Mint a Soulbound NFT
A soulbound token (SBT) is a unique and indivisible Basic NFT that is bound to a specific account and cannot be traded or transferred to another account once it has been received from the creator.
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
Minting a Soulbound NFT on-chain using Ternoa-JS
To create an NFT on the Ternoa chain, Ternoa-JS provides you with a createNft
helper to do so. It returns an object promise containing the NFTCreatedEvent
returned by the Ternoa blockchain. The only difference with a Basic NFT creation is to set the 4th parameter isSoulbound to true.
Replace IPFS_CID in the following code snippet with your CID hash previously generated in Prepare Soulbound NFT assets:
Use your own account by updating the //TernoaTestAccount
with your account seed when retrieving the keyring from the example below.
Here are detailed the createNft
helper parameters:
The response returned includes an NFTCreatedEvent
if the transaction succeeds. The particularity here is that the isSoulbound field is true. Note that MintFee
refers to the fee paid to mint the NFT in Big Number format (MintFeeRounded
is the humanized format, easier and more friendly to use).
Next
The next step will be getting the NFT data from the Ternoa Indexer using the NFT id just generated. Keep it and continue on the Retrieve a Soulbound NFT guide.
Support
If you face any trouble, feel free to reach out to our community engineers in our Discord.
Last updated