# cashaddrjs-slp

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

Latest version **0.2.12** (published 2019-10-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install cashaddrjs-slp
pnpm add cashaddrjs-slp
yarn add cashaddrjs-slp
bun add cashaddrjs-slp
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.12 |
| Published | 2019-10-31 |
| First published | 2018-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 114.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Emilio Almansi |
| Maintainers | jcramer |
| Keywords | bitcoin, cash, cashaddr, address, format, node, browser |

## Links

- npm: https://www.npmjs.com/package/cashaddrjs-slp
- Repository: https://github.com/simpleledger/cashaddrjs
- Homepage: https://github.com/simpleledger/cashaddrjs#readme
- Issues: https://github.com/simpleledger/cashaddrjs/issues
- npm.io page: https://npm.io/package/cashaddrjs-slp

## Dependencies (1)

- [big-integer](https://npm.io/package/big-integer.md) ^1.6.34

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.2.12 (latest) — 2019-10-31
- 0.2.11 — 2018-08-27
- 0.2.10 — 2018-08-27
- 0.2.9 — 2018-08-26

## README

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

[![NPM](https://nodei.co/npm/cashaddrjs.png?downloads=true)](https://nodei.co/npm/cashaddrjs-slp/)

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

Compliant with the original CashAddr [specification](https://github.com/Bitcoin-UAHF/spec/blob/master/cashaddr.md) which improves upon [BIP 173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki).

*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](https://github.com/bitcoincashjs/bchaddrjs).

## Installation

### Using NPM

```bsh
$ npm install --save cashaddrjs-slp
```

### Using Bower

```bsh
$ bower install --save cashaddrjs-slp
```

### Manually

You may also download the distribution file manually and place it within your third-party scripts directory: [dist/cashaddrjs-0.2.9.min.js](https://cdn.rawgit.com/bitcoincashjs/cashaddrjs/master/dist/cashaddrjs-0.2.9.min.js).

## Usage

### In Node.js

```javascript
const cashaddr = require('cashaddrjs');
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](https://github.com/bitcoincashjs/bchaddrjs).

### Browser

#### Script Tag

You may include a script tag in your HTML and the `cashaddr` module will be defined globally on subsequent scripts.

```html
<html>
  <head>
    ...
    <script src="https://cdn.rawgit.com/bitcoincashjs/cashaddrjs/master/dist/cashaddrjs-0.2.9.min.js"></script>
  </head>
  ...
</html>
```

## Documentation

### Generate and Browse Locally

```bsh
$ npm run docs
```

### Online

Browse automatically generated jsdocs [online](https://cdn.rawgit.com/bitcoincashjs/cashaddrjs/master/docs/index.html).

---
_Source: https://npm.io/package/cashaddrjs-slp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
