get_public_trades() orders should be sorted by [timestamp, id] (#127)

Co-authored-by: Robert Kowalski <robert@bitfinex.com>

 - solved the merge conflict in CHANGELOG
This commit is contained in:
Dario Moceri
2021-04-09 16:24:32 +02:00
committed by GitHub
parent d198ccb7a7
commit 4b4a17ebd8
4 changed files with 39 additions and 2 deletions

View File

@@ -133,7 +133,7 @@ class BfxRest:
params = "?start={}&end={}&limit={}&sort={}".format(
start, end, limit, sort)
trades = await self.fetch(endpoint, params=params)
return trades
return sorted(trades, key=lambda x: (x[1], x[0]), reverse=True if sort == 1 else False)
async def get_public_books(self, symbol, precision="P0", length=25):
"""