Install
--features "ws grpc" for an indexer that subscribes to both surfaces.
What’s included
Environment variables
The SDK reads endpoints from the environment if you don’t pass them explicitly. This is the recommended pattern for agent-generated code: the agent never has to hard-code URLs or keys, and the same binary works across regions and networks.Quick example
A minimal RPC agent that reads its endpoint from the environment and queries balance with retry/failover handled automatically:Streaming with Yellowstone gRPC
subscribe_yaml reads filters from a YAML config; for programmatic filters use client.subscribe(SubscribeRequest { .. }) instead. The Jetstream client mirrors this pattern. Swap GeyserClientBuilder for JetstreamClientBuilder.
Why use the SDK over raw HTTP
For agent-written production code, the SDK handles the cross-cutting concerns that are easy to get wrong:- Retries with exponential backoff, configurable per client
- Multi-region failover: primary fails, fallbacks tried in order
- Auth injection: license key added to every request, never stored in the endpoint
- WebSocket reconnect: subscriptions auto-resubscribe after disconnect
- gRPC channel management: keepalive, reconnect, backoff
- Typed responses: common methods deserialize into Rust structs, with raw escape hatches available for everything else
Source
- SDK repo: github.com/orbitflare/orbitflare-sdk-rs
- Full reference: SDK overview, RPC, WebSocket, gRPC, Jetstream