diff --git a/CHANGELOG.md b/CHANGELOG.md index 0635eb188..c10d83965 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ 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). +## [2.4.148] - 2025-01-20 +### Added +[Exchanges] support custom domains +[Exchanges] add INCLUDE_DISABLED_SYMBOLS_IN_AVAILABLE_SYMBOLS + ## [2.4.147] - 2025-01-13 ### Fixed [Exchange] properly propagate ExchangeOrderCancelError diff --git a/README.md b/README.md index 816d63117..9fc51f645 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# OctoBot-Trading [2.4.147](https://github.com/Drakkar-Software/OctoBot-Trading/blob/master/CHANGELOG.md) +# OctoBot-Trading [2.4.148](https://github.com/Drakkar-Software/OctoBot-Trading/blob/master/CHANGELOG.md) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/903b6b22bceb4661b608a86fea655f69)](https://app.codacy.com/gh/Drakkar-Software/OctoBot-Trading?utm_source=github.com&utm_medium=referral&utm_content=Drakkar-Software/OctoBot-Trading&utm_campaign=Badge_Grade_Dashboard) [![PyPI](https://img.shields.io/pypi/v/OctoBot-Trading.svg)](https://pypi.python.org/pypi/OctoBot-Trading/) [![Coverage Status](https://coveralls.io/repos/github/Drakkar-Software/OctoBot-Trading/badge.svg?branch=master)](https://coveralls.io/github/Drakkar-Software/OctoBot-Trading?branch=master) diff --git a/octobot_trading/__init__.py b/octobot_trading/__init__.py index 44dc2467c..da29193b5 100644 --- a/octobot_trading/__init__.py +++ b/octobot_trading/__init__.py @@ -15,4 +15,4 @@ # License along with this library. PROJECT_NAME = "OctoBot-Trading" -VERSION = "2.4.147" # major.minor.revision +VERSION = "2.4.148" # major.minor.revision diff --git a/octobot_trading/exchanges/connectors/ccxt/ccxt_connector.py b/octobot_trading/exchanges/connectors/ccxt/ccxt_connector.py index c909d7865..98886d8d9 100644 --- a/octobot_trading/exchanges/connectors/ccxt/ccxt_connector.py +++ b/octobot_trading/exchanges/connectors/ccxt/ccxt_connector.py @@ -125,7 +125,7 @@ async def initialize_impl(self): ) # initialize symbols and timeframes - self.symbols = self.get_client_symbols(active_only=True) + self.symbols = self.exchange_manager.exchange.get_all_available_symbols(active_only=True) self.time_frames = self.get_client_time_frames() except (ccxt.ExchangeNotAvailable, ccxt.RequestTimeout) as e: diff --git a/octobot_trading/exchanges/types/rest_exchange.py b/octobot_trading/exchanges/types/rest_exchange.py index 400cf7ccf..378477be2 100644 --- a/octobot_trading/exchanges/types/rest_exchange.py +++ b/octobot_trading/exchanges/types/rest_exchange.py @@ -51,6 +51,8 @@ class RestExchange(abstract_exchange.AbstractExchange): # set True when get_fixed_market_status should adapt amounts for contract size # (amounts are in not kept as contract size with OctoBot) ADAPT_MARKET_STATUS_FOR_CONTRACT_SIZE = False + # set True when disabled symbols should still be considered (ex: mexc with its temporary api trading disabled symbols) + INCLUDE_DISABLED_SYMBOLS_IN_AVAILABLE_SYMBOLS = False REQUIRE_ORDER_FEES_FROM_TRADES = False # set True when get_order is not giving fees on closed orders and fees # should be fetched using recent trades. REQUIRE_CLOSED_ORDERS_FROM_RECENT_TRADES = False # set True when get_closed_orders is not supported @@ -731,7 +733,9 @@ def get_all_available_symbols(self, active_only=True) -> set[str]: """ :return: the list of all symbols supported by the exchange """ - return self.connector.get_client_symbols(active_only=active_only) + return self.connector.get_client_symbols( + active_only=False if self.INCLUDE_DISABLED_SYMBOLS_IN_AVAILABLE_SYMBOLS else active_only + ) async def get_all_tradable_symbols(self, active_only=True) -> set[str]: """ diff --git a/tests/exchanges/connectors/ccxt/test_ccxt_connector.py b/tests/exchanges/connectors/ccxt/test_ccxt_connector.py index c0ca7ef10..f6d15476d 100644 --- a/tests/exchanges/connectors/ccxt/test_ccxt_connector.py +++ b/tests/exchanges/connectors/ccxt/test_ccxt_connector.py @@ -62,7 +62,7 @@ def setSandboxMode(self, is_sandboxed): with patch.object(ccxt_connector, 'client', new=MockCCXT()) as mocked_ccxt, \ patch.object(ccxt_connector, '_ensure_auth', new=mock.AsyncMock()) as _ensure_auth_mock: await ccxt_connector.initialize_impl() - assert ccxt_connector.symbols == set() + assert len(ccxt_connector.symbols) == 171 # all enabled symbols assert ccxt_connector.time_frames == set() assert mocked_ccxt.set_markets_calls in ([[]], []) # depends on call order _ensure_auth_mock.assert_called_once() @@ -90,7 +90,7 @@ def setSandboxMode(self, is_sandboxed): with patch.object(ccxt_connector, 'client', new=MockCCXT()) as mocked_ccxt, \ patch.object(ccxt_connector, '_ensure_auth', new=mock.AsyncMock()) as _ensure_auth_mock: await ccxt_connector.initialize_impl() - assert ccxt_connector.symbols == set() + assert len(ccxt_connector.symbols) == 171 # all enabled symbols assert ccxt_connector.time_frames == set() assert mocked_ccxt.set_markets_calls in ([[]], []) # depends on call order _ensure_auth_mock.assert_called_once() @@ -127,12 +127,9 @@ def setSandboxMode(self, is_sandboxed): with patch.object(ccxt_connector, 'client', new=MockCCXT()) as mocked_ccxt, \ patch.object(ccxt_connector, '_ensure_auth', new=mock.AsyncMock()) as _ensure_auth_mock: + ccxt_connector.exchange_manager.exchange.INCLUDE_DISABLED_SYMBOLS_IN_AVAILABLE_SYMBOLS = True await ccxt_connector.initialize_impl() - assert ccxt_connector.symbols == { - "BTC/USDT", - "ETH/USDT", - "ETH/BTC", - } + assert len(ccxt_connector.symbols) == 541 # all enabled + diasabled symbols assert ccxt_connector.time_frames == { "1h", "2h",