2022-04-30 16:07:17 -07:00
2025-11-25 13:27:13 -08:00
2025-11-25 16:54:26 -08:00
2022-03-14 14:43:52 -07:00
2025-11-25 16:57:48 -08:00
2025-11-25 17:12:32 -08:00

bch-js

Version Downloads/week License js-standard-style Join the chat at https://gitter.im/Permissionless-Software-Foundation/bch-js

bch-js is a JavaScript npm library for creating web and mobile apps that can interact with the Bitcoin Cash (BCH) blockchain. bch-js contains a toolbox of handy tools, and an easy API for talking with psf-bch-api REST API. FullStack.cash offers paid cloud access to psf-bch-api. You can run your own infrastructure by following documentation on CashStack.info.

Quick Start Videos:

YouTube walk-through videos to help you get started:

Quick Notes

  • Install library: npm install @psf/bch-js

  • Instantiate the library in your code:

import BCHJS from "@psf/bch-js"
let bchjs = new BCHJS() // Defaults to BCHN network.

This library is intended to be paired with the psf-bch-api REST API, and the infrastructure provided by FullStack.cash. The restURL property can be changed to work with different Bitcoin Cash networks:

Web Apps

minimal-slp-wallet is a minimal wallet 'engine' that incorporates bch-js. It's compiled with Browserify for front end apps.

This gist shows how to include minimal-slp-wallet into a basic web page without using a framework.

bch-wallet-web3-spa is a React web app template using bch-js and minimal-slp-wallet.

Features

  • ECMAScript 2017 standard JavaScript used instead of TypeScript. Works natively with node.js v10 or higher.

  • Full SLP tokens support: bch-js has full support for all SLP token functionality, including send, mint, and genesis transactions. It also fully supports all aspects of non-fugible tokans (NFTs).

  • Semantic Release for continuous delivery using semantic versioning.

  • IPFS and Radicle uploads of all files and dependencies, to backup dependencies in case they are ever inaccessible from GitHub or npm.

Documentation:

Full documentation for this library can be found here:

bch-js uses APIDOC so that documentation and working code live in the same repository. To generate the documentation:

  • npm run docs
  • Open the generated docs/index.html file in a web browser.

Support

Have questions? Need help? Join our community support Telegram channel

Donate

This open source software is developed and maintained by the Permissionless Software Foundation. If this library provides value to you, please consider making a donation to support the PSF developers:

bitcoincash:qqsrke9lh257tqen99dkyy2emh4uty0vky9y0z0lsr

IPFS & Radicle Releases

Copies of this repository are also published on IPFS.

  • v6.2.10: bafybeifsioj3ba77u2763nsyuzq53gtbdxsnqpoipvdl4immj6ytznjaoy
  • (with dependencies, node v14.18.2 and npm v8.8.0): bafybeihfendd4oj6uxvvecm7sluobwwhpb5wdcxhvhmx56e667nxdncd4a

They are also posted to the Radicle:

  • v6.2.10: rad:git:hnrkkroqnbfwj6uxpfjuhspoxnfm4i8e6oqwy

License

MIT

Languages
JavaScript 99.8%
Shell 0.2%