useAcceptDirectListingOffer
Accept a specific offer on a direct listing
will accept the latest offer by the given offeror.
Example
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>
);
};
Parameters
Returns
a mutation object that can be used to accept an offer on a direct listing