I can get public key from wallet adapter, so how to convert it to address in Solana ?
1 Answer
The terms ‘public key’ and ‘address’ are interchangeable. The public key of a wallet is the wallet’s address.
At a fundamental level, the address is a 256-bit number. In practice you see addresses encoded in various formats, like base58 or base64.
Given a PublicKey
object from @solana/wallet-adapter
you can obtain its base58 representation like this:
const base58Pubkey = publicKey.toBase58();
.toString()
method.