Installation and usage of the platform

REST API: information about address assets and balances

https://img.shields.io/badge/auth-required-orange.svg

The methods of the assets group are provided for obtaining information about assets and address balances.

GET /assets/balance/{address}

The method returns the balance of all assets of the address.

Parameters returned in the method response:

  • address – participant address;

  • balances – object with balances of the participant:

    • assetId – asset identifier;

    • balance – asset balance;

    • quantity – the total number of issued tokens of the asset;

    • reissuable – the reissuability of an asset;

    • issueTransaction – the body of transaction 3 for asset creation;

    • minSponsoredAssetFee – minimum fee for sponsored transactions;

    • sponsorBalance – funds allocated to pay for transactions on sponsored assets.

Response example:

GET /assets/balance/{address}:
{
  "address": "3Mv61qe6egMSjRDZiiuvJDnf3Q1qW9tTZDB",
  "balances": [
    {
      "assetId": "Ax9T4grFxx5m3KPUEKjMdnQkCKtBktf694wU2wJYvQUD",
      "balance": 4879179221,
      "quantity": 48791792210,
      "reissuable": true,
      "minSponsoredAssetFee" : 100,
      "sponsorBalance" : 1233221,
      "issueTransaction" : {
         "type" : 3,
         ...
      }
    },
    {
      "assetId": "49KfHPJcKvSAvNKwM7CTofjKHzL87SaSx8eyADBjv5Wi",
      "balance": 10,
      "quantity": 10000000000,
      "reissuable": false,
      "issueTransaction" : {
         "type" : 3,
         ...
      }
    }
  ]
}

POST /assets/balance

The method returns the balance of all assets for several addresses passed to the addresses field. Parameters passed in response for each address are identical to the GET /assets/balance/{address} method.

Response example for one address:

GET /assets/balance/{address}:
{
  "address": "3Mv61qe6egMSjRDZiiuvJDnf3Q1qW9tTZDB",
  "balances": [
    {
      "assetId": "Ax9T4grFxx5m3KPUEKjMdnQkCKtBktf694wU2wJYvQUD",
      "balance": 4879179221,
      "quantity": 48791792210,
      "reissuable": true,
      "minSponsoredAssetFee" : 100,
      "sponsorBalance" : 1233221,
      "issueTransaction" : {
         "type" : 3,
         ...
      }
    },
    {
      "assetId": "49KfHPJcKvSAvNKwM7CTofjKHzL87SaSx8eyADBjv5Wi",
      "balance": 10,
      "quantity": 10000000000,
      "reissuable": false,
      "issueTransaction" : {
         "type" : 3,
         ...
      }
    }
  ]
}

GET /assets/balance/{address}/{assetId}

The method returns the balance of the address in the specified {assetId}.

Response example:

GET /assets/balance/{address}/{assetId}:
{
  "address": "3Mv61qe6egMSjRDZiiuvJDnf3Q1qW9tTZDB",
  "assetId": "Ax9T4grFxx5m3KPUEKjMdnQkCKtBktf694wU2wJYvQUD",
  "balance": 4879179221
}

GET /assets/details/{assetId}

The method returns description of the specified {assetId}.

Response example:

GET /assets/details/{assetId}:
{
  "assetId" : "8tdULCMr598Kn2dUaKwHkvsNyFbDB1Uj5NxvVRTQRnMQ",
  "issueHeight" : 140194,
  "issueTimestamp" : 1504015013373,
  "issuer" : "3NCBMxgdghg4tUhEEffSXy11L6hUi6fcBpd",
  "name" : "name",
  "description" : "Sponsored asset",
  "decimals" : 1,
  "reissuable" : true,
  "quantity" : 1221905614,
  "script" : null,
  "scriptText" : null,
  "complexity" : 0,
  "extraFee": 0,
  "minSponsoredAssetFee" : 100000
}

GET /assets/{assetId}/distribution

The method returns the number of asset tokens on all addresses using the specified asset.

Response example:

GET /assets/details/{assetId}:
{
  "3P8GxcTEyZtG6LEfnn9knp9wu8uLKrAFHCb": 1,
  "3P2voHxcJg79csj4YspNq1akepX8TSmGhTE": 1200
}
See also