Merge pull request #187 from lbryio/filipnyquist-patch-2

Fixed more errors with CMC v2 API
This commit is contained in:
filipnyquist 2018-06-08 17:46:35 +02:00 committed by GitHub
commit e920d83324
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,7 @@ exports.stats = {
let json = response.body[0]; let json = response.body[0];
let newjson = parse_obj(json); let newjson = parse_obj(json);
let parse = JSON.stringify(newjson); let parse = JSON.stringify(newjson);
let volume24_usd = parse.replace(/[^0-9]/g, ''); let volume24_usd = Number(data.quotes.USD.volume_24h);
let dt = new Date(); let dt = new Date();
let timestamp = dt.toUTCString(); let timestamp = dt.toUTCString();
let hr_indicator = ':thumbsup:'; let hr_indicator = ':thumbsup:';
@ -56,8 +56,6 @@ exports.stats = {
} else { } else {
data = response.body.data; data = response.body.data;
let price_eur = Number(data.quotes.EUR.price); let price_eur = Number(data.quotes.EUR.price);
data = response.body[0];
price_eur = Number(data.price_eur);
let description = let description =
'**Rank: [' + '**Rank: [' +
rank + rank +
@ -76,7 +74,7 @@ exports.stats = {
statsurl + statsurl +
')\n' + ')\n' +
'Circulating Supply: [' + 'Circulating Supply: [' +
numberWithCommas(available_supply) + numberWithCommas(circulating_supply) +
' LBC](' + ' LBC](' +
statsurl + statsurl +
')\n' + ')\n' +