useListingsCount

Hook for getting the total number of listings on a Marketplace contract.

This hook is only available for Marketplace contracts

If you are using Marketplace V3 , use useDirectListingsCount or useEnglishAuctionsCount instead.

Example

import { useContract, useListingsCount } from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress, "marketplace");
const {
data: listingsCount,
isLoading,
error,
} = useListingsCount(contract);
}

Parameters

Returns

The hook's data property, once loaded, is a BigNumber containing the total number of listings on the contract.