Skip to content

Commit

Permalink
Include explanation of browser use in README
Browse files Browse the repository at this point in the history
  • Loading branch information
junderw committed Dec 17, 2017
1 parent 8eaa571 commit 1de8399
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ exact order of the original signed request.
already signed request, as decoders will recover the pubkey, any incorrect data
would cause an incorrect pubkey to be generated and will cause an error on the
decoding end when trying to send.
* Note: `satoshis` can be defined up to 3 decimal points (ie. `0.001` is the smallest valid
value for satoshis, as lightning network can deal with satoshis)
* Note: tag order matters. The message is signed, so to maintain tag order it is
an array type.

Expand Down Expand Up @@ -101,6 +99,28 @@ lnbc20u1pvjluezhp58yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqspp5qqqsyqc
*/
```

## Browser Use
You can use this in the browser. First install browserify and uglify-es (uglifyjs for ES6+) globally.

``` bash
npm install -g browserify uglify-es
```

Then run the command.

``` bash
browserify -r bolt11 --standalone lightningPayReq | uglifyjs -c -m -o bolt11.min.js
```

Now load bolt11.min.js into an HTML page like so:

``` HTML
<script src="./js/bolt11.min.js"></script>
```

And now you can do all the examples above in a browser using the global
`lightningPayReq` object.

## Contributing
We are always accepting of pull requests, but we do adhere to specific standards in regards to coding style, test driven development and commit messages.

Expand Down

0 comments on commit 1de8399

Please sign in to comment.