RobinRelay Documentation
Everything you need to route, simulate, broadcast and track transactions on Robinhood Chain through RobinRelay.
Introduction
RobinRelay is a transaction reliability layer that sits between your application and Robinhood Chain. Instead of pointing your dApp at a single RPC URL, you send transactions through RobinRelay, which monitors multiple endpoints, simulates transactions before broadcast, selects the healthiest RPC, and fails over automatically when an endpoint degrades.
Quick Start
Install the SDK from npm:
npm install @robinrelay/sdkInitialize the client and send your first transaction:
import { RobinRelay } from "@robinrelay/sdk"; const relay = new RobinRelay({ network: "robinhood", apiKey: process.env.ROBINRELAY_API_KEY,}); const tx = await relay.sendTransaction({ transaction, simulate: true, failover: true,}); const receipt = await tx.confirmed();console.log(receipt.status);Authentication
Requests are authenticated with an API key passed as a Bearer token. Store your key in an environment variable and never expose it in client-side code.
Authorization: Bearer <ROBINRELAY_API_KEY>RPC Endpoint
RobinRelay exposes a standard JSON-RPC endpoint. Point any Ethereum-compatible client at it and RobinRelay handles endpoint selection and failover transparently.
POST https://relay.robinrelay.dev/v1/rpc { "jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}Send Transaction
The sendTransaction method simulates, routes and broadcasts a signed transaction. It returns a handle you can await for confirmation.
const tx = await relay.sendTransaction({ transaction, // signed, serialized transaction simulate: true, failover: true,});Simulation
When simulate is enabled, RobinRelay executes the transaction against the pending block before broadcasting. If the simulation reverts, the transaction is never sent and the revert reason is returned.
const result = await relay.simulate({ transaction }); if (!result.success) { console.error(result.revertReason);}Failover
If a broadcast fails because an endpoint is unreachable or degraded, RobinRelay automatically retries against the next healthiest RPC. Failover is transparent to your application and typically completes in well under a second.
Confirmation
Await tx.confirmed() to track a transaction until it reaches a final status. RobinRelay polls across healthy endpoints so a single lagging RPC does not stall confirmation.
const receipt = await tx.confirmed({ confirmations: 3 });Error Handling
RobinRelay surfaces typed errors so you can distinguish simulation reverts from network failures.
try { const tx = await relay.sendTransaction({ transaction }); await tx.confirmed();} catch (err) { if (err.code === "SIMULATION_REVERTED") { // transaction was not broadcast } else if (err.code === "ALL_ENDPOINTS_FAILED") { // every RPC endpoint was unavailable }}SDK
PreviewThe @robinrelay/sdk package is not yet published. The API described here is a preview and may change before general availability.
API Reference
PreviewA complete REST and JSON-RPC reference will be published alongside the public API. The endpoints below are a preview of the planned surface.
| Method | Path | Description |
|---|---|---|
| POST | /v1/transactions | Simulate, route and broadcast a transaction |
| POST | /v1/rpc | Forward a JSON-RPC request through the router |
| GET | /v1/transactions/:hash | Fetch confirmation status for a transaction |
| GET | /v1/endpoints | List monitored RPC endpoints and their health |