useValidEnglishAuctions
Hook to get all valid English auctions from a Marketplace V3 contract.
A listing is considered valid if the:
- Auction has not expired (i.e. current time is before the end time of the auction)
- Auction has not been canceled
- Auction has not been bought out (all quantity has been sold)
Marketplace
Note: This hook is only for Marketplace V3 contracts.
For Marketplace contracts, use useActiveListings instead.
import { useValidEnglishAuctions } from "@thirdweb-dev/react";
const { data, isLoading, error } = useValidEnglishAuctions(contract);
Usage
To get a list of all valid English auctions, provide your Marketplace V3 contract instance and an optional filter object to the hook.
import { useValidEnglishAuctions, useContract } from "@thirdweb-dev/react";
// Your smart contract address
const contractAddress = "{{contract_address}}";
function App() {
const { contract } = useContract(contractAddress, "marketplace-v3");
const {
data: englishAuctions,
isLoading,
error,
} = useValidEnglishAuctions(contract);
}