Add some types to vuex actions

This commit is contained in:
Matthias 2020-06-22 08:04:28 +02:00
parent 3fdd4c0323
commit 222d9e9c40
3 changed files with 18 additions and 3 deletions

View File

@ -49,6 +49,7 @@
"sass-loader": "^10.0.2",
"typescript": "~4.0.2",
"vue-cli-plugin-bootstrap-vue": "~0.6.0",
"vue-template-compiler": "^2.6.12"
"vue-template-compiler": "^2.6.12",
"vuex-class": "^0.3.2"
}
}

View File

@ -1,5 +1,13 @@
import { api } from '@/shared/apiService';
import { BotState, BlacklistPayload, ForcebuyPayload, Logs, DailyPayload, Trade } from '@/types';
import {
BotState,
BlacklistPayload,
ForcebuyPayload,
Logs,
DailyPayload,
Trade,
PairHistoryPayload,
} from '@/types';
import { showAlert } from './alerts';
@ -113,7 +121,7 @@ export default {
.then((result) => commit('updateOpenTrades', result.data))
.catch(console.error);
},
getPairHistory({ commit }, payload) {
getPairHistory({ commit }, payload: PairHistoryPayload) {
if (payload.pair && payload.timeframe && payload.limit) {
return api
.get('/pair_history', {

View File

@ -137,3 +137,9 @@ export interface ClosedTrade extends Trade {
initial_stop_loss_pct?: number;
open_order_id?: string;
}
export interface PairHistoryPayload {
pair: string;
timeframe: string;
limit: number;
}