Skip to main content

Mint NFTs

Online Faucet

You can request test funds from the Shimmer Testnet Faucet.

You can use a node running the stardust update to mint non-fungible tokens (NFTs). To do so, you will only need to add some funds to your account, define the native token's options and call the Account.mint_nfts(nft_options, options) function.

Iota.js

You can also find this guide in the native iota.js library

Code Example

The following example will:

  1. Create an account manager.
  2. Get Alice's which was created in the first guide.
  3. Create the NftOptions.
  4. Mint the NFT by calling the Account.mint_nfts(nft_options, options) function.
Dotenv

This example uses dotenv, which is not safe for use in production environments.

wallet/examples/10_mint_nft.rs
loading...

Run the example by running the following command:

cargo run --example mint_nft --release

Expected Output

Transaction: 0x0ba6e5d164f4c5ba0e16d9ba42852fa9fa19989956632444fe3ef0bf9d12737c
Block sent: http://localhost:14265/api/core/v2/blocks/0x7d9e46cd59119c6b00f2affd88fe497276b5f6f97874e2ca42e4dae9651d1be2
Transaction: 0xf99a245889f942084b6d9d216c61f2dcb42b6b14fb595bdc92322e87caaa6bbc
Block sent: http://localhost:14265/api/core/v2/blocks/0xce3b0f453f935288356bbfdc43f217b29e3a0ff1f7f08459d08e091c941da4b4