Directly buy an auctioned NFT
Prerequisites
Buy directly an auctioned NFT using Ternoa-JS
import {
buyItNow,
initializeApi,
getKeyringFromSeed,
WaitUntil,
} from "ternoa-js";
const auctionBid = async () => {
try {
await initializeApi();
const keyring = await getKeyringFromSeed("//TernoaTestAccount");
const NFT_ID = // update with the nft id you want to buy.
const res = await buyItNow(
NFT_ID,
keyring,
WaitUntil.BlockInclusion
);
console.log(`BuyItNow_Auction: NFT id ${res.nftId} bought for ${res.amountRounded}CAPS`);
} catch (e) {
console.error(e);
}
};The expected params
Response
Support
Last updated