I'm trying to get the associated KSM address for a generic address. I was wondering if there was a simple way to do this using polkadot-js library
2 Answers
const { encodeAddress } = polkadotUtilCrypto;
let kusama_prefix = 2;
let kusama_address = encodeAddress(generic_address, kusama_prefix);
For example:
polkadotUtilCrypto.encodeAddress("5DksjtJER6oLDWkWKCWcL3f1swPWeNNFsS9zHxa2rPa7LsH9", 2)
> "EGVQCe73TpFyAZx5uKfE1222XfkT3BSKozjgcqzLBnc5eYo"
These are not in Polkadot{.js} API, however they are simple to use: