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);
}
function useEnglishAuctionWinningBid(
contract: RequiredParam<MarketplaceV3>,
auctionId: RequiredParam<BigNumberish>,
): UseQueryResult<undefined | Bid, unknown>;

Parameters

Instance of a marketplace contract

Type

let contract: RequiredParam<MarketplaceV3>;

The auction id to check If the listing cannot be found, or is not an English auction, the error property will be set.

Type

let auctionId: RequiredParam<BigNumberish>;

Returns

let returnType: UseQueryResult<undefined | Bid, unknown>;

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;
}
}