Golos
Разработчикам Статистика Баунти Документация Партнеры Github
Public Member Functions | List of all members
golos::market_history::market_history_api Class Reference

#include <market_history_api.hpp>

Public Member Functions

 market_history_api (const golos::application::api_context &ctx)
 
void on_api_startup ()
 
void set_subscribe_callback (std::function< void(const variant &)> cb, bool clear_filter)
 
void set_pending_transaction_callback (std::function< void(const variant &)> cb)
 
void set_block_applied_callback (std::function< void(const variant &block_id)> cb)
 
void cancel_all_subscriptions ()
 Stop receiving any notifications. More...
 
void subscribe_to_market (std::function< void(const variant &)> callback, const string &a, const string &b)
 Request notification when the active orders in the market between two assets changes. More...
 
void unsubscribe_from_market (const string &a, const string &b)
 Unsubscribe from updates to a given market. More...
 
std::vector< golos::application::extended_limit_orderget_limit_orders_by_owner (const string &owner) const
 
std::vector< call_order_objectget_call_orders_by_owner (const string &owner) const
 
std::vector< force_settlement_objectget_settle_orders_by_owner (const string &owner) const
 
market_ticker get_ticker (const string &base, const string &quote) const
 Returns the ticker for the market assetA:assetB. More...
 
market_volume get_volume (const string &base, const string &quote) const
 Returns the 24 hour volume for the market assetA:assetB. More...
 
order_book get_order_book (const string &base, const string &quote, unsigned limit=50) const
 Returns the order book for the market base:quote. More...
 
std::vector< market_tradeget_trade_history (const string &base, const string &quote, fc::time_point_sec start, fc::time_point_sec stop, unsigned limit=100) const
 Returns recent trades for the market assetA:assetB Note: Currently, timezone offsets are not supported. The time must be UTC. More...
 
vector< order_history_objectget_fill_order_history (const string &a, const string &b, uint32_t limit) const
 
vector< bucket_objectget_market_history (const string &a, const string &b, uint32_t bucket_seconds, fc::time_point_sec start, fc::time_point_sec end) const
 Returns the market history for the internal SBD:STEEM market. More...
 
flat_set< uint32_t > get_market_history_buckets () const
 Returns the bucket seconds being tracked by the plugin. More...
 
vector< limit_order_objectget_limit_orders (const string &a, const string &b, uint32_t limit) const
 Get limit orders in a given market. More...
 
vector< call_order_objectget_call_orders (const string &a, uint32_t limit) const
 Get call orders in a given asset. More...
 
vector< force_settlement_objectget_settle_orders (const string &a, uint32_t limit) const
 Get forced settlement orders in a given asset. More...
 
vector< collateral_bid_objectget_collateral_bids (const asset_name_type asset, uint32_t limit, uint32_t start) const
 Get collateral_bid_objects for a given asset. More...
 
vector< call_order_objectget_margin_positions (const string &name) const
 
std::vector< liquidity_balanceget_liquidity_queue (const string &start_account, uint32_t limit=1000) const
 

Detailed Description

Definition at line 74 of file market_history_api.hpp.

Constructor & Destructor Documentation

◆ market_history_api()

golos::market_history::market_history_api::market_history_api ( const golos::application::api_context ctx)

Definition at line 702 of file market_history_api.cpp.

Member Function Documentation

◆ cancel_all_subscriptions()

void golos::market_history::market_history_api::cancel_all_subscriptions ( )

Stop receiving any notifications.

This unsubscribes from all subscribed markets and objects.

Definition at line 789 of file market_history_api.cpp.

◆ get_call_orders()

vector< call_order_object > golos::market_history::market_history_api::get_call_orders ( const string &  a,
uint32_t  limit 
) const

Get call orders in a given asset.

Parameters
aID of asset being called
limitMaximum number of orders to retrieve
Returns
The call orders, ordered from earliest to be called to latest

Definition at line 764 of file market_history_api.cpp.

◆ get_call_orders_by_owner()

std::vector< call_order_object > golos::market_history::market_history_api::get_call_orders_by_owner ( const string &  owner) const

Definition at line 824 of file market_history_api.cpp.

◆ get_collateral_bids()

vector< collateral_bid_object > golos::market_history::market_history_api::get_collateral_bids ( const asset_name_type  asset,
uint32_t  limit,
uint32_t  start 
) const

Get collateral_bid_objects for a given asset.

Parameters
aID of asset
limitMaximum number of objects to retrieve
startskip that many results
Returns
The settle orders, ordered from earliest settlement date to latest

Definition at line 841 of file market_history_api.cpp.

◆ get_fill_order_history()

vector< order_history_object > golos::market_history::market_history_api::get_fill_order_history ( const string &  a,
const string &  b,
uint32_t  limit 
) const

Definition at line 735 of file market_history_api.cpp.

◆ get_limit_orders()

vector< limit_order_object > golos::market_history::market_history_api::get_limit_orders ( const string &  a,
const string &  b,
uint32_t  limit 
) const

Get limit orders in a given market.

Parameters
aID of asset being sold
bID of asset being purchased
limitMaximum number of orders to retrieve
Returns
The limit orders, ordered from least price to greatest

Definition at line 757 of file market_history_api.cpp.

◆ get_limit_orders_by_owner()

std::vector< golos::application::extended_limit_order > golos::market_history::market_history_api::get_limit_orders_by_owner ( const string &  owner) const

