Docs

useOffers

Hook for getting all of the offers made on a direct listing on a Marketplace contract.

Example

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

Parameters

Returns

This hook uses the useEvents hook under the hood to fetch NewOffer events for the given listing ID.

The return value is an array of NewOffer event objects. Each event object has the following properties:

{
offeror: string;
offerId: BigNumber;
assetContract: string;
offer: {
offerId: BigNumber;
offeror: string;
assetContract: string;
tokenId: BigNumber;
quantity: BigNumber;
currency: string;
totalPrice: BigNumber;
expirationTimestamp: BigNumber;
tokenType: "ERC721" | "ERC1155";
status: "UNSET" | "CREATED" | "COMPLETED" | "CANCELLED";
}
}