1

I can't find any docs about more details than. https://wiki.iota.org/shimmer/iota.rs/how_tos/build_nft_output/#expected-output

I was looking for something like this: https://explorer.shimmer.network/shimmer/transaction/0x69793f7d48ab8f96e05e66495f606a708ad0b71a6064f82d78a5db8061e20231 where I have to set all these parameters:

{
  "standard": "IRC27",
  "version": "v1.0",
  "type": "video/mp4",
  "uri": "https://ipfs.io/ipfs/QmPoYcVm9fx47YXNTkhpMEYSxCD3Bqh7PJYr7eo5YjLgiT",
  "name": "Shimmer OG NFT #304",
  "description": "The Shimmer OG NFT celebrates the official launch of the Shimmer Network on the 28th September 2022.",
  "issuerName": "IOTA Foundation",
  "collectionId": "0xf8757e1cc7ed608efe7d2cc3fa1ea78f44015c5e56d15424516ca9349a2bdfae",
  "collectionName": "Shimmer OG NFT Collection"
}

2 Answers 2

2

Thats just additional metadata following the IRC27 standard. You can read more about the standards for NFTs and Foundry Outputs here:

https://wiki.iota.org/shimmer/tips/tips/TIP-0027/ https://wiki.iota.org/shimmer/tips/tips/TIP-0030/

In python it would look like this:

nft_output = client.build_nft_output(
unlock_conditions=[
    {
        "type": 0,
        "address": {
            "type": 0,
            "pubKeyHash": client.bech32_to_hex("rms1qzpf0tzpf8yqej5zyhjl9k3km7y6j0xjnxxh7m2g3jtj2z5grej67sl6l46"),
        },
    },
],
# Nft Id needs to be set to 0 when minting
nft_id="0x0000000000000000000000000000000000000000000000000000000000000000",
amount='1000000',
immutable_features=[
    {
        "type": 2,
        # IRC27 metadata hex encoded
        "data": "0x7b227374616e64617264223a224952433237222c2276657273696f6e223a2276312e30222c2274797065223a22766964656f2f6d7034222c22757269223a2268747470733a2f2f697066732e696f2f697066732f516d506f5963566d396678343759584e546b68704d4559537843443342716837504a597237656f35596a4c676954222c226e616d65223a225368696d6d6572204f47204e46542023333034222c226465736372697074696f6e223a22546865205368696d6d6572204f47204e46542063656c6562726174657320746865206f6666696369616c206c61756e6368206f6620746865205368696d6d6572204e6574776f726b206f6e2074686520323874682053657074656d62657220323032322e222c226973737565724e616d65223a22494f544120466f756e646174696f6e222c22636f6c6c656374696f6e4964223a22307866383735376531636337656436303865666537643263633366613165613738663434303135633565353664313534323435313663613933343961326264666165222c22636f6c6c656374696f6e4e616d65223a225368696d6d6572204f47204e465420436f6c6c656374696f6e22207d"
    }
]

)

0

This is an example of how I mint a NFT collection in Python

import os
import json
import time
from dotenv import load_dotenv
from iota_wallet import IotaWallet
import random

load_dotenv()

shimmer_mnemonic = os.getenv("SHIMMER_MNEMONIC")
stronghold_password = os.getenv("STRONGHOLD_PASSWORD")
wallet_db_name = os.getenv("WALLET_DB_NAME")
shimmer_account_name = os.getenv("SHIMMER_ACCOUNT_NAME")
stronghold_db_name = os.getenv("STRONGHOLD_DB_NAME")

# In this example we will mint an nft
client_options = {
    'nodes': ['https://api.testnet.shimmer.network'],
}
wallet = IotaWallet(wallet_db_name, client_options)

account = wallet.get_account(shimmer_account_name)

# Sync account with the node
response = account.sync()
print(f'Synced: {response}')

wallet.set_stronghold_password(stronghold_password)

nft_collection_size = 30  # 10 NFTs in the collection
issuer_nft_id = "rms1zpzck5vsgzlc8snf3w20z852sntyq3uxed80l46afnsj5zulms3fu4837s2"
# Create the metadata with another index for each
nft_options = []
for index in range(nft_collection_size):
    nft_number = index + 1
    attribue_value = random.randint(42, 69)
    immutable_metadata = bytes(json.dumps({
        "standard": "IRC27",
        "version": "v1.0",
        "type": "image/png",
        "uri": "ipfs://bafybeicnznoiprv5udy36wlrhqffa7evyaodewea343dnavgt3aqn4gwbm",
        "name": f"Mudskipper #{nft_number}",
        "description": "The Mudskipper",
        "issuerName": "The Queen",
        "collectionName": "The 30y old virgin collection",
        "attributes": [
            {
            "trait_type": "Rarity",
            "value": f"{attribue_value}"
            }
        ]
    }).encode('utf-8')).hex()


    print(f"immutableMetadata: {immutable_metadata}")


    combined_metadata = "0x" + immutable_metadata

    nft_options.append({
    "immutableMetadata": combined_metadata,
    "issuer": issuer_nft_id,
    })
    print(f'NFT Options: {nft_options}')


for nfts in [nft_options[i:i+50] for i in range(0, len(nft_options), 50)]:
    transaction = account.mint_nfts(nft_options)


print(f'Sent transaction: {transaction}')

You can see specifically how the metadata is built here

# Create the metadata with another index for each
nft_options = []
for index in range(nft_collection_size):
    nft_number = index + 1
    attribue_value = random.randint(42, 69)
    immutable_metadata = bytes(json.dumps({
        "standard": "IRC27",
        "version": "v1.0",
        "type": "image/png",
        "uri": "ipfs://bafybeicnznoiprv5udy36wlrhqffa7evyaodewea343dnavgt3aqn4gwbm",
        "name": f"Mudskipper #{nft_number}",
        "description": "The Mudskipper",
        "issuerName": "The Queen",
        "collectionName": "The 30y old virgin collection",
        "attributes": [
            {
            "trait_type": "Rarity",
            "value": f"{attribue_value}"
            }
        ]
    }).encode('utf-8')).hex()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.