Getting a list of balances
Getting the entire balance of assets in your account
The GET/balances endpoint allow users to retrieve their total balance across all their addresses and vaults. To do this the user must have viewer as their API key role.
Query Parameters
Parameters can be use to filter for balances of each asset by entering the "asset_id".
| Name | Type | Required | Description |
|---|---|---|---|
| asset_id | string | false | The asset ID to filter by |
| limit | string | false | Default at 50 |
| offset | string | false | Offset for pagination |
Response
By using this endpoint, the response will include balances across all vault types including Rakkar Warm and Rakkar Cold.
| Component | Type | Description |
|---|---|---|
| balance_type | string | Type of balance |
The response will show a list of assets and its balance within the array "balance" with the following details:
| component | type | description |
|---|---|---|
| asset_id | string | The symbol abbreviation of the asset |
| asset_name | string | The name of the asset |
| network_id | string | The symbol abbreviation of the network |
| network_name | string | The name of the network |
| balances | array | An array of objects representing an asset's balance in the account |
The "balances" will provide more details of the type of balance including:
| component | type | description |
|---|---|---|
| total_balance | string | The total balance of the asset |
| available_balance | string | The available balance of the asset |
| processing_balance | string | The balance of an asset that is being processed in transaction |
| staking_balance | string | The balance of asset that is staked |
| claimable_balance | string | The amount of balance that is claimable from staking |
Example Response
{
"timestamp": "2019-01-02T12:34:56.000Z",
"balance_type": "all",
"balance": [
{
"asset_id": "BTC",
"asset_name": "Bitcoin",
"network_id": "BTC",
"network_name": "Bitcoin Network",
"balances":
{
"total_balance": "2",
"available_balance": "2",
"processing_balance": "0",
"staking_balance": "0",
"claimable_balance": "0"
}
},
{
"asset_id": "ETH",
"asset_name": "Ethereum",
"network_id": "ETH",
"network_name": "Ethereum Mainnet",
"balances":
{
"total_balance": "5",
"available_balance": "4.5",
"processing_balance": "0.5",
"staking_balance": "0",
"claimable_balance": "0"
}
},
{
"asset_id": "ADA",
"asset_name": "Cardano",
"network_id": "ADA",
"network_name": "Cardano Network",
"balances":
{
"total_balance": "100",
"available_balance": "60",
"processing_balance": "0",
"staking_balance": "35",
"claimable_balance": "5"
}
}
],
}Get total balances of either warm of cold vaults
To view the total balances in a vault type use the GET /balances/{vault_type} endpoint.
Path Parameters
| Component | Type | Description |
|---|---|---|
| vault_type | string | The type of vault to query balances by |
In the parameter, the user must input the enumerated value either "warm" or "cold", in the "vault_type". For example, if user select "warm" for vault type - the response will show the total balances in all warm vaults across their Rakkar account.
Enumerated values
| Name | Type | Required | Description |
|---|---|---|---|
| vault_type | enum | true | Allowed values: warm, cold |
Query Parameters
Parameters can also be use to filter for balances of an asset in a vault type by entering the "asset_id". For example, if a user can filter for the total balances of their "ETH" in all "warm" vaults.
| Name | Type | Required | Description |
|---|---|---|---|
| asset_id | string | false | The asset ID to filter by |
The response will follow the same format as the above GET /balances endpoint except with the enumerated values "warm" or "cold" displayed in the "balance_type" field depending on the input path parameters.
Example Response
{
"timestamp": "2019-01-02T12:34:56.000Z",
"balance_type": "cold",
"balance": [
{
"asset_id": "ETH",
"asset_name": "Ethereum",
"network_id": "ETH",
"network_name": "Ethereum Mainnet",
"balances":
{
"total_balance": "5",
"available_balance": "4.5",
"processing_balance": "0.5",
"staking_balance": "0",
"claimable_balance": "0"
}
},
{
"asset_id": "ADA",
"asset_name": "Cardano",
"network_id": "ADA",
"network_name": "Cardano Network",
"balances":
{
"total_balance": "100",
"available_balance": "60",
"processing_balance": "0",
"staking_balance": "35",
"claimable_balance": "5"
}
},
],
}Updated about 1 month ago
