Docs

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.

RobinRelay is in active development. Infrastructure figures shown across this site are simulated preview data and are not real production statistics.

Quick Start

Install the SDK from npm:

shell
npm install @robinrelay/sdk

Initialize 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

Preview

The @robinrelay/sdk package is not yet published. The API described here is a preview and may change before general availability.

Want early access to the SDK? Join the community to be notified when the preview package is released.

API Reference

Preview

A complete REST and JSON-RPC reference will be published alongside the public API. The endpoints below are a preview of the planned surface.

MethodPathDescription
POST/v1/transactionsSimulate, route and broadcast a transaction
POST/v1/rpcForward a JSON-RPC request through the router
GET/v1/transactions/:hashFetch confirmation status for a transaction
GET/v1/endpointsList monitored RPC endpoints and their health