get XMR price

pull/23/head
wowario 4 years ago
parent af99864ed4
commit 55324022a6
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111

@ -122,6 +122,10 @@
this.$store.commit('addRate', response.data.ask); this.$store.commit('addRate', response.data.ask);
}); });
axios.get('https://tradeogre.com/api/v1/ticker/btc-xmr').then(response => {
this.$store.commit('addRateXMR', response.data.ask);
});
axios.get(`https://funding.wownero.com/api/1/wowlight?version=0.1.4`).then(response => { axios.get(`https://funding.wownero.com/api/1/wowlight?version=0.1.4`).then(response => {
if(response.data.data === false) { if(response.data.data === false) {
const {dialog} = require('electron').remote const {dialog} = require('electron').remote

@ -30,18 +30,18 @@
return (this.$store.getters.btc_rate) * this.$store.getters.wallet.balance; return (this.$store.getters.btc_rate) * this.$store.getters.wallet.balance;
}, },
bubble_img() { bubble_img() {
let rate = this.$store.getters.btc_rate; let rate = this.$store.getters.usd_rate;
let btc = rate * this.$store.getters.wallet.balance; let usd = (rate / 1000) * this.$store.getters.wallet.balance;
if(btc < 1){ if(usd < 1){
return this.path_bubble(0); return this.path_bubble(0);
} else if(btc < 100){ } else if(usd < 100){
return this.path_bubble(1); return this.path_bubble(1);
} else if(btc < 500){ } else if(usd < 500){
return this.path_bubble(2); return this.path_bubble(2);
} else if(btc < 1000){ } else if(usd < 1000){
return this.path_bubble(3); return this.path_bubble(3);
} else if(btc < 1000){ } else if(usd < 1000){
return this.path_bubble(4); return this.path_bubble(4);
} }
} }

@ -47,18 +47,18 @@
return this.$store.getters.btc_rate * this.$store.getters.wallet.balance; return this.$store.getters.btc_rate * this.$store.getters.wallet.balance;
}, },
bubble_img() { bubble_img() {
let rate = this.$store.getters.btc_rate; let rate = this.$store.getters.usd_rate;
let btc = rate * this.$store.getters.wallet.balance; let usd = (rate / 1000) * this.$store.getters.wallet.balance;
if(btc < 1){ if(usd < 1){
return this.path_bubble(0); return this.path_bubble(0);
} else if(btc < 100){ } else if(usd < 100){
return this.path_bubble(1); return this.path_bubble(1);
} else if(btc < 500){ } else if(usd < 500){
return this.path_bubble(2); return this.path_bubble(2);
} else if(btc < 1000){ } else if(usd < 1000){
return this.path_bubble(3); return this.path_bubble(3);
} else if(btc < 1000){ } else if(usd < 1000){
return this.path_bubble(4); return this.path_bubble(4);
} }
} }

@ -17,6 +17,10 @@
<span class="balance_btc"> <span class="balance_btc">
BTC: <span>{{Number(btc_rate*wallet.balance).toFixed(9)}}</span> BTC: <span>{{Number(btc_rate*wallet.balance).toFixed(9)}}</span>
</span> </span>
|
<span class="balance_xmr">
XMR: <span>{{Number(btc_rate*wallet.balance/xmr_rate).toFixed(9)}}</span>
</span>
</div> </div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"
@ -47,6 +51,9 @@
}, },
btc_rate() { btc_rate() {
return this.$store.getters.btc_rate; return this.$store.getters.btc_rate;
},
xmr_rate() {
return this.$store.getters.xmr_rate;
} }
}, },
methods: { methods: {

@ -80,6 +80,9 @@ export default new Vuex.Store({
addRate(state, data){ addRate(state, data){
state.btc_rate = data; state.btc_rate = data;
}, },
addRateXMR(state, data){
state.xmr_rate = data;
},
showError(state, data){ showError(state, data){
state.error = data; state.error = data;
}, },
@ -137,6 +140,7 @@ export default new Vuex.Store({
wallet_path: state => state.wallet_path, wallet_path: state => state.wallet_path,
wallet_password: state => state.wallet_password, wallet_password: state => state.wallet_password,
btc_rate: state => state.btc_rate, btc_rate: state => state.btc_rate,
xmr_rate: state => state.xmr_rate,
message_box: state => state.message_box, message_box: state => state.message_box,
password_box: state => state.password_box, password_box: state => state.password_box,
height_from: state => state.height_from, height_from: state => state.height_from,