CoinTools is a handy gadget to Chrome browser that you can launch easily to view the information of cryptocurrency.
Javascript that runs in Chrome.
https://github.com/DoctorLai/CoinTools
It is available online at Chrome Webstore:
https://chrome.google.com/webstore/detail/coin-tools/fmglcggbdcbkpkfapngjobfeakehpcgj
Along with some added language translation, this version adds the tab of History Data so that you can view 30 days historical conversion between any two cryptocurrency or fiat currency.
History conversion between cryptocurrency and cryptocurrency
History conversion between fiat and fiat
History conversion between cryptocurrency and fiat
// get history
const getHistory = (a, b, dom) => {
let api = "https://min-api.cryptocompare.com/data/histoday?fsym=" + a + "&tsym=" + b + "&limit=30&e=CCCAGG";
logit("calling " + api);
dom.html('
');
$.ajax({
type: "GET",
url: api,
success: function(data) {
if (data && data.Data && data.Response == 'Success') {
let data_open = [];
let data_close = [];
let data_high = [];
let data_low = [];
let arr = data.Data;
let datalen = arr.length;
for (let i = 0; i < datalen; ++ i) {
let date = new Date(arr[i].time * 1000);
data_open.push({x: date, y: arr[i].open});
data_close.push({x: date, y: arr[i].close});
data_high.push({x: date, y: arr[i].high});
data_low.push({x: date, y: arr[i].low});
}
let chart = new CanvasJS.Chart("chartContainer", {
title:{
text: a + " => " + b
},
axisY:[{
title: b,
lineColor: "#C24642",
tickColor: "#C24642",
labelFontColor: "#C24642",
titleFontColor: "#C24642",
suffix: ""
}],
toolTip: {
shared: true
},
legend: {
cursor: "pointer",
itemclick: function(e) {
if (typeof (e.dataSeries.visible) === "undefined" || e.dataSeries.visible) {
e.dataSeries.visible = false;
} else {
e.dataSeries.visible = true;
}
e.chart.render();
}
},
data: [{
type: "line",
name: "Open",
color: "#369EAD",
showInLegend: true,
axisYIndex: 1,
dataPoints: data_open
},
{
type: "line",
name: "Close",
color: "#C24642",
axisYIndex: 0,
showInLegend: true,
dataPoints: data_close
},
{
type: "line",
name: "Low",
color: "blue",
axisYIndex: 0,
showInLegend: true,
dataPoints: data_low
},
{
type: "line",
name: "High",
color: "#7F6084",
axisYType: "secondary",
showInLegend: true,
dataPoints: data_high
}]
});
chart.render();
}
},
error: function(request, status, error) {
logit('Response: ' + request.responseText);
logit('Error: ' + error );
logit('Status: ' + status);
dom.html("");
},
complete: function(data) {
logit(get_text("api_finished", "API Finished") + ": " + api);
}
});
}
Github: https://github.com/DoctorLai/CoinTools/
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-featureInstall the CoinTools Now!