Create a policy and mint assets using new or existing policy script.
Usage
In order to reduce the amount of information in this guide, the prerequisites and helper functions are in another document.
CIP-68 Mint with New Policy
The only difference between a new and existing policy is the object policyScripts
CIP-68 Labels
100: Reference NFT locked at a script containing the datum
222: NFT held by the user's wallet making use of CIP-0025 inner structure
333: FT hold by the user's wallet making use of Cardano foundation off-chain registry inner structure
444: RFT hold by the user's wallet making use of the union of CIP-0025 inner structure AND the Cardano foundation off-chain registry inner structure
Payload
{
// When the `destAddress` is unset, by default the minted asset(s)
"changeAddress": "addr_test1qrvx8wgdndrk98qf62vka3q4fglchk7h940vepdtgcv9fuu0e0aeuac6j2xhz77esaaudku68ha89qesqvd29pmuzw6qk8xkcn",
// Utxos from the wallet that will pay for the fees, either an address or the list of cbor utxo (from a wallet)
"utxos": "addr_test1qrvx8wgdndrk98qf62vka3q4fglchk7h940vepdtgcv9fuu0e0aeuac6j2xhz77esaaudku68ha89qesqvd29pmuzw6qk8xkcn",
"mint": {
"assets": [
{
"version": "cip68",
"label": 100,
"assetName": "anvilapicip25", // UTF-8 format - Unique in the collection
// Your custom metadata
"metadata": {
"name": "anvil-api-1",
"image": [
"https://ada-anvil.s3.ca-central-1.amazonaws.com/",
"logo_pres_V2_3.png"
],
"mediaType": "image/png",
"description": "Testing CIP-25 using anvil API"
},
"policyId": "2c08845182b01c721670979fb1eb83cc037fc284fbb4fc3d80ea91a0",
"quantity": 1
}
],
// This object is ONLY required, if no asset as been minted
"policyScripts": {
"2c08845182b01c721670979fb1eb83cc037fc284fbb4fc3d80ea91a0": {
"type": "all",
"scripts": [
{
"type": "sig",
"keyHash": "fdf151b600df2492005221876c7d7e33056496572c7363c33a1e3609"
},
{
"type": "before",
"slot": 100000000
}
]
}
}
}
}
CIP-25 Mint with Existing Policy
Payload
{
// When the `destAddress` is unset, by default the minted asset(s)
"changeAddress": "addr_test1qrvx8wgdndrk98qf62vka3q4fglchk7h940vepdtgcv9fuu0e0aeuac6j2xhz77esaaudku68ha89qesqvd29pmuzw6qk8xkcn",
// Utxos from the wallet that will pay for the fees, either an address or the list of cbor utxo (from a wallet)
"utxos": "addr_test1qrvx8wgdndrk98qf62vka3q4fglchk7h940vepdtgcv9fuu0e0aeuac6j2xhz77esaaudku68ha89qesqvd29pmuzw6qk8xkcn",
"mint": {
"assets": [
{
"version": "cip68",
"assetName": "anvilapicip25", // UTF-8 format - Unique in the collection
// Your custom metadata
"metadata": {
"name": "anvil-api-1",
"image": [
"https://ada-anvil.s3.ca-central-1.amazonaws.com/",
"logo_pres_V2_3.png"
],
"mediaType": "image/png",
"description": "Testing CIP-25 using anvil API"
},
"policyId": "2c08845182b01c721670979fb1eb83cc037fc284fbb4fc3d80ea91a0",
"quantity": 1
}
]
}
}
Examples
TBD
Specifications
TBD (We must use either TRPC or Swagger to avoid deduplicating the information)