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) orPOST /v1/{chain}(key in a header). For Robinhood Chain,{chain}isrobinhood_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
| Method | Weight (CU) |
|---|---|
eth_blockNumber | 1 |
eth_call | 15 |
eth_chainId | 1 |
eth_createAccessList | 20 |
eth_estimateGas | 20 |
eth_getBlockByNumber | 5 |
eth_getBlockReceipts | 10 |
eth_getLogs | 30 |
eth_getProof | 10 |
eth_sendRawTransaction | 30 |
eth_simulateV1 | 20 |
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).
eth_getLogs max block range: 1000 blocks; state window: 250000 blocks
Allowed methods and patterns
eth_blockNumbereth_calleth_chainIdeth_estimateGaseth_feeHistoryeth_gasPriceeth_getBalanceeth_getBlockByHasheth_getBlockByNumbereth_getBlockReceiptseth_getBlockTransactionCountByHasheth_getBlockTransactionCountByNumbereth_getCodeeth_getLogseth_getProofeth_getStorageAteth_getTransactionByBlockHashAndIndexeth_getTransactionByBlockNumberAndIndexeth_getTransactionByHasheth_getTransactionCounteth_getTransactionReceipteth_maxPriorityFeePerGaseth_sendRawTransactioneth_syncingnet_versionweb3_clientVersion
Blocked methods
eth_newFiltereth_newBlockFiltereth_newPendingTransactionFiltereth_getFilterLogseth_getFilterChangeseth_uninstallFiltereth_subscribeeth_unsubscribe
eth_getLogs max block range: 1000 blocks; state window: full history
Allowed methods and patterns
eth_blockNumbereth_calleth_chainIdeth_estimateGaseth_feeHistoryeth_gasPriceeth_getBalanceeth_getBlockByHasheth_getBlockByNumbereth_getBlockReceiptseth_getBlockTransactionCountByHasheth_getBlockTransactionCountByNumbereth_getCodeeth_getLogseth_getProofeth_getStorageAteth_getTransactionByBlockHashAndIndexeth_getTransactionByBlockNumberAndIndexeth_getTransactionByHasheth_getTransactionCounteth_getTransactionReceipteth_maxPriorityFeePerGaseth_syncingnet_versionweb3_clientVersion
Blocked methods
eth_newFiltereth_newBlockFiltereth_newPendingTransactionFiltereth_getFilterLogseth_getFilterChangeseth_uninstallFiltereth_subscribeeth_unsubscribe
eth_getLogs max block range: 1000 blocks; state window: 900 blocks
Allowed methods and patterns
eth_*net_*web3_*debug_trace*
Blocked methods
eth_newFiltereth_newBlockFiltereth_newPendingTransactionFiltereth_getFilterLogseth_getFilterChangeseth_uninstallFiltereth_subscribeeth_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_secrefill,burst_cucapacity — 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.
| Code | Source | HTTP Status | Message | Billed |
|---|---|---|---|---|
| -32700 | BlockVectra | 200 | parse error | No |
| -32600 | BlockVectra | 200 | invalid request | No |
| -32600 | BlockVectra | 200 | batch too large: max <N> calls | No |
| -32600 | BlockVectra | 200 | invalid request: ambiguous member name | No |
| -32601 | BlockVectra | 200 | method not available: <method> | No |
| -32600 | BlockVectra | 404 | unknown chain | No |
| -32602 | BlockVectra | 200 | eth_getLogs block range too large: max <N> blocks | No |
| -32602 | BlockVectra | 200 | tracer not allowed | No |
| -32602 | BlockVectra | 200 | trace timeout not allowed | No |
| -32010 | BlockVectra | 200 | node is syncing; calls are temporarily unavailable | No |
| -32011 | BlockVectra | 200 | historical state is not available beyond the most recent <N> blocks | No |
| -32000 | BlockVectra | 200 | transaction not found | No |
| -32000 | BlockVectra | 200 | block not found | No |
| -32000 | BlockVectra | 200 | upstream response too large | No |
| -32005 | BlockVectra | 200 | gateway overloaded, retry later | No |
| -32005 | BlockVectra | 429 | rate limit exceeded | No |
| -32022 | BlockVectra | 429 | request cost <N> CU exceeds burst capacity <M> CU | No |
| -32022 | BlockVectra | 429 | request has <N> calls, exceeding the free-plan limit of <M> calls per second | No |
| -32603 | BlockVectra | 200 | upstream unavailable | No |
| -32603 | BlockVectra | 200 | no response from upstream | No |
| -32603 | BlockVectra | 200 | malformed upstream response | No |
| -32603 | BlockVectra | 200 | internal gateway error | No |
| -32020 | BlockVectra | 402 | insufficient balance | No |
| -32021 | BlockVectra | 503 | billing data temporarily unavailable | No |
| 4444 | Node (passed through) | 200 | pruned history unavailable | No |
| -32000 | Node (passed through) | 200 | historical state ... is not available | No |
| -32000 | Node (passed through) | 200 | old data not available due to pruning... | No |
| -32002 | Node (passed through) | 200 | <node message> | No |
| -32003 | Node (passed through) | 200 | <node message> | No |
| -32600 | Node (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.