diff --git a/src/store/index.js b/src/store/index.js index 7ab9fb0f..b808b954 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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'); } } diff --git a/src/store/modules/ftbot.js b/src/store/modules/ftbot.js index 80ca2506..6b143f4a 100644 --- a/src/store/modules/ftbot.js +++ b/src/store/modules/ftbot.js @@ -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)