@seangob/ethplorer
Version:
Ethplorer.io API for NodeJS
20 lines (18 loc) • 440 B
JavaScript
export default class ethplorer {
static transaction(tx, apiKey = 'freekey') {
var url = "https://api.ethplorer.io/getTxInfo/" + tx + "?apiKey=freekey";
var promise = new Promise((resolve, reject)=>{
fetch(url).then(r=>{
return r.json();
}).then(r=>{
if(!r.error) {
resolve(r);
}
else {
reject(r.error.message);
}
});
});
return promise;
}
}