Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
NFT marketplace interactions with Seaport
import { Seaport } from './Seaport.js'; const seaport = Seaport({ provider, seaportAddress: SEAPORT_ADDRESS, }); // List NFT for sale const order = await seaport.createOrder({ offer: [{ itemType: 2, // ERC721 token: NFT_ADDRESS, identifier: tokenId, }], consideration: [{ itemType: 0, // ETH amount: parseEther('1'), recipient: sellerAddress, }], signer, });
// Buy NFT await seaport.fulfillOrder({ order, signer, value: parseEther('1'), }); // Fulfill with criteria (trait-based orders) await seaport.fulfillAdvancedOrder({ order, criteriaResolvers: [{ identifier: specificTokenId, proof: merkleProof, }], signer, });
// Make offer on any NFT in collection const order = await seaport.createOrder({ offer: [{ itemType: 1, // ERC20 token: WETH, amount: parseEther('0.5'), }], consideration: [{ itemType: 4, // ERC721 with criteria token: NFT_ADDRESS, identifier: 0, criteria: collectionMerkleRoot, recipient: buyerAddress, }], signer, });
Was this page helpful?
Suggestions