mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 23:04:21 +01:00
Added 'ids' parameter to get_order_history() (#121)
* Added 'ids' parameter to get_order_history() * fix Co-authored-by: Robert Kowalski <robert@bitfinex.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
1.1.15
|
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)
|
-) 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)
|
-) Implemented Funding Trades (rest)
|
||||||
|
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ class BfxRest:
|
|||||||
raw_orders = await self.post(endpoint)
|
raw_orders = await self.post(endpoint)
|
||||||
return [Order.from_raw_order(ro) for ro in raw_orders]
|
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
|
Get all of the orders between the start and end period associated with API_KEY
|
||||||
- Requires authentication.
|
- Requires authentication.
|
||||||
@@ -407,11 +407,14 @@ class BfxRest:
|
|||||||
@param start int: millisecond start time
|
@param start int: millisecond start time
|
||||||
@param end int: millisecond end time
|
@param end int: millisecond end time
|
||||||
@param limit int: max number of items in response
|
@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 <models.Order>
|
@return Array <models.Order>
|
||||||
"""
|
"""
|
||||||
endpoint = "auth/r/orders/{}/hist".format(symbol)
|
endpoint = "auth/r/orders/{}/hist".format(symbol)
|
||||||
params = "?start={}&end={}&limit={}&sort={}".format(
|
params = "?start={}&end={}&limit={}&sort={}".format(
|
||||||
start, end, limit, sort)
|
start, end, limit, sort)
|
||||||
|
if ids:
|
||||||
|
params += "&id=" + ",".join(str(id) for id in ids)
|
||||||
raw_orders = await self.post(endpoint, params=params)
|
raw_orders = await self.post(endpoint, params=params)
|
||||||
return [Order.from_raw_order(ro) for ro in raw_orders]
|
return [Order.from_raw_order(ro) for ro in raw_orders]
|
||||||
|
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -11,7 +11,7 @@ from os import path
|
|||||||
here = path.abspath(path.dirname(__file__))
|
here = path.abspath(path.dirname(__file__))
|
||||||
setup(
|
setup(
|
||||||
name='bitfinex-api-py',
|
name='bitfinex-api-py',
|
||||||
version='1.1.14',
|
version='1.1.15',
|
||||||
description='Official Bitfinex Python API',
|
description='Official Bitfinex Python API',
|
||||||
long_description='A Python reference implementation of the Bitfinex API for both REST and websocket interaction',
|
long_description='A Python reference implementation of the Bitfinex API for both REST and websocket interaction',
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
|
|||||||
Reference in New Issue
Block a user