From a3c880b18d8d0860911fe0238e43570d00a0a88e Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Sat, 12 Oct 2024 19:35:01 +0200 Subject: [PATCH 1/2] [Community] add exchange_id --- .../supabase_backend/community_supabase_client.py | 9 ++++++--- octobot/community/supabase_backend/enums.py | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/octobot/community/supabase_backend/community_supabase_client.py b/octobot/community/supabase_backend/community_supabase_client.py index 53b53081f..636980a99 100644 --- a/octobot/community/supabase_backend/community_supabase_client.py +++ b/octobot/community/supabase_backend/community_supabase_client.py @@ -449,14 +449,17 @@ async def fetch_bot_profile_data(self, bot_config_id: str) -> commons_profiles.P if profile_data.trader_simulator.enabled: # attempt 1: set exchange using exchange_id when set in bot_config exchange_ids = [ - config["exchange_id"] + config[enums.ExchangeKeys.EXCHANGE_ID.value] for config in bot_config["exchanges"] - if config.get("exchange_id", None) + if config.get(enums.ExchangeKeys.EXCHANGE_ID.value, None) ] if exchange_ids: exchanges = await self.fetch_exchanges(exchange_ids) exchanges_config = [ - {enums.ExchangeKeys.INTERNAL_NAME.value: exchange[enums.ExchangeKeys.INTERNAL_NAME.value]} + { + enums.ExchangeKeys.INTERNAL_NAME.value: exchange[enums.ExchangeKeys.INTERNAL_NAME.value], + enums.ExchangeKeys.EXCHANGE_ID.value: exchange[enums.ExchangeKeys.ID.value], + } for exchange in exchanges ] else: diff --git a/octobot/community/supabase_backend/enums.py b/octobot/community/supabase_backend/enums.py index 6b49cbdc0..5770f5bac 100644 --- a/octobot/community/supabase_backend/enums.py +++ b/octobot/community/supabase_backend/enums.py @@ -109,6 +109,8 @@ class ExchangeAccountStatuses(enum.Enum): class ExchangeKeys(enum.Enum): ID = "id" INTERNAL_NAME = "internal_name" + EXCHANGE_CREDENTIAL_ID = "exchange_credential_id" + EXCHANGE_ID = "exchange_id" class SignalKeys(enum.Enum): From fe9d8fc522592e0fcb0ee3eeee53840c2f733255 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Sat, 12 Oct 2024 19:37:37 +0200 Subject: [PATCH 2/2] [Requirements] bump --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4e9af4e32..ea079a3dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Drakkar-Software requirements -OctoBot-Commons==1.9.59 +OctoBot-Commons==1.9.60 OctoBot-Trading==2.4.114 OctoBot-Evaluators==1.9.7 OctoBot-Tentacles-Manager==2.9.16