Docs

useEnglishAuctionWinningBid

Hook to get the winning bid for an English auction listing from a Marketplace V3 contract.

Example

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

Parameters

Returns

If there are no bids, the data property will be undefined . Use the isLoading property to differentiate between the loading state and the no bids state.

If there is a bid, the hook's data property, once loaded, will be an object of type Bid , containing the following properties:

{
// The id of the auction.
auctionId: string;
// The address of the buyer who made the offer.
bidderAddress: string;
// The currency contract address of the offer token.
currencyContractAddress: string;
// The amount of coins offered per token.
bidAmount: string;
// The `CurrencyValue` of the listing. Useful for displaying the price information.
bidAmountCurrencyValue: {
symbol: string;
value: BigNumber;
name: string;
decimals: number;
displayValue: string;
}
}