adjusted get_order_history() rest endpoint

This commit is contained in:
itsdeka
2021-11-22 16:09:59 +01:00
parent 83b0a5ecb6
commit bf3c5f57ab
4 changed files with 16 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
1.2.5
-) Adjusted get_order_history() rest endpoint
1.2.4
-) Added example of MARKET order with price=None

View File

@@ -427,11 +427,18 @@ class BfxRest:
@return Array <models.Order>
"""
endpoint = "auth/r/orders/{}/hist".format(symbol)
params = "?start={}&end={}&limit={}&sort={}".format(
start, end, limit, sort)
payload = {}
if start:
payload['start'] = start
if end:
payload['end'] = end
if limit:
payload['limit'] = limit
if sort:
payload['sort'] = sort
if ids:
params += "&id=" + ",".join(str(id) for id in ids)
raw_orders = await self.post(endpoint, params=params)
payload['id'] = ids
raw_orders = await self.post(endpoint, payload)
return [Order.from_raw_order(ro) for ro in raw_orders]
async def get_active_position(self):

View File

@@ -2,4 +2,4 @@
This module contains the current version of the bfxapi lib
"""
__version__ = '1.2.4'
__version__ = '1.2.5'

View File

@@ -11,7 +11,7 @@ from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='bitfinex-api-py',
version='1.2.4',
version='1.2.5',
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',