diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dbf356..e9b2470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.2.32] - 2025-01-11 +### Updated +- [MEXC] add _get_api_key_rights + ## [1.2.31] - 2025-01-09 ### Updated - [Binance] handle futures trading rights diff --git a/README.md b/README.md index 38ab409..311f479 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# trading-backend [1.2.31](https://github.com/Drakkar-Software/trading-backend/tree/master/CHANGELOG.md) +# trading-backend [1.2.32](https://github.com/Drakkar-Software/trading-backend/tree/master/CHANGELOG.md) [![PyPI](https://img.shields.io/pypi/v/trading-backend.svg)](https://pypi.python.org/pypi/trading-backend/) [![Downloads](https://pepy.tech/badge/trading-backend/month)](https://pepy.tech/project/trading-backend) [![Github-Action-CI](https://github.com/Drakkar-Software/trading-backend/workflows/trading-backend-CI/badge.svg)](https://github.com/Drakkar-Software/trading-backend/actions) diff --git a/setup.py b/setup.py index 1bf2a64..a20d42f 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ from setuptools import find_packages from setuptools import setup -VERSION = "1.2.31" +VERSION = "1.2.32" PROJECT_NAME = "trading-backend" PACKAGES = find_packages(exclude=["tests"]) diff --git a/trading_backend/exchanges/mexc.py b/trading_backend/exchanges/mexc.py index 71f43c0..079f001 100644 --- a/trading_backend/exchanges/mexc.py +++ b/trading_backend/exchanges/mexc.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU Lesser General Public # License along with this library. import trading_backend.exchanges as exchanges +import trading_backend.enums class MEXC(exchanges.Exchange): @@ -30,3 +31,9 @@ def get_orders_parameters(self, params=None) -> dict: if self._exchange.connector.client.options.get("broker", "") != self._get_id(): self._exchange.connector.client.options["broker"] = self._get_id() return super().get_orders_parameters(params) + + async def _get_api_key_rights(self) -> list[trading_backend.enums.APIKeyRights]: + # It is currently impossible to fetch api key permissions: try to cancel an imaginary order, + # if a permission error is raised instead of a cancel fail, then trading permissions are missing. + # updated: 10/01/2025 + return await self._get_api_key_rights_using_order()