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.
Everything between intent and signature.
From wallet intent to an inspectable plan.
Initialize the client, describe the exact-input trade, and receive ordered unsigned transactions with a simulation result.
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",
},
});{
"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
}
}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_KEYTest 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.
0x0000000000000000000000000000000000000001Funded; approval required before the swap0x0000000000000000000000000000000000000002Funded; approval already granted0x0000000000000000000000000000000000000003Holds 1 USDG; plans fail closed0x0000000000000000000000000000000000000004Empty wallet0x0000000000000000000000000000000000000005Plan is blocked with no signable transactions0x0000000000000000000000000000000000000006Quote provider returns a retryable errorAny 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.
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.
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.
/assetsList canonical market assets
GET/assets/{symbol}Resolve a symbol to its canonical asset
GET/prices/{symbol}Read underlying and token-equivalent prices
GET/corporate-actionsRead splits, dividends, and other actions
GET/portfolios/{wallet}Read balances and portfolio context
POST/quotesRequest an exact-input or exact-output quote
POST/trades/planBuild and simulate an unsigned trade plan
POST/transactions/simulateSimulate an ordered transaction sequence
Financial context stays explicit.
Resolve symbols to the official Robinhood Chain deployment, status, multiplier, capabilities, and provenance.
Underlying reference quotes and multiplier-adjusted token values are separate fields, never one ambiguous number.
Native gas and ERC-20 balances are read at an explicit block before a plan is constructed.
Quote responses preserve the route, exact base-unit amounts, slippage tolerance, provider, and expiry.
Required approvals and swap calldata are returned in execution order with wallet and intent context.
Built-in safety and active project rules produce an explainable allow, warn, or block decision bound to the durable plan.
Ordered calls run through eth_simulateV1 so prerequisite state changes carry forward before signing.
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.
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.