getWalletBalance

Retrieves the balance of a token or native currency for a given wallet.

Example

import { getWalletBalance } from "thirdweb/wallets";
const balance = await getWalletBalance({
address,
client,
chain,
tokenAddress,
});
function getWalletBalance(
): Promise<GetWalletBalanceResult>;

Parameters

The options for retrieving the token balance.

Type

let options: {
address: string;
chain: Chain;
client: ThirdwebClient;
tokenAddress?: string;
};

Returns

let returnType: Promise<GetWalletBalanceResult>;

A promise that resolves to the token balance result.