Delegate/Undelegate an NFT
Prerequisites
How to delegate an NFT using Ternoa-JS
import {
delegateNft,
initializeApi,
getKeyringFromSeed,
WaitUntil,
} from "ternoa-js";
const delegateNFT = async () => {
try {
await initializeApi();
const keyring = await getKeyringFromSeed("//TernoaTestAccount");
const delegatee = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"; // The destination account address.
const NFT_ID = 1; // the NFT id you want to delegate
const nftData = await delegateNft(
NFT_ID,
delegatee,
keyring,
WaitUntil.BlockInclusion
);
console.log(`NFT ${nftData.nftId} delegated to : ${nftData.recipient}`);
} catch (e) {
console.error(e);
}
};The expected params
Response
How to undelegate an NFT using Ternoa-JS
Support
Last updated