A gRPC-web client for connecting browser applications to a bchd (Bitcoin Cash full node) server. Version 0.16.5-v2 is current. Built by Google's grpc/grpc-web library (not the older @improbable-eng/grpc-web) for long-term stability. Ships TypeScript definitions. Includes utilities for hex/base64/Uint8Array conversion, merkle proof validation, and compact filter matching. Notable limitation: lacks FETCH support (only XHR). Alternative: grpc-bchrpc-web (improbable-eng) for Node.js or web.
npm install grpc-bchrpc-browserNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a gRPC client, sends a GetMempoolInfo request, and logs the mempool size.
Use XHR-compatible endpoints or switch to improbable-eng grpc-web for Fetch support.
Pin 'grpc-web' to a known compatible version (e.g., 1.x) in package.json.
Import from 'grpc-bchrpc-browser' directly; avoid deep imports like 'grpc-bchrpc-browser/lib/...'.
Run 'npm install grpc-bchrpc-browser' and ensure your bundler resolves node_modules.
Use 'import { GrpcClient } from 'grpc-bchrpc-browser'' instead of 'const GrpcClient = require(...)'.Ensure the gRPC-web proxy (e.g., Envoy) is set up to allow CORS and forward to bchd.