Balance API

get_account_balances(id, assets)

Get an account’s balances in various assets.

Parameters

Option
Description
account_id_type id
ID of the account to get balances for
flat_set<asset_id_type> assets
an array of IDs of the assets to get balances of; if empty, get all assets account has a balance in

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_account_balances",
7
[
8
"1.2.15",
9
[
10
"1.3.0", ...
11
]
12
]
13
]
14
}
Copied!

Returns

An array of balances of the account.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
{
6
"amount": "799959899999120",
7
"asset_id": "1.3.0"
8
}
9
]
10
}
Copied!

get_contract_balances(contract_id)

Get a contract's balances in various assets.

Parameters

Option
Description
contract_id_type contract_id
ID of the contract to get balances for

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_contract_balances",
7
[
8
"1.11.0"
9
]
10
]
11
}
Copied!

Returns

An array of balances of the contract.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
{
6
"amount": 100,
7
"asset_id": "1.3.0"
8
}
9
]
10
}
Copied!

get_named_account_balances(name, assets)

Semantically equivalent to get_account_balances, but takes a name instead of an ID.

Parameters

Option
Description
string name
name of the account to get balances for
flat_set<asset_id_type> assets
an array of IDs of the assets to get balances of; if empty, get all assets account has a balance in

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_named_account_balances",
7
[
8
"nathan",
9
[
10
"1.3.0", ...
11
]
12
]
13
]
14
}
Copied!

Returns

1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
{
6
"amount": "991999999999840",
7
"asset_id": "1.3.0"
8
}
9
]
10
}
Copied!

get_balance_objects(keys)

Returns all unclaimed balance objects for a set of addresses.

Parameters

Option
Description
vector<public_key_t> keys
an array of public keys

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_balance_objects",
7
[
8
[
9
"ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu",
10
...
11
]
12
]
13
]
14
}
Copied!

Returns

An array of balances objects.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
{
6
"id": "1.8.0",
7
"owner": "ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu",
8
"balance": {
9
"amount": "1000000000000000",
10
"asset_id": "1.3.0"
11
},
12
"last_claim_date": "1970-01-01T00:00:00",
13
"extensions": []
14
}
15
]
16
}
Copied!

get_vested_balances(objs)

Parameters

Option
Description
vector<balance_id_type> objs
an array of balance ID

Example

1
{
2
"id": 3,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_vested_balances",
7
[
8
[
9
"1.8.0",
10
...
11
]
12
]
13
]
14
}
Copied!

Returns

An array of assets vested.
1
{
2
"id": 3,
3
"jsonrpc": "2.0",
4
"result": [
5
{
6
"amount": "1000000000000000",
7
"asset_id": "1.3.0"
8
}
9
]
10
}
Copied!

get_vesting_balances(account_id)

Parameters

Option
Description
account_id_type account_ids
the id of account to use

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_vesting_balances",
7
[
8
"1.2.26"
9
]
10
]
11
}
Copied!

Returns

An array of vesting balances.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
{
6
"id": "1.7.0",
7
"owner": "1.2.26",
8
"balance": {
9
"amount": 100,
10
"asset_id": "1.3.0"
11
},
12
"policy": [
13
0,
14
{
15
"begin_timestamp": "1970-01-01T00:00:00",
16
"vesting_cliff_seconds": 0,
17
"vesting_duration_seconds": 0,
18
"begin_balance": 100
19
}
20
],
21
"extensions": []
22
}
23
]
24
}
Copied!

get_frozen_balances(account_id)

Parameters

Option
Description
account_id_type account_id
the id of account to use

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_frozen_balances",
7
[
8
"1.2.26"
9
]
10
]
11
}
Copied!

Returns

An array of frozen balances.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
{
6
"id": "1.11.0",
7
"owner": "1.2.26",
8
"balance": {
9
"amount": 1000000000,
10
"asset_id": "1.3.0"
11
},
12
"multiplier": 13000,
13
"unfreeze_time": "2019-12-18T14:49:32",
14
"extensions": []
15
}
16
]
17
}
Copied!

get_committee_frozen_balance(committee_member_id)

Parameters

Option
Description
committee_member_id_type committee_member_id
the id of committee member to use

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_committee_frozen_balance",
7
[
8
"1.4.6"
9
]
10
]
11
}
Copied!

Returns

Frozen balance of committee member.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": {
5
"amount": 1000,
6
"asset_id": "1.3.0"
7
}
8
}
Copied!
Last modified 1yr ago