Documentation Index Fetch the complete documentation index at: https://sequence-0fb8d9e6-unreal-quickstart-with-marketplace.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
useCreateListingModal
The useCreateListingModal hook is used to list an item for sale on the Marketplace. It provides the necessary functionality to create and manage a new listing.
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 ;
}
show
(args: ShowCreateListingModalArgs) => void
interface ShowCreateListingModalArgs {
collectionAddress : Hex ;
chainId : string ;
collectibleId : string ;
orderbookKind ?: OrderbookKind ;
callbacks ?: ModalCallbacks ;
}
useBuyModal
The useBuyModal hook allows users to purchase an NFT that is listed for sale on the Marketplace. It handles the buying process and transaction execution.
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 >
interface useBuyModal {
onSuccess ?: ({ hash , orderId } : {
hash ?: Hash ;
orderId ?: string ;
}) => void ;
onError ?: ( error : Error ) => void ;
}
show
(args: ShowBuyModalArgs) => void
interface ShowBuyModalArgs {
chainId : string ;
collectionAddress : Hex ;
tokenId : string ;
order : Order ;
}
useMakeOfferModal
The useMakeOfferModal hook enables users to place an offer on an NFT. It facilitates creating and submitting offers within the Marketplace.
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 ;
}
show
(args: ShowMakeOfferModalArgs) => void
interface ShowMakeOfferModalArgs {
collectionAddress : Hex ;
chainId : string ;
collectibleId : string ;
orderbookKind ?: OrderbookKind ;
callbacks ?: ModalCallbacks ;
}
useSellModal
The useSellModal hook is used to sell an NFT by accepting an existing offer. It provides the necessary functionality to complete the selling process.
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 ;
}
show
(args: ShowSellModalArgs) => void
interface ShowSellModalArgs {
collectionAddress : Hex ;
chainId : string ;
tokenId : string ;
order : Order ;
callbacks ?: ModalCallbacks ;
}