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

Method Signature

// Single-token issuer (positional parameter) - DEPRECATED
async freezeTokens(sparkAddress: string): Promise<{
  impactedTokenOutputs: TokenOutputRef[];
  impactedTokenAmount: bigint;
}>

// Multi-token issuer (object parameters)
async freezeTokens({
  tokenIdentifier,
  sparkAddress,
}: {
  tokenIdentifier: Bech32mTokenIdentifier;
  sparkAddress: string;
}): Promise<{
  impactedTokenOutputs: TokenOutputRef[];
  impactedTokenAmount: bigint;
}>
Deprecated: The single-parameter overload freezeTokens(sparkAddress: string) is deprecated. Use freezeTokens({ tokenIdentifier, sparkAddress }) instead. This method will be removed in a future version.

Parameters

Single-token issuer

sparkAddress
string
required
The Spark Address to freeze

Multi-token issuer

tokenIdentifier
Bech32mTokenIdentifier
required
The token identifier to freeze. Required for multi-token issuers.
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

// Recommended: Multi-token issuer (specify which token with object parameters)
const tokenId = await issuerWallet.getIssuerTokenIdentifier();
const result = await issuerWallet.freezeTokens({
  tokenIdentifier: tokenId,
  sparkAddress: "spark1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"
});
console.log("Frozen outputs:", result.impactedTokenOutputs);
console.log("Frozen amount:", result.impactedTokenAmount);

// Deprecated: Single token issuer (simple positional parameter)
const result2 = await issuerWallet.freezeTokens(
  "spark1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"
);