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 { contract } = useContract(<ContractAddress>);
const { data: totalSupply, isLoading, error } = useTokenSupply(contract);

Signature:

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

Parameters

ParameterTypeDescription
contractRequiredParam<TokenContract>an instance of a TokenContract

Returns:

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

a response object that incudes the total minted supply