Skip to content
Get startedGetting started →

getSolanaAddress

Derives the Solana address for an Ed25519 public key: the public key itself, base58-encoded.

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"
  • Type: Uint8Array
  • Required

A 32-byte Ed25519 public key.

A SolanaAddress, a branded string type.