python-binance icon indicating copy to clipboard operation
python-binance copied to clipboard

client.futures_account_balance() fails while other api is working well

Open OldChi opened this issue 2 years ago • 1 comments

Describe the bug I could call client.get_account() successfully without Exception, but calling client.futures_account_balance() leads to BinanceAPIException.

To Reproduce File e:\Python\Python310\lib\site-packages\binance\client.py:6055, in Client.futures_account_balance(self, **params) 6049 def futures_account_balance(self, **params): 6050 """Get futures account balance 6051 6052 https://binance-docs.github.io/apidocs/futures/en/#future-account-balance-user_data 6053 6054 """ -> 6055 return self._request_futures_api('get', 'balance', True, data=params)

File e:\Python\Python310\lib\site-packages\binance\client.py:339, in Client._request_futures_api(self, method, path, signed, **kwargs) 336 def _request_futures_api(self, method, path, signed=False, **kwargs) -> Dict: 337 uri = self._create_futures_api_uri(path) --> 339 return self._request(method, uri, signed, True, **kwargs)

File e:\Python\Python310\lib\site-packages\binance\client.py:315, in Client._request(self, method, uri, signed, force_params, **kwargs) 312 kwargs = self._get_request_kwargs(method, signed, force_params, **kwargs) 314 self.response = getattr(self.session, method)(uri, **kwargs) --> 315 return self._handle_response(self.response)

File e:\Python\Python310\lib\site-packages\binance\client.py:324, in Client._handle_response(response) 319 """Internal helper for handling API responses from the Binance server. 320 Raises the appropriate exceptions when necessary; otherwise, returns the 321 response. 322 """ 323 if not (200 <= response.status_code < 300): --> 324 raise BinanceAPIException(response, response.status_code, response.text) 325 try: 326 return response.json()

BinanceAPIException: APIError(code=-2015): Invalid API-key, IP, or permissions for action, request ip:

OldChi avatar Feb 15 '23 13:02 OldChi

The same Error

chan1919 avatar Jun 07 '23 18:06 chan1919