Account API

Accounts

get_accounts(account_ids)

Get a list of accounts by ID. This function has semantics identical to get_objects.

Parameters

Option
Description
vector<account_id_type> accounts_ids
IDs of the accounts to retrieve

Example

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

Returns

The accounts corresponding to the provided IDs.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
{
6
"id": "1.2.10",
7
"registrar": "1.2.4",
8
"name": "init4",
9
"active": {
10
"weight_threshold": 1,
11
"account_auths": [],
12
"key_auths": [
13
[
14
"ECHOEdjiBUy2RBJ9sMN7jKMK4x9Fa4QVR7JgtNLwbgcZtcZB",
15
1
16
]
17
]
18
},
19
"echorand_key": "ECHOEdjiBUy2RBJ9sMN7jKMK4x9Fa4QVR7JgtNLwbgcZtcZB",
20
"options": {
21
"delegating_account": "1.2.5",
22
"delegate_share": 2000,
23
"extensions": []
24
},
25
"statistics": "2.5.10",
26
"whitelisting_accounts": [],
27
"blacklisting_accounts": [],
28
"whitelisted_accounts": [],
29
"blacklisted_accounts": [],
30
"active_special_authority": [
31
0,
32
{}
33
],
34
"top_n_control_flags": 0,
35
"accumulated_reward": 0,
36
"extensions": []
37
}
38
]
39
}
Copied!

get_full_accounts(names_or_ids, subscribe)

Fetch all objects relevant to the specified accounts and subscribe to updates.
This function fetches all relevant objects for the given accounts, and subscribes to updates to the given accounts. If any of the strings in names_or_ids cannot be tied to an account, that input will be ignored. All other accounts will be retrieved and subscribed.

Parameters

Option
Description
vector<string> names_or_ids
an array of either the names or IDs of accounts to retrieve (can be mixed)
bool subscribe
whether to subscribe to updates

Example

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

Returns

A map of strings from names_or_ids to the corresponding accounts.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
[
6
"1.2.10",
7
{
8
"account": {
9
"id": "1.2.10",
10
"registrar": "1.2.4",
11
"name": "init4",
12
"active": {
13
"weight_threshold": 1,
14
"account_auths": [],
15
"key_auths": [
16
[
17
"ECHOEdjiBUy2RBJ9sMN7jKMK4x9Fa4QVR7JgtNLwbgcZtcZB",
18
1
19
]
20
]
21
},
22
"echorand_key": "ECHOEdjiBUy2RBJ9sMN7jKMK4x9Fa4QVR7JgtNLwbgcZtcZB",
23
"options": {
24
"delegating_account": "1.2.5",
25
"delegate_share": 2000,
26
"extensions": []
27
},
28
"statistics": "2.5.10",
29
"whitelisting_accounts": [],
30
"blacklisting_accounts": [],
31
"whitelisted_accounts": [],
32
"blacklisted_accounts": [],
33
"active_special_authority": [
34
0,
35
{}
36
],
37
"top_n_control_flags": 0,
38
"accumulated_reward": 0,
39
"extensions": []
40
},
41
"statistics": {
42
"id": "2.5.10",
43
"owner": "1.2.10",
44
"most_recent_op": "2.8.0",
45
"total_ops": 0,
46
"removed_ops": 0,
47
"total_blocks": 3,
48
"total_core_in_orders": 0,
49
"created_eth_address": false,
50
"committeeman_rating": 0,
51
"extensions": []
52
},
53
"registrar_name": "temp-account",
54
"balances": [],
55
"vesting_balances": [],
56
"proposals": [],
57
"assets": []
58
}
59
]
60
]
61
}
Copied!

Notice example

The notification was received by performing the account update operation for changing delegating_account.
1
{
2
"method": "notice",
3
"params": [
4
CALLBACK_ID,
5
[
6
[
7
{
8
"id": "1.2.10",
9
"registrar": "1.2.4",
10
"name": "init4",
11
"active": {
12
"weight_threshold": 1,
13
"account_auths": [],
14
"key_auths": [
15
[
16
"ECHOCh3WGJCMKkBJHFJpzaC378cwwYisNbNKpD6oYhcuA6nR",
17
1
18
]
19
]
20
},
21
"echorand_key": "ECHOCh3WGJCMKkBJHFJpzaC378cwwYisNbNKpD6oYhcuA6nR",
22
"options": {
23
"delegating_account": "1.2.5",
24
"delegate_share": 2000,
25
"extensions": []
26
},
27
"statistics": "2.5.10",
28
"whitelisting_accounts": [],
29
"blacklisting_accounts": [],
30
"whitelisted_accounts": [],
31
"blacklisted_accounts": [],
32
"active_special_authority": [
33
0,
34
{}
35
],
36
"top_n_control_flags": 0,
37
"extensions": []
38
}
39
]
40
]
41
]
42
}
Copied!

get_account_by_name(name)

Get the account object by it's name.

Parameters

Option
Description
string name
account name

Example

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

Returns

