useMinimumNextBid
Hook for getting the minimum value a bid must be to be valid in an auction listing on a Marketplace or MarketplaceV3 contract.
Takes into account the current highest bid, or the reserve price if there is no bid, and increments it by the bid buffer to calculate the minimum next bid.
import { useMinimumNextBid } from "@thirdweb-dev/react";
Usage
Provide your marketplace contract and the listing ID you wish to check as the arguments.
import { useContract, useMinimumNextBid } from "@thirdweb-dev/react";
const contractAddress = "{{contract_address}}";
const listingId = 0;
function App() {
const { contract } = useContract(contractAddress, "marketplace");
const { data, isLoading, error } = useMinimumNextBid(contract, listingId);
}
Configuration
listingId (required)
The ID of the listing to get the minimum next bid for.
If the listing cannot be found, is not an auction listing, or is not active, the error
property will be set.
import { useContract, useMinimumNextBid } from "@thirdweb-dev/react";
const contractAddress = "{{contract_address}}";
const listingId = "{{listing_id}}";
function App() {
const { contract } = useContract(contractAddress, "marketplace");
const { data, isLoading, error } = useMinimumNextBid(
contract,
listingId,
);
}
Return Value
The hook's data
property, once loaded, is an object containing the minimum next bid for the listing.
{
symbol: string;
value: BigNumber;
name: string;
decimals: number;
displayValue: string;
} | undefined