Skip to main content
Use @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

npm install @thru/proto

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.
import { create, GetBlockRequestSchema, QueryService, Account, Block } from "@thru/proto";

What it exports

@thru/proto re-exports create from @bufbuild/protobuf and the generated protobuf modules for:
GroupRepresentative exports
Common typesconsensus, errors, filters, pagination, primitives
Core typesaccount, block, node, state, transaction, types
Service definitionsCommandService, DebugService, QueryService, StreamingService

Example

import { create, GetBlockRequestSchema } from "@thru/proto";

const request = create(GetBlockRequestSchema, {
  slot: 123n,
});

Message creation

Generated message modules include schema constants, so you can instantiate messages with create( ...Schema ) instead of hand-constructing plain objects.