You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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.
9
9
10
10
### Quick Start Videos:
11
+
11
12
Here are two YouTube walk-through videos to help you get started:
13
+
12
14
-[Introduction to bch-js and the bch-js-examples repository](https://youtu.be/GD2i1ZUiyrk)
13
15
-[Working with the FullStack.cash JWT token](https://youtu.be/GD2i1ZUiyrk)
let bchjs = new BCHJS() // Defaults to BCHN network.
34
36
35
37
// testnet
36
-
bchjs = new BCHJS({ restURL: 'https://tapi.fullstack.cash/v3/' })
38
+
bchjs = new BCHJS({ restURL: 'https://testnet3.fullstack.cash/v3/' })
37
39
```
38
40
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:
41
43
42
-
If you need a backward-compatible instance of this library, you can use a
- 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
48
48
49
49
### 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*.
52
50
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.
54
55
- Explicitly: You can directly feed in the JWT token with the `apiToken` property when instantiating the library. Here is an example:
55
56
56
57
```
57
-
const BCHJS = require("@chris.troutner/bch-js")
58
+
const BCHJS = require("@psf/bch-js")
58
59
let bchjs = new BCHJS({
59
-
restURL: 'https://api.fullstack.cash/v3/',
60
+
restURL: 'https://bchn.fullstack.cash/v3/',
60
61
apiToken: 'eyJhbGciO...' // Your JWT token here.
61
62
})
62
63
```
63
64
64
65
### Gatsby
66
+
65
67
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):
This is because the new IPFS class in bch-js uses the fs library for uploading files, which is not supported by Gatsby.
77
80
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
+
78
83
## Features
79
-
This library sets itself apart from BITBOX with the following features:
80
84
81
85
-[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.
83
87
84
88
- 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).
85
89
86
90
-[Semantic Release](https://github.com/semantic-release/semantic-release) for
87
-
continuous delivery using semantic versioning.
91
+
continuous delivery using semantic versioning.
88
92
89
93
-[Greenkeeper](https://greenkeeper.io/) automatic dependency management for
90
-
automatically maintaining the latest, most secure dependencies.
94
+
automatically maintaining the latest, most secure dependencies.
91
95
92
96
-[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.
96
98
97
99
## Documentation:
98
100
99
101
Full documentation for this library can be found here:
0 commit comments