Copy
Ask AI
import { useBuyModal } from "@0xsequence/marketplace-sdk/react";
## Into your React component:
const { show: showBuyModal } = useBuyModal({
onSuccess(hash) {
console.log("Buy transaction sent with hash: ", hash);
},
onError,
});
const onClickBuy = () => {
showBuyModal({
chainId,
collectionAddress,
tokenId,
order,
});
};
return <button onClick={onClickBuy}>Buy</button>
useBuyModal
* params
Show child attributes
Show child attributes
Copy
Ask AI
interface useBuyModal {
onSuccess?: ({ hash, orderId }: {
hash?: Hash;
orderId?: string;
}) => void;
onError?: (error: Error) => void;
}
* return properties