Socket
Socket
Sign inDemoInstall

cardano-stat

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cardano-stat

A small library that gives current Cardano statistics from Coindesk.


Version published
Weekly downloads
1
Maintainers
1
Install size
3.03 kB
Created
Weekly downloads
 

Readme

Source

Cardano Stat

About

Cardano Stat is a library that gives current statistics about cardano through my backend api that I made that recieves data from Coindesk, so essentially, this library is an api wrapper of my api that I made. All of the data comes completely from Coindesk and can be found here (https://www.coindesk.com/price/cardano).

Usage

First and foremost, install Cardano Stat using npm like so

$ npm i cardano-stat

Then, once you have done that, require it in your code

const cardano = require('cardano-stat')

The cardano constant will give you an object with (current) information on the following...

  • Current Price
  • 24 Hour Percent Change
  • Market Cap
  • 24 Hour Volume
  • 24 Hour Low
  • 24 Hour High
  • Net Change
  • 24 Hour Open
  • All Time High
  • Total Supply
  • 24 Hour Returns
  • YTD Returns
  • 30 Day Volatility
  • 24 Hour Transaction Count
  • 24 Hour Average Transaction Fee
  • 24 Hour Value Transacted
Here is a quick final example of how to use the library in all its glory.
const cardano = require('cardano-stat')

console.log(cardano)
//output shoule be something similar to this
/*
{
  price: '$1.49',
  '24h_change': '8.01',
  market_cap: '$47.93B',
  '24h_volume': '$2.11B',
  '24h_low': '$1.37',
  '24h_high': '$1.49',
  net_change: '$0.109957',
  '24h_open': '$1.37',
  all_time_high: '$2.47',
  total_supply: '32.27B',
  '24h_returns': '8.01',
  ytd_returns: '717.26',
  '30d_volatility': '0.60',
  '24h_transaction_count': '31,500',
  '24h_average_transaction_fee': '$0.299762',
  '24h_value_transacted': '$2.22B'
}
*/

console.log(cardano.price) //output - $1.49
console.log(cardano['24h_change']) //output - 8.01
console.log(cardano.market_cap) //output - $47.93B
console.log(cardano['24h_volume']) //output - $2.11B
console.log(cardano['24h_low']) //output - $1.37
console.log(cardano['24h_high']) //output - $1.49
console.log(cardano.net_change) //output - $0.109957
console.log(cardano['24h_open']) //output - $1.37
console.log(cardano.all_time_high) //output - $2.47
console.log(cardano.total_supply) //output - 32.27B
console.log(cardano['24h_returns']) //output - 8.01
console.log(cardano.ytd_returns) //output - 717.26
console.log(cardano['30d_volatility']) //output - 0.60
console.log(cardano['24h_transaction_count']) //output - 31,500
console.log(cardano['24h_average_transaction_fee']) //output - $0.299762
console.log(cardano['24h_value_transacted']) //output - $2.22B

Keywords

FAQs

Last updated on 07 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc