cryptocompare
Advanced tools
Comparing version 0.0.1 to 0.0.2
Unreleased | ||
---------- | ||
0.0.2 / 2016-11-21 | ||
------------------ | ||
- bug fix: `priceHistorical()` - wrong endpoint | ||
0.0.1 / 2016-08-01 | ||
------------------ | ||
- initial release |
@@ -30,4 +30,4 @@ /* global fetch */ | ||
if (!time instanceof Date) throw new Error('time parameter must be an instance of Date.') | ||
time = time.getTime() / 1000 | ||
var url = baseUrl + 'price?fsym=' + fsym + '&tsyms=' + tsyms.join(',') + '&ts=' + time | ||
time = Math.floor(time.getTime() / 1000) | ||
var url = baseUrl + 'pricehistorical?fsym=' + fsym + '&tsyms=' + tsyms.join(',') + '&ts=' + time | ||
return fetchJSON(url) | ||
@@ -34,0 +34,0 @@ } |
{ | ||
"name": "cryptocompare", | ||
"description": "CryptoCompare JavaScript API", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "JP Richardson <jprichardson@gmail.com>", | ||
@@ -30,4 +30,6 @@ "bugs": { | ||
"scripts": { | ||
"test": "standard && tape test/*.js | tap-spec" | ||
"lint": "standard", | ||
"test": "npm run lint && npm run unit", | ||
"unit": "tape test/*.js | tap-spec" | ||
} | ||
} |
@@ -26,3 +26,3 @@ var test = require('tape') | ||
test('priceHistorical()', function (t) { | ||
t.plan(4) | ||
t.plan(5) | ||
var oneYearAgo = new Date((Date.now() / 1000 - 31536000) * 1000) | ||
@@ -32,2 +32,3 @@ cc.priceHistorical('BTC', ['USD', 'CNY'], oneYearAgo).then(prices => { | ||
t.strictEqual(typeof prices[0].Price, 'number', 'prices[0].Price is a number') | ||
t.is(prices[0].Price, 321.68, 'prices[0] is set') | ||
t.strictEqual(prices[1].Symbol, 'CNY') | ||
@@ -34,0 +35,0 @@ t.strictEqual(typeof prices[1].Price, 'number') |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6738
65