npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

grpc-bchrpc-browser

v0.16.5-v2

Published

BCHD gRPC client for browsers

Readme

A bchd rpc client for browsers using grpc/grpc-web

This package provides a simple gRPC client for connecting web applications to a bchd full node.

A mobile friendly version of this project is formatted from markdown by github pages.

Getting Started

For a quick example usage subscribing transactions see the console here, or an experimental example using this module in a web worker.

Detailed RPC Documentation for the rpc protocol is a work in progress.

Client Documentation detailing methods and utility functions.

Mocha browser tests should provide some working examples.

This is slightly more than a stock client generated from protocol buffers. The following utilities have been added:

  • Simple utilities to transform hex/base64/Uint8Arrays without nodejs Buffer
  • A function to transform a number to a little-endian array
  • Functions to validate a merkle proof from bchd
  • A class to read and match compact filters for outpoints and public keys

For Bitcoin Cash and bchd specifically, functions are currently here to validate a transaction and block, as well as other utilities to handle different data types used or sent by bchd.

Motivation

This project uses Google's grpc/grpc-web library to generate a client, rather than the older and more widely used @improbable-eng/grpc-web.

The client is built from the pb files in advance rather than on-the-fly, a functionality which may be employed with the @improbable library.

The motivation is toward lower maintenance, long-term stability and support by using the google library, not that this thinking played out well with the framework formerly known as angular.

One notable limitation of the official grpc/grpc-web library is a lack of FETCH support.

See also

Alternative implementations of this project are built using the improbable-eng library here:

Scripts

Note: this project was created in node v12.2.0 (LTS) and used protoc version 3.11.4; and is open to using features from es2017 although initially targeted at es6.

Build

To build:

npm run build        # transpile typescript, browserify and minify use
npm run build:docs   # build documentation for the client class

Running Tests

Tests can be run either from console or in a browser. The typescript is loaded via ts-node, in that context.

npm run test          # run tests in node
npm run test:browser  # run tests in a browser

Updating the Spec

If for some reason you need to update the gcash proto files yourself to add some future functionality use:

npm run pb-clean     # remove old definitions
npm run pb-update    # download bchrpc.proto from gcash/bchd/master
npm run pb-build     # create client library
npm run pb-doc       # generate documentation

Important: an installed version of protoc
is required to run pb-build.

IN ADDITION you must have protoc-gen-grpc-web, see grpc-web

Using bchrpc in a Postman-like webgui

To facilitate debugging and development of the client, it may be useful make calls using a webui. The following npm scripts are provided, assuming you have golang installed.

npm run pb-grpcui-install     # install grpcui
npm run pb-grpcui             # run a local webui against a bchd node

BCHD Full Nodes w/ gRPC

Mainnet:

  • https://bchd.greyh.at:8335
  • https://bchd.imaginary.cash:8335
  • https://bchd.fountainhead.cash:443
  • https://bchd.sploit.cash:443

Testnet:

  • https://bchd.greyh.at:18335
  • https://bchd-testnet.greyh.at:18335