Hive Developers logo

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:string
  • start:int. e.g.: -1 for reverse history or any positive numeric
  • limit:int up to 1000
  • include_reversible:boolean (optional) If set to true also operations from reversible block will be included
  • operation_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

account_history_api.get_ops_in_block

Returns all operations contained in a block. Parameter:

  • block_num:int
  • only_virtual:boolean
  • include_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
{
  "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:string trx_id of expected transaction
  • include_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:int starting block number (inclusive) to search for virtual operations
  • block_range_end:int last block number (exclusive) to search for virtual operations
  • include_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/false
  • operation_begin (optional) starting virtual operation in given block (inclusive)
  • limit (optional) a limit of retrieved operations
  • filter (optional) a filter that decides which an operation matches - used bitwise filtering equals to position such as:
    • fill_convert_request_operation = 0x000001
    • author_reward_operation = 0x000002
    • curation_reward_operation = 0x000004
    • comment_reward_operation = 0x000008
    • liquidity_reward_operation = 0x000010
    • interest_operation = 0x000020
    • fill_vesting_withdraw_operation = 0x000040
    • fill_order_operation = 0x000080
    • shutdown_witness_operation = 0x000100
    • fill_transfer_from_savings_operation = 0x000200
    • hardfork_operation = 0x000400
    • comment_payout_update_operation = 0x000800
    • return_vesting_delegation_operation = 0x001000
    • comment_benefactor_reward_operation = 0x002000
    • producer_reward_operation = 0x004000
    • clear_null_account_balance_operation = 0x008000
    • proposal_pay_operation = 0x010000
    • sps_fund_operation = 0x020000
    • hardfork_hive_operation = 0x040000
    • hardfork_hive_restore_operation = 0x080000
    • delayed_voting_operation = 0x100000
    • consolidate_treasury_balance_operation = 0x200000
    • effective_comment_vote_operation = 0x400000
    • ineffective_delete_comment_operation = 0x800000
    • sps_convert_operation = 0x1000000
    • dhf_funding_operation = 0x0020000
    • dhf_conversion_operation = 0x1000000
    • expired_account_notification_operation = 0x2000000
    • changed_recovery_account_operation = 0x4000000
    • transfer_to_vesting_completed_operation = 0x8000000
    • pow_reward_operation = 0x10000000
    • vesting_shares_split_operation = 0x20000000
    • account_created_operation = 0x40000000
    • fill_collateralized_convert_request_operation = 0x80000000
    • system_warning_operation = 0x100000000
    • fill_recurrent_transfer_operation = 0x200000000
    • failed_recurrent_transfer_operation = 0x400000000
    • limit_order_cancelled_operation = 0x800000000
    • producer_missed_operation = 0x1000000000
    • proposal_fee_operation = 0x2000000000
    • collateralized_convert_immediate_conversion_operation = 0x4000000000
    • escrow_approved_operation = 0x8000000000
    • escrow_rejected_operation = 0x10000000000
    • proxy_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