Skip to content

Commit e29140b

Browse files
author
OpenCoderX
authored
use correct account status path if the tld is .us, add param for version in Client.get_account_status
The paths for the .com and .us account status endpoints have diverged. We now check the tld configured in the Client and use path 'accountStatus' if the tld is .us. We also allow the caller to pass an api version, which defaults to 1 if not passed. This leaves the functionality the same for traders lucky enough to interact with the .com api.
1 parent e974c34 commit e29140b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

binance/client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2251,11 +2251,12 @@ def get_system_status(self):
22512251
"""
22522252
return self._request_margin_api('get', 'system/status')
22532253

2254-
def get_account_status(self, **params):
2254+
def get_account_status(self, version=1,**params):
22552255
"""Get account status detail.
22562256
22572257
https://binance-docs.github.io/apidocs/spot/en/#account-status-sapi-user_data
2258-
2258+
:param version: the api version
2259+
:param version: int
22592260
:param recvWindow: the number of milliseconds the request is valid for
22602261
:type recvWindow: int
22612262
@@ -2268,7 +2269,11 @@ def get_account_status(self, **params):
22682269
}
22692270
22702271
"""
2271-
return self._request_margin_api('get', 'account/status', True, data=params)
2272+
if self.tld == 'us':
2273+
path = 'accountStatus'
2274+
else:
2275+
path = 'account/status'
2276+
return self._request_margin_api('get', path, True, version, data=params)
22722277

22732278
def get_account_api_trading_status(self, **params):
22742279
"""Fetch account api trading status detail.

0 commit comments

Comments
 (0)