Skip to content

Commit

Permalink
Resolve "Add start, end, and cursor parameters to `kraken.spot.…
Browse files Browse the repository at this point in the history
…Funding.get_recent_deposits_status`" (#170)
  • Loading branch information
btschwertfeger authored Oct 21, 2023
1 parent aae3fe5 commit 9b4cd39
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
21 changes: 18 additions & 3 deletions kraken/spot/funding.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,12 @@ def get_recent_deposits_status(
self: Funding,
asset: Optional[str] = None,
method: Optional[str] = None,
start: Optional[str] = None,
end: Optional[str] = None,
cursor: bool | str = False, # noqa: FBT002
*,
extra_params: Optional[dict] = None,
) -> list[dict]:
) -> list[dict] | dict:
"""
Get information about the recent deposit status. The look back period is 90 days and
only the last 25 deposits will be returned.
Expand All @@ -171,8 +174,15 @@ def get_recent_deposits_status(
:type asset: str, optional
:param method: Filter by deposit method
:type method: str, optional
:param start: Start timestamp
:type start: str, optional
:param end: End timestamp
:type end: str, optional
:param cursor: If bool: dis-/enable paginated responses; if str: cursor
for next page
:type cursor: bool | str, default: ``False``
:return: The user specific deposit history
:rtype: list[dict]
:rtype: list[dict] | dict
.. code-block:: python
:linenos:
Expand Down Expand Up @@ -218,11 +228,16 @@ def get_recent_deposits_status(
}, ...
]
"""
params: dict = {}
params: dict = {"cursor": cursor}
if defined(asset):
params["asset"] = asset
if defined(method):
params["method"] = method
if defined(start):
params["start"] = start
if defined(end):
params["end"] = end

return self._request( # type: ignore[return-value]
method="POST",
uri="/private/DepositStatus",
Expand Down
10 changes: 10 additions & 0 deletions tests/spot/test_spot_funding.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ def test_get_recent_deposits_status(spot_auth_funding: Funding) -> None:
spot_auth_funding.get_recent_deposits_status(asset="XLM", method="Stellar XLM"),
list,
)
assert isinstance(
spot_auth_funding.get_recent_deposits_status(
asset="XLM",
method="Stellar XLM",
start=1688992722,
end=1688999722,
cursor=True,
),
dict,
)


@pytest.mark.spot()
Expand Down
1 change: 0 additions & 1 deletion tests/spot/test_spot_orderbook_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def test_get_first() -> None:
)


@pytest.mark.wip()
@pytest.mark.spot()
@pytest.mark.spot_orderbook()
@mock.patch("kraken.spot.orderbook_v1.KrakenSpotWSClientV1", return_value=None)
Expand Down
1 change: 0 additions & 1 deletion tests/spot/test_spot_orderbook_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def test_get_first() -> None:
)


@pytest.mark.wip()
@pytest.mark.spot()
@pytest.mark.spot_orderbook()
@mock.patch("kraken.spot.orderbook_v2.KrakenSpotWSClientV2", return_value=None)
Expand Down

0 comments on commit 9b4cd39

Please sign in to comment.