Skip to content

Commit 4563042

Browse files
Fix kraken.spot.Market.get_recent_trades parameter 'since' (#120)
1 parent e973303 commit 4563042

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ Note: Authenticated Futures websocket clients can also un-/subscribe from/to pub
405405

406406
# 🆕 Contributions
407407

408-
... are welcome! - Please have a look at [CONTRIBUTION.md](./CONTRIBUTING.md).
408+
are welcome! - Please have a look at [CONTRIBUTION.md](./CONTRIBUTING.md).
409409

410410
---
411411

@@ -422,7 +422,7 @@ Note: Authenticated Futures websocket clients can also un-/subscribe from/to pub
422422

423423
<a name="notes"></a>
424424

425-
# 📝 Notes:
425+
# 📝 Notes
426426

427427
- Coding standards are not always followed to make arguments and function names as similar as possible to those in the Kraken API documentations.
428428

kraken/spot/market.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ def get_order_book(self: "Market", pair: str, count: Optional[int] = 100) -> dic
329329
)
330330

331331
def get_recent_trades(
332-
self: "Market", pair: str, since: Optional[Union[str, int]] = None
332+
self: "Market",
333+
pair: str,
334+
since: Optional[Union[str, int]] = None,
335+
count: Optional[int] = None,
333336
) -> dict:
334337
"""
335338
Get the latest trades for a specific trading pair (up to 1000).
@@ -340,6 +343,8 @@ def get_recent_trades(
340343
:type pair: str
341344
:param since: Filter trades since given timestamp (default: ``None``)
342345
:type since: str | int, optional
346+
:param count: The max number of results
347+
:type count: int, optional
343348
:return: The last public trades (up to 1000 results)
344349
:rtype: dict
345350
@@ -361,7 +366,9 @@ def get_recent_trades(
361366
"""
362367
params: dict = {"pair": pair}
363368
if defined(since):
364-
params["since"] = None
369+
params["since"] = since
370+
if defined(count):
371+
params["count"] = count
365372
return self._request( # type: ignore[return-value]
366373
method="GET", uri="/public/Trades", params=params, auth=False
367374
)

0 commit comments

Comments
 (0)