Skip to content

Commit

Permalink
Bump version to 0.2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ealmansi committed Jan 10, 2018
1 parent eacea53 commit 293eb5e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
33 changes: 12 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,32 @@ Compliant with the original CashAddr [specification](https://github.com/Bitcoin-

### Using NPM

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

### Using Bower

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

### Manually

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

## Usage

### In Node.js

```javascript
const cashaddr = require('cashaddrjs');

const hash = [
118, 160, 64, 83, 189,
160, 168, 139, 218, 81,
119, 184, 106, 21, 195,
178, 159, 85, 152, 115
];

const address = cashaddr.encode('bitcoincash', 'P2PKH', hash);
console.log(address); // 'bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a'

const decoded = cashaddr.decode(address);
console.log(decoded.prefix); // 'bitcoincash'
console.log(decoded.type); // 'P2PKH'
console.log(decoded.hash); // [ 118, 160, ..., 115 ]
const cashaddr = require('.');
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'
```

### Browser
Expand All @@ -59,7 +50,7 @@ You may include a script tag in your HTML and the `cashaddr` module will be defi
<html>
<head>
...
<script src="https://cdn.rawgit.com/bitcoincashjs/cashaddrjs/master/dist/cashaddrjs-0.1.10.min.js"></script>
<script src="https://cdn.rawgit.com/bitcoincashjs/cashaddrjs/master/dist/cashaddrjs-0.2.0.min.js"></script>
</head>
...
</html>
Expand All @@ -69,7 +60,7 @@ You may include a script tag in your HTML and the `cashaddr` module will be defi

### Generate and Browse Locally

```s
```bsh
$ npm run docs
```

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cashaddrjs",
"version": "0.1.10",
"version": "0.2.0",
"description": "Bitcoin Cash cashaddr address format support for Node.js and web browsers.",
"main": "lib/cashaddr.js",
"files": [
Expand Down

0 comments on commit 293eb5e

Please sign in to comment.