mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-06 14:20:24 +00:00
Improve pairlistparam types
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user