Skip to content

Commit 9162525

Browse files
Merge branch 'grants/issue10' of https://github.com/theRealBitcoinClub/bch-js into grants/issue10
2 parents befa6a3 + 71f3408 commit 9162525

File tree

1 file changed

+42
-52
lines changed

1 file changed

+42
-52
lines changed

README.md

Lines changed: 42 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,71 @@
11
# bch-js
22

3-
[![Build Status](https://travis-ci.org/christroutner/bch-js.svg?branch=master)](https://travis-ci.org/christroutner/bch-js)
4-
[![Version](https://img.shields.io/npm/v/@chris.troutner/bch-js)](https://www.npmjs.com/package/@chris.troutner/bch-js)
5-
[![Downloads/week](https://img.shields.io/npm/dw/@chris.troutner/bch-js)](https://npmjs.org/package/@chris.troutner/bch-js)
6-
[![License](https://img.shields.io/npm/l/@chris.troutner/bch-js)](https://github.com/christroutner/bch-js/blob/master/LICENSE.md)
3+
[![Build Status](https://travis-ci.org/Permissionless-Software-Foundation/bch-js.svg?branch=master)](https://travis-ci.org/Permissionless-Software-Foundation/bch-js)
4+
[![Version](https://img.shields.io/npm/v/@psf/bch-js)](https://www.npmjs.com/package/@psf/bch-js)
5+
[![Downloads/week](https://img.shields.io/npm/dw/@psf/bch-js)](https://npmjs.org/package/@psf/bch-js)
6+
[![License](https://img.shields.io/npm/l/@psf/bch-js)](https://github.com/Permissionless-Software-Foundation/bch-js/blob/master/LICENSE.md)
77

8-
[bch-js](https://www.npmjs.com/package/@chris.troutner/bch-js) is a JavaScript npm library for creating web and mobile apps for interacting with the Bitcoin Cash (BCH) blockchain. It can be used for free, but requires an account on [FullStack.cash](https://fullstack.cash) for increased rate limits. Find out more from [this article](https://troutsblog.com/research/bitcoin-cash/how-to-bch-full-stack-developer).
8+
[bch-js](https://www.npmjs.com/package/@psf/bch-js) is a JavaScript npm library for creating web and mobile apps that can interact with the Bitcoin Cash (BCH) blockchains. It can be used for free, but requires an account on [FullStack.cash](https://fullstack.cash) for increased rate limits. Learn more from [this article](https://troutsblog.com/research/bitcoin-cash/how-to-bch-full-stack-developer) about Full Stack Bitcoin Cash development.
99

1010
### Quick Start Videos:
11+
1112
Here are two YouTube walk-through videos to help you get started:
13+
1214
- [Introduction to bch-js and the bch-js-examples repository](https://youtu.be/GD2i1ZUiyrk)
1315
- [Working with the FullStack.cash JWT token](https://youtu.be/GD2i1ZUiyrk)
1416

1517
### Quick Links
16-
- [npm Library](https://www.npmjs.com/package/@chris.troutner/bch-js)
18+
19+
- [npm Library](https://www.npmjs.com/package/@psf/bch-js)
1720
- [Documentation](https://bchjs.fullstack.cash/)
1821
- [Examples](https://github.com/Permissionless-Software-Foundation/bch-js-examples)
19-
- [api.fullstack.cash](https://api.fullstack.cash) - The REST API this library talks to by default.
22+
- [bchn.fullstack.cash](https://bchn.fullstack.cash) - The REST API this library talks to by default.
23+
- [FullStack.cash](https://fullstack.cash) - cloud-based infrastructure for application developers.
2024
- [FullStack.cash Account](https://fullstack.cash/login) - Get your API key to unlock increased rate limits.
21-
- [FullStack.cash](https://fullstack.cash) - cloud-based infrastructure for application
22-
developers.
2325
- [Permissionless Software Foundation](https://psfoundation.cash) - The organization that maintains this library.
2426

25-
2627
### Quick Notes
2728

28-
- Install library: `npm install @chris.troutner/bch-js`
29+
- Install library: `npm install @psf/bch-js`
2930

3031
- Instantiate the library in your code:
32+
3133
```
32-
const BCHJS = require("@chris.troutner/bch-js")
33-
let bchjs = new BCHJS()
34+
const BCHJS = require("@psf/bch-js")
35+
let bchjs = new BCHJS() // Defaults to BCHN network.
3436
3537
// testnet
36-
bchjs = new BCHJS({ restURL: 'https://tapi.fullstack.cash/v3/' })
38+
bchjs = new BCHJS({ restURL: 'https://testnet3.fullstack.cash/v3/' })
3739
```
3840

39-
This is a fork of the [BITBOX SDK](https://github.com/Bitcoin-com/bitbox-sdk) (which is maintained by Bitcoin.com). This library is intended to be paired with
40-
the [bch-api](https://github.com/christroutner/bch-api) REST API.
41+
This library is intended to be paired with
42+
the [bch-api](https://github.com/Permissionless-Software-Foundation/bch-api) REST API, and the infrastructure provided by [FullStack.cash](https://fullstack.cash). The `restURL` property can be changed to work with different Bitcoin Cash networks:
4143

42-
If you need a backward-compatible instance of this library, you can use a
43-
'shim'. Do it like this:
44-
```
45-
const BCHJS = require("@chris.troutner/bch-js")
46-
const bitbox = BCHJS.BitboxShim({ restURL: 'https://api.fullstack.cash/v3/' })
47-
```
44+
- BCHN Mainnet REST API server: https://bchn.fullstack.cash/v3/
45+
- ABC Mainnet REST API server: https://abc.fullstack.cash/v3/
46+
- Testnet3 REST API server: https://testnet3.fullstack.cash/v3/
47+
- Check server status: https://metrics.fullstack.cash
4848

4949
### API Key
50-
The [bch-api](https://github.com/christroutner/bch-api) REST API hosted by [FullStack.cash](https://fullstack.cash) uses JWT tokens to pay for increased
51-
rate limits when interacting with the back end server. See [this article](https://troutsblog.com/research/bitcoin-cash/how-to-bch-full-stack-developer) if you want to understand the system-as-a-whole. The JWT token can be fed to bch-js *implicitly* or *explicitly*.
5250

53-
- Implicitly: bch-js will detect your JWT token by setting the `BCHJSTOKEN` environment variable.
51+
The [bch-api](https://github.com/Permissionless-Software-Foundation/bch-api) REST API hosted by [FullStack.cash](https://fullstack.cash) uses JWT tokens to pay for increased
52+
rate limits when interacting with the back end server. See [this article](https://troutsblog.com/research/bitcoin-cash/how-to-bch-full-stack-developer) if you want to understand the system-as-a-whole. The JWT token can be fed to bch-js _implicitly_ or _explicitly_.
53+
54+
- Implicitly: bch-js will detect your JWT token if you set the `BCHJSTOKEN` environment variable.
5455
- Explicitly: You can directly feed in the JWT token with the `apiToken` property when instantiating the library. Here is an example:
5556

5657
```
57-
const BCHJS = require("@chris.troutner/bch-js")
58+
const BCHJS = require("@psf/bch-js")
5859
let bchjs = new BCHJS({
59-
restURL: 'https://api.fullstack.cash/v3/',
60+
restURL: 'https://bchn.fullstack.cash/v3/',
6061
apiToken: 'eyJhbGciO...' // Your JWT token here.
6162
})
6263
```
6364

6465
### Gatsby
66+
6567
bch-js is included in this [gatsby-ipfs-template](https://github.com/Permissionless-Software-Foundation/gatsby-ipfs-template) for building uncensorable web apps that can interact with the blockchain. When building a Gatsby (or other front-end app that uses Webpack), you'll need to add these lines to your `gatsby-node.js` file, as per [this issue](https://github.com/gatsbyjs/gatsby/issues/564):
68+
6669
```
6770
exports.onCreateWebpackConfig = ({ actions }) => {
6871
actions.setWebpackConfig({
@@ -75,60 +78,47 @@ exports.onCreateWebpackConfig = ({ actions }) => {
7578

7679
This is because the new IPFS class in bch-js uses the fs library for uploading files, which is not supported by Gatsby.
7780

81+
We also provide [minimal-slp-wallet-web](https://www.npmjs.com/package/minimal-slp-wallet-web) as a basic Bitcoin Cash wallet with SLP support, for front end projects. bch-js is encapsulated inside the instantiation of the library Class.
82+
7883
## Features
79-
This library sets itself apart from BITBOX with the following features:
8084

8185
- [ECMAScript 2017 standard JavaScript](https://en.wikipedia.org/wiki/ECMAScript#8th_Edition_-_ECMAScript_2017) used instead of TypeScript. Works
82-
natively with node.js v10 or higher.
86+
natively with node.js v10 or higher.
8387

8488
- Full SLP tokens support: bch-js has full support for all SLP token functionality, including send, mint, and genesis transactions. It also fully support all aspects of [non-fugible tokans (NFTs)](https://www.youtube.com/watch?v=vvlpYUx6HRs).
8589

8690
- [Semantic Release](https://github.com/semantic-release/semantic-release) for
87-
continuous delivery using semantic versioning.
91+
continuous delivery using semantic versioning.
8892

8993
- [Greenkeeper](https://greenkeeper.io/) automatic dependency management for
90-
automatically maintaining the latest, most secure dependencies.
94+
automatically maintaining the latest, most secure dependencies.
9195

9296
- [IPFS uploads](https://ipfs.io) of all files and dependencies, to backup
93-
dependencies in case they are ever inaccessible from GitHub or npm.
94-
95-
97+
dependencies in case they are ever inaccessible from GitHub or npm.
9698

9799
## Documentation:
98100

99101
Full documentation for this library can be found here:
100-
- [Documentation](https://bchjs.fullstack.cash/)
101-
102-
Original documentation on BITBOX is available at:
103-
104-
- [General docs](https://developer.bitcoin.com)
105-
- [BITBOX Introduction](https://developer.bitcoin.com/bitbox)
106-
- [BITBOX API Reference](https://developer.bitcoin.com/bitbox/docs/getting-started)
107102

103+
- [Documentation](https://bchjs.fullstack.cash/)
108104

109105
bch-js uses [APIDOC](http://apidocjs.com/) so that documentation and working code
110106
live in the same repository. To generate the documentation:
107+
111108
- `npm run docs`
112109
- Open the generated `docs/index.html` file in a web browser.
113110

114111
## Support
112+
115113
Have questions? Need help? Join our community support
116114
[Telegram channel](https://t.me/bch_js_toolkit)
117115

118116
## IPFS Releases
119117

120-
I will periodically publish IPFS releases of this repository, including all
121-
dependencies in the `node_modules` folder. This ensures working copies of this
122-
repository can be retrieved in case there is any drift in dependency files, or
123-
if dependencies are pulled from npm or GitHub.
118+
Copies of this repository are also published on IPFS.
124119

125-
- Initial fork on 5/9/2019:
126-
- without node_modules folder: QmQFHfbBQdEHfhtiRLbXtX1NcgnfL45hZb7TbQimTXAuzG (4 MB)
127-
- with node_modules folder: QmXq9Ds6Qdkg9xbRhcF8pay9KabA6QN2y7bx3wvSqiXifk (107 MB)
128-
129-
- v1.0.0 - refactored to pure JavaScript:
130-
- without node_modules folder: QmNjFsiTZRMAUa9rZpXqZqivv9JLaNicwLSPHjyLB7PVDk (1 MB)
131-
- with node_modules folder: Qma9ScApwBtuL7dpdSk7jpBFTxbqRdiR921WjyP75SU7bT (100 MB)
120+
- v3.8.10: QmauhggzKDo9A9je5y2K6WRAp32JmGRFCw2ZFTiSnW8yot
132121

133122
## License
123+
134124
[MIT](LICENSE.md)

0 commit comments

Comments
 (0)