Delegate/Undelegate an NFT
Ternoa provides you with many NFT features. Not only creating an NFT can be done in just a few lines of code but we also cover many NFT basic use cases: Ternoa allows you to easily create functions to delegate, transfer, burn an NFT, or even set the NFT royalty without using any smart contracts.
Prerequisites
Before getting started, make sure you have the following ready:
Create a Ternoa account with Alphanet CAPS
Install and set up your editor of choice (we will use Visual Studio Code [VSC] in this tutorial)
Install NodeJS v.14+ & NPM
How to delegate an NFT using Ternoa-JS
This function delegates an NFT to someone else on the Ternoa chain. It returns an object promise containing the NFTDelegatedEvent provided by the Ternoa blockchain. Use your own account by updating the //TernoaTestAccount with your account seed when retrieving the keyring from the example below. Since you are willing to delegate your NFT to someone else, replace both variables delegatee and NFT_ID with the data of your choice.
The expected params
Response
The response provided from the blockchain event includes all the information below according to the parameters provided when delegating/undelegating the NFT.
How to undelegate an NFT using Ternoa-JS
To undelegate a delegated NFT, you just need to run the same function as before and replace the delegate variable with undefined.
Support
If you face any trouble, feel free to reach out to our community engineers in our Discord.
Last updated