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

Method Signature

async burnTokens({
  tokenAmount,
  tokenIdentifier,
  selectedOutputs,
}: {
  tokenAmount: bigint;
  tokenIdentifier: Bech32mTokenIdentifier;
  selectedOutputs?: OutputWithPreviousTransactionData[];
}): Promise<string>

Parameters

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

Returns

txId
string
required
Transaction ID

Example

const tokenIdentifiers = await issuerWallet.getIssuerTokenIdentifiers();
const tokenId = tokenIdentifiers[0];
if (!tokenId) {
  throw new Error("No issuer token found");
}

const txId = await issuerWallet.burnTokens({
  tokenAmount: 500n,
  tokenIdentifier: tokenId,
});

console.log("Tokens burned:", txId);