Hive Developer Portal
Methods:
Used to lookup account history information. These AppBase API methods are still under development and subject to change.
account_history_api.get_account_history
Returns a history of all operations for a given account. Parameters:
account:stringstart:int. e.g.: -1 for reverse history or any positive numericlimit:intup to 1000include_reversible:boolean(optional) If set to true also operations from reversible block will be includedoperation_filter_low:int(optional)operation_filter_high:int(optional)
If either operation_filter_low or operation_filter_high are set, the set of returned operations will include only these matching bitwise filter.
For the first 64 operations (as defined in protocol/operations.hpp), set the corresponding bit in operation_filter_low; for the higher-numbered operations, set the bit in operation_filter_high (pretending operation_filter is a 128-bit bitmask composed of {operation_filter_high, operation_filter_low})
account (string) |
start (int) |
limit (int) |
include_reversible (boolean) |
operation_filter_low (int) |
operation_filter_high (int) |
|
|---|---|---|---|---|---|---|
"hiveio" |
1000 |
1000 |
Queries the account named hiveio starting on the latest item in history, up to 1,000 results. |
|||
"alice" |
-1 |
1000 |
Queries the account named alice starting on the oldest item in history, up to 1,000 results. |
|||
"bob" |
-1 |
1000 |
true | 1 | Queries only votes by the account named bob starting on the oldest item in history, up to 1,000 results. |
|
"charlie" |
-1 |
1000 |
true | 262144 | Queries only custom jsons by the account named charlie starting on the oldest item in history, up to 1,000 results. |
|
"emma" |
-1 |
1000 |
true | 0 | 1 | Queries only proposal payments to the account named emma starting on the oldest item in history, up to 1,000 results. |
Also see: Paginated API Methods
Query Parameters JSON
{
"account": "",
"start": "18446744073709551615",
"limit": 1000,
"include_reversible": true,
"operation_filter_low": 4294967295,
"operation_filter_high": 4294967295
}
Expected Response JSON
{
"history": [
[
99,
{
"trx_id": "0000000000000000000000000000000000000000",
"block": 0,
"trx_in_block": 4294967295,
"op_in_trx": 0,
"virtual_op": 0,
"timestamp": "2019-12-09T21:32:39",
"op": {}
}
]
]
}
Example curl
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_account_history", "params":{"account":"hiveio", "start":1000, "limit":1000}, "id":1}' https://api.hive.blog
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_account_history", "params":{"account":"hiveio", "start":-1, "limit":1000}, "id":1}' https://api.hive.blog
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_account_history", "params":{"account":"bob", "start":-1, "limit":1000, "include_reversible": true, "operation_filter_low": 1}, "id":1}' https://api.hive.blog
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_account_history", "params":{"account":"charlie", "start":-1, "limit":1000, "include_reversible": true, "operation_filter_low": 262144}, "id":1}' https://api.hive.blog
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_account_history", "params":{"account":"emma", "start":-1, "limit":1000, "include_reversible": true, "operation_filter_low": 0, "operation_filter_high": 1}, "id":1}' https://api.hive.blog
Query Parameters JSON
{
"block_num": 0,
"only_virtual": false,
"include_reversible": true
}
Expected Response JSON
{
"ops": [
{
"trx_id": "0000000000000000000000000000000000000000",
"block": 0,
"trx_in_block": 4294967295,
"op_in_trx": 0,
"virtual_op": 0,
"timestamp": "2019-10-06T09:05:15",
"op": {}
}
]
}
Example curl
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_ops_in_block", "params":{"block_num":1,"only_virtual":false}, "id":1}' https://api.hive.blog
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_ops_in_block", "params":{"block_num":5443322,"only_virtual":true}, "id":1}' https://api.hive.blog
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_ops_in_block", "params":{"block_num":5443322,"only_virtual":true,"include_reversible":true}, "id":1}' https://api.hive.blog
account_history_api.get_transaction
Returns the details of a transaction based on a transaction id (including their signatures, operations like also a block_num it was included to).
id:stringtrx_id of expected transactioninclude_reversible:boolean(optional) If set to true also operations from reversible block will be included if block_num points to such block.
Query Parameters JSON
{
"id": "6fde0190a97835ea6d9e651293e90c89911f933c",
"include_reversible": true
}
Expected Response JSON
{
"ref_block_num": 36374,
"ref_block_prefix": 3218139339,
"expiration": "2018-04-09T00:29:06",
"operations": [
{
"type": "claim_reward_balance_operation",
"value": {
"account": "social",
"reward_hive": {
"amount": "0",
"precision": 3,
"nai": "@@000000021"
},
"reward_hbd": {
"amount": "0",
"precision": 3,
"nai": "@@000000013"
},
"reward_vests": {
"amount": "1",
"precision": 6,
"nai": "@@000000037"
}
}
}
],
"extensions": [],
"signatures": [
"1b01bdbb0c0d43db821c09ae8a82881c1ce3ba0eca35f23bc06541eca05560742f210a21243e20d04d5c88cb977abf2d75cc088db0fff2ca9fdf2cba753cf69844"
],
"transaction_id": "6fde0190a97835ea6d9e651293e90c89911f933c",
"block_num": 21401130,
"transaction_num": 25
}
Example curl
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_transaction", "params":{"id":"6fde0190a97835ea6d9e651293e90c89911f933c"}, "id":1}' https://api.hive.blog
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.get_transaction", "params":{"id":"6fde0190a97835ea6d9e651293e90c89911f933c", "include_reversible": true}, "id":1}' https://api.hive.blog
account_history_api.enum_virtual_ops
Allows to specify range of blocks to retrieve virtual operations for.
block_range_begin:intstarting block number (inclusive) to search for virtual operationsblock_range_end:intlast block number (exclusive) to search for virtual operationsinclude_reversible:boolean(optional) If set to true also operations from reversible block will be included if block_num points to such block.group_by_block(optional) true/falseoperation_begin(optional) starting virtual operation in given block (inclusive)limit(optional) a limit of retrieved operationsfilter(optional) a filter that decides which an operation matches - used bitwise filtering equals to position such as:fill_convert_request_operation = 0x000001author_reward_operation = 0x000002curation_reward_operation = 0x000004comment_reward_operation = 0x000008liquidity_reward_operation = 0x000010interest_operation = 0x000020fill_vesting_withdraw_operation = 0x000040fill_order_operation = 0x000080shutdown_witness_operation = 0x000100fill_transfer_from_savings_operation = 0x000200hardfork_operation = 0x000400comment_payout_update_operation = 0x000800return_vesting_delegation_operation = 0x001000comment_benefactor_reward_operation = 0x002000producer_reward_operation = 0x004000clear_null_account_balance_operation = 0x008000proposal_pay_operation = 0x010000sps_fund_operation = 0x020000hardfork_hive_operation = 0x040000hardfork_hive_restore_operation = 0x080000delayed_voting_operation = 0x100000consolidate_treasury_balance_operation = 0x200000effective_comment_vote_operation = 0x400000ineffective_delete_comment_operation = 0x800000sps_convert_operation = 0x1000000dhf_funding_operation = 0x0020000dhf_conversion_operation = 0x1000000expired_account_notification_operation = 0x2000000changed_recovery_account_operation = 0x4000000transfer_to_vesting_completed_operation = 0x8000000pow_reward_operation = 0x10000000vesting_shares_split_operation = 0x20000000account_created_operation = 0x40000000fill_collateralized_convert_request_operation = 0x80000000system_warning_operation = 0x100000000fill_recurrent_transfer_operation = 0x200000000failed_recurrent_transfer_operation = 0x400000000limit_order_cancelled_operation = 0x800000000producer_missed_operation = 0x1000000000proposal_fee_operation = 0x2000000000collateralized_convert_immediate_conversion_operation = 0x4000000000escrow_approved_operation = 0x8000000000escrow_rejected_operation = 0x10000000000proxy_cleared_operation = 0x20000000000
Query Parameters JSON
{
"block_range_begin": 1,
"block_range_end": 2,
"include_reversible": true,
"group_by_block": false,
"operation_begin": 0,
"limit": 1000,
"filter": 1
}
Expected Response JSON
{
"ops": [
{
"trx_id": "0000000000000000000000000000000000000000",
"block": 0,
"trx_in_block": 4294967295,
"op_in_trx": 0,
"virtual_op": 0,
"timestamp": "2016-03-24T17:46:30",
"op": {},
"operation_id": "18446744069414584320"
}
],
"ops_by_block": [],
"next_block_range_begin": 2,
"next_operation_begin": 0
}
Example curl
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.enum_virtual_ops", "params":{"block_range_begin":1,"block_range_end":2}, "id":1}' https://api.hive.blog
curl -s --data '{"jsonrpc":"2.0", "method":"account_history_api.enum_virtual_ops", "params":{"block_range_begin":1,"block_range_end":2,"include_reversible":true}, "id":1}' https://api.hive.blog