Skip to main content
Deprecated: Use getIssuerTokensMetadata() instead for multi-token support.
Gets the metadata about the token for the IssuerSparkWallet. Throws an error if the issuer has multiple tokens.
As an issuer, to get your token public key, you can call getIssuerTokenMetadata() or getIdentityPublicKey(). For frequent retrieval, use getIdentityPublicKey() since it doesn’t require a network call.

Method Signature

interface IssuerTokenMetadata {
  tokenPublicKey: string;            // Issuer's public key (same as identity public key)
  rawTokenIdentifier: Uint8Array;    // Binary token identifier
  tokenName: string;
  tokenTicker: string;               // Token ticker symbol (e.g., "USDT")
  decimals: number;                  // Number of decimal places
  maxSupply: bigint;
  isFreezable: boolean;
  extraMetadata?: Uint8Array;        // Arbitrary bytes set during token creation
}

async function getIssuerTokenMetadata(): Promise<IssuerTokenMetadata>;

Returns

metadata
IssuerTokenMetadata
required
Object containing complete token metadata

Example

const metadata = await issuerWallet.getIssuerTokenMetadata();
console.log("Token name:", metadata.tokenName);
console.log("Token ticker:", metadata.tokenTicker);
console.log("Decimals:", metadata.decimals);
console.log("Max supply:", metadata.maxSupply);
console.log("Is freezable:", metadata.isFreezable);

// Check for extra metadata
if (metadata.extraMetadata) {
  console.log("Extra metadata:", metadata.extraMetadata);
}