Improve pairlistparam types
This commit is contained in:
@@ -16,13 +16,33 @@ from freqtrade.mixins import LoggingMixin
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class PairlistParameter(TypedDict):
|
class __PairlistParameterBase(TypedDict):
|
||||||
type: Literal["number", "string", "boolean"]
|
|
||||||
default: Union[int, float, str, bool, None]
|
|
||||||
description: str
|
description: str
|
||||||
help: 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):
|
class IPairList(LoggingMixin, ABC):
|
||||||
|
|
||||||
def __init__(self, exchange: Exchange, pairlistmanager,
|
def __init__(self, exchange: Exchange, pairlistmanager,
|
||||||
|
|||||||
Reference in New Issue
Block a user