2.71.0 • Published 14 days ago

@coinranking/supplies v2.71.0

Weekly downloads
471
License
MIT
Repository
github
Last release
14 days ago

code-style Commitizen friendly npm (scoped) codecov

Supplies 📦

An open source JavaScript library for getting the cryptocurrency total, circulating and max supply from block explorers.

npm.io

Getting started

  1. Node.js 12.13 or higher is required
  2. Install using NPM

Installation

Coinranking Supplies is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 12.13 or higher is required.

Installation is done using the npm install command:

npm i @coinranking/supplies

Usage

List all supported drivers

const { drivers } = require('@coinranking/supplies');

console.log(drivers);

List all supported blockchains

const { blockchains } = require('@coinranking/supplies');

console.log(blockchains);

List all drivers that support a specific blockchain

const { selectDriversByBlockchain } = require('@coinranking/supplies');

console.log(selectDriversByBlockchain('Ethereum'));

Get the supply of specific coin

const { Etherscan, Coin } = require('@coinranking/supplies');

const driver = new Etherscan({
  secret: 'freekey',
});

const coin = new Coin({
  // Lets take the Basic Attention Token (BAT) for example.
  // The reference is the unique id for a specific driver;
  // which is a smart contract address in this case.
  name: 'Basic Attention Token',
  symbol: 'BAT',
  reference: '0x0d8775f648430679a709e98d2b0cb6250d2887ef',
  // Modifiers are blockchain addresses that get subtracted from the
  // total supply to get the circulating supply.
  modifiers: [
    '0x0000000000000000000000000000000000000000', // Burned address
    '0x0000000000000000000000000000000000000001', // Burned address
    '0x185f19b43d818e10a31be68f445ef8edcb8afb83', // Multisig address
    '0x67fa2c06c9c6d4332f330e14a66bdf1873ef3d2b', // Team Lock up address
    '0x7c31560552170ce96c4a7b018e93cddc19dc61b6', // UGP reserve address
  ],
  // Some drivers like Etherscan require decimals
  decimals: 18,
});

driver
  .getSupply(coin)
  .then((supply) => {
    console.log(supply);
  });

CLI

After installation the supplies command will be available in your terminal. The CLI is available under node ./bin/supplies.js when developing.

Get

Get the supply of a native coin

supplies get <driver name>

Get supply of a specific coin or a token

supplies get <driver name> -r <smart contract address>

Flags

NameFlagDescription
Decimals-d, --decimalsSome drivers like Etherscan require decimals.
Reference-r, --referenceReference is a unique id for a specific driver; for example a smart contract address.
Modifiers-m, --modifiersWallets addresses to subtract from the total supply; for example wallets hold by the foundation or burn addresses. Split the addresses with a comma and without spaces.
Record-R, --recordRecord the requests and coin, and save them as fixtures. This is for developing purposes.
API Key-k, --keyFor passing down an API key when the driver requires one. When used in combination with the -r flag the key will be masked in the fixtures.
No cache--nocacheSkip using the cache.

Development

Getting started

Install dependencies

npm run install

CLI

The CLI is available under node ./bin/supplies.js when developing

Contributing

Bug reports and pull requests are welcome. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Conventions

  1. Airbnb JavaScript Style Guide
  2. Conventional commits

License

MIT

2.71.0

14 days ago

2.70.3

5 months ago

2.69.0

9 months ago

2.69.1

9 months ago

2.68.0

10 months ago

2.68.1

10 months ago

2.68.2

9 months ago

2.70.2

9 months ago

2.70.1

9 months ago

2.70.0

9 months ago

2.67.6

1 year ago

2.67.5

1 year ago

2.67.2

1 year ago

2.67.3

1 year ago

2.67.4

1 year ago

2.67.1

2 years ago

2.67.0

3 years ago

2.66.0

3 years ago

2.65.0

3 years ago

2.64.0

3 years ago

2.63.0

3 years ago

2.62.0

3 years ago

2.61.0

3 years ago

2.60.0

3 years ago

2.57.0

3 years ago

2.56.0

3 years ago

2.55.0

3 years ago

2.59.0

3 years ago

2.54.0

3 years ago

2.58.0

3 years ago

2.46.0

3 years ago

2.53.0

3 years ago

2.45.0

3 years ago

2.49.0

3 years ago

2.52.0

3 years ago

2.44.1

3 years ago

2.48.0

3 years ago

2.51.0

3 years ago

2.47.0

3 years ago

2.50.0

3 years ago

2.44.0

3 years ago

2.43.1

3 years ago

2.43.0

3 years ago

2.42.2

3 years ago

2.42.1

3 years ago

2.42.0

3 years ago

2.41.0

3 years ago

2.40.0

3 years ago

2.39.0

3 years ago

2.38.0

3 years ago

2.37.0

3 years ago

2.36.0

3 years ago

2.35.1

3 years ago

2.35.3

3 years ago

2.35.2

3 years ago

2.35.0

3 years ago

2.34.0

3 years ago

2.33.0

3 years ago

2.32.1

3 years ago

2.32.0

4 years ago

2.31.0

4 years ago

2.30.1

4 years ago

2.30.0

4 years ago

2.29.0

4 years ago

2.28.0

4 years ago

2.27.0

4 years ago

2.26.0

4 years ago

2.25.0

4 years ago

2.24.0

4 years ago

2.23.0

4 years ago

2.22.0

4 years ago

2.21.0

4 years ago

2.20.0

4 years ago

2.19.0

4 years ago

2.18.0

4 years ago

2.17.0

4 years ago

2.16.0

4 years ago

2.15.0

4 years ago

2.14.0

4 years ago

2.13.0

4 years ago

2.12.0

4 years ago

2.11.0

4 years ago

2.10.0

4 years ago

2.9.0

4 years ago

2.8.0

4 years ago

2.6.0

4 years ago

2.7.0

4 years ago

2.5.0

4 years ago

2.4.0

4 years ago

2.2.0

4 years ago

2.3.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.42.1

4 years ago

1.42.0

4 years ago

1.41.0

4 years ago

1.40.0

4 years ago

1.39.0

4 years ago

1.38.0

4 years ago

1.37.0

4 years ago

1.36.0

4 years ago

1.35.0

4 years ago

1.34.0

4 years ago

1.32.0

4 years ago

1.33.0

4 years ago

1.31.0

4 years ago

1.30.0

4 years ago

1.29.0

4 years ago

1.28.0

4 years ago

1.27.0

4 years ago

1.26.1

4 years ago

1.26.0

4 years ago

1.25.2

4 years ago

1.25.1

4 years ago

1.25.0

4 years ago

1.24.0

4 years ago

1.23.2

4 years ago

1.23.1

4 years ago

1.23.0

4 years ago

1.22.0

4 years ago

1.21.0

4 years ago

1.20.0

4 years ago

1.19.0

4 years ago

1.18.0

4 years ago

1.17.0

4 years ago

1.16.0

4 years ago

1.15.0

4 years ago

1.14.0

4 years ago

1.13.0

4 years ago

1.12.0

4 years ago

1.11.0

4 years ago

1.10.5

4 years ago

1.10.4

4 years ago

1.10.3

4 years ago

1.10.2

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago