Last updated:
0 purchases
grpc bchrpc web
BCHD gRPC web client for Flutter web projects #
This package provides a gRPC web client for connecting directly to a BCHD full node.
Usage #
import "package:grpc_bchrpc/grpc_bchrpc.dart";
final client = GrpcWebClient();
const txid = "11556da6ee3cb1d14727b3a8f4b37093b6fecd2bc7d577a02b4e98b7be58a7e8";
final res = await client.getRawTransaction(hash: hex.decode(txid), reversedHashOrder: true);
expect(res.transaction.length, 441);
client.close();
copied to clipboard
Test #
$ dart test/client.spec.dart
Regenerate the stubs #
If you want to regenerate the corresponding Dart files for protos/bchrpc.proto,
you will need to have protoc version 3.0.0 or higher and the Dart protoc plugin
version 0.7.9 or higher on your PATH.
To install protoc, see the instructions on
the Protocol Buffers website.
The easiest way to get the Dart protoc plugin is by running
$ pub global activate protoc_plugin
copied to clipboard
and follow the directions to add ~/.pub-cache/bin to your PATH, if you haven't
already done so.
You can now regenerate the Dart files by running
$ protoc --dart_out=grpc:lib/src/generated -Iprotos protos/bchrpc.proto
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.