an instance of a Marketplace contract
a mutation object that can be used to accept an offer on a direct listing
will accept the latest offer by the given offeror.
const Component = () => {
const { contract } = useContract("{{contract_address}}");
const {
mutate: acceptOffer,
isLoading,
error,
} = useAcceptDirectListingOffer(contract);
if (error) {
console.error("failed to accept offer", error);
}
return (
<button
disabled={isLoading}
onClick={() => acceptOffer({ listingId: 1, addressOfOfferor: "{{wallet_address}}" })}
>
Accept offer
</button>
);
};
Generated using TypeDoc
Accept a specific offer on a direct listing