Account object it the account exists, null otherwise.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": {
5
"id": "1.2.26",
6
"registrar": "1.2.4",
7
"name": "nathan",
8
"active": {
9
"weight_threshold": 1,
10
"account_auths": [],
11
"key_auths": [
12
[
13
"ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu",
14
1
15
]
16
]
17
},
18
"echorand_key": "ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu",
19
"options": {
20
"delegating_account": "1.2.5",
21
"delegate_share": 2000,
22
"extensions": []
23
},
24
"statistics": "2.5.26",
25
"whitelisting_accounts": [],
26
"blacklisting_accounts": [],
27
"whitelisted_accounts": [],
28
"blacklisted_accounts": [],
29
"active_special_authority": [
30
0,
31
{}
32
],
33
"top_n_control_flags": 0,
34
"accumulated_reward": 0,
35
"extensions": []
36
}
37
}
Copied!

get_account_references(account_id)

All accounts that refer to the key or account id in their active authorities.

Parameters

Option
Description
account_id_type account_id
id of the account

Example

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

Returns

1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
"1.2.0",
6
"1.2.2"
7
]
8
}
Copied!

lookup_account_names(account_names)

Get a list of accounts by name. This function has semantics identical to get_objects.

Parameters

Option
Description
vector<string> account_names
names of the accounts to retrieve

Example

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

Returns

The accounts holding the provided names.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
{
6
"id": "1.2.26",
7
"registrar": "1.2.4",
8
"name": "nathan",
9
"active": {
10
"weight_threshold": 1,
11
"account_auths": [],
12
"key_auths": [
13
[
14
"ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu",
15
1
16
]
17
]
18
},
19
"echorand_key": "ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu",
20
"options": {
21
"delegating_account": "1.2.5",
22
"delegate_share": 2000,
23
"extensions": []
24
},
25
"statistics": "2.5.26",
26
"whitelisting_accounts": [],
27
"blacklisting_accounts": [],
28
"whitelisted_accounts": [],
29
"blacklisted_accounts": [],
30
"active_special_authority": [
31
0,
32
{}
33
],
34
"top_n_control_flags": 0,
35
"accumulated_reward": 0,
36
"extensions": []
37
}
38
]
39
}
Copied!

lookup_accounts(lower_bound_name, limit)

Get names and IDs for registered accounts.

Parameters

Option
Description
string lower_bound_name
lower bound of the first name to return
uint32_t limit
maximum number of results to return must not exceed 1000

Example

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

Returns

Map of account names to corresponding IDs.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
[
6
"init1",
7
"1.2.7"
8
],
9
[
10
"init2",
11
"1.2.8"
12
],
13
[
14
"init3",
15
"1.2.9"
16
]
17
]
18
}
Copied!

get_account_addresses(account_id, from, limit)

Get addresses of specified account.

Parameters

Option
Description
account_id_type account_id
ID of the account
uint64_t from
number of block to start retrieve from
unsigned limit
maximum number of addresses to return

Example

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

Returns

Addresses owned by account in specified ids interval.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
{
6
"id": "2.15.0",
7
"owner": "1.2.26",
8
"label": "label1",
9
"address": "6b34edbee7b4eaf077ab8217a50ac43a00d0ba05",
10
"extensions": []
11
}
12
]
13
}
Copied!

get_account_by_address(address)

Get owner of specified address.

Parameters

Option
Description
ripemd160 address
address in form of ripemd160 hash

Example

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

Returns

Account id of owner.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": "1.2.15"
5
}
Copied!

get_evm_addresses(account_id)

Get EVM addresses, if exist, for the given account id.

Parameters

Option
Description
account_id_type account_id
address in form of ripemd160 hash

Example

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

Returns

EVM addresses owned by account.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
[
6
{
7
"id": "1.24.0",
8
"owner": "1.2.10",
9
"evm_address": "0102fe7702b96808f7bbc0d4a888ed1468216cfd",
10
"extensions": []
11
}
12
]
13
]
14
}
Copied!

get_account_address_by_label(account_name_or_id, label)

Get account address by owner account and label.

Parameters

Option
Description
string account_name_or_id
the name or id of the owner account
string label
the label of account address object

Example

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

Returns

EVM addresses owned by account.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
"f149bd2883b1179965bd6706092573be4d68fec8"
6
]
7
}
Copied!

get_account_count()

Get the total number of accounts registered with the blockchain.

Example

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

Returns

1
{
2
"id": 3,
3
"jsonrpc": "2.0",
4
"result": 27
5
}
Copied!

Keys

get_key_references(keys)

Retreive an array of account IDs associated with the given keys.

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_key_references",
7
[
8
[
9
"ECHO61p48u6pHnjSAYP5kzQ4RGNQzFDBDYRrfqrAuhtb2Hdm",
10
"ECHO6ffcvxMD8XrWWNRSPmusHSFFjuPe9qnnVbVQBgERd3fi", ...
11
]
12
]
13
]
14
}
Copied!

Returns

An array of arrays of account IDs for every public key provided.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
[
6
"1.2.14"
7
],
8
[
9
"1.2.13"
10
]
11
]
12
}
Copied!

is_public_key_registered(public_key)

Determine whether of a public key is currently linked to any registered (i.e. non-stealth) account on the blockchain.

Parameters

Option
Description
public_key_t key
public key

Example

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

Returns

Whether a public key is known.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": false
5
}
Copied!
Last modified 10mo ago