Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

coinmetrics

0.0.2 • Public • Published

COINMETRICS

Node.js wrapper for the Coinmetrics.io API. Documentation can be found here: https://coinmetrics.io/api/

INSTALLATION

npm install coinmetrics

Usage with Async/Await

const coinmetrics = require('coinmetrics')
 
var supportedAssets = await coinmetrics.getSupportedAssets()
 
var dataTypes = await coinmetrics.getAvailableDataTypesForAsset(asset)
 
var assetData = await coinmetrics.getAssetDataForTimeRange(asset, data_type, begin_timestamp, end_timestamp)
 

Usage with Promises

const coinmetrics = require('coinmetrics')
 
coinmetrics.getSupportedAssets()
  .then((results) => {
    var supportedAssets = results
  })
 
coinmetrics.getAvailableDataTypesForAsset(asset)
  .then((results) => {
    var dataTypes = results
  })
 
coinmetrics.getAssetDataForTimeRange(asset, data_type, begin_timestamp, end_timestamp)
  .then((results) => {
    var assetData = results
  })
 

Usage with Callbacks

const coinmetrics = require('coinmetrics')
 
coinmetrics.getSupportedAssets((results) => {
  var supportedAssets = results
})
 
coinmetrics.getAvailableDataTypesForAsset(asset, (results) => {
  var dataTypes = results
})
 
coinmetrics.getAssetDataForTimeRange(asset, data_type, begin_timestamp, end_timestamp, (results) => {
  var assetData = results
})
 

install

npm i coinmetrics

Downloadsweekly downloads

9

version

0.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability