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/getTrades');
dispatch('ftbot/getPerformance');
dispatch('ftbot/getWhitelist');
dispatch('ftbot/getBlacklist');
dispatch('ftbot/getProfit');
}
}

View File

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