useBidBuffer

Hook for determining the current bid buffer on a Marketplace or Marketplace V3 contract.

The bid buffer is what percentage higher the next bid must be than the current highest bid, or the starting price if there are no bids.

Example

import { useBidBuffer, useContract } from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress, "marketplace");
const {
data: bidBuffer,
isLoading,
error,
} = useBidBuffer(contract, listingId);
function useBidBuffer(
contract: RequiredParam<Marketplace | MarketplaceV3>,
listingId?: RequiredParam<BigNumberish>,
): UseQueryResult<BigNumber, unknown>;

Parameters

Instance of a Marketplace or MarketplaceV3 contract

Type

let contract: RequiredParam<Marketplace | MarketplaceV3>;

The listing ID of the item that you want to get the bid buffer for. The listing must be an auction (or english auction) listing, the hook will populate the error property if it is not.

Type

let listingId: RequiredParam<BigNumberish>;

Returns

let returnType: UseQueryResult<BigNumber, unknown>;

The hook's data property, once loaded, returns a BigNumber value representing the current bid buffer.

The bidBuffer value returned is in percentage format. For example, a value of 500 means that the next bid must be 5% higher than the current highest bid.