@thru/proto when you need the generated message and service types behind Thru’s RPC surface, especially if you are building a custom client, middleware, or test harness.
Install
When to use it
Choose this package when you want to:- Instantiate protobuf messages from generated schemas.
- Call Thru gRPC or Connect services directly.
- Share the same generated types across browser and server code.
- Keep your client layer close to the wire format instead of using a higher-level SDK.
Entry points
The package exposes a single public entry point at@thru/proto.
What it exports
@thru/proto re-exports create from @bufbuild/protobuf and the generated protobuf modules for:
| Group | Representative exports |
|---|---|
| Common types | consensus, errors, filters, pagination, primitives |
| Core types | account, block, node, state, transaction, types |
| Service definitions | CommandService, DebugService, QueryService, StreamingService |
Example
Message creation
Generated message modules include schema constants, so you can instantiate messages withcreate( ...Schema ) instead of hand-constructing plain objects.