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);
}
function useListingsCount(
contract: RequiredParam<Marketplace>,
): UseQueryResult<BigNumber, unknown>;

Parameters

Instance of a marketplace contract

Type

let contract: RequiredParam<Marketplace>;

Returns

let returnType: UseQueryResult<BigNumber, unknown>;

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