List an NFT for sale on a marketplace
Prerequisites
List for sale an NFT on a marketplace using Ternoa-JS
import {
listNft,
initializeApi,
getKeyringFromSeed,
WaitUntil,
} from "ternoa-js";
const listNftOnMp = async () => {
try {
await initializeApi();
const keyring = await getKeyringFromSeed("//TernoaTestAccount");
const NFT_ID = // update with the nft id you want to list for sale.
const MARKETPLACE_ID = // update with the marketplace id you want the NFT to be listed on.
const res = await listNft(
NFT_ID,
MARKETPLACE_ID,
price,
keyring,
WaitUntil.BlockInclusion
);
console.log(`NFT id: ${res.nftId} listed on marketplace ${res.marketplaceId} for ${res.priceRounded}CAPS`);
} catch (e) {
console.error(e);
}
};The expected params
Response
Unlist an NFT on a marketplace using Ternoa-JS
The expected params
Response
Support
Last updated