From d09a30cc671dc9b2b0f3626e8194b0b727545305 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 3 Dec 2021 15:33:58 +0100 Subject: [PATCH] OrderTypeValues should be in enums --- freqtrade/enums/__init__.py | 1 + freqtrade/enums/ordertypevalue.py | 6 ++++++ freqtrade/rpc/api_server/api_schemas.py | 7 +------ 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 freqtrade/enums/ordertypevalue.py diff --git a/freqtrade/enums/__init__.py b/freqtrade/enums/__init__.py index d803baf31..eab483db3 100644 --- a/freqtrade/enums/__init__.py +++ b/freqtrade/enums/__init__.py @@ -1,5 +1,6 @@ # flake8: noqa: F401 from freqtrade.enums.backteststate import BacktestState +from freqtrade.enums.ordertypevalue import OrderTypeValues from freqtrade.enums.rpcmessagetype import RPCMessageType from freqtrade.enums.runmode import NON_UTIL_MODES, OPTIMIZE_MODES, TRADING_MODES, RunMode from freqtrade.enums.selltype import SellType diff --git a/freqtrade/enums/ordertypevalue.py b/freqtrade/enums/ordertypevalue.py new file mode 100644 index 000000000..9bb716171 --- /dev/null +++ b/freqtrade/enums/ordertypevalue.py @@ -0,0 +1,6 @@ +from enum import Enum + + +class OrderTypeValues(str, Enum): + limit = 'limit' + market = 'market' diff --git a/freqtrade/rpc/api_server/api_schemas.py b/freqtrade/rpc/api_server/api_schemas.py index c1720a836..f9389d810 100644 --- a/freqtrade/rpc/api_server/api_schemas.py +++ b/freqtrade/rpc/api_server/api_schemas.py @@ -1,10 +1,10 @@ from datetime import date, datetime -from enum import Enum from typing import Any, Dict, List, Optional, Union from pydantic import BaseModel from freqtrade.constants import DATETIME_PRINT_FORMAT +from freqtrade.enums import OrderTypeValues class Ping(BaseModel): @@ -132,11 +132,6 @@ class UnfilledTimeout(BaseModel): exit_timeout_count: Optional[int] -class OrderTypeValues(str, Enum): - limit = 'limit' - market = 'market' - - class OrderTypes(BaseModel): buy: OrderTypeValues sell: OrderTypeValues