useCreateListingModal
useCreateListingModalフックは、マーケットプレイスでアイテムを出品する際に使用します。新しい出品を作成・管理するために必要な機能を提供します。import { useCreateListingModal } from "@0xsequence/marketplace-sdk/react";
## Into your React component:
const { show: showListModal } = useCreateListingModal({ onError });
const onClickList = () => {
showListModal({
collectionAddress,
chainId,
collectibleId,
orderbookKind,
});
};
return <button onClick={onClickList}>List</button>
表示 子属性
表示 子属性
interface useCreateListingModal {
onSuccess?: ({ hash, orderId }: {
hash?: Hash;
orderId?: string;
}) => void;
onError?: (error: Error) => void;
}
useBuyModal
useBuyModalフックは、マーケットプレイスで販売中のNFTを購入するためのものです。購入手続きやトランザクションの実行を担当します。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>
useMakeOfferModal
useMakeOfferModalフックは、ユーザーがNFTに対してオファーを出すことを可能にします。マーケットプレイス内でオファーの作成と送信をサポートします。import { useMakeOfferModal } from "@0xsequence/marketplace-sdk/react";
## Into your React component:
const { show: showOfferModal } = useMakeOfferModal({
onError,
});
const onClickOffer = () => {
showOfferModal({
collectionAddress,
chainId,
collectibleId,
orderbookKind,
});
};
return <button onClick={onClickOffer}>Make Offer</button>
表示 子属性
表示 子属性
interface useMakeOfferModal {
onSuccess?: ({ hash, orderId }: {
hash?: Hash;
orderId?: string;
}) => void;
onError?: (error: Error) => void;
}
useSellModal
useSellModalフックは、既存のオファーを受け入れてNFTを販売する際に使用します。販売手続きを完了するための機能を提供します。import { useSellModal } from "@0xsequence/marketplace-sdk/react";
## Into your React component:
const { show: showSellModal } = useSellModal({ onError });
const onAcceptOffer = () => {
showSellModal({
collectionAddress,
chainId,
tokenId,
order,
});
};
return <button onClick={onAcceptOffer}>Accept Offer</button>
表示 子属性
表示 子属性
interface useSellModal {
onSuccess?: ({ hash, orderId }: {
hash?: Hash;
orderId?: string;
}) => void;
onError?: (error: Error) => void;
}