privex.steemengine.SteemEngineToken.SteemEngineToken.get_orderbook¶
- SteemEngineToken.get_orderbook(symbol, direction='buy', user=None, limit=200, offset=0, indexes: Optional[list] = None, sort_by: str = 'price', sort_reverse=None, **query) List[SEOrder][source]¶
Get a list of open Steem/Hive Engine orders for a given symbol, by default will display
'buy'orders unless you setdirectionto'sell'- NOTE: By default, if
directionis'buy', then the orders will be returned sorted by price - descending (highest first), and for
sell- ascending (lowest first).
Example:
>>> st = SteemEngineToken() >>> o = st.get_orderbook('ENG', direction='sell') >>> o[0] <SEOrder account='someguy123' price='0.99' symbol='ENG' quantity='885.40249121'> >>> str(o[0].timestamp) '2019-07-26 10:46:18'
Sort by highest quantity first:
>>> st.get_orderbook('BEE', 'sell', sort_by='quantity', sort_reverse=True)
Sort by oldest order first:
>>> st.get_orderbook('BEE', 'sell', sort_by='timestamp')
- Parameters
sort_reverse (bool) –
Trueto reverse sortsort_by(descending),Falseto NOT reverse (ascending). The defaultNonewill sort descending (reversed) whendirectionisbuy, and ascending forsell(direction-based sorting only applies whensort_byis'price')sort_by (str) – (Default:
price) The attribute ofSEOrderto sort by.symbol (str) – The symbol to get the open orders for
limit (int) – Amount of orders to retrieve
offset (int) – Offset selection by this many rows (for pagination)
indexes (list) – A list of dictionary indexes, e.g.
[dict(descending=False, index='timestamp')]user (str) – If
None, get all orders, otherwise only get orders by this user. Default:Nonedirection (str) – The direction of orders to get, either
buyorsellDefault:buy
- Raises
NoResult – Raised when
Noneis returned byrpc.find- Return List[SEOrder] orders
A list of
SEOrderobjects
- NOTE: By default, if