Add strategy_version to API response

This commit is contained in:
Matthias
2021-12-04 14:49:45 +01:00
parent e3190cf8a8
commit d0467b30ba
5 changed files with 9 additions and 3 deletions

View File

@@ -145,6 +145,7 @@ class OrderTypes(BaseModel):
class ShowConfig(BaseModel):
version: str
strategy_version: Optional[str]
api_version: float
dry_run: bool
stake_currency: str

View File

@@ -121,9 +121,11 @@ def edge(rpc: RPC = Depends(get_rpc)):
@router.get('/show_config', response_model=ShowConfig, tags=['info'])
def show_config(rpc: Optional[RPC] = Depends(get_rpc_optional), config=Depends(get_config)):
state = ''
strategy_version = None
if rpc:
state = rpc._freqtrade.state
resp = RPC._rpc_show_config(config, state)
strategy_version = rpc._freqtrade.strategy.version()
resp = RPC._rpc_show_config(config, state, strategy_version)
resp['api_version'] = API_VERSION
return resp