decimals

Retrieves the number of decimal places for a given ERC20 contract.

Example

import { decimals } from "thirdweb/extensions/erc20";
const tokenDecimals = await decimals({ contract });
function decimals(options: BaseTransactionOptions): Promise<number>;

Parameters

The options for the transaction.

Type

let options: { contract: ThirdwebContract<abi> } & T;

Returns

let returnType: Promise<number>;

A promise that resolves to the number of decimal places.