Skip to content

Commit

Permalink
Merge pull request #8 from sndmndss/dev
Browse files Browse the repository at this point in the history
Changes according to 2024-05-02 changelog
  • Loading branch information
sndmndss authored May 15, 2024
2 parents b86ceac + 1e89803 commit 4d4aa03
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
6 changes: 4 additions & 2 deletions bpx/__async/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion bpx/__async/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 4 additions & 2 deletions bpx/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion bpx/base/base_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "bpx-py"
version = "1.1.3"
version = "1.1.4"
description = "Backpack API SDK tool"
authors = ["sndmndss <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 4d4aa03

Please sign in to comment.