JSON-RPC

JSON-RPC

Supported JSON-RPC methods, CU weights, and error codes.

Overview

JSON-RPC 2.0 access on every supported chain is metered through the BlockVectra gateway. All requests are counted in Computation Units (CU) and rate-limited per key.

  • Endpoint: POST /v1/{chain}/{api_key} (key in the path) or POST /v1/{chain} (key in a header). For Robinhood Chain, {chain} is robinhood_mainnet: https://dev-api.blockvectra.network/v1/robinhood_mainnet. The same API key works on every supported chain
  • Protocol: HTTP POST, single call or batch (max 100 calls)
  • Metering: A request's total CU cost counts against your key's burst capacity as soon as it arrives. Every accepted call that gets a response is charged at the method's published CU weight; the error-code table lists the cases that are not billed (see Error Codes). Billing is settled hourly (rounded down to whole units, remainder carries over, executed ~15 minutes after the period ends)
  • Availability: Available methods vary by chain. On Robinhood Chain: eth_*, net_*, web3_*, debug_trace* (with exceptions; see below). For other chains, see Supported Chains.
  • Ethereum (Beta): its own method list and about 36 days of recent data — see Supported Chains → Ethereum.

Integration

1. Get an API Key

See Quickstart → Get an API key.

2. Call JSON-RPC

export BLOCKVECTRA_API_KEY=rgw_your_api_key

curl -X POST "https://dev-api.blockvectra.network/v1/robinhood_mainnet/$BLOCKVECTRA_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_blockNumber",
    "params": [],
    "id": 1
  }'

Key passing (priority order):

  • URL path: POST /v1/{chain}/{api_key}
  • Header on POST /v1/{chain}: x-api-key: {api_key} (overrides Bearer if non-empty)
  • Header on POST /v1/{chain}: Authorization: Bearer {api_key}

3. Handle CU Costs

Every method carries a CU (Computation Unit) weight; the cost of a request is the sum of the weights of all calls it contains. See the CU weight table below for per-method weights and default values, and the Billed column of the error codes table for which error conditions are billed. Usage is charged per account per hourly period, rounded down to whole billing units (1 unit = 1000 CU), with the remainder carrying over to the next period (across periods the total charged is floor(total CU / 1000)); settlement runs about 15 minutes after the period ends (for example: 508 CU carried over + 2557 CU consumed = 3065 CU charges 3 billing units, with 65 CU carried over).

Common Calls

Worked examples for common calls.

Query logs (eth_getLogs)

Filter a contract's logs over a recent block range — here, the ERC-20 Transfer event (topic 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef). See the CU Metering Rules table below for eth_getLogs's current CU weight; the gateway rejects any range wider than that chain's eth_getLogs span limit. On Robinhood Chain the limit is 1000 blocks (-32602 eth_getLogs block range too large: max 1000 blocks); for other chains, see Supported Chains.

export BLOCKVECTRA_API_KEY=rgw_your_api_key

curl -X POST "https://dev-api.blockvectra.network/v1/robinhood_mainnet" \
  -H 'Content-Type: application/json' \
  -H "x-api-key: $BLOCKVECTRA_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getLogs",
    "params": [{
      "fromBlock": "0x45a2409",
      "toBlock": "0x45a2609",
      "address": "0x1111111111111111111111111111111111111111",
      "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
    }],
    "id": 1
  }'

Trace a transaction (debug_traceTransaction)

Trace a transaction's internal calls with the callTracer. See the CU Metering Rules table below for debug_trace*'s current CU weight. Like the other state-reading methods, it's rejected once the target block falls outside that chain's recent-state window (-32011). On Robinhood Chain the window is the chain head minus 900 blocks; for other chains, see Supported Chains. On chains that provide traces, use the Data API for historical traces.

Note: The transaction must be within the chain's recent-state window (on Robinhood Chain about the last 900 blocks, i.e. only minutes); older transactions return -32011 (historical state is not available beyond the most recent 900 blocks).

export BLOCKVECTRA_API_KEY=rgw_your_api_key

curl -X POST "https://dev-api.blockvectra.network/v1/robinhood_mainnet" \
  -H 'Content-Type: application/json' \
  -H "x-api-key: $BLOCKVECTRA_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "method": "debug_traceTransaction",
    "params": ["0xYOUR_TRANSACTION_HASH", {"tracer": "callTracer"}],
    "id": 1
  }'

Batch several calls

Send several calls in a single request — up to the batch limit noted above (max 100 calls per request). This example reads the block number, chain ID, and gas price in one round trip.

export BLOCKVECTRA_API_KEY=rgw_your_api_key

