Skip to main content
Built on alloy types throughout - Address, U256, B256, Filter, TransactionRequest, typed blocks, transactions, receipts, and logs - with OrbitFlare’s own transport: endpoint failover, retry with backoff, and self-healing WebSocket subscriptions. It targets Robinhood Chain, the EVM-compatible L2, and defaults to OrbitFlare’s production endpoints.

Install

Only the RPC client is enabled by default. Enable what you need:

Alloy types

All addresses, hashes, and quantities are alloy types. The common ones are re-exported at the crate root (Address, U256, B256, Bytes, Filter, TransactionRequest, BlockNumberOrTag, …), and the full crates are available as orbitflare_robinhood_sdk::primitives (alloy-primitives) and orbitflare_robinhood_sdk::rpc_types (alloy-rpc-types-eth).

RPC client

Here’s a client with every option set:
Everything has a sensible default - the builder defaults to the production OrbitFlare endpoint, so the minimal setup is:

Builder methods

.url(url) - The primary endpoint. Resolution order: .url() on the builder, then the ORBITFLARE_ROBINHOOD_RPC_URL environment variable, then the default https://robinhood.rpc.orbitflare.com (rpc::DEFAULT_RPC_URL). .urls(&[...]) - Set the primary and all fallbacks in one call. The first element is the primary, the rest are fallbacks. .fallback_url(url) / .fallback_urls(&[...]) - Add failover endpoints. When the primary fails, the SDK tries fallbacks in order. Failing endpoints are quarantined with exponential cooldown (10s, 20s, 40s, max 60s) and automatically retried once the cooldown expires; healthy endpoints are always preferred. .api_key(key) - Your OrbitFlare license key. If not set, the SDK checks ORBITFLARE_LICENSE_KEY from the environment. The key is appended to the endpoint URL at request time. .block_tag(tag) - Default block tag used by state queries (get_balance, call, get_code, …). Takes anything that converts into BlockNumberOrTag. Defaults to Latest. .retry(policy) - Controls retry on transient errors (5xx, 429, connection resets, JSON-RPC error code -32005) with exponential backoff before failing over to the next endpoint. 429 responses with a Retry-After header are respected. .timeout(duration) - HTTP timeout for each individual request.

Available RPC methods

Reading chain state

Log filters

get_logs takes alloy’s Filter directly:

Contract calls and transactions

call and estimate_gas take alloy’s TransactionRequest. To send a transaction, build and sign it with alloy (alloy-signer, alloy-network), then broadcast through the SDK:

Arbitrary methods

request calls any RPC method by name - the SDK builds the JSON-RPC envelope, handles retry and failover, and returns the result field. This also covers the arb_* extension methods Robinhood Chain serves as an Arbitrum Nitro chain. request_raw sends a raw JSON-RPC body string.

WebSocket client

Enable the ws feature. Robinhood Chain produces blocks roughly every 100 milliseconds, so newHeads fires far faster than on Ethereum mainnet or most L2s.
Minimal:
Note that .build() is async - it establishes the WebSocket connection before returning. The builder shares .urls(), .fallback_url(s)(), .api_key(), and .retry() with the RPC builder; the WebSocket-specific options are: .url(url) - Primary WebSocket endpoint. Resolution order: .url(), then ORBITFLARE_ROBINHOOD_WS_URL, then the default wss://robinhood.rpc.orbitflare.com (ws::DEFAULT_WS_URL). .ping_interval_secs(n) - How often the SDK sends WebSocket Ping frames to detect dead connections. Default: 10. .max_missed_pongs(n) - Pings without a response before the connection is considered dead and reconnected. Default: 3.

Subscriptions

Subscriptions are typed - each yields the corresponding alloy type instead of raw JSON:
All subscriptions return a WsSubscription<T>. Call .next() for the next typed event (None means the subscription was closed), or .next_raw() for the untyped serde_json::Value payload.
All subscriptions run on a single WebSocket connection, and you can add new ones at any time. sub.unsubscribe().await removes one explicitly; dropping a subscription without calling it also works - the SDK detects the orphan and sends the unsubscribe automatically.

Reconnection

If the connection drops, the background task reconnects with exponential backoff and re-subscribes every active subscription automatically. Your .next() calls just keep working - events resume once the connection is back. Dead connections are detected via active ping/pong, configurable with .ping_interval_secs() and .max_missed_pongs().

Environment variables

Full example

A monitoring script that reads a wallet, then follows new blocks and ERC-20 transfers in real time:

Source

The SDK is open source: github.com/orbitflare/orbitflare-robinhood-sdk-rs