diff --git a/CHANGELOG b/CHANGELOG index c0bded5a..54f19e5b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ 1.1.15 +-) Added 'ids' parameter to get_order_history() -) Added an example to show how it is possible to spawn multiple bfx ws instances to comply with the open subscriptions number constraint (max. 25) -) Implemented Funding Trades (rest) diff --git a/bfxapi/rest/bfx_rest.py b/bfxapi/rest/bfx_rest.py index a4d91743..9a970579 100644 --- a/bfxapi/rest/bfx_rest.py +++ b/bfxapi/rest/bfx_rest.py @@ -397,7 +397,7 @@ async def get_active_orders(self, symbol): raw_orders = await self.post(endpoint) return [Order.from_raw_order(ro) for ro in raw_orders] - async def get_order_history(self, symbol, start, end, limit=25, sort=-1): + async def get_order_history(self, symbol, start, end, limit=25, sort=-1, ids=None): """ Get all of the orders between the start and end period associated with API_KEY - Requires authentication. @@ -407,11 +407,14 @@ async def get_order_history(self, symbol, start, end, limit=25, sort=-1): @param start int: millisecond start time @param end int: millisecond end time @param limit int: max number of items in response + @param ids list of int: allows you to retrieve specific orders by order ID (ids: [ID1, ID2, ID3]) @return Array """ endpoint = "auth/r/orders/{}/hist".format(symbol) params = "?start={}&end={}&limit={}&sort={}".format( start, end, limit, sort) + if ids: + params += "&id=" + ",".join(str(id) for id in ids) raw_orders = await self.post(endpoint, params=params) return [Order.from_raw_order(ro) for ro in raw_orders] diff --git a/setup.py b/setup.py index 7de3efd9..c638f7a3 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ here = path.abspath(path.dirname(__file__)) setup( name='bitfinex-api-py', - version='1.1.14', + version='1.1.15', description='Official Bitfinex Python API', long_description='A Python reference implementation of the Bitfinex API for both REST and websocket interaction', long_description_content_type='text/markdown',