curl -X POST "https://dev-api.blockvectra.network/v1/robinhood_mainnet" \
  -H 'Content-Type: application/json' \
  -H "x-api-key: $BLOCKVECTRA_API_KEY" \
  -d '[
    {"jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1},
    {"jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 2},
    {"jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 3}
  ]'

If the gateway rejects the whole batch instead — insufficient balance, rate limiting, burst capacity, or more than 100 calls (see the Error Codes table below) — it returns a single JSON-RPC error object instead of an array; viem's batch: true mode then surfaces this as an opaque UnknownRpcError, so retry a single call to see the actual error.

CU Metering Rules

Computation Unit (CU) weight for each JSON-RPC method.

Resolution Strategy

Exact match > Longest prefix pattern (ending in *) > Default

Default: 10 CU

MethodWeight (CU)
eth_blockNumber1
eth_call15
eth_chainId1
eth_createAccessList20
eth_estimateGas20
eth_getBlockByNumber5
eth_getBlockReceipts10
eth_getLogs30
eth_getProof10
eth_sendRawTransaction30
eth_simulateV120
debug_trace*100

Method Policy

Available methods vary by chain; each chain's list is shown below, and Supported Chains covers the rest. Only methods matching an allowed name or pattern are reachable; a handful of methods are explicitly blocked even though they match one (they return -32601 method not available).

Applies to: EthereumBeta

eth_getLogs max block range: 1000 blocks; state window: 250000 blocks

Allowed methods and patterns

  • eth_blockNumber
  • eth_call
  • eth_chainId
  • eth_estimateGas
  • eth_feeHistory
  • eth_gasPrice
  • eth_getBalance
  • eth_getBlockByHash
  • eth_getBlockByNumber
  • eth_getBlockReceipts
  • eth_getBlockTransactionCountByHash
  • eth_getBlockTransactionCountByNumber
  • eth_getCode
  • eth_getLogs
  • eth_getProof
  • eth_getStorageAt
  • eth_getTransactionByBlockHashAndIndex
  • eth_getTransactionByBlockNumberAndIndex
  • eth_getTransactionByHash
  • eth_getTransactionCount
  • eth_getTransactionReceipt
  • eth_maxPriorityFeePerGas
  • eth_sendRawTransaction
  • eth_syncing
  • net_version
  • web3_clientVersion

Blocked methods

  • eth_newFilter
  • eth_newBlockFilter
  • eth_newPendingTransactionFilter
  • eth_getFilterLogs
  • eth_getFilterChanges
  • eth_uninstallFilter
  • eth_subscribe
  • eth_unsubscribe
Applies to: HyperEVM

eth_getLogs max block range: 1000 blocks; state window: full history

Allowed methods and patterns

  • eth_blockNumber
  • eth_call
  • eth_chainId
  • eth_estimateGas
  • eth_feeHistory
  • eth_gasPrice
  • eth_getBalance
  • eth_getBlockByHash
  • eth_getBlockByNumber
  • eth_getBlockReceipts
  • eth_getBlockTransactionCountByHash
  • eth_getBlockTransactionCountByNumber
  • eth_getCode
  • eth_getLogs
  • eth_getProof
  • eth_getStorageAt
  • eth_getTransactionByBlockHashAndIndex
  • eth_getTransactionByBlockNumberAndIndex
  • eth_getTransactionByHash
  • eth_getTransactionCount
  • eth_getTransactionReceipt
  • eth_maxPriorityFeePerGas
  • eth_syncing
  • net_version
  • web3_clientVersion

Blocked methods

  • eth_newFilter
  • eth_newBlockFilter
  • eth_newPendingTransactionFilter
  • eth_getFilterLogs
  • eth_getFilterChanges
  • eth_uninstallFilter
  • eth_subscribe
  • eth_unsubscribe
Applies to: Robinhood Chain

eth_getLogs max block range: 1000 blocks; state window: 900 blocks

Allowed methods and patterns

  • eth_*
  • net_*
  • web3_*
  • debug_trace*

Blocked methods

  • eth_newFilter
  • eth_newBlockFilter
  • eth_newPendingTransactionFilter
  • eth_getFilterLogs
  • eth_getFilterChanges
  • eth_uninstallFilter
  • eth_subscribe
  • eth_unsubscribe

Limits:

  • Batch: max 100 calls per request; also limited by the key's CU burst, see below.
  • Request body: max 2 MiB
  • CU burst: each API key has a CU bucket (cu_per_sec refill, burst_cu capacity — defaults are 100 CU/s and burst 400 CU; shown per key in the console Keys table). A single request — including a whole JSON-RPC batch — whose total CU exceeds the key's burst capacity is rejected with -32022 request_exceeds_burst (request cost <N> CU exceeds burst capacity <M> CU); split it into smaller batches.

Error Codes

Complete catalog of JSON-RPC error codes and their billing implications.

CodeSourceHTTP StatusMessageBilled
-32700BlockVectra200parse errorNo
-32600BlockVectra200invalid requestNo
-32600BlockVectra200batch too large: max <N> callsNo
-32600BlockVectra200invalid request: ambiguous member nameNo
-32601BlockVectra200method not available: <method>No
-32600BlockVectra404unknown chainNo
-32602BlockVectra200eth_getLogs block range too large: max <N> blocksNo
-32602BlockVectra200tracer not allowedNo
-32602BlockVectra200trace timeout not allowedNo
-32010BlockVectra200node is syncing; calls are temporarily unavailableNo
-32011BlockVectra200historical state is not available beyond the most recent <N> blocksNo
-32000BlockVectra200transaction not foundNo
-32000BlockVectra200block not foundNo
-32000BlockVectra200upstream response too largeNo
-32005BlockVectra200gateway overloaded, retry laterNo
-32005BlockVectra429rate limit exceededNo
-32022BlockVectra429request cost <N> CU exceeds burst capacity <M> CUNo
-32022BlockVectra429request has <N> calls, exceeding the free-plan limit of <M> calls per secondNo
-32603BlockVectra200upstream unavailableNo
-32603BlockVectra200no response from upstreamNo
-32603BlockVectra200malformed upstream responseNo
-32603BlockVectra200internal gateway errorNo
-32020BlockVectra402insufficient balanceNo
-32021BlockVectra503billing data temporarily unavailableNo
4444Node (passed through)200pruned history unavailableNo
-32000Node (passed through)200historical state ... is not availableNo
-32000Node (passed through)200old data not available due to pruning...No
-32002Node (passed through)200<node message>No
-32003Node (passed through)200<node message>No
-32600Node (passed through)200<node message>No
*Node (passed through)200<node message>Yes

Full OpenAPI Reference

See the Full OpenAPI reference for the complete machine-readable specification with all method signatures, request and response schemas, and parameter details rendered interactively.

On this page