From b95dc57f0eb188f3ea210340dfe84b749f19549e Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 3 Sep 2020 06:43:41 +0200 Subject: [PATCH] Enhance types for dashboard component --- src/types/daily.ts | 2 ++ src/types/index.ts | 1 + src/types/profit.ts | 25 +++++++++++++++++++++++++ src/views/Dashboard.vue | 4 ++-- 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/types/profit.ts diff --git a/src/types/daily.ts b/src/types/daily.ts index 3bd2a2b7..b44d0d89 100644 --- a/src/types/daily.ts +++ b/src/types/daily.ts @@ -12,4 +12,6 @@ export interface DailyRecord { export interface DailyReturnValue { data: Array; + fiat_display_currency: string; + stake_currency: string; } diff --git a/src/types/index.ts b/src/types/index.ts index 7acdc170..456a06a8 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -2,4 +2,5 @@ export * from './auth'; export * from './blacklist'; export * from './chart'; export * from './daily'; +export * from './profit'; export * from './types'; diff --git a/src/types/profit.ts b/src/types/profit.ts new file mode 100644 index 00000000..64c1ac74 --- /dev/null +++ b/src/types/profit.ts @@ -0,0 +1,25 @@ +export interface ProfitInterface { + profit_closed_coin: number; + profit_closed_percent_mean: number; + profit_closed_ratio_mean: number; + profit_closed_percent_sum: number; + profit_closed_ratio_sum: number; + profit_closed_fiat: number; + profit_all_coin: number; + profit_all_percent_mean: number; + profit_all_ratio_mean: number; + profit_all_percent_sum: number; + profit_all_ratio_sum: number; + profit_all_fiat: number; + trade_count: number; + closed_trade_count: number; + first_trade_date: string; + first_trade_timestamp: number; + latest_trade_date: string; + latest_trade_timestamp: number; + avg_duration: string; + best_pair: string; + best_rate: number; + winning_trades: number; + losing_trades: number; +} diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 11561695..38c352b3 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -55,7 +55,7 @@ import DailyChart from '@/components/charts/DailyChart.vue'; import HourlyChart from '@/components/charts/HourlyChart.vue'; import CumProfitChart from '@/components/charts/CumProfitChart.vue'; -import { Trade, DailyReturnValue, BalanceInterface } from '@/types'; +import { Trade, DailyReturnValue, BalanceInterface, ProfitInterface } from '@/types'; const ftbot = namespace('ftbot'); @@ -75,7 +75,7 @@ export default class Trading extends Vue { @ftbot.State balance!: BalanceInterface; - @ftbot.State profit!: BalanceInterface; + @ftbot.State profit!: ProfitInterface; @ftbot.State performanceStats!: Array;