diff --git a/ft_client/freqtrade_client/ft_rest_client.py b/ft_client/freqtrade_client/ft_rest_client.py index 1a10cd7d8..20e6d6f6e 100755 --- a/ft_client/freqtrade_client/ft_rest_client.py +++ b/ft_client/freqtrade_client/ft_rest_client.py @@ -7,7 +7,7 @@ so it can be used as a standalone script, and can be installed independently. import json import logging -from typing import Optional +from typing import Any, Dict, List, Optional, Union from urllib.parse import urlencode, urlparse, urlunparse import requests @@ -16,6 +16,9 @@ from requests.exceptions import ConnectionError logger = logging.getLogger("ft_rest_client") +ParamsT = Optional[Dict[str, Any]] +PostDataT = Optional[Union[Dict[str, Any], List[Dict[str, Any]]]] + class FtRestClient: @@ -58,13 +61,13 @@ class FtRestClient: except ConnectionError: logger.warning("Connection error") - def _get(self, apipath, params: Optional[dict] = None): + def _get(self, apipath, params: ParamsT = None): return self._call("GET", apipath, params=params) - def _delete(self, apipath, params: Optional[dict] = None): + def _delete(self, apipath, params: ParamsT = None): return self._call("DELETE", apipath, params=params) - def _post(self, apipath, params: Optional[dict] = None, data: Optional[dict] = None): + def _post(self, apipath, params: ParamsT = None, data: PostDataT = None): return self._call("POST", apipath, params=params, data=data) def start(self):