LUCIT-Systems-and-Development / unicorn-binance-rest-api

A Python SDK by LUCIT to use the Binance REST API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, us, tr) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-rest-api.docs.lucit.tech
Other
61 stars 17 forks source link

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

Closed vunovikov closed 6 months ago

vunovikov commented 1 year ago

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.

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?

Genyok commented 1 year ago

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

vunovikov commented 1 year ago

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

maximborodin commented 1 year ago

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

Genyok commented 1 year ago

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)
vunovikov commented 1 year ago

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

oliver-zehentleitner commented 6 months ago

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!