Skip to main content

useTokenSupply() function

This feature is currently in beta and may change based on feedback that we receive.

Use this to get a the total supply of your contract.

Example

const { data: totalSupply, isLoading, error } = useTokenSupply(<YourTokenContractInstance>);

Signature:

export declare function useTokenSupply(
contract: RequiredParam<Erc20>,
): import("@tanstack/react-query").UseQueryResult<
{
symbol: string;
name: string;
value: import("ethers").BigNumber;
decimals: number;
displayValue: string;
},
unknown
>;

Parameters

ParameterTypeDescription
contractRequiredParam<Erc20>an instance of a ERC20 contract.

Returns:

import("@tanstack/react-query").UseQueryResult<{ symbol: string; name: string; value: import("ethers").BigNumber; decimals: number; displayValue: string; }, unknown>

a response object that incudes the total minted supply