Improve pairlistparam types

This commit is contained in:
Matthias 2023-04-20 07:03:27 +02:00
parent 2ea157d9d3
commit 4636de30cd

View File

@ -16,13 +16,33 @@ from freqtrade.mixins import LoggingMixin
logger = logging.getLogger(__name__)
class PairlistParameter(TypedDict):
type: Literal["number", "string", "boolean"]
default: Union[int, float, str, bool, None]
class __PairlistParameterBase(TypedDict):
description: str
help: str
class __NumberPairlistParameter(__PairlistParameterBase):
type: Literal["number"]
default: Union[int, float, None]
class __StringPairlistParameter(__PairlistParameterBase):
type: Literal["string"]
default: Union[str, None]
class __BoolPairlistParameter(__PairlistParameterBase):
type: Literal["boolean"]
default: Union[bool, None]
PairlistParameter = Union[
__NumberPairlistParameter,
__StringPairlistParameter,
__BoolPairlistParameter
]
class IPairList(LoggingMixin, ABC):
def __init__(self, exchange: Exchange, pairlistmanager,