I tried @polkadot/util-crypto
lib and @polkadot/keyring
to convert, public key to polkadot address but no help.
Is there any method provided by the polkadot.js
?
Steps on how to get the address will also work great.
Thank you
I tried @polkadot/util-crypto
lib and @polkadot/keyring
to convert, public key to polkadot address but no help.
Is there any method provided by the polkadot.js
?
Steps on how to get the address will also work great.
Thank you
Copyright © 2021 Jogjafile Inc.
@polkadot/util-crypto
exposes the functionencodeAddress
which can input your public key bytes/hex and output an SS58 encoded address. If you want to get the address for a specific network, like Polkadot, you need to provide a secondary parameter which is the SS58 Prefix for that network. In the case of Polkadot it is 0.https://docs.substrate.io/reference/address-formats/#address-type
For example: