Hook for getting the winner of an auction (or english auction) on a Marketplace or MarketplaceV3 contract.
Marketplace
import { useAuctionWinner, useContract } from "@thirdweb-dev/react"; function App() { const { contract } = useContract(contractAddress, "marketplace"); const { data, isLoading, error } = useAuctionWinner( contract, listingId, // The listing id of the item that you want to get the auction winner for );}
function useAuctionWinner( contract: RequiredParam<Marketplace | MarketplaceV3>, listingId: RequiredParam<BigNumberish>,): UseQueryResult<string, unknown>;
Instance of a Marketplace or MarketplaceV3 contract
MarketplaceV3
let contract: RequiredParam<Marketplace | MarketplaceV3>;
The listing ID of the item that you want to get the auction winner for.
The listing must be an auction (or english auction) listing, the hook will populate the error property if it is not.
let listingId: RequiredParam<BigNumberish>;
let returnType: UseQueryResult<string, unknown>;
The hook's data property, once loaded, contains a string representing the address of the auction winner, or undefined if there is no winner.
data
string
undefined