Bag

Register

Description:

This function register a bag transaction.

Steps:

  1. Call the bag/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 bag will manage.

  • metadata: additional information about the bag.

Example Input:

{
    "seed": "//Alice",
    "class_id": 100000,
    "metadata": {
        "userdata": "somedata"
    }
}

Expected Output:

  • who: the account address that paid for the transaction.

  • class_id: the class identifier managed by the bag.

Create

Description:

This function creates a bag transaction.

Previous Steps:

  1. Create an account

  2. Fund an account

Steps:

  1. Call the bag/create endpoint with the following request body:

  • seed: the seed of the account that will pay for the transaction.

  • class_id: the class identifier that the bag manages.

  • owners: array of account addresses that will be associated with the bag.

  • shares: the amount of share held by the corresponding owners.

Example Input:

Expected Output:

  • owners: array of account addresses associated with the bag.

  • bag: the bag account.

  • class_id: the class identifier that the bag manages.

  • asset_id: the asset identifier that the bag manages.

Deposit

Description:

This function creates a new deposit to the bag account.

Previous Steps:

  1. Create an account

  2. Fund an account

  3. Create a class

  4. Create an asset

  5. Mint an asset

Steps:

  1. Call the bag/deposit endpoint with the following request body:

  • seed: the seed of the account that will pay for the transaction.

  • bag: the bag account where the deposit will be made.

  • class_ids: an array of the class identifiers that will be part of the transaction.

  • 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.

Example Input:

Expected Output:

  • who: the account address that paid for the transaction.

  • bag: the bag account.

Sweep

Description:

This function sweep the deposits made on an bag account to a given account.

Previous Steps:

  1. Create an account

  2. Fund an account

  3. Create a class

  4. Create an asset

  5. Mint an asset

Steps:

  1. Call the bag/sweep endpoint with the following request body:

  • seed: the seed of the account that will pay for the transaction.

  • bag: the bag account where the deposit were made.

  • to: the receiver account address.

Example Input:

Expected Output:

  • who: the account address that paid for the transaction.

  • to: the receiver account address.

  • bag: the bag account.

Last updated