Freezes issuer’s tokens for a specific wallet via the IssuerSparkWallet.
Method Signature
// Single-token issuer (positional parameter)
async freezeTokens(sparkAddress: string): Promise<{
impactedOutputIds: string[];
impactedTokenAmount: bigint;
}>
// Multi-token issuer (object parameters)
async freezeTokens({
tokenIdentifier,
sparkAddress,
}: {
tokenIdentifier: Bech32mTokenIdentifier;
sparkAddress: string;
}): Promise<{
impactedOutputIds: string[];
impactedTokenAmount: bigint;
}>
Parameters
Single-token issuer
The Spark Address to freeze
Multi-token issuer
tokenIdentifier
Bech32mTokenIdentifier
required
The token identifier to freeze. Required for multi-token issuers.
The Spark Address to freeze
Returns
Array of output IDs that were frozen
Total amount of tokens frozen
Example
// Single token issuer (simple positional parameter)
const result = await issuerWallet.freezeTokens(
"spark1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"
);
console.log("Frozen outputs:", result.impactedOutputIds);
console.log("Frozen amount:", result.impactedTokenAmount);
// Multi-token issuer (specify which token with object parameters)
const tokenId = await issuerWallet.getIssuerTokenIdentifier();
const result2 = await issuerWallet.freezeTokens({
tokenIdentifier: tokenId,
sparkAddress: "spark1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"
});