@solar-republic/cosmos-grpc v0.15.4
Cosmos gRPC
Generates ultralight, tree-shakable TypeScript APIs from the .proto
files of any blockchain built using the Cosmos-SDK. Intended for use in a Web environment.
Generated code is strongly-typed, self-contained, and dependency-free.
The generated module includes:
- gRPC REST clients compatible with Cosmos REST endpoints (via gRPC-gateway)
- Protobuf message encoders & decoders, including for strongly-typed
google.protobuf.Any
interfaces - Positional destructors for the JSON serialization of messages (e.g., those returned by gRPC-gateway)
Some goals for this project include:
- adding Amino transcoders
Motivation
Other generated clients use protoc plugins that end up producing extremely bloated code with many unused functions, hefty classes, and poor tree-shakability, leading to large bundles. Part of the reason is due to how those protoc plugins map Messages to classes, support a variety of transports, and import bulky dependencies for encoding/decoding.
This project implements its own ultralight protobuf encoder & decoder, exports every operation as its own ESM function (for optimal tree-shaking), and focusses solely on Cosmos-SDK's gRPC-gateway REST endpoints for transport.
Using in a project
yarn add @solar-republic/cosmos-grpc
Contributing
yarn install
yarn build
8 days ago
14 days ago
14 days ago
18 days ago
18 days ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
7 months ago
7 months ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago