Enhance types for dashboard component

This commit is contained in:
Matthias 2020-09-03 06:43:41 +02:00
parent 32e56ed3d8
commit b95dc57f0e
4 changed files with 30 additions and 2 deletions

View File

@ -12,4 +12,6 @@ export interface DailyRecord {
export interface DailyReturnValue {
data: Array<DailyRecord>;
fiat_display_currency: string;
stake_currency: string;
}

View File

@ -2,4 +2,5 @@ export * from './auth';
export * from './blacklist';
export * from './chart';
export * from './daily';
export * from './profit';
export * from './types';

25
src/types/profit.ts Normal file
View File

@ -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;
}

View File

@ -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<PerformanceEntry>;