added xmr/btc data for shapeshift
This commit is contained in:
parent
3162bcf4c8
commit
27ec18cf7a
@ -8,7 +8,7 @@ class XMRData extends EventEmitter {
|
||||
}
|
||||
|
||||
get initial() {
|
||||
return { shapeshift: null, xmrto: null };
|
||||
return { shapeshift: null, xmrto: null, shapeshift_xmr: null };
|
||||
}
|
||||
|
||||
start() {
|
||||
@ -25,12 +25,13 @@ class XMRData extends EventEmitter {
|
||||
axios.get("https://shapeshift.io/marketinfo/btc_xmr").catch(err => log.error(err.config.url, err.message)),
|
||||
axios.get("https://xmr.to/api/v2/xmr2btc/order_parameter_query/").catch(err => log.error(err.config.url, err.message)),
|
||||
]).then(resp => {
|
||||
let bitpay = null, shapeshift = null, xmrto = null;
|
||||
let bitpay = null, shapeshift = null, xmrto = null, shapeshift_xmr = null;
|
||||
|
||||
if (resp[0] != undefined) {
|
||||
bitpay = resp[0].data.rate;
|
||||
|
||||
if (resp[1] != undefined) {
|
||||
shapeshift_xmr = (Math.round(resp[1].data.rate * 100) / 100) + "XMR";
|
||||
shapeshift = (Math.round((bitpay / resp[1].data.rate) * 100) / 100) + "€";
|
||||
}
|
||||
|
||||
@ -39,7 +40,7 @@ class XMRData extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
this.emit("data", { shapeshift, xmrto });
|
||||
this.emit("data", { shapeshift, xmrto, shapeshift_xmr });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,6 +56,19 @@
|
||||
line-height: 50px;
|
||||
vertical-align: top;
|
||||
font-size: 1.5em;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.databox .data:nth-of-type(1) {
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.data.parentheses::before {
|
||||
content: "(";
|
||||
}
|
||||
|
||||
.data.parentheses::after {
|
||||
content: ")";
|
||||
}
|
||||
|
||||
#overlay {
|
||||
@ -90,7 +103,7 @@
|
||||
<div class="title">Monero</div>
|
||||
|
||||
<div class="databox">
|
||||
<img class="icon" src="img/shapeshift.png"><div class="data d-monero-shapeshift">---</div>
|
||||
<img class="icon" src="img/shapeshift.png"><div class="data d-monero-shapeshift">---</div> <div class="data parentheses d-monero-shapeshift_xmr">---</div>
|
||||
</div>
|
||||
|
||||
<div class="databox">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user