Add whitelist and blacklist data

This commit is contained in:
Matthias 2020-05-12 07:07:53 +02:00
parent eee98954ec
commit 6d755c8ab6
2 changed files with 25 additions and 2 deletions

View File

@ -38,6 +38,8 @@ export default new Vuex.Store({
dispatch('ftbot/getOpentrades'); dispatch('ftbot/getOpentrades');
dispatch('ftbot/getTrades'); dispatch('ftbot/getTrades');
dispatch('ftbot/getPerformance'); dispatch('ftbot/getPerformance');
dispatch('ftbot/getWhitelist');
dispatch('ftbot/getBlacklist');
dispatch('ftbot/getProfit'); dispatch('ftbot/getProfit');
} }
} }

View File

@ -9,6 +9,8 @@ export default {
openTrades: [], openTrades: [],
trade_count: 0, trade_count: 0,
performanceStats: [], performanceStats: [],
whitelist: [],
blacklist: [],
profit: {}, profit: {},
botState: {}, botState: {},
}, },
@ -35,6 +37,12 @@ export default {
updatePerformance(state, performance) { updatePerformance(state, performance) {
state.performanceStats = performance; state.performanceStats = performance;
}, },
updateWhitelist(state, whitelist) {
state.whitelist = whitelist.whitelist;
},
updateBlacklist(state, blacklist) {
state.blacklist = blacklist.blacklist;
},
updateProfit(state, profit) { updateProfit(state, profit) {
state.profit = profit; state.profit = profit;
}, },
@ -64,6 +72,20 @@ export default {
.then((result) => commit('updatePerformance', result.data)) .then((result) => commit('updatePerformance', result.data))
.catch(console.error); .catch(console.error);
}, },
getWhitelist({ commit, getters }) {
return axios.get(`${apiBase}/whitelist`, {
...getters.apiAuth
})
.then((result) => commit('updateWhitelist', result.data))
.catch(console.error);
},
getBlacklist({ commit, getters }) {
return axios.get(`${apiBase}/blacklist`, {
...getters.apiAuth
})
.then((result) => commit('updateBlacklist', result.data))
.catch(console.error);
},
getProfit({ commit, getters }) { getProfit({ commit, getters }) {
return axios.get(`${apiBase}/profit`, { return axios.get(`${apiBase}/profit`, {
...getters.apiAuth ...getters.apiAuth
@ -125,8 +147,7 @@ export default {
console.log(payload); console.log(payload);
return axios.post(`${apiBase}/forcesell`, payload, { return axios.post(`${apiBase}/forcesell`, payload, {
...getters.apiAuth ...getters.apiAuth
}).then((result) => { }).then(() => {
console.log(result.data)
dispatch('alerts/addAlert', { message: `Sell order for ${tradeid} created`}, { root: true }, ) dispatch('alerts/addAlert', { message: `Sell order for ${tradeid} created`}, { root: true }, )
}).catch((error) => { }).catch((error) => {
console.error(error.response) console.error(error.response)