diff --git a/CHANGELOG b/CHANGELOG index f972440..351bdaa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +1.3.0 +-) Adjusted get_trades() to allow symbol to be None and get trades for all symbols + 1.2.8 -) Bugfix - It is possible to call bfx.ws.run() from an already running event loop diff --git a/bfxapi/examples/rest/get_authenticated_data.py b/bfxapi/examples/rest/get_authenticated_data.py index 9cf2adc..0efd74f 100644 --- a/bfxapi/examples/rest/get_authenticated_data.py +++ b/bfxapi/examples/rest/get_authenticated_data.py @@ -39,7 +39,7 @@ async def log_active_positions(): [ print (p) for p in positions ] async def log_trades(): - trades = await bfx.rest.get_trades('tBTCUSD', 0, then) + trades = await bfx.rest.get_trades(symbol='tBTCUSD', start=0, end=then) print ("Trades:") [ print (t) for t in trades] diff --git a/bfxapi/rest/bfx_rest.py b/bfxapi/rest/bfx_rest.py index e305666..81fff4a 100644 --- a/bfxapi/rest/bfx_rest.py +++ b/bfxapi/rest/bfx_rest.py @@ -465,7 +465,7 @@ class BfxRest: raw_trades = await self.post(endpoint) return [Trade.from_raw_rest_trade(rt) for rt in raw_trades] - async def get_trades(self, symbol, start, end, limit=25): + async def get_trades(self, start, end, symbol=None, limit=25): """ Get all of the trades between the start and end period associated with API_KEY - Requires authentication. @@ -477,7 +477,7 @@ class BfxRest: @param limit int: max number of items in response @return Array """ - endpoint = "auth/r/trades/{}/hist".format(symbol) + endpoint = "auth/r/trades/{}/hist".format(symbol) if symbol else "auth/r/trades/hist" params = "?start={}&end={}&limit={}".format(start, end, limit) raw_trades = await self.post(endpoint, params=params) return [Trade.from_raw_rest_trade(rt) for rt in raw_trades] diff --git a/bfxapi/version.py b/bfxapi/version.py index e9e4434..e4840b6 100644 --- a/bfxapi/version.py +++ b/bfxapi/version.py @@ -2,4 +2,4 @@ This module contains the current version of the bfxapi lib """ -__version__ = '1.2.8' +__version__ = '1.3.0' diff --git a/setup.py b/setup.py index ffda49f..a5227e7 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ from os import path here = path.abspath(path.dirname(__file__)) setup( name='bitfinex-api-py', - version='1.2.8', + version='1.3.0', 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',