Authority and Validation API

get_transaction_hex(trx)

Get a hexdump of the serialized binary form of a signed transaction.

Parameters

Option
Description
signed_transaction trx
object signed transaction

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_transaction_hex",
7
[
8
{
9
"ref_block_num": "221",
10
"ref_block_prefix": "4141892275",
11
"expiration": "1970-01-01T00:00:00",
12
"operations": []
13
}
14
]
15
]
16
}
Copied!

Returns

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

get_required_signatures(ctrx, available_keys)

Takes a partially signed transaction and a set of public keys that the owner has the ability to sign for and return the minimal subset of public keys that should add signatures to the transaction.

Parameters

Option
Description
signed_transaction trx
object signed transaction
flat_set<public_key_t> available_keys
an array of public keys

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_required_signatures",
7
[
8
{
9
"ref_block_num": 1719,
10
"ref_block_prefix": 3664479505,
11
"expiration": "2019-08-21T14:16:03",
12
"operations": [
13
[
14
28,
15
{
16
"fee": {
17
"amount": 5001,
18
"asset_id": "1.3.0"
19
},
20
"owner": "1.2.26",
21
"label": "label1",
22
"extensions": []
23
}
24
]
25
],
26
"extensions": [],
27
"signatures": [],
28
},
29
[
30
"ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu"
31
]
32
]
33
]
34
}
Copied!

Returns

A set of public keys.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
"ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu"
6
]
7
}
Copied!

get_potential_signatures(ctrx)

This method will return the set of all public keys that could possibly sign for a given transaction. This call can be used by wallets to filter their set of public keys to just the relevant subset prior to calling get_required_signatures to get the minimum subset.

Parameters

Option
Description
signed_transaction trx
object signed transaction

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_potential_signatures",
7
[
8
{
9
"ref_block_num": 1719,
10
"ref_block_prefix": 3664479505,
11
"expiration": "2019-08-21T14:16:03",
12
"operations": [
13
[
14
28,
15
{
16
"fee": {
17
"amount": 5001,
18
"asset_id": "1.3.0"
19
},
20
"owner": "1.2.26",
21
"label": "label1",
22
"extensions": []
23
}
24
]
25
],
26
"extensions": [],
27
"signatures": [
28
"aa936713a49db3b2881ece72879dc2cb22c4b81368f9bbb4e57666b7277b96e153a5519a8fed82ca54ee71cc3dd0a33c614aa44613580009e2de242de5ce8902"
29
],
30
"signed_with_echorand_key": false
31
}
32
]
33
]
34
}
Copied!

Returns

A set of public keys.
1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": [
5
"ECHO6XS3BMVnEHAzo1PhHWt9vndrZn2P27tCbU9WdqCM8sJu"
6
]
7
}
Copied!

verify_authority(trx)

Returns true of the trx has all of the required signatures, otherwise throws an exception.

Parameters

Option
Description
signed_transaction trx
object signed transaction

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"verify_authority",
7
[
8
{
9
"ref_block_num": 1719,
10
"ref_block_prefix": 3664479505,
11
"expiration": "2019-08-21T14:16:03",
12
"operations": [
13
[
14
28,
15
{
16
"fee": {
17
"amount": 5001,
18
"asset_id": "1.3.0"
19
},
20
"owner": "1.2.26",
21
"label": "label1",
22
"extensions": []
23
}
24
]
25
],
26
"extensions": [],
27
"signatures": [
28
"aa936713a49db3b2881ece72879dc2cb22c4b81368f9bbb4e57666b7277b96e153a5519a8fed82ca54ee71cc3dd0a33c614aa44613580009e2de242de5ce8902"
29
],
30
"signed_with_echorand_key": false
31
}
32
]
33
]
34
}
Copied!

Returns

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

verify_account_authority(name_or_id, signers)

Returns true if the signers have enough authority to authorize an account.

Parameters

Option
Description
string name_or_id
the name or ID of the account
flat_set<public_key_t> signers
an array of public keys

Example

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

Returns

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

validate_transaction(trx)

Validates a transaction against the current state without broadcasting it on the network.

Parameters

Option
Description
signed_transaction trx
object signed transaction

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"validate_transaction",
7
[
8
{
9
"ref_block_num": 3530,
10
"ref_block_prefix": 636194404,
11
"expiration": "2019-08-21T15:36:27",
12
"operations": [
13
[
14
28,
15
{
16
"fee": {
17
"amount": 5002,
18
"asset_id": "1.3.0"
19
},
20
"owner": "1.2.26",
21
"label": "god_please",
22
"extensions": []
23
}
24
]
25
],
26
"extensions": [],
27
"signatures": [
28
"22e67b0b5072fd1e6901d983663b093b81898b318f34ee931e244f076c387cda7f32027cc31b7d50c77299072ddc516ffaf538e6b5c6d385830f1b4d050db20f"
29
],
30
"signed_with_echorand_key": false
31
}
32
]
33
]
34
}
Copied!

Returns

1
{
2
"id": 4,
3
"jsonrpc": "2.0",
4
"result": {
5
"ref_block_num": 3530,
6
"ref_block_prefix": 636194404,
7
"expiration": "2019-08-21T15:36:27",
8
"operations": [
9
[
10
28,
11
{
12
"fee": {
13
"amount": 5002,
14
"asset_id": "1.3.0"
15
},
16
"owner": "1.2.26",
17
"label": "god_please",
18
"extensions": []
19
}
20
]
21
],
22
"extensions": [],
23
"signatures": [
24
"22e67b0b5072fd1e6901d983663b093b81898b318f34ee931e244f076c387cda7f32027cc31b7d50c77299072ddc516ffaf538e6b5c6d385830f1b4d050db20f"
25
],
26
"signed_with_echorand_key": false,
27
"operation_results": [
28
[
29
1,
30
"2.15.4"
31
]
32
]
33
}
34
}
Copied!

get_required_fees(ops, id)

For each operation calculate the required fee in the specified asset type. If the asset type does not have a valid core_exchange_rate.

Parameters

Option
Description
string name_or_id
the name or ID of the account
flat_set<public_key_t> signers
an array of public keys

Example

1
{
2
"id": 4,
3
"method": "call",
4
"params": [
5
DATABASE_API_ID,
6
"get_required_fees",
7
[
8
[
9
[
10
28,
11
{
12
"fee": {
13
"amount": 5002,
14
"asset_id": "1.3.0"
15
},
16
"owner": "1.2.26",
17
"label": "god_please",
18
"extensions": []
19
}
20
]
21
],
22
"1.3.0"
23
]
24
]
25
}
Copied!

Returns

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