RailXDocumentationAPI status
RailX API v0

Build on tokenized markets through one coherent interface.

RailX turns fragmented asset metadata, financial semantics, chain state, liquidity, approvals, and simulation into primitives software can rely on.

CORE PRIMITIVES

Everything between intent and signature.

QUICKSTART

From wallet intent to an inspectable plan.

Initialize the client, describe the exact-input trade, and receive ordered unsigned transactions with a simulation result.

request.tsTypeScript
import { RailXClient } from "@railx/sdk";

const rail = new RailXClient({
  baseUrl: "https://railx.dev/api/v0",
  apiKey: process.env.RAILX_PROJECT_KEY,
});

const plan = await rail.trades.plan({
  wallet: address,
  intent: {
    type: "exact_input",
    tokenIn: "USDG",
    tokenOut: "NVDA",
    amountIn: "500",
  },
});
plan.jsonResponse
{
  "status": "ready",
  "chainId": 4663,
  "intent": {
    "type": "swap_exact_input",
    "tokenIn": "USDG",
    "tokenOut": "NVDA",
    "amountIn": "500"
  },
  "simulation": {
    "status": "passed",
    "mode": "sequential"
  },
  "verdict": {
    "outcome": "allow",
    "policyVersion": { "id": "policy_...", "version": 3, "schemaVersion": 1 },
    "checks": [
      { "source": "rail_safety", "code": "SIMULATION_PASSED" },
      { "source": "project_policy", "code": "POLICY_EVALUATED" }
    ]
  },
  "signing": {
    "mode": "wallet_controlled",
    "submittedByRail": false
  }
}
The wallet stays in control.RailX returns explicit unsigned transactions. Your wallet reviews, signs, and submits them.
AUTHENTICATION

Authenticate server-side.

Create a test or live project key in the dashboard, pass it as a bearer token, and keep it in server environment variables. Keys are isolated by environment and never belong in a browser bundle.

Authorization: Bearer $RAILX_PROJECT_KEY
SANDBOX

Test keys run against a deterministic sandbox.

A railx_test_ key never reaches Robinhood, the chain, or Uniswap. Every call is answered from a fixed catalog with repeatable balances, so your integration tests need no provider credential and produce the same result every run. Pick an outcome by wallet address, or force one with the x-railx-scenario header.

funded0x0000000000000000000000000000000000000001Funded; approval required before the swap
approved0x0000000000000000000000000000000000000002Funded; approval already granted
insufficient_balance0x0000000000000000000000000000000000000003Holds 1 USDG; plans fail closed
zero_balance0x0000000000000000000000000000000000000004Empty wallet
simulation_failed0x0000000000000000000000000000000000000005Plan is blocked with no signable transactions
provider_degraded0x0000000000000000000000000000000000000006Quote provider returns a retryable error

Any other wallet behaves like zero_balance. The symbol HALT reports a trading halt. Plan and quote identifiers repeat when you send the same x-request-id. Sandbox responses carry x-railx-sandbox: on.

TRADE POLICY

Every plan tells you whether to allow, review, or block it.

RailX first simulates the full sequence, then applies the active immutable policy for that project. Policies can allow or block stocks and payment tokens, and set warning or blocking thresholds for trade size and requested slippage. Every result includes structured checks a person or coding agent can explain.

A blocked plan cannot be signed.Warnings keep unsigned transactions for human review. Blocks return no transaction steps or signable payloads. A failed or partial simulation is always a built-in RailX safety block.
API REFERENCE

Seven primitives. One response model.

All routes are versioned under /api/v0. Quantities use exact decimal strings, addresses are checksummed, and every response includes a request ID.

CONCEPTS

Financial context stays explicit.

Canonical assets

Resolve symbols to the official Robinhood Chain deployment, status, multiplier, capabilities, and provenance.

Price semantics

Underlying reference quotes and multiplier-adjusted token values are separate fields, never one ambiguous number.

Wallet context

Native gas and ERC-20 balances are read at an explicit block before a plan is constructed.

Executable quotes

Quote responses preserve the route, exact base-unit amounts, slippage tolerance, provider, and expiry.

Trade plans

Required approvals and swap calldata are returned in execution order with wallet and intent context.

Policy verdicts

Built-in safety and active project rules produce an explainable allow, warn, or block decision bound to the durable plan.

Sequential simulation

Ordered calls run through eth_simulateV1 so prerequisite state changes carry forward before signing.

OPERATIONS

Usage and diagnostics are built into every request.

Authenticated responses identify the resolved environment and plan, plus minute and monthly allowance headers. The dashboard separates test and live usage, searches recent requests by ID, route, status, key prefix, error, symbol, or wallet, and exports daily usage as CSV.

Diagnostics are safe to share.Request logs retain normalized routes, timings, status, and allowlisted context. They never retain bearer tokens, API secrets, calldata, request bodies, or raw provider responses.
ERRORS

Errors are designed for software.

Every failure includes a stable code, plain-language message, retryability signal, details, and request ID. Branch on the error code, never the prose.

INVALID_REQUESTCorrect the payload before retrying.
ASSET_NOT_FOUNDThe symbol does not resolve to a canonical asset.
INSUFFICIENT_BALANCEThe wallet cannot fund the requested exact input.
RATE_LIMITEDRetry after the minute window reported in the response.
MONTHLY_LIMIT_EXCEEDEDThe project has exhausted its operator-assigned monthly allowance.
UPSTREAM_UNAVAILABLERetry according to the response signal.