Docs

useWinningBid

Hook for getting the winning bid of an auction listing on a Marketplace contract.

Example

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

Parameters

Returns

Query result object that includes the Offer that is winning the auction The hook's data property, once loaded, is an object of type Offer , or undefined if no winning bid exists.

{
// The id of the listing.
listingId: BigNumberish;
// The address of the buyer who made the offer.
buyerAddress: string;
// The quantity of tokens to be bought.
quantityDesired: BigNumberish;
// The amount of coins offered per token.
pricePerToken: BigNumber;
// The `CurrencyValue` of the listing. Useful for displaying the price information.
currencyValue: CurrencyValue;
// The currency contract address of the offer token.
currencyContractAddress: string;
} | undefined;