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.
import { useBidBuffer } from "@thirdweb-dev/react";
const { data, isLoading, error } = useBidBuffer(contract, listingId);
Usage
Provide your marketplace contract as the first argument, and the listing ID as the second argument.
import { useBidBuffer, useContract } from "@thirdweb-dev/react";
// Your smart contract address
const contractAddress = "{{contract_address}}";
// Listing ID to get the bid buffer for
const listingId = 1;
function App() {
const { contract } = useContract(contractAddress, "marketplace");
const {
data: bidBuffer,
isLoading,
error,
} = useBidBuffer(contract, listingId);
}