Buy a NFT
Prerequisites:
Getting startedStep 1: Import the following modules
const { Client, CategoryNFT } = require("@xact-wallet-sdk/client");
require("dotenv").config();Step 2: Initializing Buy NFT
/* Update the fields with your informations */
const fromAccountId = ''; /* account Id of the buyer */
/* Account ID of the Seller */
const sellerAccountId = '';
const nftIds = ['1@0.0.123456'] /* ID of the NFTs you want to buy */
const tokenId = '' /* tokenId of the NFT */
await client.buyNFT(tokenId, {fromAccountId,sellerAccountId,nftIds});Step 3: Listen for the NFT's buy
Code Check ✅
Last updated