From 5f5e9b952af9373830f29b7c1a44c710629c35e0 Mon Sep 17 00:00:00 2001 From: sndmndss Date: Wed, 15 May 2024 17:27:38 +0200 Subject: [PATCH 1/3] Changes according to 2024-05-02 changelog --- bpx/account.py | 6 ++++-- bpx/base/base_account.py | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bpx/account.py b/bpx/account.py index bc9a00f..97c494e 100644 --- a/bpx/account.py +++ b/bpx/account.py @@ -35,8 +35,10 @@ def get_deposit_address(self, blockchain: str, window: int = None): url, headers, params = super().get_deposit_address(blockchain, window) return self.http_client.get(url, headers=headers, params=params) - def get_withdrawals(self, limit: int = 100, offset: int = 0, window: int = None): - url, headers, params = super().get_withdrawals(limit, offset, window) + def get_withdrawals(self, limit: int = 100, offset: int = 0, + __from: int = None, to: int = None, window: int = None): + + url, headers, params = super().get_withdrawals(limit, offset, __from, to, window) return self.http_client.get(url, headers=headers, params=params) def withdrawal(self, address: str, diff --git a/bpx/base/base_account.py b/bpx/base/base_account.py index aa8af41..33a7083 100644 --- a/bpx/base/base_account.py +++ b/bpx/base/base_account.py @@ -51,12 +51,16 @@ def get_deposit_address(self, blockchain: str, window: int): url = self.BPX_API_URL + 'wapi/v1/capital/deposit/address' return url, headers, params - def get_withdrawals(self, limit: int, offset: int, window: int): + def get_withdrawals(self, limit: int, offset: int, __from: int, to: int, window: int): if limit > 1000 or limit < 0: raise LimitValueError if offset < 0: raise NegativeValueError(offset) params = {'limit': limit, 'offset': offset} + if __from: + params['from'] = __from + if to: + params['to'] = to headers = self._headers(params, 'withdrawalQueryAll', window=window) url = self.BPX_API_URL + 'wapi/v1/capital/withdrawals' return url, headers, params From 05ae0a113be42132d553a5a37f7feb1b653d0e68 Mon Sep 17 00:00:00 2001 From: sndmndss Date: Wed, 15 May 2024 17:29:11 +0200 Subject: [PATCH 2/3] 1.1.4 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 729ffed..4589602 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bpx-py" -version = "1.1.3" +version = "1.1.4" description = "Backpack API SDK tool" authors = ["sndmndss "] readme = "README.md" From 1e898039665fc356a6a51392c79f7a2c37016772 Mon Sep 17 00:00:00 2001 From: sndmndss Date: Wed, 15 May 2024 17:35:28 +0200 Subject: [PATCH 3/3] Changes according to 2024-05-02 changelog --- bpx/__async/account.py | 6 ++++-- bpx/__async/public.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bpx/__async/account.py b/bpx/__async/account.py index c74539a..9959b7a 100644 --- a/bpx/__async/account.py +++ b/bpx/__async/account.py @@ -33,8 +33,10 @@ async def get_deposit_address(self, blockchain: str, window: int = None): url, headers, params = super().get_deposit_address(blockchain, window) return await self.http_client.get(url, headers=headers, params=params) - async def get_withdrawals(self, limit: int = 100, offset: int = 0, window: int = None): - url, headers, params = super().get_withdrawals(limit, offset, window) + async def get_withdrawals(self, limit: int = 100, offset: int = 0, + __from: int = None,to: int = None, window: int = None): + + url, headers, params = super().get_withdrawals(limit, offset, __from, to, window) return await self.http_client.get(url, headers=headers, params=params) async def withdrawal(self, address: str, diff --git a/bpx/__async/public.py b/bpx/__async/public.py index 593618b..4581a97 100644 --- a/bpx/__async/public.py +++ b/bpx/__async/public.py @@ -22,7 +22,7 @@ async def get_ticker(self, symbol: str): async def get_depth(self, symbol: str): return await self.http_client.get(self.get_depth_url(symbol)) - async def get_klines(self, symbol: str, interval: str, start_time=0, end_time=0): + async def get_klines(self, symbol: str, interval: str, start_time: int, end_time=0): return await self.http_client.get(self.get_klines_url(symbol, interval, start_time, end_time)) async def get_status(self):