Skip to main content
Burns existing tokens to reduce the circulating supply for the IssuerSparkWallet.

Method Signature

// Single-token issuer (positional parameter)
async burnTokens(
  amount: bigint,
  selectedOutputs?: OutputWithPreviousTransactionData[]
): Promise<string>

// Multi-token issuer (object parameters)
async burnTokens({
  tokenAmount,
  tokenIdentifier,
  selectedOutputs,
}: {
  tokenAmount: bigint;
  tokenIdentifier: Bech32mTokenIdentifier;
  selectedOutputs?: OutputWithPreviousTransactionData[];
}): Promise<string>

Parameters

Single-token issuer

amount
bigint
required
The amount to burn (e.g., 1000n)
selectedOutputs
OutputWithPreviousTransactionData[]
Optional specific outputs to use for the burn operation

Multi-token issuer

tokenAmount
bigint
required
The amount to burn (e.g., 1000n)
tokenIdentifier
Bech32mTokenIdentifier
required
The token identifier to burn. Required for multi-token issuers.
selectedOutputs
OutputWithPreviousTransactionData[]
Optional specific outputs to use for the burn operation

Returns

txId
string
required
Transaction ID

Example

// Single token issuer (simple positional parameter)
const txId = await issuerWallet.burnTokens(1000n);
console.log("Tokens burned:", txId);

// Multi-token issuer (specify which token with object parameters)
const tokenId = await issuerWallet.getIssuerTokenIdentifier();
const txId2 = await issuerWallet.burnTokens({
  tokenAmount: 500n,
  tokenIdentifier: tokenId
});