Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cryptocompare

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cryptocompare - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

4

CHANGELOG.md
Unreleased
----------
0.0.2 / 2016-11-21
------------------
- bug fix: `priceHistorical()` - wrong endpoint
0.0.1 / 2016-08-01
------------------
- initial release

4

index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc