useListingsCount
Hook for getting the total number of listings on a Marketplace contract.
Marketplace V3
Note: this hook is only available for Marketplace contracts.
If you are using Marketplace V3, use useListingsCount or useEnglishAuctionsCount instead.
import { useListingsCount } from "@thirdweb-dev/react";
const { data: listingsCount, isLoading, error } = useListingsCount(contract);
Usage
Provide your marketplace contract as the argument.
import { useContract, useListingsCount } from "@thirdweb-dev/react";
const contractAddress = "{{contract_address}}";
function App() {
const { contract } = useContract(contractAddress, "marketplace");
const { data: listingsCount, isLoading, error } = useListingsCount(contract);
}