https://github.com/bitcoinjs/bip44-constants
This package provides BIP44 coin constants as found here: https://github.com/satoshilabs/slips/blob/master/slip-0044.md
https://github.com/bitcoinjs/bip44-constants
bip44 bitcoin
Last synced: 3 months ago
JSON representation
This package provides BIP44 coin constants as found here: https://github.com/satoshilabs/slips/blob/master/slip-0044.md
- Host: GitHub
- URL: https://github.com/bitcoinjs/bip44-constants
- Owner: bitcoinjs
- License: mit
- Created: 2015-07-21T19:53:33.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2025-06-22T03:42:36.000Z (4 months ago)
- Last Synced: 2025-06-22T04:26:10.800Z (4 months ago)
- Topics: bip44, bitcoin
- Language: JavaScript
- Homepage:
- Size: 439 KB
- Stars: 92
- Watchers: 13
- Forks: 64
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# BIP44 Constants
[](https://www.npmjs.org/package/bip44-constants)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](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).
## Install
```
npm i --save bip44-constants
```## Usage
```js
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](LICENSE)