Skip to main content
Freezes issuer tokens for a specific wallet via the IssuerSparkWallet.

Method Signature

async freezeTokens({
  tokenIdentifier,
  sparkAddress,
}: {
  tokenIdentifier: Bech32mTokenIdentifier;
  sparkAddress: string;
}): Promise<{
  impactedTokenOutputs: TokenOutputRef[];
  impactedTokenAmount: bigint;
}>

Parameters

tokenIdentifier
Bech32mTokenIdentifier
required
The token identifier to freeze.
sparkAddress
string
required
The Spark Address to freeze

Returns

impactedTokenOutputs
TokenOutputRef[]
required
Array of token output references that were frozen. Each TokenOutputRef contains:
  • transactionHash: Uint8Array - The transaction hash
  • vout: number - The output index
impactedTokenAmount
bigint
required
Total amount of tokens frozen

Example

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

const result = await issuerWallet.freezeTokens({
  tokenIdentifier: tokenId,
  sparkAddress: "spark1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx",
});

console.log("Frozen outputs:", result.impactedTokenOutputs);
console.log("Frozen amount:", result.impactedTokenAmount);