JSPM

cashaddrjs-fork

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q39890F
  • License MIT

Bitcoin Cash cashaddr address format support for Node.js and web browsers.

Package Exports

  • cashaddrjs-fork

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cashaddrjs-fork) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

It is a fork fixing the old JavaScript engine

Original repository is : bitcoincashjs/bchaddrjs

CashAddr.js: The new Bitcoin Cash address format for Node.js and web browsers.

NPM

JavaScript implementation for the new CashAddr address format for Bitcoin Cash.

Compliant with the original CashAddr specification which improves upon BIP 173.

Note: This is a JavaScript implementation of the CashAddr format specification. If you are looking for a general purpose Bitcoin Cash address translation library, check out the easy-to-use and well-tested BchAddr.js.

Installation

Using NPM

$ npm install --save cashaddrjs-fork

Usage

In Node.js

const cashaddr = require('cashaddrjs-fork');
const address = 'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a';
const { prefix, type, hash } = cashaddr.decode(address);
console.log(prefix); // 'bitcoincash'
console.log(type); // 'P2PKH'
console.log(hash); // Uint8Array [ 118, 160, ..., 115 ]
console.log(cashaddr.encode(prefix, type, hash)); // 'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a'

Note: This is a JavaScript implementation of the CashAddr format specification. If you are looking for an easy-to-use and well-tested library to translate between different formats, check out BchAddr.js.