Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

bip44-constants

bitcoinjs16.5kMIT400.0.0TypeScript support: included

Bitcoin BIP44 constants.

bip44, bitcoin, litecoin, dogecoin, blackcoin, trezor

readme

BIP44 Constants

NPM Package

This package provides BIP44 coin constants as found here: https://github.com/satoshilabs/slips/blob/master/slip-0044.md

You can read more about BIP44.

Install

npm i --save bip44-constants

Usage

const constants = require('bip44-constants')
console.log(constants)

// iterate through constants
// format: constant, coinSymbol, coinName
// ie. [ 0x80000002, "LTC", "Litecoin" ]
// Some rows have no coin and are just indices and constants
constants.forEach(row => {
  const constant = row[0]
  const coinSymbol = row[1]
  const coinName = row[2]

  // ...
  console.log(coinName, coinSymbol, constant)
})

// Find your coin by using filter
const liteCoin = constants.filter(item => item[1] === 'LTC')
// ---- OR filter on multiple elements if you are aware of duplicates
const liquidBitcoin = constants.filter(item => item[1] === 'LBTC' && item[2] === 'Liquid BTC')

// Be sure to assert there was only one result
assert(liteCoin.length === 1)
assert(liquidBitcoin.length === 1)

console.log(liteCoin[0])
// [ 2147483650, 'LTC', 'Litecoin' ]
console.log(liquidBitcoin[0])
// [ 2147485424, 'LBTC', 'Liquid BTC' ]

console.log(liteCoin[0][0])
// 2147483650 (which is 0x80000002 in hex)
console.log(liquidBitcoin[0][0])
// 2147485424 (which is 0x800006f0 in hex)

Contributors

If you notice that index.js is out of date, please run npm run update and submit a pull request! Alternatively, please submit an issue to notify us that is out of date.

LICENSE MIT

changelog

8.0.0 / 2019-02-01

  • change constants from object to 2d array (see README)
  • add new constants

7.0.0 / 2018-11-12

  • change values for PIGGY/SSC
  • add new constants

6.1.0 / 2018-10-25

  • updated constants

6.0.0 / 2018-10-11

5.2.0 / 2018-08-27

  • updated constants

5.1.0 / 2018-07-30

  • add TRX constant

5.0.0 / 2018-03-05

  • using asset symbol as the key as opposed to the asset name
  • updated constants

4.0.1 / 2017-12-04

  • changed constant values to type Number, not type String

3.1.0 / 2017-08-27

  • updated constants

3.0.0 / 2017-08-27

  • updated constants (semver major since one constant changed)

2.5.0 / 2017-05-27

  • updated constants

2.4.0 / 2017-04-09

  • updated constants

2.3.0 / 2016-10-16

  • updated constants

2.2.0 / 2016-03-24

  • updated constants

2.1.0 / 2016-02-08

2.0.0 / 2016-01-26

  • had to bump major version since DarkCoin was renamed to Dash

1.0.0 / 2015-07-21

  • initial release