getBalance

Retrieves the balance of an ERC20 token for a specific address.

Example

import { getBalance } from "thirdweb/extensions/erc20";
const balance = await getBalance({ contract, address: "0x..." });
function getBalance(
): Promise<GetBalanceResult>;

Parameters

The transaction options including the address.

Type

Returns

let returnType: {
decimals: number;
displayValue: string;
name: string;
symbol: string;
value: bigint;
};

An object containing the balance value, display value, and symbol.