Build > dApp Development > dApp Transactions > Examples > Non-Fungible Resource Creation β View on GitHub
It is possible to create non-fungible resources with transactions, but it is quite hard to create them manually - this is because a non-fungible resource includes a Scrypto SBOR Schema for the non-fungible data.
Instead, itβs better to build the transaction with the Rust Manifest Builder, and then submit it using the developer console.
Building the Transfer Manifest with the Rust Manifest Builder
First, set-up a Rust/Scrypto project as in the Rust Manifest Builder docs.
The below test can be run to output a manifest to ./transaction_manifest/create_non_fungible.rtm with the CREATE_NON_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY command.
You can tweak lots of the parameters, including renaming/restructuring MyNonFungibleDataType.
This code uses .lock_fee_from_faucet() to lock the standard test fee from the system faucet in Stokenet. Learn more about Lock Fees here.
use Example manifest output is as follows. Note that because it is automatically generated, it doesnβt use the manifest type aliases which are typically used for manual creation.
CALL_METHOD
Address("component_tdx_2_1cptxxxxxxxxxfaucetxxxxxxxxx000527798379xxxxxxxxxyulkzl")
"lock_fee"
Decimal("5000")
;
CREATE_NON_FUNGIBLE_RESOURCE_WITH_INITIAL_SUPPLY
Enum<0u8>()
Enum<1u8>()
true
Enum<0u8>(
Enum<0u8>(
Tuple(
Array<Enum>(
Enum<14u8>(
Array<Enum>(
Enum<0u8>(
12u8
),
Enum<0u8>(
12u8
),
Enum<0u8>(
198u8
)
)
)
),
Array<Tuple>(
Tuple(
Enum<1u8>(
"MyNonFungibleDataType"
),
Enum<1u8>(
Enum<0u8>(
Array<String>(
"name",
"description",
"key_image_url"
)
)
)
)
),
Array<Enum>(
Enum<0u8>()
)
)
),
Enum<1u8>(
0u64
),
Array<String>()
)
Map<NonFungibleLocalId, Tuple>(
NonFungibleLocalId("#1#") => Tuple(
Tuple(
"hello world",
"lorem ipsum",
"https://assets-global.website-files.com/618962e5f285fb3c879d82ca/61b8f414d213fd7349b654b9_icon-DEX.svg"
)
)
)
Tuple(
Enum<0u8>(),
Enum<0u8>(),
Enum<0u8>(),
Enum<0u8>(),
Enum<0u8>(),
Enum<0u8>(),
Enum<0u8>()
)
Tuple(
Map<String, Tuple>(
"name" => Tuple(
Enum<1u8>(
Enum<0u8>(
"Example NF"
)
),
true
)
),
Map<String, Enum>()
)
Enum<0u8>()
;