Asset
Create Class
Description:
This function creates a new class of assets. Classes being a set that includes related assets or assets that have common characteristics.
Previous Steps:
Create an account
Fund an account
Steps:
Call the assets/create_class endpoint with the following request body:
seed: the seed of the account that will pay for the transaction.
class_id: the class identifier (must be unique).
owner: the account address that will have ownership of the class.
metadata: additional information about the class.
Example Input:
Expected Output:
class_id: the class identifier.
who: the account address of the class owner.
Class Info
Description:
This function returns information about a class.
Previous Steps:
Create an account
Fund an account
Steps:
Call the assets/class_info endpoint with the following request body:
class_id: the class identifier.
Example Input:
Expected Output:
class_id: the class identifier.
owner: the account address of the class owner.
metadata: additional information about the asset.
Create
Description:
This function creates an asset.
Previous Steps:
Create an account
Fund an account
Steps:
Call the assets/create endpoint with the following request body:
seed: the seed of the account that will pay for the transaction.
class_id: the class identifier
asset_id: the asset identifier (must be unique).
account: the account address that will have ownership of the asset.
metadata: additional information about the asset.
Example Input:
Expected Output:
class_id: the class identifier.
asset_id: the asset identifier.
who: the account address of the asset owner.
Info
Description:
This function returns information about an asset.
Previous Steps:
Create an account
Fund an account
Steps:
Call the assets/info endpoint with the following request body:
class_id: the class identifier.
asset_id: the asset identifier.
Example Input:
Expected Output:
class_id: the class identifier.
asset_id: the asset identifier.
owner: the account address of the asset owner.
metadata: additional information about the asset.
Update Metadata
Description:
This function updates the asset class metadata.
Previous Steps:
Create an account
Fund an account
Steps:
Call the assets/update_metadata endpoint with the following request body:
seed: the seed of the account that will pay for the transaction.
metadata: the new metadata to be set by this function.
class_id: the class identifier.
asset_id: the asset identifier.
Example Input:
Expected Output:
class_id: the class identifier.
asset_id: the asset identifier.
who: the account address that paid for the transaction.
metadata: the information updated by the function.
Mint
Description:
This function mints an asset by a given amount.
Previous Steps:
Create an account
Fund an account
Steps:
Call the assets/mint endpoint with the following request body:
seed: the seed of the account that will pay for the transaction.
class_id: the class identifier
asset_id: the asset identifier
to: the account address that will have ownership of the assets.
amount: the specific amount of assets to be minted.
Example Input:
Expected Output:
who: the account address that paid for the transaction.
class_id: the class identifier
asset_id: the asset identifier
to: the account address that has the ownership of the assets.
amount: the specific amount of assets minted.
Burn
Description:
This function burns an asset by a given amount.
Previous Steps:
Create an account
Fund an account
Steps:
Call the assets/burn endpoint with the following request body:
seed: the seed of the account that will pay for the transaction.
class_id: the class identifier
asset_id: the asset identifier
from: the account address that will burn the assets.
amount: the specific amount of assets to be burned.
Example Input:
Expected Output:
who: the account address that paid for the transaction.
class_id: the class identifier
asset_id: the asset identifier
from: the account address that burned the assets.
amount: the specific amount of assets burned.
Balance
Description:
This function checks the balance of an asset in an account.
Previous Steps:
Create an account
Fund an account
Steps:
Call the assets/balance endpoint with the following request body:
class_id: the class identifier
asset_id: the asset identifier
account: the account address that will be checked.
Example Input:
Expected Output:
amount: the specific amount of assets in the given account.
Transfer
Description:
This function transfers an given amounts of an asset from one account to another.
Previous Steps:
Create an account
Fund an account
Steps:
Call the assets/transfer_from endpoint with the following request body:
seed: the seed of the account that will pay for the transaction.
class_id: the class identifier
asset_id: the asset identifier
from: the account address that will send the assets.
to: the account address that will receive the assets
amount: the specific amount of assets to be sent.
Example Input:
Expected Output:
who: the account address that paid for the transaction.
class_id: the class identifier
asset_id: the asset identifier
from: the account address that sent the assets.
to: the account address that received the assets
amount: the specific amount of assets sent.
Last updated