unicorn-binance-rest-api icon indicating copy to clipboard operation
unicorn-binance-rest-api copied to clipboard

GET /fapi/v1/account is retired, please use GET /fapi/v2/account

Open vunovikov opened this issue 1 year ago • 5 comments

Version of this library.

unicorn_fy: 0.12.2 unicorn_binance_local_depth_cache: 0.7.3 unicorn_binance_rest_api: 1.10.0 unicorn_binance_trailing_stop_loss: 0.8.0 unicorn_binance_websocket_api: 1.46.1

Solution to Issue cannot be found in the documentation or other Issues and also occurs in the latest version of this library.

  • [X] I checked the documentation and other Issues. I am using the latest version of this library.

Hardware?

Local server/workstation

Operating System?

Windows

Python version?

Python3.10

Installed packages

No response

Logging output

No response

Used endpoint?

binance.com-futures

Issue

I am getting the following error:

unicorn_binance_rest_api.exceptions.BinanceAPIException: APIError(code=-5000): GET /fapi/v1/account is retired, please use GET /fapi/v2/account

Can you tell me how I can fix it?

vunovikov avatar Aug 29 '23 12:08 vunovikov

From the binance api documentation.

2023-06-28

Notice:

REST

The following endpoints will no longer be supported from 2023-07-15: GET /fapi/v1/account GET /fapi/v1/balance GET /fapi/v1/positionRisk Please switch to corresponding v2 endpoints: GET /fapi/v2/account GET /fapi/v2/balance GET /fapi/v2/positionRisk

https://binance-docs.github.io/apidocs/futures/en/#change-log

Genyok avatar Aug 30 '23 17:08 Genyok

Thanks, I've already made the necessary edits to manager.py

vunovikov avatar Sep 01 '23 19:09 vunovikov

So will you release the new version with the fix soon?

maximborodin avatar Sep 22 '23 14:09 maximborodin

Make the changes yourself in manager.py. Here are the changes that I made for myself.

Function_create_futures_api_uri in manager.py.

def _create_futures_api_uri(self, path):
        if path == 'balance':
            api_version = self.FUTURES_API_VERSION2
        elif path == 'account':
            api_version = self.FUTURES_API_VERSION2
        elif path == 'positionRisk':
            api_version = self.FUTURES_API_VERSION2
        else:
            api_version = self.FUTURES_API_VERSION
        return self.FUTURES_URL + '/' + api_version + '/' + path

Function futures_exchange_info in manager.py

def futures_exchange_info(self):
        """Current exchange trading rules and symbol information

        https://binance-docs.github.io/apidocs/futures/en/#exchange-information-market_data

        """
        return self._request_futures_api('get', 'exchangeInfo', throw_exception=False)

Genyok avatar Sep 24 '23 10:09 Genyok

A new version of the library has appeared, but the necessary edits are still missing

vunovikov avatar Nov 12 '23 14:11 vunovikov

I am sorry that this has taken so long! I had to finance the project and implement the new licensing so that I could continue. From now on, updates like this will only take a few hours!

oliver-zehentleitner avatar May 09 '24 16:05 oliver-zehentleitner