Withdraw a NFT from Sale
The following sample will show you how to withdraw a NFT for sale and transfer back the NFT to the seller account.
Prerequisites:
Sell a NFTStep 1: Import the following modules
Let's continue building on the index.js from the previous example (Environment Set-up) and add the following modules:
const { Client, CategoryNFT } = require("@xact-wallet-sdk/client");
require("dotenv").config();Step 2: Initializing withdraw NFT from sale
When withdrawing a NFT from sale, a request will be sent to the end user
/* Update the fields with your informations */
const tokenId = '0.0.123456'; /* token Id of the NFT */
const nftIds = ['1@0.0.123456']; /* array of the nftIds to withdraw */
await client.deleteNFTFromSale({tokenId, nftIds});Step 3: Listen for the NFT's removal
Finally get notified when your NFT has been successfully withdrawn from sale!
Code Check ✅
Your index.js file should look like this:
Last updated