Skip to content

Commit 9b4cd39

Browse files
Resolve "Add start, end, and cursor parameters to kraken.spot.Funding.get_recent_deposits_status" (#170)
1 parent aae3fe5 commit 9b4cd39

4 files changed

Lines changed: 28 additions & 5 deletions

File tree

kraken/spot/funding.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,12 @@ def get_recent_deposits_status(
156156
self: Funding,
157157
asset: Optional[str] = None,
158158
method: Optional[str] = None,
159+
start: Optional[str] = None,
160+
end: Optional[str] = None,
161+
cursor: bool | str = False, # noqa: FBT002
159162
*,
160163
extra_params: Optional[dict] = None,
161-
) -> list[dict]:
164+
) -> list[dict] | dict:
162165
"""
163166
Get information about the recent deposit status. The look back period is 90 days and
164167
only the last 25 deposits will be returned.
@@ -171,8 +174,15 @@ def get_recent_deposits_status(
171174
:type asset: str, optional
172175
:param method: Filter by deposit method
173176
:type method: str, optional
177+
:param start: Start timestamp
178+
:type start: str, optional
179+
:param end: End timestamp
180+
:type end: str, optional
181+
:param cursor: If bool: dis-/enable paginated responses; if str: cursor
182+
for next page
183+
:type cursor: bool | str, default: ``False``
174184
:return: The user specific deposit history
175-
:rtype: list[dict]
185+
:rtype: list[dict] | dict
176186
177187
.. code-block:: python
178188
:linenos:
@@ -218,11 +228,16 @@ def get_recent_deposits_status(
218228
}, ...
219229
]
220230
"""
221-
params: dict = {}
231+
params: dict = {"cursor": cursor}
222232
if defined(asset):
223233
params["asset"] = asset
224234
if defined(method):
225235
params["method"] = method
236+
if defined(start):
237+
params["start"] = start
238+
if defined(end):
239+
params["end"] = end
240+
226241
return self._request( # type: ignore[return-value]
227242
method="POST",
228243
uri="/private/DepositStatus",

tests/spot/test_spot_funding.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ def test_get_recent_deposits_status(spot_auth_funding: Funding) -> None:
5959
spot_auth_funding.get_recent_deposits_status(asset="XLM", method="Stellar XLM"),
6060
list,
6161
)
62+
assert isinstance(
63+
spot_auth_funding.get_recent_deposits_status(
64+
asset="XLM",
65+
method="Stellar XLM",
66+
start=1688992722,
67+
end=1688999722,
68+
cursor=True,
69+
),
70+
dict,
71+
)
6272

6373

6474
@pytest.mark.spot()

tests/spot/test_spot_orderbook_v1.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def test_get_first() -> None:
6666
)
6767

6868

69-
@pytest.mark.wip()
7069
@pytest.mark.spot()
7170
@pytest.mark.spot_orderbook()
7271
@mock.patch("kraken.spot.orderbook_v1.KrakenSpotWSClientV1", return_value=None)

tests/spot/test_spot_orderbook_v2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def test_get_first() -> None:
6666
)
6767

6868

69-
@pytest.mark.wip()
7069
@pytest.mark.spot()
7170
@pytest.mark.spot_orderbook()
7271
@mock.patch("kraken.spot.orderbook_v2.KrakenSpotWSClientV2", return_value=None)

0 commit comments

Comments
 (0)