From 484943a640d3eb920afb835f5041b7d58fa0442e Mon Sep 17 00:00:00 2001 From: Axel-CH Date: Mon, 17 Mar 2025 15:05:58 -0400 Subject: [PATCH] feat: set trade_id as required param in list_custom_data, add key as optional --- ft_client/freqtrade_client/ft_rest_client.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ft_client/freqtrade_client/ft_rest_client.py b/ft_client/freqtrade_client/ft_rest_client.py index dfdbb0a6a..5b5f3acf2 100755 --- a/ft_client/freqtrade_client/ft_rest_client.py +++ b/ft_client/freqtrade_client/ft_rest_client.py @@ -269,17 +269,18 @@ class FtRestClient: params["offset"] = offset return self._get("trades", params) - def list_custom_data(self, trade_id=None, key=None): - """Lists custom_data of the running bot. + def list_custom_data(self, trade_id, key=None): + """List custom_data of the running bot for specific trade. - :param tradeid: Optional keyword argument - Id of the trade + :param tradeid: keyword argument - Id of the trade + :param key: Optional keyword argument - key of the custom-data :return: json object """ params = {} - trade_id = -1 - if trade_id is not None: - params["trade_id"] = trade_id + params["trade_id"] = trade_id + if key is not None: + params["key"] = key return self._get("trades/{tradeid}/custom_data", params=params)