Skip to main content

Overview

All HTTP RPC endpoints accept POST requests with Content-Type: application/json and follow the JSON-RPC 2.0 specification.

Base Endpoint

Routes requests using the default strategy (configurable, defaults to load_balanced).

Parameters

  • :chain - Chain identifier (name or numeric ID)
    • Chain name: ethereum, base, arbitrum
    • Chain ID: 1, 8453, 42161

Example

Response:

Strategy Endpoints

Explicitly specify the routing strategy for provider selection.

Fastest

Routes all requests to the single fastest provider based on measured latency.

Load Balanced

Randomly distributes requests across healthy providers.

Latency Weighted

Probabilistically routes requests with bias toward lower-latency providers.

Provider Override Endpoints

Route directly to a specific provider, bypassing strategy selection.

Parameters

  • :provider_id - Provider identifier (e.g., alchemy, infura, quicknode)
  • :chain - Chain identifier

Example

Alternative syntax:

Profile-Scoped Endpoints

All routes above are available under a profile namespace for multi-tenancy.

Parameters

  • :profile - Profile slug (e.g., default, testnet, production)

Example

Without an explicit profile in the URL, requests automatically use the "default" profile. Ensure config/profiles/default.yml exists at startup.

Supported Methods

Lasso supports read-only Ethereum JSON-RPC methods:

Block Methods

  • eth_blockNumber - Latest block number
  • eth_getBlockByNumber - Block data by number
  • eth_getBlockByHash - Block data by hash

Account Methods

  • eth_getBalance - Account balance
  • eth_getTransactionCount - Account nonce
  • eth_getCode - Contract bytecode

Transaction Methods

  • eth_getTransactionByHash - Transaction details
  • eth_getTransactionReceipt - Transaction receipt

Call Methods

  • eth_call - Read-only contract call
  • eth_estimateGas - Gas estimation

State Methods

  • eth_getLogs - Historical log queries
  • eth_getStorageAt - Storage slot value

Gas & Fee Methods

  • eth_gasPrice - Current gas price
  • eth_maxPriorityFeePerGas - EIP-1559 priority fee
  • eth_feeHistory - Historical fee data

Metadata Methods

  • eth_chainId - Chain ID (served locally, no upstream call)

Unsupported Methods

Subscription Methods

Subscription methods (eth_subscribe, eth_unsubscribe) are rejected over HTTP with a WebSocket URL hint:

Write Methods

Write methods (eth_sendRawTransaction, eth_sendTransaction) are not currently supported.

Request Headers

Required Headers

Optional Headers

Provider Override Header

You can specify a provider via header instead of URL path:

Query Parameters

Strategy Query Parameter

Response Format

Success Response

Error Response

Error Codes

| Code | Meaning | |------|---------|| | -32700 | Parse error (malformed JSON) | | -32600 | Invalid Request (missing fields, batch too large) | | -32601 | Method not found or not supported on this transport | | -32602 | Invalid params (unsupported chain, missing chain_id) | | -32603 | Internal error | | -32000 | Server error (rate limit, strategy access denied, quota exceeded) |

Response Headers

Standard Headers

Observability Headers

With include_meta=headers:

CORS

All origins are allowed (*). Allowed headers:
  • Content-Type
  • Authorization
  • X-Requested-With
  • X-Lasso-Provider
  • X-Lasso-Transport
  • X-Lasso-Api-Key
Preflight responses are cached for 24 hours.