Unfreezes issuer’s tokens for a specific wallet via the IssuerSparkWallet.
Method Signature
// Single-token issuer (positional parameter) - DEPRECATED
async unfreezeTokens(sparkAddress: string): Promise<{
impactedTokenOutputs: TokenOutputRef[];
impactedTokenAmount: bigint;
}>
// Multi-token issuer (object parameters)
async unfreezeTokens({
tokenIdentifier,
sparkAddress,
}: {
tokenIdentifier: Bech32mTokenIdentifier;
sparkAddress: string;
}): Promise<{
impactedTokenOutputs: TokenOutputRef[];
impactedTokenAmount: bigint;
}>
Deprecated: The single-parameter overload unfreezeTokens(sparkAddress: string) is deprecated. Use unfreezeTokens({ tokenIdentifier, sparkAddress }) instead. This method will be removed in a future version.
Parameters
Single-token issuer
The Spark Address to unfreeze
Multi-token issuer
tokenIdentifier
Bech32mTokenIdentifier
required
The token identifier to unfreeze. Required for multi-token issuers.
The Spark Address to unfreeze
Returns
Array of token output references that were unfrozen. Each TokenOutputRef contains:
transactionHash: Uint8Array - The transaction hash
vout: number - The output index
Total amount of tokens unfrozen
Example
// Recommended: Multi-token issuer (specify which token with object parameters)
const tokenId = await issuerWallet.getIssuerTokenIdentifier();
const result = await issuerWallet.unfreezeTokens({
tokenIdentifier: tokenId,
sparkAddress: "spark1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"
});
console.log("Unfrozen outputs:", result.impactedTokenOutputs);
console.log("Unfrozen amount:", result.impactedTokenAmount);
// Deprecated: Single token issuer (simple positional parameter)
const result2 = await issuerWallet.unfreezeTokens(
"spark1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx"
);