Skip to main content

Prepare Your Development Environment

To run the code in this tutorial, you will need the following:

(optional) Download the Code

You can download the tutorials codebase to follow while you read the next sections.

Running Code Examples

If you plan on using the provided code example, please read the article How To Run Code Examples.

Shimmer Addresses and Outputs

The tutorial's codebase uses several predefined Shimmer addresses and outputs. If you use other addresses, you will need to update the code accordingly. Likewise, the tutorial codebase assumes a particular state of the addresses and outputs. Before executing the code, please ensure your addresses and outputs are in the expected state.

Available Commands

Mint new NFT

You can run the mint-nft script by running the following command from the example's directory:

npm run mint-nft

NFT Transaction

You can run the nft-transaction script by running the following command from the example's directory:

npm run nft-transaction

NFT Claim

You can run the claim-nft script by running the following command from the example's directory:

npm run claim-nft

Create Your package.json File

You can create your package.json file from the example below and place it in your projects base directory:

{
"name": "tutorial-nft",
"type": "module",
"version": "1.0.0",
"scripts": {
"dist": "tsc",
"mint-nft": "node dist/mint-new-nft",
"nft-transaction": "node dist/nft-transaction",
"claim-nft": "node dist/claim-nft"
},
"dependencies": {
"@iota/crypto.js": "2.0.0-rc.1",
"@iota/iota.js": "2.0.0-rc.2",
"@iota/util.js": "2.0.0-rc.1",
"@iota/pow-neon.js": "2.0.0-rc.2"
},
"devDependencies": {
"typescript": "^4.4.3",
"@types/node": "18.7.23"
}
}

After you have created the package.json file, you can install all the necessary dependencies by running the following command from the same directory:

npm install

Troubleshooting

If you are getting any errors during the installation process, please make sure your system is using Node.js 16. You can check your node version by running the following command:

node -v