Hooks
Marketplace Actions
The action hooks are essential for interacting with the Marketplace in your application. Useful for making listings, making offers, and performing buy and sell actions.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
The action hooks are essential for interacting with the Marketplace in your application. Useful for making listings, making offers, and performing buy and sell actions.
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>
Show child attributes
interface useCreateListingModal {
onSuccess?: ({ hash, orderId }: {
hash?: Hash;
orderId?: string;
}) => void;
onError?: (error: Error) => void;
}
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>
Show child attributes
interface useBuyModal {
onSuccess?: ({ hash, orderId }: {
hash?: Hash;
orderId?: string;
}) => void;
onError?: (error: Error) => void;
}
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>
Show child attributes
interface useMakeOfferModal {
onSuccess?: ({ hash, orderId }: {
hash?: Hash;
orderId?: string;
}) => void;
onError?: (error: Error) => void;
}
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>
Show child attributes
interface useSellModal {
onSuccess?: ({ hash, orderId }: {
hash?: Hash;
orderId?: string;
}) => void;
onError?: (error: Error) => void;
}