Skip to content

Commit

Permalink
feat(py-stellar-base/stellar_base/horizon.py): order_book suuports st…
Browse files Browse the repository at this point in the history
…ream
  • Loading branch information
overcat committed May 5, 2019
1 parent cce2e78 commit f54f9ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stellar_base/horizon.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def transaction_payments(self, tx_hash, cursor=None, order='asc', limit=10):
return self.query(endpoint, params)

def order_book(self, selling_asset_code, buying_asset_code, selling_asset_issuer=None, buying_asset_issuer=None,
limit=10):
limit=10, sse=False):
"""Return, for each orderbook, a summary of the orderbook and the bids
and asks associated with that orderbook.
Expand All @@ -486,6 +486,7 @@ def order_book(self, selling_asset_code, buying_asset_code, selling_asset_issuer
:param str buying_asset_issuer: Account ID of the issuer of the Asset being bought,
if it is a native asset, let it be `None`.
:param int limit: Limit the number of items returned.
:param bool sse: Use server side events for streaming responses.
:return: A list of orderbook summaries as a JSON object.
:rtype: dict
Expand All @@ -502,7 +503,7 @@ def order_book(self, selling_asset_code, buying_asset_code, selling_asset_issuer
}
endpoint = '/order_book'
params = self.__query_params(limit=limit, **asset_params)
return self.query(endpoint, params)
return self.query(endpoint, params, sse)

def ledgers(self, cursor=None, order='asc', limit=10, sse=False):
"""This endpoint represents all ledgers.
Expand Down

0 comments on commit f54f9ad

Please sign in to comment.