Bundle
Register
Description:
This function registers a new bundle schema.
Previous Steps:
Create a class
Create an asset
Mint an asset
Steps:
Call the bundle/register endpoint with the following request body:
seed: the seed of the account that will pay for the transaction.
class_id: the new class identifier that the bundle will manage.
asset_id: the new asset identifier that the bundle will manage.
schema: this will represent all the classes and assets that need to be present in order to fulfill the other transactions
class_ids: an array of the class identifiers that will be part of the schema.
asset_ids: an array of asset_ids arrays that will be related to each class_id.
amounts: an array of amount arrays that will be related to each asset_id.
metadata: additional information about the bundle.
Example Input:
{
"seed": "//Alice",
"class_id": 3,
"asset_id": 0,
"schema": {
"class_ids": [1],
"asset_ids": [
[1]
],
"amounts": [
[5]
]
},
"metadata": {
"userdata": ""
}
}
Expected Output:
{
"bundle_id": "460bf8be553867922d58c434b3e672ffee40d163d4e744d28c1f67f93d0b3a3c",
"who": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"class_id": 3,
"asset_id": 0
}
who: the account address associated with the bundle.
bundle_id: the bundle identifier.
class_id: the class identifier managed by the bundle.
asset_id: the asset identifier managed by the bundle.
Mint
Description:
This function mints a bundle.
Previous Steps:
Create an account
Steps:
Call the bundle/mint endpoint with the following request body:
seed: the seed of the account that will pay for the transaction.
from: the account address of the sender.
to: the account address of the receiver.
bundle_id: the bundle identifier.
amount: the amount to be minted.
Example Input:
{
"seed": "//Alice",
"from": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"to": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"bundle_id": "460bf8be553867922d58c434b3e672ffee40d163d4e744d28c1f67f93d0b3a3c",
"amount": 10
}
Expected Output:
{
"who": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"from": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"to": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"bundle_id": "460bf8be553867922d58c434b3e672ffee40d163d4e744d28c1f67f93d0b3a3c",
"amount": 10
}
who: the account address that paid for the transaction.
from: the account address of the sender.
to: the account address of the receiver.
bundle_id: the bundle identifier.
amount: the amount minted.
Last updated