BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
The history_api class implements the RPC API for account history. More...
#include <api.hpp>
Classes | |
struct | history_operation_detail |
Public Member Functions | |
history_api (application &app) | |
vector< operation_history_object > | get_account_history (const std::string &account_name_or_id, operation_history_id_type stop=operation_history_id_type(), uint32_t limit=application_options::get_default().api_limit_get_account_history, operation_history_id_type start=operation_history_id_type()) const |
Get the history of operations related to the specified account. More... | |
vector< operation_history_object > | get_account_history_by_time (const std::string &account_name_or_id, const optional< uint32_t > &limit=optional< uint32_t >(), const optional< fc::time_point_sec > &start=optional< fc::time_point_sec >()) const |
Get the history of operations related to the specified account no later than the specified time. More... | |
history_operation_detail | get_account_history_by_operations (const std::string &account_name_or_id, const flat_set< uint16_t > &operation_types, uint32_t start, uint32_t limit) const |
Get the history of operations related to the specified account filtering by operation types. More... | |
vector< operation_history_object > | get_account_history_operations (const std::string &account_name_or_id, int64_t operation_type, operation_history_id_type start=operation_history_id_type(), operation_history_id_type stop=operation_history_id_type(), uint32_t limit=application_options::get_default().api_limit_get_account_history_operations) const |
Get the history of operations related to the specified account filtering by operation type. More... | |
vector< operation_history_object > | get_relative_account_history (const std::string &account_name_or_id, uint64_t stop=0, uint32_t limit=application_options::get_default().api_limit_get_relative_account_history, uint64_t start=0) const |
Get the history of operations related to the specified account referenced by an event numbering specific to the account. The current number of operations for the account can be found in the account statistics (or use 0 for start). More... | |
vector< operation_history_object > | get_block_operation_history (uint32_t block_num, const optional< uint16_t > &trx_in_block={}) const |
Get all operations within a block or a transaction, including virtual operations. More... | |
vector< operation_history_object > | get_block_operations_by_time (const optional< fc::time_point_sec > &start=optional< fc::time_point_sec >()) const |
Get all operations, including virtual operations, within the most recent block (no later than the specified time) containing at least one operation. More... | |
vector< order_history_object > | get_fill_order_history (const std::string &a, const std::string &b, uint32_t limit) const |
Get details of order executions occurred most recently in a trading pair. More... | |
vector< bucket_object > | get_market_history (const std::string &a, const std::string &b, uint32_t bucket_seconds, const fc::time_point_sec &start, const fc::time_point_sec &end) const |
Get OHLCV data of a trading pair in a time range. More... | |
flat_set< uint32_t > | get_market_history_buckets () const |
Get OHLCV time bucket lengths supported (configured) by this API server. More... | |
vector< liquidity_pool_history_object > | get_liquidity_pool_history (liquidity_pool_id_type pool_id, const optional< fc::time_point_sec > &start=optional< fc::time_point_sec >(), const optional< fc::time_point_sec > &stop=optional< fc::time_point_sec >(), const optional< uint32_t > &limit=optional< uint32_t >(), const optional< int64_t > &operation_type=optional< int64_t >()) const |
Get history of a liquidity pool. More... | |
vector< liquidity_pool_history_object > | get_liquidity_pool_history_by_sequence (liquidity_pool_id_type pool_id, const optional< uint64_t > &start=optional< uint64_t >(), const optional< fc::time_point_sec > &stop=optional< fc::time_point_sec >(), const optional< uint32_t > &limit=optional< uint32_t >(), const optional< int64_t > &operation_type=optional< int64_t >()) const |
Get history of a liquidity pool. More... | |
The history_api class implements the RPC API for account history.
This API contains methods to access account histories
|
explicit |
vector< operation_history_object > graphene::app::history_api::get_account_history | ( | const std::string & | account_name_or_id, |
operation_history_id_type | stop = operation_history_id_type() , |
||
uint32_t | limit = application_options::get_default().api_limit_get_account_history , |
||
operation_history_id_type | start = operation_history_id_type() |
||
) | const |
Get the history of operations related to the specified account.
account_name_or_id | The account name or ID whose history should be queried |
stop | ID of the earliest operation to retrieve |
limit | Maximum number of operations to retrieve, must not exceed the configured value of api_limit_get_account_history |
start | ID of the most recent operation to retrieve |
history_api::history_operation_detail graphene::app::history_api::get_account_history_by_operations | ( | const std::string & | account_name_or_id, |
const flat_set< uint16_t > & | operation_types, | ||
uint32_t | start, | ||
uint32_t | limit | ||
) | const |
Get the history of operations related to the specified account filtering by operation types.
account_name_or_id | The account name or ID whose history should be queried |
operation_types | The IDs of the operation we want to get operations in the account ( 0 = transfer , 1 = limit order create, ...) |
start | the sequence number where to start looping back through the history |
limit | the max number of entries to return (from start number), must not exceed the configured value of api_limit_get_account_history_by_operations |
vector< operation_history_object > graphene::app::history_api::get_account_history_by_time | ( | const std::string & | account_name_or_id, |
const optional< uint32_t > & | limit = optional<uint32_t>() , |
||
const optional< fc::time_point_sec > & | start = optional<fc::time_point_sec>() |
||
) | const |
Get the history of operations related to the specified account no later than the specified time.
account_name_or_id | The account name or ID whose history should be queried |
limit | Maximum number of operations to retrieve, must not exceed the configured value of api_limit_get_account_history |
start | the time point to start looping back through history |
account_name_or_id
cannot be tied to an account, an empty list will be returnedlimit
can be omitted or be null, if so the configured value of api_limit_get_account_history will be usedstart
can be omitted or be null, if so the api will return the "first page" of the historyvector< operation_history_object > graphene::app::history_api::get_account_history_operations | ( | const std::string & | account_name_or_id, |
int64_t | operation_type, | ||
operation_history_id_type | start = operation_history_id_type() , |
||
operation_history_id_type | stop = operation_history_id_type() , |
||
uint32_t | limit = application_options::get_default().api_limit_get_account_history_operations |
||
) | const |
Get the history of operations related to the specified account filtering by operation type.
account_name_or_id | The account name or ID whose history should be queried |
operation_type | The type of the operation we want to get operations in the account ( 0 = transfer , 1 = limit order create, ...) |
stop | ID of the earliest operation to retrieve |
limit | Maximum number of operations to retrieve, must not exceed the configured value of api_limit_get_account_history_operations |
start | ID of the most recent operation to retrieve |
vector< operation_history_object > graphene::app::history_api::get_block_operation_history | ( | uint32_t | block_num, |
const optional< uint16_t > & | trx_in_block = {} |
||
) | const |
Get all operations within a block or a transaction, including virtual operations.
block_num | the number (height) of the block to fetch |
trx_in_block | the sequence of a transaction in the block, starts from 0, optional. If specified, will return only operations of that transaction. If omitted, will return all operations in the specified block. |
vector< operation_history_object > graphene::app::history_api::get_block_operations_by_time | ( | const optional< fc::time_point_sec > & | start = optional<fc::time_point_sec>() | ) | const |
Get all operations, including virtual operations, within the most recent block (no later than the specified time) containing at least one operation.
start | time point, optional, if omitted, the data of the latest block containing at least one operation will be returned |
vector< order_history_object > graphene::app::history_api::get_fill_order_history | ( | const std::string & | a, |
const std::string & | b, | ||
uint32_t | limit | ||
) | const |
Get details of order executions occurred most recently in a trading pair.
a | Asset symbol or ID in a trading pair |
b | The other asset symbol or ID in the trading pair |
limit | Maximum records to return |
vector< liquidity_pool_history_object > graphene::app::history_api::get_liquidity_pool_history | ( | liquidity_pool_id_type | pool_id, |
const optional< fc::time_point_sec > & | start = optional<fc::time_point_sec>() , |
||
const optional< fc::time_point_sec > & | stop = optional<fc::time_point_sec>() , |
||
const optional< uint32_t > & | limit = optional<uint32_t>() , |
||
const optional< int64_t > & | operation_type = optional<int64_t>() |
||
) | const |
Get history of a liquidity pool.
pool_id | ID of the liquidity pool to query |
start | A UNIX timestamp. Optional. If specified, only the operations occurred not later than this time will be returned. |
stop | A UNIX timestamp. Optional. If specified, only the operations occurred later than this time will be returned. |
limit | Maximum quantity of operations in the history to retrieve. Optional. If not specified, the configured value of api_limit_get_liquidity_pool_history will be used. If specified, it must not exceed the configured value of api_limit_get_liquidity_pool_history. |
operation_type | Optional. If specified, only the operations whose type is the specified type will be returned. Otherwise all operations will be returned. |
limit
occurred in the same second, this API only returns the most recent records, the rest records can be retrieved with the get_liquidity_pool_history_by_sequence API.vector< liquidity_pool_history_object > graphene::app::history_api::get_liquidity_pool_history_by_sequence | ( | liquidity_pool_id_type | pool_id, |
const optional< uint64_t > & | start = optional<uint64_t>() , |
||
const optional< fc::time_point_sec > & | stop = optional<fc::time_point_sec>() , |
||
const optional< uint32_t > & | limit = optional<uint32_t>() , |
||
const optional< int64_t > & | operation_type = optional<int64_t>() |
||
) | const |
Get history of a liquidity pool.
pool_id | ID of the liquidity pool to query |
start | An Integer. Optional. If specified, only the operations whose sequences are not greater than this will be returned. |
stop | A UNIX timestamp. Optional. If specified, only operations occurred later than this time will be returned. |
limit | Maximum quantity of operations in the history to retrieve. Optional. If not specified, the configured value of api_limit_get_liquidity_pool_history will be used. If specified, it must not exceed the configured value of api_limit_get_liquidity_pool_history. |
operation_type | Optional. If specified, only the operations whose type is the specified type will be returned. Otherwise all operations will be returned. |
vector< bucket_object > graphene::app::history_api::get_market_history | ( | const std::string & | a, |
const std::string & | b, | ||
uint32_t | bucket_seconds, | ||
const fc::time_point_sec & | start, | ||
const fc::time_point_sec & | end | ||
) | const |
Get OHLCV data of a trading pair in a time range.
a | Asset symbol or ID in a trading pair |
b | The other asset symbol or ID in the trading pair |
bucket_seconds | Length of each time bucket in seconds. Note: it need to be within result of get_market_history_buckets() API, otherwise no data will be returned |
start | The start of a time range, E.G. "2018-01-01T00:00:00" |
end | The end of the time range |
flat_set< uint32_t > graphene::app::history_api::get_market_history_buckets | ( | ) | const |
vector< operation_history_object > graphene::app::history_api::get_relative_account_history | ( | const std::string & | account_name_or_id, |
uint64_t | stop = 0 , |
||
uint32_t | limit = application_options::get_default().api_limit_get_relative_account_history , |
||
uint64_t | start = 0 |
||
) | const |
Get the history of operations related to the specified account referenced by an event numbering specific to the account. The current number of operations for the account can be found in the account statistics (or use 0 for start).
account_name_or_id | The account name or ID whose history should be queried |
stop | Sequence number of earliest operation. 0 is default and will query 'limit' number of operations. |
limit | Maximum number of operations to retrieve, must not exceed the configured value of api_limit_get_relative_account_history |
start | Sequence number of the most recent operation to retrieve. 0 is default, which will start querying from the most recent operation. |