Skip to main content

useTotalCirculatingSupply

Hook for fetching the total number of NFTs in circulation for a given smart contract.

This takes into account the increase in supply due to minting and the decrease in supply due to burning.

Available to use on contracts that implement either the ERC721 or ERC1155 standard.

import { useTotalCirculatingSupply } from "@thirdweb-dev/react";

const { data, isLoading, error } = useTotalCirculatingSupply(contract);

Usage

Provide your NFT contract from the useContract hook as the first argument.

import { useTotalCirculatingSupply, useContract } from "@thirdweb-dev/react";

// Your smart contract address
const contractAddress = "{{contract_address}}";

function App() {
const { contract } = useContract(contractAddress);
const { data, isLoading, error } = useTotalCirculatingSupply(contract);
}

Configuration

tokenId (ERC1155 only)

tokenId (ERC1155 only)

If you are using an ERC1155 contract, provide the tokenId as the second argument.

This will return the total quantity of the given token ID in circulation.

import { useTotalCirculatingSupply, useContract } from "@thirdweb-dev/react";

// Your smart contract address
const contractAddress = "{{contract_address}}";

function App() {
const { contract } = useContract(contractAddress);
const { data, isLoading, error } = useTotalCirculatingSupply(
contract,
"{{token_id}}",
);
}

Return Value

Return Value

The hook returns a BigNumber representing the total circulating supply.

BigNumber;