Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesc #71

Merged
merged 2 commits into from
Jan 10, 2025
Merged

Mesc #71

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
7 changes: 7 additions & 0 deletions trading_backend/exchanges/mexc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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()
Loading