GithubHelp home page GithubHelp logo

salemkode / bch-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from permissionless-software-foundation/bch-js

0.0 0.0 0.0 3.59 MB

A JS library for working with the Bitcoin Cash blockchain. Forked from bitbox-sdk.

Home Page: https://FullStack.cash

License: MIT License

JavaScript 99.95% Shell 0.05%

bch-js's Introduction

bch-js

Version Downloads/week License js-standard-style

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 for increased rate limits. Learn more from this article about Full Stack Bitcoin Cash development.

Quick Start Videos:

Here are two YouTube walk-through videos to help you get started:

Quick Links

Quick Notes

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

  • Instantiate the library in your code:

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

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

API Key

The bch-api REST API hosted by FullStack.cash uses JWT tokens to pay for increased rate limits when interacting with the back end server. See this article if you want to understand the system-as-a-whole. The JWT token can be fed to bch-js implicitly or explicitly.

  • Implicitly: bch-js will detect your JWT token if you set the BCHJSTOKEN environment variable.
  • Explicitly: You can directly feed in the JWT token with the apiToken property when instantiating the library. Here is an example:
const BCHJS = require("@psf/bch-js")
let bchjs = new BCHJS({
  restURL: 'https://bchn.fullstack.cash/v5/',
  apiToken: 'eyJhbGciO...' // Your JWT token here.
})

Gatsby

bch-js is included in this 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:

exports.onCreateWebpackConfig = ({ actions }) => {
  actions.setWebpackConfig({
    node: {
      fs: 'empty'
    }
  })
}

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

We also provide 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.

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 support all aspects of non-fugible tokans (NFTs).

  • Semantic Release for continuous delivery using semantic versioning.

  • Greenkeeper automatic dependency management for automatically maintaining the latest, most secure dependencies.

  • IPFS 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

IPFS Releases

Copies of this repository are also published on IPFS.

  • v4.5.4: QmWv3pxJy3MH8vU5nLUVyzqFxfNKXLQQEnz1rgStNuQijd

License

MIT

test

bch-js's People

Contributors

christroutner avatar zh avatar bytesofman avatar danielhumgon avatar mr-zwets avatar dependabot[bot] avatar pesimista avatar kaellis avatar uncletammy avatar salemkode avatar nicocappabianca avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.