Socket
Socket
Sign inDemoInstall

cryptocompare

Package Overview
Dependencies
Maintainers
2
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.1.0 to 0.2.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

0.2.0 / 2017-09-01
------------------
- added: `exchange` option to `histoDay()`, `histoHour()`, & `histoMinute()`
0.1.0 / 2017-04-04

@@ -2,0 +7,0 @@ ------------------

3

index.js

@@ -72,2 +72,3 @@ 'use strict'

let url = `${baseUrl}histoday?fsym=${fsym}&tsym=${tsym}`
if (options.exchange) url += `&e=${options.exchange}`
if (options.limit === 'none') url += '&allData=true'

@@ -85,2 +86,3 @@ else if (options.limit) url += `&limit=${options.limit}`

let url = `${baseUrl}histohour?fsym=${fsym}&tsym=${tsym}`
if (options.exchange) url += `&e=${options.exchange}`
if (options.limit) url += `&limit=${options.limit}`

@@ -97,2 +99,3 @@ if (options.tryConversion === false) url += '&tryConversion=false'

let url = `${baseUrl}histominute?fsym=${fsym}&tsym=${tsym}`
if (options.exchange) url += `&e=${options.exchange}`
if (options.limit) url += `&limit=${options.limit}`

@@ -99,0 +102,0 @@ if (options.tryConversion === false) url += '&tryConversion=false'

2

package.json
{
"name": "cryptocompare",
"description": "CryptoCompare JavaScript API",
"version": "0.1.0",
"version": "0.2.0",
"author": "JP Richardson <jprichardson@gmail.com>",

@@ -6,0 +6,0 @@ "bugs": {

@@ -290,2 +290,3 @@ cryptocompare

- `timestamp` (Date) By default, `histoDay()` gets historical data for the past several days. Use the `timestamp` option to set a historical start point.
- `exchange` (String) Exchange to get history data from. By default, average data is used. (You can get a list of top exchanges for a given pair with `topExchanges()`.)

@@ -321,2 +322,3 @@ ```js

- `timestamp` (Date) By default, `histoHour()` gets historical data for the past several hours. Use the `timestamp` option to set a historical start point.
- `exchange` (String) Exchange to get history data from. By default, average data is used. (You can get a list of top exchanges for a given pair with `topExchanges()`.)

@@ -352,2 +354,3 @@ ```js

- `timestamp` (Date) By default, `histoMinute()` gets historical data for the past several minutes. Use the `timestamp` option to set a historical start point.
- `exchange` (String) Exchange to get history data from. By default, average data is used. (You can get a list of top exchanges for a given pair with `topExchanges()`.)

@@ -354,0 +357,0 @@ ```js

@@ -136,3 +136,3 @@ 'use strict'

t.strictEqual(typeof prices.USD, 'number', 'prices.USD is a number')
t.is(prices.USD, 997, 'Correct historical value')
t.is(prices.USD, 995.44, 'Correct historical value')
t.strictEqual(typeof prices.EUR, 'number', 'prices.EUR is a number')

@@ -139,0 +139,0 @@ t.end()

@@ -113,4 +113,4 @@ 'use strict'

let data = []
data.push(cc.histoMinute('BTC', 'USD', { timestamp: new Date('2017-01-01') }))
data.push(cc.histoMinute('BTC', 'USD', { timestamp: new Date('2017-01-02') }))
data.push(cc.histoMinute('BTC', 'USD', { timestamp: new Date() }))
data.push(cc.histoMinute('BTC', 'USD', { timestamp: new Date(Date.now() - (1000 * 60 * 60 * 24)) }))
Promise.all(data).then(data => {

@@ -117,0 +117,0 @@ t.notDeepEqual(data[0], data[1], 'data from different days should not be equivalent')

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