Definition at line 817 of file market_history_api.cpp.

◆ get_liquidity_queue()

std::vector< liquidity_balance > golos::market_history::market_history_api::get_liquidity_queue ( const string &  start_account,
uint32_t  limit = 1000 
) const

Gets the current liquidity reward queue.

Parameters
start_accountThe account to start the list from, or "" to get the head of the queue
limitMaxmimum number of accounts to return – Must not exceed 1000

Definition at line 782 of file market_history_api.cpp.

◆ get_margin_positions()

vector< call_order_object > golos::market_history::market_history_api::get_margin_positions ( const string &  name) const
Returns
all open margin positions for a given account id.

Definition at line 770 of file market_history_api.cpp.

◆ get_market_history()

vector< bucket_object > golos::market_history::market_history_api::get_market_history ( const string &  a,
const string &  b,
uint32_t  bucket_seconds,
fc::time_point_sec  start,
fc::time_point_sec  end 
) const

Returns the market history for the internal SBD:STEEM market.

Parameters
bucket_secondsThe size of buckets the history is broken into. The bucket size must be configured in the plugin options.
startThe start time to get market history.
endThe end time to get market history
Returns
A list of market history buckets.

Definition at line 742 of file market_history_api.cpp.

◆ get_market_history_buckets()

flat_set< uint32_t > golos::market_history::market_history_api::get_market_history_buckets ( ) const

Returns the bucket seconds being tracked by the plugin.

Definition at line 750 of file market_history_api.cpp.

◆ get_order_book()

order_book golos::market_history::market_history_api::get_order_book ( const string &  base,
const string &  quote,
unsigned  limit = 50 
) const

Returns the order book for the market base:quote.

Parameters
baseString name of the first asset
quoteString name of the second asset
depthof the order book. Up to depth of each asks and bids, capped at 50. Prioritizes most moderate of each
Returns
Order book of the market

Definition at line 721 of file market_history_api.cpp.

◆ get_settle_orders()

vector< force_settlement_object > golos::market_history::market_history_api::get_settle_orders ( const string &  a,
uint32_t  limit 
) const

Get forced settlement orders in a given asset.

Parameters
aID of asset being settled
limitMaximum number of orders to retrieve
Returns
The settle orders, ordered from earliest settlement date to latest

Definition at line 776 of file market_history_api.cpp.

◆ get_settle_orders_by_owner()

std::vector< force_settlement_object > golos::market_history::market_history_api::get_settle_orders_by_owner ( const string &  owner) const

Definition at line 830 of file market_history_api.cpp.

◆ get_ticker()

market_ticker golos::market_history::market_history_api::get_ticker ( const string &  base,
const string &  quote 
) const

Returns the ticker for the market assetA:assetB.

Parameters
aString name of the first asset
bString name of the second asset
Returns
The market ticker for the past 24 hours.

Definition at line 709 of file market_history_api.cpp.

◆ get_trade_history()

std::vector< market_trade > golos::market_history::market_history_api::get_trade_history ( const string &  base,
const string &  quote,
fc::time_point_sec  start,
fc::time_point_sec  stop,
unsigned  limit = 100 
) const

Returns recent trades for the market assetA:assetB Note: Currently, timezone offsets are not supported. The time must be UTC.

Parameters
aString name of the first asset
bString name of the second asset
stopStop time as a UNIX timestamp
limitNumber of transactions to retrieve, capped at 100
startStart time as a UNIX timestamp
Returns
Recent transactions in the market

Definition at line 727 of file market_history_api.cpp.

◆ get_volume()

market_volume golos::market_history::market_history_api::get_volume ( const string &  base,
const string &  quote 
) const

Returns the 24 hour volume for the market assetA:assetB.

Parameters
aString name of the first asset
bString name of the second asset
Returns
The market volume over the past 24 hours

Definition at line 715 of file market_history_api.cpp.

◆ on_api_startup()

void golos::market_history::market_history_api::on_api_startup ( )

Definition at line 706 of file market_history_api.cpp.

◆ set_block_applied_callback()

void golos::market_history::market_history_api::set_block_applied_callback ( std::function< void(const variant &block_id)>  cb)

Definition at line 807 of file market_history_api.cpp.

◆ set_pending_transaction_callback()

void golos::market_history::market_history_api::set_pending_transaction_callback ( std::function< void(const variant &)>  cb)

Definition at line 801 of file market_history_api.cpp.

◆ set_subscribe_callback()

void golos::market_history::market_history_api::set_subscribe_callback ( std::function< void(const variant &)>  cb,
bool  clear_filter 
)

Definition at line 795 of file market_history_api.cpp.

◆ subscribe_to_market()

void golos::market_history::market_history_api::subscribe_to_market ( std::function< void(const variant &)>  callback,
const string &  a,
const string &  b 
)

Request notification when the active orders in the market between two assets changes.

Parameters
callbackCallback method which is called when the market changes
aFirst asset ID
bSecond asset ID

Callback will be passed a variant containing a vector<pair<operation, operation_result>>. The vector will contain, in order, the operations which changed the market, and their results.

Definition at line 836 of file market_history_api.cpp.

◆ unsubscribe_from_market()

void golos::market_history::market_history_api::unsubscribe_from_market ( const string &  a,
const string &  b 
)

Unsubscribe from updates to a given market.

Parameters
aFirst asset ID
bSecond asset ID

Definition at line 813 of file market_history_api.cpp.


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