Skip to main content
Gets statistics about token outputs in the wallet.

Method Signature

async getTokenOutputStats(
  tokenIdentifier?: Bech32mTokenIdentifier
): Promise<{
  outputCount: number;
  totalAmount: bigint;
}>

Parameters

tokenIdentifier
Bech32mTokenIdentifier
Optional token identifier to get stats for. If not provided, returns stats for all tokens.

Returns

outputCount
number
required
Number of token outputs
totalAmount
bigint
required
Total amount across all outputs

Example

// Get stats for a specific token
const stats = await wallet.getTokenOutputStats("btkn1...");
console.log("Output count:", stats.outputCount);
console.log("Total amount:", stats.totalAmount);

// Get stats for all tokens
const allStats = await wallet.getTokenOutputStats();
console.log("All token outputs:", allStats.outputCount);