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

Method Signature

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

Parameters

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

Returns

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

Example

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

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

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