Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.orbitflare.com/llms.txt

Use this file to discover all available pages before exploring further.

When you’re past the prototype stage and shipping a production daemon, indexer, trading bot, or long-running agent worker, reach for the Rust SDK. Instead of managing raw HTTP requests, gRPC channels, and WebSocket connections yourself, the SDK handles connection lifecycle, authentication, retries, failover, and reconnection behind a clean API.
For interactive agent workflows in Claude Code or Cursor, prefer the MCP server. For shell scripts and CI, prefer the CLI. The SDK is for code your agents write: production services that run independently.

Install

cargo add orbitflare-sdk                          # RPC only
cargo add orbitflare-sdk --features ws            # + WebSocket
cargo add orbitflare-sdk --features grpc          # + Yellowstone gRPC
cargo add orbitflare-sdk --features jetstream     # + Jetstream
Combine features as needed, e.g. --features "ws grpc" for an indexer that subscribes to both surfaces.

What’s included

ServiceWhat it does
RPCJSON-RPC client with typed helpers for common Solana methods, plus raw escape hatches
WebSocketSubscriptions for accounts, logs, slots, signatures with auto-resubscribe on reconnect
gRPC (Yellowstone)Yellowstone Geyser streaming for transactions, accounts, slots, and blocks. YAML config or programmatic filters
JetStreamOrbitFlare’s decoded shreds delivered as gRPC streams. Same client pattern as Yellowstone, different proto

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.
VariableUsed byPurpose
ORBITFLARE_LICENSE_KEYRPC, WebSocketAPI key appended to endpoint URLs
ORBITFLARE_RPC_URLRPCDefault endpoint if .url() is not called
ORBITFLARE_WS_URLWebSocketDefault endpoint if .url() is not called
ORBITFLARE_GRPC_URLgRPCDefault endpoint if .url() is not called
ORBITFLARE_JETSTREAM_URLJetStreamDefault endpoint if .url() is not called

Quick example

A minimal RPC agent that reads its endpoint from the environment and queries balance with retry/failover handled automatically:
use orbitflare_sdk::{RpcClientBuilder, Result};

#[tokio::main]
async fn main() -> Result<()> {
    let client = RpcClientBuilder::new().build()?;     // reads ORBITFLARE_RPC_URL + LICENSE_KEY
    let balance = client.get_balance("Gh9ZwEm...").await?;
    println!("{} SOL", balance.value as f64 / 1e9);
    Ok(())
}
With explicit failover regions:
let client = RpcClientBuilder::new()
    .urls(&[
        "http://ny.rpc.orbitflare.com",
        "http://fra.rpc.orbitflare.com",
        "http://ams.rpc.orbitflare.com",
    ])
    .build()?;
The first URL is primary; the rest are fallbacks tried in order on failure.

Streaming with Yellowstone gRPC

use orbitflare_sdk::{YellowstoneClientBuilder, Result};

#[tokio::main]
async fn main() -> Result<()> {
    let client = YellowstoneClientBuilder::new()
        .url("http://fra.rpc.orbitflare.com:10000")
        .build()
        .await?;

    let mut stream = client.subscribe_transactions(/* filters */).await?;
    while let Some(update) = stream.next().await {
        // process update
    }
    Ok(())
}
The Jetstream client mirrors this pattern. Swap YellowstoneClientBuilder 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
When you ask an agent to write an OrbitFlare integration, point it at the SDK and the resulting code stays small, idiomatic, and resilient.

Source