Skip to main content

UtilsNamespace.getTokensBalance() method

Retrieves the balances of tokens owned by an address.

Signature:

getTokensBalance(addressToCheck: string, contractAddresses?: string[]): Promise<BalanceResult[]>;

Parameters

ParameterTypeDescription
addressToCheckstringThe address for which to retrieve the token balances.
contractAddressesstring[](Optional) An array of contract addresses to filter the token balances. If not provided, retrieves balances for all tokens.

Returns:

Promise<BalanceResult[]>

An array of BalanceResults, each containing the symbol, amount, and contract address of a token balance.