useListings
Hook for getting all listings (including expired ones) from a Marketplace contract.
Marketplace V3
Note: this hook is only available for Marketplace contracts.
If you are using Marketplace V3, use useDirectListings or useEnglishAuctions instead.
import { useListings } from "@thirdweb-dev/react";
const { data, isLoading, error } = useListings(contract);
Usage
Provide your marketplace contract and an optional filter you wish to use as the arguments.
import { useContract, useListings } from "@thirdweb-dev/react";
const contractAddress = "{{contract_address}}";
function App() {
const { contract } = useContract(contractAddress, "marketplace");
const { data, isLoading, error } = useListings(contract);
}