From fc4a266b58ce802ea9cf6d1624d1c639b359e742 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 23 Nov 2021 07:33:21 +0100 Subject: [PATCH] Implement botApi in botstate --- src/store/modules/ftbot/index.ts | 4 ++++ src/types/types.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/store/modules/ftbot/index.ts b/src/store/modules/ftbot/index.ts index 1b81eaa8..15944e43 100644 --- a/src/store/modules/ftbot/index.ts +++ b/src/store/modules/ftbot/index.ts @@ -75,6 +75,7 @@ export enum BotStoreGetters { stakeCurrencyDecimals = 'stakeCurrencyDecimals', strategyPlotConfig = 'strategyPlotConfig', version = 'version', + botApiVersion = 'botApiVersion', sysinfo = 'sysinfo', profit = 'profit', botState = 'botState', @@ -252,6 +253,9 @@ export function createBotSubStore(botId: string, botName: string) { [BotStoreGetters.version](state: FtbotStateType): string { return state.botState?.version || state.version; }, + [BotStoreGetters.botApiVersion](state: FtbotStateType): number { + return state.botState?.api_version || 1.0; + }, [BotStoreGetters.sysinfo](state: FtbotStateType): SysInfoResponse | {} { return state.sysinfo; }, diff --git a/src/types/types.ts b/src/types/types.ts index baec5a5a..ca266836 100644 --- a/src/types/types.ts +++ b/src/types/types.ts @@ -78,6 +78,8 @@ export interface BidStrategy extends PriceBase { export interface BotState { version: string; + /** Api version - was not provided prior to 1.1 (or 2021.11) */ + api_version?: number; dry_run: boolean; trading_mode?: string; short_allowed?: boolean;