Beta
an instance of a MarketplaceV3 contract
a mutation object that can be used to buy out a direct listing
const Component = () => {
const { contract } = useContract("{{contract_address}}", "marketplace-v3");
const {
mutate: buyNow,
isLoading,
error,
} = useBuyDirectListing(contract);
if (error) {
console.error("failed to buy direct listing", error);
}
return (
<button
disabled={isLoading}
onClick={() => buyNow({listingId: 1, quantity: 1, buyer: "{{address}}"})}
>
Buy listing!
</button>
);
};
Generated using TypeDoc
Buy a direct listing