From cc9e8c03197319561b7902ef886502a81cae1db5 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 8 Nov 2020 17:38:11 -0800 Subject: [PATCH 1/5] Fixing links in README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2240516..37c0610 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # bch-js -[![Build Status](https://travis-ci.org/christroutner/bch-js.svg?branch=master)](https://travis-ci.org/christroutner/bch-js) +[![Build Status](https://travis-ci.org/Permissionless-Software-Foundation/bch-js.svg?branch=master)](https://travis-ci.org/Permissionless-Software-Foundation/bch-js) [![Version](https://img.shields.io/npm/v/@chris.troutner/bch-js)](https://www.npmjs.com/package/@chris.troutner/bch-js) [![Downloads/week](https://img.shields.io/npm/dw/@chris.troutner/bch-js)](https://npmjs.org/package/@chris.troutner/bch-js) -[![License](https://img.shields.io/npm/l/@chris.troutner/bch-js)](https://github.com/christroutner/bch-js/blob/master/LICENSE.md) +[![License](https://img.shields.io/npm/l/@chris.troutner/bch-js)](https://github.com/Permissionless-Software-Foundation/bch-js/blob/master/LICENSE.md) [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). @@ -37,7 +37,7 @@ bchjs = new BCHJS({ restURL: 'https://tapi.fullstack.cash/v3/' }) ``` 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 -the [bch-api](https://github.com/christroutner/bch-api) REST API. +the [bch-api](https://github.com/Permissionless-Software-Foundation/bch-api) REST API. If you need a backward-compatible instance of this library, you can use a 'shim'. Do it like this: @@ -47,7 +47,7 @@ const bitbox = BCHJS.BitboxShim({ restURL: 'https://api.fullstack.cash/v3/' }) ``` ### API Key -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 +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 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*. - Implicitly: bch-js will detect your JWT token by setting the `BCHJSTOKEN` environment variable. From c2ff1e2d689881e232cc30d745a85b7972469cf0 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 8 Nov 2020 17:46:40 -0800 Subject: [PATCH 2/5] Updating npm lib --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 37c0610..e5731fe 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # bch-js [![Build Status](https://travis-ci.org/Permissionless-Software-Foundation/bch-js.svg?branch=master)](https://travis-ci.org/Permissionless-Software-Foundation/bch-js) -[![Version](https://img.shields.io/npm/v/@chris.troutner/bch-js)](https://www.npmjs.com/package/@chris.troutner/bch-js) -[![Downloads/week](https://img.shields.io/npm/dw/@chris.troutner/bch-js)](https://npmjs.org/package/@chris.troutner/bch-js) -[![License](https://img.shields.io/npm/l/@chris.troutner/bch-js)](https://github.com/Permissionless-Software-Foundation/bch-js/blob/master/LICENSE.md) +[![Version](https://img.shields.io/npm/v/@psf/bch-js)](https://www.npmjs.com/package/@psf/bch-js) +[![Downloads/week](https://img.shields.io/npm/dw/@psf/bch-js)](https://npmjs.org/package/@psf/bch-js) +[![License](https://img.shields.io/npm/l/@psf/bch-js)](https://github.com/Permissionless-Software-Foundation/bch-js/blob/master/LICENSE.md) -[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). +[bch-js](https://www.npmjs.com/package/@psf/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). ### Quick Start Videos: Here are two YouTube walk-through videos to help you get started: @@ -13,7 +13,7 @@ Here are two YouTube walk-through videos to help you get started: - [Working with the FullStack.cash JWT token](https://youtu.be/GD2i1ZUiyrk) ### Quick Links -- [npm Library](https://www.npmjs.com/package/@chris.troutner/bch-js) +- [npm Library](https://www.npmjs.com/package/@psf/bch-js) - [Documentation](https://bchjs.fullstack.cash/) - [Examples](https://github.com/Permissionless-Software-Foundation/bch-js-examples) - [api.fullstack.cash](https://api.fullstack.cash) - The REST API this library talks to by default. @@ -25,11 +25,11 @@ developers. ### Quick Notes -- Install library: `npm install @chris.troutner/bch-js` +- Install library: `npm install @psf/bch-js` - Instantiate the library in your code: ``` -const BCHJS = require("@chris.troutner/bch-js") +const BCHJS = require("@psf/bch-js") let bchjs = new BCHJS() // testnet @@ -42,7 +42,7 @@ the [bch-api](https://github.com/Permissionless-Software-Foundation/bch-api) RES If you need a backward-compatible instance of this library, you can use a 'shim'. Do it like this: ``` -const BCHJS = require("@chris.troutner/bch-js") +const BCHJS = require("@psf/bch-js") const bitbox = BCHJS.BitboxShim({ restURL: 'https://api.fullstack.cash/v3/' }) ``` @@ -54,7 +54,7 @@ rate limits when interacting with the back end server. See [this article](https: - Explicitly: You can directly feed in the JWT token with the `apiToken` property when instantiating the library. Here is an example: ``` -const BCHJS = require("@chris.troutner/bch-js") +const BCHJS = require("@psf/bch-js") let bchjs = new BCHJS({ restURL: 'https://api.fullstack.cash/v3/', apiToken: 'eyJhbGciO...' // Your JWT token here. From 33d2da503dd3400d158e9355c87b1f8bacc57a5d Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 8 Nov 2020 18:49:45 -0800 Subject: [PATCH 3/5] Updating READMe --- README.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e5731fe..fb2d9af 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Downloads/week](https://img.shields.io/npm/dw/@psf/bch-js)](https://npmjs.org/package/@psf/bch-js) [![License](https://img.shields.io/npm/l/@psf/bch-js)](https://github.com/Permissionless-Software-Foundation/bch-js/blob/master/LICENSE.md) -[bch-js](https://www.npmjs.com/package/@psf/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). +[bch-js](https://www.npmjs.com/package/@psf/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. Learn more from [this article](https://troutsblog.com/research/bitcoin-cash/how-to-bch-full-stack-developer) about Full Stack Bitcoin Cash development. ### Quick Start Videos: Here are two YouTube walk-through videos to help you get started: @@ -30,21 +30,19 @@ developers. - Instantiate the library in your code: ``` const BCHJS = require("@psf/bch-js") -let bchjs = new BCHJS() +let bchjs = new BCHJS() // Default to BCHN network. // testnet -bchjs = new BCHJS({ restURL: 'https://tapi.fullstack.cash/v3/' }) +bchjs = new BCHJS({ restURL: 'https://testnet3.fullstack.cash/v3/' }) ``` -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 -the [bch-api](https://github.com/Permissionless-Software-Foundation/bch-api) REST API. +This library is intended to be paired with +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: -If you need a backward-compatible instance of this library, you can use a -'shim'. Do it like this: -``` -const BCHJS = require("@psf/bch-js") -const bitbox = BCHJS.BitboxShim({ restURL: 'https://api.fullstack.cash/v3/' }) -``` +- BCHN Mainnet REST API server: https://bchn.fullstack.cash/v3/ +- ABC Mainnet REST API server: https://abc.fullstack.cash/v3/ +- Testnet3 REST API server: https://testnet3.fullstack.cash/v3/ +- Check server status: https://metrics.fullstack.cash ### API Key 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 From a1bf617d9103680a4ee3aaec33da123e432a3bd6 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 8 Nov 2020 18:56:48 -0800 Subject: [PATCH 4/5] Updating README --- README.md | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index fb2d9af..a81e246 100644 --- a/README.md +++ b/README.md @@ -8,26 +8,29 @@ [bch-js](https://www.npmjs.com/package/@psf/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. Learn more from [this article](https://troutsblog.com/research/bitcoin-cash/how-to-bch-full-stack-developer) about Full Stack Bitcoin Cash development. ### Quick Start Videos: + Here are two YouTube walk-through videos to help you get started: + - [Introduction to bch-js and the bch-js-examples repository](https://youtu.be/GD2i1ZUiyrk) - [Working with the FullStack.cash JWT token](https://youtu.be/GD2i1ZUiyrk) ### Quick Links + - [npm Library](https://www.npmjs.com/package/@psf/bch-js) - [Documentation](https://bchjs.fullstack.cash/) - [Examples](https://github.com/Permissionless-Software-Foundation/bch-js-examples) - [api.fullstack.cash](https://api.fullstack.cash) - The REST API this library talks to by default. - [FullStack.cash Account](https://fullstack.cash/login) - Get your API key to unlock increased rate limits. - [FullStack.cash](https://fullstack.cash) - cloud-based infrastructure for application -developers. + developers. - [Permissionless Software Foundation](https://psfoundation.cash) - The organization that maintains this library. - ### 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() // Default to BCHN network. @@ -45,22 +48,25 @@ the [bch-api](https://github.com/Permissionless-Software-Foundation/bch-api) RES - Check server status: https://metrics.fullstack.cash ### API Key -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 -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*. -- Implicitly: bch-js will detect your JWT token by setting the `BCHJSTOKEN` environment variable. +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 +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_. + +- 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://api.fullstack.cash/v3/', + restURL: 'https://bchn.fullstack.cash/v3/', apiToken: 'eyJhbGciO...' // Your JWT token here. }) ``` ### Gatsby + 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): + ``` exports.onCreateWebpackConfig = ({ actions }) => { actions.setWebpackConfig({ @@ -73,43 +79,38 @@ exports.onCreateWebpackConfig = ({ actions }) => { 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](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. + ## Features -This library sets itself apart from BITBOX with the following features: - [ECMAScript 2017 standard JavaScript](https://en.wikipedia.org/wiki/ECMAScript#8th_Edition_-_ECMAScript_2017) used instead of TypeScript. Works -natively with node.js v10 or higher. + 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)](https://www.youtube.com/watch?v=vvlpYUx6HRs). - [Semantic Release](https://github.com/semantic-release/semantic-release) for -continuous delivery using semantic versioning. + continuous delivery using semantic versioning. - [Greenkeeper](https://greenkeeper.io/) automatic dependency management for -automatically maintaining the latest, most secure dependencies. + automatically maintaining the latest, most secure dependencies. - [IPFS uploads](https://ipfs.io) of all files and dependencies, to backup -dependencies in case they are ever inaccessible from GitHub or npm. - - + dependencies in case they are ever inaccessible from GitHub or npm. ## Documentation: Full documentation for this library can be found here: + - [Documentation](https://bchjs.fullstack.cash/) -Original documentation on BITBOX is available at: - -- [General docs](https://developer.bitcoin.com) -- [BITBOX Introduction](https://developer.bitcoin.com/bitbox) -- [BITBOX API Reference](https://developer.bitcoin.com/bitbox/docs/getting-started) - - bch-js uses [APIDOC](http://apidocjs.com/) 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](https://t.me/bch_js_toolkit) @@ -121,6 +122,7 @@ repository can be retrieved in case there is any drift in dependency files, or if dependencies are pulled from npm or GitHub. - Initial fork on 5/9/2019: + - without node_modules folder: QmQFHfbBQdEHfhtiRLbXtX1NcgnfL45hZb7TbQimTXAuzG (4 MB) - with node_modules folder: QmXq9Ds6Qdkg9xbRhcF8pay9KabA6QN2y7bx3wvSqiXifk (107 MB) @@ -129,4 +131,5 @@ if dependencies are pulled from npm or GitHub. - with node_modules folder: Qma9ScApwBtuL7dpdSk7jpBFTxbqRdiR921WjyP75SU7bT (100 MB) ## License + [MIT](LICENSE.md) From a32e0da9be600c1241498c3d0a230ee696366842 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sun, 8 Nov 2020 19:02:30 -0800 Subject: [PATCH 5/5] Updating README --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a81e246..1cd03fa 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Downloads/week](https://img.shields.io/npm/dw/@psf/bch-js)](https://npmjs.org/package/@psf/bch-js) [![License](https://img.shields.io/npm/l/@psf/bch-js)](https://github.com/Permissionless-Software-Foundation/bch-js/blob/master/LICENSE.md) -[bch-js](https://www.npmjs.com/package/@psf/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. Learn more from [this article](https://troutsblog.com/research/bitcoin-cash/how-to-bch-full-stack-developer) about Full Stack Bitcoin Cash development. +[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. ### Quick Start Videos: @@ -19,10 +19,9 @@ Here are two YouTube walk-through videos to help you get started: - [npm Library](https://www.npmjs.com/package/@psf/bch-js) - [Documentation](https://bchjs.fullstack.cash/) - [Examples](https://github.com/Permissionless-Software-Foundation/bch-js-examples) -- [api.fullstack.cash](https://api.fullstack.cash) - The REST API this library talks to by default. +- [bchn.fullstack.cash](https://bchn.fullstack.cash) - The REST API this library talks to by default. +- [FullStack.cash](https://fullstack.cash) - cloud-based infrastructure for application developers. - [FullStack.cash Account](https://fullstack.cash/login) - Get your API key to unlock increased rate limits. -- [FullStack.cash](https://fullstack.cash) - cloud-based infrastructure for application - developers. - [Permissionless Software Foundation](https://psfoundation.cash) - The organization that maintains this library. ### Quick Notes @@ -33,7 +32,7 @@ Here are two YouTube walk-through videos to help you get started: ``` const BCHJS = require("@psf/bch-js") -let bchjs = new BCHJS() // Default to BCHN network. +let bchjs = new BCHJS() // Defaults to BCHN network. // testnet bchjs = new BCHJS({ restURL: 'https://testnet3.fullstack.cash/v3/' })