getSolanaAddress
Derives the Solana address for an Ed25519 public key: the public key itself, base58-encoded.
Import
Section titled “Import”import { getSolanaAddress } from "@category-labs/mera";import { createEd25519SigningSession, getSolanaAddress,} from "@category-labs/mera";
const session = createEd25519SigningSession({ privateKey: crypto.getRandomValues(new Uint8Array(32)),});
const address = getSolanaAddress(session.publicKey);// base58, like "7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV"Parameters
Section titled “Parameters”publicKey
Section titled “publicKey”- Type:
Uint8Array - Required
A 32-byte Ed25519 public key.
Returns
Section titled “Returns”A SolanaAddress, a branded string type.
Errors
Section titled “Errors”INPUT_INVALID:publicKeyis not 32 bytes.