Not all config values are mandatory in webserver mode

This commit is contained in:
Matthias 2021-04-02 20:00:14 +02:00
parent 17b3cc2097
commit 129c7b02d0
3 changed files with 13 additions and 15 deletions

View File

@ -118,17 +118,17 @@ class ShowConfig(BaseModel):
stake_currency_decimals: int stake_currency_decimals: int
max_open_trades: int max_open_trades: int
minimal_roi: Dict[str, Any] minimal_roi: Dict[str, Any]
stoploss: float stoploss: Optional[float]
trailing_stop: bool trailing_stop: Optional[bool]
trailing_stop_positive: Optional[float] trailing_stop_positive: Optional[float]
trailing_stop_positive_offset: Optional[float] trailing_stop_positive_offset: Optional[float]
trailing_only_offset_is_reached: Optional[bool] trailing_only_offset_is_reached: Optional[bool]
use_custom_stoploss: Optional[bool] use_custom_stoploss: Optional[bool]
timeframe: str timeframe: Optional[str]
timeframe_ms: int timeframe_ms: int
timeframe_min: int timeframe_min: int
exchange: str exchange: str
strategy: str strategy: Optional[str]
forcebuy_enabled: bool forcebuy_enabled: bool
ask_strategy: Dict[str, Any] ask_strategy: Dict[str, Any]
bid_strategy: Dict[str, Any] bid_strategy: Dict[str, Any]

View File

@ -11,15 +11,14 @@ from freqtrade.constants import USERPATH_STRATEGIES
from freqtrade.data.history import get_datahandler from freqtrade.data.history import get_datahandler
from freqtrade.exceptions import OperationalException from freqtrade.exceptions import OperationalException
from freqtrade.rpc import RPC from freqtrade.rpc import RPC
from freqtrade.rpc.api_server.api_schemas import (AvailablePairs, from freqtrade.rpc.api_server.api_schemas import (AvailablePairs, Balances, BlacklistPayload,
Balances, BlacklistPayload, BlacklistResponse, BlacklistResponse, Count, Daily,
Count, Daily, DeleteLockRequest, DeleteTrade, DeleteLockRequest, DeleteTrade, ForceBuyPayload,
ForceBuyPayload, ForceBuyResponse, ForceBuyResponse, ForceSellPayload, Locks, Logs,
ForceSellPayload, Locks, Logs, OpenTradeSchema, OpenTradeSchema, PairHistory, PerformanceEntry,
PairHistory, PerformanceEntry, Ping, PlotConfig, Ping, PlotConfig, Profit, ResultMsg, ShowConfig,
Profit, ResultMsg, ShowConfig, Stats, StatusMsg, Stats, StatusMsg, StrategyListResponse,
StrategyListResponse, StrategyResponse, Version, StrategyResponse, Version, WhitelistResponse)
WhitelistResponse)
from freqtrade.rpc.api_server.deps import get_config, get_rpc, get_rpc_optional from freqtrade.rpc.api_server.deps import get_config, get_rpc, get_rpc_optional
from freqtrade.rpc.rpc import RPCException from freqtrade.rpc.rpc import RPCException
@ -260,4 +259,3 @@ def list_available_pairs(timeframe: Optional[str] = None, stake_currency: Option
'pair_interval': pair_interval, 'pair_interval': pair_interval,
} }
return result return result

View File

@ -109,10 +109,10 @@ class ApiServer(RPCHandler):
def configure_app(self, app: FastAPI, config): def configure_app(self, app: FastAPI, config):
from freqtrade.rpc.api_server.api_auth import http_basic_or_jwt_token, router_login from freqtrade.rpc.api_server.api_auth import http_basic_or_jwt_token, router_login
from freqtrade.rpc.api_server.api_backtest import router as api_backtest
from freqtrade.rpc.api_server.api_v1 import router as api_v1 from freqtrade.rpc.api_server.api_v1 import router as api_v1
from freqtrade.rpc.api_server.api_v1 import router_public as api_v1_public from freqtrade.rpc.api_server.api_v1 import router_public as api_v1_public
from freqtrade.rpc.api_server.web_ui import router_ui from freqtrade.rpc.api_server.web_ui import router_ui
from freqtrade.rpc.api_server.api_backtest import router as api_backtest
app.include_router(api_v1_public, prefix="/api/v1") app.include_router(api_v1_public, prefix="/api/v1")