Encryption in browser with wallet & extension
Creating a secret NFT in a browser environment
This section provides a comprehensive guide on creating a Secret NFT on the Ternoa chain without using a SEED to retrieve the signer keyring. To successfully follow this process, it is recommended that you have a basic understanding of the concepts explained step by step in the following pages:
Suppose this is your first time interacting with the Ternoa chain in a browser environment and using a wallet or extension to sign a transaction. In that case, it is advisable to begin with a simpler code example and read through this section beforehand.
We also assume you are familiar with the Ternoa IPFS client. Use the Ternoa IPFS node endpoint, with a key generated from our key generator, or your own storage provider. Read more about the Ternoa IPFS client. Read more about storage options.
Utilizing Polkadot extension, Next.js, and TypeScript:
In the following code snippet, we will walk through a step-by-step process for a use case to create a Secret NFT on the chain. This involves using the @polkadot/extension-dapp and uploading your files and metadata to IPFS.
It's important to note that this solution is not the only option available. Feel free to choose any provider that best suits your dApp and adjust your code accordingly to match your technical stack.
This code snippet is specifically designed to function within a Next.js environment. Depending on Next.js server-side component rules, you may need to make slight adaptations when importing the @polkadot/extension-dapp extension library to work seamlessly in your JavaScript environment.
We suggest breaking down certain portions of this function into multiple modular and reusable atomic functions. This example illustrates a comprehensive and complete workflow to enhance comprehension.
Last updated