Bitshares-Core  2.0.181105
BitShares blockchain implementation and command-line interface software
Public Member Functions | List of all members
graphene::app::history_api Class Reference

The history_api class implements the RPC API for account history. More...

#include <api.hpp>

Public Member Functions

 history_api (application &app)
 
vector< operation_history_objectget_account_history (const std::string account_id_or_name, operation_history_id_type stop=operation_history_id_type(), unsigned limit=100, operation_history_id_type start=operation_history_id_type()) const
 Get operations relevant to the specificed account. More...
 
history_operation_detail get_account_history_by_operations (const std::string account_id_or_name, vector< uint16_t > operation_types, uint32_t start, unsigned limit)
 Get operations relevant to the specified account filtering by operation type. More...
 
vector< operation_history_objectget_account_history_operations (const std::string account_id_or_name, int operation_id, operation_history_id_type start=operation_history_id_type(), operation_history_id_type stop=operation_history_id_type(), unsigned limit=100) const
 Get only asked operations relevant to the specified account. More...
 
vector< operation_history_objectget_relative_account_history (const std::string account_id_or_name, uint64_t stop=0, unsigned limit=100, uint64_t start=0) const
 
vector< order_history_object > get_fill_order_history (asset_id_type a, asset_id_type b, uint32_t limit) const
 Get details of order executions occurred most recently in a trading pair. More...
 
vector< bucket_object > get_market_history (asset_id_type a, asset_id_type b, uint32_t bucket_seconds, fc::time_point_sec start, 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...
 

Detailed Description

The history_api class implements the RPC API for account history.

This API contains methods to access account histories

Definition at line 116 of file api.hpp.

Constructor & Destructor Documentation

◆ history_api()

graphene::app::history_api::history_api ( application app)
inline

Definition at line 119 of file api.hpp.

Member Function Documentation

◆ get_account_history()

vector< operation_history_object > graphene::app::history_api::get_account_history ( const std::string  account_id_or_name,
operation_history_id_type  stop = operation_history_id_type(),
unsigned  limit = 100,
operation_history_id_type  start = operation_history_id_type() 
) const

Get operations relevant to the specificed account.

Parameters
account_id_or_nameThe account ID or name whose history should be queried
stopID of the earliest operation to retrieve
limitMaximum number of operations to retrieve (must not exceed 100)
startID of the most recent operation to retrieve
Returns
A list of operations performed by account, ordered from most recent to oldest.

Definition at line 311 of file api.cpp.

◆ get_account_history_by_operations()

history_operation_detail graphene::app::history_api::get_account_history_by_operations ( const std::string  account_id_or_name,
vector< uint16_t >  operation_types,
uint32_t  start,
unsigned  limit 
)

Get operations relevant to the specified account filtering by operation type.

Parameters
account_id_or_nameThe account ID or name whose history should be queried
operation_typesThe IDs of the operation we want to get operations in the account ( 0 = transfer , 1 = limit order create, ...)
startthe sequence number where to start looping back throw the history
limitthe max number of entries to return (from start number)
Returns
history_operation_detail

Definition at line 430 of file api.cpp.

◆ get_account_history_operations()

vector< operation_history_object > graphene::app::history_api::get_account_history_operations ( const std::string  account_id_or_name,
int  operation_id,
operation_history_id_type  start = operation_history_id_type(),
operation_history_id_type  stop = operation_history_id_type(),
unsigned  limit = 100 
) const

Get only asked operations relevant to the specified account.

Parameters
account_id_or_nameThe account ID or name whose history should be queried
operation_idThe ID of the operation we want to get operations in the account ( 0 = transfer , 1 = limit order create, ...)
stopID of the earliest operation to retrieve
limitMaximum number of operations to retrieve (must not exceed 100)
startID of the most recent operation to retrieve
Returns
A list of operations performed by account, ordered from most recent to oldest.

Definition at line 346 of file api.cpp.

◆ get_fill_order_history()

vector< order_history_object > graphene::app::history_api::get_fill_order_history ( asset_id_type  a,
asset_id_type  b,
uint32_t  limit 
) const

Get details of order executions occurred most recently in a trading pair.

Parameters
aOne asset in a trading pair
bThe other asset in the trading pair
limitMaximum records to return
Returns
a list of order_history objects, in "most recent first" order

Definition at line 286 of file api.cpp.

◆ get_market_history()

vector< bucket_object > graphene::app::history_api::get_market_history ( asset_id_type  a,
asset_id_type  b,
uint32_t  bucket_seconds,
fc::time_point_sec  start,
fc::time_point_sec  end 
) const

Get OHLCV data of a trading pair in a time range.

Parameters
aOne asset in a trading pair
bThe other asset in the trading pair
bucket_secondsLength 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
startThe start of a time range, E.G. "2018-01-01T00:00:00"
endThe end of the time range
Returns
A list of OHLCV data, in "least recent first" order. If there are more than 200 records in the specified time range, the first 200 records will be returned.

Definition at line 445 of file api.cpp.

◆ get_market_history_buckets()

flat_set< uint32_t > graphene::app::history_api::get_market_history_buckets ( ) const

Get OHLCV time bucket lengths supported (configured) by this API server.

Returns
A list of time bucket lengths in seconds. E.G. if the result contains a number "300", it means this API server supports OHLCV data aggregated in 5-minute buckets.

Definition at line 423 of file api.cpp.

◆ get_relative_account_history()

vector< operation_history_object > graphene::app::history_api::get_relative_account_history ( const std::string  account_id_or_name,
uint64_t  stop = 0,
unsigned  limit = 100,
uint64_t  start = 0 
) const

Get operations relevant 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).

Parameters
account_id_or_nameThe account ID or name whose history should be queried
stopSequence number of earliest operation. 0 is default and will query 'limit' number of operations.
limitMaximum number of operations to retrieve (must not exceed 100)
startSequence number of the most recent operation to retrieve. 0 is default, which will start querying from the most recent operation.
Returns
A list of operations performed by account, ordered from most recent to oldest.

Definition at line 386 of file api.cpp.


The documentation for this class was generated from the following files: