# Overview Source: https://docs.blockvectra.com/en/ BlockVectra is a multi-chain blockchain data provider: one API key for JSON-RPC on every chain we support, and the Data API where it is available. You don't need to run your own node. ## What you get * **JSON-RPC**: standard EVM methods (available methods vary by chain, with `debug_trace` methods on supported chains), metered by Compute Units (CU) per call. * **Data API**: read-only REST endpoints over indexed chain data — blocks, transactions, token transfers and balances, NFTs, DEX activity, tokenized stocks, and more. Coverage and capabilities vary by chain; see [Supported Chains](https://docs.blockvectra.com/en/chains/). ## Get an API key Sign in to the [Console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) using an Ethereum wallet or GitHub / Google to automatically provision an account and create an API key. Once you have a key, head to the [Quickstart](https://docs.blockvectra.com/en/quickstart/) to make your first call. ## Find your way around * [Quickstart](https://docs.blockvectra.com/en/quickstart/) — first JSON-RPC and Data API calls, CU billing, common errors * [Supported Chains](https://docs.blockvectra.com/en/chains/) — Chain IDs, endpoint URLs, and feature support matrix * [Robinhood Chain Guide](https://docs.blockvectra.com/en/guides/robinhood-chain/) — endpoint URLs, supported methods, and tokenized stock datasets * [Robinhood Testnet Starter](https://docs.blockvectra.com/en/guides/robinhood-testnet-starter/) — RPC setup and a starter template for testnet development * [Robinhood Testnet Faucet](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/) — test ETH funding options and network checks * [API Reference](https://docs.blockvectra.com/en/api/json-rpc/) — JSON-RPC methods and Data API endpoints * [Full JSON-RPC Reference](https://docs.blockvectra.com/en/api/json-rpc/reference/) — complete specifications, parameters, and return schemas for all supported methods * [Datasets](https://docs.blockvectra.com/en/datasets/) — derived datasets across supported chains * [Guides](https://docs.blockvectra.com/en/guides/) — practical guides for API integration, CU management, and multi-chain workflows ## Starter templates Jumpstart your integration with official GitHub starter repositories: * [agent-quickstart](https://github.com/blockvectra/agent-quickstart) — Programmatic sign-up and initial API call for AI agents and CI. * [multichain-viem](https://github.com/blockvectra/multichain-viem) — Multi-chain viem template and client setup. * [hyperevm-backfill](https://github.com/blockvectra/hyperevm-backfill) — Chunked HyperEVM log backfill with retries and checkpoint resume. * [robinhood-stock-tokens](https://github.com/blockvectra/robinhood-stock-tokens) — Robinhood Chain tokenized stock metrics and leaderboards. * [robinhood-testnet-starter](https://github.com/blockvectra/robinhood-testnet-starter?ref=docs-testnet-starter) — Robinhood Chain Testnet starter: keyless reads, programmatic sign-up with WebSocket logs, then mainnet. ## For AI agents Building an agent or using an AI coding assistant? Start with the [AI agent guide](https://docs.blockvectra.com/en/guides/ai-agents/): a keyless [MCP server](https://docs.blockvectra.com/mcp), `llms.txt` indexes, OpenAPI 3.1 specifications, and guidance on what to ask the user for when you have no API key. --- # Supported Chains Source: https://docs.blockvectra.com/en/chains/ BlockVectra is a multi-chain blockchain data provider: JSON-RPC on every chain we support, and the Data API where it is available. ## One key, all chains * **Universal key**: the same API key works on every blockchain network BlockVectra supports — no separate keys per chain. * **Chain in the URL**: every request names its chain explicitly through the `{chain}` path segment. * **Aggregated usage**: account balance, Compute Unit (CU) rate-limit buckets, and free-tier per-second request limits are shared across all chains. * **Pricing**: see [Pricing](https://blockvectra.com/en/pricing/). ## Try without an API key Choose a [free public RPC endpoint](https://blockvectra.com/en/free/#public-rpc) for wallet methods without an API key. Public methods and per-IP limits are listed per network; see [Quickstart](https://docs.blockvectra.com/en/quickstart/) for a call example. ## URL templates Standard URL structures for calling JSON-RPC and the Data API: | Service | Mode | URL template | Notes | | -------- | --------------- | ---------------------------- | ------------------------------------------------------------ | | JSON-RPC | Key in the path | `POST /v1/{chain}/{api_key}` | Simplest form; recommended for curl and HTTP clients | | JSON-RPC | Key in a header | `POST /v1/{chain}` | Pass the key in the `x-api-key: {api_key}` request header | | Data API | REST endpoints | `GET /v1/data/{chain}/…` | Pass the key in the `x-api-key` request header | | Status | Public status | `GET /v1/status` | No key required; returns each public chain's status and head | > **Note**: a request without a chain segment (e.g. `POST /v1` or `POST /v1/`) returns HTTP 404 with an empty body. See [Quickstart](https://docs.blockvectra.com/en/quickstart/) for setup details. ## Supported chains matrix The blockchain networks currently available on BlockVectra, with their service capabilities: Endpoints, methods with an API key, subscriptions, transaction sending, state and log limits, datasets, related testnets and guides are shown per chain. Unknown facts stay unknown. Expand a chain below the matrix for requests supported by that chain. The state and log limits in this table apply to requests made with an API key. Public endpoints have their own method, history and log limits, which you can read from `GET /v1/chains`. Before querying logs on a public endpoint, check `public.methods`, `public.history_blocks` and `public.logs`, and use `public.logs.max_block_range` and `public.logs.max_results` rather than the top-level `max_logs_block_range`. | Chain | {chain} | Chain ID | Tracing | Public Endpoint | WebSocket | Data API | Methods with an API key | Webhook push | Send Transactions | Send Transactions (Keyless Public Endpoint) | State History Window | eth_getLogs Max Block Range | Data API Datasets | Related testnets | Related guides | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | [Arbitrum One RPC and Data API](https://blockvectra.com/en/chains/arb_mainnet/) | arb_mainnet | 42161 | ✓ | `https://api.blockvectra.com/v1/arb_mainnet/public` | Supported (newHeads, logs) | Open | 43 | [Supported · Confirmations 1–120 (default 120)](https://blockvectra.com/en/webhooks/), [Webhook push guide](https://docs.blockvectra.com/en/guides/webhook-push/) | Supported | Supported | Historical state for the most recent 5,000 blocks | 1,000 blocks | Blocks, Transactions, Address Transactions, Transfers, Token Metadata, Data Freshness | Unknown | Unknown | | [Arc RPC](https://blockvectra.com/en/chains/arc_mainnet/) | arc_mainnet | 5042 | — | `https://api.blockvectra.com/v1/arc_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Unknown | 1,000 blocks | Not supported | Unknown | Unknown | | [Avalanche C-Chain RPC](https://blockvectra.com/en/chains/avax_mainnet/) | avax_mainnet | 43114 | ✓ | `https://api.blockvectra.com/v1/avax_mainnet/public` | Supported (newHeads, logs) | Not available yet | 41 | Not supported | Supported | Supported | Historical state for the most recent 128 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Base RPC and Data API](https://blockvectra.com/en/chains/base_mainnet/) | base_mainnet | 8453 | — | `https://api.blockvectra.com/v1/base_mainnet/public` | Supported (newHeads, logs) | Open | 39 | [Supported · Confirmations 1–519 (default 1)](https://blockvectra.com/en/webhooks/), [Webhook push guide](https://docs.blockvectra.com/en/guides/webhook-push/) | Supported | Supported | Historical state for the most recent 10,000 blocks | 1,000 blocks | Blocks, Transactions, Address Transactions, Transfers, Token Metadata, Data Freshness | Unknown | [Base](https://docs.blockvectra.com/en/guides/base/) | | [Berachain RPC](https://blockvectra.com/en/chains/berachain_mainnet/) | berachain_mainnet | 80094 | — | `https://api.blockvectra.com/v1/berachain_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 9,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Boba RPC](https://blockvectra.com/en/chains/boba_mainnet/) | boba_mainnet | 288 | — | `https://api.blockvectra.com/v1/boba_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 80,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [BNB Smart Chain RPC and Data API](https://blockvectra.com/en/chains/bsc_mainnet/) | bsc_mainnet | 56 | — | `https://api.blockvectra.com/v1/bsc_mainnet/public` | Supported (newHeads, logs) | Open | 25 | [Supported · Confirmations 1–2 (default 1)](https://blockvectra.com/en/webhooks/), [Webhook push guide](https://docs.blockvectra.com/en/guides/webhook-push/) | Supported | Supported | Historical state for the most recent 100 blocks | 1,000 blocks | Blocks, Transactions, Address Transactions, Transfers, Token Metadata, Data Freshness | Unknown | Unknown | | [Celo RPC](https://blockvectra.com/en/chains/celo_mainnet/) | celo_mainnet | 42220 | — | `https://api.blockvectra.com/v1/celo_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 864,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Ethereum RPC and Data API](https://blockvectra.com/en/chains/eth_mainnet/) | eth_mainnet | 1 | ✓ | `https://api.blockvectra.com/v1/eth_mainnet/public` | Supported (newHeads, logs) | Open | 38 | [Supported · Confirmations 1–82 (default 6)](https://blockvectra.com/en/webhooks/), [Webhook push guide](https://docs.blockvectra.com/en/guides/webhook-push/) | Supported | Supported | Historical state for the most recent 250,000 blocks | 1,000 blocks | Blocks, Transactions, Address Transactions, Transfers, Token Metadata, Data Freshness | Unknown | Unknown | | [Ethereum Sepolia RPC and Data API](https://blockvectra.com/en/chains/eth_sepolia/) | eth_sepolia | 11155111 | — | `https://api.blockvectra.com/v1/eth_sepolia/public` | Supported (newHeads, logs) | Open | 29 | [Supported · Confirmations 1–67 (default 6)](https://blockvectra.com/en/webhooks/), [Webhook push guide](https://docs.blockvectra.com/en/guides/webhook-push/) | Supported | Supported | Unknown | 1,000 blocks | Blocks, Transactions, Address Transactions, Transfers, Token Metadata, Data Freshness | Unknown | Unknown | | [Fraxtal RPC](https://blockvectra.com/en/chains/fraxtal_mainnet/) | fraxtal_mainnet | 252 | — | `https://api.blockvectra.com/v1/fraxtal_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 10,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Gnosis RPC and Data API](https://blockvectra.com/en/chains/gnosis_mainnet/) | gnosis_mainnet | 100 | — | `https://api.blockvectra.com/v1/gnosis_mainnet/public` | Supported (newHeads, logs) | Open | 39 | Not supported | Supported | Supported | Historical state for the most recent 262,000 blocks | 1,000 blocks | Blocks, Transactions, Address Transactions, Transfers, Token Metadata, Data Freshness | Unknown | Unknown | | [HyperEVM RPC and Data API](https://blockvectra.com/en/chains/hyperevm_mainnet/) | hyperevm_mainnet | 999 | — | `https://api.blockvectra.com/v1/hyperevm_mainnet/public` | Supported (newHeads, logs) | Open | 25 | [Supported · Confirmations 1–1 (default 1)](https://blockvectra.com/en/webhooks/), [Webhook push guide](https://docs.blockvectra.com/en/guides/webhook-push/) | Supported | Not supported | Unknown | 1,000 blocks | Blocks, Transactions, Address Transactions, Transfers, Token Metadata, Data Freshness | Unknown | [HyperEVM backfill and polling](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) | | [Ink RPC](https://blockvectra.com/en/chains/ink_mainnet/) | ink_mainnet | 57073 | — | `https://api.blockvectra.com/v1/ink_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 9,000 blocks | 1,000 blocks | Not supported | Unknown | [Ink pool discovery](https://docs.blockvectra.com/en/guides/ink-pool-discovery/) | | [Katana RPC](https://blockvectra.com/en/chains/katana_mainnet/) | katana_mainnet | 747474 | — | `https://api.blockvectra.com/v1/katana_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 86,400 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Linea RPC](https://blockvectra.com/en/chains/linea_mainnet/) | linea_mainnet | 59144 | — | `https://api.blockvectra.com/v1/linea_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 128 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Metal L2 RPC](https://blockvectra.com/en/chains/metall2_mainnet/) | metall2_mainnet | 1750 | — | `https://api.blockvectra.com/v1/metall2_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 10,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Mode RPC](https://blockvectra.com/en/chains/mode_mainnet/) | mode_mainnet | 34443 | — | `https://api.blockvectra.com/v1/mode_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 10,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [OP Mainnet RPC and Data API](https://blockvectra.com/en/chains/op_mainnet/) | op_mainnet | 10 | — | `https://api.blockvectra.com/v1/op_mainnet/public` | Supported (newHeads, logs) | Open | 39 | Not supported | Supported | Supported | Historical state for the most recent 1,296,000 blocks | 1,000 blocks | Blocks, Transactions, Address Transactions, Transfers, Token Metadata, Data Freshness | Unknown | Unknown | | [Polygon RPC and Data API](https://blockvectra.com/en/chains/polygon_mainnet/) | polygon_mainnet | 137 | ✓ | `https://api.blockvectra.com/v1/polygon_mainnet/public` | Supported (newHeads, logs) | Open | 43 | [Supported · Confirmations 1–200 (default 200)](https://blockvectra.com/en/webhooks/), [Webhook push guide](https://docs.blockvectra.com/en/guides/webhook-push/) | Supported | Supported | Historical state for the most recent 126 blocks | 1,000 blocks | Blocks, Transactions, Address Transactions, Transfers, Token Metadata, Data Freshness | Unknown | Unknown | | [Robinhood Chain RPC and Data API](https://blockvectra.com/en/chains/robinhood_mainnet/) | robinhood_mainnet | 4663 | ✓ | `https://api.blockvectra.com/v1/robinhood_mainnet/public` | Supported (newHeads, logs) | Open | 43 | [Supported · Confirmations 1–1 (default 1)](https://blockvectra.com/en/webhooks/), [Webhook push guide](https://docs.blockvectra.com/en/guides/webhook-push/) | Supported | Supported | Historical state for the most recent 900 blocks | 1,000 blocks | Blocks, Transactions, Address Transactions, Transfers, Token Metadata, DEX Swaps, Tokenized Stocks, Traces, Data Freshness | Unknown | [HoodFi name records](https://docs.blockvectra.com/en/guides/hoodfi-name-records/), [Robinhood Chain mainnet](https://docs.blockvectra.com/en/guides/robinhood-chain/), [Stock token multiplier](https://docs.blockvectra.com/en/guides/stock-token-multiplier/), [Tokenized stocks](https://docs.blockvectra.com/en/guides/stocks/) | | [Robinhood Chain Testnet RPC](https://blockvectra.com/en/chains/robinhood_testnet/) | robinhood_testnet | 46630 | ✓ | `https://api.blockvectra.com/v1/robinhood_testnet/public` | Supported (newHeads, logs) | Not available yet | 43 | [Supported · Confirmations 1–1 (default 1)](https://blockvectra.com/en/webhooks/), [Webhook push guide](https://docs.blockvectra.com/en/guides/webhook-push/) | Supported | Supported | Historical state for the most recent 1,023 blocks | 1,000 blocks | Not supported | Unknown | [Testnet faucet](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/), [Robinhood Chain Testnet starter](https://docs.blockvectra.com/en/guides/robinhood-testnet-starter/) | | [Rootstock RPC](https://blockvectra.com/en/chains/rootstock_mainnet/) | rootstock_mainnet | 30 | — | `https://api.blockvectra.com/v1/rootstock_mainnet/public` | Supported (newHeads, logs) | Not available yet | 27 | Not supported | Supported | Supported | Historical state for the most recent 6,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Soneium RPC](https://blockvectra.com/en/chains/soneium_mainnet/) | soneium_mainnet | 1868 | — | `https://api.blockvectra.com/v1/soneium_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 9,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Sonic RPC](https://blockvectra.com/en/chains/sonic_mainnet/) | sonic_mainnet | 146 | ✓ | `https://api.blockvectra.com/v1/sonic_mainnet/public` | Supported (newHeads, logs) | Not available yet | 43 | Not supported | Supported | Supported | Historical state for the most recent 11,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Unichain RPC](https://blockvectra.com/en/chains/unichain_mainnet/) | unichain_mainnet | 130 | — | `https://api.blockvectra.com/v1/unichain_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 85,500 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [World Chain RPC](https://blockvectra.com/en/chains/world_mainnet/) | world_mainnet | 480 | — | `https://api.blockvectra.com/v1/world_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 30,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [X Layer RPC](https://blockvectra.com/en/chains/xlayer_mainnet/) | xlayer_mainnet | 196 | ✓ | `https://api.blockvectra.com/v1/xlayer_mainnet/public` | Supported (newHeads, logs) | Not available yet | 43 | Not supported | Supported | Supported | Historical state for the most recent 250,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | | [Zora RPC](https://blockvectra.com/en/chains/zora_mainnet/) | zora_mainnet | 7777777 | — | `https://api.blockvectra.com/v1/zora_mainnet/public` | Supported (newHeads, logs) | Not available yet | 39 | Not supported | Supported | Supported | Historical state for the most recent 10,000 blocks | 1,000 blocks | Not supported | Unknown | Unknown | ## Next steps with an API key ### Arbitrum One #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/arb_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/arb_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### Data API ```bash curl -fsS 'https://api.blockvectra.com/v1/data/arb_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` [Data API](https://docs.blockvectra.com/en/api/data/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/arb_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Create a Webhook subscription](https://blockvectra.com/en/webhooks/) · [Create a Webhook subscription](https://docs.blockvectra.com/en/guides/webhook-push/) · [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Arc #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/arc_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/arc_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/arc_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Avalanche C-Chain #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/avax_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/avax_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/avax_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Base #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/base_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/base_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### Data API ```bash curl -fsS 'https://api.blockvectra.com/v1/data/base_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` [Data API](https://docs.blockvectra.com/en/api/data/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/base_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Create a Webhook subscription](https://blockvectra.com/en/webhooks/) · [Create a Webhook subscription](https://docs.blockvectra.com/en/guides/webhook-push/) · [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Berachain #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/berachain_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/berachain_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/berachain_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Boba #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/boba_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/boba_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/boba_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### BNB Smart Chain #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/bsc_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/bsc_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### Data API ```bash curl -fsS 'https://api.blockvectra.com/v1/data/bsc_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` [Data API](https://docs.blockvectra.com/en/api/data/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/bsc_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Create a Webhook subscription](https://blockvectra.com/en/webhooks/) · [Create a Webhook subscription](https://docs.blockvectra.com/en/guides/webhook-push/) · [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Celo #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/celo_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/celo_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/celo_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Ethereum #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/eth_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/eth_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### Data API ```bash curl -fsS 'https://api.blockvectra.com/v1/data/eth_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` [Data API](https://docs.blockvectra.com/en/api/data/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/eth_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Create a Webhook subscription](https://blockvectra.com/en/webhooks/) · [Create a Webhook subscription](https://docs.blockvectra.com/en/guides/webhook-push/) · [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Ethereum Sepolia #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/eth_sepolia' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/eth_sepolia' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### Data API ```bash curl -fsS 'https://api.blockvectra.com/v1/data/eth_sepolia/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` [Data API](https://docs.blockvectra.com/en/api/data/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/eth_sepolia' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Create a Webhook subscription](https://blockvectra.com/en/webhooks/) · [Create a Webhook subscription](https://docs.blockvectra.com/en/guides/webhook-push/) · [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Fraxtal #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/fraxtal_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/fraxtal_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/fraxtal_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Gnosis #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/gnosis_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/gnosis_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### Data API ```bash curl -fsS 'https://api.blockvectra.com/v1/data/gnosis_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` [Data API](https://docs.blockvectra.com/en/api/data/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/gnosis_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### HyperEVM #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/hyperevm_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/hyperevm_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### Data API ```bash curl -fsS 'https://api.blockvectra.com/v1/data/hyperevm_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` [Data API](https://docs.blockvectra.com/en/api/data/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/hyperevm_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Create a Webhook subscription](https://blockvectra.com/en/webhooks/) · [Create a Webhook subscription](https://docs.blockvectra.com/en/guides/webhook-push/) · [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Ink #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/ink_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/ink_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/ink_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Katana #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/katana_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/katana_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/katana_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Linea #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/linea_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/linea_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/linea_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Metal L2 #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/metall2_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/metall2_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/metall2_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Mode #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/mode_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/mode_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/mode_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### OP Mainnet #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/op_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/op_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### Data API ```bash curl -fsS 'https://api.blockvectra.com/v1/data/op_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` [Data API](https://docs.blockvectra.com/en/api/data/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/op_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Polygon #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/polygon_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/polygon_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### Data API ```bash curl -fsS 'https://api.blockvectra.com/v1/data/polygon_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` [Data API](https://docs.blockvectra.com/en/api/data/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/polygon_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Create a Webhook subscription](https://blockvectra.com/en/webhooks/) · [Create a Webhook subscription](https://docs.blockvectra.com/en/guides/webhook-push/) · [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Robinhood Chain #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/robinhood_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/robinhood_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### Data API ```bash curl -fsS 'https://api.blockvectra.com/v1/data/robinhood_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` [Data API](https://docs.blockvectra.com/en/api/data/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/robinhood_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Create a Webhook subscription](https://blockvectra.com/en/webhooks/) · [Create a Webhook subscription](https://docs.blockvectra.com/en/guides/webhook-push/) · [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Robinhood Chain Testnet #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/robinhood_testnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/robinhood_testnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/robinhood_testnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Create a Webhook subscription](https://blockvectra.com/en/webhooks/) · [Create a Webhook subscription](https://docs.blockvectra.com/en/guides/webhook-push/) · [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Rootstock #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/rootstock_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/rootstock_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/rootstock_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Soneium #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/soneium_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/soneium_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/soneium_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Sonic #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/sonic_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/sonic_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/sonic_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Unichain #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/unichain_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/unichain_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/unichain_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### World Chain #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/world_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/world_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/world_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### X Layer #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/xlayer_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/xlayer_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/xlayer_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) ### Zora #### eth_getLogs ```bash set -eu : "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}" validate_response='import json,re,sys response=json.load(sys.stdin) if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response): sys.exit("Invalid JSON-RPC response") result=response["result"] if sys.argv[1]=="head": if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)): sys.exit("Invalid block quantity") print(result) else: if not (type(result) is list and all(type(log) is dict for log in result)): sys.exit("Invalid logs result") print(json.dumps(response,indent=2))' head_response=$(curl -fsS 'https://api.blockvectra.com/v1/zora_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head) logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/zora_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}") printf '%s' "$logs_response" | python3 -c "$validate_response" logs ``` [eth_getLogs](https://docs.blockvectra.com/en/guides/getlogs-block-range/) #### WebSocket ```bash echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/zora_mainnet' ``` [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) [Usage and CU](https://console.blockvectra.com/usage/) · [Top up](https://console.blockvectra.com/billing/) **HyperEVM** HyperEVM blocks include HyperCore system transactions (from address 0x2222…2222 or 0x20…, gasPrice 0). [View live status →](https://blockvectra.com/en/status/) ## Ethereum * **Chain ID**: `1` * **Chain name (`{chain}` in URLs)**: `eth_mainnet`, e.g. `POST /v1/eth_mainnet/{api_key}` or `GET /v1/data/eth_mainnet/…`. ### JSON-RPC * **Methods**: available methods for each chain are determined by `methods.allow` / `deny` in `GET /v1/chains` (see [Method Policy](https://docs.blockvectra.com/en/api/json-rpc/#method-policy)); methods outside that scope return `-32601`. * **Recent data only**: the historical state window is determined by `state_window_blocks` in `GET /v1/chains`. Historical state queries outside the window return `-32011` (not billed); block, receipt and log queries outside the window return `-32000 old data not available due to pruning` (not billed); a transaction looked up by hash outside the window returns `result: null`. * **`eth_getLogs`**: the maximum block span per request is `max_logs_block_range` in `GET /v1/chains`. ### Data API * **Recent data only**: Ethereum data coverage is determined by `coverage.from_block` in `GET /v1/data/chains`. A block number or window below the start returns `422 no_coverage`; a transaction hash that has left the window returns `404`. * **When `from_block` is `null`**: the start is temporarily unknown. Do not treat it as `0` or as full history, and do not send historical requests (by block number, window or hash) for Ethereum until it is an integer again; they return `503 unavailable`. * **`503 gateway_overloaded`**: retry with backoff (`Retry-After: 1`). * **Datasets**: the datasets Ethereum serves are listed in `features` of `GET /v1/data/chains`; the others return `422 no_coverage` (not billed). Address transactions and transfers only cover the window: a response that crosses its start is marked `meta.coverage: "partial"`. ## Discovering chains programmatically Use these public endpoints to discover supported chains and their status: ### 1. Service status (`GET /v1/status`) A public endpoint that requires no API key (CORS `*`). It lists only publicly available chains and returns their status and indexed head: ```bash curl -s "https://api.blockvectra.com/v1/status" ``` Example response: ```json { "checked_at": "2026-09-28T07:40:00Z", "gateway": { "status": "ok" }, "chains": [ { "chain": "robinhood_mainnet", "name": "Robinhood Chain", "chain_id": 4663, "jsonrpc": true, "data": true, "status": "ok", "data_status": "ok", "sync": { "stage": "synced", "node_block": 74600000, "target_block": null }, "head": { "block": 74600000, "time": "2026-09-28T07:39:58Z", "lag_seconds": 3 } }, { "chain": "eth_mainnet", "name": "Ethereum", "chain_id": 1, "jsonrpc": true, "data": true, "status": "ok", "data_status": "ok", "sync": { "stage": "synced", "node_block": 26010000, "target_block": null }, "head": { "block": 26010000, "time": "2026-09-28T07:39:59Z", "lag_seconds": 1 } } ] } ``` Each entry's `name` is always the chain's English display name. `jsonrpc` and `data` report whether that chain is open for JSON-RPC and the Data API respectively; `status` is `"ok"` or `"unavailable"`. If a chain is syncing, calls to that chain return `-32010`. On `/v1/status`, `status` reports whether JSON-RPC is healthy and `data_status` reports whether the Data API is healthy (`"ok"`, `"syncing"`, or `"unavailable"`); in `/v1/data/chains`, a `coverage.has_data` of `false` means the chain has no indexed data yet. ### 2. Data API chains (`GET /v1/data/chains`) Requires an API key in the `x-api-key` header (billed). Returns the public chains the Data API serves, each with what it serves (`features`), the blocks its data covers (`coverage`), the node's consensus `safe`/`finalized` markers and their status (`finality`) and its per-request caps (`limits`): ```bash curl -s "https://api.blockvectra.com/v1/data/chains" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` Example response: ```json { "data": [ { "chain": "robinhood_mainnet", "chain_slug": "ROBINHOOD_MAINNET", "name": "Robinhood Chain", "chain_id": 4663, "chain_external_id": "eip155:4663", "features": [ "blocks", "transactions", "address_transactions", "transfers", "token_metadata", "balances", "holders", "nfts", "dex_swaps", "dex_prices", "stocks", "traces", "freshness" ], "coverage": { "from_block": 0, "traces_from_block": 1000000, "has_data": true }, "finality": { "model": "node_tags", "status": "ok", "safe_block": 74599400, "finalized_block": 74598900 }, "limits": { "max_page_size": 500, "max_window_blocks": 100000, "max_pools_for_token": 200, "max_batch_addresses": 100 } }, { "chain": "eth_mainnet", "chain_slug": "ETH_MAINNET", "name": "Ethereum", "chain_id": 1, "chain_external_id": "eip155:1", "features": ["blocks", "transactions", "address_transactions", "transfers", "token_metadata", "freshness"], "coverage": { "from_block": 1000000, "traces_from_block": null, "has_data": true }, "finality": { "model": "node_tags", "status": "stale", "safe_block": 26009950, "finalized_block": 26009900 }, "limits": { "max_page_size": 500, "max_window_blocks": 100000, "max_pools_for_token": 200, "max_batch_addresses": 100 } } ] } ``` `finality` reports the node's consensus markers (`model` is `"node_tags"`), marker health (`status` is `"ok"`, `"stale"`, or `"unavailable"`), and the current `safe_block` and `finalized_block` (`safe_block >= finalized_block`, and both are `null` only when status is `"unavailable"`). `coverage.from_block` is the lowest indexed block, read live. It is `0` once the chain's history reaches genesis. It can be `null` only when the chain has no indexed block at all (`has_data = false`), or while the start cannot be determined: treat `null` as unknown — not as complete history and not as `0` — and historical requests then return `503 unavailable`. Always read it from this endpoint at runtime rather than hard-coding it. `coverage.traces_from_block` is the first block with trace data; a trace request before it, or inside a gap, returns `422 no_coverage` (not billed). Calling `/v1/data/{chain}/…` with an unknown or not-public chain returns HTTP `404` with `error.code` `not_found` (not billed; the chain name must be the exact lowercase slug). --- # Console Account API Source: https://docs.blockvectra.com/en/api/console/ These are console account management APIs. Product APIs (JSON-RPC, Data API and WebSocket) do not depend on them. Authenticate account-specific requests with the session token returned by SIWE login. [Download OpenAPI spec](https://docs.blockvectra.com/openapi/console.yaml) ## Endpoint index ### Auth - POST /auth/siwe/challenge — Get SIWE message - POST /auth/siwe/login — SIWE login (first login creates account) - POST /auth/logout — Log out current session ### Me - GET /me — Current username, identity list, and current session - PATCH /me — Update username - POST /me/identities/siwe — Link wallet - POST /me/identities/oauth — Link GitHub or Google identity using login code - DELETE /me/identities/{identity_id} — Unlink identity ### Keys - GET /keys — List API keys - POST /keys — Create key (secret displayed only once) - GET /keys/{key_id} — Single key - PATCH /keys/{key_id} — Rename key - POST /keys/{key_id}/rotate — Rotate key (new secret displayed only once) - POST /keys/{key_id}/revoke — Revoke key (idempotent) ### Billing - GET /plans — Plan policies and pricing parameters - GET /balance — Balance and settlement cutoff timestamp - GET /charges — Charge records (paginated) - GET /topups — Top-up records (paginated) - GET /usage — Calls and CU usage grouped by UTC date, API key, chain, and method - GET /resets — Reset chances - POST /resets/use — Use one reset chance --- # Blockchain Data API reference Source: https://docs.blockvectra.com/en/api/data/ ## Overview Use this Blockchain Data API reference to construct REST requests for indexed blocks, transactions, addresses, tokens, NFTs, DEX activity, tokenized stocks and dataset freshness. To choose a dataset and check chain availability, start with the [datasets directory](https://docs.blockvectra.com/en/datasets/); for wallet token balances and transfer history, follow the [wallet assets guide](https://docs.blockvectra.com/en/guides/wallet-assets/). * **Base URL**: `https://api.blockvectra.com/v1/data` — every route except `/chains` is prefixed with a chain identifier (e.g. `https://api.blockvectra.com/v1/data/{chain}/…`) * **Protocol**: HTTP `GET` (plus `POST` for batch token lookups at `/{chain}/tokens:batch`), JSON responses * **Authentication**: API key required — pass your key in the `x-api-key` request header. Requests are metered and billed in Compute Units (CU); only 2xx successful responses are billed * **Ethereum**: data coverage is determined by `coverage.from_block` in `GET /v1/data/chains`, and covers a smaller set of datasets — see [Supported Chains → Ethereum](https://docs.blockvectra.com/en/chains/#ethereum) * [TypeScript SDK (GitHub)](https://github.com/blockvectra/data-api-js#installation) · [Daily DEX price example](https://github.com/blockvectra/data-api-js/blob/fcf80e2b3d72e168ba9ffddf5eae89e5ee7e269c/README.md#daily-dex-prices) · [npm](https://www.npmjs.com/package/@blockvectra/data-api) · [WETH/USDG · robinhood\_mainnet · 2026-10-01 UTC](https://github.com/blockvectra/data-api-js/blob/0e24d26e9960469445a6fd8b590d1ec41265913f/README.md#historical-wethusdg-response) · [JSON](https://github.com/blockvectra/data-api-js/blob/0e24d26e9960469445a6fd8b590d1ec41265913f/docs/responses/dex-prices-robinhood-weth-usdg-2026-10-01.json) ```bash npm install @blockvectra/data-api ``` Need cursor-based history? The [checkpointed ERC-20 transfers example](https://github.com/blockvectra/data-api-js/blob/fa40d51e322fe94683b4f184289ce48e39ec825f/README.md#checkpointed-erc-20-transfers-one-page-per-run) saves one page and its original `meta` per run, then resumes from the same opaque cursor when you rerun it with the same fixed query and state file. Pagination exhaustion alone does not prove a complete history — check `coverage` separately. ERC-20 only. [Install the prebuilt package](https://github.com/blockvectra/data-api-js/blob/fa40d51e322fe94683b4f184289ce48e39ec825f/README.md#install-the-prebuilt-package) to run it directly; no local schema generation or source build. Data API CU weights are listed on the [Pricing](https://blockvectra.com/en/pricing/) page and returned by `GET /v1/plans`. See [Quickstart → Call the Data API](https://docs.blockvectra.com/en/quickstart/#4-call-the-data-api) for example requests and response shapes. For path versioning, backward compatibility rules, and SDK recommendations, see [API versioning and compatibility](https://docs.blockvectra.com/en/api/versioning/). ## Chains The Data API serves indexed data scoped to each chain: `https://api.blockvectra.com/v1/data/{chain}/…`. Available datasets and features vary by chain; see [Supported Chains](https://docs.blockvectra.com/en/chains/) for the full capability matrix. `GET https://api.blockvectra.com/v1/data/chains` reports each chain's `features`, `coverage`, `finality` and `limits`. Requests outside a dataset's coverage return HTTP `422 no_coverage` (not billed); an unknown or not-public chain returns HTTP `404` with `error.code` `not_found` (not billed; chain names must be exact lowercase slugs). ## Errors Every error response is `{"error":{"code","message"}}`; only `409 not_indexed_yet` may add `indexed_through` (the highest indexed block on that chain), and it is absent when the chain has no indexed data yet. Codes customers hit most often: | Status | `error.code` | Meaning | Action | | ------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `402` | `insufficient_balance` | Paid balance or free grant exhausted; when balance is known, `error.data` includes `balance_units` and `balance_cu` (not billed) | Top up on-chain on the console [Billing page](https://console.blockvectra.com/billing/), or wait for the free allowance to refill | | `404` | `not_found` | Unknown or not-public `{chain}`, or the object does not exist | Fix the request | | `409` | `not_indexed_yet` | Request reaches above `as_of_block` (newest fully written block; includes `indexed_through`), hash resolves above `as_of_block`, or the chain has no indexed data yet (no `indexed_through`) | With `indexed_through`, poll until your block or `to_block` is at or below it; without it, wait for the chain to start indexing (`coverage.has_data` in `GET /v1/data/chains` shows the state) | | `422` | `no_coverage` | Permanent gap: the chain lacks that capability, or the block is before indexed/trace coverage | Change the request; retrying will not help | | `429` | `rate_limited` | Key CU rate limit (response includes `Retry-After`) or account call rate limit (no `Retry-After`); not billed | Retry after `Retry-After` seconds | | `429` | `cost_exceeds_burst` | A single request costs more than the key's burst capacity; no `Retry-After` (not billed) | Split the request; retrying as sent never succeeds | | `503` | `unavailable` | Temporarily unavailable; the response carries `Retry-After`. Also returned for historical requests on a chain whose `coverage.from_block` is currently `null` | Retry after `Retry-After` seconds | | `503` | `gateway_overloaded` | Account concurrency limit across all its keys and chains is reached, or the service is temporarily busy; `Retry-After: 1` (not billed) | Reduce concurrent requests across the account and wait `Retry-After` seconds before retrying | ## Endpoint index ### Chain - GET /chains — List supported chains - GET /{chain}/blocks/{number} — Get a block by number - GET /{chain}/blocks/hash/{hash} — Get a block by hash - GET /{chain}/blocks/{number}/transactions — List a block's transactions - GET /{chain}/transactions/{hash} — Get a transaction by hash ### Status - GET /{chain}/status/freshness — Freshness and lag per dataset ### Addresses - GET /{chain}/addresses/{address}/transactions — List an address's transactions - GET /{chain}/addresses/{address}/transfers — List an address's token transfers - GET /{chain}/addresses/{address}/balances — List an address's ERC-20 balances ### Tokens - GET /{chain}/tokens/{token}/transfers — List a token contract's transfers - GET /{chain}/tokens/{token}/holders — List a token's holders - GET /{chain}/tokens/{token} — Get token metadata - POST /{chain}/tokens:batch — Batch get token metadata ### NFTs - GET /{chain}/nfts/{contract}/{token_id} — Get one NFT's owner/holders - GET /{chain}/nfts — List NFTs owned by an address ### DEX - GET /{chain}/dex/swaps — List DEX swaps by pool or token - GET /{chain}/dex/prices — Daily DEX token prices ### Stocks - GET /{chain}/stocks — Daily leaderboard of tokenized stocks - GET /{chain}/stocks/{token} — Get one tokenized stock ### Traces - GET /{chain}/blocks/{number}/traces — Historical callTracer trace tree for a whole block - GET /{chain}/transactions/{hash}/trace — Historical callTracer trace tree for one transaction --- # JSON-RPC Source: https://docs.blockvectra.com/en/api/json-rpc/ ## Overview All requests are counted in **Compute 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://api.blockvectra.com/v1/robinhood_mainnet`. The same [API key](https://docs.blockvectra.com/en/quickstart/#1-get-an-api-key) works on every supported chain * **Protocol**: HTTP `POST`, single call or batch * **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 [Errors reference](https://docs.blockvectra.com/en/errors/) lists the cases that are not billed. Billing is settled hourly (rounded down to whole units, remainder carries over, executed \~15 minutes after the period ends) * **Ethereum**: its own method list and a state window determined by `state_window_blocks` — see [Supported Chains → Ethereum](https://docs.blockvectra.com/en/chains/#ethereum). For complete parameter schemas, method signatures, and interactive request testing across all methods, see the [Full Reference](https://docs.blockvectra.com/en/api/json-rpc/reference/). For path versioning, backward compatibility rules, and SDK recommendations, see [API versioning and compatibility](https://docs.blockvectra.com/en/api/versioning/). To get an API key and send a first request, see the [Quickstart](https://docs.blockvectra.com/en/quickstart/); it also covers key passing and batch requests. ## 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](https://docs.blockvectra.com/en/api/json-rpc/#cu-metering-rules) table below for `eth_getLogs`'s current CU weight; a range wider than the chain's `max_logs_block_range` (from `GET /v1/chains`) is rejected with `-32602`. **cURL** ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/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 }' ``` **TypeScript** ```ts // npx tsx example.mts import { createPublicClient, http } from 'viem' const apiKey = process.env.BLOCKVECTRA_API_KEY! const client = createPublicClient({ transport: http('https://api.blockvectra.com/v1/robinhood_mainnet', { fetchOptions: { headers: { 'x-api-key': apiKey } } }), }) const TRANSFER_TOPIC = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' const latest = await client.getBlockNumber() const logs = await client.getLogs({ address: '0x1111111111111111111111111111111111111111', topics: [TRANSFER_TOPIC], fromBlock: latest > 100n ? latest - 100n : 0n, toBlock: latest, }) console.log(logs.length) ``` **Python** ```python # uv run --with web3 python example.py import os from web3 import Web3 api_key = os.environ["BLOCKVECTRA_API_KEY"] w3 = Web3( Web3.HTTPProvider( "https://api.blockvectra.com/v1/robinhood_mainnet", request_kwargs={"headers": {"Content-Type": "application/json", "x-api-key": api_key}}, ) ) TRANSFER_TOPIC = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" latest = w3.eth.block_number logs = w3.eth.get_logs( { "address": "0x1111111111111111111111111111111111111111", "topics": [TRANSFER_TOPIC], "fromBlock": max(latest - 100, 0), "toBlock": latest, } ) print(len(logs)) ``` **Go** ```go // go mod init example && go get github.com/ethereum/go-ethereum && go mod tidy && go run . package main import ( "context" "fmt" "log" "math/big" "os" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rpc" ) var transferTopic = common.HexToHash( "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", ) func main() { apiKey := os.Getenv("BLOCKVECTRA_API_KEY") ctx := context.Background() rpcClient, err := rpc.DialOptions(ctx, "https://api.blockvectra.com/v1/robinhood_mainnet", rpc.WithHeader("x-api-key", apiKey)) if err != nil { log.Fatal(err) } client := ethclient.NewClient(rpcClient) latest, err := client.BlockNumber(ctx) if err != nil { log.Fatal(err) } from := uint64(0) if latest > 100 { from = latest - 100 } address := common.HexToAddress("0x1111111111111111111111111111111111111111") logs, err := client.FilterLogs(ctx, ethereum.FilterQuery{ FromBlock: new(big.Int).SetUint64(from), ToBlock: new(big.Int).SetUint64(latest), Addresses: []common.Address{address}, Topics: [][]common.Hash{{transferTopic}}, }) if err != nil { log.Fatal(err) } fmt.Println(len(logs)) } ``` **Rust** Add to `Cargo.toml`: ```toml [dependencies] alloy = { version = "1", features = ["provider-http", "rpc-types"] } tokio = { version = "1", features = ["full"] } eyre = "0.6" reqwest = { version = "0.13", default-features = false } ``` ```rust // cargo run use alloy::primitives::{address, b256}; use alloy::providers::{Provider, ProviderBuilder}; use alloy::rpc::types::Filter; const TRANSFER_TOPIC: alloy::primitives::B256 = b256!("ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"); #[tokio::main] async fn main() -> eyre::Result<()> { let api_key = std::env::var("BLOCKVECTRA_API_KEY").unwrap_or_default(); let rpc_url: reqwest::Url = "https://api.blockvectra.com/v1/robinhood_mainnet".parse()?; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("x-api-key", api_key.parse()?); let http_client = reqwest::Client::builder().default_headers(headers).build()?; let provider = ProviderBuilder::new().connect_reqwest(http_client, rpc_url); let latest = provider.get_block_number().await?; let from = latest.saturating_sub(100); let filter = Filter::new() .address(address!("1111111111111111111111111111111111111111")) .event_signature(TRANSFER_TOPIC) .from_block(from) .to_block(latest); let logs = provider.get_logs(&filter).await?; println!("{}", logs.len()); Ok(()) } ``` ### Trace a transaction (`debug_traceTransaction`) Trace a transaction's internal calls with the `callTracer`. See the [CU Metering Rules](https://docs.blockvectra.com/en/api/json-rpc/#cu-metering-rules) table below for `debug_traceTransaction`'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`). The window size is the chain's `state_window_blocks` (from `GET /v1/chains`). On chains that provide traces, use the [Data API](https://docs.blockvectra.com/en/api/data/) for historical traces. **cURL** ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/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 }' ``` **TypeScript** ```ts // npx tsx example.mts import { createPublicClient, http } from 'viem' const apiKey = process.env.BLOCKVECTRA_API_KEY! const client = createPublicClient({ transport: http('https://api.blockvectra.com/v1/robinhood_mainnet', { fetchOptions: { headers: { 'x-api-key': apiKey } } }), }) const txHash = '0xYOUR_TRANSACTION_HASH' const trace = await client.request({ method: 'debug_traceTransaction' as any, params: [txHash, { tracer: 'callTracer' }] as any, }) console.log(trace) ``` **Python** ```python # uv run --with web3 python example.py import os from web3 import Web3 api_key = os.environ["BLOCKVECTRA_API_KEY"] w3 = Web3( Web3.HTTPProvider( "https://api.blockvectra.com/v1/robinhood_mainnet", request_kwargs={"headers": {"Content-Type": "application/json", "x-api-key": api_key}}, ) ) tx_hash = "0xYOUR_TRANSACTION_HASH" trace = w3.manager.request_blocking( "debug_traceTransaction", [tx_hash, {"tracer": "callTracer"}] ) print(trace) ``` **Go** ```go // go mod init example && go get github.com/ethereum/go-ethereum && go mod tidy && go run . package main import ( "context" "encoding/json" "fmt" "log" "os" "github.com/ethereum/go-ethereum/rpc" ) func main() { apiKey := os.Getenv("BLOCKVECTRA_API_KEY") ctx := context.Background() client, err := rpc.DialOptions(ctx, "https://api.blockvectra.com/v1/robinhood_mainnet", rpc.WithHeader("x-api-key", apiKey)) if err != nil { log.Fatal(err) } txHash := "0xYOUR_TRANSACTION_HASH" var trace json.RawMessage err = client.CallContext(ctx, &trace, "debug_traceTransaction", txHash, map[string]string{ "tracer": "callTracer", }) if err != nil { log.Fatal(err) } fmt.Println(string(trace)) } ``` **Rust** Add to `Cargo.toml`: ```toml [dependencies] alloy = { version = "1", features = ["provider-http", "rpc-types"] } tokio = { version = "1", features = ["full"] } eyre = "0.6" reqwest = { version = "0.13", default-features = false } serde_json = "1" ``` ```rust // cargo run use alloy::providers::{Provider, ProviderBuilder}; use serde_json::json; #[tokio::main] async fn main() -> eyre::Result<()> { let api_key = std::env::var("BLOCKVECTRA_API_KEY").unwrap_or_default(); let rpc_url: reqwest::Url = "https://api.blockvectra.com/v1/robinhood_mainnet".parse()?; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("x-api-key", api_key.parse()?); let http_client = reqwest::Client::builder().default_headers(headers).build()?; let provider = ProviderBuilder::new().connect_reqwest(http_client, rpc_url); let tx_hash = "0xYOUR_TRANSACTION_HASH"; let trace: serde_json::Value = provider .client() .request("debug_traceTransaction", (tx_hash, json!({ "tracer": "callTracer" }))) .await?; println!("{trace}"); Ok(()) } ``` ## CU metering rules Compute Unit (CU) weight for each JSON-RPC method. | Method | Weight (CU) | | --- | --- | | `eth_blockNumber` | 1 | | `eth_chainId` | 1 | | `eth_getBlockByNumber` | 5 | | `eth_blobBaseFee` | 10 | | `eth_feeHistory` | 10 | | `eth_gasPrice` | 10 | | `eth_getBalance` | 10 | | `eth_getBlockByHash` | 10 | | `eth_getBlockReceipts` | 10 | | `eth_getBlockTransactionCountByHash` | 10 | | `eth_getBlockTransactionCountByNumber` | 10 | | `eth_getCode` | 10 | | `eth_getHeaderByHash` | 10 | | `eth_getHeaderByNumber` | 10 | | `eth_getProof` | 10 | | `eth_getRawTransactionByBlockHashAndIndex` | 10 | | `eth_getRawTransactionByBlockNumberAndIndex` | 10 | | `eth_getRawTransactionByHash` | 10 | | `eth_getStorageAt` | 10 | | `eth_getTransactionByBlockHashAndIndex` | 10 | | `eth_getTransactionByBlockNumberAndIndex` | 10 | | `eth_getTransactionByHash` | 10 | | `eth_getTransactionCount` | 10 | | `eth_getTransactionReceipt` | 10 | | `eth_getUncleByBlockHashAndIndex` | 10 | | `eth_getUncleByBlockNumberAndIndex` | 10 | | `eth_getUncleCountByBlockHash` | 10 | | `eth_getUncleCountByBlockNumber` | 10 | | `eth_maxPriorityFeePerGas` | 10 | | `eth_syncing` | 10 | | `net_version` | 10 | | `web3_clientVersion` | 10 | | `web3_sha3` | 10 | | `eth_call` | 15 | | `eth_createAccessList` | 20 | | `eth_estimateGas` | 20 | | `eth_simulateV1` | 20 | | `eth_getLogs` | 30 | | `eth_sendRawTransaction` | 30 | | `debug_traceBlockByHash` | 100 | | `debug_traceBlockByNumber` | 100 | | `debug_traceCall` | 100 | | `debug_traceTransaction` | 100 | | `trace_block` | 100 | | `trace_call` | 100 | | `trace_get` | 100 | | `trace_replayTransaction` | 100 | | `trace_transaction` | 100 | ## Method policy Available methods vary by chain; each chain's list is shown below, and [Supported Chains](https://docs.blockvectra.com/en/chains/) covers the rest. Only methods matching an allowed name or pattern are reachable; any other method returns `-32601 method not available`. **Allowed on every chain below:** - `eth_blockNumber` - `eth_call` - `eth_chainId` - `eth_estimateGas` - `eth_gasPrice` - `eth_getBalance` - `eth_getBlockByHash` - `eth_getBlockByNumber` - `eth_getBlockTransactionCountByHash` - `eth_getBlockTransactionCountByNumber` - `eth_getCode` - `eth_getLogs` - `eth_getStorageAt` - `eth_getTransactionByBlockHashAndIndex` - `eth_getTransactionByBlockNumberAndIndex` - `eth_getTransactionByHash` - `eth_getTransactionCount` - `eth_getTransactionReceipt` - `eth_sendRawTransaction` - `eth_syncing` - `net_version` - `web3_clientVersion` ### Arbitrum One eth_getLogs max block range: 1,000 blocks; state window: 5,000 blocks **Also allowed:** - `debug_traceBlockByHash` - `debug_traceBlockByNumber` - `debug_traceCall` - `debug_traceTransaction` - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Arc eth_getLogs max block range: 1,000 blocks; state window: — **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Avalanche C-Chain eth_getLogs max block range: 1,000 blocks; state window: 128 blocks **Also allowed:** - `debug_traceBlockByHash` - `debug_traceBlockByNumber` - `debug_traceCall` - `debug_traceTransaction` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `web3_sha3` ### Base eth_getLogs max block range: 1,000 blocks; state window: 10,000 blocks **Also allowed:** - `eth_maxPriorityFeePerGas` - `eth_blobBaseFee` - `eth_feeHistory` - `eth_createAccessList` - `eth_getProof` - `eth_simulateV1` - `eth_getBlockReceipts` - `eth_getRawTransactionByHash` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getUncleCountByBlockNumber` - `eth_getUncleCountByBlockHash` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleByBlockHashAndIndex` - `eth_getHeaderByNumber` - `eth_getHeaderByHash` - `web3_sha3` ### Berachain eth_getLogs max block range: 1,000 blocks; state window: 9,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Boba eth_getLogs max block range: 1,000 blocks; state window: 80,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### BNB Smart Chain eth_getLogs max block range: 1,000 blocks; state window: 100 blocks **Also allowed:** - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_maxPriorityFeePerGas` ### Celo eth_getLogs max block range: 1,000 blocks; state window: 864,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Ethereum eth_getLogs max block range: 1,000 blocks; state window: 250,000 blocks **Also allowed:** - `debug_traceBlockByHash` - `debug_traceBlockByNumber` - `debug_traceCall` - `debug_traceTransaction` - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getProof` - `eth_maxPriorityFeePerGas` - `trace_block` - `trace_call` - `trace_get` - `trace_replayTransaction` - `trace_transaction` - `web3_sha3` ### Ethereum Sepolia eth_getLogs max block range: 1,000 blocks; state window: — **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getProof` - `eth_maxPriorityFeePerGas` - `web3_sha3` ### Fraxtal eth_getLogs max block range: 1,000 blocks; state window: 10,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Gnosis eth_getLogs max block range: 1,000 blocks; state window: 262,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### HyperEVM eth_getLogs max block range: 1,000 blocks; state window: — **Also allowed:** - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_maxPriorityFeePerGas` ### Ink eth_getLogs max block range: 1,000 blocks; state window: 9,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Katana eth_getLogs max block range: 1,000 blocks; state window: 86,400 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Linea eth_getLogs max block range: 1,000 blocks; state window: 128 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Metal L2 eth_getLogs max block range: 1,000 blocks; state window: 10,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Mode eth_getLogs max block range: 1,000 blocks; state window: 10,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### OP Mainnet eth_getLogs max block range: 1,000 blocks; state window: 1,296,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Polygon eth_getLogs max block range: 1,000 blocks; state window: 126 blocks **Also allowed:** - `debug_traceBlockByHash` - `debug_traceBlockByNumber` - `debug_traceCall` - `debug_traceTransaction` - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Robinhood Chain eth_getLogs max block range: 1,000 blocks; state window: 900 blocks **Also allowed:** - `eth_maxPriorityFeePerGas` - `eth_blobBaseFee` - `eth_feeHistory` - `eth_createAccessList` - `eth_getProof` - `eth_simulateV1` - `eth_getBlockReceipts` - `eth_getRawTransactionByHash` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getUncleCountByBlockNumber` - `eth_getUncleCountByBlockHash` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleByBlockHashAndIndex` - `eth_getHeaderByNumber` - `eth_getHeaderByHash` - `web3_sha3` - `debug_traceTransaction` - `debug_traceCall` - `debug_traceBlockByNumber` - `debug_traceBlockByHash` ### Robinhood Chain Testnet eth_getLogs max block range: 1,000 blocks; state window: 1,023 blocks **Also allowed:** - `debug_traceBlockByHash` - `debug_traceBlockByNumber` - `debug_traceCall` - `debug_traceTransaction` - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Rootstock eth_getLogs max block range: 1,000 blocks; state window: 6,000 blocks **Also allowed:** - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `web3_sha3` ### Soneium eth_getLogs max block range: 1,000 blocks; state window: 9,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Sonic eth_getLogs max block range: 1,000 blocks; state window: 11,000 blocks **Also allowed:** - `debug_traceBlockByHash` - `debug_traceBlockByNumber` - `debug_traceCall` - `debug_traceTransaction` - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Unichain eth_getLogs max block range: 1,000 blocks; state window: 85,500 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### World Chain eth_getLogs max block range: 1,000 blocks; state window: 30,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### X Layer eth_getLogs max block range: 1,000 blocks; state window: 250,000 blocks **Also allowed:** - `debug_traceBlockByHash` - `debug_traceBlockByNumber` - `debug_traceCall` - `debug_traceTransaction` - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` ### Zora eth_getLogs max block range: 1,000 blocks; state window: 10,000 blocks **Also allowed:** - `eth_blobBaseFee` - `eth_createAccessList` - `eth_feeHistory` - `eth_getBlockReceipts` - `eth_getHeaderByHash` - `eth_getHeaderByNumber` - `eth_getProof` - `eth_getRawTransactionByBlockHashAndIndex` - `eth_getRawTransactionByBlockNumberAndIndex` - `eth_getRawTransactionByHash` - `eth_getUncleByBlockHashAndIndex` - `eth_getUncleByBlockNumberAndIndex` - `eth_getUncleCountByBlockHash` - `eth_getUncleCountByBlockNumber` - `eth_maxPriorityFeePerGas` - `eth_simulateV1` - `web3_sha3` **Limits**: * **Batch**: max 100 calls per request; also limited by the key's CU burst, see below. * **Request body**: max 2 MiB (see “10. Limits at a glance” in the [full OpenAPI reference](https://docs.blockvectra.com/en/api/json-rpc/reference/)) * **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; after a paid top-up each key is at least 2,000 CU/s and burst 10,000 CU, and higher custom limits are kept; 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 CU exceeds burst capacity CU`); split it into smaller batches. ## Error codes See the [Errors reference](https://docs.blockvectra.com/en/errors/) for every error code, whether it is billed, and what to do. ## Full OpenAPI reference See the [Full OpenAPI reference](https://docs.blockvectra.com/en/api/json-rpc/reference/) for the complete machine-readable specification with all method signatures, request and response schemas, and parameter details rendered interactively. --- # debug_traceCall: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/debug_traceCall/ ## Summary Run an eth_call on top of a given block state and generate an execution trace. ([Official documentation](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugtracecall)) ## Compute units (CU) and pricing - CU per call: 100 CU - Price per 1M calls (USD): $10.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `call` | `object` | Transaction call object, containing from, to, data, gas, gasPrice, value. | | `block` | `QUANTITY\|TAG\|HASH` | Block number (0x-prefixed hexadecimal quantity), block hash, or the 'latest' / 'pending' tag to trace against; safe, finalized and earliest return -32011. | | `options` | `object` | Trace options object (optional): tracer is callTracer, flatCallTracer, prestateTracer, 4byteTracer or noopTracer, omitted uses the default struct logger, and any other value returns -32602 tracer not allowed; tracerConfig passes tracer-specific options (such as onlyTopCall and withLog for callTracer, diffMode for prestateTracer); timeout is at most 30s; reexec is a Geth-compatible option (non-negative integer, 0 is valid): the maximum number of blocks to walk back and re-execute when rebuilding historical state, not a target block number, and it does not change the trace target; accepting the parameter does not mean any re-execution occurred, and support depends on the chain node implementation; stateOverrides, blockOverrides and txIndex are also supported. | ## Returns - **Type**: `ARRAY (flatCallTracer); OBJECT (callTracer, prestateTracer, 4byteTracer, noopTracer, default struct logger)` - **Description**: The tracer determines the return shape: flatCallTracer returns an array of flat trace entries, each containing action, type, an integer-array traceAddress, subtraces, and result on success or error on failure; block and transaction context fields depend on the node and call mode, blockHash and transactionHash may be null for simulated calls, and Arbitrum entries may also include beforeEVMTransfers and afterEVMTransfers. callTracer returns a CallFrame tree object; prestateTracer returns an address-keyed account-state object by default, or a state-diff object with pre and post in diffMode; 4byteTracer returns an object mapping signature and calldata size to occurrence count; noopTracer returns an empty object; omitting tracer returns the default struct logger object with gas, failed, returnValue and structLogs. ## Notes The target block must be within the chain's state window (state_window_blocks); out-of-window requests return -32011 (not billed). The gateway accepts the pending tag, but node support depends on the chain: on arb_mainnet, debug_traceCall with block=pending may return node error -32000 with message tracing on top of pending is not supported; this error is passed through unchanged, not rewritten to -32010 or -32011. Use latest, or an explicit block number or hash, instead. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "debug_traceCall", "params": [ { "to": "", "data": "" }, "latest", { "tracer": "callTracer" } ], "id": 1 }' ``` ## Supported chains Available on all supported chains except: Arc (arc_mainnet), Base (base_mainnet), Berachain (berachain_mainnet), Boba (boba_mainnet), BNB Smart Chain (bsc_mainnet), Celo (celo_mainnet), Ethereum Sepolia (eth_sepolia), Fraxtal (fraxtal_mainnet), Gnosis (gnosis_mainnet), HyperEVM (hyperevm_mainnet), Ink (ink_mainnet), Katana (katana_mainnet), Linea (linea_mainnet), Metal L2 (metall2_mainnet), Mode (mode_mainnet), OP Mainnet (op_mainnet), Rootstock (rootstock_mainnet), Soneium (soneium_mainnet), Unichain (unichain_mainnet), World Chain (world_mainnet), Zora (zora_mainnet). --- # debug_traceTransaction: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/debug_traceTransaction/ ## Summary Reconstruct and replay the execution of a transaction to produce an execution trace. ([Official documentation](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugtracetransaction)) ## Compute units (CU) and pricing - CU per call: 100 CU - Price per 1M calls (USD): $10.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `transactionHash` | `HASH` | 32-byte transaction hash to trace as 0x-prefixed hex. | | `options` | `object` | Trace options object (optional): tracer is callTracer, flatCallTracer, prestateTracer, 4byteTracer or noopTracer, omitted uses the default struct logger, and any other value returns -32602 tracer not allowed; tracerConfig passes tracer-specific options (such as onlyTopCall and withLog for callTracer, diffMode for prestateTracer); timeout is at most 30s; reexec is a Geth-compatible option (non-negative integer, 0 is valid): the maximum number of blocks to walk back and re-execute when rebuilding historical state, not a target block number, and it does not change the trace target; accepting the parameter does not mean any re-execution occurred, and support depends on the chain node implementation. | ## Returns - **Type**: `ARRAY (flatCallTracer); OBJECT (callTracer, prestateTracer, 4byteTracer, noopTracer, default struct logger)` - **Description**: The tracer determines the return shape: flatCallTracer returns an array of flat trace entries, each containing action, type, an integer-array traceAddress, subtraces, and result on success or error on failure; block and transaction context fields depend on the node and call mode, blockHash and transactionHash may be null for simulated calls, and Arbitrum entries may also include beforeEVMTransfers and afterEVMTransfers. callTracer returns a CallFrame tree object; prestateTracer returns an address-keyed account-state object by default, or a state-diff object with pre and post in diffMode; 4byteTracer returns an object mapping signature and calldata size to occurrence count; noopTracer returns an empty object; omitting tracer returns the default struct logger object with gas, failed, returnValue and structLogs. ## Notes The target transaction's block must be within the chain's state window (state_window_blocks); out-of-window requests return -32011 (not billed). ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "debug_traceTransaction", "params": [ "", { "tracer": "callTracer" } ], "id": 1 }' ``` ## Supported chains Available on all supported chains except: Arc (arc_mainnet), Base (base_mainnet), Berachain (berachain_mainnet), Boba (boba_mainnet), BNB Smart Chain (bsc_mainnet), Celo (celo_mainnet), Ethereum Sepolia (eth_sepolia), Fraxtal (fraxtal_mainnet), Gnosis (gnosis_mainnet), HyperEVM (hyperevm_mainnet), Ink (ink_mainnet), Katana (katana_mainnet), Linea (linea_mainnet), Metal L2 (metall2_mainnet), Mode (mode_mainnet), OP Mainnet (op_mainnet), Rootstock (rootstock_mainnet), Soneium (soneium_mainnet), Unichain (unichain_mainnet), World Chain (world_mainnet), Zora (zora_mainnet). --- # eth_blockNumber: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_blockNumber/ ## Summary Return the number of the latest block known to the node. ## Compute units (CU) and pricing - CU per call: 1 CU - Price per 1M calls (USD): $0.10 ## Parameters This method takes no parameters. ## Returns - **Type**: `QUANTITY` - **Description**: Latest block number as a 0x-prefixed hexadecimal quantity. ## Notes The result reflects the node's current head and moves as new blocks arrive; it does not imply that the block is final. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/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 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_call: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_call/ ## Summary Execute a read-only call against the state of a given block and return its result. ## Compute units (CU) and pricing - CU per call: 15 CU - Price per 1M calls (USD): $1.50 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `transaction` | `object` | Call object with to (the address being called) and optional from, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value and data/input. Quantity fields value, gas, gasPrice, maxFeePerGas and maxPriorityFeePerGas encode nonnegative integers minimally in hex: 0x0 is zero and 0x1 is one; 0x, 0x00 and 0x01 are not valid Quantity. data/input is complete-bytes Data: 0x is empty, 0x00 is one zero byte, 0x0001 is two bytes, and leading zeros in Data must be preserved. Never treat addresses, hashes, signatures or arbitrary 0x fields as Quantity. | | `blockParameter` | `QUANTITY\|TAG` | Optional block number or tag the call runs against: latest or pending; safe, finalized and earliest return -32011 (not billed); defaults to the latest block. | ## Returns - **Type**: `DATA` - **Description**: Call return data, usually ABI-encoded, as 0x-prefixed hex; 0x when there is no return value. ## Notes The call is read-only: it creates no transaction and changes no state, and a revert normally surfaces as an error. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_call", "params": [ { "to": "0x0000000000000000000000000000000000000000", "data": "0x" }, "latest" ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_chainId: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_chainId/ ## Summary Return the EIP-155 chain ID of the current network. ## Compute units (CU) and pricing - CU per call: 1 CU - Price per 1M calls (USD): $0.10 ## Parameters This method takes no parameters. ## Returns - **Type**: `QUANTITY` - **Description**: Chain ID as a 0x-prefixed hexadecimal quantity (for example 0x1 on mainnet). ## Notes The chain ID is part of EIP-155 transaction signing and stays constant for a network. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_estimateGas: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_estimateGas/ ## Summary Estimate the gas limit a transaction would need. ## Compute units (CU) and pricing - CU per call: 20 CU - Price per 1M calls (USD): $2.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `transaction` | `object` | Transaction call object that may include from, to, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value and data/input; it is only simulated and changes no on-chain state. Quantity fields value, gas, gasPrice, maxFeePerGas and maxPriorityFeePerGas encode nonnegative integers minimally in hex: 0x0 is zero and 0x1 is one; 0x, 0x00 and 0x01 are not valid Quantity. data/input is complete-bytes Data: 0x is empty, 0x00 is one zero byte, 0x0001 is two bytes, and leading zeros in Data must be preserved. Never treat addresses, hashes, signatures or arbitrary 0x fields as Quantity. | | `blockParameter` | `QUANTITY\|TAG` | Optional block number or tag for the estimate: latest or pending; safe, finalized and earliest return -32011 (not billed); defaults to the latest block. | ## Returns - **Type**: `QUANTITY` - **Description**: Estimated gas amount as a 0x-prefixed hexadecimal quantity. ## Notes The estimate runs against the state of the given block; if the call would revert, clients normally return an error instead of a number. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ { "to": "0x0000000000000000000000000000000000000000", "data": "0x" }, "latest" ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_feeHistory: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_feeHistory/ ## Summary Return historical base fees, gas usage ratios and optional priority-fee percentiles over a range of blocks. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `blockCount` | `QUANTITY` | Number of blocks to query, as a 0x-prefixed hexadecimal quantity. | | `newestBlock` | `QUANTITY\|TAG` | Newest block in the range, as a block number or tag such as latest. | | `rewardPercentiles` | `ARRAY` | Optional ascending array of percentiles between 0 and 100, used to compute priority-fee percentiles per block. | ## Returns - **Type**: `object` - **Description**: Object with oldestBlock, baseFeePerGas (an array one longer than blockCount), gasUsedRatio, and, when rewardPercentiles is given, a two-dimensional reward array. ## Notes This is the EIP-1559 fee-history method; when rewardPercentiles is omitted, the result has no reward field. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_feeHistory", "params": [ "", "latest", [] ], "id": 1 }' ``` ## Supported chains Available on all supported chains except: Rootstock (rootstock_mainnet). --- # eth_gasPrice: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_gasPrice/ ## Summary Return the node's suggested current gas price in wei. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters This method takes no parameters. ## Returns - **Type**: `QUANTITY` - **Description**: Suggested gas price as a 0x-prefixed hexadecimal quantity in wei. ## Notes It is an estimate of the current market fee and may not map exactly to the EIP-1559 base fee plus priority fee. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_gasPrice", "params": [], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_getBalance: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getBalance/ ## Summary Return the balance of an address at a given block, in wei. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `address` | `ADDRESS` | Account address to query. | | `blockParameter` | `QUANTITY\|TAG` | Block number or tag: latest or pending; safe, finalized and earliest return -32011 (not billed). | ## Returns - **Type**: `QUANTITY` - **Description**: Account balance as a 0x-prefixed hexadecimal quantity in wei. ## Notes The balance depends on the chosen block tag: pending reflects the pending state. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": [ "0x0000000000000000000000000000000000000000", "latest" ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_getBlockByHash: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getBlockByHash/ ## Summary Return a block by its hash, optionally with full transaction objects. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `blockHash` | `HASH` | 32-byte block hash as 0x-prefixed hex. | | `fullTransactions` | `boolean` | true returns full transaction objects; false returns only the list of transaction hashes. | ## Returns - **Type**: `OBJECT|NULL` - **Description**: Block object; null when not found. ## Notes Compared with a number lookup, a hash lookup refers to a fixed block. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": [ "", false ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_getBlockByNumber: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getBlockByNumber/ ## Summary Return a block by its number, optionally with full transaction objects. ## Compute units (CU) and pricing - CU per call: 5 CU - Price per 1M calls (USD): $0.50 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `blockParameter` | `QUANTITY\|TAG` | Block number or tag: latest, earliest, pending, safe or finalized. | | `fullTransactions` | `boolean` | true returns full transaction objects; false returns only the list of transaction hashes. | ## Returns - **Type**: `OBJECT|NULL` - **Description**: Block object with header fields and a transaction list; null when the block is not found. ## Notes The blocks behind the latest, pending, safe and finalized tags change as the chain advances. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": [ "latest", false ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_getBlockReceipts: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getBlockReceipts/ ## Summary Return all transaction receipts for a given block. ([Official documentation](https://ethereum.github.io/execution-apis/api/methods/eth_getBlockReceipts)) ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `block` | `QUANTITY\|TAG\|HASH` | Block number (0x-prefixed hexadecimal quantity), block hash (32-byte, 0x-prefixed hex), or block tag: 'latest', 'earliest', 'pending', 'safe' or 'finalized'. | ## Returns - **Type**: `ARRAY|NULL` - **Description**: Array of transaction receipt objects, or null when the block is not found. Each receipt contains transactionHash, blockNumber, gasUsed, status, logs and related fields. ## Notes One call fetches a whole block's receipts, saving round trips compared with calling eth_getTransactionReceipt per transaction. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_getBlockReceipts", "params": [ "latest" ], "id": 1 }' ``` ## Supported chains Available on all supported chains except: Rootstock (rootstock_mainnet). --- # eth_getCode: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getCode/ ## Summary Return the contract bytecode deployed at an address at a given block. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `address` | `ADDRESS` | Account address to query. | | `blockParameter` | `QUANTITY\|TAG` | Block number or tag: latest or pending; safe, finalized and earliest return -32011 (not billed). | ## Returns - **Type**: `DATA` - **Description**: EVM bytecode as 0x-prefixed hex; 0x for an externally owned account or when no code exists at that block. ## Notes A contract can return different code at different blocks, for example before deployment or after it is destroyed. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_getCode", "params": [ "0x0000000000000000000000000000000000000000", "latest" ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_getLogs: block range limit, parameters and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getLogs/ ## Summary Query event logs within a block range that match a filter. ## Compute units (CU) and pricing - CU per call: 30 CU - Price per 1M calls (USD): $3.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `filter` | `object` | Filter object: fromBlock and toBlock (block number or tag, default latest), address (one address or an array of addresses), topics (an array where each item is null, a 32-byte topic, or an array of topics), or blockHash to target a single block. | ## Returns - **Type**: `ARRAY` - **Description**: Array of log objects in block order; an empty array when nothing matches. ## Notes blockHash is mutually exclusive with fromBlock/toBlock; topics match by position, and null means any value at that position. A block range wider than the chain's max_logs_block_range (see GET /v1/chains) returns -32602. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "address": "0x0000000000000000000000000000000000000000", "fromBlock": "latest", "toBlock": "latest" } ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. For wide queries, follow the [eth\_getLogs block range limit and chunked queries guide](https://docs.blockvectra.com/en/guides/getlogs-block-range/). Error details and recommended actions are in the [logs\_range\_too\_large reference](https://docs.blockvectra.com/en/errors/#logs_range_too_large). --- # eth_getStorageAt: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getStorageAt/ ## Summary Return the raw value stored at a given storage slot of an address. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `address` | `ADDRESS` | Contract address. | | `position` | `QUANTITY` | Storage slot position as a 0x-prefixed hexadecimal quantity; this is the raw EVM slot, not the order in which Solidity variables are declared. | | `blockParameter` | `QUANTITY\|TAG` | Block number or tag: latest or pending; safe, finalized and earliest return -32011 (not billed). | ## Returns - **Type**: `DATA` - **Description**: The 32-byte value at that slot, as 0x-prefixed hex. ## Notes To read a specific variable, compute the slot from Solidity's storage layout, including mappings, dynamic arrays and packing rules. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_getStorageAt", "params": [ "0x0000000000000000000000000000000000000000", "0x0", "latest" ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_getTransactionByHash: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getTransactionByHash/ ## Summary Return a transaction by its hash. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `transactionHash` | `HASH` | 32-byte transaction hash as 0x-prefixed hex. | ## Returns - **Type**: `OBJECT|NULL` - **Description**: Transaction object including its block context; null when the transaction is unknown. ## Notes A pending transaction may already be in the pool, but its block fields stay empty until it is included. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": [ "" ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_getTransactionCount: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getTransactionCount/ ## Summary Return the number of transactions sent from an address (its nonce) at a given block. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `address` | `ADDRESS` | Account address to query. | | `blockParameter` | `QUANTITY\|TAG` | Block number or tag: latest or pending; safe, finalized and earliest return -32011 (not billed). | ## Returns - **Type**: `QUANTITY` - **Description**: Account nonce as a 0x-prefixed hexadecimal quantity. ## Notes With latest only mined transactions count, while pending also counts pending transactions; a difference usually means there are unconfirmed transactions. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": [ "0x0000000000000000000000000000000000000000", "latest" ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_getTransactionReceipt: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getTransactionReceipt/ ## Summary Return the receipt (execution result) of a transaction by its hash. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `transactionHash` | `HASH` | 32-byte transaction hash as 0x-prefixed hex. | ## Returns - **Type**: `OBJECT|NULL` - **Description**: Transaction receipt object with fields such as status, gasUsed, logs and effectiveGasPrice; null when the transaction is unknown or not yet mined. ## Notes A receipt exists only after the transaction is mined; status reports success or revert, and logs are delivered together with the receipt. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": [ "" ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_maxPriorityFeePerGas: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_maxPriorityFeePerGas/ ## Summary Return the node's suggested EIP-1559 priority fee (tip) per gas, in wei. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters This method takes no parameters. ## Returns - **Type**: `QUANTITY` - **Description**: Suggested priority fee as a 0x-prefixed hexadecimal quantity in wei. ## Notes The value covers only the tip, not the base fee; an EIP-1559 transaction also needs the block base fee to derive maxFeePerGas. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_maxPriorityFeePerGas", "params": [], "id": 1 }' ``` ## Supported chains Available on all supported chains except: Rootstock (rootstock_mainnet). --- # eth_sendRawTransaction: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_sendRawTransaction/ ## Summary Submit a signed raw transaction. ## Compute units (CU) and pricing - CU per call: 30 CU - Price per 1M calls (USD): $3.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `signedTransactionData` | `DATA` | Signed transaction data as 0x-prefixed hex (the RLP-encoded raw transaction). | ## Returns - **Type**: `DATA` - **Description**: Transaction hash as a 32-byte, 0x-prefixed hex string. ## Notes Receiving a hash only means the node accepted the transaction, not that it is on-chain; confirm success through the receipt. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": [ "" ], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # eth_simulateV1: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_simulateV1/ ## Summary Simulate a sequence of calls or transactions against block state without broadcasting. ([Official documentation](https://ethereum.github.io/execution-apis/api/methods/eth_simulateV1)) ## Compute units (CU) and pricing - CU per call: 20 CU - Price per 1M calls (USD): $2.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `payload` | `object` | Simulation payload object: blockStateCalls (required) is an array of simulated blocks, each with optional blockOverrides (block header field overrides), stateOverrides (account state overrides) and calls (the calls or transactions to execute in that block); validation (boolean, default false) runs most of the checks a normal EVM would when true and behaves like eth_call when false; traceTransfers (boolean, default false) adds ETH transfers to the logs as ERC-20 Transfer events; returnFullTransactions (boolean) returns full transaction objects when true, otherwise just hashes. | | `block` | `QUANTITY\|TAG\|HASH` | Optional block number (0x-prefixed hexadecimal quantity), block hash or block tag the simulation runs against; defaults to 'latest'. | ## Returns - **Type**: `ARRAY` - **Description**: EthSimulateResult: an array of simulated block objects, each with the block header fields returned by the chain node plus a calls array, where the canonical field for the block's fee recipient is result[i].miner (a 20-byte 0x address), consistent with the simulate-transactions guide; each call has status (0x1 success, 0x0 failure), returnData and gasUsed, plus optional maxUsedGas when returned, with logs on success or error on failure. ## Notes Availability depends on the chain's method policy (methods.allow). Chains where this method is not enabled return -32601 method not available (not billed). ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_simulateV1", "params": [ { "blockStateCalls": [ { "calls": [ { "to": "", "data": "" } ] } ] }, "latest" ], "id": 1 }' ``` ## Supported chains Available on all supported chains except: Avalanche C-Chain (avax_mainnet), BNB Smart Chain (bsc_mainnet), Ethereum (eth_mainnet), Ethereum Sepolia (eth_sepolia), HyperEVM (hyperevm_mainnet), Rootstock (rootstock_mainnet). --- # eth_syncing: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/eth_syncing/ ## Summary Return the node's syncing status. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters This method takes no parameters. ## Returns - **Type**: `boolean|object` - **Description**: false when not syncing; otherwise an object with progress fields such as startingBlock, currentBlock and highestBlock. ## Notes Clients may include extra fields in the syncing object; combine it with the latest block number to judge whether the node is usable. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "eth_syncing", "params": [], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # JSON-RPC Methods Source: https://docs.blockvectra.com/en/api/json-rpc/methods/ BlockVectra supports standard Ethereum JSON-RPC 2.0 methods across supported blockchain networks. Requests are metered in **Compute Units (CU)** and rate-limited per key. Select any method below to view its parameters, return structure, notes, curl request example, and per-chain availability. ## Methods | Method | Summary | CU / Call | | --- | --- | --- | | [`eth_blockNumber`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_blockNumber/) | Return the number of the latest block known to the node. | 1 CU | | [`eth_chainId`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_chainId/) | Return the EIP-155 chain ID of the current network. | 1 CU | | [`eth_syncing`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_syncing/) | Return the node's syncing status. | 10 CU | | [`net_version`](https://docs.blockvectra.com/en/api/json-rpc/methods/net_version/) | Return the network ID of the current network as a decimal string. | 10 CU | | [`web3_clientVersion`](https://docs.blockvectra.com/en/api/json-rpc/methods/web3_clientVersion/) | Return the client name and version string of the node. | 10 CU | | [`eth_gasPrice`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_gasPrice/) | Return the node's suggested current gas price in wei. | 10 CU | | [`eth_maxPriorityFeePerGas`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_maxPriorityFeePerGas/) | Return the node's suggested EIP-1559 priority fee (tip) per gas, in wei. | 10 CU | | [`eth_feeHistory`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_feeHistory/) | Return historical base fees, gas usage ratios and optional priority-fee percentiles over a range of blocks. | 10 CU | | [`eth_estimateGas`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_estimateGas/) | Estimate the gas limit a transaction would need. | 20 CU | | [`eth_call`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_call/) | Execute a read-only call against the state of a given block and return its result. | 15 CU | | [`eth_simulateV1`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_simulateV1/) | Simulate a sequence of calls or transactions against block state without broadcasting. | 20 CU | | [`eth_getBalance`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getBalance/) | Return the balance of an address at a given block, in wei. | 10 CU | | [`eth_getCode`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getCode/) | Return the contract bytecode deployed at an address at a given block. | 10 CU | | [`eth_getStorageAt`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getStorageAt/) | Return the raw value stored at a given storage slot of an address. | 10 CU | | [`eth_getTransactionCount`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getTransactionCount/) | Return the number of transactions sent from an address (its nonce) at a given block. | 10 CU | | [`eth_getLogs`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getLogs/) | Query event logs within a block range that match a filter. | 30 CU | | [`eth_getBlockByNumber`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getBlockByNumber/) | Return a block by its number, optionally with full transaction objects. | 5 CU | | [`eth_getBlockByHash`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getBlockByHash/) | Return a block by its hash, optionally with full transaction objects. | 10 CU | | [`eth_getBlockReceipts`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getBlockReceipts/) | Return all transaction receipts for a given block. | 10 CU | | [`eth_getTransactionByHash`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getTransactionByHash/) | Return a transaction by its hash. | 10 CU | | [`eth_getTransactionReceipt`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getTransactionReceipt/) | Return the receipt (execution result) of a transaction by its hash. | 10 CU | | [`eth_sendRawTransaction`](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_sendRawTransaction/) | Submit a signed raw transaction. | 30 CU | | [`debug_traceTransaction`](https://docs.blockvectra.com/en/api/json-rpc/methods/debug_traceTransaction/) | Reconstruct and replay the execution of a transaction to produce an execution trace. | 100 CU | | [`debug_traceCall`](https://docs.blockvectra.com/en/api/json-rpc/methods/debug_traceCall/) | Run an eth_call on top of a given block state and generate an execution trace. | 100 CU | | [`trace_transaction`](https://docs.blockvectra.com/en/api/json-rpc/methods/trace_transaction/) | Return all traces produced during the execution of a transaction. | 100 CU | ## Related references * [JSON-RPC Overview and Metering Rules](https://docs.blockvectra.com/en/api/json-rpc/) * [Error Codes Table](https://docs.blockvectra.com/en/api/json-rpc/#error-codes) * [Per-Chain Method Policy](https://docs.blockvectra.com/en/api/json-rpc/#method-policy) * [Supported Chains](https://docs.blockvectra.com/en/chains/) --- # net_version: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/net_version/ ## Summary Return the network ID of the current network as a decimal string. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters This method takes no parameters. ## Returns - **Type**: `string` - **Description**: Network ID as a decimal string (for example "1" on mainnet). ## Notes The network ID and the EIP-155 chain ID are distinct concepts; they are often equal but do not have to be, and signing should use eth_chainId. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "net_version", "params": [], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # trace_transaction: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/trace_transaction/ ## Summary Return all traces produced during the execution of a transaction. ([Official documentation](https://docs.nethermind.io/interacting/json-rpc-ns/trace/#trace_transaction)) ## Compute units (CU) and pricing - CU per call: 100 CU - Price per 1M calls (USD): $10.00 ## Parameters | Parameter | Type | Description | | --- | --- | --- | | `transactionHash` | `HASH` | 32-byte transaction hash to inspect as 0x-prefixed hex. | ## Returns - **Type**: `ARRAY` - **Description**: Array of trace objects recorded during transaction execution, in execution order. ## Notes trace_transaction is supported on chains with Parity/OpenEthereum-style trace modules enabled; see the availability table below. A block outside the state window returns -32011, and an unknown hash returns -32000; neither is billed. For Geth-style call trees, use debug_traceTransaction. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/eth_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "trace_transaction", "params": [ "" ], "id": 1 }' ``` ## Supported chains Available on all supported chains except: Arbitrum One (arb_mainnet), Arc (arc_mainnet), Avalanche C-Chain (avax_mainnet), Base (base_mainnet), Berachain (berachain_mainnet), Boba (boba_mainnet), BNB Smart Chain (bsc_mainnet), Celo (celo_mainnet), Ethereum Sepolia (eth_sepolia), Fraxtal (fraxtal_mainnet), Gnosis (gnosis_mainnet), HyperEVM (hyperevm_mainnet), Ink (ink_mainnet), Katana (katana_mainnet), Linea (linea_mainnet), Metal L2 (metall2_mainnet), Mode (mode_mainnet), OP Mainnet (op_mainnet), Polygon (polygon_mainnet), Robinhood Chain (robinhood_mainnet), Robinhood Chain Testnet (robinhood_testnet), Rootstock (rootstock_mainnet), Soneium (soneium_mainnet), Sonic (sonic_mainnet), Unichain (unichain_mainnet), World Chain (world_mainnet), X Layer (xlayer_mainnet), Zora (zora_mainnet). --- # web3_clientVersion: parameters, returns and CU Source: https://docs.blockvectra.com/en/api/json-rpc/methods/web3_clientVersion/ ## Summary Return the client name and version string of the node. ## Compute units (CU) and pricing - CU per call: 10 CU - Price per 1M calls (USD): $1.00 ## Parameters This method takes no parameters. ## Returns - **Type**: `string` - **Description**: Client version string, for example "Geth/v1.x.x/...". ## Notes The string format is client-specific and not standardized. ## Request example ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -X POST "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "method": "web3_clientVersion", "params": [], "id": 1 }' ``` ## Supported chains Available on all 29 supported chains. --- # Full Reference Source: https://docs.blockvectra.com/en/api/json-rpc/reference/ ## Endpoint index ### Faucet - POST /faucet/robinhood_testnet — Claim 0.001 test ETH on the Robinhood testnet. - OPTIONS /faucet/robinhood_testnet — CORS preflight for browser faucet claim requests, without an API key. ### JSON-RPC - POST /{chain}/public — Call the public wallet JSON-RPC endpoint without an API key. - POST /{chain}/public/{apiKey} — Call standard billed JSON-RPC through the public endpoint with a path API key. - POST /{chain}/{apiKey} — JSON-RPC call (API key in the URL path) - POST /{chain} — JSON-RPC call (API key in a header) ### Status - GET /status — Public service status ### Chains - GET /chains — Public chain list and parameters ### Account - GET /account — Get the API key's own balance and limits. ## Account and top-up APIs For account management, see [Console Account API](https://docs.blockvectra.com/en/api/console/) ([OpenAPI](https://docs.blockvectra.com/openapi/console.yaml)). For deposit addresses and on-chain deposit history, see [Top-up API](https://docs.blockvectra.com/en/api/topup/) ([OpenAPI](https://docs.blockvectra.com/openapi/topup.yaml)). --- # Top-up API Source: https://docs.blockvectra.com/en/api/topup/ Query top-up availability without credentials. Use your API key in the `x-api-key` header to retrieve a deposit address and list your deposits. See the [Agent Top-Up Guide](https://docs.blockvectra.com/en/guides/agent-topup/) for the signing and deposit flow. [Download OpenAPI spec](https://docs.blockvectra.com/openapi/topup.yaml) ## Endpoint index ### Other - GET /v1/topup/status — Get top-up availability - GET /v1/topup/deposit-address — Get deposit address - GET /v1/topup/deposits — List deposit history --- # API versioning and compatibility Source: https://docs.blockvectra.com/en/api/versioning/ ## Versioning scheme BlockVectra APIs use path versioning: `/v1`. ## Compatible changes The following changes are backward-compatible; clients must ignore unknown fields: * Adding new fields * Adding new `error.data.reason` values * Adding new endpoints * Adding new optional parameters When encountering an unrecognized reason, clients must handle it according to the `retryable` field in the same error object. See the [Error Reference](https://docs.blockvectra.com/en/errors/). ## Changes outside API versioning Chains and methods can be added or removed at any time; read `GET /v1/chains` at runtime. ## Pricing and CU weights The price schedule is fetched in real time from `GET /v1/plans` (`method_weights`) See the [Pricing page](https://blockvectra.com/en/pricing/). --- # Blockchain Data API datasets: choose data for your application Source: https://docs.blockvectra.com/en/datasets/ Choose Blockchain Data API datasets by task and check the chain matrix below. For wallet assets, start with [token balances](https://blockvectra.com/en/data/balances/) and [token transfer history](https://blockvectra.com/en/data/transfers/); for tokenized stock activity, see the [stocks guide](https://docs.blockvectra.com/en/guides/stocks/). Once you have chosen a dataset, use the [Data API reference](https://docs.blockvectra.com/en/api/data/) for request parameters and response schemas, or the [Quickstart](https://docs.blockvectra.com/en/quickstart/) for your first call. ## What's available * **Blocks & transactions** — block and transaction data, including event logs and execution traces (where supported). * **Token transfers & balances** — ERC-20 transfer history and address balances. * **Token holders** — holders and balances per token. * **Tokenized stocks** — US stocks and ETFs issued on supported chains as tokens. * **DEX trades & daily prices** — decentralized exchange trades and daily prices. * **NFT holdings** — current holders and balances. * **Data freshness** — how far each dataset lags behind the indexed chain head. ## Chain × dataset matrix Availability of datasets across supported chains: | Chain | Token transfers | Token balances | Token holders | Tokenized stocks | DEX trades & daily prices | NFT holdings | Traces | | --- | --- | --- | --- | --- | --- | --- | --- | | [Arbitrum One RPC and Data API](https://blockvectra.com/en/chains/arb_mainnet/) (`arb_mainnet`) | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | [Base RPC and Data API](https://blockvectra.com/en/chains/base_mainnet/) (`base_mainnet`) | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | [BNB Smart Chain RPC and Data API](https://blockvectra.com/en/chains/bsc_mainnet/) (`bsc_mainnet`) | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | [Ethereum RPC and Data API](https://blockvectra.com/en/chains/eth_mainnet/) (`eth_mainnet`) | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | [Ethereum Sepolia RPC and Data API](https://blockvectra.com/en/chains/eth_sepolia/) (`eth_sepolia`) | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | [Gnosis RPC and Data API](https://blockvectra.com/en/chains/gnosis_mainnet/) (`gnosis_mainnet`) | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | [HyperEVM RPC and Data API](https://blockvectra.com/en/chains/hyperevm_mainnet/) (`hyperevm_mainnet`) | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | [OP Mainnet RPC and Data API](https://blockvectra.com/en/chains/op_mainnet/) (`op_mainnet`) | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | [Polygon RPC and Data API](https://blockvectra.com/en/chains/polygon_mainnet/) (`polygon_mainnet`) | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | [Robinhood Chain RPC and Data API](https://blockvectra.com/en/chains/robinhood_mainnet/) (`robinhood_mainnet`) | ✓ | ✗ | ✗ | ✓ | Partial | ✗ | ✓ | Partial = only some of this dataset's endpoints are enabled on that chain. [View live status →](https://blockvectra.com/en/status/) ### Coverage notes * **Ethereum window**: coverage for transfers and address transactions is determined by `coverage.from_block` in `GET /v1/data/chains`; a response that crosses the window start is marked `meta.coverage: "partial"`. * **Traces**: available on select chains only, from a certain block onward, with a small number of gaps (see [Supported Chains](https://docs.blockvectra.com/en/chains/)). ✗ means requests return `422 no_coverage` (not billed). See [Supported Chains](https://docs.blockvectra.com/en/chains/) for endpoint URLs, chain IDs, and additional per-chain details. ## Next steps * [Quickstart](https://docs.blockvectra.com/en/quickstart/) — make your first JSON-RPC and Data API calls. * [Data API reference](https://docs.blockvectra.com/en/api/data/) — endpoints, parameters, and response shapes. * [Supported Chains](https://docs.blockvectra.com/en/chains/) — service capabilities and network identifiers. --- # Error Reference Source: https://docs.blockvectra.com/en/errors/ This reference documents all error codes and machine-readable `reason` values across BlockVectra services, including whether a rejected call is billed, retry policies, backoff durations, and recommended actions for AI agents and automated clients. For machine-readable consumption, fetch the complete catalog as JSON at [/errors.json](https://docs.blockvectra.com/errors.json). Every error response carrying a `docs_url` links directly to a stable anchor on this page: `https://docs.blockvectra.com/en/errors/#` (or `#-` for errors without a reason code). ### JSON-RPC errors | HTTP | Code | Reason | Meaning | Billed | Retryable | Wait Time (Retry-After) | Agent Action | | --- | --- | --- | --- | --- | --- | --- | --- | | 401 | -32024 | `missing_api_key` | `missing API key: send it in the request path (/v1/{chain}/) or in the x-api-key header` | No | No | — | For JSON-RPC endpoints (/v1/{chain}), provide API key in request path (/v1/{chain}/) or in x-api-key header. For Data API (/v1/data/*) and Top-up API (/v1/topup/*), provide API key only in x-api-key header. | | 401 | -32024 | `invalid_api_key` | `Unknown, disabled, or revoked API key: JSON-RPC and Data API both return HTTP 401 with an invalid_api_key error envelope (JSON-RPC: error.code -32024 and error.data.reason invalid_api_key; Data API: error.code and error.data.reason invalid_api_key).` | No | No | — | Check the API key; if necessary, sign in again in the console or via programmatic sign-up to create a new key (see [Lost your session or API key?](https://docs.blockvectra.com/en/guides/programmatic-signup/#lost-your-session-or-api-key)). | | 403 | -32025 | `key_expired` | `API key expired; create a new key in the console` | No | No | — | API key expired; create a new key in the console or via programmatic sign-up. | | 403 | -32025 | `key_cap_exhausted` | `API key CU cap exhausted; create a new key in the console` | No | No | — | API key lifetime CU cap used up; create a new key in the console or via programmatic sign-up. | | 503 | -32021 | `auth_unavailable` | `authentication data temporarily unavailable` | No | Yes | Honor Retry-After header (seconds) | Server is temporarily unable to verify keys; this is not an issue with your key. Retry after waiting per Retry-After; **do not recreate the key**. | | 404 | -32600 | `unknown_chain` | `unknown chain` | No | No | — | Check available chains via GET /v1/chains or the list_chains tool; verify URL path. | | 404 | unknown_endpoint | `unknown_endpoint` | `Data API method and path do not match a known operation` | No | No | — | Verify method and URL path against Data API documentation. | | 200 | -32700 | `parse_error` | `parse error` | No | No | — | Verify valid JSON syntax in request body before sending. | | 200 | -32600 | `invalid_request` | `invalid request` | No | No | — | Inspect request structure; verify jsonrpc: '2.0', id, and method fields before resending. | | 200 | -32602 | `invalid_params` | `tracer not allowed` | No | No | — | Adjust method params; check supported tracers and timeout limits for the chain. | | 200 | -32602 | `logs_range_too_large` | `eth_getLogs block range too large: max blocks` | No | No | — | Narrow query block range to within max_logs_block_range indicated in GET /v1/chains. | | 429 | -32005 | `public_rate_limit` | `public request rate limit exceeded` | No | Yes | Honor Retry-After header (seconds) | Wait for the Retry-After header, then retry; or send the request with an API key ([get one](https://blockvectra.com/en/get-api-key/?ref=err-public)). | | 429 | -32005 | `public_pool_busy` | `public chain pool is busy` | No | Yes | Honor Retry-After header or wait a few seconds and retry with backoff | Retry with backoff, or send the request with an API key ([get one](https://blockvectra.com/en/get-api-key/?ref=err-public)). | | 200 | -32601 | `method_not_public` | `Method is not available on the public endpoint` | No | No | — | Use a method the public endpoint supports, or send the request with an API key ([get one](https://blockvectra.com/en/get-api-key/?ref=err-public)). | | 200 | -32601 | `method_not_allowed` | `Method is not available on this chain or has been disabled by policy` | No | No | — | Check methods.allow and methods.deny in GET /v1/chains for supported methods. Transaction sending support is determined by methods.allow in GET /v1/chains. | | 200 | -32601 | `subscription_not_available` | `WebSocket subscription is not offered on this chain` | No | No | — | Check available subscriptions for this chain via GET /v1/chains. | | 200 | -32602 | `logs_filter_required` | `logs subscription requires an address or topic0 (a non-null value in the first topics position)` | No | No | — | Specify an address or a non-null topic0 in the logs filter. | | 200 | -32600 | `batch_too_large` | `batch too large: max calls` | No | No | — | Split batch into smaller batches meeting the max call limit indicated in error data. | | 413 | request_too_large | `request_too_large` | `Data API request body exceeds the size limit` | No | No | — | Reduce request body size. | | 200 | -32000 | `not_found` | `transaction not found` | No | No | — | If newly submitted or mined, wait for propagation and retry; otherwise check block number or hash. | | 200 | -32011 | `state_window` | `historical state is not available beyond the most recent blocks` | No | No | — | Query blocks within state_window_blocks as reported in GET /v1/chains, or use Data API for historical data. | | 200 | -32011 | `range_not_indexed` | `requested history is not completely indexed` | No | No | — | Narrow the requested history to an indexed range; do not retry the same uncovered range unchanged. | | 200 | -32011 | `history_not_ready` | `requested history is not ready` | No | Yes | Wait for indexing to catch up; honor error.data.retry_after_seconds when present | Retry after indexing catches up, waiting error.data.retry_after_seconds when provided. | | 429 | -32005 | `key_rate_limit` | `rate limit exceeded` | No | Yes | Honor Retry-After header (seconds) | Sleep for the duration specified in Retry-After header before retrying, or distribute load. | | 429 | rate_limited | `rate_limited` | `Request rate limit exceeded on API or GET /v1/account (more than 5 requests per second for this key)` | No | Yes | Honor Retry-After header (seconds) | Sleep for duration in Retry-After before retrying. | | 429 | -32005 | `concurrency_limit` | `rate limit exceeded` | No | Yes | Honor Retry-After header or wait for active calls to complete | Limit client concurrency pool size and retry completed slots. | | 429 | -32005 | `free_plan_call_limit` | `rate limit exceeded` | No | Yes | Wait 1 second before retrying | Throttle request rate or top up to unlock paid tier throughput. | | 429 | -32022 | `request_exceeds_burst` | `request cost CU exceeds burst capacity CU` | No | No | — | Waiting will not succeed; split batch or lower method parameters to fit within burst capacity. | | 429 | -32022 | `free_plan_batch_too_large` | `request has calls, exceeding the free-plan limit of calls per second` | No | No | — | Waiting will not succeed; split batch so call count is within free-plan limit, or top up. | | 429 | -32005 | `ws_connection_limit` | `WebSocket connection limit reached for this key or account` | No | No | — | Close an unused WebSocket connection or reuse an existing connection. | | 200 | -32022 | `subscription_limit` | `WebSocket subscription limit reached for this connection` | No | No | — | Unsubscribe an existing subscription or open another connection. | | 200 | -32005 | `ws_filter_capacity` | `WebSocket logs filters are at capacity` | No | No | — | Unsubscribe an existing logs subscription or use a narrower filter. | | 200 | -32026 | `ws_push_overloaded` | `WebSocket notification queue is overloaded` | No | Yes | Retry later with backoff, or reconnect | Retry eth_subscribe with exponential backoff, or reconnect. Existing subscriptions continue receiving notifications. | | 200 | -32005 | `overloaded` | `service overloaded, retry later` | No | Yes | Wait a few seconds and retry with exponential backoff | Back off with jitter and retry request. | | 402 | -32020 | `balance_exhausted` | `Insufficient balance (when balance is known, error.data includes balance_units and balance_cu)` | No | No | — | Top up on-chain: get your deposit address from the Console or `GET /v1/topup/deposit-address` (MCP `get_deposit_address`); see the [agent top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/), or use quota reset in console if eligible. When balance is known, error.data carries balance_units (negative when overdrawn) and balance_cu. | | 402 | -32020 | `free_grant_exhausted` | `Free grant exhausted (when balance is known, error.data includes balance_units and balance_cu)` | No | No | — | Top up on-chain: get your deposit address from the Console or `GET /v1/topup/deposit-address` (MCP `get_deposit_address`); see the [agent top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/), use quota reset if available, or wait for next cycle grant. When balance is known, error.data carries balance_units (negative when overdrawn) and balance_cu. | | 503 | -32021 | `billing_unavailable` | `billing data temporarily unavailable` | No | Yes | Honor Retry-After header (seconds) | This is not a balance issue; newly created keys sync within seconds. Wait for Retry-After and retry. | | 200 | -32010 | `node_syncing` | `node is syncing; calls are temporarily unavailable` | No | Yes | Wait a few seconds and retry | Wait for node synchronization to finish, or check GET /v1/status. | | 200 | -32603 | `upstream_unavailable` | `upstream unavailable` | No | Yes | Wait a few seconds and retry | Retry with exponential backoff; check GET /v1/status for node health. | | 504 | 504 | `upstream_timeout` | `Upstream service did not answer within the time limit` | No | Yes | Retry after a brief delay | Retry the request with exponential backoff. | | 200 | -32000 | `response_too_large` | `upstream response too large` | No | No | — | Narrow query parameters (e.g. reduce block range in eth_getLogs or request smaller traces). | | 200 | -32603 | `internal_error` | `internal service error` | No | No | — | Retry request; report persistent failures with timestamp to support. | | 200 | 4444 | — | `pruned history unavailable` | No | No | — | Block is outside the node's pruned history window; query historical blocks via Data API. | | 200 | -32000 | — | `historical state ... is not available; old data not available due to pruning...; missing trie node ...` | No | No | — | Query blocks within the state window, or use Data API for historical queries. | | 200 | -32002 | — | `` | No | Yes | Wait a few seconds and retry with a smaller batch | Reduce the number of calls in the batch and retry. | | 200 | -32003 | — | `` | No | No | — | Split batch into smaller requests to reduce response payload size. | | 200 | -32601 | — | `` | No | No | — | Check methods.allow and methods.deny in GET /v1/chains for supported methods. Transaction sending support is determined by methods.allow in GET /v1/chains. | | 200 | -32603 | — | `` | No | Yes | Retry after a brief delay | Retry request; report persistent failures with timestamp to support. | | 200 | -32600 | — | `` | No | No | — | Inspect individual requests in the batch for non-compliant parameters; split and retry. | | 200 | * | — | `` | Yes | No | — | Node performed computation and was billed. Inspect revert reason/data or call parameters; do not blindly retry. | | 408 | 408 | — | `Request timed out after 35s between request header completion and response` | Possible | Yes | Wait a few seconds before retrying read calls | Calls may have reached node and could be billed. For read calls, retry with backoff. For write calls (e.g. eth_sendRawTransaction), check transaction status by hash first. | ### WebSocket Close Codes WebSocket connection close codes and recommended client actions. | Code | Reason | Meaning | Retryable | Wait Time (Retry-After) | Agent Action | | --- | --- | --- | --- | --- | --- | | 1001 | — | `idle` | Yes | Reconnect as needed | Reconnect as needed. | | 1003 | — | `binary frames are not accepted` | No | — | Do not reconnect automatically; send UTF-8 text frames only. | | 1009 | — | `message too large` | No | — | Do not reconnect automatically; split large requests to stay under 1 MiB. | | 1012 | — | `service restart` | Yes | Reconnect with jittered backoff | Reconnect with jittered backoff, re-subscribe, and backfill missed data. | | 1013 | — | `chain unavailable; overloaded` | Yes | Reconnect with exponential full-jitter backoff | Reconnect with exponential full-jitter backoff, re-subscribe, and backfill missed data. | | 4402 | — | `insufficient balance` | No | — | Do not reconnect automatically; top up on-chain: get your deposit address from the Console or `GET /v1/topup/deposit-address` (MCP `get_deposit_address`); see the [agent top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/), or use quota reset in console if eligible. | | 4404 | — | `invalid api key` | No | — | Do not reconnect automatically; verify or rotate API key in console. | | 4408 | — | `The service closes a session whose push queue passes 512 KiB (524,288 bytes) and drops pending notifications; clients may not receive a close frame (browser reports 1006); treat unexpected disconnects like 4408.` | Yes | Reconnect with backoff; subscribe to less or read faster | Clients should treat an unexpected drop (no close frame received, browser reports 1006) like 4408: reconnect with backoff, re-establish subscriptions, and backfill dropped data with eth_getLogs; subscribe to less, or read faster. | | 4429 | — | `push rate exceeded` | Yes | Reconnect with backoff or reduce subscriptions | Reduce subscriptions or reconnect with backoff. | | 4503 | — | `billing unavailable` | Yes | Reconnect with exponential full-jitter backoff | Reconnect with exponential full-jitter backoff and re-subscribe. | ### Data API Errors Errors returned by the Blockchain Data API endpoints under /v1/data/{chain}/. | HTTP | Code | Reason | Meaning | Billed | Retryable | Wait Time (Retry-After) | Agent Action | | --- | --- | --- | --- | --- | --- | --- | --- | | 400 | bad_request | — | `Duplicate query parameter, invalid query string, or malformed request` | No | No | — | Inspect query parameters; ensure parameters like limit appear at most once and query parameters are valid. | | 409 | not_indexed_yet | — | `Requested block number or window is above as_of_block, or hash resolves above as_of_block (carries indexed_through unless chain has no indexed blocks)` | No | Yes | Wait a few seconds until indexed_through reaches the block | Poll until the requested block or to_block is at or below indexed_through, or wait for the chain to start writing blocks. | | 409 | window_too_large | — | `Block window spans more than 100,000 blocks and clamp parameter was not set to true` | No | No | — | Narrow block range (from_block to to_block) <= 100,000 blocks, or pass clamp=true. | | 409 | too_many_pools | — | `Token matches more than 200 liquidity pools; query by pool dimension instead` | No | No | — | Query by specific pool address rather than querying all pools for the token. | | 409 | span_exceeded | — | `Requested date span exceeds the 90-day maximum limit` | No | No | — | Narrow date range between from_time and to_time to within 90 days. | | 422 | no_coverage | — | `Capability not supported on this chain, or requested block is before the coverage window` | No | No | — | Check `features` and `coverage.from_block` in GET /v1/data/chains (or `data_features` in the free GET /v1/status) before querying. | | 503 | unavailable | — | `Data service temporarily unavailable` | No | Yes | Wait a few seconds and retry with exponential backoff | Retry after a brief delay with exponential backoff. | | 402 | insufficient_balance | — | `Paid balance or free grant exhausted (when balance is known, error.data includes balance_units and balance_cu)` | No | No | — | Top up on-chain: get your deposit address from the Console or `GET /v1/topup/deposit-address` (MCP `get_deposit_address`); see the [agent top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/), or wait for the free allowance to refill. | | 429 | cost_exceeds_burst | — | `A single request costs more than the key's burst capacity` | No | No | — | Split the request into smaller ones; retrying it as sent never succeeds. | | 503 | gateway_overloaded | — | `Data API capacity is temporarily unavailable` | No | Yes | Retry-After: 1 second | Reduce concurrent requests across this account's keys and chains; wait Retry-After before retrying. error.data.reason is null. | ### Console, Account & Faucet API Errors Errors returned by the management, key provisioning, authentication, and faucet endpoints under /v1/. | HTTP | Code | Reason | Meaning | Billed | Retryable | Wait Time (Retry-After) | Agent Action | | --- | --- | --- | --- | --- | --- | --- | --- | | 409 | topup_disabled | — | `Top-up paused or no available networks for top-up at this time; new addresses cannot be allocated, but existing allocated addresses remain assigned to the account` | No | No | — | Check top-up availability via GET /v1/topup/status; retry later when top-up is enabled. | | 503 | deposit_unavailable | — | `Unable to allocate a deposit address temporarily; retry per Retry-After header` | No | Yes | Honor Retry-After header (seconds) and use exponential backoff | Retry per the Retry-After header with exponential backoff. | | 400 | invalid_request | `invalid_username` | `Username exceeds 64 Unicode characters after trimming, or contains a control character (Cc) or lone surrogate (Cs)` | No | No | — | Surrounding whitespace is trimmed, and an empty result is treated as null. Otherwise use at most 64 Unicode characters without control characters (Cc) or lone surrogates (Cs). | | 400 | invalid_request | `expires_at` | `Key expiration time is not in the future or exceeds the maximum allowed key validity period` | No | No | — | Set expires_at to a future RFC 3339 timestamp within the allowed validity period (default 365 days), or use expires_in_secs. | | 400 | invalid_request | `cu_cap` | `The cu_cap parameter is out of bounds (must be an integer between 1 and 9007199254740991)` | No | No | — | Adjust cu_cap to be an integer between 1 and 9007199254740991 or omit it for unlimited CU. | | 400 | siwe_invalid | `expired` | `Sign-In with Ethereum (SIWE) message has expired or nonce was already used` | No | Yes | Fetch a new challenge immediately and sign | Request a fresh challenge from /v1/auth/siwe/challenge and sign the newly issued statement. | | 400 | siwe_invalid | `chain_mismatch` | `SIWE message chainId does not match server settings` | No | No | — | Use the chainId returned by /v1/auth/siwe/challenge when constructing the SIWE message. | | 400 | siwe_invalid | `domain_mismatch` | `SIWE message domain does not match server host` | No | No | — | Ensure domain and uri match the server host returned in challenge. | | 400 | siwe_invalid | `signature` | `SIWE cryptographic signature verification failed` | No | No | — | Verify that the message was signed by the private key corresponding to the specified address. | | 409 | key_limit_reached | `active_keys` | `Unrevoked, unexpired API keys (including disabled keys) reached maximum account limit` | No | No | — | Revoke an existing unused key before creating a new key. | | 409 | no_reset_available | `nothing_to_reset` | `Balance is already at or above the reset target; reset opportunity is preserved` | No | No | — | No reset needed currently; use reset opportunity after balance is depleted. | | 429 | rate_limited | `daily_creations` | `Account 24-hour key creation limit reached` | No | Yes | Honor Retry-After header (seconds) | Honor Retry-After and wait for creation quota to become available; rotation uses the same quota. | | 429 | signup_rate_limited | `per_ip` | `Sign-up rate limit reached for the client IP subnet` | No | Yes | Honor Retry-After header (seconds) | Wait for the Retry-After interval before creating a new account from this network. | | 429 | signup_rate_limited | `global` | `Global new user registration rate limit reached across all sources` | No | Yes | Honor Retry-After header (seconds) | Wait for the Retry-After interval before retrying account creation. | | 400 | oauth_invalid | — | `OAuth parameter invalid or callback state unknown, expired, or already used` | No | Yes | — | Initiate a fresh OAuth login flow from /v1/auth/{provider}/start. | | 400 | login_code_invalid | — | `Login code unknown, expired, already consumed, or PKCE verifier mismatch` | No | No | — | Restart login to obtain a fresh login code. | | 401 | unauthenticated | — | `Missing session, or session token is invalid, expired, or revoked; on top-up API (/v1/topup/*), this also occurs when Authorization header contains a non-Bearer or invalid token instead of x-api-key` | No | No | — | Sign in again to acquire a new Bearer session token; on top-up API, use x-api-key request header instead of Authorization header to pass API key. | | 403 | user_disabled | — | `Account has been suspended by administration` | No | No | — | Contact contact@blockvectra.com for account support. | | 404 | provider_disabled | — | `OAuth provider is recognized but currently disabled` | No | No | — | Use SIWE or another supported authentication provider. | | 409 | identity_in_use | — | `Identity (wallet or OAuth account) is already bound to another user` | No | No | — | Unbind the identity from the previous account or use a different identity. | | 409 | identity_limit_reached | — | `Maximum number of linked identities (5) reached for this account` | No | No | — | Unbind an unnecessary identity before linking a new one. | | 409 | last_identity | — | `Cannot unbind the sole remaining identity from the account` | No | No | — | Bind another identity first before removing this one. | | 409 | key_not_active | — | `Attempted to rotate an API key that is disabled, revoked, or expired` | No | No | — | Create a new key or rotate an active key. | | 409 | no_reset_available | — | `No quota reset opportunities remain on this account` | No | No | — | Top up on-chain: get your deposit address from the Console or `GET /v1/topup/deposit-address` (MCP `get_deposit_address`); see the [agent top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/), or wait for the next promotion cycle. | | 413 | payload_too_large | — | `Request body exceeds the 64 KiB size limit` | No | No | — | Reduce request body size below 64 KiB. | | 503 | signup_paused | — | `Global new user registrations are temporarily paused; existing logins unaffected` | No | Yes | Retry registration later | New user sign-ups temporarily paused; check status and try again later. | | 503 | usage_unavailable | — | `Usage reporting service is temporarily unavailable` | No | Yes | Wait a few seconds and retry | Only affects /usage endpoint; other endpoints work normally. Retry shortly. | | 500 | internal | — | `Unexpected server error` | No | Yes | Retry after a brief delay | Retry request with exponential backoff. | | 400 | invalid_address | `invalid_address` | `Recipient address format or checksum is invalid` | No | No | — | Use 0x followed by 40 hexadecimal characters, lowercase or EIP-55 checksummed; check data.field (/address). | | 503 | faucet_empty | `faucet_empty` | `The faucet has insufficient funds for the claim and transaction fee` | No | Yes | Honor Retry-After header (seconds) | Wait for Retry-After before retrying; do not assume test ETH has been sent without an accepted response. | | 503 | service_unavailable | `service_unavailable` | `Faucet claim processing is temporarily unavailable, or a previous claim has no receipt yet` | No | Yes | Honor Retry-After header (seconds) | Wait for Retry-After before retrying; do not assume test ETH has been sent without an accepted response. | ### Push API Errors Errors from webhook subscription management and event history under /v1/push/. | HTTP | Code | Reason | Meaning | Billed | Retryable | Wait Time (Retry-After) | Agent Action | | --- | --- | --- | --- | --- | --- | --- | --- | | 400 | invalid_request | — | `Invalid request fields, addresses, pagination or block range.` | No | No | — | Inspect data.field and data.invalid; correct the request. | | 401 | missing_api_key | — | `Missing x-api-key.` | No | No | — | Supply your API key in x-api-key. | | 401 | invalid_api_key | — | `Unknown, disabled or revoked API key.` | No | No | — | Use an active key from your account. | | 402 | insufficient_balance | — | `Balance or free allowance exhausted for event history.` | No | No | — | Inspect data.reason (balance_exhausted or free_grant_exhausted) and data.balance_units / data.balance_cu when present; top up via data.topup_url or data.deposit_address_url. | | 403 | key_cap_exhausted | — | `API key CU cap exhausted for event history.` | No | No | — | Inspect data.cu_cap and create a new key in the console. | | 403 | key_expired | — | `API key has expired.` | No | No | — | Use an unexpired key from your account. | | 404 | not_found | — | `Route, method or subscription not found.` | No | No | — | Check the path, method and subscription ownership. | | 409 | limit_reached | — | `Account subscription or address-pair limit reached.` | No | No | — | Inspect data.limit and data.max; reduce subscriptions or addresses. | | 413 | request_too_large | — | `Request body exceeds the route limit.` | No | No | — | Split the address batch or reduce the body size. | | 422 | chain_not_available | — | `Chain unavailable for push or absent from the subscription.` | No | No | — | Check GET /v1/push/chains and the subscription chains. | | 422 | chains_required | — | `At least one chain is required.` | No | No | — | Provide a nonempty chains object; use offline status to stop listening. | | 422 | confirmations_out_of_range | — | `Confirmation depth outside the chain range.` | No | No | — | Choose confirmations within data.min and data.max. | | 422 | destination_not_allowed | — | `Receiving URL is not allowed.` | No | No | — | Inspect data.rule; use an HTTPS hostname on port 443 without userinfo or fragment. | | 422 | block_out_of_range | — | `Block range outside available replay or history coverage.` | No | No | — | Use data.min_block and data.max_block to adjust the range. | | 429 | cost_exceeds_burst | — | `History request cost exceeds key burst capacity.` | No | No | — | Inspect data.reason (request_exceeds_burst) and data.max; increase burst capacity before retrying. Retrying unchanged does not help. | | 429 | rate_limited | — | `Management or history query rate limit reached.` | No | Yes | Wait the seconds in Retry-After. | For history, inspect data.reason (key_rate_limit or free_plan_call_limit); wait Retry-After seconds and reduce request frequency or concurrency. | | 500 | internal_error | — | `Unexpected service error.` | No | No | — | Keep x-bv-request-id and contact support. | | 503 | auth_unavailable | — | `API key validation temporarily unavailable.` | No | Yes | Wait the seconds in Retry-After. | Wait Retry-After seconds before retrying. | | 503 | billing_unavailable | — | `History billing state temporarily unavailable.` | No | Yes | Wait the seconds in Retry-After. | Wait Retry-After seconds before retrying. | | 503 | upstream_unavailable | — | `Push service temporarily unreachable.` | No | Yes | Wait the seconds in Retry-After. | Wait Retry-After seconds before retrying. | | 503 | service_unavailable | — | `Push service or address capacity temporarily unavailable.` | No | Yes | Wait the seconds in Retry-After. | Wait Retry-After seconds before retrying. | For Webhook subscription or replay errors, follow the [Push delivery recovery guide](https://docs.blockvectra.com/en/guides/webhook-push/#delivery-retries-and-replay). Receiver integration starts with [raw-body signature verification](https://docs.blockvectra.com/en/guides/webhook-push/#verify-signatures); the [stablecoin payment example](https://docs.blockvectra.com/en/guides/stablecoin-payments/#receive-payments-with-webhooks) adds event deduplication, receipt checks, gap backfill and reorg reconciliation. See [billing rules](https://docs.blockvectra.com/en/guides/billing-rules/#webhook-push-billing) for metering and [WebSocket reconnection](https://docs.blockvectra.com/en/guides/websocket-subscriptions/#reconnection-and-exponential-backoff) for connection-based subscriptions. For `logs_range_too_large`, check the [eth\_getLogs method parameters](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getLogs/) and follow the [block range limit and chunked queries guide](https://docs.blockvectra.com/en/guides/getlogs-block-range/). For faucet claims on Robinhood Chain, see the [testnet faucet guide](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/) for eligibility and handling of shared error codes. When debugging parameter encoding for [eth\_estimateGas](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_estimateGas/) or [eth\_call](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_call/), encode Quantity and Data as described in [EIP-1474 value encoding](https://eips.ethereum.org/EIPS/eip-1474#value-encoding): do not use JavaScript `Number` for large integers, never catch an encoding failure and default it to zero, and read the actual returned code, reason and HTTP status before classifying it — invalid params is not automatically a slippage or retry/backoff condition. --- # Blockchain RPC and docs MCP for Agent frameworks Source: https://docs.blockvectra.com/en/guides/agent-frameworks/ Configure blockchain RPC in LangChain, ElizaOS, viem, wagmi or Coinbase AgentKit using the recipes below; LangChain, ElizaOS and Coinbase AgentKit each have their own page with runnable code. Developers and AI Agents can first use [docs MCP](https://docs.blockvectra.com/en/guides/mcp-server/) to discover methods and documentation, then follow the separate [HTTP sign-up flow](https://docs.blockvectra.com/en/guides/programmatic-signup/) to create an API key. Use that key in RPC and Data API requests or in the MCP client's `x-api-key` header for keyed tools; keyless RPC access is limited to each chain's `public.methods`. ## Read documentation with an SDK For a first documentation lookup without a model, wallet or BlockVectra API key, use the standalone examples from this fixed checkout: ```bash git clone https://github.com/blockvectra/agent-quickstart.git cd agent-quickstart git checkout --detach c4c0d5c81c5518add7f0f204a77f42934d183588 ``` ### Python / OpenAI Agents SDK With Python 3.12+ and [uv](https://docs.astral.sh/uv/), run from the checkout root: ```bash uv run examples/openai_agents_docs.py ``` The [example](https://github.com/blockvectra/agent-quickstart/blob/c4c0d5c81c5518add7f0f204a77f42934d183588/examples/openai_agents_docs.py) pins `openai-agents==0.24.0` and `mcp==2.3.0`. It calls the SDK-managed MCP server directly without running an `Agent` or `Runner`; tracing is disabled. ### Node.js / mcp-use With Node.js 22.22.2+, run from the checkout root: ```bash cd examples/mcp-use-docs npm ci --ignore-scripts npm start ``` The [standalone example](https://github.com/blockvectra/agent-quickstart/tree/c4c0d5c81c5518add7f0f204a77f42934d183588/examples/mcp-use-docs) pins `@mcp-use/client` to 2.4.5, includes a dependency lockfile, and disables SDK anonymous telemetry before loading the client. Both examples connect to `https://docs.blockvectra.com/mcp/docs`, list its two documentation tools, search for `quickstart` in English and print the returned page. Tool errors or empty results stop the example. Reading the page does not execute its RPC or account instructions. Dependency installation needs network access before the examples start. ## LangChain * Full guide: [Use blockchain RPC in LangChain agents](https://docs.blockvectra.com/en/guides/langchain/) * Official documentation: [LangChain MCP](https://docs.langchain.com/oss/python/langchain/mcp) and [tools](https://docs.langchain.com/oss/python/langchain/tools) A LangChain agent reaches BlockVectra through one `@tool` function that POSTs JSON-RPC to `https://api.blockvectra.com/v1/eth_mainnet/public`, or through `MCPAdapter` pointed at `https://docs.blockvectra.com/mcp`. The guide has the Python and TypeScript code, the keyed variant and the error table. ## ElizaOS * Full guide: [Use blockchain RPC in ElizaOS agents](https://docs.blockvectra.com/en/guides/elizaos/) * Official documentation: [elizaOS Documentation](https://elizaos.github.io/eliza/) * Official repository: [elizaos/eliza](https://github.com/elizaos/eliza) ElizaOS reaches EVM chains through `@elizaos/plugin-evm`. Set `EVM_PROVIDER_URL` for Ethereum mainnet and `ETHEREUM_PROVIDER_` for other chains in `.env`, and add `@elizaos/plugin-mcp` to use the docs MCP server. The guide has the full `.env`, character and MCP configuration. ## AgentOS For RPC on Robinhood Chain, set `RPC_ROBINHOOD_URL` in AgentOS. Use BlockVectra's [path-key RPC route](https://docs.blockvectra.com/en/guides/robinhood-chain/#network-information-and-endpoints) without changing AgentOS or adding a proxy. Supply `BLOCKVECTRA_API_KEY` privately in the AgentOS process environment, then set: ```sh # robinhood_mainnet: expected chain ID 4663; remove conflicting "4663"/"robinhood" URL overrides. export RPC_ROBINHOOD_URL="https://api.blockvectra.com/v1/robinhood_mainnet/${BLOCKVECTRA_API_KEY:?Set BLOCKVECTRA_API_KEY privately first}" ``` Start AgentOS from that environment using your usual command. An existing chain-ID or alias entry in `[trading.rpc_urls]` takes priority: remove that override, or update it privately to the same path-key URL. The variable expands in the shell; TOML does not perform this shell expansion. See the [AgentOS URL resolver](https://github.com/use-agent-os/agent-os/blob/4f6e71de2fc7e2361aefdbe97e6f6408ba8fbe0e/src/agentos/trading/chains.py#L153-L169). Treat the full URL as a secret: keep it out of version control, shared logs, screenshots and browser code, and do not use shell tracing (`set -x`) while setting it. AgentOS's LP path can use a separate public log fallback; selecting this URL does not mean all external calls use BlockVectra or verify a trading/LP workflow. The [quickstart example](https://github.com/blockvectra/agent-quickstart/blob/7207087a556c573a5272bbb7e57d1ee37f5d25c2/README.md#url-only-clients-agentos) records the offline checks and their scope. ## viem * Official documentation: [viem Documentation](https://viem.sh/docs/clients/public.html) * Transports reference: [viem HTTP Transport](https://viem.sh/docs/clients/transports/http.html) and [viem WebSocket Transport](https://viem.sh/docs/clients/transports/websocket.html) * Official repository: [wevm/viem](https://github.com/wevm/viem) In viem, configure client transports using `http()` or `webSocket()`. ### HTTP transport with API key ```typescript import { createPublicClient, http } from "viem"; import { mainnet } from "viem/chains"; export const client = createPublicClient({ chain: mainnet, transport: http(`https://api.blockvectra.com/v1/eth_mainnet/${process.env.BLOCKVECTRA_API_KEY}`), }); ``` ### HTTP transport with keyless public endpoint For read requests on permitted public methods without an API key: ```typescript import { createPublicClient, http } from "viem"; import { mainnet } from "viem/chains"; export const publicClient = createPublicClient({ chain: mainnet, transport: http("https://api.blockvectra.com/v1/eth_mainnet/public"), }); ``` ### WebSocket transport WebSocket transport (`webSocket(...)`) is supported on chains with `ws: true` in `GET /v1/chains`, such as on Robinhood Chain (`robinhood_mainnet`): ```typescript import { createPublicClient, webSocket } from "viem"; export const wsClient = createPublicClient({ transport: webSocket(`wss://api.blockvectra.com/v1/robinhood_mainnet/${process.env.BLOCKVECTRA_API_KEY}`), }); ``` For connection parameters and subscription types, see the [WebSocket subscriptions guide](https://docs.blockvectra.com/en/guides/websocket-subscriptions/). ## wagmi * Official documentation: [wagmi createConfig](https://wagmi.sh/core/api/createConfig) and [wagmi HTTP Transport](https://wagmi.sh/core/api/transports/http) * Official repository: [wevm/wagmi](https://github.com/wevm/wagmi) In wagmi, pass the BlockVectra RPC URL to the `transports` map inside `createConfig`. ### Configuration with API key ```typescript import { createConfig, http } from "wagmi"; import { mainnet } from "wagmi/chains"; export const config = createConfig({ chains: [mainnet], transports: { [mainnet.id]: http(`https://api.blockvectra.com/v1/eth_mainnet/${process.env.BLOCKVECTRA_API_KEY}`), }, }); ``` ### Configuration with keyless public endpoint ```typescript import { createConfig, http } from "wagmi"; import { mainnet } from "wagmi/chains"; export const config = createConfig({ chains: [mainnet], transports: { [mainnet.id]: http("https://api.blockvectra.com/v1/eth_mainnet/public"), }, }); ``` ## Coinbase AgentKit * Full guide: [Use blockchain RPC in Coinbase AgentKit agents](https://docs.blockvectra.com/en/guides/coinbase-agentkit/) * Official documentation: [Coinbase AgentKit Documentation](https://docs.cdp.coinbase.com/agentkit/docs/welcome) * Official repository: [coinbase/agentkit](https://github.com/coinbase/agentkit) Coinbase AgentKit sends onchain actions through a wallet provider, and `ViemWalletProvider` wraps a viem `WalletClient` whose transport can be a BlockVectra endpoint. ### Configuration with ViemWalletProvider ```typescript import { AgentKit, ViemWalletProvider } from "@coinbase/agentkit"; import { createWalletClient, http } from "viem"; import { privateKeyToAccount } from "viem/accounts"; import { base } from "viem/chains"; const client = createWalletClient({ account: privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`), chain: base, transport: http("https://api.blockvectra.com/v1/base_mainnet/public"), }); export const agentKit = await AgentKit.from({ walletProvider: new ViemWalletProvider(client) }); ``` For methods outside the chain's `public.methods`, pass the keyed URL `https://api.blockvectra.com/v1/base_mainnet/${process.env.BLOCKVECTRA_API_KEY}` to `http()` as a template string. The guide covers LangChain tool wiring, MCP and errors. ## Remote MCP If your agent connects via the Model Context Protocol (Streamable HTTP MCP), connect to the BlockVectra MCP server endpoint: `https://docs.blockvectra.com/mcp` For client configuration instructions across Claude Code, Cursor, VS Code, Codex, Gemini CLI, OpenAI Responses API, and Windsurf, see [Install in your client](https://docs.blockvectra.com/en/guides/mcp-server/#install-in-your-client) on the BlockVectra MCP server page. ## Next steps * [Connect an AI agent](https://docs.blockvectra.com/en/guides/ai-agents/) to discover endpoints with MCP, llms.txt, and OpenAPI. * [Follow the programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/) to sign up and create an API key with a wallet signature, or [log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create a key. * [Billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) to review Compute Unit (CU) metering, rate limits, and non-billed errors. --- # Pay for RPC with USDC / USDT / USDG: programmatic top-up for AI agents Source: https://docs.blockvectra.com/en/guides/agent-topup/ Developers and AI Agents can top up an RPC and Data API account over HTTP: check open networks and tokens, use an existing API key to retrieve the account's EVM deposit address, then poll credit status after transferring funds. Before funding, check the [pricing page](https://blockvectra.com/en/pricing/) and [estimate RPC and Data API costs from CU weights](https://docs.blockvectra.com/en/guides/reading-cu-pricing/). * **First step:** Run `curl -s https://api.blockvectra.com/v1/topup/status` to check open networks and tokens before transferring funds, and read the dynamic USD minimum from `pricing.min_topup_usd` in `GET https://console-api.blockvectra.com/v1/plans`. * **Done when:** The deposit record for your `tx_hash` has `status: credited`; `credited_units` and `credited_cu` show the credits added to your account. [Agent access options](https://blockvectra.com/en/agents/). ## Get your deposit address in Billing Sign in, [open Billing to get your deposit address](https://console.blockvectra.com/login/?next=%2Fbilling%2F), and use the deposit address and token details shown for your account. Check the current networks and tokens at [GET /v1/topup/status](https://api.blockvectra.com/v1/topup/status), and read the dynamic USD minimum from `pricing.min_topup_usd` in [GET /v1/plans](https://console-api.blockvectra.com/v1/plans), before transferring funds. > **API key security and server-side requirement** > > The `x-api-key` header **can only be called from server-side environments**. Never call top-up endpoints from client-side browser code, and never expose your API key in frontend bundles, public repositories, or AI chat conversations. ## Prerequisites * **Existing API key**: Calling authenticated top-up endpoints requires an active BlockVectra RPC API key. If you do not have an API key yet, follow the [Programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/) to sign up and create a key using an Ethereum wallet signature, or create one in the [Console](https://console.blockvectra.com/login/?next=%2Fkeys%2F). * **On-chain assets**: Your agent environment or funding wallet must hold USDC / USDT / USDG listed by `GET /v1/topup/status` on a supported network, along with sufficient native gas tokens to broadcast transactions. * **Environment variable**: Store your key in the `BLOCKVECTRA_API_KEY` environment variable. The authenticated top-up endpoints accept the `x-api-key` header directly using the same API key used for RPC calls. No browser session is required. ## Four-step top-up workflow Once the first paid top-up is credited, free cycle refills stop, unused free credits remain available, and the account-level call-rate cap is removed; each non-revoked key's CU limits are raised to at least the paid floor and higher custom limits are kept. See the [pricing rules](https://blockvectra.com/en/pricing/) and [free plan rules](https://blockvectra.com/en/free/#rules); read current limits and the minimum top-up from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans) (`free`, `key_defaults`, `paid_key_minimums`, and `pricing.min_topup_usd`). Top-up endpoints (status, deposit address, and deposits) use the production API host: ``` https://api.blockvectra.com ``` Plan limits and pricing parameters are served by the Console API at `https://console-api.blockvectra.com` (such as [GET https://console-api.blockvectra.com/v1/plans](https://console-api.blockvectra.com/v1/plans)). ### 1. Check availability (GET /v1/topup/status) Before initiating a transfer, verify global top-up status and check which networks and tokens are currently open. The USD minimum comes from `pricing.min_topup_usd` in `GET /v1/plans`, not from this endpoint. This endpoint is public and requires no credentials. ```bash curl -s https://api.blockvectra.com/v1/topup/status ``` Example response (selected networks and tokens): ```json { "enabled": true, "networks": [ { "network": "base_mainnet", "chain_id": 8453, "token": "USDC", "enabled": true }, { "network": "bsc_mainnet", "chain_id": 56, "token": "USDT", "enabled": true }, { "network": "bsc_mainnet", "chain_id": 56, "token": "USDC", "enabled": true } ] } ``` * `enabled`: Global switch. If `false`, top-up is closed across all networks. * `networks`: Open status per network and token. When `enabled` is `false` for a network or token, **do not transfer funds on that network**. * `min_deposit_usd`: Secondary USD value (6 decimal places) for cross-checking against `pricing.min_topup_usd` from `GET https://console-api.blockvectra.com/v1/plans`, the authoritative dynamic USD minimum. It is not an alternative source of the minimum. To read the authoritative dynamic USD minimum: ```bash curl -s https://console-api.blockvectra.com/v1/plans | jq -r .pricing.min_topup_usd ``` ### 2. Retrieve deposit address and parameters (GET /v1/topup/deposit-address) Retrieve or allocate the customer EVM deposit address and inspect supported networks and token contracts. This endpoint requires `x-api-key` authentication and must be called from server-side environments only. ```bash curl -s \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ https://api.blockvectra.com/v1/topup/deposit-address ``` Example response (selected networks and tokens): ```json { "address": "0x", "deposits_url": "https://api.blockvectra.com/v1/topup/deposits", "networks": [ { "chain": "base_mainnet", "chain_id": 8453, "name": "Base", "typical_credit_seconds": 30, "explorer_tx_url": "https://basescan.org/tx/{tx_hash}", "tokens": [ { "symbol": "USDC", "contract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "decimals": 6, "min_amount_raw": "1000000" } ] }, { "chain": "bsc_mainnet", "chain_id": 56, "name": "BNB Smart Chain", "typical_credit_seconds": 60, "explorer_tx_url": "https://bscscan.com/tx/{tx_hash}", "tokens": [ { "symbol": "USDT", "contract": "0x55d398326f99059fF775485246999027B3197955", "decimals": 18, "min_amount_raw": "1000000000000000000" }, { "symbol": "USDC", "contract": "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", "decimals": 18, "min_amount_raw": "1000000000000000000" } ] } ] } ``` * `address`: EIP-55 checksummed EVM deposit address dedicated to your account. * `deposits_url`: URL to query customer deposit records. * `networks`: List of open EVM networks. Closed networks are omitted. Includes chain slug `chain`, EVM chain ID `chain_id`, display name `name`, typical credit latency in seconds after block inclusion `typical_credit_seconds`, and block explorer transaction URL template `explorer_tx_url`. * `tokens`: Tokens on this network, including token symbol `symbol` (USDC / USDT / USDG), contract address `contract`, token decimals `decimals`, and minimum deposit amount in raw atomic units `min_amount_raw` (refer to the actual value returned by the endpoint; do not assume a scaled amount). > **Token decimals and amount conversion** > > The same token can have different decimals on different chains (for example, USDT and USDC on BSC are 18 decimals, whereas USDC on Base is 6 decimals). Amount calculation must use the `decimals` returned for that specific network rather than hardcoding a single token decimal value. #### Error responses Authenticated top-up endpoints (`/v1/topup/deposit-address` and `/v1/topup/deposits`) return standard JSON error structures: * **HTTP 401 (Authentication failure)**: Returned when the `x-api-key` header is missing (`missing_api_key`) or the key is invalid, revoked, or disabled (`invalid_api_key`): ```json { "error": { "code": "missing_api_key", "message": "missing API key: send it in the x-api-key header", "data": { "reason": "missing_api_key", "docs_url": "https://docs.blockvectra.com/en/errors/#missing_api_key", "retryable": false } } } ``` * **HTTP 409 (Top-up disabled)**: Returned when top-up is closed globally or across all networks (`topup_disabled`): ```json { "error": { "code": "topup_disabled", "data": { "reason": "topup_disabled", "docs_url": "https://docs.blockvectra.com/en/errors/#topup_disabled", "retryable": false } } } ``` For the complete list of error codes, see the [Errors Reference](https://docs.blockvectra.com/en/errors/). ### 3. Broadcast on-chain transfer Using your agent's wallet or script, submit an ERC-20 `transfer` transaction to the deposit `address` retrieved in Step 2. Transfer requirements: * Send only tokens and contracts listed in the `tokens` array for that network. * Compare the transfer amount and the selected token's returned `min_amount_raw` in the same raw atomic units; the transfer must be greater than or equal to that minimum. Use the token's `decimals` when displaying human-readable amounts. `pricing.min_topup_usd` from `GET /v1/plans` is the authoritative global USD policy (`min_deposit_usd` from `GET /v1/topup/status` is only a secondary cross-check), not token atomic quantities, and cannot be compared directly with raw integers. Read the current policy and token minimum before broadcasting; example amounts are illustrative. * Before broadcasting, read this run's `GET /v1/plans`, `GET /v1/topup/status` and `GET /v1/topup/deposit-address` responses and confirm that top-up is enabled, the network and token are open, and `contract`, `decimals`, `min_amount_raw` and your account's deposit `address` are all present and consistent. If any value is missing, closed or contradictory, stop and do not broadcast. `pricing.min_topup_usd` is the dynamic USD policy; any older fixed minimum is not authoritative, and `$1` is only an example amount, not a minimum. Convert the amount to exact integer atomic units with `decimals` and compare it with `min_amount_raw`; do not compare USD directly with token units. The status and address calls in the code samples below only read and print values; they are not the complete pre-broadcast check. * Transfers sent to unsupported chains or with incorrect tokens cannot be credited automatically; verify the network and token contract prior to broadcasting. * Record the on-chain transaction hash (`tx_hash`) once submitted. ### 4. Poll deposit records and verify credit (GET /v1/topup/deposits) After the transaction is included in a block, query deposit transfer history to track crediting status. This endpoint requires `x-api-key` and is server-side only. #### Query parameters * `limit`: Number of deposit records to return per page. Default is `20`, valid range is `1`–`100`. * `before`: Cursor pagination parameter based on `deposit_id`. Pass the `next_before` value from the previous page response to fetch the next page of earlier records. * `tx_hash`: Optional 0x-prefixed 64-character hexadecimal transaction hash to filter for a specific transfer. Filter by transaction hash (`tx_hash`) to inspect your specific transfer: ```bash curl -s \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ "https://api.blockvectra.com/v1/topup/deposits?tx_hash=0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890" ``` Example response: ```json { "items": [ { "deposit_id": 42, "chain": "base_mainnet", "chain_id": 8453, "token": "USDC", "contract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "amount": "25.000000", "tx_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", "tx_log_ordinal": 0, "block_number": 123456789, "external_ref": "eip155:8453:0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890:0", "status": "credited", "reason": null, "credited_units": 250000, "credited_cu": 250000000, "detected_at": "2026-10-02T10:00:00Z" } ], "next_before": null } ``` * `items`: Array of deposit records matching the query parameters. * `next_before`: The `deposit_id` of the last item when the page is full (the number of items equals `limit`), otherwise `null`. A full last page still returns a cursor; requesting it returns an empty page with `next_before: null`. Stop paging when `next_before` is `null`. Combine with the `before` query parameter for cursor-based pagination. Deposit `status` values: * `processing`: Transfer detected on-chain, crediting in progress. * `credited`: Credited to the account balance. `credited_units` and `credited_cu` indicate the credited amounts. * `not_credited`: Transfer cannot be credited. The `reason` field indicates the cause: * `below_minimum`: Deposit amount is below the minimum threshold. * `large_amount`: Deposit amount exceeds threshold and requires manual review. * `other`: Other crediting exception. Credit latency and polling guidance: * **Arrival and crediting time**: Credit time is governed by the `typical_credit_seconds` returned in Step 2. * **Polling interval**: Poll at a recommended interval of **every 20–60 seconds**, not more frequently, to avoid triggering rate limits. ## Code examples The following examples demonstrate how to read `BLOCKVECTRA_API_KEY` from the environment and query top-up endpoints in Node.js and Python. ### Node.js (fetch) ```javascript import process from "node:process"; const apiKey = process.env.BLOCKVECTRA_API_KEY; if (!apiKey) { throw new Error("Missing BLOCKVECTRA_API_KEY environment variable"); } const BASE_URL = "https://api.blockvectra.com"; // 1. Check availability; status min_deposit_usd is a secondary cross-check (USD minimum authority: GET /v1/plans pricing.min_topup_usd) const statusRes = await fetch(`${BASE_URL}/v1/topup/status`); const status = await statusRes.json(); if (!status.enabled) { throw new Error("Top-up is currently disabled"); } const minDepositUsd = status.min_deposit_usd; console.log("Status min_deposit_usd (secondary, USD):", minDepositUsd); // 2. Retrieve deposit address and open networks const addressRes = await fetch(`${BASE_URL}/v1/topup/deposit-address`, { headers: { "x-api-key": apiKey }, }); if (addressRes.status === 401) { throw new Error("Missing or invalid API key (HTTP 401)"); } if (addressRes.status === 409) { throw new Error("Top-up is disabled (topup_disabled)"); } if (!addressRes.ok) { throw new Error(`Failed to retrieve deposit address: ${addressRes.status}`); } const depositData = await addressRes.json(); console.log("Deposit address:", depositData.address); console.log("Open networks count:", depositData.networks.length); // 3. Poll deposit status async function checkDepositStatus(txHash) { const url = new URL(`${BASE_URL}/v1/topup/deposits`); url.searchParams.set("tx_hash", txHash); const res = await fetch(url, { headers: { "x-api-key": apiKey }, }); if (res.status === 401) { throw new Error("Missing or invalid API key (HTTP 401)"); } if (!res.ok) { throw new Error(`Failed to query deposits: ${res.status}`); } return res.json(); } ``` ### Python (requests) ```python # pip install requests import os import requests api_key = os.environ.get("BLOCKVECTRA_API_KEY") if not api_key: raise ValueError("Missing BLOCKVECTRA_API_KEY environment variable") base_url = "https://api.blockvectra.com" # 1. Check availability; status min_deposit_usd is a secondary cross-check (USD minimum authority: GET /v1/plans pricing.min_topup_usd) resp = requests.get(f"{base_url}/v1/topup/status", timeout=10) resp.raise_for_status() status_data = resp.json() if not status_data.get("enabled"): raise RuntimeError("Top-up is currently disabled") min_deposit_usd = status_data.get("min_deposit_usd") print("Status min_deposit_usd (secondary, USD):", min_deposit_usd) # 2. Retrieve deposit address resp = requests.get( f"{base_url}/v1/topup/deposit-address", headers={"x-api-key": api_key}, timeout=10, ) if resp.status_code == 401: raise RuntimeError("Missing or invalid API key (HTTP 401)") if resp.status_code == 409: raise RuntimeError("Top-up is disabled (topup_disabled)") resp.raise_for_status() deposit_data = resp.json() print("Deposit address:", deposit_data["address"]) # 3. Poll deposit status def check_deposit_status(tx_hash: str): resp = requests.get( f"{base_url}/v1/topup/deposits", headers={"x-api-key": api_key}, params={"tx_hash": tx_hash}, timeout=10, ) if resp.status_code == 401: raise RuntimeError("Missing or invalid API key (HTTP 401)") resp.raise_for_status() return resp.json() ``` ## Next steps * [Query balance (`GET /v1/account`)](https://docs.blockvectra.com/en/guides/billing-rules/#query-balance-get-v1account) to verify your account balance and remaining Compute Units (CU). * [Billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) to review Compute Unit (CU) metering, rate limits, and non-billed errors. * [Free plan guide](https://docs.blockvectra.com/en/guides/free-plan/) to review free tier limits and upgrade rules. * [Programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/) to create accounts and provision API keys using wallet signatures. --- # Blockchain RPC and docs MCP for AI Agents Source: https://docs.blockvectra.com/en/guides/ai-agents/ Start with the keyless [docs MCP endpoint](https://docs.blockvectra.com/mcp) to discover blockchain RPC methods, Data API datasets, prices and documentation. AI Agents are first-class users: developers and AI Agents use the same APIs, rules, limits and prices. ## Connecting from MCP clients For Claude Code, add the docs MCP server: ```bash claude mcp add --transport http blockvectra-docs https://docs.blockvectra.com/mcp ``` In your client, ask for these two keyless tool calls in order: discover the chain, then read the quickstart. Neither step needs an account, wallet or API key. ```text Call list_chains with chain=robinhood_mainnet. Then call read_doc with path=quickstart and lang=en. ``` Success means `list_chains` returns `robinhood_mainnet` and `read_doc` returns the quickstart body; registering the tools or seeing them listed does not confirm a successful call. If installation or connection fails, see [Install in your client](https://docs.blockvectra.com/en/guides/mcp-server/#install-in-your-client) for configuration, headers and troubleshooting. For a known chain, pass its exact name as `chain` to `list_chains`; otherwise use `list_chains` to discover it. For other tasks, use `search_docs`, then pass a matching page's `path` to `read_doc`. Continue with the account setup below only for RPC, Data API or account tasks that require authentication. 1. **Discover**: use docs MCP, `llms.txt`, OpenAPI and public JSON to choose a chain and method. Keyless RPC calls are limited to the chain's `public.methods`. 2. **Open an account over HTTP**: follow [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/) to sign in with a wallet signature and create an API key. MCP's `how_to_get_api_key` returns instructions for this separate HTTP flow. 3. **Call data APIs**: keep the key in `BLOCKVECTRA_API_KEY` and use it for authenticated RPC or Data API requests. For keyed MCP tools, configure the client's `x-api-key` header; each tool's allowed operations are listed below. ## 1. Machine-readable context and specifications BlockVectra publishes files aimed at LLM agents and developer tools: ### llms.txt indexes Following the [llmstxt.org](https://llmstxt.org) convention, these files give agents a structured summary of the site and its endpoints: * **Main site index**: [Main site llms.txt](https://blockvectra.com/llms.txt) — overview of the main site, supported chains, pricing, and public APIs. * **Documentation index**: [Documentation llms.txt](https://docs.blockvectra.com/llms.txt) — catalog of every documentation page with its title and description. ### Full documentation file (`llms-full.txt`) * **Complete documentation**: [llms-full.txt](https://docs.blockvectra.com/llms-full.txt) — the full text of every English documentation page in one plain-text Markdown file, suitable for loading into an agent's system prompt or ingesting into a Retrieval-Augmented Generation (RAG) pipeline. ### Downloadable OpenAPI 3.1 specifications The documentation site serves OpenAPI 3.1 YAML files that can be imported directly into agent frameworks, tool generators, or API clients: * **JSON-RPC API specification**: [/openapi/json-rpc.yaml](https://docs.blockvectra.com/openapi/json-rpc.yaml) — supported methods, per-chain method policy, error responses, and Compute Unit metering. * **Data API specification**: [/openapi/data.yaml](https://docs.blockvectra.com/openapi/data.yaml) — REST endpoint definitions for indexed blocks, transactions, transfers, balances, holders, and related datasets. * **Push API specification**: [/openapi/push.yaml](https://docs.blockvectra.com/openapi/push.yaml) — HTTP subscription management, watched wallet addresses, webhook events, signatures and replay. For wallet address activity, follow the [Blockchain Webhook API guide](https://docs.blockvectra.com/en/guides/webhook-push/). For ERC-20 USDT / USDC payment notifications, use the [payment receiver example](https://docs.blockvectra.com/en/guides/stablecoin-payments/#receive-payments-with-webhooks). Developers and AI agents create and manage subscriptions through the HTTP Push API with `x-api-key`; the docs MCP provides discovery and reading of these guides. For path versioning, backward compatibility rules, and recommendations for agents and SDK authors, see [API versioning and compatibility](https://docs.blockvectra.com/en/api/versioning/). For ready-to-use recipes across popular frameworks (ElizaOS, viem, wagmi, Coinbase AgentKit), see [Agent framework recipes](https://docs.blockvectra.com/en/guides/agent-frameworks/). ### Model Context Protocol (MCP) server BlockVectra exposes a stateless MCP server over Streamable HTTP at the [MCP endpoint](https://docs.blockvectra.com/mcp); connecting needs no key. It offers 15 tools: documentation, chains, status and pricing tools work without a key, and keyed tools read `x-api-key` from the client's headers. Keys never go through tool arguments. The tool list, key requirements, FAQ and per-client install steps (Claude Code, Cursor, VS Code, Codex, Gemini CLI, OpenAI Responses API, Windsurf) are on the [BlockVectra MCP server](https://docs.blockvectra.com/en/guides/mcp-server/) page. ### One API integration If your agent already works through [One](https://www.withone.ai/knowledge/block-vectra), you can pick BlockVectra actions from its public API catalog, such as daily DEX token prices. For a direct MCP connection, use the client setup above instead. Authentication uses your own BlockVectra key, sent as `x-api-key`; see [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/) to get one. Keep the key in One's private connection settings, never in an agent prompt or action parameter. For a price action, give the chain, token, quote and UTC date explicitly. Treat the response's freshness and coverage as the source of truth: a missing or empty daily price is not a price of zero. Request parameters are in the [Data API reference](https://docs.blockvectra.com/en/api/data/). ## 2. Public JSON endpoints (no key required) An agent can inspect available chains, live status, and plan parameters before sending any metered request. None of these endpoints needs an API key: * `GET /v1/status` and `GET /v1/chains` are unauthenticated and unbilled. * `GET /v1/plans` is public and unauthenticated. All three send `Access-Control-Allow-Origin: *`. ### Service status (`GET /v1/status`) Returns the service's readiness and the synchronization status of each public chain: ```bash curl -s "https://api.blockvectra.com/v1/status" ``` Response fields: * `checked_at`: when the snapshot was generated (RFC 3339 / ISO 8601 UTC). * `gateway.status`: service running status. `ok` means the service is ready; `degraded` means paid requests are rejected until it recovers. This value is independent of any chain's node status. * `chains[]`: the chains served to the public: * `chain`: chain slug (e.g. `robinhood_mainnet`). * `name`: human-readable display name. * `chain_id`: EIP-155 chain ID (decimal integer). * `jsonrpc`: whether JSON-RPC is served. * `data`: whether the Data API is served. * `data_features`: Data API capabilities available for this chain (an empty array when `data` is `false`). * `data_status`: Data API running status (`ok`, `syncing`, or `unavailable`; present only when `data` is `true`). * `status`: chain node status (`ok` or `unavailable`). * `head`: latest block information — `block` (latest block height), `time` (block timestamp), and `lag_seconds` (how far the block time lags the current time) — or `null` when unknown. Example response: ```json { "checked_at": "2026-09-28T12:00:00Z", "gateway": { "status": "ok" }, "chains": [ { "chain": "robinhood_mainnet", "name": "Robinhood Chain", "chain_id": 4663, "jsonrpc": true, "data": true, "data_features": [ "blocks", "transactions", "address_transactions", "transfers", "token_metadata", "freshness" ], "status": "ok", "head": { "block": 73017329, "time": "2026-09-28T11:59:58Z", "lag_seconds": 2 } } ] } ``` ### Chain parameters (`GET /v1/chains`) Returns each public chain's static parameters and method policy: ```bash curl -s "https://api.blockvectra.com/v1/chains" ``` Response fields: * `chains[]`: public chains and their static parameters: * `chain`: chain slug. * `name`: human-readable display name. * `chain_id`: EIP-155 chain ID. * `jsonrpc`: whether JSON-RPC is served. * `data`: whether the Data API is served. * `ws`: whether WebSocket connections are supported. * `subscriptions`: supported WebSocket subscription types (e.g. `newHeads`, `logs`). * `methods`: method policy: * `allow`: allowed method names (e.g. `eth_call`, `debug_traceTransaction`). * `deny`: denied methods or prefix wildcard patterns (e.g. `eth_newFilter`). Denied methods take precedence over allowed ones. * `max_logs_block_range`: maximum block span allowed in a single `eth_getLogs` request. * `state_window_blocks`: historical state window in blocks; `null` when the full history is available. * `info`: per-chain public extension data (reserved; currently an empty object `{}`). * `public`: unauthenticated public endpoint configuration. Only chains offering public JSON-RPC include this object; other chains omit the field: * `url`: base URL for public requests. * `methods`: methods permitted on the public endpoint. * `rate_limit`: rate limits (`per_ip_rps`, `burst`, `batch_max`). * `history_blocks`: block history accessible on the public endpoint. * `send_raw_rate_limit`: rate limits for broadcasting transactions via `eth_sendRawTransaction`. Example response: ```json { "chains": [ { "chain": "robinhood_mainnet", "name": "Robinhood Chain", "chain_id": 4663, "jsonrpc": true, "data": true, "ws": true, "subscriptions": [ "newHeads", "logs" ], "methods": { "allow": [ "eth_blockNumber", "eth_call", "eth_chainId", "debug_traceTransaction" ], "deny": [ "eth_newFilter", "eth_newBlockFilter", "eth_newPendingTransactionFilter", "eth_getFilterLogs", "eth_getFilterChanges", "eth_uninstallFilter", "eth_subscribe", "eth_unsubscribe" ] }, "max_logs_block_range": 1000, "state_window_blocks": 900, "info": {}, "public": { "url": "https://api.blockvectra.com/v1/robinhood_mainnet/public", "methods": [ "eth_chainId", "net_version", "eth_blockNumber", "eth_call" ], "rate_limit": { "per_ip_rps": 3, "burst": 20, "batch_max": 10 }, "history_blocks": 128, "send_raw_rate_limit": { "per_ip_rps": 1, "burst": 3 } } } ] } ``` ### Plans and method weights (`GET /v1/plans`) Plan parameters are served at `GET https://console-api.blockvectra.com/v1/plans`. An agent can query this endpoint at runtime to read the active free-plan limits and the Compute Unit (CU) weight of each method: * `free`: Free Plan parameters — `signup_units` (sign-up grant, in units), `monthly_units` (cycle refill watermark, in units), `window_days` (usage cycle length in days), and `max_calls_per_sec` (free-plan per-second call cap). * `pricing`: paid-plan parameters — `units_per_usd` (units per 1 USD), `cu_per_unit` (CU per unit), and `min_topup_usd` (minimum top-up in USD). * `method_weights`: per-call CU weights, each `{ "method": string, "cu_weight": number }`. `method` specifies the JSON-RPC method name or pattern, default weights for unlisted methods, or a Data API operation such as `data.`. Weights are per method and are not split by chain. ## 3. Authentication and key security Agents that issue RPC calls must follow these rules: * **Authentication**: pass the API key in one of three ways. In the path: `POST /v1/{chain}/{api_key}` — the path form uses only the key in the path and ignores both headers. In the `x-api-key` header: `POST /v1/{chain}` with `x-api-key: $BLOCKVECTRA_API_KEY`. In the `Authorization` header: `POST /v1/{chain}` with `Authorization: Bearer $BLOCKVECTRA_API_KEY`. When both headers are present, a non-empty `x-api-key` wins; Bearer is used only when `x-api-key` is missing or empty. The same key works on every supported chain, and on the Data API (which accepts the key only in the `x-api-key` header). * **Key security**: keep API keys in server-side environment variables (for example `BLOCKVECTRA_API_KEY`) or a secrets manager. Never embed a key in browser code or any client-side bundle. Endpoints do return `Access-Control-Allow-Origin: *`, but they are meant to be called by backend services rather than from the browser. * **Metering and upgrades**: usage is metered in Compute Units (CU): each method consumes CU according to its weight, and balance, CU buckets, and free-plan rate limits are shared across all chains. After a paid top-up, the free plan's per-second call cap no longer applies; each key still has a CU rate limit and burst capacity. Unused Free Credits stay in your Credits and can still be used. See the [Pricing page](https://blockvectra.com/en/pricing/) for details. > **No API key yet?** > > If you have an Ethereum wallet: follow the [Programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/) to sign up and create an API key using an Ethereum wallet signature without a browser. An agent's identity is its wallet: if a session token or key is lost, [re-authenticate with the same wallet to recover it](https://docs.blockvectra.com/en/guides/programmatic-signup/#lost-your-session-or-api-key). If you do not have a wallet: ask the user to sign in at [console.blockvectra.com](https://console.blockvectra.com/login/?next=%2Fkeys%2F), create a key, and set it as the environment variable `BLOCKVECTRA_API_KEY`. Do not ask the user to paste the key into the chat. ### Query balance (`GET /v1/account`) An agent can check its key's current balance, CU limits, and key parameters directly without consuming Compute Units (CU). For the request format, rate limits, and full response field definitions, see [Query balance: GET /v1/account](https://docs.blockvectra.com/en/guides/billing-rules/#query-balance-get-v1account). ## 4. Chain selection workflow for agents Before dispatching calls, an agent can follow these steps: 1. **Check the chain and its method policy**: call `GET /v1/chains`, confirm that the target chain exists and has `jsonrpc: true`, and that the method you plan to call is allowed by `methods.allow` and not denied by `methods.deny` (deny wins). 2. **Check live status**: call `GET /v1/status` and confirm that `gateway.status` is `ok` and that the target chain's `status` is `ok`; use `head.lag_seconds` to decide whether the chain's data is fresh enough for your use case. When a chain's node is not synced, every method except `eth_chainId` returns JSON-RPC error `-32010` (HTTP 200, not billed), so the agent can wait and retry or pick another chain. 3. **Send the request**: `POST /v1/{chain}` with the `x-api-key` header and a standard JSON-RPC body. ## 5. Minimal working example The example below reads `/v1/chains` to pick a chain that allows `eth_blockNumber`, checks `/v1/status`, and then calls `eth_blockNumber` once. The examples exit with an error on non-2xx HTTP, invalid JSON, or JSON-RPC errors. They print success only for version `2.0`, integer `id: 1`, no `error` key, and a canonical hex quantity in `result` (including `0x0`). The cURL example requires `python3`. **cURL** ```bash set -eu export BLOCKVECTRA_API_KEY="rgw_your_api_key" # Reject every non-2xx status, including redirects. request() { response=$(curl -fsS -w '\n%{http_code}' "$@") || return "$?" case "${response##*$'\n'}" in 2[0-9][0-9]) printf '%s' "${response%$'\n'*}" ;; *) return 1 ;; esac } chains=$(request "https://api.blockvectra.com/v1/chains") status=$(request "https://api.blockvectra.com/v1/status") # Select an allowed chain and check readiness before the RPC call. chain=$(CHAINS="$chains" STATUS="$status" python3 - <<'PYTHON' import json import os def matches(pattern, method): return pattern == method or (pattern.endswith("*") and method.startswith(pattern[:-1])) selected = next(( c for c in json.loads(os.environ["CHAINS"])["chains"] if c["jsonrpc"] and not any(matches(p, "eth_blockNumber") for p in c["methods"]["deny"]) and any(matches(p, "eth_blockNumber") for p in c["methods"]["allow"]) ), None) if selected is None: raise RuntimeError("No chain found that allows eth_blockNumber") status = json.loads(os.environ["STATUS"]) chain_status = next((c for c in status["chains"] if c["chain"] == selected["chain"]), None) if status["gateway"]["status"] != "ok" or chain_status is None or chain_status["status"] != "ok": raise RuntimeError("Selected chain is currently unavailable") print(selected["chain"]) PYTHON ) default_endpoint="https://api.blockvectra.com/v1/robinhood_mainnet" rpc_response=$(request "${default_endpoint%/*}/$chain" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -H "x-bv-meter: 1" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') RPC_RESPONSE="$rpc_response" python3 - <<'PYTHON' import json import os import re rpc_response = json.loads(os.environ["RPC_RESPONSE"]) if ( not isinstance(rpc_response, dict) or rpc_response.get("jsonrpc") != "2.0" or type(rpc_response.get("id")) is not int or rpc_response["id"] != 1 or "error" in rpc_response or "result" not in rpc_response or not isinstance(rpc_response["result"], str) or re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)", rpc_response["result"]) is None ): raise RuntimeError("Invalid eth_blockNumber response") print("Response:", rpc_response) PYTHON ``` **TypeScript** ```typescript const apiKey = process.env.BLOCKVECTRA_API_KEY; if (!apiKey) { throw new Error("Missing BLOCKVECTRA_API_KEY"); } type ChainFacts = { chain: string; jsonrpc: boolean; methods: { allow: string[]; deny: string[] }; }; function matches(pattern: string, method: string): boolean { if (pattern === "*") return true; if (pattern.endsWith("*")) return method.startsWith(pattern.slice(0, -1)); return pattern === method; } // 1. Fetch the public chain directory const chainsRes = await fetch("https://api.blockvectra.com/v1/chains", { redirect: "manual" }); if (!chainsRes.ok) throw new Error(`Chain directory HTTP ${chainsRes.status}`); const { chains } = (await chainsRes.json()) as { chains: ChainFacts[] }; // 2. Select a chain that serves JSON-RPC and allows eth_blockNumber const selected = chains.find( (chain) => chain.jsonrpc && !chain.methods.deny.some((pattern) => matches(pattern, "eth_blockNumber")) && chain.methods.allow.some((pattern) => matches(pattern, "eth_blockNumber")), ); if (!selected) { throw new Error("No chain found that allows eth_blockNumber"); } // 3. Confirm the service and the selected chain are ready const statusRes = await fetch("https://api.blockvectra.com/v1/status", { redirect: "manual" }); if (!statusRes.ok) throw new Error(`Status HTTP ${statusRes.status}`); const status = await statusRes.json(); const chainStatus = status.chains?.find( (chain: { chain: string }) => chain.chain === selected.chain, ); if (status.gateway?.status !== "ok" || chainStatus?.status !== "ok") { throw new Error(`Chain ${selected.chain} is currently unavailable`); } // 4. Call eth_blockNumber on the selected chain const defaultEndpoint = "https://api.blockvectra.com/v1/robinhood_mainnet"; const rpcUrl = `${defaultEndpoint.slice(0, defaultEndpoint.lastIndexOf("/"))}/${selected.chain}`; const rpcRes = await fetch(rpcUrl, { method: "POST", redirect: "manual", headers: { "Content-Type": "application/json", "x-api-key": apiKey, "x-bv-meter": "1", }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_blockNumber", params: [], }), }); if (!rpcRes.ok) throw new Error(`RPC HTTP ${rpcRes.status}`); const rpcResponse: unknown = await rpcRes.json(); if ( typeof rpcResponse !== "object" || rpcResponse === null || Array.isArray(rpcResponse) || !("jsonrpc" in rpcResponse) || rpcResponse.jsonrpc !== "2.0" || !("id" in rpcResponse) || rpcResponse.id !== 1 || "error" in rpcResponse || !("result" in rpcResponse) || typeof rpcResponse.result !== "string" || rpcResponse.result.match(/^0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)$/)?.[0] !== rpcResponse.result ) { throw new Error("Invalid eth_blockNumber response"); } console.log("Response:", rpcResponse); ``` **Python** ```python import os import re import requests api_key = os.environ["BLOCKVECTRA_API_KEY"] def matches(pattern: str, method: str) -> bool: if pattern == "*": return True if pattern.endswith("*"): return method.startswith(pattern[:-1]) return pattern == method # 1. Fetch the public chain directory def read_json(response): response.raise_for_status() if not 200 <= response.status_code < 300: raise RuntimeError(f"Unexpected HTTP {response.status_code}") return response.json() chains = read_json(requests.get("https://api.blockvectra.com/v1/chains", allow_redirects=False))["chains"] # 2. Select a chain that serves JSON-RPC and allows eth_blockNumber selected = next( ( chain for chain in chains if chain["jsonrpc"] and not any(matches(p, "eth_blockNumber") for p in chain["methods"]["deny"]) and any(matches(p, "eth_blockNumber") for p in chain["methods"]["allow"]) ), None, ) if selected is None: raise RuntimeError("No chain found that allows eth_blockNumber") # 3. Confirm the service and the selected chain are ready status = read_json(requests.get("https://api.blockvectra.com/v1/status", allow_redirects=False)) chain_status = next( (c for c in status["chains"] if c["chain"] == selected["chain"]), None, ) if ( status["gateway"]["status"] != "ok" or chain_status is None or chain_status["status"] != "ok" ): raise RuntimeError(f"Chain {selected['chain']} is currently unavailable") # 4. Call eth_blockNumber on the selected chain default_endpoint = "https://api.blockvectra.com/v1/robinhood_mainnet" rpc_url = f"{default_endpoint.rsplit('/', 1)[0]}/{selected['chain']}" rpc_response = read_json(requests.post( rpc_url, allow_redirects=False, headers={ "Content-Type": "application/json", "x-api-key": api_key, "x-bv-meter": "1", }, json={"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}, )) if ( not isinstance(rpc_response, dict) or rpc_response.get("jsonrpc") != "2.0" or type(rpc_response.get("id")) is not int or rpc_response["id"] != 1 or "error" in rpc_response or "result" not in rpc_response or not isinstance(rpc_response["result"], str) or re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)", rpc_response["result"]) is None ): raise RuntimeError("Invalid eth_blockNumber response") print("Response:", rpc_response) ``` A successful call returns a standard JSON-RPC response object: ```json { "jsonrpc": "2.0", "id": 1, "result": "0x45a27f1" } ``` To inspect per-request CU charges and remaining balance units in response headers, include `x-bv-meter: 1`. For header behavior and error cases, see [Charge and balance response headers](https://docs.blockvectra.com/en/guides/billing-rules/#http-status-codes-and-billing-rules). ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Follow the programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/) to sign up and create an API key with a wallet signature, or [log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create a key. --- # BlockVectra as an Alchemy Alternative: Method Prices and Free Log Queries Source: https://docs.blockvectra.com/en/guides/alchemy-alternative/ BlockVectra supports authenticated HyperEVM log queries of up to 1,000 blocks and publishes eth\_call at $1.50 per million calls before available free credits; validate your chain and complete result before migration. ## Comparison Competitor figures as of 2026-10-08. BlockVectra method weights, free-plan and key limits come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans) and log ranges from [GET /v1/chains](https://api.blockvectra.com/v1/chains); current figures are rendered by the components below. | Metric | Alchemy | BlockVectra | Sources | | -------------------------------------- | -------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `eth_call`, per million calls | 26 Alchemy CU/call; $13.65 | Current `eth_call` USD price in the method table below | [Pricing](https://www.alchemy.com/pricing), [method weights](https://www.alchemy.com/docs/reference/compute-unit-costs), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | | `eth_getLogs`, per million calls | 60 Alchemy CU/call; $31.50 | Current `eth_getLogs` USD price below | [Pricing](https://www.alchemy.com/pricing), [method weights](https://www.alchemy.com/docs/reference/compute-unit-costs), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | | `eth_blockNumber`, per million calls | 10 Alchemy CU/call; $5.25 | Current `eth_blockNumber` USD price below | [Pricing](https://www.alchemy.com/pricing), [method weights](https://www.alchemy.com/docs/reference/compute-unit-costs), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | | Free-account HyperEVM Mainnet log span | 10 blocks/query | 1,000 blocks/query, authenticated | [Log ranges](https://www.alchemy.com/docs/chains/ethereum/ethereum-api-endpoints/eth-get-logs), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | Alchemy prices use `$0.525 per million CU × method CU per call`, before free credits and throughput add-ons. Its free allowance is 30M Alchemy CU/month. Provider CU are different units; compare USD per identical completed request. The log-span row compares free accounts only; response size and event density still affect query completion. ## Why choose BlockVectra ### Method prices and free-account budget Method weights, USD conversion and the free-account budget below come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans). Chain limits come from [GET /v1/chains](https://api.blockvectra.com/v1/chains). Compare the same chain, method, block and complete result; splitting and retries change the number of calls. **Active Conversion Parameters** 1 USD = 10,000 billing units, 1 billing unit = 1,000 CU (1 USD = 10,000,000 CU). **Formula**: CU weight × 1,000,000 ÷ (10,000 × 1,000) USD. | Method | CU per call | Price per 1M calls (USD) | | --- | --- | --- | | `eth_blockNumber` | 1 | $0.10 | | `eth_call` | 15 | $1.50 | | `eth_getLogs` | 30 | $3.00 | | `debug_traceTransaction` | 100 | $10.00 | | `data.block` | 5 | $0.50 | Self-service Push supports up to 1,000,000 addresses per subscription. For 10,000,000 / 100,000,000 addresses per subscription, [contact us to enable capacity](https://blockvectra.com/en/contact/). **BlockVectra task costs and request rates** Free new-key default budget: 100 CU/s. | Method | Example calls | CU per call | Task cost (USD) | Requests/s from key CU budget | | --- | --- | --- | --- | --- | | `eth_call` | 1,000,000 | 15 | $1.50 | 6 | | `eth_getLogs` | 100,000 | 30 | $0.30 | 3 | Task costs are list prices before free credits, gas and additional services. Request rates equal key_defaults.cu_per_sec ÷ method CU and assume only that method uses the key. Free-account caps and other traffic can reduce the usable rate; these figures are budget conversions, not measured throughput. [Current weights, prices and key limits: GET /v1/plans.](https://console-api.blockvectra.com/v1/plans) The Free Plan requires registering an account and using an API key; all keys under an account share an average of 25 calls per second (short bursts allowed). At the end of each 30-day cycle, balances below 30,000,000 CU are refilled to 30,000,000 CU. | Method | CU Weight | Approx Calls / Cycle | Approx / Day | List Price / 1M Calls | | --- | --- | --- | --- | --- | | `eth_blockNumber` | 1 | 30,000,000 | 1,000,000 | $0.10 | | `eth_getBlockByNumber` | 5 | 6,000,000 | 200,000 | $0.50 | | `eth_getBalance` | 10 | 3,000,000 | 100,000 | $1.00 | | `eth_call` | 15 | 2,000,000 | 66,666 | $1.50 | | `eth_getLogs` | 30 | 1,000,000 | 33,333 | $3.00 | | `debug_traceTransaction` | 100 | 300,000 | 10,000 | $10.00 | | `data.block` | 5 | 6,000,000 | 200,000 | $0.50 | | `data.address_balances` | 25 | 1,200,000 | 40,000 | $2.50 | | `data.dex_prices` | 15 | 2,000,000 | 66,666 | $1.50 | | `data.transaction_trace` | 200 | 150,000 | 5,000 | $20.00 | Free-account cap: up to 25 calls per second, shared across all keys in the account, all chains, and the Data API. Per-key `key_defaults.cu_per_sec` and `burst_cu` also apply. Eligible cycle refills top the free balance up to the target rather than adding a full grant. The first paid top-up stops cycle refills while preserving remaining free CU. See [free plan rules](https://docs.blockvectra.com/en/guides/free-plan/). ### Free-account log queries Use the authenticated HyperEVM span above to query more blocks per request within your available free CU. Save the last completed block and split dense intervals when necessary. Check [log range and recovery](https://docs.blockvectra.com/en/guides/getlogs-block-range/) for chunking and deduplication. ### Keyless trials and programmatic Agent funding Try a listed `public.methods` method at the chain catalog's `public.url` before creating a key. For authenticated access, [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/) lets an Agent create an account and key with a wallet signature. [Agent top-ups](https://docs.blockvectra.com/en/guides/agent-topup/) fund the same usage balance with stablecoins; read networks, tokens and minimums from [top-up status](https://api.blockvectra.com/v1/topup/status). Developers and AI Agents use the same prices and limits. ### Multi-chain address Push Watch the same address set across several supported chains in one subscription, with one HTTPS receiver. This suits wallet activity and payment notifications without maintaining a socket per chain. See [self-service and enterprise address capacity](https://docs.blockvectra.com/en/guides/webhook-push/#address-capacity); [contact us](https://blockvectra.com/en/contact/) to enable enterprise capacity. Address-day and delivered-event charges are separate from RPC calls and are listed in [Push pricing](https://docs.blockvectra.com/en/guides/webhook-push/#billing-and-example). RPC on Robinhood Chain and HyperEVM is listed in the [chain catalog](https://api.blockvectra.com/v1/chains). Check methods and Push support per network; use the [chain-specific starter guide](https://docs.blockvectra.com/en/guides/robinhood-chain/) and [HyperEVM backfill guide](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) for the relevant workflow. ## Migration steps 1. **Inventory and coverage:** list chains, methods, fixed blocks, log spans and subscription dependencies. Check `methods.allow`, `methods.deny`, `public.methods`, `state_window_blocks` and `ws` in the [catalog](https://api.blockvectra.com/v1/chains). A null history window is unspecified, not archive coverage. A keyless `public.url` smoke test validates only its listed public methods. 2. **Key and authentication:** obtain a BlockVectra key through the [console](https://console.blockvectra.com/keys/) or [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/). Keep it in your server environment. RPC accepts `POST /v1/{chain}/{api_key}` or `POST /v1/{chain}` with `x-api-key`; Data API uses `x-api-key`. This Ethereum WETH `decimals()` example uses the header: ```bash if [ -z "$BLOCKVECTRA_API_KEY" ]; then echo "Set BLOCKVECTRA_API_KEY in your server environment" exit 1 fi curl --fail-with-body -sS --max-time 15 https://api.blockvectra.com/v1/eth_mainnet \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"to":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2","data":"0x313ce567"},"latest"]}' ``` 3. **Replay before switching:** replace `latest` with the same supported fixed block on both providers and record the block hash. Compare returned values and JSON-RPC `error`, even after HTTP 200. Test representative log queries, bounded retries, rate-limit recovery and cursor resume. Migrate proprietary APIs and subscriptions separately; move traffic after the required results match. ## FAQ ### Does a lower method price mean a lower total task cost? Calculate `max(0, sum(calls × method CU) − available_free_cu) / (pricing.units_per_usd × pricing.cu_per_unit)`. Include splitting, retries and any services your task uses. Existing included credits change incremental costs; compare the complete result rather than billing-unit names. ### Can I migrate by changing the endpoint? For supported standard RPC methods, update the endpoint and path key or `x-api-key` header, then replay fixed-block requests. Check historical state and method coverage first. Proprietary APIs, WebSocket subscriptions and Push receivers need their own migration tests; see [historical state](https://docs.blockvectra.com/en/guides/evm-historical-state/) and [Webhook versus WebSocket](https://docs.blockvectra.com/en/guides/webhook-vs-websocket/). Use [How to choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/) for a workload checklist and self-tests. --- # BlockVectra as an Ankr Alternative: Method-Based EVM Read Pricing Source: https://docs.blockvectra.com/en/guides/ankr-alternative/ BlockVectra prices supported eth\_call reads at 15 CU each; a full 30,000,000-CU free balance can cover 2,000,000 such calls, shared with all other methods and subject to account and key limits. ## Comparison Competitor figures as of 2026-10-08. BlockVectra method weights, free-plan and key limits come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans) and log ranges from [GET /v1/chains](https://api.blockvectra.com/v1/chains); current figures are rendered by the components below. | Metric | Ankr | BlockVectra | Sources | | ---------------------------------------------- | ------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `eth_call`, per million HTTPS EVM calls | 200 API Credits/call; $20 | Current `eth_call` USD price below | [Request pricing](https://www.ankr.com/docs/rpc-service/pricing/), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | | `eth_getLogs`, per million HTTPS EVM calls | 200 API Credits/call; $20 | Current `eth_getLogs` USD price below | [Request pricing](https://www.ankr.com/docs/rpc-service/pricing/), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | | `eth_blockNumber`, per million HTTPS EVM calls | 200 API Credits/call; $20 | Current `eth_blockNumber` USD price below | [Request pricing](https://www.ankr.com/docs/rpc-service/pricing/), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | | Free `eth_call` budget, no other traffic | Freemium: 200M API Credits/month ÷ 200 = 1M calls | Current cycle calls in the free-plan table below | [Service plans](https://www.ankr.com/docs/rpc-service/service-plans/), [request pricing](https://www.ankr.com/docs/rpc-service/pricing/), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | Ankr converts $0.10 to 1M API Credits, so its 200-credit HTTPS EVM category costs $0.00002/call. These rates exclude WSS and Advanced API. A free call budget assumes no other methods consume credits; monthly and cycle allowances have their own refill rules, and actual traffic must fit account and key rate limits. ## Why choose BlockVectra ### Method prices and free-account budget Method weights, USD conversion and the free-account budget below come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans). Chain limits come from [GET /v1/chains](https://api.blockvectra.com/v1/chains). Compare the same chain, method, block and complete result; splitting and retries change the number of calls. **Active Conversion Parameters** 1 USD = 10,000 billing units, 1 billing unit = 1,000 CU (1 USD = 10,000,000 CU). **Formula**: CU weight × 1,000,000 ÷ (10,000 × 1,000) USD. | Method | CU per call | Price per 1M calls (USD) | | --- | --- | --- | | `eth_blockNumber` | 1 | $0.10 | | `eth_call` | 15 | $1.50 | | `eth_getLogs` | 30 | $3.00 | | `debug_traceTransaction` | 100 | $10.00 | | `data.block` | 5 | $0.50 | Self-service Push supports up to 1,000,000 addresses per subscription. For 10,000,000 / 100,000,000 addresses per subscription, [contact us to enable capacity](https://blockvectra.com/en/contact/). **BlockVectra task costs and request rates** Free new-key default budget: 100 CU/s. | Method | Example calls | CU per call | Task cost (USD) | Requests/s from key CU budget | | --- | --- | --- | --- | --- | | `eth_call` | 1,000,000 | 15 | $1.50 | 6 | | `eth_getLogs` | 100,000 | 30 | $0.30 | 3 | Task costs are list prices before free credits, gas and additional services. Request rates equal key_defaults.cu_per_sec ÷ method CU and assume only that method uses the key. Free-account caps and other traffic can reduce the usable rate; these figures are budget conversions, not measured throughput. [Current weights, prices and key limits: GET /v1/plans.](https://console-api.blockvectra.com/v1/plans) Free-account cap: up to 25 calls per second, shared across all keys in the account, all chains, and the Data API. Per-key `key_defaults.cu_per_sec` and `burst_cu` also apply. Eligible cycle refills top the free balance up to the target rather than adding a full grant. The first paid top-up stops cycle refills while preserving remaining free CU. See [free plan rules](https://docs.blockvectra.com/en/guides/free-plan/). ### A free budget measured in useful calls The free-plan table gives the calls a full cycle balance can cover when used only for each listed method. Contract reads, log queries and block-number checks draw from the same CU balance: budget each method at the weight in the method-pricing table, then add the costs. Using CU for logs reduces the amount left for contract reads. The Free Plan requires registering an account and using an API key; all keys under an account share an average of 25 calls per second (short bursts allowed). At the end of each 30-day cycle, balances below 30,000,000 CU are refilled to 30,000,000 CU. | Method | CU Weight | Approx Calls / Cycle | Approx / Day | List Price / 1M Calls | | --- | --- | --- | --- | --- | | `eth_blockNumber` | 1 | 30,000,000 | 1,000,000 | $0.10 | | `eth_getBlockByNumber` | 5 | 6,000,000 | 200,000 | $0.50 | | `eth_getBalance` | 10 | 3,000,000 | 100,000 | $1.00 | | `eth_call` | 15 | 2,000,000 | 66,666 | $1.50 | | `eth_getLogs` | 30 | 1,000,000 | 33,333 | $3.00 | | `debug_traceTransaction` | 100 | 300,000 | 10,000 | $10.00 | | `data.block` | 5 | 6,000,000 | 200,000 | $0.50 | | `data.address_balances` | 25 | 1,200,000 | 40,000 | $2.50 | | `data.dex_prices` | 15 | 2,000,000 | 66,666 | $1.50 | | `data.transaction_trace` | 200 | 150,000 | 5,000 | $20.00 | Eligible refills restore the balance to its target rather than adding a full grant. Check your actual remaining CU before a backfill and pace all keys within the shared account cap and per-key limits; the cycle call count is not a guaranteed daily allowance. See [Reading CU pricing](https://docs.blockvectra.com/en/guides/reading-cu-pricing/) for mixed-workload estimates. ### Keyless trials and programmatic Agent funding Try a listed `public.methods` method at the chain catalog's `public.url` before creating a key. For authenticated access, [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/) lets an Agent create an account and key with a wallet signature. [Agent top-ups](https://docs.blockvectra.com/en/guides/agent-topup/) fund the same usage balance with stablecoins; read networks, tokens and minimums from [top-up status](https://api.blockvectra.com/v1/topup/status). Developers and AI Agents use the same prices and limits. ### Multi-chain address Push Watch the same address set across several supported chains in one subscription, with one HTTPS receiver. This suits wallet activity and payment notifications without maintaining a socket per chain. See [self-service and enterprise address capacity](https://docs.blockvectra.com/en/guides/webhook-push/#address-capacity); [contact us](https://blockvectra.com/en/contact/) to enable enterprise capacity. Address-day and delivered-event charges are separate from RPC calls and are listed in [Push pricing](https://docs.blockvectra.com/en/guides/webhook-push/#billing-and-example). RPC on Robinhood Chain and HyperEVM is listed in the [chain catalog](https://api.blockvectra.com/v1/chains). Check methods and Push support per network; use the [chain-specific starter guide](https://docs.blockvectra.com/en/guides/robinhood-chain/) and [HyperEVM backfill guide](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) for the relevant workflow. ## Migration steps 1. **Inventory and coverage:** list chains, methods, fixed blocks, log spans and subscription dependencies. Check `methods.allow`, `methods.deny`, `public.methods`, `state_window_blocks` and `ws` in the [catalog](https://api.blockvectra.com/v1/chains). A null history window is unspecified, not archive coverage. A keyless `public.url` smoke test validates only its listed public methods. 2. **Key and authentication:** obtain a BlockVectra key through the [console](https://console.blockvectra.com/keys/) or [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/). Keep it in your server environment. RPC accepts `POST /v1/{chain}/{api_key}` or `POST /v1/{chain}` with `x-api-key`; Data API uses `x-api-key`. This Ethereum WETH `decimals()` example uses the header: ```bash if [ -z "$BLOCKVECTRA_API_KEY" ]; then echo "Set BLOCKVECTRA_API_KEY in your server environment" exit 1 fi curl --fail-with-body -sS --max-time 15 https://api.blockvectra.com/v1/eth_mainnet \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"to":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2","data":"0x313ce567"},"latest"]}' ``` 3. **Replay before switching:** replace `latest` with the same supported fixed block on both providers and record the block hash. Compare returned values and JSON-RPC `error`, even after HTTP 200. Test representative log queries, bounded retries, rate-limit recovery and cursor resume. Migrate proprietary APIs and subscriptions separately; move traffic after the required results match. ## FAQ ### Does a lower method price mean a lower total task cost? Calculate `max(0, sum(calls × method CU) − available_free_cu) / (pricing.units_per_usd × pricing.cu_per_unit)`. Include splitting, retries and any services your task uses. Existing included credits change incremental costs; compare the complete result rather than billing-unit names. ### Can I migrate by changing the endpoint? For supported standard RPC methods, update the endpoint and path key or `x-api-key` header, then replay fixed-block requests. Check historical state and method coverage first. Proprietary APIs, WebSocket subscriptions and Push receivers need their own migration tests; see [historical state](https://docs.blockvectra.com/en/guides/evm-historical-state/) and [Webhook versus WebSocket](https://docs.blockvectra.com/en/guides/webhook-vs-websocket/). Use [How to choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/) for a workload checklist and self-tests. --- # Base RPC URL: keyless access, curl and viem examples Source: https://docs.blockvectra.com/en/guides/base/ Start with the Base mainnet public RPC URL below to read the chain ID without an API key. Check supported methods and per-IP limits on the [Base chain page](https://blockvectra.com/en/chains/base_mainnet/); use a key for methods outside `public.methods` that the chain allows. ```bash curl -sS "https://api.blockvectra.com/v1/base_mainnet/public" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' ``` ## Network information and endpoints Every request to Base identifies its target network explicitly in the URL path using the slug `base_mainnet`. JSON-RPC supports both path-based key authentication and request header authentication (`x-api-key`). | Parameter / Endpoint | Value / Template | Authentication | |---|---|---| | Chain ID (EIP-155) | `8453` | — | | JSON-RPC (path key) | `POST https://api.blockvectra.com/v1/base_mainnet/{api_key}` | API key in URL path | | JSON-RPC (header key) | `POST https://api.blockvectra.com/v1/base_mainnet` | Header x-api-key: {api_key} | | WebSocket (path key) | `wss://api.blockvectra.com/v1/base_mainnet/{api_key}` | API key in URL path | | WebSocket (header key) | `wss://api.blockvectra.com/v1/base_mainnet` | Header x-api-key: {api_key} or Authorization: Bearer {api_key} | | WebSocket subscriptions | `newHeads, logs` | — | | Data API base | `GET https://api.blockvectra.com/v1/data/base_mainnet/…` | Header x-api-key: {api_key} | | Public status | `GET https://api.blockvectra.com/v1/status` | Unauthenticated (public) | ## Direct curl and viem examples You can make JSON-RPC calls directly using curl or web3 client libraries such as viem. Set your API key in the `BLOCKVECTRA_API_KEY` environment variable: **curl (Header)** Query the EIP-155 chain ID using the `x-api-key` request header: ```bash curl -s "https://api.blockvectra.com/v1/base_mainnet" \ -H "Content-Type: application/json" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' ``` **curl (Path)** Query the latest block number by passing your API key in the URL path: ```bash curl -s "https://api.blockvectra.com/v1/base_mainnet/$BLOCKVECTRA_API_KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' ``` **TypeScript (viem)** Connect using viem's `createPublicClient` and the official `base` chain definition: ```ts import { createPublicClient, http } from "viem"; import { base } from "viem/chains"; const client = createPublicClient({ chain: base, transport: http("https://api.blockvectra.com/v1/base_mainnet", { fetchOptions: { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY!, }, }, }), }); const blockNumber = await client.getBlockNumber(); console.log("Current block number on Base:", blockNumber); ``` You can also pass the key in the transport URL path: ```ts const client = createPublicClient({ chain: base, transport: http(`https://api.blockvectra.com/v1/base_mainnet/${process.env.BLOCKVECTRA_API_KEY}`), }); ``` Complete starter template: [blockvectra/multichain-viem](https://github.com/blockvectra/multichain-viem) ### Response structure Responses adhere to the JSON-RPC 2.0 specification: * **Success**: Returns an object containing `jsonrpc: "2.0"`, matching integer `id`, and hexadecimal-encoded `result` (`eth_chainId` returns the hex-encoded chain ID; `eth_blockNumber` returns the latest block height). * **Disallowed methods**: Requesting a method outside the network's allowed methods returns JSON-RPC error code `-32601` (`method not available`, not billed). * **Out-of-window queries**: Historical state requests earlier than the state retention window return JSON-RPC error code `-32011` (not billed). * **Missing API key**: Omitting the key returns HTTP 401 with JSON-RPC error code `-32024` (`missing_api_key`, not billed). * **Invalid parameters**: Malformed request parameters return JSON-RPC error code `-32602` (not billed). ## Capability and method policy Live values: `GET /v1/chains` (`methods`, `max_logs_block_range`, `state_window_blocks`). ### Network parameters and limits - **eth_getLogs block range**: Max 1000 blocks per request - **Historical state window**: Recent 10000 blocks (queries beyond return -32011) - **Execution tracing (debug_trace*)**: Not available Per-chain allowed methods: [Supported Chains](https://docs.blockvectra.com/en/chains/) ## Blockchain Data API Live values: `GET /v1/chains` (`data`). ### Blockchain Data API status - **Available**: Blockchain Data API is available on Base. Browse supported datasets in the datasets directory. [Browse datasets directory](https://blockvectra.com/en/data/) ### Find direct calls to a contract, then fetch receipts To list transactions sent directly to your contract in a fixed block range and read their receipts, page through the address transactions endpoint, then call `eth_getTransactionReceipt` for each returned hash. Both bounds are inclusive, so a 200-block range is `TO_BLOCK = FROM_BLOCK + 199`. ```bash export CONTRACT=0x... # your contract address export FROM_BLOCK=... # range start (inclusive) export TO_BLOCK=... # range end (inclusive) curl -sS "https://api.blockvectra.com/v1/data/base_mainnet/addresses/$CONTRACT/transactions?from_block=$FROM_BLOCK&to_block=$TO_BLOCK&direction=to&limit=500" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` 1. Each item in `data` has a `hash`. If the top-level `next_cursor` is present, repeat the request with the same query plus `&cursor=`, passing the cursor back unchanged. Stop when `next_cursor` is absent. A page can hold fewer than `limit` rows, or none, while `next_cursor` is still present. 2. Check `meta.coverage` on every page. `partial` means the range was clamped or starts before this dataset's indexed start, so the list does not cover the whole range. An empty list is not proof that the range had no calls. 3. Fetch each receipt from the same chain with the same key. `hash` already starts with `0x`; put the complete value from `data` into `TX_HASH` unchanged, without adding another `0x`: ```bash curl -sS "https://api.blockvectra.com/v1/base_mainnet" \ -H "Content-Type: application/json" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getTransactionReceipt\",\"params\":[\"$TX_HASH\"]}" ``` Handle errors by layer: * Data API: `409 not_indexed_yet` means the range is above the indexed head, so retry later or add `clamp=true`, which truncates `to_block` down to the indexed head and returns `meta.coverage = "partial"` (a clamped result no longer covers your original fixed range; if `from_block` itself is above the indexed head, `clamp=true` still returns 409); `409 window_too_large` means the range exceeds 100,000 blocks; `422 no_coverage` means the range is outside the dataset; `503 unavailable` carries `Retry-After`, so wait at least that many seconds and retry with the same cursor. * JSON-RPC: an HTTP error or an `error` object in the body is a failed call. `"result": null` means no receipt was returned for that hash, not success; retry later or check the hash. A non-null receipt does not mean the transaction succeeded: `status` `0x1` is success and `0x0` means it reverted. This lists only top-level transactions whose `to` is the contract. It does not include events, internal calls or transactions that reach the contract through another contract. Supported methods and ranges come from `GET /v1/chains` and the actual response. For pagination and event queries, see [eth\_getLogs vs Token Transfers API](https://docs.blockvectra.com/en/guides/logs-vs-transfers/). ## Getting started and API keys New accounts get 30,000,000 CU on sign-up — no credit card. * **Web console**: Sign up via Ethereum wallet signature, and generate an API key in the [Console](https://console.blockvectra.com/login/?next=%2Fkeys%2F). See the [Quickstart guide](https://docs.blockvectra.com/en/quickstart/) for setup details. * **Programmatic sign-up**: Autonomous AI agents, automated scripts, and CI pipelines can sign in and provision API keys using Ethereum wallet signatures (EIP-191) without a browser. Follow the [Programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/). * **AI agents**: Autonomous AI agents can discover Base capabilities using the official Model Context Protocol (MCP) server. See [Connecting AI Agents to BlockVectra](https://docs.blockvectra.com/en/guides/ai-agents/). * **Upgrading limits**: After topping up, the account-wide calls-per-second limit is removed; each key remains subject to Compute Unit (CU) rate and burst limits. For current rates and billing units, see the [Pricing page](https://blockvectra.com/en/pricing/). ## Related guides and resources * **Base developer documentation**: For network specifications, gas mechanics, and contracts on Base, see the official [Base documentation](https://docs.base.org). * **Wallet custom RPC**: Configure custom RPC endpoints for Base in MetaMask and Rabby using the [Wallet Custom RPC guide](https://docs.blockvectra.com/en/guides/wallet-custom-rpc/). * **Transaction simulation**: Test transaction execution and evaluate state changes before broadcasting using `eth_simulateV1` in the [Simulate Transactions guide](https://docs.blockvectra.com/en/guides/simulate-transactions/). ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # What is not billed: error codes and billing rules Source: https://docs.blockvectra.com/en/guides/billing-rules/ BlockVectra meters requests in Compute Units (CU). JSON-RPC and Data API calls are billed only after a response is obtained. This guide summarizes the billing determination rules across HTTP status codes, JSON-RPC calls, and the Data API, along with recommended actions for developers. ## HTTP status codes and billing rules The billing determination and handling rules for HTTP-level responses are as follows: The method rows below apply to ordinary HTTP requests to `/v1/{chain}` and `/v1/{chain}/{api_key}`, not named routes such as `/v1/chains`. A valid WebSocket upgrade follows the WebSocket capability and authentication checks instead of the plain GET/HEAD rules. | HTTP Status | Response Body | Scenario | Billed? | Recommended Action | | ----------: | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 200 | JSON-RPC response (single or batch) | Normal response; all JSON-RPC layer errors (parse error, method rejection, upstream failure, node error) are also 200 | Evaluated per call | Inspect `result` or `error` for each call; if an error is returned, see JSON-RPC error handling below | | 204 | Empty | All calls in the request are notifications | Notifications are billed as normal | No extra action required | | 204 | Empty | `OPTIONS` preflight, for either a known or unknown chain | No | Send the JSON-RPC request with `POST` | | 400 | Empty | Malformed HTTP message (cannot parse request line or headers, invalid chunked encoding), or more than 10 s between two reads of the request body | No | Check HTTP request syntax, headers, and transmission continuity | | 402 | JSON, `-32020` | Insufficient balance, allowance exhausted; when balance is known, `error.data` includes `balance_units` and `balance_cu` | No | Check your balance on the Console [billing page](https://console.blockvectra.com/billing/) or via `GET /v1/topup/deposit-address` (MCP `get_deposit_address`); top up on-chain to your account's dedicated address (see the [Agent top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/)) | | 403 | Empty | Methods other than `POST`, `OPTIONS`, `GET`, or `HEAD` on these RPC routes (regardless of whether the chain name is known) | No | Change the HTTP request method to `POST` | | 405 | Plain `GET`: JSON-RPC `-32600`, `error.data.reason: method_not_allowed`; `HEAD`: empty body. Both include `Allow: POST` | Plain `GET` or `HEAD` to a known, public chain, before key checks; also applies when the chain does not support WebSocket | No | Use `POST` for JSON-RPC | | 401 | JSON, `-32024` (`missing_api_key` or `invalid_api_key`) | Missing key on known chain, key unknown or disabled | No | Provide an active API key in `x-api-key` header (brand-new or rotated keys take a few seconds to take effect; wait a moment and retry) | | 404 | `POST`/`GET`: JSON-RPC `-32600` (`error.data.reason: unknown_chain`); `HEAD`: empty body, without `Allow` | `POST`, `GET`, or `HEAD` to an unknown or not-public `{chain}`, before key checks | No | Check the chain name in the URL against [Supported Chains](https://docs.blockvectra.com/en/chains/) (must be exact lowercase slug) | | 404 | empty body | Unmatched path (e.g. `POST /v1`, `/v1/`, `POST /v1/{chain}/`) | No | Include chain in URL (`/v1/{chain}`) | | 408 | Empty | Exceeded 35 s from reading request headers to returning response | **Possible**: calls already forwarded to the node are billed as normal once the node responds | Do not unconditionally retry state-changing calls (e.g. `eth_sendRawTransaction`); a client disconnect does not cancel calls already forwarded | | 413 | Empty | Request body > 2 MiB (2,097,152 bytes; see “10. Limits at a glance” in the [full OpenAPI reference](https://docs.blockvectra.com/en/api/json-rpc/reference/)) | No | Keep request body under 2 MiB; split batches into smaller requests | | 414 / 431 | Empty | URI too long (414) or request headers too large (431) | No | Shorten request URI or trim HTTP request headers | | 429 | JSON, `-32005` or `-32022`; carries `Retry-After` for rate limits (`-32005`); burst/batch size limits (`-32022`) do not carry it | Bucket balance depleted → `-32005`; single request CU exceeds burst capacity → `-32022`; account call rate limit depleted → `-32005`; calls in single request exceed limit → `-32022` | No | For `-32005` with `Retry-After`, wait the specified seconds before retrying; for `-32022`, split the request or reduce batch size (retrying as-is will never succeed) | | 503 | JSON, `-32021`, with `Retry-After` | Billing data temporarily unavailable; server temporarily rejects request (not a balance issue, no need to top up); newly created keys return this until billing data syncs (usually a few seconds) | No | Not a balance issue, no need to top up; wait the seconds specified in `Retry-After` and retry | > Note: When accessed through Cloudflare, Cloudflare may return 52x or 1015 error pages; these are not generated by the service. > **Charge and balance response headers**: When sending `x-bv-meter: 1` on HTTP requests (applicable to both JSON-RPC and Data API), a response that billed at least one call returns `x-bv-cu-charged` (the Compute Units billed for this request, or the sum across billed calls of a batch) and `x-bv-balance-units` (the account's remaining balance units right after this charge, negative when overdrawn; omitted if the balance is unknown). Requests without `x-bv-meter: 1`, responses where nothing was billed, and 402, 403, 429, or 503 error responses omit both headers. These response headers are accessible to browser scripts via CORS, while WebSocket does not use them. The balance subtracts total unsettled usage rounded up once to whole units; hourly settlement rounds down, so the reported balance may rise by up to one unit after settlement. ## JSON-RPC error codes and billing rules The same error code can originate from the platform or the node, and **billing differs**: * **Errors generated by the platform itself**: never billed; * **Errors returned by the node**: passed through as-is and billed at the method weight, with only the node error codes listed below as exceptions. ### Rule details * **Node errors not billed**: The node's `-32002` (batch timeout), `-32003` (batch response too large), and `-32600` (batch rejected as a whole) indicate that the node abandoned the call early; these and any notifications in the same batch are not billed. Node `-32601` (exposed method not implemented) and `-32603` (node internal failure) are not billed over HTTP or WebSocket and do not affect other calls or notifications in the batch. In addition, `4444` (pruned block) and `-32000` (historical state outside the node's state history window, defined by `state_window_blocks` in `GET /v1/chains`) are not billed and do not affect other calls in the batch. * **Node errors billed**: Other errors returned by the node are billed at the method weight when they report the chain's outcome, such as `execution reverted` (`-32000` or `3` with `data`), the node's own `-32602 invalid argument`. * **Balance admission and sync**: `-32020` indicates insufficient account balance and requires a top-up; when the balance is known, `error.data.balance_units` and `error.data.balance_cu` carry what is left (it can be negative). A newly created key may return `-32021` (503) for a few seconds; wait `Retry-After` and retry. * **Upstream failures**: A `-32603` generated by the platform due to upstream communication failure or malformed response (`upstream unavailable`, `no response from upstream`, `malformed upstream response`) carries `data.reason: upstream_unavailable`. * **Notification billing**: Notifications (204) are billed at their method weights. ### JSON-RPC error codes table | Code | Source | HTTP | Message | Reason | Billed? | Recommended Action | | -----: | ----------- | ---: | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -32700 | BlockVectra | 200 | `parse error` | - | No (costs 1 CU rate-limit token; see “9. Rate limiting” in the [full OpenAPI reference](https://docs.blockvectra.com/en/api/json-rpc/reference/)) | Fix request JSON syntax | | -32600 | BlockVectra | 200 | `invalid request` | `invalid_request` | No (costs 1 CU rate-limit token; see “9. Rate limiting” in the [full OpenAPI reference](https://docs.blockvectra.com/en/api/json-rpc/reference/)) | Fix JSON-RPC request syntax and structure | | -32600 | BlockVectra | 200 | `batch too large: max calls` | `batch_too_large` (+max) | No | Split batch into calls under the limit (standard batch limit is 100) | | -32600 | BlockVectra | 200 | `invalid request: ambiguous member name` | `invalid_request` | No | Remove duplicate or ambiguous member names in JSON objects | | -32601 | BlockVectra | 200 | `method not available: ` | - | No | Call only methods allowed for this chain (see [Supported Chains](https://docs.blockvectra.com/en/chains/)) | | -32600 | BlockVectra | 404 | `unknown chain` | `unknown_chain` | No | Check the chain name in the URL | | -32602 | BlockVectra | 200 | `eth_getLogs block range too large: max blocks` | - | No | Narrow the `eth_getLogs` block range (limit defined per chain, e.g. 1000 blocks) | | -32602 | BlockVectra | 200 | `tracer not allowed` | - | No | Use an allowed native tracer (`callTracer`, `flatCallTracer`, `prestateTracer`, `4byteTracer`, `noopTracer`, or omit) | | -32602 | BlockVectra | 200 | `trace timeout not allowed` | - | No | Set a valid Go duration string with timeout ≤ 30s | | -32010 | BlockVectra | 200 | `node is syncing; calls are temporarily unavailable` | - | No | Node is syncing, retry later (except for `eth_chainId`) | | -32011 | BlockVectra | 200 | `historical state is not available beyond the most recent blocks` | - | No | Query a more recent block (target block must be within the state window; avoid safe/finalized/earliest tags) | | -32000 | BlockVectra | 200 | `transaction not found` | `not_found` | No | Verify transaction hash (`0x` + 64 hex characters) | | -32000 | BlockVectra | 200 | `block not found` | `not_found` | No | Verify block hash or number | | -32000 | BlockVectra | 200 | `upstream response too large` | `response_too_large` | No | Narrow query scope or split requests | | -32005 | BlockVectra | 200 | - | `overloaded` | No | Server temporarily overloaded, retry later | | -32005 | BlockVectra | 429 | `rate limit exceeded` | `key_rate_limit` / `free_plan_call_limit` / `concurrency_limit` | No | Reduce request frequency; honour `Retry-After` when present | | -32022 | BlockVectra | 429 | `request cost CU exceeds burst capacity CU` | `request_exceeds_burst` | No | Split request or batch so single-request CU is below burst capacity | | -32022 | BlockVectra | 429 | `request has calls, exceeding the free-plan limit of calls per second` | `free_plan_batch_too_large` (+max) | No | Split batch to fit under per-second limit, or upgrade to a paid plan | | -32603 | BlockVectra | 200 | `upstream unavailable` | `upstream_unavailable` | No | Upstream communication failure, retry later | | -32603 | BlockVectra | 200 | `no response from upstream` | `upstream_unavailable` | No | Upstream did not respond, retry later | | -32603 | BlockVectra | 200 | `malformed upstream response` | `upstream_unavailable` | No | Upstream response malformed, retry later | | -32603 | BlockVectra | 200 | - | - | No | Rare internal error, retry later | | -32020 | BlockVectra | 402 | `insufficient balance` | `balance_exhausted` / `free_grant_exhausted` (+topup\_url, and +`balance_units` / `balance_cu` when balance is known) | No | Check your balance on the Console [Billing page](https://console.blockvectra.com/billing/) or via `GET /v1/topup/deposit-address` (MCP `get_deposit_address`); top up on-chain to your account's dedicated address (see the [Agent top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/)) | | -32021 | BlockVectra | 503 | `billing data temporarily unavailable` | - | No | Billing data syncing (not a balance issue); wait `Retry-After` seconds and retry | | 4444 | Node | 200 | `pruned history unavailable` | - | No | Requested block was pruned by node; not billed; does not affect batch | | -32000 | Node | 200 | `historical state ... is not available` | - | No | Outside node state history window; not billed; does not affect batch | | -32000 | Node | 200 | `old data not available due to pruning...` | - | No | Outside node history window (window determined by `state_window_blocks`); not billed; does not affect batch | | -32002 | Node | 200 | `` | - | No | Node timed out on batch and abandoned call; not billed; notifications in batch also not billed | | -32003 | Node | 200 | `` | - | No | Node batch response too large and abandoned; not billed; notifications in batch also not billed | | -32601 | Node | 200 | `` | - | No | Exposed method is not implemented by the node; use another supported method | | -32603 | Node | 200 | `` | - | No | Node internal failure; retry with backoff | | -32600 | Node | 200 | `` | - | No | Entire batch rejected by node; not billed; notifications in batch also not billed | | Other | Node | 200 | `` | - | **Yes** (method weight) | Chain outcome (e.g. `execution reverted`, node `-32602`); check contract call parameters | ## Data API billing rules The Data API wraps read-only chain data into REST endpoints. Its billing and error handling follow these rules: ### Rule details * Only 2xx successful responses are billed. * Unavailable operations outside coverage (such as unsupported chains or blocks outside trace coverage) return HTTP 422 `no_coverage`, which is not billed but counts toward rate limits. * HTTP 401, 402, 404, and 429 responses are not billed. For response headers (`x-bv-meter: 1`), see [HTTP status codes and billing rules](https://docs.blockvectra.com/en/guides/billing-rules/#http-status-codes-and-billing-rules). ### Data API status codes table | HTTP Status | Error Code / Scenario | Billed? | Recommended Action | | ----------: | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 200 | Successful data response | **Yes** (Data API operation CU weight) | Parse `data`, `meta`, and `next_cursor` in the response envelope | | 400 | Request parameters malformed or missing required fields | No | Check and fix query or body parameters | | 402 | Balance exhausted (`error.code: "insufficient_balance"`, includes `balance_units` and `balance_cu` when balance is known) | No | Check your balance on the Console [billing page](https://console.blockvectra.com/billing/) or via `GET /v1/topup/deposit-address` (MCP `get_deposit_address`); top up on-chain to your account's dedicated address (see the [Agent top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/)) | | 401 | API key missing, unknown or disabled (`error.code: "missing_api_key"` or `"invalid_api_key"`) | No | Pass an active API key in the `x-api-key` header | | 404 | Unknown or not-public chain (`error.code: "not_found"`), or requested object does not exist | No | Check the chain slug in the URL (must be exact lowercase) and the request path | | 409 | Requested block or window is above the current indexed height (`error.code: "not_indexed_yet"`, includes `indexed_through`) | No | Query blocks up to `indexed_through` or retry later | | 422 | Chain-specific operation unavailable (e.g. unsupported chain or outside trace coverage, `error.code: "no_coverage"`) | No (counts toward rate limits) | Check supported features via `GET /v1/status` (free, keyless `data_features`) | | 429 | Rate limit exceeded (`error.code: "rate_limited"`), or a single request costs more than the key's burst capacity (`error.code: "cost_exceeds_burst"`) | No | Reduce request frequency; split oversized requests (a burst-exceeding request will never succeed as sent) | | 503 | Data service temporarily unavailable (`error.code: "unavailable"`), or the chain is busy (`error.code: "gateway_overloaded"`) | No | Retry later and honour `Retry-After` when present | ## Query balance (`GET /v1/account`) An API key holder can check balance and key quota details directly without incurring any billing or deducting Compute Units (CU): ```bash curl -H "x-api-key: $BLOCKVECTRA_API_KEY" https://api.blockvectra.com/v1/account ``` * **Free and unbilled**: `GET /v1/account` is free. It is never billed, does not deduct CU, and returns HTTP 200 with the current balance even when it is zero or negative (it never returns 402). * **Authentication**: Key authentication uses the `x-api-key` header exclusively (path keys and Bearer tokens are not accepted). Missing header returns 401 `missing_api_key`; invalid or revoked keys return 401 `invalid_api_key`. (Expired keys return 403 `key_expired`; transient service unavailabilities return 503 `auth_unavailable` or `billing_unavailable` with `Retry-After`.) * **Rate limiting**: Has an independent limit of 5 requests per second per key ID, independent of CU metering and billing (see “10. Limits at a glance” in the [full OpenAPI reference](https://docs.blockvectra.com/en/api/json-rpc/reference/)). Exceeding the limit returns HTTP 429 `rate_limited` with a `Retry-After` header. Response fields: * `key_id`: The API key's identifier string. * `plan`: Account plan type (`free` when the account has a free-plan call-rate allowance; `paid` otherwise). * `balance_units`: Remaining account balance in units (may be zero or negative). * `balance_cu`: Remaining balance converted to Compute Units (CU). * `balance_as_of_age_ms`: Milliseconds elapsed since the balance was read from its data source. * `key`: Key-specific limits and quota details: * `cu_per_sec`: Token-bucket refill rate in CU per second. * `burst_cu`: Token-bucket burst capacity in CU. * `cu_cap`: Lifetime CU cap for this key, or `null` if uncapped. * `cu_cap_remaining`: CU remaining under `cu_cap`, or `null` if uncapped (can be zero or negative). * `expires_at`: RFC 3339 expiration timestamp, or `null` if the key never expires. Example response: ```json { "key_id": "", "plan": "", "balance_units": , "balance_cu": , "balance_as_of_age_ms": , "key": { "cu_per_sec": , "burst_cu": , "cu_cap": , "cu_cap_remaining": , "expires_at": "" } } ``` ## Pricing and upgrades The specific cost for all billed calls is determined by published CU weights: * To inspect weights for all methods and operations, see the [method weight table](https://blockvectra.com/en/pricing/) and the [JSON-RPC CU Metering Rules](https://docs.blockvectra.com/en/api/json-rpc/#cu-metering-rules). * For plan pricing and settlement details, see the [Pricing page](https://blockvectra.com/en/pricing/). * Upgrading to a paid plan: making a paid top-up removes the Free Plan's per-second call limit; each key remains subject to CU rate and burst limits. ### On-Chain Top-up Process When your account balance is insufficient or you need higher throughput, top up on-chain in the console following these steps: 1. **Log in to the Console**: Sign in to the [BlockVectra Console](https://console.blockvectra.com/login/?next=%2Fbilling%2F). 2. **Go to the Billing Page**: Navigate to the [Billing page](https://console.blockvectra.com/billing/). 3. **Get Your Dedicated Address**: In the on-chain top-up card, copy your account's dedicated top-up address or scan the QR code. 4. **Transfer Funds**: Transfer only using the supported networks and USDC / USDT / USDG listed on the page. Supported networks and minimum top-up amounts are shown in the console. 5. **Automatic Crediting**: Once detected on-chain, transactions show as "Processing"; once credited, credits are automatically added to your balance. > **Important Notes**: > > * Only use the networks and tokens explicitly listed in the console. Transfers on unsupported chains or with wrong tokens cannot be credited automatically. > * Ensure each transfer meets the minimum top-up amount indicated in the console. > * Once your first paid top-up is credited, your account is upgraded to a paid account, removing the Free Plan's per-second call limit. Agent or server programs can directly call top-up endpoints using an API key; see the [Agent programmatic top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/). ## Webhook push billing Push has separate weights for delivered data events, successful history queries and billable address-days. Management calls other than event history, failed delivery attempts, automatic retries and control events are free. Each delivered event is charged once; customer replay and canonical events redelivered after a reorg are new billed deliveries. Address charges use each subscription’s maximum address count while online during the UTC day; the account free-address allowance is shared across subscriptions, with older subscriptions using it first. An address in two subscriptions is counted twice; adding chains changes event fees, not address fees. See the [Blockchain Webhook API guide](https://docs.blockvectra.com/en/guides/webhook-push/) for setup, [signature verification](https://docs.blockvectra.com/en/guides/webhook-push/#verify-signatures) and [delivery recovery](https://docs.blockvectra.com/en/guides/webhook-push/#delivery-retries-and-replay). The [stablecoin payment guide](https://docs.blockvectra.com/en/guides/stablecoin-payments/) covers receipt validation and polling backfill; [WebSocket subscriptions](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) use their own connection and notification metering. Request errors are listed in the [error reference](https://docs.blockvectra.com/en/errors/). The weights below come from `GET /v1/plans`. | Usage | Billing unit | CU | | --- | --- | --- | | `push.address_day` | Billable address-day | 33 | | `push.history` | Successful history request | 25 | | `push.log` | Delivered data event | 150 | | `push.native_transfer` | Delivered data event | 150 | | `push.token_transfer` | Delivered data event | 150 | Free addresses per account per UTC day: 1000 Free address allowance per account per UTC day, shared by all subscription groups regardless of plan. For each group, count its maximum address count while online during that day; allocate the allowance in ascending group ID order. The same address in two groups counts twice; the number of chains in a group does not multiply its address count. A group offline or deleted for the entire day contributes nothing. For each group, the remaining count after its share of the allowance is multiplied by the `push.address_day` CU weight in `method_weights`. The current configured allowance comes from the same pricing policy used for the address-day charge; it is not an account capacity limit or a separate allowance per group. Example: 10 delivered native.transfer events, 2 successful history requests and 10 billable address-days cost 10 × 150 + 2 × 25 + 10 × 33 = 1880 CU. Billable address-days are counted after the account free-address allowance. ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # BlockVectra as a Chainstack Alternative: Method Prices for Additional Reads Source: https://docs.blockvectra.com/en/guides/chainstack-alternative/ Choose BlockVectra for lower list prices on additional supported EVM reads and usage billing without a monthly RPC subscription. ## Comparison Competitor figures as of 2026-10-08. BlockVectra method weights, free-plan and key limits come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans) and log ranges from [GET /v1/chains](https://api.blockvectra.com/v1/chains); current figures are rendered by the components below. | Metric | Chainstack | BlockVectra | Sources | | ----------------------------------------------------------- | -------------------------------------------------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Developer extra full-class `eth_call`, per million calls | 1 RU/call; $20 after the included 3M RU/month | Current `eth_call` USD price below, before available free CU | [Pricing](https://chainstack.com/pricing/), [RU rules](https://docs.chainstack.com/docs/request-units), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | | Developer extra full-class `eth_getLogs`, per million calls | 1 RU/call; $20 after the included 3M RU/month | Current `eth_getLogs` USD price below, before available free CU | [Pricing](https://chainstack.com/pricing/), [RU rules](https://docs.chainstack.com/docs/request-units), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | | Paid metered RPC subscription | Growth: $49/month, 20M RU/month included; extra $15/M RU | Usage billing without a monthly RPC subscription | [Pricing](https://chainstack.com/pricing/), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | The Developer rates are incremental overage after the included quota, not prices for every call. Full requests use 1 RU; archive-class requests use 2 RU. For Global Nodes, eligible EVM methods targeting blocks at least 127 blocks behind the tip are archive-class; for logs, inspect the billed starting block. Node mode can change the classification. Apply the current RU rules to the exact request before comparing. ## Why choose BlockVectra ### Method prices and free-account budget Method weights, USD conversion and the free-account budget below come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans). Chain limits come from [GET /v1/chains](https://api.blockvectra.com/v1/chains). Compare the same chain, method, block and complete result; splitting and retries change the number of calls. **Active Conversion Parameters** 1 USD = 10,000 billing units, 1 billing unit = 1,000 CU (1 USD = 10,000,000 CU). **Formula**: CU weight × 1,000,000 ÷ (10,000 × 1,000) USD. | Method | CU per call | Price per 1M calls (USD) | | --- | --- | --- | | `eth_blockNumber` | 1 | $0.10 | | `eth_call` | 15 | $1.50 | | `eth_getLogs` | 30 | $3.00 | | `debug_traceTransaction` | 100 | $10.00 | | `data.block` | 5 | $0.50 | Self-service Push supports up to 1,000,000 addresses per subscription. For 10,000,000 / 100,000,000 addresses per subscription, [contact us to enable capacity](https://blockvectra.com/en/contact/). **BlockVectra task costs and request rates** Free new-key default budget: 100 CU/s. | Method | Example calls | CU per call | Task cost (USD) | Requests/s from key CU budget | | --- | --- | --- | --- | --- | | `eth_call` | 1,000,000 | 15 | $1.50 | 6 | | `eth_getLogs` | 100,000 | 30 | $0.30 | 3 | Task costs are list prices before free credits, gas and additional services. Request rates equal key_defaults.cu_per_sec ÷ method CU and assume only that method uses the key. Free-account caps and other traffic can reduce the usable rate; these figures are budget conversions, not measured throughput. [Current weights, prices and key limits: GET /v1/plans.](https://console-api.blockvectra.com/v1/plans) The Free Plan requires registering an account and using an API key; all keys under an account share an average of 25 calls per second (short bursts allowed). At the end of each 30-day cycle, balances below 30,000,000 CU are refilled to 30,000,000 CU. | Method | CU Weight | Approx Calls / Cycle | Approx / Day | List Price / 1M Calls | | --- | --- | --- | --- | --- | | `eth_blockNumber` | 1 | 30,000,000 | 1,000,000 | $0.10 | | `eth_getBlockByNumber` | 5 | 6,000,000 | 200,000 | $0.50 | | `eth_getBalance` | 10 | 3,000,000 | 100,000 | $1.00 | | `eth_call` | 15 | 2,000,000 | 66,666 | $1.50 | | `eth_getLogs` | 30 | 1,000,000 | 33,333 | $3.00 | | `debug_traceTransaction` | 100 | 300,000 | 10,000 | $10.00 | | `data.block` | 5 | 6,000,000 | 200,000 | $0.50 | | `data.address_balances` | 25 | 1,200,000 | 40,000 | $2.50 | | `data.dex_prices` | 15 | 2,000,000 | 66,666 | $1.50 | | `data.transaction_trace` | 200 | 150,000 | 5,000 | $20.00 | Free-account cap: up to 25 calls per second, shared across all keys in the account, all chains, and the Data API. Per-key `key_defaults.cu_per_sec` and `burst_cu` also apply. Eligible cycle refills top the free balance up to the target rather than adding a full grant. The first paid top-up stops cycle refills while preserving remaining free CU. See [free plan rules](https://docs.blockvectra.com/en/guides/free-plan/). ### Additional reads priced by method For a hypothetical additional workload of 1,000,000 `eth_call` reads and 100,000 `eth_getLogs` requests, add `1,000,000 × current eth_call CU weight` and `100,000 × current eth_getLogs CU weight` from the method table. Estimate paid compute as `max(0, workload CU − available free CU) / (pricing.units_per_usd × pricing.cu_per_unit)`. Count every chunk and billable retry, then verify the required state blocks and complete log results on the target chain. Historical state and log spans are separate capabilities; check [historical EVM state](https://docs.blockvectra.com/en/guides/evm-historical-state/). Sources: [plans](https://console-api.blockvectra.com/v1/plans) and [chains](https://api.blockvectra.com/v1/chains), checked **2026-10-09**. ### Keyless trials and programmatic Agent funding Try a listed `public.methods` method at the chain catalog's `public.url` before creating a key. For authenticated access, [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/) lets an Agent create an account and key with a wallet signature. [Agent top-ups](https://docs.blockvectra.com/en/guides/agent-topup/) fund the same usage balance with stablecoins; read networks, tokens and minimums from [top-up status](https://api.blockvectra.com/v1/topup/status). Developers and AI Agents use the same prices and limits. ### Multi-chain address Push Watch the same address set across several supported chains in one subscription, with one HTTPS receiver. This suits wallet activity and payment notifications without maintaining a socket per chain. See [self-service and enterprise address capacity](https://docs.blockvectra.com/en/guides/webhook-push/#address-capacity); [contact us](https://blockvectra.com/en/contact/) to enable enterprise capacity. Address-day and delivered-event charges are separate from RPC calls and are listed in [Push pricing](https://docs.blockvectra.com/en/guides/webhook-push/#billing-and-example). RPC on Robinhood Chain and HyperEVM is listed in the [chain catalog](https://api.blockvectra.com/v1/chains). Check methods and Push support per network; use the [chain-specific starter guide](https://docs.blockvectra.com/en/guides/robinhood-chain/) and [HyperEVM backfill guide](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) for the relevant workflow. ## Migration steps 1. **Inventory and coverage:** list chains, methods, fixed blocks, log spans and subscription dependencies. Check `methods.allow`, `methods.deny`, `public.methods`, `state_window_blocks` and `ws` in the [catalog](https://api.blockvectra.com/v1/chains). A null history window is unspecified, not archive coverage. A keyless `public.url` smoke test validates only its listed public methods. 2. **Key and authentication:** obtain a BlockVectra key through the [console](https://console.blockvectra.com/keys/) or [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/). Keep it in your server environment. RPC accepts `POST /v1/{chain}/{api_key}` or `POST /v1/{chain}` with `x-api-key`; Data API uses `x-api-key`. This Ethereum WETH `decimals()` example uses the header: ```bash if [ -z "$BLOCKVECTRA_API_KEY" ]; then echo "Set BLOCKVECTRA_API_KEY in your server environment" exit 1 fi curl --fail-with-body -sS --max-time 15 https://api.blockvectra.com/v1/eth_mainnet \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"to":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2","data":"0x313ce567"},"latest"]}' ``` 3. **Replay before switching:** replace `latest` with the same supported fixed block on both providers and record the block hash. Compare returned values and JSON-RPC `error`, even after HTTP 200. Test representative log queries, bounded retries, rate-limit recovery and cursor resume. Migrate proprietary APIs and subscriptions separately; move traffic after the required results match. ## FAQ ### Does a lower method price mean a lower total task cost? Calculate `max(0, sum(calls × method CU) − available_free_cu) / (pricing.units_per_usd × pricing.cu_per_unit)`. Include splitting, retries and any services your task uses. Existing included credits change incremental costs; compare the complete result rather than billing-unit names. ### Can I migrate by changing the endpoint? For supported standard RPC methods, update the endpoint and path key or `x-api-key` header, then replay fixed-block requests. Check historical state and method coverage first. Proprietary APIs, WebSocket subscriptions and Push receivers need their own migration tests; see [historical state](https://docs.blockvectra.com/en/guides/evm-historical-state/) and [Webhook versus WebSocket](https://docs.blockvectra.com/en/guides/webhook-vs-websocket/). Use [How to choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/) for a workload checklist and self-tests. --- # How to choose an RPC provider Source: https://docs.blockvectra.com/en/guides/choose-rpc-provider/ Choose an RPC provider by the cost and reliability of completing your actual task: first verify chains, methods and historical coverage, then measure query count, throughput and recovery. Write down the chains, methods, fixed blocks, daily traffic distribution, peak concurrency and notification or dataset dependencies your application or AI Agent needs. The public BlockVectra values below come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans) and [GET /v1/chains](https://api.blockvectra.com/v1/chains); fetch them again before making a decision. Data coverage comes from [GET /v1/status](https://api.blockvectra.com/v1/status). A declaration is a starting point for a test, not a latency measurement or an SLA. Evaluate BlockVectra for supported contract reads with method-based usage billing, bounded HyperEVM log backfills of up to 1,000 blocks per authenticated request, or multi-chain address notifications through one self-service subscription and one HTTPS receiver. Contract reads use the current `eth_call` weight in the method table below; Push address-days and delivered events have separate rates. Match the workflow to your task: [contract-read pricing](https://docs.blockvectra.com/en/guides/reading-cu-pricing/), [HyperEVM log backfills](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) or [address notifications and capacity](https://docs.blockvectra.com/en/guides/webhook-push/#address-capacity). Prices and limits were checked against [plans](https://console-api.blockvectra.com/v1/plans) and [chains](https://api.blockvectra.com/v1/chains) on **2026-10-09**; confirm coverage with the current APIs and run the relevant self-test for your required blocks, complete results and recovery path. ## Method prices and billing units A request count alone does not price a workload. Record each method's billing weight, conversion into USD, included credits, overage and any subscription or add-on fee. Credits, CU and request units need their own conversion before comparing providers. BlockVectra's current method weights and list prices are read from the public plans endpoint when the page is built: **Active Conversion Parameters** 1 USD = 10,000 billing units, 1 billing unit = 1,000 CU (1 USD = 10,000,000 CU). **Formula**: CU weight × 1,000,000 ÷ (10,000 × 1,000) USD. | Method | CU per call | Price per 1M calls (USD) | | --- | --- | --- | | `eth_blockNumber` | 1 | $0.10 | | `eth_call` | 15 | $1.50 | | `eth_getLogs` | 30 | $3.00 | | `debug_traceTransaction` | 100 | $10.00 | | `data.block` | 5 | $0.50 | Self-service Push supports up to 1,000,000 addresses per subscription. For 10,000,000 / 100,000,000 addresses per subscription, [contact us to enable capacity](https://blockvectra.com/en/contact/). **BlockVectra task costs and request rates** Free new-key default budget: 100 CU/s. | Method | Example calls | CU per call | Task cost (USD) | Requests/s from key CU budget | | --- | --- | --- | --- | --- | | `eth_call` | 1,000,000 | 15 | $1.50 | 6 | | `eth_getLogs` | 100,000 | 30 | $0.30 | 3 | Task costs are list prices before free credits, gas and additional services. Request rates equal key_defaults.cu_per_sec ÷ method CU and assume only that method uses the key. Free-account caps and other traffic can reduce the usable rate; these figures are budget conversions, not measured throughput. [Current weights, prices and key limits: GET /v1/plans.](https://console-api.blockvectra.com/v1/plans) ```text workload_cu = sum(calls_for_method × current_method_cu_weight) cu_per_usd = pricing.units_per_usd × pricing.cu_per_unit list_cost_usd = workload_cu / cu_per_usd paid_compute_usd = max(0, workload_cu − available_free_cu) / cu_per_usd ``` List prices exclude free credits, gas, add-ons and migration work. Distinguish a recurring allowance from an expiring trial, and an extra-credit price from the average cost of included requests. Check the [billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) for which responses consume CU. **Self-test:** replay a small, representative method mix with fixed blocks and record successful calls, retries and billable errors. Compare the account's usage change with the method-weight calculation. Budget for the number of requests that returned the complete result, including pagination and backfills. See [Reading CU pricing](https://docs.blockvectra.com/en/guides/reading-cu-pricing/) for the conversion. ## Log ranges and historical state For `eth_getLogs`, check block span, result-size limits and filter support for the specific chain and plan. A wide span is useful only if the response is complete. BlockVectra's authenticated spans come from the chain catalog: | Chain | Chain slug | max_logs_block_range (blocks) | | --- | --- | --- | | Arbitrum One | `arb_mainnet` | 1,000 | | Arc | `arc_mainnet` | 1,000 | | Avalanche C-Chain | `avax_mainnet` | 1,000 | | Base | `base_mainnet` | 1,000 | | Berachain | `berachain_mainnet` | 1,000 | | Boba | `boba_mainnet` | 1,000 | | BNB Smart Chain | `bsc_mainnet` | 1,000 | | Celo | `celo_mainnet` | 1,000 | | Ethereum | `eth_mainnet` | 1,000 | | Ethereum Sepolia | `eth_sepolia` | 1,000 | | Fraxtal | `fraxtal_mainnet` | 1,000 | | Gnosis | `gnosis_mainnet` | 1,000 | | HyperEVM | `hyperevm_mainnet` | 1,000 | | Ink | `ink_mainnet` | 1,000 | | Katana | `katana_mainnet` | 1,000 | | Linea | `linea_mainnet` | 1,000 | | Metal L2 | `metall2_mainnet` | 1,000 | | Mode | `mode_mainnet` | 1,000 | | OP Mainnet | `op_mainnet` | 1,000 | | Polygon | `polygon_mainnet` | 1,000 | | Robinhood Chain | `robinhood_mainnet` | 1,000 | | Robinhood Chain Testnet | `robinhood_testnet` | 1,000 | | Rootstock | `rootstock_mainnet` | 1,000 | | Soneium | `soneium_mainnet` | 1,000 | | Sonic | `sonic_mainnet` | 1,000 | | Unichain | `unichain_mainnet` | 1,000 | | World Chain | `world_mainnet` | 1,000 | | X Layer | `xlayer_mainnet` | 1,000 | | Zora | `zora_mainnet` | 1,000 | Historical logs and historical contract execution are different capabilities. For `eth_call`, read `state_window_blocks`; for keyless reads, also read `public.history_blocks`. A missing or null field is unspecified, not proof of unlimited history. See [historical EVM state](https://docs.blockvectra.com/en/guides/evm-historical-state/). **Self-test:** choose a fixed interval with a known contract and topics, split it at the declared range, and compare the union of results with smaller overlapping queries. Deduplicate by block hash, transaction hash and log index, and check interval boundaries. Separately read the same contract at a recent fixed block and at the oldest block your application requires; record the actual result or JSON-RPC error. Test dense and sparse intervals and count retries. Follow [log range and recovery](https://docs.blockvectra.com/en/guides/getlogs-block-range/) to checkpoint progress. ## Free credits, rate limits and peak traffic BlockVectra's current cycle budget and the calls it can cover are calculated from plans: The Free Plan requires registering an account and using an API key; all keys under an account share an average of 25 calls per second (short bursts allowed). At the end of each 30-day cycle, balances below 30,000,000 CU are refilled to 30,000,000 CU. | Method | CU Weight | Approx Calls / Cycle | Approx / Day | List Price / 1M Calls | | --- | --- | --- | --- | --- | | `eth_blockNumber` | 1 | 30,000,000 | 1,000,000 | $0.10 | | `eth_getBlockByNumber` | 5 | 6,000,000 | 200,000 | $0.50 | | `eth_getBalance` | 10 | 3,000,000 | 100,000 | $1.00 | | `eth_call` | 15 | 2,000,000 | 66,666 | $1.50 | | `eth_getLogs` | 30 | 1,000,000 | 33,333 | $3.00 | | `debug_traceTransaction` | 100 | 300,000 | 10,000 | $10.00 | | `data.block` | 5 | 6,000,000 | 200,000 | $0.50 | | `data.address_balances` | 25 | 1,200,000 | 40,000 | $2.50 | | `data.dex_prices` | 15 | 2,000,000 | 66,666 | $1.50 | | `data.transaction_trace` | 200 | 150,000 | 5,000 | $20.00 | Free-account call cap: up to 25 calls per second, shared across all keys in the account, all chains, and the Data API. Each key also has `cu_per_sec` and `burst_cu` limits. An eligible cycle refill tops the free balance up to its target; it is not an extra full grant. The first paid top-up stops cycle refills while preserving remaining free CU. See [free plan rules](https://docs.blockvectra.com/en/guides/free-plan/). Keep daily quotas, cycle balances, requests/s, CU/s, burst capacity and concurrent requests separate. Paying for more usage does not by itself establish more per-key throughput. **Self-test:** use an authenticated key and a small bounded batch at the pacing and concurrency your task needs, within the account's limits. Record HTTP status, JSON-RPC error, latency percentiles and completed calls. Stop at quota exhaustion; use bounded backoff on throttling and persist progress. Repeat with a mixed-method sample because costly methods consume more of a CU/s budget. Compare a burst with steady traffic, and include other keys' usage when checking the shared account cap. ## Comparing latency, errors and results fairly Use the same chain, fixed block range, `address`/`topics`, concurrency, pacing and timeout for both providers. Do not use `latest` at either end: the chain moves between runs, so endpoints process different amounts of work. The [`eth_getLogs` documentation](https://ethereum.org/developers/docs/apis/json-rpc/#eth_getlogs) defines these filter fields; see the [log range guide](https://docs.blockvectra.com/en/guides/getlogs-block-range/) for checkpoints. Report p50 and p95 latency for successful requests with the success count. For all attempts, also list timeouts, HTTP errors and JSON-RPC errors with an explicit denominator; categories can overlap, so do not sum them as mutually exclusive. Record failure latency too, not only successful latency. Compare returned log counts and response bytes to align result volume; equal counts do not prove complete content or canonicality. Include retries in total task time, request count and cost. Treat success and failure latency and the error rate separately, following the [four golden signals](https://sre.google/sre-book/monitoring-distributed-systems/#the-four-golden-signals). For a same-chain outside reference, independent benchmarks exist for [Ink](https://openchainbench.com/benchmarks/ink-rpc), [Unichain](https://openchainbench.com/benchmarks/unichain-rpc), [Fraxtal](https://openchainbench.com/benchmarks/fraxtal-rpc), [Katana](https://openchainbench.com/benchmarks/katana-rpc), [Ethereum](https://openchainbench.com/benchmarks/ethereum-rpc), [Arbitrum](https://openchainbench.com/benchmarks/arbitrum-rpc), [Boba](https://openchainbench.com/benchmarks/boba-rpc) and [World Chain](https://openchainbench.com/benchmarks/world-chain-rpc). Check each page's method, sampling region and time window first; its workload is not your application's result. ### Run one bounded request set on each endpoint [Download `rpc-benchmark.mjs`](https://docs.blockvectra.com/examples/rpc-benchmark.mjs) to send the same fixed workload to one endpoint at a time and save one JSON report for offline comparison. It needs Node.js 24 or later, uses only built-in modules, checks `eth_chainId` first, then sends the same `eth_getLogs` filter `repetitions` times, serially. It does not retry, follow redirects, sign, broadcast, scan providers or choose blocks for you. Create `benchmark.json` yourself; the values below are illustrative. The file cannot contain an endpoint or a key. Set the endpoint in `RPC_BENCHMARK_URL` and, if the endpoint needs one, the key in `BLOCKVECTRA_API_KEY`. Prefer an endpoint that accepts the key in the `x-api-key` header rather than a path key, so the key does not appear in a URL, log or report. ```json { "chainId": "0x1", "filter": { "fromBlock": "0x1400000", "toBlock": "0x1400063", "address": "0x1111111111111111111111111111111111111111", "topics": [] }, "repetitions": 5, "intervalMs": 250, "timeoutMs": 10000, "maxDurationMs": 60000, "maxResponseBytes": 1048576, "maxTotalBytes": 16777216, "region": "eu-west" } ``` ```bash export RPC_BENCHMARK_URL="https://your-rpc.example/v1/eth_mainnet" export BLOCKVECTRA_API_KEY="set-your-key-here" node rpc-benchmark.mjs --config ./benchmark.json > run.json ``` Use the same `chainId`, filter, repetitions, interval and limits on each endpoint, and run each independently, one endpoint at a time. The report includes `stop_reason`, raw attempts, successful and failed `eth_getLogs` latency separately (nearest-rank p50 and p95 when samples exist), and a workload fingerprint that excludes the endpoint and key. It records the script SHA-256 and the environment variable names, not their values. Exit code 0 means every planned request completed successfully; a runtime failure still writes JSON and exits 1; an invalid config exits 2 before any request. `maxResponseBytes`, `maxTotalBytes` and `maxDurationMs` are application-side stop thresholds, not network limits or a hard cap on CU or provider billing. A small sample is not an SLA, not evidence of complete or canonical results, and not customer traffic. Verify the fixed block hash independently before comparing results. The User-Agent ends with `BlockVectraQA/1`. ## Chain, method and protocol coverage Use the [chain catalog](https://api.blockvectra.com/v1/chains) to check network identity, `jsonrpc`, `methods.allow`, `methods.deny`, `public.methods`, `ws` and `subscriptions`. A chain name does not establish that every method or protocol is available. Keyless methods and authenticated methods can have different limits. **Self-test:** copy the chosen network's `public.url` and call a method in `public.methods`. For the Ethereum example below, inspect the network ID, then run the application’s required methods with an authenticated key and the same fixed blocks. Check deny rules as well as allow rules; compare block hashes when comparing results across endpoints. ```bash curl --fail-with-body -sS --max-time 15 https://api.blockvectra.com/v1/eth_mainnet/public \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' ``` This checks a public method, not archive coverage or authenticated capacity. If your application needs sockets, test the required subscription, disconnect and resume path on a network that declares `ws` support. See [WebSocket subscriptions](https://docs.blockvectra.com/en/guides/websocket-subscriptions/). **Workflow check:** list every method the whole flow calls, then check `methods.allow`, `methods.deny` and `public.methods` of the current catalog entry separately for the keyed and the keyless endpoint. A matching `eth_chainId` result shows the network only; confirm method support, the `eth_getLogs` block range and the history window one by one, and treat a missing method as a missing capability. A primary and a backup endpoint each need the full list. Return HTTP and JSON-RPC errors to the caller instead of turning them into an empty log or event list. For example, a scanner that reads logs and waits for a transaction needs more than the first receipt call. With viem 2.47.10 ([source](https://github.com/wevm/viem/blob/14f77b7ffc65764aa01d99ce49b941b593692636/src/actions/public/waitForTransactionReceipt.ts)), `waitForTransactionReceipt` defaults to `checkReplacement: true`. If the first receipt is already available it can return right away. While the transaction is pending, or when a same-sender, same-nonce replacement is detected, it can additionally call `eth_getTransactionByHash` and read blocks. The exact calls depend on the viem version and configuration. A catalog check does not prove that the data is complete or that history is available. ```ts import type { Client } from "viem"; import { waitForTransactionReceipt } from "viem/actions"; // Methods this workflow needs, checked against the catalog entry. export const required = [ "eth_chainId", "eth_getLogs", "eth_getTransactionReceipt", "eth_getTransactionByHash", "eth_blockNumber", "eth_getBlockByNumber", ]; type Scope = { allow?: string[]; deny?: string[] }; // A rule is an exact name or a trailing "*" prefix; "*" matches every method. const matches = (rule: string, method: string) => rule.endsWith("*") ? method.startsWith(rule.slice(0, -1)) : rule === method; // Deny wins; a missing allow list means nothing is allowed. export function missingMethods(required: string[], scope: Scope) { return required.filter( (m) => (scope.deny ?? []).some((r) => matches(r, m)) || !(scope.allow ?? []).some((r) => matches(r, m)), ); } type Entry = { methods?: Scope; public?: { methods?: string[] } }; // Keyed uses methods.allow/deny; keyless uses only public.methods. export function checkEntry(required: string[], entry: Entry) { return { keyed: missingMethods(required, entry.methods ?? {}), public: missingMethods(required, { allow: entry.public?.methods }), }; } // Synthetic entry for illustration, not a copy of the live catalog. export const syntheticEntry: Entry = { methods: { allow: ["eth_*"] }, public: { methods: ["eth_chainId", "eth_blockNumber"] }, }; export const missing = checkEntry(required, syntheticEntry); // Missing methods per scope: // keyed: [] // public: eth_getLogs, eth_getTransactionReceipt, eth_getTransactionByHash, eth_getBlockByNumber export async function confirmTransaction( client: Client, hash: `0x${string}`, timeout = 60_000, ) { const receipt = await waitForTransactionReceipt(client, { hash, timeout, }); return { hash: receipt.transactionHash, status: receipt.status }; } ``` In a checkout of the docs source, `apps/docs/tests/rpc-workflow-coverage-guide.test.ts` runs this snippet against a mock transport for the pending-then-included and pending-then-replaced cases, using the installed viem version rather than 2.47.10. Run it with `pnpm exec vitest run apps/docs/tests/rpc-workflow-coverage-guide.test.ts`. ## Push delivery and indexed data For address notifications, inspect the chain's `push` declaration and its confirmation settings. BlockVectra can watch the same address set across supported chains in one subscription with one HTTPS receiver; check [self-service and enterprise capacity](https://docs.blockvectra.com/en/guides/webhook-push/#address-capacity) against your address count. For Data API queries, inspect the datasets and indexed range in [GET /v1/status](https://api.blockvectra.com/v1/status). Indexed records do not imply arbitrary historical contract execution. RPC polling, WebSocket messages, delivered Push events and watched address-days use different billing meters; calculate each needed workflow from the applicable weights in [plans](https://console-api.blockvectra.com/v1/plans). **Self-test:** for Push, use an HTTPS receiver you control, verify signatures and test duplicate handling, retries and replay using an event from an address you control. For Data API, query a known indexed transaction or transfer, compare its block hash with RPC, exhaust pagination, and save the cursor before resuming. Record coverage gaps and the number of billed events or calls. Use [Webhook Push](https://docs.blockvectra.com/en/guides/webhook-push/), [Webhook versus WebSocket](https://docs.blockvectra.com/en/guides/webhook-vs-websocket/) and the [Data API reference](https://docs.blockvectra.com/en/api/data/) for the appropriate recovery path. ## Authentication and Agent access Check whether your client can securely supply a key, discover machine-readable documentation, create an account and recover from errors. BlockVectra RPC accepts a path key at `POST /v1/{chain}/{api_key}` or an `x-api-key` header at `POST /v1/{chain}`. Data API uses `x-api-key`. Keep keys in server environments and out of browser bundles, logs and chat messages. Developers and AI Agents use the same pricing and limits. [Programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/) documents wallet-based account creation, and the [Agent guide](https://docs.blockvectra.com/en/guides/ai-agents/) provides documentation and MCP entry points. Agents can fund the account usage balance with stablecoins through the [documented top-up flow](https://docs.blockvectra.com/en/guides/agent-topup/), without a monthly RPC subscription. Top-up networks, tokens and minimums come from [GET /v1/topup/status](https://api.blockvectra.com/v1/topup/status). **Self-test:** have the intended client discover the chain and method, read the documentation, load a key from its environment and execute one bounded authenticated request. Inspect both HTTP status and JSON-RPC `error`. Check a missing-key response without logging credentials. Verify that the client saves progress on insufficient balance, reads the enabled top-up network and token, and follows the documented top-up flow; account creation and payment steps should use accounts you control. Do not treat a documentation MCP connection as proof that the Agent can execute an authenticated RPC call. ## Record the decision Keep a short result sheet: source and sampling date; chain and method; fixed block hash; result completeness; total calls and retries; available quota; paid task cost; latency and throttling; history and protocol gaps; recovery steps; migration effort. If the workload requires contractual support or an SLA, obtain the applicable terms separately from these API tests. Once your workload is defined, compare with specific providers: * [Compare with specific providers: compute pricing and log ranges](https://docs.blockvectra.com/en/guides/alchemy-alternative/). * [Compare with specific providers: trial and subscription billing](https://docs.blockvectra.com/en/guides/quicknode-alternative/). * [Compare with specific providers: HTTPS request costs](https://docs.blockvectra.com/en/guides/ankr-alternative/). * [Compare with specific providers: daily and cycle budgets](https://docs.blockvectra.com/en/guides/infura-alternative/). * [Compare with specific providers: included requests and overage](https://docs.blockvectra.com/en/guides/chainstack-alternative/). --- # Coinbase AgentKit Base RPC provider: BlockVectra setup Source: https://docs.blockvectra.com/en/guides/coinbase-agentkit/ To use BlockVectra as the Base RPC provider for Coinbase AgentKit, note that AgentKit sends its onchain actions through a wallet provider, and `ViemWalletProvider` accepts any viem `WalletClient`. Give that client `https://api.blockvectra.com/v1/base_mainnet/public` as its transport and AgentKit's RPC traffic uses BlockVectra without an API key. A key adds the rest; the Free Plan gives 30,000,000 CU per 30-day window. Checked 2026-10-21. ```typescript import { AgentKit, ViemWalletProvider } from "@coinbase/agentkit"; import { getLangChainTools } from "@coinbase/agentkit-langchain"; import { createWalletClient, http } from "viem"; import { privateKeyToAccount } from "viem/accounts"; import { base } from "viem/chains"; const client = createWalletClient({ account: privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`), chain: base, transport: http("https://api.blockvectra.com/v1/base_mainnet/public"), }); const agentKit = await AgentKit.from({ walletProvider: new ViemWalletProvider(client) }); const tools = await getLangChainTools(agentKit); ``` Install with `npm install @coinbase/agentkit @coinbase/agentkit-langchain viem`. `tools` is the list AgentKit's [LangChain integration](https://github.com/coinbase/agentkit/blob/main/typescript/agentkit/README.md) passes to `createAgent({ model, tools })`; the wallet key stays in your environment. ## Use an API key The public endpoint serves only the methods in each chain's `public.methods`. For the others, send the key in the `x-api-key` header and keep it in the environment, so it never appears in the URL: ```typescript const transport = http("https://api.blockvectra.com/v1/base_mainnet", { fetchOptions: { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! } }, }); ``` If a client cannot set headers, the key can go in the URL path (`/v1/{chain}/{api_key}`) instead; URLs can end up in access logs, so prefer the header. Create the key without a browser with the four steps in the [programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/?ref=docs-agentkit): challenge, signature, login, then `POST /keys`. Developers can also [create a key in the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F\&ref=docs-agentkit). One key works on every chain, so switching the agent to another network only changes the chain slug and the viem chain object. ## Combine AgentKit actions with the docs MCP server AgentKit's TypeScript package exposes its actions as LangChain tools, so MCP tools from LangChain's adapter go into the same `tools` array. Follow the [LangChain guide](https://docs.blockvectra.com/en/guides/langchain/#add-the-docs-mcp-server) to load `https://docs.blockvectra.com/mcp`, then merge: ```typescript const agent = createAgent({ model: "claude-sonnet-5", tools: [...tools, ...(await adapter.listTools())] }); ``` The agent gets AgentKit's wallet actions plus BlockVectra's `list_chains`, `get_status`, `rpc_call` and `read_doc`, listed on the [MCP server page](https://docs.blockvectra.com/en/guides/mcp-server/). Connecting needs no key. ## Errors you may see | Response | Meaning | What to do | | ------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------------- | | HTTP 401, `-32024`, `missing_api_key` | A keyed request was sent without a key | Send the key in the `x-api-key` header (or the URL path) | | HTTP 401, `-32024`, `invalid_api_key` | Key unknown, disabled or revoked | Check the key in the console; a new key takes a few seconds to activate | | `-32601`, `method_not_public` | Method is not in the chain's `public.methods` | Switch that transport from `/public` to the keyed URL | Each BlockVectra error includes `data.reason` and a `docs_url`; the full list is on the [errors page](https://docs.blockvectra.com/en/errors/). ## Official documentation * [coinbase/agentkit on GitHub](https://github.com/coinbase/agentkit) * [viem HTTP transport](https://viem.sh/docs/clients/transports/http.html) ## Common questions **Does BlockVectra see the wallet private key?** No. The viem account signs locally; the endpoint receives reads and signed raw transactions. **Can the agent read logs through the public endpoint?** No. `eth_getLogs` and the Data API need an API key. **Does the key go in the MCP tool arguments?** No. Keep it in the environment or the MCP client headers. ## Next steps * [Agent framework overview](https://docs.blockvectra.com/en/guides/agent-frameworks/) for LangChain, ElizaOS, viem and wagmi. * [Connect an AI agent](https://docs.blockvectra.com/en/guides/ai-agents/) to discover endpoints with MCP, llms.txt and OpenAPI. * [Billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) for CU metering, rate limits and non-billed errors. --- # Deploy a contract with Foundry or Hardhat Source: https://docs.blockvectra.com/en/guides/deploy-contract/ ## Select the network Follow the target chain's integration guide (accessed via [Supported Chains](https://docs.blockvectra.com/en/chains/)) to create `network.mjs` and export `RPC_URL` and `CHAIN_ID`. Chain guides read the chain ID and method policy from [GET /v1/chains](https://api.blockvectra.com/v1/chains) and explain the gas token, whether a separate broadcasting RPC is required, and chain-specific deployment settings. Choose one tool below. Both deploy the same small contract without constructor arguments. Fund the deployer with the selected network’s native gas token. Set `DEPLOYER_PRIVATE_KEY` securely in your local environment; never commit it. The following commands broadcast a transaction and spend gas. Create `Hello.sol` with no constructor arguments: ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; contract Hello { event Ping(address indexed sender); function ping() external { emit Ping(msg.sender); } function hello() external pure returns (string memory) { return "hello"; } } ``` ### Foundry In an initialized Foundry project, place the contract at `src/Hello.sol` and use this `foundry.toml`: ```toml [profile.default] src = "src" out = "out" libs = ["lib"] solc_version = "0.8.24" evm_version = "paris" [rpc_endpoints] target = "${RPC_URL}" ``` ```bash : "${RPC_URL:?Set RPC_URL}" "${CHAIN_ID:?Set CHAIN_ID}" "${DEPLOYER_PRIVATE_KEY:?Set deployer key}" test "$(cast chain-id --rpc-url "$RPC_URL")" = "$CHAIN_ID" || exit 1 forge build forge create src/Hello.sol:Hello --rpc-url target \ --chain "$CHAIN_ID" --private-key "$DEPLOYER_PRIVATE_KEY" --broadcast ``` Keep the transaction hash and deployed address. Use `cast receipt "$TX_HASH" --rpc-url "$RPC_URL"` to inspect inclusion and status, then `cast call "$CONTRACT_ADDRESS" "hello()(string)" --rpc-url "$RPC_URL"` to read the contract. Set these two variables from the deployment output. ### Hardhat 2 with ethers 6 In a separate CommonJS project (`npm init -y`), install `npm install --save-dev hardhat@2 @nomicfoundation/hardhat-ethers@3 ethers@6`. Place the same contract at `contracts/Hello.sol`. Save this as `hardhat.config.cjs`: ```js require('@nomicfoundation/hardhat-ethers'); const { RPC_URL, CHAIN_ID, DEPLOYER_PRIVATE_KEY } = process.env; if (!RPC_URL || !/^[1-9][0-9]*$/.test(CHAIN_ID ?? '') || !DEPLOYER_PRIVATE_KEY) { throw new Error('Set RPC_URL, CHAIN_ID and DEPLOYER_PRIVATE_KEY'); } module.exports = { solidity: { version: '0.8.24', settings: { evmVersion: 'paris' } }, networks: { target: { url: RPC_URL, chainId: Number(CHAIN_ID), accounts: [DEPLOYER_PRIVATE_KEY] }, }, }; ``` Create the `scripts` directory and save as `scripts/deploy.cjs`: ```js const { ethers } = require('hardhat'); async function main() { const contract = await ethers.deployContract('Hello'); console.log(contract.deploymentTransaction().hash); await contract.waitForDeployment(); console.log(await contract.getAddress()); } main().catch(error => { console.error(error); process.exitCode = 1; }); ``` ```bash npx hardhat compile npx hardhat run scripts/deploy.cjs --network target ``` The network’s `chainId` is checked against the RPC. See the [Hardhat 2 network settings](https://v2.hardhat.org/hardhat-runner/docs/config) and [Foundry settings](https://www.getfoundry.sh/config/index.html) (accessed: 2026-10-07). ## Read events Set `LOG_ADDRESS` to the deployed address. Follow the event reading method in the target chain's guide (WebSocket subscription or HTTP chunked polling, depending on the chain's `ws` field in `/v1/chains`) to read `Ping` events after calling `ping()`. --- # DEX daily prices API: OHLC and VWAP for any token Source: https://docs.blockvectra.com/en/guides/dex-daily-prices/ `GET /{chain}/dex/prices` returns daily DEX open, high, low, close and VWAP prices for one token for a date range. Developers and AI agents call it with the same API key. ```bash curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/dex/prices?token=0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D&from=2026-09-01&to=2026-09-30" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` ## What the DEX daily prices dataset is BlockVectra's DEX dataset indexes decentralized exchange trade activity and computes aggregated daily pricing metrics. The DEX daily prices endpoint (`getDexPrices`) provides the daily volume-weighted average price (VWAP), price indicators (fields `first_price`, `last_price`, `min_price`, and `max_price`), and volume metrics for a specified token over a given date range. Availability of this dataset varies across networks; chains providing this dataset are subject to the [Supported Chains](https://docs.blockvectra.com/en/chains/) page. This endpoint is not paginated: all matching daily rows within the requested date span are returned directly in `data`, and `next_cursor` is never present. If your application requires granular swap transactions rather than daily aggregates, use `GET /{chain}/dex/swaps` (see the [Data API Reference](https://docs.blockvectra.com/en/api/data/)). ## Request parameters and limits The endpoint route is `GET https://api.blockvectra.com/v1/data/{chain}/dex/prices`. All requests require authentication by supplying your API key in the `x-api-key` header. The endpoint accepts the following query parameters: | Parameter | Location | Type | Required | Description | | --------- | -------- | ----------- | -------- | ---------------------------------------------------------------------------- | | `chain` | path | string | Yes | Chain identifier, e.g. `robinhood_mainnet` | | `token` | query | string | Yes | 20-byte base token address, `0x` optional, either case | | `quote` | query | string | No | Optional 20-byte quote token address to restrict to a single base/quote pair | | `from` | query | date string | Yes | UTC start date, inclusive, `YYYY-MM-DD` | | `to` | query | date string | Yes | UTC end date, inclusive, `YYYY-MM-DD`. `to - from` must be `<= 90` days | ### Constraints and error codes When a request violates constraints, the API returns a structured error body `{"error":{"code","message"}}`: * **HTTP 400 (`bad_request`)**: Missing required query parameters (`token`, `from`, or `to`), invalid `token`/`quote` address syntax, invalid `YYYY-MM-DD` calendar dates, or `from` is after `to`. * **HTTP 409 (`span_exceeded`)**: `to - from` is more than 90 days. * **HTTP 404 (`error.code: not_found`, `error.data.reason: unknown_chain`)**: `{chain}` is unknown or not public in `GET /chains`; chain lookup precedes query validation. * **HTTP 422 (`no_coverage`)**: The chain does not support the `dex_prices` dataset capability. * **HTTP 503 (`unavailable`)**: Service temporarily unavailable; retry according to the `Retry-After` header. ## Request examples The following examples query daily DEX prices for a base token across September 2026: **cURL** ```bash curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/dex/prices?token=0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D&from=2026-09-01&to=2026-09-30" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts const url = new URL("https://api.blockvectra.com/v1/data/robinhood_mainnet/dex/prices"); url.searchParams.set("token", "0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D"); url.searchParams.set("from", "2026-09-01"); url.searchParams.set("to", "2026-09-30"); const res = await fetch(url, { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY!, }, }); if (!res.ok) { throw new Error(`Request failed with status ${res.status}`); } const body = await res.json(); console.log(body); ``` **Python** ```python import os import requests res = requests.get( "https://api.blockvectra.com/v1/data/robinhood_mainnet/dex/prices", params={ "token": "0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D", "from": "2026-09-01", "to": "2026-09-30", }, headers={ "x-api-key": os.environ["BLOCKVECTRA_API_KEY"], }, ) res.raise_for_status() print(res.json()) ``` ## Detailed field reference Each entry in `data` represents aggregated daily DEX metrics for the token pair on that UTC date: ### Token and quote assets * `day` (string): UTC date in `YYYY-MM-DD` format. * `token` (string): 20-byte base token address in lowercase `0x`-prefixed hex. * `token_symbol` (string or `null`): Base token symbol. * `token_name` (string or `null`): Base token display name. * `quote_token` (string): Quote asset address. The all-zero address (`0x0000000000000000000000000000000000000000`) represents native ETH as the quote asset. * `quote_symbol` (string or `null`): Quote asset symbol (`"ETH"` when `quote_token` is the all-zero address). * `quote_name` (string or `null`): Quote asset display name (`"Ether"` when `quote_token` is the all-zero address). * `base_decimals` (integer or `null`): Base token decimals (0–255). * `quote_decimals` (integer or `null`): Quote asset decimals (`18` when `quote_token` is the all-zero address). ### Volume and trade counts * `swap_count` (integer): Swap count for this row. * `base_volume_raw` (string): Atomic base volume as an unsigned integer decimal string (`UInt256String`). * `quote_volume_raw` (string): Atomic quote volume as an unsigned integer decimal string (`UInt256String`). * `base_volume` (string or `null`): Human-readable base token volume scaled by `base_decimals` as a `DecimalString`; `null` when `base_decimals` is unknown. * `quote_volume` (string or `null`): Quote volume scaled by quote decimals as a `DecimalString`, or `null`. ### Price indicators and VWAP * `vwap` (string or `null`): Volume-weighted average price as a `DecimalString`, or `null`. * `first_price` (string or `null`): First price indicator as a `DecimalString`, or `null`. * `last_price` (string or `null`): Last price indicator as a `DecimalString`, or `null`. * `min_price` (string or `null`): Minimum price indicator as a `DecimalString`, or `null`. * `max_price` (string or `null`): Maximum price indicator as a `DecimalString`, or `null`. ### Exact fraction fields * `first_price_numerator` / `first_price_denominator` (string): Raw integer amounts of the swap behind `first_price` (`UInt256String`): the numerator is `quote_amount_raw` in quote atomic units and the denominator is `base_amount_raw` in base atomic units. They are not the scaled human-readable `first_price` as an exact fraction. * `last_price_numerator` / `last_price_denominator` (string): Raw integer amounts of the swap behind `last_price` (`UInt256String`): the numerator is `quote_amount_raw` in quote atomic units and the denominator is `base_amount_raw` in base atomic units. They are not the scaled human-readable `last_price` as an exact fraction. * `min_price_numerator` / `min_price_denominator` (string): Raw integer amounts of the swap behind `min_price` (`UInt256String`): the numerator is `quote_amount_raw` in quote atomic units and the denominator is `base_amount_raw` in base atomic units. They are not the scaled human-readable `min_price` as an exact fraction. * `max_price_numerator` / `max_price_denominator` (string): Raw integer amounts of the swap behind `max_price` (`UInt256String`): the numerator is `quote_amount_raw` in quote atomic units and the denominator is `base_amount_raw` in base atomic units. They are not the scaled human-readable `max_price` as an exact fraction. * `refreshed_at` (string): Refresh timestamp for this row (ISO-8601 UTC timestamp). The raw ratio `numerator / denominator` is quote atomic units per base atomic unit. The human-readable price (quote tokens per base token) is the raw ratio × 10^(`base_decimals` − `quote_decimals`). When `base_decimals` or `quote_decimals` is `null`, the human-readable price is unknown; do not assume 18. `0` is a valid decimals value. When a denominator is `0`, do not divide; treat the human-readable price as `null`. For the same pair (same decimals), price direction and relative change can be computed directly from the raw ratios. ### Envelope metadata (`meta`) * `chain`: Chain identifier. * `chain_slug`: Canonical uppercase chain slug. * `chain_external_id`: CAIP-2 formatted chain identifier. * `as_of_block`: The chain's newest fully written block (reported by this dataset, not checked against request parameters). * `coverage`: Coverage classification (reports `"full"` for this endpoint). * `refreshed_at`: Metadata refreshed timestamp. May be `null`: `null` means the update time of this data is unknown and it should be treated as stale; block-based endpoints always return a value. ## Why prices use exact numerators and denominators Standard JSON numbers rely on IEEE-754 double-precision floats, which present precision limitations: 1. **Floating-point truncation and drift**: Float64 values provide only 53 bits of precision, and dividing token quantities yields rounding drift that compounds across calculations. 2. **Transport safety**: Formatting values as decimal strings (`UInt256String`) ensures numbers travel across HTTP without losing precision in JSON parsers. By providing the exact integer numerator and denominator for price indicators, BlockVectra enables exact mathematical calculations without floating-point conversion. ### Handling exact fractions in TypeScript (BigInt) In TypeScript, native `BigInt` handles ratio comparison and decimals scaling without floating-point conversion. `isPriceUp` compares the raw ratios of one pair; `rawRatioToHumanString` applies the decimals scaling and returns `null` when decimals are unknown or the denominator is `0`. Its output is truncated (not rounded) to `displayDigits` digits: this is display truncation, separate from the token's own precision, and does not claim an exact finite decimal expansion. ```ts interface DexDailyPrice { base_decimals: number | null; quote_decimals: number | null; // Raw amounts: numerator is quote_amount_raw, denominator is base_amount_raw. first_price_numerator: string; first_price_denominator: string; last_price_numerator: string; last_price_denominator: string; } // 1. Raw ratios of one pair share the same decimals, so they compare directly. // a / b > c / d is equivalent to a * d > c * b (denominators must be non-zero) export function isPriceUp(row: DexDailyPrice): boolean | null { const openNum = BigInt(row.first_price_numerator); const openDen = BigInt(row.first_price_denominator); const closeNum = BigInt(row.last_price_numerator); const closeDen = BigInt(row.last_price_denominator); if (openDen === 0n || closeDen === 0n) return null; return closeNum * openDen > openNum * closeDen; } // 2. Raw ratio -> human-readable price (quote tokens per base token): // human = numerator / denominator * 10^(baseDecimals - quoteDecimals) // Returns null when a decimals value is null (0 is valid) or the denominator is 0. // The result is truncated to displayDigits digits for display only. export function rawRatioToHumanString( numeratorStr: string, denominatorStr: string, baseDecimals: number | null, quoteDecimals: number | null, displayDigits = 18 ): string | null { if (baseDecimals === null || quoteDecimals === null) return null; let num = BigInt(numeratorStr); let den = BigInt(denominatorStr); if (den === 0n) return null; const shift = baseDecimals - quoteDecimals; if (shift >= 0) { num *= 10n ** BigInt(shift); } else { den *= 10n ** BigInt(-shift); } const unit = 10n ** BigInt(displayDigits); const scaled = (num * unit) / den; const intPart = scaled / unit; if (displayDigits === 0) return intPart.toString(); const fracPart = (scaled % unit).toString().padStart(displayDigits, "0"); return `${intPart}.${fracPart}`; } ``` ### Handling exact fractions in Python Python's standard library provides `fractions.Fraction` for exact rational arithmetic. `human_price` applies the decimals scaling exactly and returns `None` when decimals are unknown or the denominator is `0`; `format_fraction` rounds half to even with integer arithmetic, only for display. ```python from fractions import Fraction def raw_ratio(numerator, denominator): """Raw ratio: quote atomic units per base atomic unit. None when the denominator is 0.""" den = int(denominator) if den == 0: return None return Fraction(int(numerator), den) def human_price(numerator, denominator, base_decimals, quote_decimals): """Quote tokens per base token = raw ratio * 10^(base_decimals - quote_decimals). Returns None when a decimals value is None (0 is valid) or the denominator is 0. """ if base_decimals is None or quote_decimals is None: return None raw = raw_ratio(numerator, denominator) if raw is None: return None return raw * Fraction(10) ** (base_decimals - quote_decimals) def percentage_change(row): """Same pair, same decimals: raw ratios compare directly. Exact Fraction, no float.""" open_raw = raw_ratio(row["first_price_numerator"], row["first_price_denominator"]) close_raw = raw_ratio(row["last_price_numerator"], row["last_price_denominator"]) if open_raw is None or close_raw is None or open_raw == 0: return None return (close_raw - open_raw) / open_raw * 100 def format_fraction(value, digits=18): """Display only: round half to even at `digits` places with exact integer arithmetic.""" quotient, remainder = divmod(abs(value.numerator) * 10**digits, value.denominator) twice = remainder * 2 if twice > value.denominator or (twice == value.denominator and quotient % 2 == 1): quotient += 1 whole, fraction = divmod(quotient, 10**digits) text = str(whole) if digits == 0 else f"{whole}.{fraction:0{digits}d}" return f"-{text}" if value < 0 and quotient != 0 else text ``` ## Backfilling one year of daily prices To backfill a year of data (365 days) within the 90-day span limit, divide the full date range into consecutive windows of at most 90 days and issue chunked requests: ```ts interface DateSpan { from: string; to: string; } /** * Split a large date range into consecutive spans of at most maxDays (default: 90) */ export function splitDateRange(startDateStr: string, endDateStr: string, maxDays = 90): DateSpan[] { const spans: DateSpan[] = []; let currentStart = new Date(startDateStr); const end = new Date(endDateStr); while (currentStart <= end) { const chunkEnd = new Date(currentStart); chunkEnd.setUTCDate(chunkEnd.getUTCDate() + (maxDays - 1)); const effectiveEnd = chunkEnd < end ? chunkEnd : end; spans.push({ from: currentStart.toISOString().slice(0, 10), to: effectiveEnd.toISOString().slice(0, 10), }); const nextStart = new Date(effectiveEnd); nextStart.setUTCDate(nextStart.getUTCDate() + 1); currentStart = nextStart; } return spans; } /** * Backfill token daily prices across multiple 90-day chunks */ export async function backfillTokenDailyPrices( chain: string, token: string, startDate: string, endDate: string, apiKey: string ) { const chunks = splitDateRange(startDate, endDate, 90); const allDailyPrices = []; for (const chunk of chunks) { const url = new URL(`https://api.blockvectra.com/v1/data/${chain}/dex/prices`); url.searchParams.set("token", token); url.searchParams.set("from", chunk.from); url.searchParams.set("to", chunk.to); const res = await fetch(url, { headers: { "x-api-key": apiKey }, }); if (!res.ok) { throw new Error(`Failed to fetch span ${chunk.from}..${chunk.to}: HTTP ${res.status}`); } const json = await res.json(); allDailyPrices.push(...json.data); } return allDailyPrices; } ``` ## Capacity and CU usage calculations Every Data API endpoint meters consumption in Compute Units (CU). The per-call CU weight for `data.dex_prices` and the estimated consumption for token backfills are calculated below: - **Method weight:** `data.dex_prices` = 15 CU / call. - **Backfilling 1 year of daily prices for 200 tokens:** with a max span of 90 days per request, covering 365 days takes 5 chunks per token, totaling 1,000 calls. Total consumption is 15,000 CU (approx <0.1% of the free plan cycle allowance), about <$0.01 at list price. - **Daily maintenance (refreshing 200 tokens once per day):** 200 calls/day (3,000 CU/day), totaling approximately 6,000 calls per 30-day cycle (90,000 CU, approx 0.3% of the free quota), about <$0.01/month at list price. When scaling your backfill volume or requiring higher request concurrency, top up on-chain on the console [Billing page](https://console.blockvectra.com/billing/) to upgrade to a paid account. For active rates and unit conversions, see the [Pricing page](https://blockvectra.com/en/pricing/). ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # ElizaOS EVM plugin RPC provider: BlockVectra setup Source: https://docs.blockvectra.com/en/guides/elizaos/ BlockVectra works as the RPC provider for the ElizaOS EVM plugin, `@elizaos/plugin-evm`, which reads its RPC URLs from the environment. Set `EVM_PROVIDER_URL` to `https://api.blockvectra.com/v1/eth_mainnet/public` and the plugin uses BlockVectra for Ethereum mainnet with no API key. The Free Plan adds keyed methods with 30,000,000 CU per 30-day window. Checked 2026-10-21. ```bash # .env (the plugin also needs the wallet key; keep it in your secret store) EVM_PRIVATE_KEY=your-wallet-private-key EVM_PROVIDER_URL=https://api.blockvectra.com/v1/eth_mainnet/public ETHEREUM_PROVIDER_BASE=https://api.blockvectra.com/v1/base_mainnet/public ``` ```json { "name": "DeFiAgent", "plugins": ["@elizaos/plugin-evm"], "settings": { "chains": { "evm": ["base"] } } } ``` Install the plugin with `bun add @elizaos/plugin-evm`. Ethereum mainnet is enabled by default; every other chain you list in `settings.chains.evm` must use its `viem/chains` export name, and its URL variable is `ETHEREUM_PROVIDER_` in upper case, as in the plugin's [README on npm](https://www.npmjs.com/package/@elizaos/plugin-evm). ## Use an API key Public endpoints cover only the methods in each chain's `public.methods`. For the rest, put the key in the URL path (`/v1/{chain}/{api_key}`). The plugin takes only a URL, so this is the one place the key travels in the path. Export the variables in the shell that starts the agent so the key never lands in a file you commit: ```bash export EVM_PROVIDER_URL=https://api.blockvectra.com/v1/eth_mainnet/${BLOCKVECTRA_API_KEY} export ETHEREUM_PROVIDER_BASE=https://api.blockvectra.com/v1/base_mainnet/${BLOCKVECTRA_API_KEY} ``` URLs can show up in logs, proxies and error messages, so use a separate key with a low `cu_cap` for the agent, and revoke it in the console if it leaks. To create the key without a browser, follow the four steps in the [programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/?ref=docs-elizaos): challenge, signature, login, then `POST /keys`. Developers can also [create a key in the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F\&ref=docs-elizaos). The same key works on every chain, so one key serves each `ETHEREUM_PROVIDER_*` variable. ## Add the docs MCP server `@elizaos/plugin-mcp` lets a character use remote MCP servers over Streamable HTTP. Install it with `bun add @elizaos/plugin-mcp`, then register the BlockVectra docs server in the character settings: ```json { "plugins": ["@elizaos/plugin-evm", "@elizaos/plugin-mcp"], "settings": { "mcp": { "servers": { "blockvectra": { "type": "streamable-http", "url": "https://docs.blockvectra.com/mcp" } } } } } ``` The agent can then call `list_chains`, `get_status`, `rpc_call`, `read_doc` and the other tools listed on the [MCP server page](https://docs.blockvectra.com/en/guides/mcp-server/), keyless. The plugin's documented HTTP options are `type`, `url` and `timeout`; it documents no header option, so keyed MCP tools are out of reach from this config. Keep keyed reads in `plugin-evm` as above. ## Errors you may see | Response | Meaning | What to do | | ------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------- | | HTTP 401, `-32024`, `missing_api_key` | A keyed URL was called without a key | Put the key in the path or the `x-api-key` header | | HTTP 401, `-32024`, `invalid_api_key` | Key unknown, disabled or revoked | Check the key in the console; a new key takes a few seconds to activate | | `-32601`, `method_not_public` | Method is not in the chain's `public.methods` | Switch that chain's URL from `/public` to the keyed form | | Chain not recognised | Name in `settings.chains.evm` does not match a `viem/chains` name | Use the exact `viem/chains` name | Each BlockVectra error includes `data.reason` and a `docs_url`; the full list is on the [errors page](https://docs.blockvectra.com/en/errors/). ## Official documentation * [ElizaOS documentation](https://elizaos.github.io/eliza/) * [elizaos/eliza on GitHub](https://github.com/elizaos/eliza) * [`@elizaos/plugin-evm` on npm](https://www.npmjs.com/package/@elizaos/plugin-evm) * [`@elizaos/plugin-mcp` on npm](https://www.npmjs.com/package/@elizaos/plugin-mcp) ## Common questions **Does `EVM_PROVIDER_URL` apply to Base?** No. It sets Ethereum mainnet only; other chains use `ETHEREUM_PROVIDER_`. **Can an agent sign and send transactions through the public endpoint?** `eth_sendRawTransaction` is in `public.methods` for the chains that list it, with its own lower per-IP rate limit under `public.send_raw_rate_limit` in `GET /v1/chains`. Read the limit there before building on it. **Do I need a key for the MCP server?** No. Connecting and the documentation, chain and pricing tools are keyless. ## Next steps * [Agent framework overview](https://docs.blockvectra.com/en/guides/agent-frameworks/) for LangChain, viem, wagmi and Coinbase AgentKit. * [Connect an AI agent](https://docs.blockvectra.com/en/guides/ai-agents/) to discover endpoints with MCP, llms.txt and OpenAPI. * [Billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) for CU metering, rate limits and non-billed errors. --- # missing trie node and historical eth_call: state window per chain Source: https://docs.blockvectra.com/en/guides/evm-historical-state/ If a historical `eth_call` or `eth_getBalance` fails with `missing trie node`, the serving node no longer holds state for that block. BlockVectra reads state only within each chain's window (`state_window_blocks` in [GET /v1/chains](https://api.blockvectra.com/v1/chains)), counted in blocks behind the head; an older block returns HTTP 200 with JSON-RPC `-32011`, `error.data.reason: state_window` and `retryable: false`. The table below lists every chain's window, keyless history and log span. Checked 2026-11-12. Check the window, the endpoint's authentication mode and the target block before reading an earlier contract value; the `eth_getLogs` block range is a different limit. ## Compare per-chain state windows The table shows published state windows, keyless history, log spans and declared Data API datasets from the public snapshot. For a request now, read [GET /v1/chains](https://api.blockvectra.com/v1/chains) and [GET /v1/status](https://api.blockvectra.com/v1/status) again. Developers and AI Agents should check state windows and log query spans separately. A null state window does not establish archive coverage. Public history applies only to the declared public methods. | Chain | Chain slug | Authenticated state window: state_window_blocks (blocks) | Keyless history: public.history_blocks (blocks) | Authenticated log query span: max_logs_block_range (blocks) | Declared Data API datasets | | --- | --- | --- | --- | --- | --- | | Arbitrum One | `arb_mainnet` | 5,000 | 1,000 | 1,000 | blocks, transactions, address_transactions, transfers, token_metadata, freshness | | Arc | `arc_mainnet` | Not declared | 1,000 | 1,000 | Data API unavailable | | Avalanche C-Chain | `avax_mainnet` | 128 | 128 | 1,000 | Data API unavailable | | Base | `base_mainnet` | 10,000 | 1,000 | 1,000 | blocks, transactions, address_transactions, transfers, token_metadata, freshness | | Berachain | `berachain_mainnet` | 9,000 | 1,000 | 1,000 | Data API unavailable | | Boba | `boba_mainnet` | 80,000 | 1,000 | 1,000 | Data API unavailable | | BNB Smart Chain | `bsc_mainnet` | 100 | 100 | 1,000 | blocks, transactions, address_transactions, transfers, token_metadata, freshness | | Celo | `celo_mainnet` | 864,000 | 1,000 | 1,000 | Data API unavailable | | Ethereum | `eth_mainnet` | 250,000 | 1,000 | 1,000 | blocks, transactions, address_transactions, transfers, token_metadata, freshness | | Ethereum Sepolia | `eth_sepolia` | Not declared | 1,000 | 1,000 | blocks, transactions, address_transactions, transfers, token_metadata, freshness | | Fraxtal | `fraxtal_mainnet` | 10,000 | 1,000 | 1,000 | Data API unavailable | | Gnosis | `gnosis_mainnet` | 262,000 | 1,000 | 1,000 | blocks, transactions, address_transactions, transfers, token_metadata, freshness | | HyperEVM | `hyperevm_mainnet` | Not declared | 1,000 | 1,000 | blocks, transactions, address_transactions, transfers, token_metadata, freshness | | Ink | `ink_mainnet` | 9,000 | 1,000 | 1,000 | Data API unavailable | | Katana | `katana_mainnet` | 86,400 | 1,000 | 1,000 | Data API unavailable | | Linea | `linea_mainnet` | 128 | 128 | 1,000 | Data API unavailable | | Metal L2 | `metall2_mainnet` | 10,000 | 1,000 | 1,000 | Data API unavailable | | Mode | `mode_mainnet` | 10,000 | 1,000 | 1,000 | Data API unavailable | | OP Mainnet | `op_mainnet` | 1,296,000 | 1,000 | 1,000 | blocks, transactions, address_transactions, transfers, token_metadata, freshness | | Polygon | `polygon_mainnet` | 126 | 126 | 1,000 | blocks, transactions, address_transactions, transfers, token_metadata, freshness | | Robinhood Chain | `robinhood_mainnet` | 900 | 900 | 1,000 | blocks, transactions, address_transactions, transfers, token_metadata, dex_swaps, stocks, traces, freshness | | Robinhood Chain Testnet | `robinhood_testnet` | 1,023 | 1,000 | 1,000 | Data API unavailable | | Rootstock | `rootstock_mainnet` | 6,000 | 1,000 | 1,000 | Data API unavailable | | Soneium | `soneium_mainnet` | 9,000 | 1,000 | 1,000 | Data API unavailable | | Sonic | `sonic_mainnet` | 11,000 | 1,000 | 1,000 | Data API unavailable | | Unichain | `unichain_mainnet` | 85,500 | 1,000 | 1,000 | Data API unavailable | | World Chain | `world_mainnet` | 30,000 | 1,000 | 1,000 | Data API unavailable | | X Layer | `xlayer_mainnet` | 250,000 | 1,000 | 1,000 | Data API unavailable | | Zora | `zora_mainnet` | 10,000 | 1,000 | 1,000 | Data API unavailable | [GET /v1/chains](https://api.blockvectra.com/v1/chains) · Sampled (UTC): 2026-11-12 [GET /v1/status](https://api.blockvectra.com/v1/status) · Sampled (UTC): 2026-11-12 ## Three different historical limits | Field in [GET /v1/chains](https://api.blockvectra.com/v1/chains) | What it controls | What to check | | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | `state_window_blocks` | How far back authenticated state reads such as `eth_call`, `eth_getBalance`, `eth_getCode` and `eth_getStorageAt` can query | With head `H` and declared window `W`, a numbered block older than `H − W` is outside the window. Check `methods.allow` and `methods.deny` too. | | `public.history_blocks` | Historical block references through the keyless `public.url` | Use only `public.methods`. For state reads, the smaller of the public history and the declared state window applies. | | `max_logs_block_range` | The number of blocks in one authenticated `eth_getLogs` request | Count `toBlock − fromBlock + 1`. A permitted span does not establish that old contract state or logs are available. | These limits are in blocks, not days. A `null` or undeclared state window does not establish archive coverage. Keyless method availability is separate from authenticated method availability: a log span alone does not enable public `eth_getLogs`. ## Choose a block tag Use `latest` for the current value. For a historical comparison, read `eth_blockNumber` once and convert a chosen block number to a hexadecimal quantity such as `0x18efa2f`. Keep that number fixed for every call in the comparison; repeated `latest` calls can use different blocks. For state reads, `earliest`, `safe` and `finalized` return `-32011` under the state-window policy. Choose an explicit block number within the declared window instead. A block-hash form is not a way to obtain additional history: keyless state reads reject it, and an authenticated request still depends on available state. A block number may refer to a different block after a reorganization. Record the block hash with `eth_getBlockByNumber` if you need to identify the result's block. An in-window number also needs a synced chain and an existing contract at that height. ## Fixed-block contract read On Ethereum, WETH at `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2` exposes `decimals()` with selector `0x313ce567`. A keyless call sampled on 2026-10-08 (UTC) at block `0x18efa2f` returned HTTP 200 with this result: Request to the chain's `public.url`: ```json { "jsonrpc": "2.0", "id": 2, "method": "eth_call", "params": [ { "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "data": "0x313ce567" }, "0x18efa2f" ] } ``` Response: ```json { "jsonrpc": "2.0", "id": 2, "result": "0x0000000000000000000000000000000000000000000000000000000000000012" } ``` The ABI-encoded integer is 18. The result is a decimals value, not a balance, and does not establish availability at other heights. That fixed block will age out of a bounded window; use a recent block when running the following example later. Save the example as `historical-state.mjs` and run `node historical-state.mjs` with Node.js 24 or later and your `BLOCKVECTRA_API_KEY` environment variable set. It uses the authenticated endpoint, keeps the same contract and calldata, and compares `latest`, one fixed recent block and a block outside the published authenticated window. Each output includes the actual HTTP status and JSON-RPC body; an HTTP 200 can still contain an error. It stops on an unexpected response instead of treating it as a successful read. ```js const key = process.env.BLOCKVECTRA_API_KEY; if (!key) throw new Error('Set BLOCKVECTRA_API_KEY'); const chainsUrl = 'https://api.blockvectra.com/v1/chains'; const catalogResponse = await fetch(chainsUrl, { signal: AbortSignal.timeout(15_000) }); if (!catalogResponse.ok) throw new Error(`Chains HTTP ${catalogResponse.status}`); const catalog = await catalogResponse.json(); const chain = catalog.chains.find(item => item.chain === 'eth_mainnet'); const matches = (method, pattern) => pattern.endsWith('*') ? method.startsWith(pattern.slice(0, -1)) : method === pattern; if (!chain?.jsonrpc || !['eth_call', 'eth_blockNumber'].every(method => chain.methods?.allow?.some(pattern => matches(method, pattern)) && !chain.methods?.deny?.some(pattern => matches(method, pattern)))) { throw new Error('Required methods are unavailable'); } const window = chain.state_window_blocks; if (!Number.isSafeInteger(window) || window < 10) { throw new Error('This example needs a declared state window of at least 10 blocks'); } const rpcUrl = new URL('./eth_mainnet', chainsUrl).href; let id = 0; async function rpc(method, params) { const response = await fetch(rpcUrl, { method: 'POST', redirect: 'error', signal: AbortSignal.timeout(15_000), headers: { 'Content-Type': 'application/json', 'x-api-key': key }, body: JSON.stringify({ jsonrpc: '2.0', id: ++id, method, params }), }); return { http: response.status, body: await response.json() }; } const headResponse = await rpc('eth_blockNumber', []); if (headResponse.http !== 200 || headResponse.body.error || !/^0x[0-9a-f]+$/i.test(headResponse.body.result ?? '')) { throw new Error(`Cannot read head: ${JSON.stringify(headResponse)}`); } const head = BigInt(headResponse.body.result); if (head <= BigInt(window)) throw new Error('Head is too low for an out-of-window block'); const hex = value => `0x${value.toString(16)}`; const fixedBlock = hex(head - 10n); const outsideBlock = hex(head - BigInt(window) - 1n); const call = { to: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', data: '0x313ce567' }; for (const block of ['latest', fixedBlock, outsideBlock]) { const reply = await rpc('eth_call', [call, block]); console.log(JSON.stringify({ head: hex(head), block, ...reply })); if (block === outsideBlock) { if (reply.http !== 200 || reply.body.error?.code !== -32011 || reply.body.error?.data?.reason !== 'state_window') { throw new Error('Expected state_window; inspect the actual response above'); } } else if (reply.http !== 200 || reply.body.error || reply.body.result !== '0x0000000000000000000000000000000000000000000000000000000000000012') { throw new Error('Expected the WETH decimals result; inspect the actual response above'); } } ``` The recorded response above uses `public.url`; the script uses an API key. To make a keyless read, take the URL directly from `public.url`, omit the key, and choose a block within `public.history_blocks` as well as the state window. Changing authentication can change the permitted history, even for the same contract and calldata. ## Diagnose an out-of-window error On the same keyless endpoint, a call sampled on 2026-10-08 (UTC) changing only the target block to `0x18ef650` (and the request ID) returned HTTP 200 with `error.code: -32011`, `error.data.reason: state_window` and `error.data.retryable: false`. Its message was `block reference is outside the public history window`. This is a public-history failure; the authenticated endpoint has its own state window. Use these fields from the [state\_window error entry](https://docs.blockvectra.com/en/errors/#state_window) to recognize the failure rather than relying on a particular window number in the message: | Field | Documented value or meaning | | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | HTTP status | `200`; inspect the JSON-RPC `error` even when HTTP succeeds | | `error.code` | `-32011` | | `error.message` | Authenticated state-window errors describe the most recent supported block count; public-history errors can use a different message | | `error.data.reason` | `state_window` | | `error.data.docs_url` | Link to the error catalog's `state_window` explanation | | `error.data.retryable` | `false`: sending the same request later does not restore older state | Choose a newer numbered block or use `latest` if the task needs the current value. Reducing an `eth_getLogs` span does not recover historical `eth_call` state. Other `-32011` reasons have different actions: [range\_not\_indexed](https://docs.blockvectra.com/en/errors/#range_not_indexed) requires a covered range; [history\_not\_ready](https://docs.blockvectra.com/en/errors/#history_not_ready) allows retry after indexing catches up. Inspect `error.data.reason`, not only the numeric code. Underlying state can also be unavailable with `-32000`, or pruned block history with `4444`; see the [error catalog](https://docs.blockvectra.com/en/errors/). Do not retry an old block unchanged or assume a larger declared window guarantees every response. ## Choose the next query For a complete workload checklist and self-tests, start with [How to choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/). When choosing a provider for repeated contract reads, [compare daily and cycle budgets for EVM reads](https://docs.blockvectra.com/en/guides/infura-alternative/). Check the required historical blocks first, then plan the task's daily distribution and throughput; fitting a credit budget does not establish state coverage. When comparing providers for historical reads, first confirm that both can serve the target block. The [full-request overage comparison](https://docs.blockvectra.com/en/guides/chainstack-alternative/) compares extra RU prices with method-based costs, separates included quota from extra usage, and explains full versus archive billing classes. For earlier indexed blocks, transactions, transfers or other datasets, check the table's declared Data API datasets and the [Data API reference](https://docs.blockvectra.com/en/api/data/). Indexed records do not provide arbitrary historical contract execution or imply that every chain has historical balances. * [eth\_call method reference](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_call/) for call parameters and return encoding. * [eth\_getLogs block range and chunked queries](https://docs.blockvectra.com/en/guides/getlogs-block-range/) for event-log history. * [Wallet custom RPC setup](https://docs.blockvectra.com/en/guides/wallet-custom-rpc/) for wallet connections and dedicated keys. * [Supported chains](https://docs.blockvectra.com/en/chains/) for network availability and [CU pricing](https://docs.blockvectra.com/en/guides/reading-cu-pricing/) for method costs. --- # Free RPC credits: how many free CU and calls you get Source: https://docs.blockvectra.com/en/guides/free-plan/ The free RPC credits are 30,000,000 CU per 30-day window, enough for about 2,000,000 `eth_call` requests at 15 CU each, with no credit card. Developers and AI agents share one account-wide cap of 25 calls per second, and credits are pooled across chains, JSON-RPC and the Data API. ```bash curl -s "https://console-api.blockvectra.com/v1/plans" | jq '.free' ``` Values come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans). Checked 2026-10-21; see [how CU converts to price](https://docs.blockvectra.com/en/guides/reading-cu-pricing/). ## What the free plan is suited for BlockVectra's Free Plan provides an out-of-the-box blockchain interface for developers. Without requiring a credit card, you can use it for local development, personal projects, lightweight automation bots, contract event tracking, and moderate-frequency chain data queries. Billing is metered in Compute Units (CU): each method consumes CU according to its weight, with usage pooled across all chains, JSON-RPC, and the Data API. For detailed billing rules, see the [Pricing page](https://blockvectra.com/en/pricing/). ## Method weights and period capacity The table below calculates the estimated call capacity for common methods within a single usage window based on the active method weights and platform API data: The Free Plan requires registering an account and using an API key; all keys under an account share an average of 25 calls per second (short bursts allowed). At the end of each 30-day cycle, balances below 30,000,000 CU are refilled to 30,000,000 CU. | Method | CU Weight | Approx Calls / Cycle | Approx / Day | List Price / 1M Calls | | --- | --- | --- | --- | --- | | `eth_blockNumber` | 1 | 30,000,000 | 1,000,000 | $0.10 | | `eth_getBlockByNumber` | 5 | 6,000,000 | 200,000 | $0.50 | | `eth_getBalance` | 10 | 3,000,000 | 100,000 | $1.00 | | `eth_call` | 15 | 2,000,000 | 66,666 | $1.50 | | `eth_getLogs` | 30 | 1,000,000 | 33,333 | $3.00 | | `debug_traceTransaction` | 100 | 300,000 | 10,000 | $10.00 | | `data.block` | 5 | 6,000,000 | 200,000 | $0.50 | | `data.address_balances` | 25 | 1,200,000 | 40,000 | $2.50 | | `data.dex_prices` | 15 | 2,000,000 | 66,666 | $1.50 | | `data.transaction_trace` | 200 | 150,000 | 5,000 | $20.00 | ## Task examples and upgrade paths To help you assess usage, here are calculations for representative development tasks: - **Polling eth_blockNumber once per second:** about 2,592,000 calls per cycle, consuming only 8.6% of the free quota. - **Tracking contract events with eth_getLogs:** polling every 60s consumes 4.3%, every 10s consumes 25.9%, and every 2s consumes 129.6% (exceeds free quota). - **Querying balances for 1,000 addresses every 10 minutes (data.address_balances):** total consumption per cycle is 108,000,000 CU, which is 3.6x the free allowance; the average call rate is only 1.67 calls/sec, showing that usage exceeds the CU quota rather than the rate limit; at list price this task's total usage is about $10.80/month — making it a natural upgrade path. ## Getting started and upgrading The free quota is ideal for development, testing, and lightweight workloads. When your traffic expands and requires higher concurrency or more compute units, top up on-chain: get your deposit address from the Console [Billing page](https://console.blockvectra.com/billing/) or `GET /v1/topup/deposit-address` (MCP `get_deposit_address`; see the [Agent top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/)); once credited, the account-wide calls-per-second cap is removed. Each key remains subject to CU rate and burst limits, as described in the [JSON-RPC documentation](https://docs.blockvectra.com/en/api/json-rpc/#method-policy). Any unused Free Credits stay in your Credits and can still be used. For current rates and billing units, please see the [Pricing page](https://blockvectra.com/en/pricing/). ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F\&ref=docs-free-plan) to create an API key. --- # Gas Station: API and wallet authorization Source: https://docs.blockvectra.com/en/guides/gas-station/ ## Access and current availability Gas Station uses a separate HTTPS service origin and a tenant-scoped access token supplied by the Gas Station operator through the existing access arrangement. Use `Authorization: Bearer ` on every endpoint below. A BlockVectra RPC API key is not this token; no self-service token-issuance endpoint is documented here. Keep the token and wallet private keys private. The tenant comes from the token, never from a request body or URL; do not put tokens or idempotency keys in URLs. Execution is currently paused: the nine listed networks are the target set, none is enabled for execution yet, and service-fee collection is off. The directory is a readiness report, not a promise that a listed network can execute a transfer. Read `GET /v1/chains` before planning an execution; do not quote, sign, or submit while execution remains unavailable. ## Chain directory `GET /v1/chains` returns `{ "chains": [...] }`. Each row has `slug`, `id`, `configured`, `runtimeVerified`, `readinessReasons`, and `executionStrategy`. `configured` describes configuration, not successful execution or finality verification. All nine rows currently have `configured=false` and `runtimeVerified=false`. | Chain slug | Chain ID | | ------------------- | -------- | | `arb_mainnet` | 42161 | | `base_mainnet` | 8453 | | `bsc_mainnet` | 56 | | `eth_mainnet` | 1 | | `eth_sepolia` | 11155111 | | `hyperevm_mainnet` | 999 | | `polygon_mainnet` | 137 | | `robinhood_mainnet` | 4663 | | `robinhood_testnet` | 46630 | ## HTTP endpoints Paths are relative to the HTTPS Gas Station origin supplied with access. They are not BlockVectra RPC routes. JSON POST bodies require `Content-Type: application/json`; the reconcile request has no body. Successful responses use HTTP 200. | Method and path | Input | Response | | ------------------------------ | ------------------------------------------------- | ------------------------------------ | | `GET /v1/chains` | No body | Chain readiness directory | | `POST /v1/quotes` | Quote request described below | `Quote` | | `POST /v1/tasks` | `quoteId`, `safeSignatures`, `envelopeSignatures` | `TaskView` | | `GET /v1/quotes/:quoteId/task` | Previously saved quote ID; no body | Associated `TaskView`, or 404 | | `GET /v1/tasks/:id` | Known task ID; no body | `TaskView`, or 404 | | `POST /v1/tasks/:id/reconcile` | Known task ID; no body | Observed `TaskView`; never resubmits | The quote request contains exactly `chain`, `safe`, `sponsor`, `token`, `recipient`, `amount`, and `idempotencyKey`. Use a listed chain slug and the sponsor, asset and recipient permissions assigned to your access. `safe`, `token`, and `recipient` are nonzero EVM addresses. `amount` is a positive integer string in the token's smallest unit, below `2^256`; do not use floating-point token amounts. `chain`, `sponsor`, and `idempotencyKey` use 1–128 ASCII characters from `[A-Za-z0-9_.:-]`. Quote IDs and task IDs instead use 1–128 characters from `[A-Za-z0-9_-]`. ## Review and authorize a quote The execution path is `SAFE_141_VIA_RELAYER_EOA`: a named Gas Station relayer EOA pays the native gas, broadcasts through BlockVectra public RPC and reads the receipt back. It calls `execTransaction` on your Safe 1.4.1, and the Safe executes an allowlisted ERC-20 `transfer(recipient, amount)`. Owners sign locally and no private key is uploaded. This is a compatible Safe workflow, not gas sponsorship for arbitrary EOAs or arbitrary contracts. No UserOperation is created and `execution.entryPoint` is `null`. Authorizations made for the older client path are not valid for this path. A `Quote` contains `id`, `chain`, `chainId`, `safe`, `request`, `requestDigest`, `safeTypedData`, `envelopeTypedData`, `owners`, `threshold`, and `expiresAt`. Review the asset, recipient, amount, policy, actual service relayer, fee caps, units, and validity before signing. `request.execution.sender` and `nonce` are the customer Safe and its Safe nonce. The relayer's outer transaction nonce is assigned by the service at submission, is not part of the quote, and must not replace the Safe nonce. SafeTx uses `value=0`, `operation=0`, `baseGas=0`, `gasPrice=0`, `gasToken=0x0` and `refundReceiver=0x0`, with `safeTxGas>0`; `envelopeTypedData.message.relayer` is the service EOA. Request amounts and caps are nonnegative decimal integer strings; validity timestamps are milliseconds since the Unix epoch. The request digest is the lowercase 64-hex SHA-256 of canonical `{ domain: "gas-station-request-v2", ...request }`, without `0x`. Canonical JSON sorts object keys recursively, preserves array order, uses UTF-8 and has no whitespace. Recompute the normalized request as returned; the envelope uses the same digest with a `0x` prefix. The envelope also binds the SafeTx hash, actual relayer, and validity window. SafeTx itself has no expiry or relayer field; the envelope does not change Safe's on-chain signature semantics. Owners sign SafeTx and the envelope locally. Submit `quoteId` and the two signature arrays, each with `{ owner, signature }` entries. Both arrays contain the same `threshold` owners, strictly ascending by owner address. Each signature is 65-byte `r || s || v`, with `v` equal to 27 or 28. Private keys are never submitted. The SDK checks digest and typed-data binding before signing, including `feeCaps.gas >= gasLimit * maxFeePerGas` and `0 <= maxPriorityFeePerGas <= maxFeePerGas`. SDK validation does not independently verify chain deployments or service-account ownership. ## Idempotency and uncertain submission Within one tenant, an idempotency key binds the original quote intent. Reusing it for different content returns `409 IDEMPOTENCY_CONFLICT`; an expired quote is not renewed by replaying its key. Save `quote.id` before submitting. The SDK makes one HTTP request per method, does not automatically retry submission, and does not follow redirects or switch service origins. If submission times out, loses its response, or returns an unreadable or invalid success response, the SDK reports `SUBMIT_OUTCOME_UNKNOWN`. Query `GET /v1/quotes/:quoteId/task` using the original quote ID. This lookup does not reserve, sign, sponsor, broadcast, or trigger reconciliation. A 404 means no associated task is visible to this tenant on this query; it does not prove the original submission was never accepted. Preserve the unknown outcome after 404 or a failed query; query explicitly again later rather than generating a new key or resubmitting. Once known, retain the task ID for subsequent reads or reconcile. ## Task state and transaction identity `TaskView` contains `id`, `chain`, `safe`, `state`, optional legacy `userOperationHash`, `transactionHash`, `businessSuccess`, `actualCosts`, optional `costProjection`, `blockHash`, and `errorCode`. States are `RESERVED`, `PREPARING`, `EXPIRED`, `SIGNING`, `SIGNED`, `SUBMITTING`, `UNKNOWN`, `ACCEPTED`, `INCLUDED`, `FINALIZED_SUCCEEDED`, and `FINALIZED_FAILED`. `PREPARING` is a queryable progress state, not a server error. Unknown hashes and amounts remain null; `userOperationHash` appears only in older responses. GETs do not sign or send; reconcile can observe status but never signs or rebroadcasts. `userOperationHash` is a legacy optional field from the earlier account-abstraction path; the relayer path creates no UserOperation. `transactionHash` is the relayer's outer on-chain transaction. `blockHash` identifies inclusion. Hashes use `0x` plus 64 hex characters; formatting alone proves neither inclusion nor finality. Outer transaction inclusion or success does not establish business success. Use the task's verified business result and final state. A finalized business result remains available even when costs are incomplete; a failed business operation may still consume gas. ## Known and unknown costs `actualCosts` is either a complete settled `{ gas, serviceFee, apiCu }` object or `null`; null does not mean free. A `FINALIZED_SUCCEEDED` or `FINALIZED_FAILED` task may still have `actualCosts=null` while costs remain unresolved. `costProjection` reports each of `gas`, `serviceFee`, and `apiCu` as `{ unit, knownSubtotal, complete }`. Units come from that task's request; non-null amounts are nonnegative decimal integer strings in that unit. `knownSubtotal=null` means no trusted amount is available. A subtotal with `complete=false` may increase. `complete=true` requires a non-null amount; completeness alone does not create a settlement or prove payment. A `serviceFee` amount is a trusted accounting fact, not a payment, capture, or collection receipt. After settlement, projection amounts equal `actualCosts` without adding CU again. Before settlement, gas and service-fee amounts use verified finalized observations. CU uses the original quote's cumulative cost evidence: unresolved-only requests remain unknown, and partially resolved requests can have a partial subtotal. CU is complete only when all attempts are resolved, its window is closed, and there is no conflicting observation. No requests and no trusted observation still means unknown, even after window closure; a trusted zero is distinct from missing evidence. Caps, HTTP status, and budgets are not actual costs. Reading the projection does not initiate another request for cost evidence or change accounting. Older services may omit `costProjection`; the SDK and CLI preserve omission rather than inserting zeros. A malformed added projection is ignored without changing the original successful response. No prices, fee-collection endpoint, or paid-service availability are offered by this page. ## Errors and paused behavior Errors have the shape `{ "error": { "code": "..." } }`. | HTTP status | Code and meaning | | ----------- | ------------------------------------------------------------------------------------- | | 400 | `INVALID_REQUEST` or `INVALID_SIGNATURE`: invalid input or authorization | | 401 | `UNAUTHORIZED`: missing or invalid Gas Station token | | 403 | `FORBIDDEN`: access does not permit the chain, sponsor, asset, recipient, or amount | | 404 | `NOT_FOUND`, `QUOTE_NOT_FOUND`, or `TASK_NOT_FOUND`: no visible resource | | 409 | `IDEMPOTENCY_CONFLICT`, `QUOTE_EXPIRED`, or `BUDGET_EXCEEDED` | | 429 | `RATE_LIMITED`: respect a supplied `Retry-After`; do not replay uncertain submissions | | 503 | `CHAIN_NOT_READY`: execution is paused or required chain capabilities are unavailable | The readiness gate rejects new execution with `503 CHAIN_NOT_READY` while paused. Authentication, input validation, permissions, expired quotes, and existing task associations still have their own outcomes; not every request during a pause returns 503. A matching replay associated with an existing task returns its facts without sending again. Status reads and reconciliation remain available subject to authentication and permissions; a pause does not turn an unknown result into failure or authorize resubmission. --- # eth_getLogs block range too large: the block range limit per chain and how to split queries Source: https://docs.blockvectra.com/en/guides/getlogs-block-range/ ## Direct answer With an API key, a single `eth_getLogs` request is limited to the target chain's `max_logs_block_range` from [GET /v1/chains](https://api.blockvectra.com/v1/chains): 1,000 blocks on HyperEVM and 1,000 on Robinhood Chain, counting `toBlock − fromBlock + 1` blocks; the table for every chain follows. Checked 2026-11-12. Exceeding it returns HTTP 200, JSON-RPC `-32602` and `error.data.reason: logs_range_too_large`, with `retryable: false` (see the [error catalog](https://docs.blockvectra.com/en/errors/#logs_range_too_large)). Split the interval into `[from, min(from + max − 1, end)]` and advance to the previous chunk's end plus one after success. [Choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/). * **First step:** Run `curl -s "https://api.blockvectra.com/v1/chains"`. With a key, read `max_logs_block_range`, `methods.allow` and `methods.deny`; without a key, first check `public.methods`, then `public.logs`, `public.history_blocks` and the general public policy. * **Done when:** `logs-minimal.mjs` outputs each completed chunk's `fromBlock`, `toBlock` and `result` array through your chosen `TO_BLOCK`, without an HTTP or JSON-RPC error. [Chain parameters and access options](https://blockvectra.com/en/chains/hyperevm_mainnet/). * **Programmatic sign-up**: Autonomous AI agents, automated scripts, and CI pipelines can sign in and provision API keys using Ethereum wallet signatures (EIP-191) without a browser. Follow the [Programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/). * **Web console**: Sign up via Ethereum wallet signature, and generate an API key in the [Console](https://console.blockvectra.com/login/?next=%2Fkeys%2F). See the [Quickstart guide](https://docs.blockvectra.com/en/quickstart/) for setup details. ### Access mode With an API key, read the top-level `max_logs_block_range`. For anonymous access, first confirm that `public.methods` includes `eth_getLogs`, then obey `public.logs` together with `public.history_blocks` and the general public rate/batch policy. `public.logs.max_block_range` is a per-query range; `public.history_blocks` is the block-reference lookback window, separate from the state window. Anonymous `blockHash` support is determined by `public.logs.block_hash_supported`. Missing or unknown policy does not mean unrestricted access. Mainnet permissions do not imply testnet permissions. The example below uses an API key. Save this as `logs-minimal.mjs`, set `BLOCKVECTRA_API_KEY`, the contract address `LOG_ADDRESS`, and a confirmed block window in `FROM_BLOCK` and `TO_BLOCK`, then run `node logs-minimal.mjs` with Node.js 24 or later. Select a chain with `CHAIN`; the default is `robinhood_mainnet`. ```js const { BLOCKVECTRA_API_KEY: key, LOG_ADDRESS: address, FROM_BLOCK, TO_BLOCK } = process.env; if (!key || !/^0x[0-9a-f]{40}$/i.test(address ?? '')) throw new Error('Set BLOCKVECTRA_API_KEY and LOG_ADDRESS'); if (![FROM_BLOCK, TO_BLOCK].every(value => /^(0x[0-9a-f]+|[0-9]+)$/i.test(value ?? ''))) { throw new Error('Set FROM_BLOCK and TO_BLOCK to nonnegative block numbers'); } const start = BigInt(FROM_BLOCK), end = BigInt(TO_BLOCK); if (start > end) throw new Error('FROM_BLOCK must not exceed TO_BLOCK'); const chainSlug = process.env.CHAIN ?? 'robinhood_mainnet'; const chainsUrl = 'https://api.blockvectra.com/v1/chains'; const catalogResponse = await fetch(chainsUrl, { signal: AbortSignal.timeout(15_000) }); if (!catalogResponse.ok) throw new Error(`Chains HTTP ${catalogResponse.status}`); const catalog = await catalogResponse.json(); const chain = catalog.chains.find(item => item.chain === chainSlug); if (!chain || !Number.isSafeInteger(chain.max_logs_block_range) || chain.max_logs_block_range <= 0) { throw new Error('Missing or invalid max_logs_block_range'); } const matches = pattern => pattern.endsWith('*') ? 'eth_getLogs'.startsWith(pattern.slice(0, -1)) : pattern === 'eth_getLogs'; if (!chain.methods?.allow?.some(matches) || chain.methods?.deny?.some(matches)) { throw new Error('eth_getLogs is unavailable on this chain'); } const max = BigInt(chain.max_logs_block_range); const rpcUrl = new URL(`./${chainSlug}`, chainsUrl).href; const hex = value => `0x${value.toString(16)}`; for (let from = start; from <= end;) { const to = from + max - 1n < end ? from + max - 1n : end; const response = await fetch(rpcUrl, { method: 'POST', redirect: 'error', signal: AbortSignal.timeout(15_000), headers: { 'Content-Type': 'application/json', 'x-api-key': key }, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'eth_getLogs', params: [{ address, fromBlock: hex(from), toBlock: hex(to) }] }), }); const body = await response.json(); const valid = body !== null && typeof body === 'object' && !Array.isArray(body) && body.jsonrpc === '2.0' && body.id === 1 && !('error' in body) && Array.isArray(body.result); if (!response.ok || !valid) { throw new Error(`RPC HTTP ${response.status}: ${JSON.stringify(body?.error ?? 'Invalid result')}`); } console.log(JSON.stringify({ fromBlock: hex(from), toBlock: hex(to), result: body.result })); from = to + 1n; } ``` Each output line is a completed chunk. Any HTTP or JSON-RPC error stops the example without skipping the failed chunk. See the batch and rate-limit guidance below for handling 429. ## Empty logs near the chain head An empty `result: []` can be valid when no logs match the filter. If receipts appear to contradict it, compare the same block hash on the same endpoint and apply the same `address` and `topics` filters to the receipt logs; receipts can contain unrelated logs. A [Nethermind 2.1.0 issue](https://github.com/NethermindEth/nethermind/issues/14858) reports a different case: `eth_getLogs` with `blockHash` temporarily returned `[]` before the block became head, while receipts for that hash already contained logs. This is a report about that client and version, not a verified BlockVectra incident. Reducing the block range does not diagnose that discrepancy. For a comparable discrepancy, save the block hash and height, exact filter, observed head, and responses with timestamps; remove API keys and credentials. If the endpoint supports receipt queries, compare only logs that match your filter. Keep that block unresolved in your indexer while checking the contradiction, using bounded retries and your reorg/checkpoint recovery policy. Do not treat every empty result as a failure. The minimal example above queries a confirmed block window; it is not a near-head completeness check. ### BSC: a saved non-empty event comparison [BNB Chain's public endpoint documentation](https://docs.bnbchain.org/bnb-smart-chain/developers/json_rpc/json-rpc-endpoint/) says its listed public mainnet endpoints disable `eth_getLogs`. A method being unavailable is different from a successful `result: []`; that policy alone does not explain a successful empty array when matching receipt logs exist. For BlockVectra, [BSC access options](https://blockvectra.com/en/chains/bsc_mainnet/) require an API key for `eth_getLogs`; the public RPC is not an entry point for this method. The [fixed historical sample](https://gist.github.com/gjwang/5a8f80f5e441a5701e2e01ae73f187bf/cbf598b79c846211e6788c727edac491e79275f5) records three requests on 2026-10-25 at 13:26:17–21 UTC: chain ID 56, a fixed transaction receipt, and an address-only, single-block logs query at block 129476271 (`0x7b7a6af`). The query returned four logs. One ERC-721 `Transfer` for token 1811 matched the receipt on eight fields: `address`, `topics`, `data`, `blockHash`, `blockNumber`, `transactionHash`, `transactionIndex`, and `logIndex`. Download the [ZIP for that fixed version](https://gist.github.com/gjwang/5a8f80f5e441a5701e2e01ae73f187bf/archive/cbf598b79c846211e6788c727edac491e79275f5.zip), extract it, and enter the directory containing the sample files. Downloading needs a network connection; the checker itself runs offline with Node.js 22 or later, without an API key or `npm install`: ```bash node verify-sample.mjs observed-sample.json ``` Expected output: `PASS 1 receipt event matched among 4 returned logs`. This checks one event in a historical archive, not current historical availability, whole-block or whole-history completeness, canonical status, performance, or the cause of an incident. This sample is not input for the whole-block checker below and is not a whole-block acceptance check. ## eth\_getLogs limits by chain These are each chain's `max_logs_block_range` values published by [GET /v1/chains](https://api.blockvectra.com/v1/chains). "Not published" does not mean unlimited. Also check `methods.allow` and `methods.deny` before calling, with deny taking precedence; a block span limit is separate from result count or query duration limits. | Chain | Chain slug | max_logs_block_range (blocks) | | --- | --- | --- | | Arbitrum One | `arb_mainnet` | 1,000 | | Arc | `arc_mainnet` | 1,000 | | Avalanche C-Chain | `avax_mainnet` | 1,000 | | Base | `base_mainnet` | 1,000 | | Berachain | `berachain_mainnet` | 1,000 | | Boba | `boba_mainnet` | 1,000 | | BNB Smart Chain | `bsc_mainnet` | 1,000 | | Celo | `celo_mainnet` | 1,000 | | Ethereum | `eth_mainnet` | 1,000 | | Ethereum Sepolia | `eth_sepolia` | 1,000 | | Fraxtal | `fraxtal_mainnet` | 1,000 | | Gnosis | `gnosis_mainnet` | 1,000 | | HyperEVM | `hyperevm_mainnet` | 1,000 | | Ink | `ink_mainnet` | 1,000 | | Katana | `katana_mainnet` | 1,000 | | Linea | `linea_mainnet` | 1,000 | | Metal L2 | `metall2_mainnet` | 1,000 | | Mode | `mode_mainnet` | 1,000 | | OP Mainnet | `op_mainnet` | 1,000 | | Polygon | `polygon_mainnet` | 1,000 | | Robinhood Chain | `robinhood_mainnet` | 1,000 | | Robinhood Chain Testnet | `robinhood_testnet` | 1,000 | | Rootstock | `rootstock_mainnet` | 1,000 | | Soneium | `soneium_mainnet` | 1,000 | | Sonic | `sonic_mainnet` | 1,000 | | Unichain | `unichain_mainnet` | 1,000 | | World Chain | `world_mainnet` | 1,000 | | X Layer | `xlayer_mainnet` | 1,000 | | Zora | `zora_mainnet` | 1,000 | ## eth\_getLogs block range limits When calling the JSON-RPC `eth_getLogs` method, the block span of a single request is calculated as `toBlock − fromBlock + 1` and cannot exceed the target chain's published `max_logs_block_range`. This limit varies by chain. Per-chain parameters are published through the public endpoint `GET /v1/chains` (chains are listed on [Supported Chains](https://docs.blockvectra.com/en/chains/)). This endpoint is unauthenticated and unbilled. When developing client applications, query this endpoint dynamically at runtime rather than hardcoding block range limits into your code. Filter fields `fromBlock` and `toBlock` default to `latest` when omitted or `null`. ## Common error messages, verbatim Distinguish block span, result count, and query duration: the same JSON-RPC code can describe different failures. | Error text / identifier | Source | What to do | | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | | `eth_getLogs block range too large: max blocks`; `-32602`; `logs_range_too_large` | [BlockVectra error catalog](https://docs.blockvectra.com/en/errors/#logs_range_too_large) | `` is the chain's `max_logs_block_range`; reduce the span before resending. Retrying unchanged does not help. | | `query block range exceeds server limit, narrow your filter: ` | [Erigon eth\_getLogs source](https://github.com/erigontech/erigon/blob/9e603d74f60c21ca793a03a7ce373de19aa3fdc7/rpc/jsonrpc/eth_receipts.go#L343-L347) | `` is that node's range limit; reduce the queried interval before resending. | | `query returns too many logs, narrow your filter: ` | [Erigon eth\_getLogs source](https://github.com/erigontech/erigon/blob/9e603d74f60c21ca793a03a7ce373de19aa3fdc7/rpc/jsonrpc/eth_receipts.go#L439-L442) | `` is that node's result limit; reduce the interval and narrow `address` and `topics`. A single block may still need more specific filters. | In these message templates, `` is replaced by the endpoint's limit. Third-party messages refer to their own endpoints and limits; wording can vary by client version. For BlockVectra, use `/v1/chains` and `error.data.reason`. ## Read the JSON-RPC error behind a Web3.py HTTPError With the synchronous HTTP provider, Web3.py posts through Requests and calls [`raise_for_status()`](https://github.com/ApeWorX/web3.py/blob/982748918289193bf2d0cb831520479f14991078/web3/_utils/http_session_manager.py#L123) on the default, non-streaming path. A 4xx or 5xx reply therefore surfaces as `requests.HTTPError` (as in [web3.py#3915](https://github.com/ApeWorX/web3.py/issues/3915)), and any JSON-RPC `error` the server sent is in `exc.response`. `AsyncHTTPProvider` and `stream=True` are separate paths; this section does not cover them. A Requests `Response` is falsey for 4xx/5xx, so test `exc.response is None`, never `if response`. `w3` and `filter_params` below are your existing client and filter; wrap the call you already make: ```python title="Inspect an HTTP error" import requests def rpc_error_from_http(exc): response = exc.response if response is None: return None try: body = response.json() except ValueError: return None error = body.get("error") if isinstance(body, dict) else None if not isinstance(error, dict): return None data = error.get("data") reason = data.get("reason") if isinstance(data, dict) else None code = error.get("code") return { "status": response.status_code, "code": code if isinstance(code, int) and not isinstance(code, bool) else None, "reason": reason if isinstance(reason, str) else None, } try: logs = w3.eth.get_logs(filter_params) except requests.HTTPError as exc: info = rpc_error_from_http(exc) if info is not None: print(info) raise ``` The helper only reads the status, `code` and `data.reason`; it prints no headers, key, request or full body, and returns `None` when the body is not a JSON object with an `error` object (for example a 502 HTML page). The `raise` keeps the original `HTTPError`, and a 200 reply never reaches the `except`. The diagnosis is not a valid RPC response and carries no logs. How to read it: * A BlockVectra span overrun is not an HTTPError: it returns HTTP 200 with `error.data.reason: logs_range_too_large`, as described below. * `-32602` alone does not mean the span is too large. On another provider, check the actual `message`, `code` and `data` before changing the range. * On 429 or 502, do not shrink the range, retry without a bound, or advance your checkpoint. Retry a bounded number of times, honoring `Retry-After` when present, and move forward only after a chunk succeeds. ## Exceeding the block span limit When a single request's block span `toBlock − fromBlock + 1` exceeds the chain's `max_logs_block_range`, the request is rejected with HTTP 200 and a JSON-RPC error: * **Error code**: `-32602` * **Error message**: `eth_getLogs block range too large: max blocks` * **Billing status**: Not billed. ### Example request This request exceeds the limit only if its block span is larger than the target chain's current `max_logs_block_range`: ```json { "jsonrpc": "2.0", "id": 1, "method": "eth_getLogs", "params": [ { "fromBlock": "0x45a2409", "toBlock": "0x45a27f1" } ] } ``` ### Example response The corresponding error response example: ```json { "jsonrpc": "2.0", "id": 1, "error": { "code": -32602, "message": "eth_getLogs block range too large: max blocks" } } ``` Where `` is the target chain's `max_logs_block_range` (published via `GET /v1/chains`). In a batch request containing multiple calls, if an `eth_getLogs` call exceeds the block span limit, that specific item returns the `-32602` error above and is not billed. ## Performing chunked queries To query logs over a large block interval, first query the target chain's `max_logs_block_range`, divide the target interval into contiguous chunks of `[from, from + max - 1]`, and send sequential requests while aggregating the results. The following examples use `robinhood_mainnet` to demonstrate chunked queries: **cURL** ```bash export BLOCKVECTRA_API_KEY="rgw_your_api_key" # 1. Read max_logs_block_range from the public chains endpoint (unauthenticated, unbilled) curl -s "https://api.blockvectra.com/v1/chains" # 2. Make a single compliant request within the chain's max_logs_block_range (toBlock - fromBlock + 1) curl -s "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "eth_getLogs", "params": [{ "address": "0x1111111111111111111111111111111111111111", "fromBlock": "0x45a2409", "toBlock": "0x45a246c" }] }' ``` **TypeScript** ```ts const CHAIN = "robinhood_mainnet"; const RPC_ENDPOINT = "https://api.blockvectra.com/v1/robinhood_mainnet"; // 1. Fetch max_logs_block_range from the public GET /v1/chains endpoint (unauthenticated, unbilled) const chainsUrl = new URL("/v1/chains", RPC_ENDPOINT); const chainsRes = await fetch(chainsUrl); if (!chainsRes.ok) { throw new Error(`GET /v1/chains failed with HTTP ${chainsRes.status}`); } const { chains } = (await chainsRes.json()) as { chains: Array<{ chain: string; max_logs_block_range: number }>; }; const targetChain = chains.find((c) => c.chain === CHAIN); if (!targetChain) { throw new Error(`Chain ${CHAIN} not found`); } const maxRange = targetChain.max_logs_block_range; if (!Number.isSafeInteger(maxRange) || maxRange <= 0) { throw new Error(`Invalid max_logs_block_range: ${maxRange}`); } // 2. Query chunks sequentially over [from, from + max - 1] and aggregate results (both endpoints inclusive) const fromBlock = 0x45a2409; const toBlock = 0x45a2900; const allLogs: unknown[] = []; let cur = fromBlock; while (cur <= toBlock) { const chunkEnd = Math.min(cur + maxRange - 1, toBlock); const res = await fetch(RPC_ENDPOINT, { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": process.env.BLOCKVECTRA_API_KEY!, }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_getLogs", params: [ { address: "0x1111111111111111111111111111111111111111", fromBlock: "0x" + cur.toString(16), toBlock: "0x" + chunkEnd.toString(16), }, ], }), }); if (!res.ok) { throw new Error(`eth_getLogs failed with HTTP ${res.status}`); } const body: unknown = await res.json(); if (typeof body !== "object" || body === null || Array.isArray(body)) { throw new Error("eth_getLogs response is not a JSON object"); } const envelope = body as { jsonrpc?: unknown; id?: unknown; result?: unknown; error?: unknown }; if ("error" in envelope) { const err = envelope.error as { code?: unknown; message?: unknown } | null | undefined; throw new Error(`eth_getLogs error ${err?.code}: ${err?.message}`); } if (envelope.jsonrpc !== "2.0" || envelope.id !== 1) { throw new Error("eth_getLogs response has the wrong jsonrpc version or id"); } if (!Array.isArray(envelope.result)) { throw new Error("eth_getLogs result is not an array"); } allLogs.push(...envelope.result); cur = chunkEnd + 1; } console.log(`Fetched ${allLogs.length} logs across blocks`); // npx tsx example.mts ``` **Python** ```python import os from urllib.parse import urljoin import requests CHAIN = "robinhood_mainnet" RPC_ENDPOINT = "https://api.blockvectra.com/v1/robinhood_mainnet" # 1. Fetch max_logs_block_range from the public GET /v1/chains endpoint (unauthenticated, unbilled) chains_url = urljoin(RPC_ENDPOINT, "/v1/chains") chains_res = requests.get(chains_url) chains_res.raise_for_status() chains = chains_res.json().get("chains", []) target_chain = next((c for c in chains if c["chain"] == CHAIN), None) if not target_chain: raise RuntimeError(f"Chain {CHAIN} not found") max_range = target_chain["max_logs_block_range"] if isinstance(max_range, bool) or not isinstance(max_range, int) or max_range <= 0: raise RuntimeError(f"Invalid max_logs_block_range: {max_range!r}") # 2. Query chunks sequentially over [from, from + max - 1] and aggregate results (both endpoints inclusive) from_block = 0x45a2409 to_block = 0x45a2900 all_logs: list = [] cur = from_block while cur <= to_block: chunk_end = min(cur + max_range - 1, to_block) res = requests.post( RPC_ENDPOINT, headers={ "Content-Type": "application/json", "x-api-key": os.environ["BLOCKVECTRA_API_KEY"], }, json={ "jsonrpc": "2.0", "id": 1, "method": "eth_getLogs", "params": [ { "address": "0x1111111111111111111111111111111111111111", "fromBlock": hex(cur), "toBlock": hex(chunk_end), } ], }, ) res.raise_for_status() body = res.json() if not isinstance(body, dict): raise RuntimeError("eth_getLogs response is not a JSON object") if "error" in body: err = body["error"] if isinstance(body["error"], dict) else {} raise RuntimeError(f"eth_getLogs error {err.get('code')}: {err.get('message')}") response_id = body.get("id") if body.get("jsonrpc") != "2.0" or isinstance(response_id, bool) or response_id != 1: raise RuntimeError("eth_getLogs response has the wrong jsonrpc version or id") result = body.get("result") if not isinstance(result, list): raise RuntimeError("eth_getLogs result is not a list") all_logs.extend(result) cur = chunk_end + 1 print(f"Fetched {len(all_logs)} logs across blocks") ``` ## Test response handling offline Use the [35 synthetic response cases](https://docs.blockvectra.com/examples/getlogs-guide-cases.jsonl) with a mock transport to check chunk boundaries, HTTP/JSON-RPC failures and successful empty results. See the [format and expected outputs](https://docs.blockvectra.com/examples/getlogs-client-cases.md) and [MIT license](https://docs.blockvectra.com/examples/getlogs-client-cases.LICENSE). For checking progress commits, timestamp-start estimation and stale writes after cancellation, download the v0.1.0 synthetic evaluation fixtures: [evm-log-backfill-checkpoints v0.1.0](https://github.com/blockvectra/evm-log-backfill-checkpoints/releases/tag/v0.1.0). The 11 cases are teaching and evaluation data, not real chain data; they cover checkpoint, timestamp-start and writer-fencing JSONL groups. The release also includes a tar.gz archive, fixtures.manifest.json and SHA256SUMS. These fixtures are separate from the 35 response cases above and from the resumable client. They need no install, key or network and run on Node.js 22. The commit-fence cases model synchronous in-memory state only, not real database atomicity or persistence. ## Resumable measurement client (download) [Download `getlogs-resumable.mjs`](https://docs.blockvectra.com/examples/getlogs-resumable.mjs) and run it with Node.js 24 or later. It has no dependencies, calls only the fixed production catalog and RPC endpoints, validates `eth_chainId` against the catalog's `chain_id`, and splits the window by the live `max_logs_block_range` after checking `methods.allow` and `methods.deny`. ```bash export BLOCKVECTRA_API_KEY="rgw_your_api_key" export LOG_ADDRESS="0x1111111111111111111111111111111111111111" export FROM_BLOCK="0x45a2409" export TO_BLOCK="0x45a2900" export CHAIN="robinhood_mainnet" export CHECKPOINT_FILE="./getlogs-checkpoint.json" node getlogs-resumable.mjs ``` Optional: set `CHUNK_BLOCKS` (a positive decimal integer, for example `CHUNK_BLOCKS=100`) to request fewer blocks per call than the catalog limit. The span used is `min(CHUNK_BLOCKS, max_logs_block_range)`; a larger value is clamped to the catalog limit, not rejected, and an invalid value stops before any request. A smaller span means more requests and may cost more; it is not a guarantee about result size. It is an execution setting, not part of the task identity. For the same chain, address, `from` and `to`, you may change only `CHUNK_BLOCKS` and continue with the same checkpoint file; it only applies to blocks not yet saved, and saved chunks are never re-requested. `total_chunks` is the saved chunks plus the chunks needed for the remaining blocks at the effective span, and the 20-chunk budget counts saved chunks, so lowering `CHUNK_BLOCKS` on resume can stop the run before the first `eth_getLogs`. Three limits are separate: the block span (`max_logs_block_range`), the number of logs a request may return, and the 2 MiB response body cap. If a chunk fails on the result-count or size limit, the client does not commit it, advance, shrink the range or retry on its own. To change the window, address or chain, use a new checkpoint file and keep the original file; this client does not overwrite or migrate a task automatically. This is not evidence that any real run has been resumed, nor a claim of no missing data or finality. One process may use a checkpoint file at a time. The client takes a lock file at `.lock`, writes each candidate checkpoint as one JSON document through a `0600` temporary file, `fsync` and atomic rename, and stops on the first error without skipping a chunk or retrying. If the lock remains after a crash, verify that no process owns it and remove it manually. A checkpoint is rejected if its task binding, chunk order, continuity or `nextBlock` does not match; it is never silently restarted, and an existing file that is not a valid checkpoint object is rejected before any request instead of being treated as absent. The budget is 20 saved chunks for the whole task, including resumed chunks, so the client stops before requesting a chunk that would exceed it. Saved chunks stay valid when the catalog's `max_logs_block_range` changes: only the remaining window is split by the current value. Each response and the checkpoint file are read through a byte-bounded path capped at 2 MiB; an oversized response is canceled, and the last committed checkpoint is kept. `status: "complete"` only means every block in the fixed requested interval was read successfully. It does not claim upstream completeness or finality, and it does not make retries exactly-once: choose a confirmed window, and validate reorgs independently with block hashes or overlapping re-queries. This is a client-side measurement example: a default run does not add the internal QA suffix. Only internal automated tests that explicitly set `BLOCKVECTRA_INTERNAL_QA=1` for the CLI, or pass `internalQa: true` when calling the library, add the `BlockVectraQA/1` User-Agent suffix; internal automated tests must set it. Its output reports client-observed attempt latency, separates catalog, chain ID and `eth_getLogs` request/success counts, counts `new_attempts` for `eth_getLogs` only, and reports committed chunks separately from successful `eth_getLogs` RPCs. `request_observations` has one ordered row for every actual fetch (catalog, chain ID and `eth_getLogs`), so its count denominator is all requests, unlike `new_attempts`; task or checkpoint failures before a fetch add no row. Each row records the stage, the observed HTTP status or `null` when unknown, application body bytes actually consumed (`0` if unread, partial if reading stops early, never `Content-Length` or wire size), `body_read_complete` (true only after the reader signals done), and an outcome: `json_received`, `http_error`, `transport_error`, `timeout`, `invalid_json`, `response_limit`, `unreadable_body` or `invalid_response`. `json_rpc_error_present` is `null` when unknown, for catalog rows, and for invalid JSON or nonobject RPC bodies; otherwise it only reports whether a parsed RPC object has its own `error` field and does not validate that field. `json_received` means valid parsed JSON, not semantic RPC acceptance: only `stage_successes` and `ok` attempts count accepted stages and RPCs. HTTP error bodies stay unread. `committed_chunks` is the number of chunks committed successfully in this run; the total saved ranges equal `resumed_chunks` + `committed_chunks`. Offline mock runs are not production measurements, and the example publishes no p95, p99 or SLA. ## Reconcile one block offline [Download `getlogs-reconcile-block.mjs`](https://docs.blockvectra.com/examples/getlogs-reconcile-block.mjs) to check an `eth_getLogs` result against the block's receipts, so a transaction that a partial result left out does not go unnoticed. It needs Node.js 24 or later, has no dependencies and makes no network calls. ```bash node getlogs-reconcile-block.mjs block-material.json ``` The file (at most 2 MiB) holds one block: `{ "block": { "hash", "number", "transactions": [txHash] }, "receipts": [full receipt RPC results, one per transaction, any order], "logs": [eth_getLogs result], "filter": { "address", "topics" } }`. `transactions` is the full list of transaction hashes, not transaction objects. Other standard fields such as `parentHash`, `status` or `logsBloom` are ignored. Across the receipts in block order, `logIndex` must run 0, 1, 2, and so on without gaps or repeats, even for logs the filter excludes. `filter` is optional: `address` is one address or an array, and each `topics` position is `null`, one topic or an array of topics. Filter semantics follow go-ethereum's `filterLogs` (an empty `address` list or empty topic list matches anything, and a `topics` position the log does not have never matches); other providers may differ. The script applies it to every receipt log, then compares the result with `logs` by block hash, transaction hash and log index, including address, topics, data, block number and transaction index. It prints `{ status, reason, counts }` and exits `0` for `consistent`, `1` for `inconsistent` (a log is missing, extra or changed) and `2` for `unresolved` (missing or malformed fields, a block-wide `logIndex` that is not continuous, receipts that do not cover the block's transactions, logs from another block, duplicate identities, an invalid filter). Stop on `1` or `2` and keep the range unresolved. The script never reads or writes a checkpoint. `consistent` only means the supplied material agrees with itself; it does not show that the block is canonical, check a receipts root or prove that history is complete. ## Batch request considerations If you consider packing multiple chunked queries into a single JSON-RPC batch request, keep the batch and burst capacity rules in mind: * **Batch size limit**: Batch requests accept 1 to 100 calls. Submitting more than 100 calls is rejected with HTTP 200 and error code `-32600 batch too large: max 100 calls` (not billed). * **Single-request burst capacity**: If the summed CU weight of the calls in one request exceeds the key's burst capacity (`burst_cu`), the request is rejected with HTTP 429 `-32022 request cost CU exceeds burst capacity CU` (not billed); split it into smaller batches. * **Insufficient bucket capacity**: If the sum of full weights does not exceed burst capacity but the token bucket lacks enough available capacity, the service returns HTTP 429 with error code `-32005 rate limit exceeded` and `Retry-After`; see [What is not billed: error codes and billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) for retry and billing details. Therefore, when performing large-scale log queries, sequential chunked queries are recommended; if batching, keep the number of calls per batch small enough so the sum of full weights remains within the burst capacity. ## Related guides and billing rules * See the [eth\_getLogs method reference](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getLogs/) for filter parameters, return values, and CU weights. * See the [logs\_range\_too\_large error reference](https://docs.blockvectra.com/en/errors/#logs_range_too_large) for error details and recommended actions. * For a comparison between `eth_getLogs` and the Data API transfers endpoints (address transfers and token transfers), including coverage and finality differences, see [Recent node data vs indexed history: when to use eth\_getLogs and when to use the transfers API](https://docs.blockvectra.com/en/guides/logs-vs-transfers/). * For full details on compute units (CU), hourly settlement, and non-billed error responses, see [What is not billed: error codes and billing rules](https://docs.blockvectra.com/en/guides/billing-rules/). ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # HoodFi on Robinhood Chain: read coin type 2147488311 name records Source: https://docs.blockvectra.com/en/guides/hoodfi-name-records/ ## Choose the Robinhood record For a HoodFi name on Robinhood Chain (4663), read `addr(bytes32,uint256)` with **coin type 2147488311**, then compare coin type 60 at the **same block hash**. Select the Robinhood record. If it is empty, zero or not exactly 20 bytes, stop; do not fall back to coin type 60 or a default record. If the two addresses differ, ask the user to confirm the Robinhood destination before using it. This follows the [maintainer's record-selection policy](https://github.com/blockhash-xyz/mancer-sdk/issues/2#issuecomment-6622496038). [ENSIP-11](https://docs.ens.domains/ensip/11/) derives an EVM coin type as `0x80000000 | chainId`: for 4663, that is 2147488311. The one-argument `addr(bytes32)` reads coin type 60; it does not select a Robinhood record. The recipe calls the fixed HoodFi registry `0xf2bABA012244bdD7445129597350054E1B3aEe5C`. `namehash(NAME)` supplies its node; this is not a general ENS resolver-discovery flow. ## Run the read Use Node.js 20+ and viem 2.x (`npm install viem` in your own project). Get a key from the [console](https://console.blockvectra.com/login/?next=%2Fkeys%2F), or follow [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/); see [Quickstart](https://docs.blockvectra.com/en/quickstart/) for initial setup. Set `BLOCKVECTRA_API_KEY` locally to your real key, then save the JavaScript below as `hoodfi-name-records.mjs` and run `node hoodfi-name-records.mjs`. Optionally set `NAME`; its default is `mike.hoodfi.eth`. Keep the key out of source files, URLs and logs. The script uses `https://api.blockvectra.com/v1/robinhood_mainnet` with the key only in `x-api-key`. It makes at most four serial requests, at least 1.1 seconds apart, with a 15 second timeout per request, no redirects and no retries: 1. Verify `eth_chainId` is `0x1237` (4663). 2. Read `latest` once and retain the block hash. 3. Read coin type 2147488311 with `{blockHash, requireCanonical: true}`; reject an invalid Robinhood address immediately. 4. Read coin type 60 with exactly the same selector, for comparison only. Empty or zero means no comparison record; other malformed bytes stop the run. ```js import { decodeFunctionResult, encodeFunctionData, namehash, parseAbi } from "viem"; const ENDPOINT = "https://api.blockvectra.com/v1/robinhood_mainnet"; const REGISTRY = "0xf2bABA012244bdD7445129597350054E1B3aEe5C"; const NAME = process.env.NAME ?? "mike.hoodfi.eth"; const RH_COIN_TYPE = 2147488311n; // ENSIP-11: 0x80000000 | 4663 const GAP_MS = 1_100; const TIMEOUT_MS = 15_000; const apiKey = process.env.BLOCKVECTRA_API_KEY; if (!apiKey || /\s|replace|placeholder|your[_-]?(api[_-]?)?key|[<>]/i.test(apiKey)) { throw new Error("Set a real BLOCKVECTRA_API_KEY in your local environment"); } const abi = parseAbi(["function addr(bytes32 node, uint256 coinType) view returns (bytes)"]); const node = namehash(NAME); // A node for this fixed HoodFi registry, not general ENS resolution. // Raw JSON-RPC preserves the EIP-1898 object without client-side block tag rewriting. let sent = 0; let lastSentAt; async function rpc(method, params) { if (sent >= 4) throw new Error("Four-request diagnostic budget exceeded"); if (lastSentAt !== undefined) { const wait = lastSentAt + GAP_MS - Date.now(); if (wait > 0) await new Promise((resolve) => setTimeout(resolve, wait)); } lastSentAt = Date.now(); const id = ++sent; let response; try { response = await fetch(ENDPOINT, { method: "POST", headers: { "content-type": "application/json", "x-api-key": apiKey, "user-agent": "hoodfi-name-records-diagnostic BlockVectraQA/1", }, body: JSON.stringify({ jsonrpc: "2.0", id, method, params }), redirect: "error", signal: AbortSignal.timeout(TIMEOUT_MS), }); } catch { throw new Error(`${method}: transport failure (including timeout or redirect)`); } if (response.status !== 200) throw new Error(`${method}: HTTP ${response.status}`); let body; try { body = await response.json(); } catch { throw new Error(`${method}: invalid JSON`); } if (!body || body.jsonrpc !== "2.0" || body.id !== id) { throw new Error(`${method}: invalid JSON-RPC response id or version`); } if (Object.hasOwn(body, "error")) { // Do not echo server messages or arbitrary response data: they can contain secrets. const code = Number.isSafeInteger(body.error?.code) ? body.error.code : "unknown"; const reason = body.error?.data?.reason === "state_window" ? " state_window" : ""; throw new Error(`${method}: JSON-RPC error ${code}${reason}`); } if (!Object.hasOwn(body, "result")) throw new Error(`${method}: missing result`); return body.result; } const chainId = await rpc("eth_chainId", []); if (typeof chainId !== "string" || !/^0x(?:0|[1-9a-f][0-9a-f]*)$/i.test(chainId) || BigInt(chainId) !== 4663n) throw new Error("Expected chain 4663 (0x1237)"); const head = await rpc("eth_getBlockByNumber", ["latest", false]); const blockHash = head?.hash; if (typeof blockHash !== "string" || !/^0x[0-9a-f]{64}$/i.test(blockHash)) { throw new Error("Invalid block hash"); } const at = { blockHash, requireCanonical: true }; async function readAddress(coinType, label, optional) { const result = await rpc("eth_call", [{ to: REGISTRY, data: encodeFunctionData({ abi, functionName: "addr", args: [node, coinType] }), }, at]); let bytes; try { if (typeof result !== "string" || !/^0x(?:[0-9a-f]{2})*$/i.test(result)) throw new Error(); bytes = decodeFunctionResult({ abi, functionName: "addr", data: result }); } catch { throw new Error(`${label}: invalid ABI result`); } if (bytes === "0x" || /^0x0{40}$/i.test(bytes)) { if (optional) return null; throw new Error(`${label}: missing or zero address`); } if (!/^0x[0-9a-f]{40}$/i.test(bytes)) throw new Error(`${label}: expected exactly 20 bytes`); return bytes.toLowerCase(); } // Request three must succeed before coin type 60 is even read. const robinhoodAddress = await readAddress(RH_COIN_TYPE, "Robinhood record", false); const coin60 = await readAddress(60n, "Coin type 60 record", true); const warnings = []; if (coin60 !== null && coin60 !== robinhoodAddress) { warnings.push("Records differ: confirm the Robinhood destination before use; coin type 60 is comparison only."); } console.log(JSON.stringify({ blockHash, robinhoodAddress, coin60, warnings }, null, 2)); ``` Output contains only `blockHash`, `robinhoodAddress`, `coin60` (or `null`) and `warnings`. Read warnings before using the address. The script neither creates nor signs nor sends transactions. Its User-Agent marks a diagnostic run. HTTP responses other than 200, JSON-RPC errors, invalid response ids, missing results, invalid hashes and ABI decoding failures stop the script without partial output. A rejected hash read must not be replaced with `latest` or a block number. To take a new snapshot, start a new run from the chain check. ## Access and snapshot semantics [EIP-1898](https://eips.ethereum.org/EIPS/eip-1898) identifies the block by hash and makes `requireCanonical: true` reject a noncanonical block. Two reads accepted at the same hash do not guarantee that block cannot be reorganized later. Use the keyed endpoint for this recipe. The keyless `/v1/robinhood_mainnet/public` route previously rejected this kind of hash-pinned `eth_call` with `-32011` / `state_window`; a head read alone does not establish support for the record reads. For current capabilities and allowances, check [GET /v1/chains](https://api.blockvectra.com/v1/chains) and [pricing](https://blockvectra.com/en/pricing/). For a concrete matching-record snapshot of `mike.hoodfi.eth`, see the [public read explanation](https://github.com/blockhash-xyz/mancer-sdk/issues/2#issuecomment-6625982298). Read the current records yourself before using an address. --- # HyperEVM public RPC rate limit and eth_getLogs block range Source: https://docs.blockvectra.com/en/guides/hyperevm-backfill/ ## Direct answer HyperEVM public RPC limits depend on the endpoint. The official public RPC (`rpc.hyperliquid.xyz/evm`) allows 100 EVM JSON-RPC requests per minute per IP and 50 blocks per `eth_getLogs` query (source: Hyperliquid official [rate-limit documentation](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/rate-limits-and-user-limits) and [JSON-RPC documentation](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/json-rpc), accessed 2026-10-11). BlockVectra's keyless HyperEVM endpoint allows 3 requests per second per IP with a burst of 20 and does not serve `eth_getLogs`; with an API key, `eth_getLogs` covers up to 1,000 blocks per query, counting both endpoints (`hyperevm_mainnet.max_logs_block_range` and `public.rate_limit` from [GET /v1/chains](https://api.blockvectra.com/v1/chains)). Checked 2026-11-12. A wider span returns HTTP 200, JSON-RPC `-32602` and `logs_range_too_large`, with `retryable: false` (see the [error catalog](https://docs.blockvectra.com/en/errors/#logs_range_too_large)); split into `[from, min(from + max − 1, end)]`, save your cursor, and advance to the end plus one after success to resume runs. Handling of 429 responses is in [Official public RPC rate limits and 429](https://docs.blockvectra.com/en/guides/hyperevm-backfill/#official-public-rpc-rate-limits-and-429) and the service parameters below. * **First step:** [Read the latest block without an API key](https://docs.blockvectra.com/en/guides/hyperevm-backfill/#1-read-the-latest-block-without-an-api-key) using the curl command below. * **Done when:** The backfill script outputs `fromBlock`, `toBlock` and a `result` array for every chunk in your chosen window; an empty array means no matching logs in that chunk. [Chain parameters and access options](https://blockvectra.com/en/chains/hyperevm_mainnet/). ## Tasks this guide helps you complete * [Probe HyperEVM RPC](https://docs.blockvectra.com/en/guides/hyperevm-backfill/#connect-with-viem-or-ethers) with a public read using viem or ethers before selecting authenticated methods. * [Backfill a bounded log window](https://docs.blockvectra.com/en/guides/hyperevm-backfill/#three-step-task-backfill-a-bounded-hyperevm-log-window) within the HyperEVM `eth_getLogs` limit, with retry decisions based on the returned error. * [Read address activity](https://docs.blockvectra.com/en/guides/hyperevm-backfill/#using-data-api-endpoints-instead-of-extensive-getlogs-scanning) through indexed transactions and transfers with a key, checking the returned coverage and freshness metadata. ## Three-step task: backfill a bounded HyperEVM log window Read the latest block without a key, create a key, then retrieve event logs for a contract over a finite block window. Choose the contract and block window you need. This task covers that bounded window; it does not promise a complete contract history. ### 1. Read the latest block without an API key ```bash curl -sS "https://api.blockvectra.com/v1/hyperevm_mainnet/public" \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' ``` The JSON-RPC `result` is the latest block number in hexadecimal. This is the HyperEVM `public.url` published by [GET /v1/chains](https://api.blockvectra.com/v1/chains). The public endpoint's `public.methods` does not include `eth_getLogs`; step 3 requires a key. ### 2. Create an API key
[Create a key for this backfill](https://console.blockvectra.com/login/?next=%2Fkeys%2F). Create a key and save the secret shown in the dialog for use with `hyperevm_mainnet`. For an AI Agent using HTTP without a browser, follow the Programmatic sign-up guide. Pass the guide URL's valid `ref` in the `POST /auth/siwe/login` JSON body instead of the example's `docs-signup`; omit it if unavailable. Do not ask the user to paste the key into chat.
### 3. Backfill logs with your key Complete starter template: [blockvectra/hyperevm-backfill](https://github.com/blockvectra/hyperevm-backfill) Save the following script as `hyperevm-task.ts`. It runs with Node.js 24 or later, with no additional packages. Set `BLOCKVECTRA_API_KEY` to your saved key and `LOG_ADDRESS` to the emitting contract address you want to inspect; keep the key on your server or in a local terminal. ```bash export BLOCKVECTRA_API_KEY='replace-with-your-key' export LOG_ADDRESS='replace-with-contract-address' node hyperevm-task.ts ``` By default, the script retrieves the most recent `max_logs_block_range` blocks, or fewer near genesis. It reads that limit from `/v1/chains` at runtime. To select another finite window, set both `FROM_BLOCK` and `TO_BLOCK` to decimal or `0x` hexadecimal block numbers before running. Larger windows are divided into consecutive chunks, each at most the published limit. ```ts const apiKey = process.env.BLOCKVECTRA_API_KEY; const address = process.env.LOG_ADDRESS; if (!apiKey || apiKey === "replace-with-your-key") throw new Error("Set BLOCKVECTRA_API_KEY"); if (!address || !/^0x[0-9a-f]{40}$/i.test(address)) throw new Error("Set LOG_ADDRESS to a contract address"); const fromBlock = process.env.FROM_BLOCK; const toBlock = process.env.TO_BLOCK; if ((fromBlock !== undefined || toBlock !== undefined) && (!fromBlock || !toBlock)) { throw new Error("Set both FROM_BLOCK and TO_BLOCK"); } const chainsUrl = "https://api.blockvectra.com/v1/chains"; const rpcUrl = new URL("./hyperevm_mainnet", chainsUrl).href; async function readJson(url: string) { const response = await fetch(url, { signal: AbortSignal.timeout(15_000) }); if (!response.ok) throw new Error(`Metadata HTTP ${response.status}`); return response.json(); } const catalog = await readJson(chainsUrl); const chain = catalog.chains.find((item: { chain: string }) => item.chain === "hyperevm_mainnet"); if (!chain || !Number.isSafeInteger(chain.max_logs_block_range) || chain.max_logs_block_range <= 0) { throw new Error("Missing or invalid max_logs_block_range"); } if (!chain.methods.allow.includes("eth_getLogs") || chain.methods.deny.includes("eth_getLogs")) { throw new Error("eth_getLogs is unavailable on this chain"); } const maxRange = BigInt(chain.max_logs_block_range); const plans = await readJson("https://console-api.blockvectra.com/v1/plans"); function weight(method: string): bigint { const row = plans.method_weights.find((item: { method: string }) => item.method === method); if (!row || !Number.isSafeInteger(row.cu_weight) || row.cu_weight <= 0) { throw new Error(`Missing or invalid CU weight for ${method}`); } return BigInt(row.cu_weight); } const headWeight = weight("eth_blockNumber"); const logsWeight = weight("eth_getLogs"); type RpcBody = { result?: unknown; error?: { code: number; data?: { retryable?: boolean } }; }; async function rpc(method: string, params: unknown[]): Promise { for (let attempt = 0; attempt < 4; attempt++) { const response = await fetch(rpcUrl, { method: "POST", redirect: "error", headers: { "Content-Type": "application/json", "x-api-key": apiKey! }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }), signal: AbortSignal.timeout(15_000), }); const body = await response.json() as RpcBody; if (response.ok && !body.error && body.result !== undefined) return body.result; if (body.error?.data?.retryable !== true || attempt === 3) { throw new Error(`RPC failed: HTTP ${response.status}, code ${body.error?.code ?? "unknown"}`); } const retryAfter = response.headers.get("Retry-After"); const delay = retryAfter === null ? 0 : /^\d+$/.test(retryAfter) ? Number(retryAfter) * 1000 : Date.parse(retryAfter) - Date.now(); if (delay > 30_000) throw new Error("Retry-After exceeds 30 seconds; rerun later"); const backoff = 1000 * 2 ** attempt + Math.random() * 250; await new Promise((resolve) => setTimeout(resolve, Math.max(backoff, Number.isFinite(delay) ? delay : 0))); } throw new Error("Retry limit reached"); } function block(value: string): bigint { if (!/^(0x[0-9a-f]+|[0-9]+)$/i.test(value)) throw new Error("Invalid block number"); return BigInt(value); } const head = await rpc("eth_blockNumber", []); if (typeof head !== "string" || !/^0x[0-9a-f]+$/i.test(head)) throw new Error("Invalid chain head"); const latest = block(head); const end = toBlock ? block(toBlock) : latest; const start = fromBlock ? block(fromBlock) : end >= maxRange - 1n ? end - maxRange + 1n : 0n; if (start > end || end > latest) throw new Error("Require 0 <= FROM_BLOCK <= TO_BLOCK <= latest"); const chunks = (end - start + maxRange) / maxRange; console.error(`Window ${start}..${end}; chunks=${chunks}; estimated CU=${headWeight + chunks * logsWeight}`); const hex = (value: bigint) => `0x${value.toString(16)}`; for (let from = start; from <= end; from += maxRange) { const to = from + maxRange - 1n < end ? from + maxRange - 1n : end; const result = await rpc("eth_getLogs", [{ address, fromBlock: hex(from), toBlock: hex(to) }]); if (!Array.isArray(result)) throw new Error("Expected eth_getLogs result array"); console.log(JSON.stringify({ fromBlock: hex(from), toBlock: hex(to), result })); } ``` Requests run sequentially. A JSON-RPC error is retried only when `error.data.retryable` is `true`, with at most four attempts per request, exponential backoff and jitter, and support for `Retry-After` seconds or an HTTP date. A wait longer than 30 seconds stops the script so you can rerun later. Network failures, timeouts, malformed responses, and non-retryable errors stop immediately; the script exits unsuccessfully rather than reporting a complete backfill. Each standard-output line contains one chunk's `fromBlock`, `toBlock`, and `result` array. `result: []` means no matching logs in that chunk. Read these fields in each log: | Field | Meaning | | ------------------------------------------------- | -------------------------------------------------------------------------------------------- | | `address` | Contract that emitted the event. | | `blockNumber`, `blockHash` | Block containing the log; the number is hexadecimal. | | `transactionHash`, `transactionIndex`, `logIndex` | Transaction and log position; indices are hexadecimal. | | `topics`, `data` | Indexed event arguments and ABI-encoded non-indexed arguments; decode with the contract ABI. | | `removed` | Whether the log was removed by a chain reorganization. | The latest block is not a finality marker. If you need a stable historical window, choose your application's confirmed `TO_BLOCK` and handle chain reorganizations. For a window of `B = TO_BLOCK − FROM_BLOCK + 1` blocks and published limit `L`, the chunk count is `N = ceil(B / L)`. Read `method_weights[].cu_weight` for `eth_getLogs` and `eth_blockNumber` from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans). The script prints an estimate to standard error: `N × weight(eth_getLogs) + weight(eth_blockNumber)`, including its keyed head lookup. This excludes extra calls and any billable retries; see [billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) for settlement. CU depends on calls, rather than the number of logs returned. **Event delivery:** Use chunked HTTP polling below, or send watched-address events to an HTTPS receiver with [webhook push](https://docs.blockvectra.com/en/guides/webhook-push/). **GET /v1/push/chains lists supported chains** and confirmation settings; authenticate with `x-api-key`. Webhook signatures, deduplication and replay are covered in that guide. Webhook push is separate from WebSocket subscriptions (`ws` and `subscriptions` in `/v1/chains`). ## Connect with viem or ethers | Parameter / Endpoint | Value / Template | Authentication | |---|---|---| | Chain ID (EIP-155) | `999` | — | | JSON-RPC (path key) | `POST https://api.blockvectra.com/v1/hyperevm_mainnet/{api_key}` | API key in URL path | | JSON-RPC (header key) | `POST https://api.blockvectra.com/v1/hyperevm_mainnet` | Header x-api-key: {api_key} | | WebSocket (path key) | `wss://api.blockvectra.com/v1/hyperevm_mainnet/{api_key}` | API key in URL path | | WebSocket (header key) | `wss://api.blockvectra.com/v1/hyperevm_mainnet` | Header x-api-key: {api_key} or Authorization: Bearer {api_key} | | WebSocket subscriptions | `newHeads, logs` | — | | Data API base | `GET https://api.blockvectra.com/v1/data/hyperevm_mainnet/…` | Header x-api-key: {api_key} | | Public status | `GET https://api.blockvectra.com/v1/status` | Unauthenticated (public) | Developers and AI Agents can use the same server-side settings. Use Node.js 24 or later, viem 2 or ethers 6, and start with public reads. Set `BLOCKVECTRA_API_KEY` securely in the environment for keyed methods. Keep keys and RPC URLs containing keys out of browser code, logs and version control. Save this as `network.mjs`. It reads `chain_id` and method policy from [GET /v1/chains](https://api.blockvectra.com/v1/chains). For keyless reads, use the catalog’s `public.url` and only methods listed in `public.methods`; public HTTP availability does not imply WebSocket access. ```js const chainSlug = process.env.BLOCKVECTRA_CHAIN ?? 'hyperevm_mainnet'; const key = process.env.BLOCKVECTRA_API_KEY; const catalogUrl = 'https://api.blockvectra.com/v1/chains'; const response = await fetch(catalogUrl, { signal: AbortSignal.timeout(15_000) }); if (!response.ok) throw new Error(`Chains HTTP ${response.status}`); const catalog = await response.json(); export const chainInfo = catalog.chains.find(item => item.chain === chainSlug); if (!chainInfo || !Number.isSafeInteger(chainInfo.chain_id) || chainInfo.chain_id <= 0) { throw new Error('Missing chain or chain_id'); } export function allows(method) { const matches = pattern => pattern.endsWith('*') ? method.startsWith(pattern.slice(0, -1)) : pattern === method; if (!key) return (chainInfo.public?.methods ?? []).some(matches); return (chainInfo.methods?.allow ?? []).some(matches) && !(chainInfo.methods?.deny ?? []).some(matches); } if (!allows('eth_chainId')) throw new Error('eth_chainId is unavailable'); export const rpcUrl = key ? new URL(`./${chainSlug}/${encodeURIComponent(key)}`, catalogUrl).href : chainInfo.public?.url; if (!rpcUrl) throw new Error('Public RPC is unavailable; set BLOCKVECTRA_API_KEY'); ``` Save as `viem-client.mjs`, install with `npm install viem@2`, then run `node viem-client.mjs`. ```js import { createPublicClient, defineChain, http } from 'viem'; import { chainInfo, rpcUrl } from './network.mjs'; export const chain = defineChain({ id: chainInfo.chain_id, name: chainInfo.name, nativeCurrency: { name: 'HYPE', symbol: 'HYPE', decimals: 18 }, rpcUrls: { default: { http: [rpcUrl] } }, }); export const client = createPublicClient({ chain, transport: http(rpcUrl) }); if (await client.getChainId() !== chain.id) throw new Error('RPC chain ID mismatch'); console.error(await client.getBlockNumber()); ``` For ethers, save as `ethers-client.mjs`, install with `npm install ethers@6`, then run `node ethers-client.mjs`. ```js import { JsonRpcProvider } from 'ethers'; import { chainInfo, rpcUrl } from './network.mjs'; const provider = new JsonRpcProvider(rpcUrl, chainInfo.chain_id, { batchMaxCount: 1 }); const network = await provider.getNetwork(); if (network.chainId !== BigInt(chainInfo.chain_id)) throw new Error('RPC chain ID mismatch'); console.log(await provider.getBlockNumber()); provider.destroy(); ``` ## Deploy with Foundry or Hardhat The current catalog for ordinary keyed `hyperevm_mainnet` has `ws=false` and lists `eth_sendRawTransaction` in `methods.allow`; the public keyless endpoint does not. Check that the selected endpoint allows the send method before deploying. Set `DEPLOY_RPC_URL` to its authenticated HTTP URL. Do not assume another provider shares BlockVectra’s method or log-range limits. Check the selected chain ID before signing. ```bash : "${DEPLOY_RPC_URL:?Set a broadcasting RPC URL}" export RPC_URL="$DEPLOY_RPC_URL" export CHAIN_ID="$(node --input-type=module -e "import { chainInfo } from './network.mjs'; console.log(chainInfo.chain_id)")" ``` Continue with the shared [Foundry or Hardhat deployment tutorial](https://docs.blockvectra.com/en/guides/deploy-contract/). Fund the deployer with EVM HYPE and review the dual-block requirements below before a large deployment. ## HYPE, small blocks and large deployments [HyperEVM’s official network guide](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm) identifies HYPE as gas, with 18 decimals (accessed: 2026-10-07). Ensure the deployer holds HYPE on HyperEVM; a HyperCore balance alone is not the EVM gas balance. Follow the linked native-transfer instructions when moving funds. The [dual-block guide](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/dual-block-architecture) describes fast small blocks and slower big blocks for larger transactions (accessed: 2026-10-07). Estimate deployment gas first. For deployments exceeding the small-block budget, the deployer must be an existing HyperCore user and sign the Core action `{"type":"evmUserModify","usingBigBlocks":true}`; setting a larger transaction gas limit alone does not select big blocks. Restore `usingBigBlocks=false` afterward to return to small blocks. On a provider supporting them, use `eth_usingBigBlocks` to check the address mode and `eth_bigBlockGasPrice` for the big-block base fee. The [official JSON-RPC reference](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/json-rpc) documents these methods (accessed: 2026-10-07). Check the chosen provider’s methods; use `/v1/chains` for BlockVectra. The minimal deployment above targets a small contract and does not change Core account mode. ## HyperCore and HyperEVM data EVM RPC serves contracts, receipts and logs. HyperCore trading data and actions use the Core API. Contracts can read Core state through precompiles and send actions through CoreWriter; use the [official interaction guide](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/interacting-with-hypercore) when integrating these paths (accessed: 2026-10-07). EVM logs do not replace Core order-book or position queries. HyperEVM system transactions (such as HyperCore to HyperEVM transfers) are not included in standard `eth_getBlockByNumber` responses and are provided separately by the official RPC via `eth_getSystemTxsByBlockNumber` and `eth_getSystemTxsByBlockHash` (see the [official JSON-RPC documentation](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/json-rpc), accessed: 2026-10-07). BlockVectra's HyperEVM block, transaction, and Data API data currently do not include system transactions; use these two official RPC methods directly when requiring system transaction data. ## Handle official error 10055 The [official HyperEVM guide](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm) defines `10055` as a Core/EVM boundary error, including nonce, insufficient-funds, duplicate-hash and underpriced-replacement failures (accessed: 2026-10-07). Inspect the message from the broadcasting RPC before deciding how to recover: * **Nonce:** compare `eth_getTransactionCount` with your pending transactions; serialize submissions from one deployer and reconcile its next nonce. * **Funds:** check the deployer’s EVM HYPE balance against value plus gas cost. * **Duplicate hash:** look up the existing transaction and receipt before submitting another transaction. * **Replacement fee:** verify the existing nonce and fee, then use the broadcaster’s replacement policy; repeating the same bytes does not raise the fee. `10055` alone does not justify blind retries. Read errors and their recovery guidance separately in the [BlockVectra error reference](https://docs.blockvectra.com/en/errors/). ## Official public RPC rate limits and 429 Hyperliquid's official [rate-limit documentation](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/rate-limits-and-user-limits) specifies at most 100 EVM JSON-RPC requests per minute per IP for `rpc.hyperliquid.xyz/evm`. Its [JSON-RPC documentation](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm/json-rpc) also limits `eth_getLogs` to 50 blocks per query and up to 4 topics. Accessed: 2026-10-11. On HTTP 429, pause requests and honor `Retry-After` first (seconds or an HTTP date). If absent, use exponential backoff with jitter and a bounded retry count, retrying the same unfinished chunk. Reduce concurrency and polling frequency, and split log queries into chunks within the endpoint's limit. Chunking alone does not remove rate limits; clients sharing an IP need to coordinate their request rate. For BlockVectra's keyed endpoint, read `hyperevm_mainnet`'s `max_logs_block_range`, `methods.allow`, and `methods.deny` from [GET /v1/chains](https://api.blockvectra.com/v1/chains) instead of applying the official public RPC's block span or requests-per-minute limit. Request rate is separately subject to the key's `cu_per_sec`, `burst_cu`, and the free-plan call limit (see the next section). On 429, inspect `error.data.reason` and `retryable`; `request_exceeds_burst` requires smaller requests rather than unchanged retries with backoff. ## BlockVectra parameters and service rules BlockVectra serves HyperEVM mainnet through JSON-RPC and REST Data API endpoints: 1. **Chain parameters and log limits**: From `GET /v1/chains` for `hyperevm_mainnet`: * **Chain identifier (Slug)**: `hyperevm_mainnet`, Chain ID `999`. * **`max_logs_block_range`**: Governed by the `max_logs_block_range` field from `GET /v1/chains`. A single `eth_getLogs` request may span at most this number of blocks (`toBlock − fromBlock + 1`). Exceeding this span returns HTTP 200 with JSON-RPC error code `-32602` (`eth_getLogs block range too large: max blocks`), which is not billed. * **`state_window_blocks`**: Governed by the `state_window_blocks` field from `GET /v1/chains`. State-reading calls (such as `eth_call` and `eth_getBalance`) are subject to the retention window declared by this field (when `null`, full state is retained without a rolling window limit). * **Method policy**: Governed by `methods.allow` and `methods.deny`. Standard EVM methods (`eth_blockNumber`, `eth_getLogs`, `eth_call`, `eth_getBalance`, `eth_getBlockByNumber`, `eth_getTransactionReceipt`, etc.) are allowed; filter and subscription methods (`eth_subscribe`, `eth_unsubscribe`, `eth_newFilter`, `eth_newBlockFilter`) are denied, returning `-32601` (not billed). 2. **Free tier rate limits and upgrading**: From `GET /v1/plans`: * **`free.max_calls_per_sec`**: up to 25 calls per second, shared across all keys in the account, all chains, and the Data API. * **Default key limits**: Each API key has a CU bucket (`cu_per_sec` refill, `burst_cu` capacity — defaults are 100 CU/s and burst 400 CU; after a paid top-up each key is at least 2,000 CU/s and burst 10,000 CU, and higher custom limits are kept). Methods are metered by Compute Unit (CU) weights. * **Upgrading limits**: After topping up, the account-wide calls-per-second limit is removed; each key remains subject to Compute Unit (CU) rate and burst limits. For current rates and billing units, see the [Pricing page](https://blockvectra.com/en/pricing/). ## Backfilling historical logs: chunked eth\_getLogs and retry logic When querying historical logs, wide intervals must be divided into contiguous chunks bounded by the target chain's `max_logs_block_range`. Client retry strategies should inspect the `retryable` field inside error responses. ### Evaluating retryable in error responses On BlockVectra, JSON-RPC error objects include an `error.data` payload containing `reason`, `docs_url`, and `retryable` (boolean): * **`retryable: true`**: Transient conditions, including service overload (`overloaded`), free plan calls-per-second limit (`free_plan_call_limit`), node synchronization (`node_syncing`), or upstream unavailable (`upstream_unavailable`). Clients should respect the `Retry-After` header when present or apply exponential backoff with jitter. * **`retryable: false`**: Non-transient errors, such as block span exceeding limits (`-32602` / `logs_range_too_large`), invalid parameters (`invalid_params`), missing API key (`missing_api_key`), or request exceeding burst capacity (`-32022` / `request_exceeds_burst`). Retrying without adjusting parameters will not succeed. Below is the response returned when an API key is omitted: ```json { "jsonrpc": "2.0", "id": null, "error": { "code": -32024, "message": "missing API key: send it in the request path (/v1/{chain}/) or in the x-api-key header", "data": { "reason": "missing_api_key", "docs_url": "https://docs.blockvectra.com/en/errors/#missing_api_key", "retryable": false } } } ``` ## Using Data API endpoints instead of extensive getLogs scanning When an application tracks transaction history or token movements for a specific address, scanning via `eth_getLogs` requires issuing sequential chunked queries bounded by `max_logs_block_range` and parsing raw Transfer event logs. BlockVectra Data API provides pre-indexed REST endpoints for `hyperevm_mainnet`, supporting windows up to 100,000 blocks with cursor-based pagination: 1. **Address transactions**: `GET /v1/data/hyperevm_mainnet/addresses/{address}/transactions` * Parameters: `from_block` (required), `to_block` (required), `direction` (optional: `from`, `to`, `any`, default `any`), `clamp` (optional boolean string, default `false`; when set to `true`, windows exceeding 100,000 blocks or higher than `as_of_block` are truncated instead of returning 409), `limit` (optional, max 500), `cursor` (pagination token). 2. **Address token transfers**: `GET /v1/data/hyperevm_mainnet/addresses/{address}/transfers` * Parameters: `standard` (required: `erc20` or `erc721`; `erc1155` cannot be queried by address and returns `422 no_coverage`), `token` (optional token contract filter), `from_block` (required), `to_block` (required), `direction` (optional: `in`, `out`, `any`), `clamp` (optional), `limit`, `cursor`. ### Response structure Responses use standard envelope schemas: * `data`: Array of records. Transactions include `hash`, `block_number`, `block_timestamp`, `from`, `to`, `value`, `tx_index`, `gas`, `gas_used`, and `status`. Transfers include `token`, `standard`, `from`, `to`, `block_number`, `block_timestamp`, `tx_hash`, `tx_index`, and `log_index` (`amount` for ERC-20, `token_id` for ERC-721). * `next_cursor`: Opaque pagination token returned when subsequent records exist (absent on the final page, not `null`). * `meta`: Metadata containing `chain`, `chain_slug`, `chain_external_id`, `as_of_block`, `safe_block`, `finalized_block`, `coverage` (`full` or `partial`), and `refreshed_at`. ### Code example: Data API queries **cURL** ```bash export BLOCKVECTRA_API_KEY="rgw_your_api_key" # 1. Query address transaction history (clamp=true prevents 409 errors) curl -s "https://api.blockvectra.com/v1/data/hyperevm_mainnet/addresses/0x2222222222222222222222222222222222222222/transactions?from_block=0&to_block=50000&clamp=true" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" # 2. Query address ERC-20 token transfers curl -s "https://api.blockvectra.com/v1/data/hyperevm_mainnet/addresses/0x2222222222222222222222222222222222222222/transfers?standard=erc20&from_block=0&to_block=50000&clamp=true" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts const apiKey = process.env.BLOCKVECTRA_API_KEY!; const targetAddress = "0x2222222222222222222222222222222222222222"; let cursor: string | undefined; do { const url = new URL( `https://api.blockvectra.com/v1/data/hyperevm_mainnet/addresses/${targetAddress}/transfers`, ); url.searchParams.set("standard", "erc20"); url.searchParams.set("from_block", "0"); url.searchParams.set("to_block", "50000"); url.searchParams.set("clamp", "true"); if (cursor) { url.searchParams.set("cursor", cursor); } const res = await fetch(url, { headers: { "x-api-key": apiKey }, }); if (!res.ok) { throw new Error(`Data API HTTP ${res.status}`); } const body = (await res.json()) as { data: unknown[]; next_cursor?: string; }; console.log(`Fetched ${body.data.length} transfers`); cursor = body.next_cursor; // Loop terminates when cursor is absent } while (cursor); ``` ## Real-time tracking: polling new blocks For an HTTP transport, track blocks by polling and fetch event logs in consecutive chunks within `max_logs_block_range`. Select WebSocket only when `/v1/chains` reports `ws=true` and the required `subscriptions` entry. For delivery to an HTTPS receiver, use [webhook push](https://docs.blockvectra.com/en/guides/webhook-push/). To exercise the deployed `Hello` contract, set `LOG_ADDRESS` to its address. Send `ping()` through the broadcasting RPC, then backfill the receipt’s block with the backfill script on this page. Continue from the last completed chunk for new events. ```bash cast send "$CONTRACT_ADDRESS" "ping()" --rpc-url "$DEPLOY_RPC_URL" \ --private-key "$DEPLOYER_PRIVATE_KEY" ``` ### Polling flow 1. Issue periodic lightweight calls to `eth_blockNumber` to inspect the latest chain head. 2. Compare the returned block number with the previously processed `lastSeenBlock`. 3. If `currentBlock > lastSeenBlock`, split `[lastSeenBlock + 1, currentBlock]` into chunks of at most `max_logs_block_range`. Persist `lastSeenBlock` only after successfully processing each chunk; on failure, retry the unfinished chunk. Deduplicate by `(blockHash, transactionHash, logIndex)` and replay an overlap after reconnecting to reconcile reorgs. 4. viem's `watchBlockNumber` or `watchBlocks` natively implements HTTP polling under an HTTP transport, allowing customization through the `pollingInterval` parameter (such as 1000 ms). ### Poll event logs in bounded chunks Save as `poll-logs.mjs` beside `network.mjs` and `viem-client.mjs`. Set `BLOCKVECTRA_API_KEY`, `LOG_ADDRESS` and `FROM_BLOCK`, then run `node poll-logs.mjs`. This finite example samples the head 12 times, five seconds apart, and queries every new range in sequential chunks. An error stops the script before advancing the failed chunk. ```js import { isAddress } from 'viem'; import { client } from './viem-client.mjs'; import { chainInfo, allows } from './network.mjs'; const address = process.env.LOG_ADDRESS; const start = process.env.FROM_BLOCK; if (!address || !isAddress(address)) throw new Error('Set LOG_ADDRESS'); if (!/^(0x[0-9a-f]+|[0-9]+)$/i.test(start ?? '')) throw new Error('Set FROM_BLOCK'); if (!allows('eth_getLogs')) throw new Error('eth_getLogs requires an available keyed endpoint'); if (!Number.isSafeInteger(chainInfo.max_logs_block_range) || chainInfo.max_logs_block_range <= 0) { throw new Error('Invalid max_logs_block_range'); } const max = BigInt(chainInfo.max_logs_block_range); let from = BigInt(start); for (let poll = 0; poll < 12; poll++) { const head = await client.getBlockNumber(); while (from <= head) { const to = from + max - 1n < head ? from + max - 1n : head; const logs = await client.getLogs({ address, fromBlock: from, toBlock: to }); console.log(JSON.stringify({ from: from.toString(), to: to.toString(), logs }, (_, value) => typeof value === 'bigint' ? value.toString() : value)); from = to + 1n; } if (poll < 11) await new Promise(resolve => setTimeout(resolve, 5_000)); } ``` Each output records a completed chunk. To resume, set `FROM_BLOCK` to its `to + 1`; durable consumers must save events and cursor together, deduplicate, and reconcile reorgs as described above. For 429 or other retryable failures, apply the bounded-backoff guidance to the same unfinished chunk. ## Related guides * Find the public RPC URL, supported methods, and current limits on the [HyperEVM chain page](https://blockvectra.com/en/chains/hyperevm_mainnet/). * For complete rules on `eth_getLogs` spans and chunking algorithms, see [eth\_getLogs block range limits and chunked queries](https://docs.blockvectra.com/en/guides/getlogs-block-range/). * For comparing `eth_getLogs` against Data API transfers, understanding `as_of_block` bounds, and `safe_block` / `finalized_block` markers, see [eth\_getLogs and indexed transfers: coverage and finality](https://docs.blockvectra.com/en/guides/logs-vs-transfers/). * For details on CU metering, non-billed errors, and retries, see [What is not billed: error codes and billing rules](https://docs.blockvectra.com/en/guides/billing-rules/). ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # Guides Source: https://docs.blockvectra.com/en/guides/ Practical guides and end-to-end workflows for using BlockVectra JSON-RPC and Data APIs across supported chains. - [Robinhood Chain RPC URL: mainnet and testnet](https://docs.blockvectra.com/en/guides/robinhood-chain/) — Connect to Robinhood Chain mainnet (chain ID 4663) or testnet (46630). Read blocks without an API key using curl, viem or ethers, or configure an eRPC local proxy with your API key. - [HoodFi on Robinhood Chain: read coin type 2147488311 name records](https://docs.blockvectra.com/en/guides/hoodfi-name-records/) — Read a HoodFi name's Robinhood address with viem, select coin type 2147488311, and compare coin type 60 at the same canonical block hash. - [Robinhood Chain testnet RPC URL and chain ID: keyless reads, WebSocket logs, faucet](https://docs.blockvectra.com/en/guides/robinhood-testnet-starter/) — Robinhood Chain testnet RPC URL https://api.blockvectra.com/v1/robinhood_testnet/public, chain ID 46630: keyless reads, WebSocket logs with an API key, faucet access, and switching the same key to mainnet. - [Robinhood Chain testnet faucet and RPC: claim test ETH, then connect](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/) — Claim Robinhood Chain testnet ETH with your own API key (0.001 per claim). Testnet chain ID 46630, keyless RPC URL https://api.blockvectra.com/v1/robinhood_testnet/public; claim limits and error handling. - [Robinhood Chain stock tokens: reading the multiplier, holders and daily activity with one API key](https://docs.blockvectra.com/en/guides/stock-token-multiplier/) — Understand the Robinhood Chain stock token multiplier, convert balances to shares, read uiMultiplier via eth_call, and track holders and daily activity via the Data API. - [Stock token holders and transfers API on Robinhood Chain](https://docs.blockvectra.com/en/guides/stocks/) — Stock token holders, transfers and wallet balances on Robinhood Chain with one API key: /tokens/{token}/holders, /transfers, /balances. Not stock quotes. - [Free RPC credits: how many free CU and calls you get](https://docs.blockvectra.com/en/guides/free-plan/) — Free RPC credits: 30,000,000 CU per 30-day window, about 2,000,000 eth_call requests, 25 calls per second per account, no credit card. - [DEX daily prices API: OHLC and VWAP for any token](https://docs.blockvectra.com/en/guides/dex-daily-prices/) — Get daily DEX OHLC prices and VWAP for a token with one GET /{chain}/dex/prices request, plus exact fractions in TypeScript and Python and backfills. - [Base RPC URL: keyless access, curl and viem examples](https://docs.blockvectra.com/en/guides/base/) — Connect to Base mainnet with a public RPC URL or API key. Use curl and viem examples, check supported methods and limits, and inspect Data API status. - [HyperEVM public RPC rate limit and eth_getLogs block range](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) — HyperEVM public RPC: the official endpoint allows 100 requests per minute per IP and 50 blocks per eth_getLogs; BlockVectra's keyless endpoint allows 3 requests per second per IP, and eth_getLogs with a key covers up to 1,000 blocks. Split longer windows and save a cursor. - [Deploy a contract with Foundry or Hardhat](https://docs.blockvectra.com/en/guides/deploy-contract/) — Deploy Hello.sol on an EVM network with Foundry or Hardhat 2, verify the chain ID, and check the transaction receipt and contract response. - [One key, many chains: switching an example to another chain](https://docs.blockvectra.com/en/guides/one-key-many-chains/) — The same API key works on every supported chain. Learn how URLs are structured, how to discover chains programmatically, and how balances and limits pool. - [Ink RPC: free chain ID read, keyed pool discovery](https://docs.blockvectra.com/en/guides/ink-pool-discovery/) — Use Ink RPC with no API key to read chain ID 57073 (0xdef1) for free. Pool discovery with hash-pinned eth_call and Multicall3 requires an API key. - [How to monitor wallet addresses for transfers and receive webhooks](https://docs.blockvectra.com/en/guides/webhook-push/) — Create one HTTP subscription with your HTTPS URL, chains and up to 1,000,000 addresses; native, token and log matches are POSTed with a signed body at least once. Verify signatures, deduplicate event IDs and replay retained matches. - [What is not billed: error codes and billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) — A detailed breakdown of billing rules across HTTP status codes, JSON-RPC errors, and the Data API, with recommended actions for developers. - [Pay for RPC with USDC / USDT / USDG: programmatic top-up for AI agents](https://docs.blockvectra.com/en/guides/agent-topup/) — Top up an RPC and Data API account on-chain over HTTP. Developers and AI Agents use an API key to check supported tokens, retrieve a dedicated deposit address and poll credit status. - [Gas Station: API and wallet authorization](https://docs.blockvectra.com/en/guides/gas-station/) — Gas Station authentication, chain readiness, quote authorization, task recovery, and known or unknown costs. - [Blockchain RPC and docs MCP for AI Agents](https://docs.blockvectra.com/en/guides/ai-agents/) — Connect AI Agents to blockchain RPC and docs MCP: discover capabilities without a key, sign up over HTTP, then call RPC and Data API with an API key. - [BlockVectra MCP server: blockchain RPC and docs tools for AI agents](https://docs.blockvectra.com/en/guides/mcp-server/) — The BlockVectra Model Context Protocol (MCP) server gives developers and AI agents keyless blockchain RPC, chain status, pricing and docs tools, with one-line install for Claude Code, Cursor, VS Code, Codex, Gemini CLI, Antigravity and more. - [Blockchain RPC and docs MCP for Agent frameworks](https://docs.blockvectra.com/en/guides/agent-frameworks/) — Configure blockchain RPC for LangChain, ElizaOS, viem, wagmi, and Coinbase AgentKit, with a page and runnable code for each, and discover capabilities via docs MCP. Includes AgentOS RPC_ROBINHOOD_URL setup on Robinhood Chain using an API-key URL. - [LangChain tool to read Ethereum blockchain data](https://docs.blockvectra.com/en/guides/langchain/) — Build a LangChain tool to read Ethereum blockchain data over BlockVectra's keyless public RPC endpoint, then add the docs MCP server and an API key. - [ElizaOS EVM plugin RPC provider: BlockVectra setup](https://docs.blockvectra.com/en/guides/elizaos/) — Use BlockVectra as the RPC provider for the ElizaOS EVM plugin (plugin-evm) with two environment variables, keyless on the public endpoint, plus docs MCP. - [Coinbase AgentKit Base RPC provider: BlockVectra setup](https://docs.blockvectra.com/en/guides/coinbase-agentkit/) — Use BlockVectra as the Base RPC provider for Coinbase AgentKit: point ViemWalletProvider's viem client at the keyless public endpoint, then add a key. - [Get a blockchain API key with a wallet signature (SIWE)](https://docs.blockvectra.com/en/guides/programmatic-signup/) — Sign a message locally with your wallet and get an API key plus 30,000,000 free CU, no payment first. 3 BlockVectra HTTP requests and a local wallet signature in 4 steps, no browser, for developers and AI agents. - [How to Monitor USDT / USDC Payments with Webhooks and RPC](https://docs.blockvectra.com/en/guides/stablecoin-payments/) — Build a payment receiver and polling cursor. Verify token contracts, recipients and integer amounts, deduplicate events and reconcile missing or replaced blocks. - [How to Verify a LineKey Agent Payment Receipt with RPC](https://docs.blockvectra.com/en/guides/verify-agent-payments/) — Run a read-only Node.js script that checks one direct Priors LineKey spend receipt on Robinhood Chain mainnet against your invoice: pinned contracts, Paid, Borrowed and USDG Transfer logs, exact integer amounts. - [eth_getLogs vs Token Transfers API: ERC-20 transfer history](https://docs.blockvectra.com/en/guides/logs-vs-transfers/) — Choose eth_getLogs for contract event logs or the Token Transfers API for indexed ERC-20 transfer history. Compare block ranges, pagination, coverage and finality. - [eth_getLogs block range too large: the block range limit per chain and how to split queries](https://docs.blockvectra.com/en/guides/getlogs-block-range/) — With an API key, one eth_getLogs request may span 1,000 blocks on HyperEVM; each chain publishes its own max_logs_block_range. On logs_range_too_large, split the inclusive block interval within that limit and advance only after the chunk succeeds. - [How Much Do RPC Calls Cost per Million? CU Weights and Price per Million Calls](https://docs.blockvectra.com/en/guides/reading-cu-pricing/) — At current published rates, eth_call costs 15 CU per call, or $1.50 per million calls before available free credits; fetch the current plans API for your workload estimate. - [How to choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/) — Evaluate RPC method costs, log ranges, free credits, rate limits, chain coverage, push and data APIs, authentication and Agent access with workload self-tests. - [Wallet token balances API: list ERC-20 assets for an address](https://docs.blockvectra.com/en/guides/wallet-assets/) — List a wallet's non-zero ERC-20 token balances with one GET /addresses/{address}/balances request, then add transfer history and token metadata. - [Transaction traces: debug_traceTransaction and the Data API trace endpoints](https://docs.blockvectra.com/en/guides/transaction-traces/) — Reconstruct execution call trees for a transaction: the JSON-RPC debug_traceTransaction method with its allowed tracers and guards, and the Data API getTransactionTrace and getBlockTraces endpoints with their coverage bounds. - [Simulate before you send: dry-running transactions with eth_simulateV1](https://docs.blockvectra.com/en/guides/simulate-transactions/) — Dry-run multiple transactions and inspect state changes before sending them on-chain using eth_simulateV1. Learn supported chain method policies, execution spec request payloads, CU pricing weights, and AI Agent MCP integration. - [MetaMask and Rabby Custom RPC Setup: URL and Chain ID](https://docs.blockvectra.com/en/guides/wallet-custom-rpc/) — Add a BlockVectra RPC URL to MetaMask or Rabby. Find chain IDs and native symbols, configure a path API key and manage a dedicated wallet key. - [WebSocket Subscriptions](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) — Connect to BlockVectra WebSocket endpoints for eth_subscribe newHeads and logs. Learn connection methods, filter rules, reconnection backoff, and recovery. ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # BlockVectra as an Infura Alternative: Cycle Credits and Usage Billing Source: https://docs.blockvectra.com/en/guides/infura-alternative/ Choose BlockVectra to use a cycle CU balance for concentrated supported read tasks and pay for additional reads without a monthly RPC subscription. ## Comparison Competitor figures as of 2026-10-08. BlockVectra method weights, free-plan and key limits come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans) and log ranges from [GET /v1/chains](https://api.blockvectra.com/v1/chains); current figures are rendered by the components below. | Metric | Infura | BlockVectra | Sources | | ------------------------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Free Ethereum `eth_call` budget, no other traffic | 3M credits/day ÷ 80 credits/call = 37,500 calls/day | Current cycle calls in the free-plan table below; use within the remaining balance | [Daily plans](https://docs.infura.io/get-started/pricing/), [method credits](https://docs.infura.io/get-started/pricing/credit-cost/), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | | Standard paid RPC subscription | Developer: $50/month, 15M credits/day included | Usage billing without a monthly RPC subscription | [Plan prices](https://www.infura.io/pricing), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | The free-budget row compares when credits can be used, not equal monthly allowances or measured throughput. A concentrated task needs enough remaining BlockVectra CU and must fit both account and key limits. No per-credit overage price is inferred from Infura subscription fees. ## Why choose BlockVectra ### Method prices and free-account budget Method weights, USD conversion and the free-account budget below come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans). Chain limits come from [GET /v1/chains](https://api.blockvectra.com/v1/chains). Compare the same chain, method, block and complete result; splitting and retries change the number of calls. **Active Conversion Parameters** 1 USD = 10,000 billing units, 1 billing unit = 1,000 CU (1 USD = 10,000,000 CU). **Formula**: CU weight × 1,000,000 ÷ (10,000 × 1,000) USD. | Method | CU per call | Price per 1M calls (USD) | | --- | --- | --- | | `eth_blockNumber` | 1 | $0.10 | | `eth_call` | 15 | $1.50 | | `eth_getLogs` | 30 | $3.00 | | `debug_traceTransaction` | 100 | $10.00 | | `data.block` | 5 | $0.50 | Self-service Push supports up to 1,000,000 addresses per subscription. For 10,000,000 / 100,000,000 addresses per subscription, [contact us to enable capacity](https://blockvectra.com/en/contact/). **BlockVectra task costs and request rates** Free new-key default budget: 100 CU/s. | Method | Example calls | CU per call | Task cost (USD) | Requests/s from key CU budget | | --- | --- | --- | --- | --- | | `eth_call` | 1,000,000 | 15 | $1.50 | 6 | | `eth_getLogs` | 100,000 | 30 | $0.30 | 3 | Task costs are list prices before free credits, gas and additional services. Request rates equal key_defaults.cu_per_sec ÷ method CU and assume only that method uses the key. Free-account caps and other traffic can reduce the usable rate; these figures are budget conversions, not measured throughput. [Current weights, prices and key limits: GET /v1/plans.](https://console-api.blockvectra.com/v1/plans) The Free Plan requires registering an account and using an API key; all keys under an account share an average of 25 calls per second (short bursts allowed). At the end of each 30-day cycle, balances below 30,000,000 CU are refilled to 30,000,000 CU. | Method | CU Weight | Approx Calls / Cycle | Approx / Day | List Price / 1M Calls | | --- | --- | --- | --- | --- | | `eth_blockNumber` | 1 | 30,000,000 | 1,000,000 | $0.10 | | `eth_getBlockByNumber` | 5 | 6,000,000 | 200,000 | $0.50 | | `eth_getBalance` | 10 | 3,000,000 | 100,000 | $1.00 | | `eth_call` | 15 | 2,000,000 | 66,666 | $1.50 | | `eth_getLogs` | 30 | 1,000,000 | 33,333 | $3.00 | | `debug_traceTransaction` | 100 | 300,000 | 10,000 | $10.00 | | `data.block` | 5 | 6,000,000 | 200,000 | $0.50 | | `data.address_balances` | 25 | 1,200,000 | 40,000 | $2.50 | | `data.dex_prices` | 15 | 2,000,000 | 66,666 | $1.50 | | `data.transaction_trace` | 200 | 150,000 | 5,000 | $20.00 | Free-account cap: up to 25 calls per second, shared across all keys in the account, all chains, and the Data API. Per-key `key_defaults.cu_per_sec` and `burst_cu` also apply. Eligible cycle refills top the free balance up to the target rather than adding a full grant. The first paid top-up stops cycle refills while preserving remaining free CU. See [free plan rules](https://docs.blockvectra.com/en/guides/free-plan/). ### A cycle balance for concentrated read tasks For a hypothetical 50,000-call Ethereum `eth_call` task on one day, calculate BlockVectra usage as `50,000 × current eth_call CU weight` using the method table. Divide by `pricing.units_per_usd × pricing.cu_per_unit` for the list-price compute cost before available free credits. You can use the cycle balance when your actual remaining balance covers the task. — defaults are 100 CU/s and burst 400 CU; after a paid top-up each key is at least 2,000 CU/s and burst 10,000 CU, and higher custom limits are kept Free-account cap: up to 25 calls per second, shared across all keys in the account, all chains, and the Data API. Dividing `key_defaults.cu_per_sec` by the current `eth_call` weight gives a sustained CU-budget rate, not measured throughput. The shared account cap and other traffic can reduce the usable rate. Test the same fixed blocks your task needs before migrating. Sources: [plans](https://console-api.blockvectra.com/v1/plans) and [chains](https://api.blockvectra.com/v1/chains), checked **2026-10-09**. ### Keyless trials and programmatic Agent funding Try a listed `public.methods` method at the chain catalog's `public.url` before creating a key. For authenticated access, [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/) lets an Agent create an account and key with a wallet signature. [Agent top-ups](https://docs.blockvectra.com/en/guides/agent-topup/) fund the same usage balance with stablecoins; read networks, tokens and minimums from [top-up status](https://api.blockvectra.com/v1/topup/status). Developers and AI Agents use the same prices and limits. ### Multi-chain address Push Watch the same address set across several supported chains in one subscription, with one HTTPS receiver. This suits wallet activity and payment notifications without maintaining a socket per chain. See [self-service and enterprise address capacity](https://docs.blockvectra.com/en/guides/webhook-push/#address-capacity); [contact us](https://blockvectra.com/en/contact/) to enable enterprise capacity. Address-day and delivered-event charges are separate from RPC calls and are listed in [Push pricing](https://docs.blockvectra.com/en/guides/webhook-push/#billing-and-example). RPC on Robinhood Chain and HyperEVM is listed in the [chain catalog](https://api.blockvectra.com/v1/chains). Check methods and Push support per network; use the [chain-specific starter guide](https://docs.blockvectra.com/en/guides/robinhood-chain/) and [HyperEVM backfill guide](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) for the relevant workflow. ## Migration steps 1. **Inventory and coverage:** list chains, methods, fixed blocks, log spans and subscription dependencies. Check `methods.allow`, `methods.deny`, `public.methods`, `state_window_blocks` and `ws` in the [catalog](https://api.blockvectra.com/v1/chains). A null history window is unspecified, not archive coverage. A keyless `public.url` smoke test validates only its listed public methods. 2. **Key and authentication:** obtain a BlockVectra key through the [console](https://console.blockvectra.com/keys/) or [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/). Keep it in your server environment. RPC accepts `POST /v1/{chain}/{api_key}` or `POST /v1/{chain}` with `x-api-key`; Data API uses `x-api-key`. This Ethereum WETH `decimals()` example uses the header: ```bash if [ -z "$BLOCKVECTRA_API_KEY" ]; then echo "Set BLOCKVECTRA_API_KEY in your server environment" exit 1 fi curl --fail-with-body -sS --max-time 15 https://api.blockvectra.com/v1/eth_mainnet \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"to":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2","data":"0x313ce567"},"latest"]}' ``` 3. **Replay before switching:** replace `latest` with the same supported fixed block on both providers and record the block hash. Compare returned values and JSON-RPC `error`, even after HTTP 200. Test representative log queries, bounded retries, rate-limit recovery and cursor resume. Migrate proprietary APIs and subscriptions separately; move traffic after the required results match. ## FAQ ### Does a lower method price mean a lower total task cost? Calculate `max(0, sum(calls × method CU) − available_free_cu) / (pricing.units_per_usd × pricing.cu_per_unit)`. Include splitting, retries and any services your task uses. Existing included credits change incremental costs; compare the complete result rather than billing-unit names. ### Can I migrate by changing the endpoint? For supported standard RPC methods, update the endpoint and path key or `x-api-key` header, then replay fixed-block requests. Check historical state and method coverage first. Proprietary APIs, WebSocket subscriptions and Push receivers need their own migration tests; see [historical state](https://docs.blockvectra.com/en/guides/evm-historical-state/) and [Webhook versus WebSocket](https://docs.blockvectra.com/en/guides/webhook-vs-websocket/). Use [How to choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/) for a workload checklist and self-tests. --- # Ink RPC: free chain ID read, keyed pool discovery Source: https://docs.blockvectra.com/en/guides/ink-pool-discovery/ ## First read: Ink RPC with no API key Read the Ink Mainnet chain ID for free without an account or API key. Send one HTTP POST to the public endpoint: ```bash curl -sS -X POST 'https://api.blockvectra.com/v1/ink_mainnet/public' \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' ``` Expected response: ```json {"jsonrpc":"2.0","id":1,"result":"0xdef1"} ``` Stop if the request fails, the response contains a JSON-RPC `error`, or `result` does not equal `0xdef1` (chain ID 57073). HTTP 200 alone does not mean the RPC succeeded. To discover pools with hash-pinned `eth_call`, continue below with an API key. ## Direct answer To discover pools on Ink Mainnet at a single block, use the authenticated endpoint `https://api.blockvectra.com/v1/ink_mainnet` with your key in the `x-api-key` header. Read the latest block once, then send every later `eth_call` with that block's hash as an [EIP-1898](https://eips.ethereum.org/EIPS/eip-1898) selector, `{"blockHash": "0x…", "requireCanonical": true}`. The keyless `…/v1/ink_mainnet/public` route rejects this hash-pinned `eth_call` with `-32011` and reason `state_window` (see [When a hash-pinned read is rejected](https://docs.blockvectra.com/en/guides/ink-pool-discovery/#when-a-hash-pinned-read-is-rejected)), so this task needs a key. Keep the key in the `BLOCKVECTRA_API_KEY` environment variable on your machine. Do not put it in a URL, a chat message, source code or a log line. To get one, [log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F), or follow the [programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/) from an agent or script. This page does not create accounts or keys. * **First step:** check that `eth_chainId` returns `0xdef1` (57073). * **Done when:** the script prints one block hash, the factory's pool count at that hash and exactly that many pool addresses. ## The four requests 1. `eth_chainId` must equal 57073. Stop on anything else. 2. `eth_getBlockByNumber` with `latest` returns the head. Keep its `hash`; do not use the block number from now on. 3. `eth_call` to the factory `0x7660BF2aDefC687C22906112ca323d60A00358cF` with `allPoolsLength()` (selector `0xefde4e64`) at `{blockHash, requireCanonical: true}` returns the pool count. 4. One `eth_call` to Multicall3 `0xcA11bde05977b3631167028862bE2a173976CA11` at the same hash selector runs `aggregate3` over `allPools(0)` … `allPools(count − 1)` (selector `0x41d1de97`). Build the list from the count you just read; do not hard-code it. ## Example: Node.js and viem This example needs Node.js 20 or later and viem 2.x. Install viem yourself in your own project with `npm install viem`; nothing else is required. Save the script as `ink-pools.mjs`: ```bash export BLOCKVECTRA_API_KEY='replace-with-your-key' node ink-pools.mjs ``` ```js import { decodeAbiParameters, decodeFunctionResult, encodeFunctionData, parseAbi, zeroAddress } from "viem"; const ENDPOINT = "https://api.blockvectra.com/v1/ink_mainnet"; const CHAIN_ID = 57073n; const FACTORY = "0x7660BF2aDefC687C22906112ca323d60A00358cF"; const MULTICALL3 = "0xcA11bde05977b3631167028862bE2a173976CA11"; const MAX_POOLS = 150n; // example budget for this script, not a product limit const TIMEOUT_MS = 15_000; const GAP_MS = 1_100; const apiKey = process.env.BLOCKVECTRA_API_KEY; if (!apiKey || apiKey === "replace-with-your-key") throw new Error("Set BLOCKVECTRA_API_KEY in your local environment"); const factoryAbi = parseAbi([ "function allPoolsLength() view returns (uint256)", "function allPools(uint256) view returns (address)", ]); const multicallAbi = parseAbi([ "function aggregate3((address target, bool allowFailure, bytes callData)[] calls) payable returns ((bool success, bytes returnData)[] returnData)", ]); // One request at a time, no retry, no redirect, no fallback to another endpoint. let lastSentAt = 0; async function rpc(method, params) { const wait = lastSentAt + GAP_MS - Date.now(); if (wait > 0) await new Promise((resolve) => setTimeout(resolve, wait)); lastSentAt = Date.now(); const response = await fetch(ENDPOINT, { method: "POST", headers: { "content-type": "application/json", "x-api-key": apiKey }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }), redirect: "error", signal: AbortSignal.timeout(TIMEOUT_MS), }); if (response.status !== 200) throw new Error(`${method}: HTTP ${response.status}`); const body = await response.json(); if (body?.jsonrpc !== "2.0" || body.id !== 1) throw new Error(`${method}: invalid JSON-RPC response`); if (body.error) { const reason = String(body.error.data?.reason ?? "").slice(0, 64); throw new Error(`${method}: JSON-RPC error ${body.error.code} ${reason}`.trim()); } return body.result; } function requireData(value, bytes) { const valid = typeof value === "string" && /^0x(?:[0-9a-f]{2})*$/i.test(value) && (bytes === undefined || value.length === 2 + bytes * 2); if (!valid) throw new Error("Invalid eth_call result"); return value; } // 1. Chain id const chainIdHex = await rpc("eth_chainId", []); if (typeof chainIdHex !== "string" || !/^0x(?:0|[1-9a-f][0-9a-f]*)$/i.test(chainIdHex)) throw new Error("Invalid chain id"); if (BigInt(chainIdHex) !== CHAIN_ID) throw new Error(`Expected chain ${CHAIN_ID}, got ${BigInt(chainIdHex)}`); // 2. Read the head once and keep only its hash const head = await rpc("eth_getBlockByNumber", ["latest", false]); const blockHash = head?.hash; if (typeof blockHash !== "string" || !/^0x[0-9a-f]{64}$/i.test(blockHash)) throw new Error("Invalid block hash"); const at = { blockHash, requireCanonical: true }; // 3. Pool count at that hash const countData = await rpc("eth_call", [ { to: FACTORY, data: encodeFunctionData({ abi: factoryAbi, functionName: "allPoolsLength" }) }, at, ]); const count = decodeFunctionResult({ abi: factoryAbi, functionName: "allPoolsLength", data: requireData(countData, 32) }); if (count < 1n || count > MAX_POOLS) throw new Error(`allPoolsLength ${count} is outside 1..${MAX_POOLS}`); const size = Number(count); // 4. allPools(i) for every i below the count, in one aggregate3 at the same hash const calls = Array.from({ length: size }, (_, i) => ({ target: FACTORY, allowFailure: true, callData: encodeFunctionData({ abi: factoryAbi, functionName: "allPools", args: [BigInt(i)] }), })); const listData = await rpc("eth_call", [ { to: MULTICALL3, data: encodeFunctionData({ abi: multicallAbi, functionName: "aggregate3", args: [calls] }) }, at, ]); const results = decodeFunctionResult({ abi: multicallAbi, functionName: "aggregate3", data: requireData(listData) }); if (results.length !== size) throw new Error(`aggregate3 returned ${results.length} results for ${size} calls`); const pools = results.map(({ success, returnData }, i) => { if (!success) throw new Error(`allPools(${i}) failed inside Multicall3`); const word = requireData(returnData, 32); if (!/^0x0{24}[0-9a-f]{40}$/i.test(word)) throw new Error(`allPools(${i}) returned non-zero address padding`); const [pool] = decodeAbiParameters([{ type: "address" }], word); if (pool === zeroAddress) throw new Error(`allPools(${i}) returned the zero address`); return pool; }); if (new Set(pools.map((pool) => pool.toLowerCase())).size !== pools.length) throw new Error("Duplicate pool address"); console.log(JSON.stringify({ blockHash, count: size, pools }, null, 2)); ``` The script stops with a non-zero exit code and no partial output when any of these happens: * an HTTP status other than 200, a JSON-RPC `error`, a 15 second timeout or a redirect; * a chain id other than 57073, a malformed block hash or a result that is not valid hex or valid ABI data; * a count outside 1 to 150. The 150 cap is only a bounded budget for this example; it is not a product limit, and we have not tested a 150-call batch here; * an inner `allPools(i)` call that fails, or a zero or duplicate pool address. It makes four calls, about 1.1 seconds apart, never retries, never broadcasts a transaction, never pages and never substitutes `latest` or a block number for the hash. It prints only the hash, the count and the pool addresses, never headers or the key. ## Sample run Our QA ran these four requests against `ink_mainnet` with a key on 2026-11-03 at 06:40 UTC. Every response was HTTP 200 with no retry: | Item | Observed | | ------------------------------- | ----------------------------------------------------------------------------------- | | Chain id | `0xdef1` (57073) | | Block | 60189593, hash `0xc3b4349618611b7dfd979140a70087920cb8416eb1c8eff82cb46332494b7617` | | `allPoolsLength()` at that hash | 17 | | `aggregate3` at that hash | 17 results, all successful, non-zero and unique | This is one QA run, not a current value: the head moves and the factory's count can grow, so read both again when you run it. It does not show a full Pharos run, a 150-call batch, pool balances or TVL, sustained use or adoption by any team. The [saved requests and responses](https://gist.github.com/gjwang/5ce60ad10587040cbe2d743dd0a3e149/a68a3c917e4a272b9131bd42c30c875b55ff27a5#file-20261103-keyed-hash-pool-discovery-json) are public. ## When a hash-pinned read is rejected On 2026-11-03 the keyless route returned the head, then rejected an `eth_call` with `{blockHash, requireCanonical: true}` using JSON-RPC `-32011` and `error.data.reason: state_window`. That error is not retryable (see [state\_window](https://docs.blockvectra.com/en/errors/#state_window) and [historical state windows](https://docs.blockvectra.com/en/guides/evm-historical-state/)). The authenticated route and the keyless route are different entry points; check `public.methods` and the state window in [GET /v1/chains](https://api.blockvectra.com/v1/chains) rather than assuming one behaves like the other. If a hash-pinned call is rejected, because the block is no longer canonical or the serving node cannot serve it: * Stop. Do not repeat the same hash, and do not swap in `latest` or a block number to get an answer. The count and the pool list would then come from different blocks. * Start a new run from step 2. Its output is a new snapshot with its own hash. Two reads accepted at the same hash do not prove the block can never be reorganized later, and they do not validate the rest of your application. Treat the output as a snapshot at that hash. For the method itself, see [eth\_call](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_call/); for Ink Mainnet parameters and access options, see the [Ink chain page](https://blockvectra.com/en/chains/ink_mainnet/). ## Independent public-RPC observations If you also want an outside view of public Ink RPC endpoints, OpenChainBench publishes one at [openchainbench.com/benchmarks/ink-rpc](https://openchainbench.com/benchmarks/ink-rpc), with the same data as JSON at [openchainbench.com/api/stat/ink-rpc](https://openchainbench.com/api/stat/ink-rpc). It measures a keyless `eth_getBlockByNumber("latest", false)` every 60 seconds from three regions. That is a different workload from this guide's keyed, hash-pinned `eth_call` and Multicall3 requests, and it says nothing about whether pool discovery succeeds, so run the example with your own key before relying on it. ## Next steps * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # LangChain tool to read Ethereum blockchain data Source: https://docs.blockvectra.com/en/guides/langchain/ A LangChain tool to read Ethereum blockchain data is one function that POSTs JSON-RPC to `https://api.blockvectra.com/v1/eth_mainnet/public`. That endpoint needs no API key or sign-up for the methods in each chain's `public.methods`. A key adds the rest, and the Free Plan gives 30,000,000 CU per 30-day window. Checked 2026-10-21. ```python import httpx from langchain.agents import create_agent from langchain.tools import tool RPC = "https://api.blockvectra.com/v1/eth_mainnet/public" @tool def eth_block_number() -> str: """Return the latest Ethereum mainnet block number as a hex string.""" body = {"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []} return httpx.post(RPC, json=body, timeout=10).json()["result"] agent = create_agent("claude-sonnet-5", tools=[eth_block_number]) result = agent.invoke({"messages": [{"role": "user", "content": "What is the latest block?"}]}) print(result["messages"][-1].content) ``` Install with `pip install "langchain[anthropic]" httpx`; the shown `claude-sonnet-5` model needs `ANTHROPIC_API_KEY`, and the [LangChain quickstart](https://docs.langchain.com/oss/python/langchain/quickstart) covers selecting other models and providers. The tool uses LangChain's [`@tool` decorator](https://docs.langchain.com/oss/python/langchain/tools) and [`create_agent`](https://reference.langchain.com/python/langchain/agents/factory/create_agent). ## The same tool in TypeScript Use Node.js 22 or later and install with `npm install langchain @langchain/core @langchain/anthropic zod`; the shown `claude-sonnet-5` model needs `ANTHROPIC_API_KEY`, and the [LangChain JS quickstart](https://docs.langchain.com/oss/javascript/langchain/quickstart) covers choosing other models and providers. ```typescript import * as z from "zod"; import { createAgent, tool } from "langchain"; const ethBlockNumber = tool( async () => { const res = await fetch("https://api.blockvectra.com/v1/eth_mainnet/public", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_blockNumber", params: [] }), }); return (await res.json()).result as string; }, { name: "eth_block_number", description: "Latest Ethereum mainnet block number (hex).", schema: z.object({}) }, ); const agent = createAgent({ model: "claude-sonnet-5", tools: [ethBlockNumber] }); ``` See the LangChain JS [tools guide](https://docs.langchain.com/oss/javascript/langchain/tools) for the `tool()` signature. ## Call any method with an API key Methods outside `public.methods`, such as `eth_getLogs`, need a key. Read it from the environment and send it in the `x-api-key` header; the chain slug (`eth_mainnet`, `base_mainnet`, and so on) comes from `GET /v1/chains`: ```python import os import httpx from langchain.tools import tool @tool def rpc_call(chain: str, method: str, params: list) -> dict: """Call a JSON-RPC method on a BlockVectra chain slug such as base_mainnet.""" headers = {"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]} body = {"jsonrpc": "2.0", "id": 1, "method": method, "params": params} return httpx.post(f"https://api.blockvectra.com/v1/{chain}", json=body, headers=headers, timeout=15).json() ``` Returning the whole JSON-RPC response lets the model read an `error` object and change its next call. To create the key without a browser, run the four-step flow in the [programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/?ref=docs-langchain): challenge, signature, login, then `POST /keys`. Developers can also [create a key in the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F\&ref=docs-langchain). ## Add the docs MCP server LangChain agents connect to MCP servers through `MCPAdapter`. Point it at `https://docs.blockvectra.com/mcp` to give the agent `list_chains`, `get_status`, `rpc_call`, `read_doc` and the other tools listed on the [MCP server page](https://docs.blockvectra.com/en/guides/mcp-server/). Connecting needs no key. ```python from langchain.agents import create_agent from langchain.mcp import MCPAdapter async def main(): async with MCPAdapter("https://docs.blockvectra.com/mcp") as adapter: tools = await adapter.list_tools() agent = create_agent("claude-sonnet-5", tools) return await agent.ainvoke({"messages": [{"role": "user", "content": "List the supported chains."}]}) ``` Install with `pip install "langchain[anthropic,mcp]>=1.4.0"` (in beta). To use keyed tools, pass the key as a bearer token: `MCPAdapter(Client(url, auth=os.environ["BLOCKVECTRA_API_KEY"]))` with `from fastmcp.client import Client`, as in LangChain's [MCP authentication guide](https://docs.langchain.com/oss/python/langchain/mcp/auth). In TypeScript, install with `npm install langchain @langchain/core @langchain/anthropic @langchain/langgraph "@langchain/mcp-adapters@^2.0.0"`; the shown `claude-sonnet-5` model also needs `ANTHROPIC_API_KEY`, and the `headers` map below is for an optional BlockVectra key: ```typescript import { MCPAdapter } from "@langchain/mcp-adapters"; import { createAgent } from "langchain"; const adapter = new MCPAdapter({ servers: { blockvectra: { url: "https://docs.blockvectra.com/mcp", headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }, }, }); try { const agent = createAgent({ model: "claude-sonnet-5", tools: await adapter.listTools() }); // agent.invoke(...) } finally { await adapter.close(); } ``` Drop the `headers` line to connect keyless. Official references: [LangChain MCP (Python)](https://docs.langchain.com/oss/python/langchain/mcp) and [LangChain MCP (JavaScript)](https://docs.langchain.com/oss/javascript/langchain/mcp). ## Errors your tool will see | Response | Meaning | What the agent should do | | ------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------------- | | HTTP 401, `-32024`, `missing_api_key` | Keyed URL called without a key | Send the key in `x-api-key` or the path | | HTTP 401, `-32024`, `invalid_api_key` | Key unknown, disabled or revoked | Check the key in the console; a new key takes a few seconds to activate | | `-32601`, `method_not_public` | Method is not in the chain's `public.methods` | Use a keyed URL instead of `/public` | | `-32601`, method not available | Method is not enabled on that chain | Check `methods.allow` in `GET /v1/chains` | Each error carries `data.reason` and a `docs_url`; the full list is on the [errors page](https://docs.blockvectra.com/en/errors/). ## Common questions **Does the public endpoint work for `eth_getLogs`?** No. It serves only the methods in the chain's `public.methods`; `eth_getLogs` and the Data API need an API key. **Can the agent pass the API key as a tool argument?** No. Keep it in the environment or the MCP client headers; the MCP server rejects keys in tool arguments. **Can the tool target another chain?** Yes. Replace `eth_mainnet` with any chain slug that has a `public.url` in `GET /v1/chains`. ## Next steps * [Agent framework overview](https://docs.blockvectra.com/en/guides/agent-frameworks/) for ElizaOS, viem, wagmi and Coinbase AgentKit. * [Connect an AI agent](https://docs.blockvectra.com/en/guides/ai-agents/) to discover endpoints with MCP, llms.txt and OpenAPI. * [Billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) for CU metering, rate limits and non-billed errors. --- # eth_getLogs vs Token Transfers API: ERC-20 transfer history Source: https://docs.blockvectra.com/en/guides/logs-vs-transfers/ For wallet history or ERC-20 transfer reconciliation, start with the [Token Transfers API](https://blockvectra.com/en/data/transfers/). Use `eth_getLogs` when you need contract event logs. Developers and AI agents can query indexed address transfers through the same blockchain data API. The [wallet assets guide](https://docs.blockvectra.com/en/guides/wallet-assets/) combines token balances, transfer history and metadata; the [Data API reference](https://docs.blockvectra.com/en/api/data/) defines request parameters and response schemas. ## Tasks this guide helps you complete * [Query contract event logs](https://docs.blockvectra.com/en/guides/logs-vs-transfers/#querying-logs-with-eth_getlogs) through authenticated RPC in bounded block ranges for monitoring or log backfill. * [Query indexed ERC-20 transfer history](https://docs.blockvectra.com/en/guides/logs-vs-transfers/#querying-transfers-with-the-data-api) through the blockchain data API by address or token contract, with cursor pagination and coverage checks. ## Two ways to read logs and transfers `eth_getLogs` is a JSON-RPC method: it returns block logs through the JSON-RPC endpoint. The Data API exposes token transfer history through two chain-scoped endpoints: * `GET /{chain}/addresses/{address}/transfers` — transfers involving an address. * `GET /{chain}/tokens/{token}/transfers` — transfers for a single token contract. Both use the same API key and are metered in CU by method weight (see the weights below). Which one fits depends on how recent the data is, whether you need a block window, and how you paginate. ## Limits that apply to eth\_getLogs `eth_getLogs` is bounded by per-chain limits that the public `GET /v1/chains` response publishes: * **Block span**: `max_logs_block_range` is the maximum number of blocks a single `eth_getLogs` request may span. It differs by chain — read it from `GET /v1/chains` (chains are listed on [Supported Chains](https://docs.blockvectra.com/en/chains/)) instead of hardcoding it. A wider range is rejected with JSON-RPC error `-32602 eth_getLogs block range too large` (not billed). * **Node sync**: while a chain's node is not synced, `eth_getLogs` returns `-32010` (not billed). * **State window**: the state window that `GET /v1/chains` reports as `state_window_blocks` applies to state-reading methods such as `eth_call` and `eth_getBalance`, not to `eth_getLogs`. * **Node pruning**: block and log reads are not limited by the state window, but they are limited by the node's retained history. Data that has been pruned returns `4444 pruned history unavailable` (not billed). When the `fromBlock` and `toBlock` filter fields are omitted or `null`, they default to `latest`. For a history scan that exceeds one request, follow the [eth\_getLogs block-range guide](https://docs.blockvectra.com/en/guides/getlogs-block-range/) to split the inclusive block window and advance only after each chunk succeeds. Calling `eth_subscribe` over HTTP returns `-32601 method not available`. On chains where `ws` is `true` in `/v1/chains`, `eth_subscribe` is available over WebSocket (see [Supported Chains](https://docs.blockvectra.com/en/chains/)); otherwise, poll `eth_getLogs` over the newest blocks. ## What the Data API transfers endpoints provide The two endpoints require different parameters: | Endpoint | `standard` | Block window | | -------------------------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /{chain}/addresses/{address}/transfers` | Required: `erc20` or `erc721`. `erc1155` returns `422 no_coverage` | `from_block` and `to_block` are both required. Results are ordered by `(block_number, log_index)` descending. `direction` (`in`, `out`, or `any`; default `any`) filters by direction, and `token` optionally restricts the results to one contract. | | `GET /{chain}/tokens/{token}/transfers` | Required: `erc20`, `erc721`, or `erc1155` | `from_block` and `to_block` are optional. An absent `to_block` defaults to `as_of_block`; an explicit `to_block` or `from_block` above it is a hard `409 not_indexed_yet`, with no `clamp` escape. | ### Pagination Both endpoints are keyset-paginated: * `limit` defaults to 50; values above 500 are clamped to 500, and `0` or a non-integer returns `400 bad_request`. * A page with `limit` rows may include `next_cursor` even when no further rows remain. Follow each returned cursor until the key is absent; the final page may contain an empty `data` array. When there is no cursor, the key is omitted, never `null`. * Pass the returned value back as `cursor`, unchanged, to fetch the next page. A cursor is valid only for the chain, endpoint, and query parameters that issued it. ### Coverage and finality For `GET /{chain}/tokens/{token}/transfers`, coverage is scoped to the token-transfer dataset of the requested `standard`. Its lower bound is computed from that dataset and can sit above the chain's `coverage.from_block` when the dataset's recorded build coverage starts later. A window entirely before that lower bound returns `422 no_coverage`. A window that starts before it, or omits `from_block`, is served as far as the dataset goes and reports `meta.coverage = "partial"`. `meta.as_of_block` is the newest fully written block (the write watermark), not proof that every block between the lower bound and it was indexed. The address endpoint still requires both `from_block` and `to_block`; do not apply this token-endpoint lower-bound rule to every transfers route. See [Supported Chains](https://docs.blockvectra.com/en/chains/) for which chains expose the dataset. During an ascending historical backfill, a gap between the backfilled tail and the live start is not detected: a window inside that gap can still return `200` with an empty `data` array. None of HTTP success, an empty result, exhausting every cursor, or a coverage field alone proves that an entire range is complete. Validate completeness against the data you expect or your own reconciliation. Each transfer item contains `token`, `standard`, `from`, `to`, `block_number`, `block_timestamp`, `tx_hash`, `tx_index`, and `log_index`. ERC-20 items add `amount`; ERC-721 items add `token_id`; ERC-1155 items add `operator`, `token_id`, `value`, and `batch_index`. ## Which one to use | Typical task | Better fit | Why | | -------------------------------------------- | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Events in the most recent few hundred blocks | `eth_getLogs` | One request can cover a recent range as long as it does not exceed that chain's `max_logs_block_range`. | | An address's historical transfers | `GET /{chain}/addresses/{address}/transfers` | Address-scoped query with a `from_block`/`to_block` window, `direction` and `token` filters, and cursor pagination; results serve up to `as_of_block`. | | All transfers of a token | `GET /{chain}/tokens/{token}/transfers` | Token-contract-scoped query covering `erc20`, `erc721`, and `erc1155`, with an optional block window and cursor pagination across the range the dataset serves. | | Live monitoring of new events | `eth_subscribe` (WebSocket chains) / `eth_getLogs` (polling) | Subscribe to new heads or logs over WebSocket where supported, or poll recent block ranges. | ## Querying logs with eth\_getLogs **cURL** ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key # fromBlock / toBlock default to latest. Set an explicit recent range to follow # new events, and keep its span within the chain's max_logs_block_range. curl -s "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "eth_getLogs", "params": [{ "address": "0x1111111111111111111111111111111111111111", "fromBlock": "latest", "toBlock": "latest" }] }' ``` **TypeScript** ```ts const res = await fetch("https://api.blockvectra.com/v1/robinhood_mainnet", { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": process.env.BLOCKVECTRA_API_KEY!, }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_getLogs", params: [{ address: "0x1111111111111111111111111111111111111111", fromBlock: "latest", toBlock: "latest", }], }), }); const { result } = await res.json(); console.log(result); // npx tsx example.mts ``` **Python** ```python import os import requests res = requests.post( "https://api.blockvectra.com/v1/robinhood_mainnet", headers={ "Content-Type": "application/json", "x-api-key": os.environ["BLOCKVECTRA_API_KEY"], }, json={ "jsonrpc": "2.0", "id": 1, "method": "eth_getLogs", "params": [{ "address": "0x1111111111111111111111111111111111111111", "fromBlock": "latest", "toBlock": "latest", }], }, ) res.raise_for_status() print(res.json()) ``` ## Querying transfers with the Data API **cURL** ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key # from_block / to_block are optional here; omitting to_block defaults to as_of_block. curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens/0x1111111111111111111111111111111111111111/transfers?standard=erc20" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts let cursor: string | undefined; do { const url = new URL( "https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens/0x1111111111111111111111111111111111111111/transfers", ); url.searchParams.set("standard", "erc20"); if (cursor) url.searchParams.set("cursor", cursor); const res = await fetch(url, { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }); const body = await res.json(); console.log(body.data); cursor = body.next_cursor; // stop when next_cursor is absent; a final empty page is valid } while (cursor); // npx tsx example.mts ``` **Python** ```python import os import requests url = "https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens/0x1111111111111111111111111111111111111111/transfers" cursor = None while True: params = {"standard": "erc20"} if cursor: params["cursor"] = cursor res = requests.get( url, params=params, headers={"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]}, ) res.raise_for_status() body = res.json() print(body["data"]) cursor = body.get("next_cursor") # stop when next_cursor is absent; a final empty page is valid if not cursor: break ``` To query by address instead, `from_block` and `to_block` are required: ```bash # clamp=true truncates a too-wide window, or a to_block above as_of_block, # instead of returning 409. curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/0x1111111111111111111111111111111111111111/transfers?standard=erc20&from_block=0&to_block=73000000&direction=any&clamp=true" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` ## CU per call Every method is billed by its CU weight. The weights below are read from the platform plans API: **CU weight per call** | Method | CU per call | | --- | --- | | `eth_getLogs` | 30 | | `data.address_transfers` | 25 | | `data.token_transfers` | 25 | For current prices and top-up options, see the [Pricing page](https://blockvectra.com/en/pricing/). ## Estimating calls and CU for a block window Block windows are inclusive: `N = to_block - from_block + 1`. If each range request covers at most `S` blocks, a successful sweep takes at least `ceil(N / S)` requests. For example, 10,000,000 blocks at 5 blocks per request is 2,000,000 requests; at 10,000 blocks per request it is 1,000. These are arithmetic examples only, not a promise about any chain or provider limit. Failures and retries add requests, and so do result-size limits. A smaller window does not automatically cost less: more calls can offset the narrower span, and CU is charged per call weight. Indexed transfers paginate by result, not by block count, so a sweep may need additional pages, including a possible final empty page; do not derive page count from the number of blocks. Multiply the per-call weights above by the expected number of billable calls to estimate CU, then check the [Pricing page](https://blockvectra.com/en/pricing/) for current prices. ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # BlockVectra MCP server: blockchain RPC and docs tools for AI agents Source: https://docs.blockvectra.com/en/guides/mcp-server/ The BlockVectra Model Context Protocol (MCP) server at `https://docs.blockvectra.com/mcp` gives developers and AI agents 15 tools for blockchain RPC calls, chain status, pricing and docs. It needs no API key to connect: 10 tools never need one; the others use `x-api-key` from your client headers. Install in one line: `claude mcp add --transport http blockvectra-docs https://docs.blockvectra.com/mcp` The endpoint is [MCP endpoint](https://docs.blockvectra.com/mcp) (HTTP POST receiving JSON-RPC 2.0; GET returns 405), served over MCP Streamable HTTP and stateless. For the HTTP files, public JSON and the sign-up flow around it, see [Connect AI agents](https://docs.blockvectra.com/en/guides/ai-agents/). To compare endpoints for your workload, use the [RPC provider checklist](https://docs.blockvectra.com/en/guides/choose-rpc-provider/) to check method costs, historical coverage and recovery. ## Set up your MCP client Choose the setup instructions for your client: * [Cline CLI and its first documentation read](https://github.com/blockvectra/mcp/blob/e1ba08d899e79fc01fd9a43075171e5c7928fd58/llms-install.md#cline-cli) * [Kilo CLI project configuration](https://github.com/blockvectra/mcp/blob/e1ba08d899e79fc01fd9a43075171e5c7928fd58/llms-install.md#kilo-cli) * [ToolHive local HTTP proxy](https://github.com/blockvectra/mcp/blob/3c5525ab04eefb5867914ebcd1fd1e3d17a590d8/README.md#toolhive-local-http-proxy) Once connected, ask your agent to call `read_doc` with `{"path":"quickstart","lang":"en"}`. This documentation lookup needs no BlockVectra API key. Only need to look things up in the docs? Jump to [Docs-only remote HTTP](https://docs.blockvectra.com/en/guides/mcp-server/#docs-only-remote-http). ## SDK examples Use these standalone examples to connect to `/mcp/docs`, search the documentation and read a returned page without a model or BlockVectra credentials: * [Python / OpenAI Agents SDK: setup and run](https://github.com/blockvectra/agent-quickstart/blob/c4c0d5c81c5518add7f0f204a77f42934d183588/README.md#read-documentation-with-the-openai-agents-sdk). * [Node.js / mcp-use: requirements, install and run](https://github.com/blockvectra/agent-quickstart/blob/c4c0d5c81c5518add7f0f204a77f42934d183588/README.md#read-documentation-with-mcp-use-nodejs). ## Tasks on Robinhood Chain * [Read data on Robinhood Chain](https://docs.blockvectra.com/en/guides/robinhood-chain/): choose the network and read chain data. * [Begin testnet development on Robinhood Chain](https://docs.blockvectra.com/en/guides/robinhood-testnet-starter/): connect to the testnet and begin development. * [Get testnet tokens on Robinhood Chain](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/): request testnet tokens and check the transaction receipt. ## Agent Skill The `blockvectra-docs` Agent Skill helps your coding agent find the right BlockVectra page for a task and answer with the source attached. With the MCP server configured, it uses `search_docs` then `read_doc`; otherwise it reads the Markdown pages over HTTP. Looking up docs needs no BlockVectra account or API key. The Skill only covers documentation. It does not set up MCP for you or run RPC calls, account creation or transactions, so keep following the install steps on this page for MCP. Run this in your own project (Node.js 22.20 or later) and pick the agent you use: ```bash npx --yes skills@1.7.4 add blockvectra/agent-quickstart --skill blockvectra-docs ``` Then ask, for example: "How do I get started on Robinhood Chain? Separate mainnet from testnet and cite the docs." The source is in [agent-quickstart](https://github.com/blockvectra/agent-quickstart/tree/main/skills/blockvectra-docs). ## Tools | Tool | What it does | API key | Access | | --- | --- | --- | --- | | `read_doc` | Read a documentation page as Markdown. | Not needed | Read-only | | `search_docs` | Search documentation titles, paths and summaries. | Not needed | Read-only | | `list_chains` | List supported chains, parameters and method policies (GET /v1/chains). | Not needed | Read-only | | `get_status` | Read live service and chain status (GET /v1/status). | Not needed | Read-only | | `get_pricing` | Read Compute Unit weights, Free Plan parameters and key defaults (GET /v1/plans). | Not needed | Read-only | | `estimate_usage` | Estimate Compute Units and cost for one or more methods. | Not needed | Read-only | | `how_to_get_api_key` | Return the steps for getting an API key and the request authentication shapes. | Not needed | Read-only | | `get_method_info` | Show a method's chain availability, CU weight and price. | Not needed | Read-only | | `explain_error` | Look up an error's meaning, billing, retryability and recovery. | Not needed | Read-only | | `list_docs` | List every documentation page with its path and title. | Not needed | Read-only | | `rpc_call` | Run a read-only JSON-RPC method on a supported chain. | Optional: keyless only for methods in the chain's public.methods | Read-only | | `data_api_get` | Send a GET request to the Data API of a supported chain. | Required (x-api-key header) | Read-only | | `get_account` | Read account balance, CU and rate limits (GET /v1/account). | Required (x-api-key header) | Read-only | | `get_deposit_address` | Read the account's deposit address, open networks and tokens. | Required (x-api-key header) | Read-only | | `send_raw_transaction` | Broadcast an already signed raw transaction (eth_sendRawTransaction). | Optional: keyless only for methods in the chain's public.methods | Broadcasts a signed transaction | This table is generated from the server's tool registry, so it lists every tool `tools/list` returns. Each tool takes the arguments and returns the fields described in its own `tools/list` schema. ### API key security Keyed tools need an API key to run Data API requests, account operations, or RPC methods outside a chain's public methods. Configure the key only in your MCP client's HTTP headers: `x-api-key` or `Authorization: Bearer …`. Keep private keys local; do not send credentials in tool arguments, URLs or chat. ### Argument credential rules These rules apply to every tool, including objects nested inside arrays and extra properties that an input schema leaves open: * For field-name comparison, convert only ASCII `A-Z` to `a-z`, then remove ASCII `_` and `-`. Do not trim whitespace, split dots or fold Unicode characters. * At every depth, the normalized names `apikey`, `xapikey`, `authorization`, `privatekey` and `secretkey` are reserved. Examples include `api_key`, `apiKey`, `API_KEY`, `x-api-key`, `xApiKey`, `Authorization`, `privateKey` and `secret_key`. The normalized name `key` is also reserved at the argument root; a nested generic `key`, `publicKey` or `key_id` is not reserved by this rule. * A reserved field is rejected whenever it is present, including a value of `null`, an empty string, `false`, zero, an array or an object. * String values at every depth are checked for the case-sensitive API-key marker `(?:^|[^A-Za-z0-9_-])rgw_[A-Za-z0-9_-]+(?=$|[^A-Za-z0-9_-])` and the uppercase PEM marker `-----BEGIN (?:RSA |EC |OPENSSH |ENCRYPTED )?PRIVATE KEY-----`. For example, the synthetic marker `rgw_example` is rejected; this does not assert that it is a valid API key. * Opaque values are not decoded. JSON embedded in a string is not parsed as an object, but its literal characters are still checked for those markers. Bare hashes, public keys and signed raw-transaction hex are not classified as credentials solely by length; the literal `invalid-secret-placeholder` alone is not a recognized marker. Do not send real credentials in any encoding: an accepted opaque value is not proof that it is safe to disclose. For a known tool, omitted `arguments` retain the tool's existing behavior. Present arguments must be an object: `null`, arrays and scalar roots are rejected. The credential rules run before the tool's published input-schema checks and before header authentication or execution. Other properties remain subject to that input schema; this policy does not close objects whose schema allows extra properties. Unknown tool names remain JSON-RPC protocol errors. ### Input rejection responses A local input rejection returns HTTP `200`, `Cache-Control: no-store` and `result.isError: true`. `result.structuredContent` is a required object with exactly `error`, `reason` and `message`; a text content block contains JSON that decodes to the same object. The error is `invalid_tool_arguments`, and the fixed message does not echo supplied fields, paths or values. | `reason` | Action before retrying | | --------------------- | -------------------------------------------------------------------------------------------------- | | `invalid_root` | Send an object, or omit arguments if the tool supports omission. | | `schema_type` | Match the published input-schema types. | | `schema_enum` | Use a value allowed by the published input schema. | | `undeclared_property` | Remove properties rejected by the input schema. | | `credential_field` | Remove reserved fields; configure API keys in the client HTTP headers and keep private keys local. | | `credential_value` | Remove recognized credential material; configure API keys in headers and keep private keys local. | For example, `search_docs` arguments `{"query":"RPC","extra":[{"privateKey":null}]}` return this object in `result.structuredContent` and matching JSON text: ```json { "error": "invalid_tool_arguments", "reason": "credential_field", "message": "API keys must never be passed in tool parameters. Configure API keys in the MCP client's x-api-key or Authorization HTTP header; keep private keys local." } ``` Clients that previously matched free-text input errors should read `structuredContent.error` and `structuredContent.reason` instead. If a keyed tool is called without an API-key header, follow its `how_to_get_api_key` hint or the [programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/?ref=docs-mcp-server). ### Executor request rejections After the input checks above and any required header authentication, the following tool-specific rejections return HTTP `200`, `Cache-Control: no-store` and `result.isError: true`. `result.structuredContent` is a required, non-null object with exactly `error`, `reason` and `message`. `error` is `executor_request_rejected`; `reason` is limited to the values for that tool below; `message` is the existing explanation for the rejected request. There is exactly one text content block containing JSON that decodes to the same object. | Tool | `reason` and rejection condition | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `search_docs` | `query_required`: query is missing or empty after trimming. | | `estimate_usage` | `method_required`: a selected estimate line has no non-empty trimmed method; `calls_per_day_invalid`: that line's daily calls are missing or not a finite, non-negative integer. These apply to single-method estimates and individual `lines` entries. | | `get_method_info` | `method_required`: method is missing or empty after trimming. | | `rpc_call` | `chain_required` or `method_required`: the respective value is missing or empty after trimming; `unknown_chain`: the existing chain-catalog lookup completes but finds no matching chain slug. | | `data_api_get` | `chain_invalid`: the trimmed chain is empty or contains characters outside `[A-Za-z0-9_-]`; `path_invalid`: path is missing or empty, starts with `/`, contains `..` or `//`, or contains `?`, `#` or `%`. | | `send_raw_transaction` | `chain_required` or `raw_tx_required`: the respective value is missing or empty after trimming; `unknown_chain`: the existing chain-catalog lookup completes but finds no matching chain slug. | For example, `get_method_info` with `{}` returns this object in `structuredContent` and equal JSON text: ```json { "error": "executor_request_rejected", "reason": "method_required", "message": "Missing or invalid 'method' parameter" } ``` These rejections are separate from `invalid_tool_arguments`; input-schema type, enum and credential checks keep their precedence. `data_api_get` still requires an API-key header before its tool-specific checks. Failed catalog retrieval, other path-character checks, estimate container errors and other existing errors keep their existing payloads. Each tool's published output schema retains its original success, error and truncated-result contract alongside the exact new rejection branch. An object marked `executor_request_rejected` must satisfy that tool's complete rejection schema; the original branch cannot accept a malformed object with this discriminator. ## Moving off Smithery proxy connections Smithery has announced that on 2026-10-31 it stops connection management and the `run.tools` / `server.smithery.ai` proxy connections; its public, non-proxy directory remains ([announcement](https://smithery.ai/future)). If your BlockVectra configuration still uses one of those proxy domains, switch it to `https://docs.blockvectra.com/mcp` and use the client configuration below. Connecting and reading documentation needs no API key; keyed tools keep their existing header authentication. To check the connection, call `read_doc` with `quickstart` and `lang` set to `en`. ## Install in your client You can connect to the BlockVectra documentation MCP server at `https://docs.blockvectra.com/mcp` across common development environments and frameworks. Start without an API key. Connect to the MCP endpoint, call list\_chains, then read quickstart with read\_doc. Add an API key in your client's HTTP headers when you need Data API or account tools. Keyless RPC access follows each chain's public method policy. The `x-api-key` header is optional. Without an API key, clients can use all read-only documentation tools (`read_doc`, `search_docs`, `list_docs`), chain discovery (`list_chains`), live status (`get_status`), pricing estimation (`get_pricing`, `estimate_usage`), error explanations (`explain_error`), and methods permitted on public endpoints. When using keyed tools (`rpc_call` on restricted methods, `data_api_get`, `get_account`, and `get_deposit_address`), configure the `x-api-key` header with your API key. ### Docs-only remote HTTP For documentation lookup, connect to `https://docs.blockvectra.com/mcp/docs`. This endpoint exposes only `search_docs` and `read_doc`; it needs no BlockVectra account, API key, or local Node.js installation. Adding an API key does not enable other tools. For Claude Code, run this one line: ```bash claude mcp add --transport http blockvectra-docs https://docs.blockvectra.com/mcp/docs ``` The command and the project `.mcp.json` below are alternatives; use one. This command does not replace or migrate an existing server of the same name, so if you already configured the full `/mcp` server, keep whichever one you want using your client's usual server management. To configure it in a project file instead, add this to `.mcp.json`: ```json { "mcpServers": { "blockvectra-docs": { "type": "http", "url": "https://docs.blockvectra.com/mcp/docs" } } } ``` In other clients, use their remote HTTP configuration format below with the same URL. For a first read, ask your agent to call `search_docs` with your task, then call `read_doc` with the `path` from a result and the same `lang`. To read the quickstart directly, call `read_doc` with `{"path":"quickstart","lang":"en"}`. Use the full `/mcp` endpoint for chain discovery, RPC, Data API, pricing, or account tools. ### Docs-only local stdio (Node.js 22+) If your client only needs to look things up in the documentation, you can run a docs-only local server. It exposes just two tools, `search_docs` and `read_doc`, reads public documentation over HTTP, and needs no BlockVectra account or API key. An inherited `BLOCKVECTRA_API_KEY` is not forwarded. RPC, Data API and account tools are not part of this mode. Install the [GitHub 0.1.1 package](https://github.com/blockvectra/mcp/releases/tag/v0.1.1) below; the npm `@blockvectra/mcp@0.1.0` package does not include this command. Downloading the package and its dependencies, and later documentation lookups, need a network connection. For a downloaded package, check its SHA-256 against the release's [SHA256SUMS](https://github.com/blockvectra/mcp/releases/download/v0.1.1/SHA256SUMS) before installing it locally. ```json { "mcpServers": { "blockvectra-docs": { "command": "npm", "args": [ "exec", "--yes", "--package", "https://github.com/blockvectra/mcp/releases/download/v0.1.1/blockvectra-mcp-0.1.1.tgz", "--", "blockvectra-docs-mcp" ] } } } ``` After the client restarts, check that it lists only `search_docs` and `read_doc`, then call `read_doc` with `path` set to `guides/robinhood-chain` and `lang` set to `en` to read the guide on Robinhood Chain. The restriction applies to this MCP connection only. To use chain discovery, RPC or keyed tools, pick the full bridge below instead; configure one of the two, not both, so you don't end up with duplicate servers. ### Local stdio (Node.js 22+) Connect to the hosted BlockVectra MCP service using the `@blockvectra/mcp` local stdio bridge (requires Node.js 22+ and an active network connection). Add the server to your client's MCP configuration: ```json { "mcpServers": { "blockvectra": { "command": "npx", "args": ["-y", "@blockvectra/mcp@0.1.0"] } } } ``` Initialization, documentation tools (`read_doc`, `search_docs`, `list_docs`), and supported public methods do not require an API key. When using keyed tools (such as Data API requests or account operations), set `BLOCKVECTRA_API_KEY` in the environment that launches the bridge process. If your client supports a per-server `env` field, you can use that field to inject the local secret value. The bridge only converts this environment variable to the `x-api-key` header and never places keys into CLI arguments, prompts, or tool arguments. Note that GUI clients might not automatically inherit shell environment variables. Calling keyed tools without an API key directs the agent to `how_to_get_api_key` and the [programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/?ref=docs-mcp-server). ### Claude Code Connect to the MCP server using the CLI: ```bash claude mcp add --transport http blockvectra-docs https://docs.blockvectra.com/mcp ``` To include an optional API key for authenticated tools, pass the `--header` (or `-H`) option and reference an environment variable instead of pasting the key. Use single quotes so your shell does not expand it; Claude Code expands `${BLOCKVECTRA_API_KEY}` when it starts the session: ```bash claude mcp add --transport http blockvectra-docs https://docs.blockvectra.com/mcp \ --header 'x-api-key: ${BLOCKVECTRA_API_KEY}' ``` The same configuration as a project-level `.mcp.json` (also what `claude mcp add --scope project` writes): ```json { "mcpServers": { "blockvectra-docs": { "type": "http", "url": "https://docs.blockvectra.com/mcp", "headers": { "x-api-key": "${BLOCKVECTRA_API_KEY}" } } } } ``` Export `BLOCKVECTRA_API_KEY` in the environment that starts `claude`. Claude Code asks you to approve a project-level `.mcp.json` server the first time you run `claude` in that directory; until then `claude mcp list` shows it as `Pending approval`. For scripts and CI, pass the file with `--mcp-config` and allow the server's tools. The key stays in the environment and the MCP client adds the header itself, so the agent does not need a shell command that expands `$BLOCKVECTRA_API_KEY` (Claude Code's permission check rejected such commands in non-interactive mode with `Contains simple_expansion`): ```bash claude -p "Use rpc_call to run eth_blockNumber on base_mainnet" \ --mcp-config ./.mcp.json --allowedTools "mcp__blockvectra-docs__*" ``` With the key set, the `rpc_call` result also contains `cu_charged` and `balance_units`; a keyless call returns only the JSON-RPC response. If the variable is not set, the client sends the literal header text and the server answers `invalid_api_key` (error code `-32024`) instead of falling back to the keyless endpoint. Official documentation: [Claude Code MCP documentation](https://code.claude.com/docs/en/mcp). ### Cursor Add the server to Cursor's MCP configuration: ```json { "mcpServers": { "blockvectra": { "url": "https://docs.blockvectra.com/mcp" } } } ``` Cursor also supports one-click installation via deep links using the base64-encoded configuration `eyJ1cmwiOiJodHRwczovL2RvY3MuYmxvY2t2ZWN0cmEuY29tL21jcCJ9` (representing `{"url":"https://docs.blockvectra.com/mcp"}`): ```text cursor://anysphere.cursor-deeplink/mcp/install?name=blockvectra&config=eyJ1cmwiOiJodHRwczovL2RvY3MuYmxvY2t2ZWN0cmEuY29tL21jcCJ9 ``` When you need authenticated tools (Data API or account management), add the `headers` object with your API key: ```json { "mcpServers": { "blockvectra": { "url": "https://docs.blockvectra.com/mcp", "headers": { "x-api-key": "${env:BLOCKVECTRA_API_KEY}" } } } } ``` The `${env:NAME}` form follows the Cursor documentation, which resolves variables in `url` and `headers`; this form has not been run against Cursor here. Put the file in `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global). Official documentation: [Cursor MCP documentation](https://cursor.com/docs/context/mcp) and [Cursor install links](https://cursor.com/docs/context/mcp/install-links). ### VS Code In VS Code, configure the server in `.vscode/mcp.json` under the top-level `servers` key with `type: "http"`: ```json { "servers": { "blockvectra": { "type": "http", "url": "https://docs.blockvectra.com/mcp" } } } ``` When you need authenticated tools, add the `headers` object: ```json { "servers": { "blockvectra": { "type": "http", "url": "https://docs.blockvectra.com/mcp", "headers": { "x-api-key": "YOUR_API_KEY" } } } } ``` When storing sensitive credentials, VS Code supports referencing input variables or environment files instead of hardcoding keys. You can also add servers using the Command Palette action `MCP: Add Server`. Official documentation: [VS Code MCP servers documentation](https://code.visualstudio.com/docs/copilot/customization/mcp-servers) and [VS Code MCP configuration reference](https://code.visualstudio.com/docs/agents/reference/mcp-configuration). ### Codex Add the server using the OpenAI Codex CLI: ```bash codex mcp add blockvectra --url https://docs.blockvectra.com/mcp ``` In `config.toml`, configure the server URL: ```toml [mcp_servers.blockvectra] url = "https://docs.blockvectra.com/mcp" ``` When you need authenticated tools, configure request headers in `config.toml`: ```toml [mcp_servers.blockvectra] url = "https://docs.blockvectra.com/mcp" http_headers = { "x-api-key" = "YOUR_API_KEY" } ``` Alternatively, map the header from an environment variable: ```toml [mcp_servers.blockvectra] url = "https://docs.blockvectra.com/mcp" env_http_headers = { "x-api-key" = "BLOCKVECTRA_API_KEY" } ``` Official documentation: [OpenAI Codex CLI MCP documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=cli). ### Gemini CLI Connect with the Gemini CLI extension: ```bash gemini extensions install https://github.com/blockvectra/mcp --ref main ``` Restart Gemini CLI, then run `/mcp` to confirm the `blockvectra-docs` server and its tools are loaded. Discovery works without an API key: ask for `list_chains`, or `read_doc` with `path=quickstart` and `lang=en`. For keyed tools, see [optional authentication](https://github.com/blockvectra/mcp#optional-authentication). The extension and the manual configuration below are alternatives. Use one, not both, so you don't register duplicate servers. In the Gemini CLI configuration, add the server under `mcpServers` using `httpUrl` for Streamable HTTP: ```json { "mcpServers": { "blockvectra": { "httpUrl": "https://docs.blockvectra.com/mcp" } } } ``` When you need authenticated tools, add the `headers` object with your API key: ```json { "mcpServers": { "blockvectra": { "httpUrl": "https://docs.blockvectra.com/mcp", "headers": { "x-api-key": "YOUR_API_KEY" } } } } ``` Official documentation: [Gemini CLI MCP server documentation](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md). ### Antigravity Install the BlockVectra documentation plugin in Antigravity: ```bash agy plugin install https://github.com/blockvectra/mcp ``` The plugin connects directly to `https://docs.blockvectra.com/mcp` over remote HTTP; there is no local npm bridge to run. Restart Antigravity, then use `/plugin` in a signed-in session to check that it is enabled and `/mcp` to see its tools. To verify the connection, ask Antigravity to call `list_chains`, then `read_doc` with `path=quickstart` and `lang=en`. Connecting, documentation, chain discovery, pricing and status tools need no API key. RPC calls follow each chain's public method policy. Data API and account tools need your own key, configured only in private HTTP headers; keep it out of command arguments, tool arguments and chat. See the [BlockVectra MCP repository](https://github.com/blockvectra/mcp#readme) for plugin and authentication details, and the official Antigravity [plugins](https://www.antigravity.google/docs/plugins?tab=cli) and [MCP](https://www.antigravity.google/docs/mcp/) documentation. ### goose goose can run MCP servers and packaged recipes. After installing goose and configuring a model provider, fetch the pinned recipe, validate it, and run it: ```bash curl -fLo blockvectra-docs.json https://raw.githubusercontent.com/blockvectra/mcp/0a7c9173478157523c2a6629ad9fe71e8b29e6c0/recipes/goose-docs.json goose recipe validate ./blockvectra-docs.json goose run --recipe ./blockvectra-docs.json ``` The recipe connects to `https://docs.blockvectra.com/mcp` over Streamable HTTP and uses only `search_docs` and `read_doc`. Its fixed task searches for the public RPC setup on Robinhood Chain mainnet, then reads `guides/robinhood-chain` with `lang=en`. The result should describe the mainnet configuration and keep the testnet faucet separate. The recipe queries documentation only; it does not execute RPC calls, send transactions or create accounts. Connecting and these two documentation tools need no BlockVectra account or API key. Model calls go through the provider you configured for goose and are billed under that provider's rules. If the run fails, check the goose and provider configuration and the `goose recipe validate` output first. Pinned recipe source: [recipes/goose-docs.json](https://github.com/blockvectra/mcp/blob/0a7c9173478157523c2a6629ad9fe71e8b29e6c0/recipes/goose-docs.json). Official documentation: [goose recipes](https://goose-docs.ai/docs/guides/recipes/). ### Hermes Agent Hermes Agent connects to remote HTTP MCP servers natively. Add BlockVectra under `mcp_servers` in `~/.hermes/config.yaml`, merging it into the existing mapping so other servers stay configured: ```yaml mcp_servers: blockvectra: url: https://docs.blockvectra.com/mcp ``` Save the file and start a new Hermes session so the server loads. Connecting and the documentation tools need no API key; for keyed tools, pass `x-api-key` in the request headers following this page's HTTP header authentication rules. For a known chain, pass `chain` to `list_chains`, such as `robinhood_mainnet`, rather than enumerating every chain. For a specific task, call `search_docs` and then read the matching page. Official documentation: [Hermes Agent MCP documentation](https://hermes-agent.nousresearch.com/docs/user-guide/features/mcp). ### OpenAI Responses API When calling the OpenAI Responses API, pass the MCP server in the `tools` array with `type: "mcp"`: ```bash OPENAI_API_BASE="https://api.openai.com/v1" curl "$OPENAI_API_BASE/responses" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "", "tools": [{ "type": "mcp", "server_label": "blockvectra", "server_url": "https://docs.blockvectra.com/mcp", "require_approval": "never" }], "input": "..." }' ``` When you need authenticated tools, include the `headers` field in the tool definition: ```json { "type": "mcp", "server_label": "blockvectra", "server_url": "https://docs.blockvectra.com/mcp", "headers": { "x-api-key": "YOUR_API_KEY" }, "require_approval": "never" } ``` Official documentation: [OpenAI MCP tools guide](https://developers.openai.com/api/docs/guides/tools-connectors-mcp) and [OpenAI Responses API reference](https://developers.openai.com/api/reference/resources/responses/methods/create). ### Windsurf In Windsurf, configure the server under `mcpServers` using the `serverUrl` field: ```json { "mcpServers": { "blockvectra": { "serverUrl": "https://docs.blockvectra.com/mcp" } } } ``` When you need authenticated tools, add the `headers` object with your API key: ```json { "mcpServers": { "blockvectra": { "serverUrl": "https://docs.blockvectra.com/mcp", "headers": { "x-api-key": "YOUR_API_KEY" } } } } ``` Windsurf also supports referencing environment variables, such as `"x-api-key": "${env:BLOCKVECTRA_API_KEY}"`. Official documentation: [Windsurf MCP documentation](https://docs.devin.ai/desktop/cascade/mcp). ### Claude Desktop and claude.ai Custom connectors are configured through the user interface: * **claude.ai**: Navigate to **Customize** > **Connectors**, click **+ Add**, select **Add custom connector**, and enter the URL: ```text https://docs.blockvectra.com/mcp ``` * **Claude Desktop**: Open the account settings menu and configure custom connectors through the connectors interface. Connecting to the URL allows Claude to search guides, read Markdown documentation, inspect supported chains, check network status, and calculate pricing estimates without credentials. Official documentation: [Claude custom connectors guide](https://support.claude.com/en/articles/11175166-getting-started-with-custom-connectors-using-remote-mcp). ### Check the connection and troubleshoot In Claude Code, `claude mcp list` shows each server's status. For a count of the tools that were actually registered, run once with the stream output and read the `init` event, or read the debug log: ```bash claude -p "say ok" --mcp-config ./.mcp.json --output-format stream-json --verbose claude -p "say ok" --mcp-config ./.mcp.json --debug mcp --debug-file mcp-debug.log ``` A working connection shows `"status": "connected"` and `mcp__blockvectra-docs__*` tools (such as `list_chains` and `rpc_call`) in the `init` event. In the debug log, look for lines about `blockvectra-docs` such as `Successfully connected` and `Failed to fetch tools`. If the server is `connected` but no tools appear, read the reason the debug log (`--debug mcp`) reports after `Failed to fetch tools`. To check that the server itself is healthy, use the curl calls below. ### Call the MCP endpoint without a client The endpoint is JSON-RPC 2.0 over HTTP POST, so any HTTP client can call it: ```bash curl -s https://docs.blockvectra.com/mcp -H 'content-type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' curl -s https://docs.blockvectra.com/mcp -H 'content-type: application/json' \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"rpc_call","arguments":{"chain":"base_mainnet","method":"eth_blockNumber","params":[]}}}' ``` The first call returns the tool list; the second returns the JSON-RPC response in `result.structuredContent`. Chain identifiers are slugs such as `base_mainnet`; get them from `list_chains`. Keyed tools need the `x-api-key` header; this call reads your account with the key from an environment variable: ```bash curl -s https://docs.blockvectra.com/mcp -H 'content-type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_account","arguments":{}}}' ``` It returns `key_id`, `plan`, `balance_units`, `balance_cu` and the key's rate limits in `result.structuredContent`. If your agent runs commands through a permission-gated shell, that variable expansion may be blocked; configure the header in the MCP client instead. ### Find and read a guide without an API key This example runs two `tools/call` requests in sequence: `search_docs` finds a guide, then `read_doc` reads it. Neither call sends `x-api-key`. It needs Python 3 and nothing else (standard library only). Save it as `read_guide.py` and run `python3 read_guide.py`. ```python import json import os import sys import urllib.request URL = "https://docs.blockvectra.com/mcp" LANG = "en" USER_AGENT = "BlockVectraDocsExample/1" if os.environ.get("BLOCKVECTRA_INTERNAL_QA") == "1": USER_AGENT += " BlockVectraQA/1" def call(request_id, name, arguments): body = json.dumps({ "jsonrpc": "2.0", "id": request_id, "method": "tools/call", "params": {"name": name, "arguments": arguments}, }).encode() req = urllib.request.Request(URL, data=body, headers={ "content-type": "application/json", "user-agent": USER_AGENT, }) try: with urllib.request.urlopen(req, timeout=20) as res: reply = json.load(res) except Exception as exc: sys.exit(f"{name}: request failed ({type(exc).__name__})") if "error" in reply: sys.exit(f"{name}: JSON-RPC error {reply['error'].get('code')}") result = reply.get("result") or {} if result.get("isError"): sys.exit(f"{name}: tool error") return result found = call(1, "search_docs", {"query": "faucet on Robinhood Chain", "lang": LANG, "limit": 1}) results = (found.get("structuredContent") or {}).get("results") or [] if not results or not isinstance(results[0].get("path"), str) or not results[0]["path"]: sys.exit("No match: try other words, or browse with list_docs.") path = results[0]["path"] print("Reading:", path, file=sys.stderr) doc = call(2, "read_doc", {"path": path, "lang": LANG}) print(doc["content"][0]["text"]) ``` The script passes the `path` from the first search result to `read_doc` unchanged, and reuses the same `lang`. `path` is relative, such as `guides/example`: do not add a domain, a leading `/` or a query string. The guide text comes back as Markdown in `result.content[0].text`; `read_doc` returns no `structuredContent`. The script exits without a second request when the HTTP call or JSON-RPC request fails, when a tool returns `isError: true`, or when `results` is empty (an empty result is not an error, but there is nothing to read; change the query or browse with `list_docs`). It does not retry. It only reads the guide: it does not run any command the guide contains. ## FAQ ### Does the BlockVectra MCP server need an API key? No. Connecting needs no key, and 10 of the 15 tools never need one. `rpc_call` and `send_raw_transaction` run without a key only for methods in the chain's `public.methods` (read it with `list_chains`). `data_api_get`, `get_account` and `get_deposit_address` need the `x-api-key` header. ### Can the MCP server create or revoke API keys? No. No tool creates, lists or revokes API keys. `how_to_get_api_key` only returns the steps; an agent creates a key over HTTP by following [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/?ref=docs-mcp-server), and people create one in the console. Keys never go through tool arguments. ### Can an agent send transactions through the MCP server? It can broadcast, not sign. `rpc_call` rejects write methods such as `eth_sendRawTransaction`, `eth_sendTransaction`, `eth_sign` and `personal_*`. `send_raw_transaction` broadcasts a transaction you already signed locally with `eth_sendRawTransaction`; the server never holds or sees a private key. ### What happens when a call fails? Check `result.isError` before using a tool result, and read the returned error message. Use `explain_error` or the [error codes reference](https://docs.blockvectra.com/en/errors/) to see whether a failure is billed and whether to retry. ## Related * [Connect AI agents](https://docs.blockvectra.com/en/guides/ai-agents/): machine-readable files, public JSON endpoints and the chain selection workflow. * [Programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/?ref=docs-mcp-server): create an API key with a wallet signature, without a browser. * [Agent framework recipes](https://docs.blockvectra.com/en/guides/agent-frameworks/): ElizaOS, viem, wagmi and Coinbase AgentKit. * [Error codes](https://docs.blockvectra.com/en/errors/): every error with billing and retry rules. --- # One key, many chains: switching an example to another chain Source: https://docs.blockvectra.com/en/guides/one-key-many-chains/ ## 1. One key across all supported chains The same API key works on all supported chains for JSON-RPC, and for the Data API on chains where it is available. Keys belong to your account and are not bound to a specific chain; there is no need to generate separate API keys for each network. Credits and rate limits are shared across all networks and across the JSON-RPC API and the Data API; they are not split by network. For detailed billing rules, see the [Pricing page](https://blockvectra.com/en/pricing/). * **Pooled balance**: Paid top-ups and free credits apply across all chains. Calls on any chain draw from the same account balance. * **Pooled rate limits**: Compute Unit (CU) refill rates and burst capacities apply across all chains for a given key. Free Plan per-second call limits are pooled across all supported chains rather than split per chain. * **Upgrade path**: After topping up, you are no longer constrained by the Free Plan's per-second call limit; each key remains subject to CU rate and burst limits, as described in the [JSON-RPC documentation](https://docs.blockvectra.com/en/api/json-rpc/#method-policy). ## 2. URL structure and the `{chain}` parameter Every chain-scoped request specifies its target network in the URL path using `{chain}`. The `{chain}` parameter is the lowercase slug identifier of the chain (for example `robinhood_mainnet`). | Service | Authentication | URL template | Description | | ----------------- | --------------------- | ---------------------------- | --------------------------------------------------- | | JSON-RPC | Key in URL path | `POST /v1/{chain}/{api_key}` | Simplest form, suitable for curl and HTTP clients | | JSON-RPC | Key in request header | `POST /v1/{chain}` | Pass key via `x-api-key: {api_key}` request header | | Data API | REST routes | `GET /v1/data/{chain}/…` | Pass key via `x-api-key: {api_key}` request header | | Public chain list | Unauthenticated | `GET /v1/chains` | Public list of chains and static facts (not billed) | | Public status | Unauthenticated | `GET /v1/status` | Current service status and chain heads (not billed) | `GET /v1/chains` reports a `jsonrpc` and a `data` flag for each chain. Address a chain with the JSON-RPC URLs when it serves JSON-RPC, and with `GET /v1/data/{chain}/…` when its `data` flag is `true` (the Data API serves only those chains). > **Tip**: When passing your key via request headers, format the URL to end with the chain name, **without** a trailing slash. JSON-RPC is served exclusively at `/v1/{chain}` and `/v1/{chain}/{api_key}`. Requests with a trailing slash (such as `/v1/{chain}/`) or missing a chain segment return HTTP 404 with an empty body. Requests to an unknown `{chain}` return HTTP 404 with `error.data.reason: "unknown_chain"` (not billed). ## 3. Programmatic chain discovery and capabilities Supported chains and their capabilities are served dynamically. Do not hardcode a static list of chains in your application. Instead, discover available networks and their capabilities at runtime: ### Discover static facts via `GET /v1/chains` This public endpoint is unauthenticated and not billed, returning all publicly available chains: ```http GET /v1/chains ``` Example response: ```json { "chains": [ { "chain": "robinhood_mainnet", "name": "Robinhood Chain", "chain_id": 4663, "jsonrpc": true, "data": true, "methods": { "allow": ["eth_blockNumber", "eth_call", "eth_chainId", "debug_traceTransaction"], "deny": ["eth_newFilter", "eth_newBlockFilter", "eth_newPendingTransactionFilter", "eth_getFilterLogs", "eth_getFilterChanges", "eth_uninstallFilter", "eth_subscribe", "eth_unsubscribe"] }, "max_logs_block_range": 1000, "state_window_blocks": 900 } ] } ``` Field reference: * `chain`: Chain identifier slug (used for `{chain}` in URLs) * `name`: Human-readable display name * `chain_id`: EIP-155 chain ID (decimal integer) * `jsonrpc`: Whether JSON-RPC is enabled * `data`: Whether the Data API is enabled * `methods`: JSON-RPC method policy for the chain, including `allow` (allowed methods) and `deny` (explicitly denied methods) * `max_logs_block_range`: Maximum block range allowed in a single `eth_getLogs` request * `state_window_blocks`: Historical state window size in blocks; `null` when unconstrained ### Check operational health via `GET /v1/status` This public endpoint is unauthenticated and not billed, returning service readiness and chain head information: ```http GET /v1/status ``` Example response: ```json { "checked_at": "2026-09-28T12:00:00Z", "gateway": { "status": "ok" }, "chains": [ { "chain": "robinhood_mainnet", "name": "Robinhood Chain", "chain_id": 4663, "jsonrpc": true, "data": true, "data_features": ["blocks", "transactions", "address_transactions", "transfers", "token_metadata", "freshness"], "status": "ok", "head": { "block": 73017329, "time": "2026-09-28T11:59:58Z", "lag_seconds": 2 } } ] } ``` Field reference: * `gateway.status`: Service status (`ok` or `degraded`) * `chains[].data_features`: Capabilities provided by the Data API for this chain * `chains[].status`: Node operational status (`ok` or `unavailable`) * `chains[].head`: Latest block head (`block`, `time`, `lag_seconds`) ## 4. Per-chain differences to keep in mind When switching between chains, review the fields provided in `GET /v1/chains`: 1. **Method allowance and policy (`methods.allow` / `methods.deny`)**: Available JSON-RPC methods vary by network according to their method policy. Requesting a disallowed method returns HTTP 200 with JSON-RPC error code `-32601` (`method not available`, not billed). 2. **Log block range (`max_logs_block_range`)**: Maximum block spans for `eth_getLogs` queries differ by chain. Exceeding the chain's limit returns HTTP 200 with JSON-RPC error code `-32602` (`eth_getLogs block range too large`, not billed). 3. **State retention window (`state_window_blocks`)**: Full-history chains return `null`. On chains with state pruning, historical state queries outside the window return HTTP 200 with JSON-RPC error code `-32011` (`historical state is not available beyond the most recent blocks`, not billed). 4. **Data API features and coverage (`data` / `data_features`)**: The chains that provide a dataset are listed on the [Supported Chains](https://docs.blockvectra.com/en/chains/) page. Querying a dataset a chain does not support, or a block before its indexed coverage, returns HTTP `422` (`error.code` `no_coverage`, not billed). When the service is temporarily unavailable — for example, when a chain is busy — requests return HTTP `503` with a `Retry-After` header (not billed). ## 5. Code examples Complete starter template: [blockvectra/multichain-viem](https://github.com/blockvectra/multichain-viem) The exact same code runs across different chains by updating the chain variable (or reading it from `GET /v1/chains`), querying `eth_blockNumber` via JSON-RPC and dataset freshness via the Data API: **cURL** ```bash export BLOCKVECTRA_API_KEY="rgw_your_api_key" # Change the chain variable to target another chain from Supported Chains CHAIN="robinhood_mainnet" # 1. JSON-RPC: Query eth_blockNumber (POST /v1/{chain}, key in the x-api-key header). RPC_URL="https://api.blockvectra.com/v1/$CHAIN" curl -s "$RPC_URL" \ -H "Content-Type: application/json" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' # 2. Data API: Query dataset freshness (GET /v1/data/{chain}/status/freshness) curl -s "https://api.blockvectra.com/v1/data/$CHAIN/status/freshness" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts // Change this variable to target another chain, or read it dynamically from GET /v1/chains const chain = "robinhood_mainnet"; const apiKey = process.env.BLOCKVECTRA_API_KEY!; // 1. JSON-RPC: Call eth_blockNumber (POST /v1/{chain}) const rpcUrl = `https://api.blockvectra.com/v1/${chain}`; const rpcResponse = await fetch(rpcUrl, { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": apiKey, }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_blockNumber", params: [], }), }); const rpcResult = await rpcResponse.json(); console.log(`[${chain}] JSON-RPC blockNumber:`, rpcResult.result); // 2. Data API: Query freshness (GET /v1/data/{chain}/status/freshness) const dataUrl = `https://api.blockvectra.com/v1/data/${chain}/status/freshness`; const dataResponse = await fetch(dataUrl, { headers: { "x-api-key": apiKey, }, }); const dataResult = await dataResponse.json(); console.log(`[${chain}] Data API freshness:`, dataResult.data); ``` **Python** ```python import os import requests # Change this variable to target another chain, or read it dynamically from GET /v1/chains chain = "robinhood_mainnet" api_key = os.environ["BLOCKVECTRA_API_KEY"] # 1. JSON-RPC: Call eth_blockNumber (POST /v1/{chain}) rpc_url = f"https://api.blockvectra.com/v1/{chain}" headers = { "Content-Type": "application/json", "x-api-key": api_key, } rpc_payload = { "jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": [], } rpc_resp = requests.post(rpc_url, json=rpc_payload, headers=headers) print(f"[{chain}] JSON-RPC blockNumber:", rpc_resp.json().get("result")) # 2. Data API: Query freshness (GET /v1/data/{chain}/status/freshness) data_url = f"https://api.blockvectra.com/v1/data/{chain}/status/freshness" data_resp = requests.get(data_url, headers={"x-api-key": api_key}) print(f"[{chain}] Data API freshness:", data_resp.json().get("data")) ``` ### Example responses JSON-RPC `eth_blockNumber` successful response (billed at the method's CU weight): ```json { "jsonrpc": "2.0", "id": 1, "result": "0x45a27f1" } ``` Data API `GET /v1/data/{chain}/status/freshness` successful response (billed in CU, only 2xx successful responses are billed): ```json { "data": [ { "dataset": "blocks", "category": "raw", "max_block_number": 72313256, "max_day": null, "max_time": "2026-09-28T03:41:07Z", "seconds_behind": 0, "blocks_behind": null, "days_behind": null, "checked_at": "2026-09-28T03:41:10Z" }, { "dataset": "traces", "category": "raw", "max_block_number": 72313256, "max_day": null, "max_time": "2026-09-28T03:41:07Z", "seconds_behind": 0, "blocks_behind": null, "days_behind": null, "coverage_from_block": 72050949, "coverage_to_block": 72313256, "coverage_complete": true, "checked_at": "2026-09-28T03:41:10Z" }, { "dataset": "dex_prices", "category": "derived", "max_block_number": null, "max_day": "2026-09-27", "max_time": "2026-09-27T00:00:00Z", "seconds_behind": 99667, "blocks_behind": null, "days_behind": 1, "checked_at": "2026-09-28T03:41:10Z" } ], "meta": { "chain": "robinhood_mainnet", "chain_slug": "ROBINHOOD_MAINNET", "chain_external_id": "eip155:4663", "as_of_block": 72313256, "safe_block": 72313100, "finalized_block": 72313000, "coverage": "full", "refreshed_at": "2026-09-28T03:41:10Z" } } ``` ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # Get a blockchain API key with a wallet signature (SIWE) Source: https://docs.blockvectra.com/en/guides/programmatic-signup/ A wallet signature is enough to get a BlockVectra API key and 30,000,000 free CU; no payment is needed first. Developers and AI agents complete 4 steps without a browser: 3 HTTP requests to BlockVectra and a local wallet signature. Request a SIWE challenge, sign it locally with your Ethereum wallet, log in, then `POST /keys`. The first login creates the account. Start with the first call (Checked 2026-10-21): ```bash BASE=https://console-api.blockvectra.com/v1 curl -s "$BASE/auth/siwe/challenge" -H 'Content-Type: application/json' \ -d "{\"address\":\"$ADDR\",\"purpose\":\"login\"}" ``` The same flow serves autonomous AI agents, CI pipelines, and scripts running without a browser. It uses an EIP-4361 / SIWE message signed with `personal_sign` (EIP-191). > **Key security** > > Never paste private keys, session tokens, or API keys into conversations with AI or pass them as MCP tool arguments. Before signing up, you can try the keyless public endpoint `https://api.blockvectra.com/v1/robinhood_mainnet/public` first (on Robinhood Chain this endpoint allows wallet JSON-RPC methods only; the allowed methods differ per chain, so check `public.methods` in `list_chains` or `GET /v1/chains`; the Data API requires a key); sign up for an account if the quota is not enough. ## Workflow overview The programmatic registration and key provisioning flow consists of four steps: 1. **Request challenge**: Send a request to `POST /auth/siwe/challenge` to obtain a server-generated sign-in message. 2. **Sign message**: Sign the exact EIP-4361 message with an Ethereum EOA wallet using `personal_sign` (EIP-191). 3. **Log in / open account**: Submit the verbatim message and signature to `POST /auth/siwe/login`. On the first sign-in for a wallet, an account is created automatically (`account_created: true`). New accounts get 30,000,000 CU on sign-up — no credit card. 4. **Create API key**: Use the session token to call `POST /keys` and create an API key. ## Shortest curl sequence 3 HTTP requests to BlockVectra plus local wallet signing (4 steps), followed by a separate authenticated HTTP request to verify the key with `eth_blockNumber`. `ADDR` is the wallet address (0x...) and `PK` its private key, loaded from a secrets manager; this needs curl, jq, and Foundry `cast`. A new key takes a few seconds to become active, so retry a `401 invalid_api_key` after a short wait (the full examples below retry automatically). ```bash BASE=https://console-api.blockvectra.com/v1 # 1. Challenge: the server returns the exact message to sign MSG=$(curl -s "$BASE/auth/siwe/challenge" -H 'Content-Type: application/json' \ -d "{\"address\":\"$ADDR\",\"purpose\":\"login\"}" | jq -r .message) # 2. Sign it with EIP-191 personal_sign SIG=$(cast wallet sign --private-key "$PK" "$MSG") # 3. Login: the first sign-in for a wallet creates the account TOKEN=$(jq -n --arg m "$MSG" --arg s "$SIG" '{message: $m, signature: $s}' | curl -s "$BASE/auth/siwe/login" -H 'Content-Type: application/json' -d @- | jq -r .session.token) # 4. Create the API key (the secret is returned only once) KEY=$(curl -s "$BASE/keys" -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \ -d '{"label":"agent-key"}' | jq -r .api_key) # 5. Call JSON-RPC with the key in the x-api-key header RESP=$(curl -s "https://api.blockvectra.com/v1/robinhood_mainnet" -H "x-api-key: $KEY" -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' \ -w '\n%{http_code}') && printf '%s' "${RESP%$'\n'*}" | jq -es --arg status "${RESP##*$'\n'}" ' if length == 1 and (.[0] | type) == "object" and ($status | test("^2[0-9][0-9]\\z")) and (.[0] | .jsonrpc == "2.0" and (.id | type) == "number" and .id == 1 and has("error") == false and (.result | type) == "string" and (.result | test("^0x(0|[1-9a-fA-F][0-9a-fA-F]*)\\z"))) then .[0] else empty end' ``` ## Complete runnable examples Start here: use a local Ethereum EOA signer, create a key, and verify it with eth\_blockNumber. For the Bash example, you need curl, jq, and Foundry cast. Keep wallet credentials in your local signing environment. Complete starter template: [blockvectra/agent-quickstart](https://github.com/blockvectra/agent-quickstart) The following scripts read the wallet credentials, complete the challenge and login sequence, provision an API key, export or print `export BLOCKVECTRA_API_KEY=...` for environment configuration, and send a verification `eth_blockNumber` request: New keys take a few seconds to become active; these examples retry automatically. **Bash** ```bash BASE=https://console-api.blockvectra.com/v1 # $ADDR: Ethereum wallet address (0x...) # $PK: wallet private key, loaded from a secrets manager (never hardcode in scripts) # 1. Fetch server-generated SIWE message (omit Origin header) curl -s "$BASE/auth/siwe/challenge" -H 'Content-Type: application/json' \ -d "{\"address\":\"$ADDR\",\"purpose\":\"login\"}" > challenge.json jq -r .message challenge.json > msg.txt # 2. Sign the exact message with EIP-191 personal_sign SIG=$(cast wallet sign --private-key "$PK" "$(cat msg.txt)") # 3. Submit verbatim message and signature (omit Origin header) to log in (ref is optional) jq -n --rawfile m msg.txt --arg s "$SIG" '{message: ($m | rtrimstr("\n")), signature: $s, ref: "docs-signup"}' | curl -s "$BASE/auth/siwe/login" -H 'Content-Type: application/json' -d @- > session.json TOKEN=$(jq -r .session.token session.json) # 4. Create an API key (the secret is returned only once) KEY_RESP=$(curl -s "$BASE/keys" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ -d '{"label":"agent-key"}') export BLOCKVECTRA_API_KEY=$(echo "$KEY_RESP" | jq -r .api_key) # 5. Call JSON-RPC with the key in the x-api-key request header RPC_DEADLINE=$((SECONDS + 10)) while true; do RPC_TIMEOUT=$((RPC_DEADLINE - SECONDS)) if ((RPC_TIMEOUT <= 0)); then printf '%s' "${RPC_BODY:-}" echo "RPC verification failed: retry budget exhausted" >&2 exit 1 fi RPC_RESP=$(curl -s --max-time "$RPC_TIMEOUT" -w '\n%{http_code}' "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}') || { rc=$?; echo "request failed (curl exit $rc)" >&2; exit $rc; } RPC_STATUS=${RPC_RESP##*$'\n'} RPC_BODY=${RPC_RESP%$'\n'*} if ((SECONDS + 2 < RPC_DEADLINE)) && printf '%s' "$RPC_BODY" | jq -es --arg status "$RPC_STATUS" ' length == 1 and (.[0] | type) == "object" and ( ($status == "401" and .[0].error.data.reason == "invalid_api_key") or ($status == "503" and .[0].error.code == -32021)) ' >/dev/null 2>&1; then sleep 2 continue fi printf '%s' "$RPC_BODY" printf '%s' "$RPC_BODY" | jq -es --arg status "$RPC_STATUS" ' length == 1 and (.[0] | type) == "object" and ($status | test("^2[0-9][0-9]\\z")) and (.[0] | .jsonrpc == "2.0" and (.id | type) == "number" and .id == 1 and has("error") == false and (.result | type) == "string" and (.result | test("^0x(0|[1-9a-fA-F][0-9a-fA-F]*)\\z"))) ' >/dev/null 2>&1 || { echo "RPC verification failed (HTTP $RPC_STATUS)" >&2; exit 1; } break done ``` **TypeScript** ```bash npm i viem ``` ```ts // Node.js 22.18+: save as signup.mts, then run: node signup.mts import { privateKeyToAccount } from "viem/accounts"; const BASE = "https://console-api.blockvectra.com/v1"; const privateKey = process.env.PRIVATE_KEY as `0x${string}`; const account = privateKeyToAccount(privateKey); // 1. Fetch server-generated SIWE message (omit Origin header) const challengeRes = await fetch(`${BASE}/auth/siwe/challenge`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ address: account.address, purpose: "login" }), }); if (!challengeRes.ok) throw new Error(`Challenge failed: ${challengeRes.status}`); const { message } = (await challengeRes.json()) as { message: string }; // 2. Sign the exact message with EIP-191 personal_sign const signature = await account.signMessage({ message }); // 3. Submit verbatim message and signature (omit Origin header) to log in (ref is optional) const loginRes = await fetch(`${BASE}/auth/siwe/login`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ message, signature, ref: "docs-signup" }), }); if (!loginRes.ok) throw new Error(`Login failed: ${loginRes.status}`); const { session } = (await loginRes.json()) as { session: { token: string } }; // 4. Create an API key (the secret is returned only once) const keyRes = await fetch(`${BASE}/keys`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${session.token}`, }, body: JSON.stringify({ label: "agent-key" }), }); if (!keyRes.ok) throw new Error(`Create key failed: ${keyRes.status}`); const { api_key } = (await keyRes.json()) as { api_key: string }; console.log("Created API key:", api_key); console.log(`export BLOCKVECTRA_API_KEY=${api_key}`); // 5. Call JSON-RPC with the key in the x-api-key request header const rpcDeadline = performance.now() + 10_000; const isObject = (value: unknown): value is Record => typeof value === "object" && value !== null && !Array.isArray(value); while (true) { const rpcRes = await fetch("https://api.blockvectra.com/v1/robinhood_mainnet", { method: "POST", signal: AbortSignal.timeout(Math.max(1, Math.ceil(rpcDeadline - performance.now()))), headers: { "Content-Type": "application/json", "x-api-key": api_key, }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_blockNumber", params: [], }), }); const rpcBody: unknown = await rpcRes.json(); const rpcError = isObject(rpcBody) ? rpcBody.error : undefined; const retryable = (rpcRes.status === 401 && rpcError?.data?.reason === "invalid_api_key") || (rpcRes.status === 503 && rpcError?.code === -32021); if (retryable && performance.now() + 2_000 < rpcDeadline) { await new Promise((resolve) => setTimeout(resolve, 2_000)); continue; } const valid = rpcRes.ok && isObject(rpcBody) && rpcBody.jsonrpc === "2.0" && rpcBody.id === 1 && !("error" in rpcBody) && typeof rpcBody.result === "string" && /^0x(0|[1-9a-fA-F][0-9a-fA-F]*)$/.test(rpcBody.result); if (!valid) throw new Error(`RPC call failed: ${rpcRes.status} ${JSON.stringify(rpcBody)}`); console.log("Block number response:", rpcBody); break; } ``` **Python** ```bash pip install eth-account requests ``` ```python import os import re import time import requests from eth_account import Account from eth_account.messages import encode_defunct BASE = "https://console-api.blockvectra.com/v1" private_key = os.environ["PRIVATE_KEY"] account = Account.from_key(private_key) address = account.address # 1. Fetch server-generated SIWE message (omit Origin header) challenge_resp = requests.post( f"{BASE}/auth/siwe/challenge", json={"address": address, "purpose": "login"}, ) challenge_resp.raise_for_status() message = challenge_resp.json()["message"] # 2. Sign the exact message with EIP-191 personal_sign signable = encode_defunct(text=message) signed = Account.sign_message(signable, private_key=private_key) signature = "0x" + bytes(signed.signature).hex() # 3. Submit verbatim message and signature (omit Origin header) to log in (ref is optional) login_resp = requests.post( f"{BASE}/auth/siwe/login", json={"message": message, "signature": signature, "ref": "docs-signup"}, ) login_resp.raise_for_status() token = login_resp.json()["session"]["token"] # 4. Create an API key (the secret is returned only once) key_resp = requests.post( f"{BASE}/keys", headers={"Authorization": f"Bearer {token}"}, json={"label": "agent-key"}, ) key_resp.raise_for_status() api_key = key_resp.json()["api_key"] print("Created API key:", api_key) print(f"export BLOCKVECTRA_API_KEY={api_key}") # 5. Call JSON-RPC with the key in the x-api-key request header rpc_deadline = time.monotonic() + 10 while True: rpc_resp = requests.post( "https://api.blockvectra.com/v1/robinhood_mainnet", headers={"x-api-key": api_key, "Content-Type": "application/json"}, json={"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}, timeout=max(0.001, rpc_deadline - time.monotonic()), ) rpc_data = rpc_resp.json() rpc_error = rpc_data.get("error") if isinstance(rpc_data, dict) else None rpc_error = rpc_error if isinstance(rpc_error, dict) else {} error_data = rpc_error.get("data") reason = error_data.get("reason") if isinstance(error_data, dict) else None retryable = ( rpc_resp.status_code == 401 and reason == "invalid_api_key" ) or (rpc_resp.status_code == 503 and rpc_error.get("code") == -32021) if retryable and time.monotonic() + 2 < rpc_deadline: time.sleep(2) continue valid = ( 200 <= rpc_resp.status_code < 300 and isinstance(rpc_data, dict) and rpc_data.get("jsonrpc") == "2.0" and isinstance(rpc_data.get("id"), (int, float)) and not isinstance(rpc_data["id"], bool) and rpc_data["id"] == 1 and "error" not in rpc_data and isinstance(rpc_data.get("result"), str) and re.fullmatch(r"0x(0|[1-9a-fA-F][0-9a-fA-F]*)", rpc_data["result"]) is not None ) if not valid: raise SystemExit(f"RPC verification failed: HTTP {rpc_resp.status_code} {rpc_data!r}") print("Block number response:", rpc_data) break ``` ## Base URL and programmatic mode All authentication and key management endpoints use the official base URL: ``` https://console-api.blockvectra.com/v1 ``` ### Omitting the Origin header Programmatic requests operate in **programmatic mode**: * Both the challenge (`POST /auth/siwe/challenge`) and login (`POST /auth/siwe/login`) requests **must not include the `Origin` header** (`curl` and standard HTTP clients omit this header by default; do not add it manually). * If an `Origin` header is sent but is not a configured web console domain (including empty string or `null`), the challenge request returns HTTP 400 `invalid_request`. * If the mode at login does not match the challenge mode (for instance, requesting a programmatic challenge without `Origin` and then submitting login with an `Origin` header, or vice versa), the login request returns HTTP 400 `siwe_invalid` with `reason: domain_mismatch`. ### Message integrity and wallet requirements * **Verbatim signature and submission**: Clients must sign and submit the message text exactly as returned by the challenge endpoint. Do not alter whitespace, domain, chain ID, or any fields. Any modification results in HTTP 400 `siwe_invalid` with `reason: signature`. * **Supported wallets**: Ethereum mainnet (Chain ID 1) Externally Owned Accounts (EOA). The signature must be a 65-byte ECDSA signature (`personal_sign`). Contract wallets (EIP-1271) and smart accounts are not supported. * **Challenge validity**: Each challenge nonce is single-use and expires after 5 minutes. ### Request body and sign-up attribution (optional) The `POST /auth/siwe/login` request body accepts required authentication parameters and optional signup attribution fields: * **Required fields**: * `message`: The complete SIWE message string obtained from the challenge endpoint. * `signature`: The 65-byte hexadecimal signature (`0x` prefixed) produced by signing the EIP-4361 `message` with `personal_sign` (EIP-191) from an Ethereum wallet. * **Optional attribution fields** (saved only once when a new account is created; ignored on subsequent logins): * `ref`: A lowercase channel token matching `^[a-z0-9._-]{1,64}$` (lowercase ASCII letters, digits, `.`, `_`, `-`, 1–64 characters). For example, autonomous agents can set this to their framework or runtime identifier (e.g. `my-agent.v1`). Non-compliant values (including uppercase letters, empty strings, excess length, or unsupported characters) return HTTP 400 `invalid_request` without case folding and prevent account creation; omit or pass `null` when not applicable. * `referrer`: A source URL or hostname string. Omission or `null` is accepted as not provided; blank strings or strings without a usable hostname are discarded. Only non-null, non-string values return HTTP 400 `invalid_request`. Sending undefined fields such as `signup_method` returns HTTP 400 `invalid_request`. ## Session tokens and API keys ### Session token lifecycle * **Format**: `rgs_` followed by 64 lowercase hexadecimal characters. * **Validity**: Absolute lifetime of 7 days; expires automatically after 24 hours of idle time. * **No refresh token**: When a session token expires, initiate a new challenge and login flow. * **Header**: Pass the session token in the `Authorization: Bearer rgs_...` request header. ### API key creation * Call `POST /keys` with the session token to create an API key (`rgw_` followed by 64 hexadecimal characters). * The default policy allows at most 20 unrevoked, unexpired (`active` + `disabled`) keys per account. A key counts only if it is unrevoked and `expires_at` is `null` or strictly later than the current time; expired keys do not count. Exceeding the configured cap returns HTTP 409 `key_limit_reached` with `error.reason: active_keys` and the configured maximum in `error.limit`; revoke a key first. The cap applies across all the account's identities, sessions, and chains. The default rolling-24-hour creation limit is also 20; exceeding it returns HTTP 429 `rate_limited` with `error.reason: daily_creations` and `Retry-After: 3600`. * Within the creation quota checks, the live-key cap is checked before the rolling-24-hour creation limit: if both are reached, creation returns the active-key HTTP 409, not the daily HTTP 429. Rotation requires an enabled, unrevoked, unexpired target key; it does not increase the live-key count but still uses the daily creation quota. Revoking or expiring a key does not remove its creation from the rolling-24-hour count. * Optional cap and expiry: you can provide `cu_cap` (lifetime CU cap for the key, which is a soft cap) and expiry (`expires_in_secs` or `expires_at`, up to the maximum days allowed by key policy); once expired or the cap is exhausted, the server returns 403 (JSON-RPC `-32025`, reason `key_expired` or `key_cap_exhausted`). * The secret `api_key` is **returned only once upon creation**. Store it securely immediately in your secrets manager or environment variables. * One API key works across all supported chains on JSON-RPC and the Data API. ## Lost your session or API key? In BlockVectra, **an agent's account identity is bound to the Ethereum wallet address used during sign-up**. If your session token expires or an API key is lost or leaked, you can recover full control using only that wallet: 1. **Re-authenticate with the same wallet**: Request a challenge, sign it with the same wallet, and submit the login request (`POST /auth/siwe/login`). The server verifies the signature, logs into the existing account with `account_created: false`, and issues a new session token. 2. **Create a new API key**: With the new session token, call `POST /keys` with `{"label": "..."}` and the `Authorization: Bearer ` header. The endpoint returns HTTP 201 with the created key details in `key` and the one-time secret in `api_key`. Save this key immediately in your environment variables or secrets manager. 3. **List all keys for the account**: * Endpoint: `GET /keys` * Header: `Authorization: Bearer ` * Query parameter: optional `include_revoked=true` (when `true`, includes revoked keys; defaults to active/disabled keys only). * Response: HTTP 200 with JSON `{"items": [...]}`. Each element in the `items` array includes: * `key_id`: unique key identifier (string) * `label`: key label (string or `null`) * `status`: status (`"active"`, `"disabled"`, or `"revoked"`) * `created_at`: creation timestamp (ISO 8601 string) * `revoked_at`: revocation timestamp (string, or `null` if not revoked) 4. **Revoke unused or compromised keys**: * Endpoint: `POST /keys/{key_id}/revoke` (note: uses `POST` with the target `key_id` in the path; empty request body) * Header: `Authorization: Bearer ` * Behavior: idempotent; keys with `active` or `disabled` status can both be revoked. If already revoked, it returns HTTP 200 unchanged. After revocation, requests using that key are rejected. * Response: HTTP 200 returning the revoked key object (fields match the key object above, with `status: "revoked"` and a timestamp in `revoked_at`). > **Key and secret security** > > Store wallet private keys and API keys in environment variables or a secrets manager. Never commit them to code repositories, write them to logs, or paste them into AI chat conversations. ## Security recommendations * **Use short-term keys and revoke when done**: For automated or ephemeral tasks, create short-lived keys with `expires_in_secs` and revoke them immediately via `POST /keys/{key_id}/revoke` once work is complete. ## Sign-up rate limits (`signup_rate_limited`) Account creation is subject to sign-up rate limits. The per-IP token bucket has capacity for 100 accounts and refills at 100 accounts/hour per IPv4 address or IPv6 /64 prefix, shared by SIWE and OAuth signup: * When exceeding sign-up limits, `POST /auth/siwe/login` returns HTTP 429 `signup_rate_limited` with a `Retry-After` header indicating the number of seconds to wait. * The `reason` field distinguishes the limit scope: * `per_ip`: the registration budget for the requesting IP prefix has been exhausted. * `global`: the aggregate platform sign-up limit has been exhausted. * Sign-up rate limits only evaluate new account registrations. Existing accounts logging in are not blocked by sign-up rate limits. ## FAQ ### Do I need to pay or top up before I get a key? No. The first wallet login creates the account and grants 30,000,000 CU. Use the session token from login to create the key. Up to the first top-up, the account is limited to 25 calls per second; see [what the Free Plan covers](https://docs.blockvectra.com/en/guides/free-plan/). ### Does it need a browser, a password, or gas? No browser is needed. The HTTP requests use plain HTTPS JSON without an `Origin` header; sign the message locally in your own wallet environment. There is no password; the wallet signature is the credential. Signing is off-chain, so it costs no gas and sends no transaction. The wallet must be an Ethereum EOA; contract wallets (EIP-1271) are not supported. ### What if I lose the API key? The secret is shown only once and cannot be retrieved again. Log in again with the same wallet to get a new session token, create a new key, and revoke the old one; see [Lost your session or API key](https://docs.blockvectra.com/en/guides/programmatic-signup/#lost-your-session-or-api-key). ## Related resources * Read the [AI agents integration guide](https://docs.blockvectra.com/en/guides/ai-agents/) to learn about the keyless MCP server and machine-readable context files. * Review [Quickstart](https://docs.blockvectra.com/en/quickstart/) for multi-language client examples. * Inspect the [Error reference](https://docs.blockvectra.com/en/errors/) for full error codes, reasons, and automated recovery actions. ## Next steps * Send your first JSON-RPC or Data API call with `x-api-key: $BLOCKVECTRA_API_KEY`. * [Check account balance and limits](https://docs.blockvectra.com/en/guides/ai-agents/#query-balance-get-v1account) using `GET /v1/account`. * Follow the [Agent programmatic top-up guide](https://docs.blockvectra.com/en/guides/agent-topup/) to maintain balance. --- # BlockVectra as a QuickNode Alternative: RPC Without a Monthly Subscription Source: https://docs.blockvectra.com/en/guides/quicknode-alternative/ Use BlockVectra for supported occasional RPC reads without a monthly RPC subscription; authenticated access uses eligible free credits or usage billing, with a $0.01 minimum top-up excluding network gas. ## Comparison Competitor figures as of 2026-10-08. BlockVectra method weights, free-plan and key limits come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans) and log ranges from [GET /v1/chains](https://api.blockvectra.com/v1/chains); current figures are rendered by the components below. | Metric | QuickNode | BlockVectra | Sources | | ------------------------------ | ----------------------------------------------------------- | ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Standard paid RPC subscription | Build: $49/month, monthly billing; 80M API credits included | Usage billing without a monthly RPC subscription | [Pricing](https://www.quicknode.com/pricing), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | | Free-access duration | One-month trial; 10M API credits; no overage | Sign-up credits and eligible cycle refills; current budget below | [Pricing](https://www.quicknode.com/pricing), [trial rules](https://support.quicknode.com/articles/5387074982-1-month-free-trial), [plans](https://console-api.blockvectra.com/v1/plans), [chains](https://api.blockvectra.com/v1/chains) | Build overage is $0.62 per million additional API credits after the included 80M, not a price for a million RPC calls. Apply the exact chain and method credit weights before estimating usage. The table uses monthly billing, excluding annual discounts and promotions; the free-access row compares duration, not the number of calls. ## Why choose BlockVectra ### Method prices and free-account budget Method weights, USD conversion and the free-account budget below come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans). Chain limits come from [GET /v1/chains](https://api.blockvectra.com/v1/chains). Compare the same chain, method, block and complete result; splitting and retries change the number of calls. **Active Conversion Parameters** 1 USD = 10,000 billing units, 1 billing unit = 1,000 CU (1 USD = 10,000,000 CU). **Formula**: CU weight × 1,000,000 ÷ (10,000 × 1,000) USD. | Method | CU per call | Price per 1M calls (USD) | | --- | --- | --- | | `eth_blockNumber` | 1 | $0.10 | | `eth_call` | 15 | $1.50 | | `eth_getLogs` | 30 | $3.00 | | `debug_traceTransaction` | 100 | $10.00 | | `data.block` | 5 | $0.50 | Self-service Push supports up to 1,000,000 addresses per subscription. For 10,000,000 / 100,000,000 addresses per subscription, [contact us to enable capacity](https://blockvectra.com/en/contact/). **BlockVectra task costs and request rates** Free new-key default budget: 100 CU/s. | Method | Example calls | CU per call | Task cost (USD) | Requests/s from key CU budget | | --- | --- | --- | --- | --- | | `eth_call` | 1,000,000 | 15 | $1.50 | 6 | | `eth_getLogs` | 100,000 | 30 | $0.30 | 3 | Task costs are list prices before free credits, gas and additional services. Request rates equal key_defaults.cu_per_sec ÷ method CU and assume only that method uses the key. Free-account caps and other traffic can reduce the usable rate; these figures are budget conversions, not measured throughput. [Current weights, prices and key limits: GET /v1/plans.](https://console-api.blockvectra.com/v1/plans) The Free Plan requires registering an account and using an API key; all keys under an account share an average of 25 calls per second (short bursts allowed). At the end of each 30-day cycle, balances below 30,000,000 CU are refilled to 30,000,000 CU. | Method | CU Weight | Approx Calls / Cycle | Approx / Day | List Price / 1M Calls | | --- | --- | --- | --- | --- | | `eth_blockNumber` | 1 | 30,000,000 | 1,000,000 | $0.10 | | `eth_getBlockByNumber` | 5 | 6,000,000 | 200,000 | $0.50 | | `eth_getBalance` | 10 | 3,000,000 | 100,000 | $1.00 | | `eth_call` | 15 | 2,000,000 | 66,666 | $1.50 | | `eth_getLogs` | 30 | 1,000,000 | 33,333 | $3.00 | | `debug_traceTransaction` | 100 | 300,000 | 10,000 | $10.00 | | `data.block` | 5 | 6,000,000 | 200,000 | $0.50 | | `data.address_balances` | 25 | 1,200,000 | 40,000 | $2.50 | | `data.dex_prices` | 15 | 2,000,000 | 66,666 | $1.50 | | `data.transaction_trace` | 200 | 150,000 | 5,000 | $20.00 | Free-account cap: up to 25 calls per second, shared across all keys in the account, all chains, and the Data API. Per-key `key_defaults.cu_per_sec` and `burst_cu` also apply. Eligible cycle refills top the free balance up to the target rather than adding a full grant. The first paid top-up stops cycle refills while preserving remaining free CU. See [free plan rules](https://docs.blockvectra.com/en/guides/free-plan/). ### Usage billing for intermittent workloads For a hypothetical occasional job of 10,000 supported `eth_call` reads, multiply the call count by the current `eth_call` CU weight in the method table. Divide that usage by `pricing.units_per_usd × pricing.cu_per_unit` for its list-price compute cost, then deduct available free CU before calculating paid compute. Include any billable retries. There is no monthly RPC subscription. When your balance covers the job, no additional compute funding is needed. Otherwise, check the current minimum in [top-up status](https://api.blockvectra.com/v1/topup/status) and follow the [top-up flow](https://docs.blockvectra.com/en/guides/agent-topup/); network gas is separate. Eligible unpaid accounts receive cycle balance refills; the first paid top-up stops those refills while preserving unused free CU. Rates and refill rules: [plans](https://console-api.blockvectra.com/v1/plans), checked **2026-10-09**, and [free plan rules](https://docs.blockvectra.com/en/guides/free-plan/). ### Keyless trials and programmatic Agent funding Try a listed `public.methods` method at the chain catalog's `public.url` before creating a key. For authenticated access, [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/) lets an Agent create an account and key with a wallet signature. [Agent top-ups](https://docs.blockvectra.com/en/guides/agent-topup/) fund the same usage balance with stablecoins; read networks, tokens and minimums from [top-up status](https://api.blockvectra.com/v1/topup/status). Developers and AI Agents use the same prices and limits. ### Multi-chain address Push Watch the same address set across several supported chains in one subscription, with one HTTPS receiver. This suits wallet activity and payment notifications without maintaining a socket per chain. See [self-service and enterprise address capacity](https://docs.blockvectra.com/en/guides/webhook-push/#address-capacity); [contact us](https://blockvectra.com/en/contact/) to enable enterprise capacity. Address-day and delivered-event charges are separate from RPC calls and are listed in [Push pricing](https://docs.blockvectra.com/en/guides/webhook-push/#billing-and-example). RPC on Robinhood Chain and HyperEVM is listed in the [chain catalog](https://api.blockvectra.com/v1/chains). Check methods and Push support per network; use the [chain-specific starter guide](https://docs.blockvectra.com/en/guides/robinhood-chain/) and [HyperEVM backfill guide](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) for the relevant workflow. ## Migration steps 1. **Inventory and coverage:** list chains, methods, fixed blocks, log spans and subscription dependencies. Check `methods.allow`, `methods.deny`, `public.methods`, `state_window_blocks` and `ws` in the [catalog](https://api.blockvectra.com/v1/chains). A null history window is unspecified, not archive coverage. A keyless `public.url` smoke test validates only its listed public methods. 2. **Key and authentication:** obtain a BlockVectra key through the [console](https://console.blockvectra.com/keys/) or [programmatic sign-up](https://docs.blockvectra.com/en/guides/programmatic-signup/). Keep it in your server environment. RPC accepts `POST /v1/{chain}/{api_key}` or `POST /v1/{chain}` with `x-api-key`; Data API uses `x-api-key`. This Ethereum WETH `decimals()` example uses the header: ```bash if [ -z "$BLOCKVECTRA_API_KEY" ]; then echo "Set BLOCKVECTRA_API_KEY in your server environment" exit 1 fi curl --fail-with-body -sS --max-time 15 https://api.blockvectra.com/v1/eth_mainnet \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"to":"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2","data":"0x313ce567"},"latest"]}' ``` 3. **Replay before switching:** replace `latest` with the same supported fixed block on both providers and record the block hash. Compare returned values and JSON-RPC `error`, even after HTTP 200. Test representative log queries, bounded retries, rate-limit recovery and cursor resume. Migrate proprietary APIs and subscriptions separately; move traffic after the required results match. ## FAQ ### Does a lower method price mean a lower total task cost? Calculate `max(0, sum(calls × method CU) − available_free_cu) / (pricing.units_per_usd × pricing.cu_per_unit)`. Include splitting, retries and any services your task uses. Existing included credits change incremental costs; compare the complete result rather than billing-unit names. ### Can I migrate by changing the endpoint? For supported standard RPC methods, update the endpoint and path key or `x-api-key` header, then replay fixed-block requests. Check historical state and method coverage first. Proprietary APIs, WebSocket subscriptions and Push receivers need their own migration tests; see [historical state](https://docs.blockvectra.com/en/guides/evm-historical-state/) and [Webhook versus WebSocket](https://docs.blockvectra.com/en/guides/webhook-vs-websocket/). Use [How to choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/) for a workload checklist and self-tests. --- # How Much Do RPC Calls Cost per Million? CU Weights and Price per Million Calls Source: https://docs.blockvectra.com/en/guides/reading-cu-pricing/ At current published rates, an `eth_call` costs 15 CU, which is $1.50 per million calls before available free credits are applied. Price per million calls = method CU weight × 1,000,000 ÷ (`units_per_usd` × `cu_per_unit`); both factors and every method weight come from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans) (Checked 2026-10-21), and the [pricing page](https://blockvectra.com/en/pricing/) shows the same values. Developers and AI agents can use them to estimate costs in Compute Units (CU) and USD. ```bash curl -s "https://console-api.blockvectra.com/v1/plans" | jq '{pricing, method_weights}' ``` This guide walks through what a CU represents, how method weights work, how to convert CU weights into a price per million calls in USD, and how to estimate per-cycle costs. ## Method weights and billing Every supported method is billed at its published Compute Unit (CU) weight. For example, calls to standard methods like `eth_blockNumber` or `eth_call`, execution trace methods (such as `debug_traceTransaction`), and Data API endpoints (such as `data.block`) each consume their defined CU weight per call. The published CU weights for all methods are available on the [Pricing page](https://blockvectra.com/en/pricing/) and can be queried dynamically from the platform plans API (`GET /v1/plans`). Unlisted or newly introduced JSON-RPC methods receive the default CU weight. Data API methods outside available coverage return appropriate status codes and are not billed. ## Converting CU per call to price per million calls When planning infrastructure budgets, developers often measure costs in dollars per million requests. ### Conversion formula Under the platform pricing model, a method's price per million calls is `cu_weight × 1,000,000 ÷ (units_per_usd × cu_per_unit)`; `eth_call` at 15 CU gives $1.50. The pieces: * Paid credits are denominated in **billing units**: `units_per_usd` (billing units per 1 USD). * Each billing unit contains a fixed number of CUs: `cu_per_unit` (CUs per billing unit). * Therefore, 1 USD provides `units_per_usd × cu_per_unit` total CUs. For how settlement works, see the [Pricing page](https://blockvectra.com/en/pricing/). ### Common methods price table The table below lists representative methods, showing their CU weights and list price per million calls, read from the platform plans API (`GET /v1/plans`): **Active Conversion Parameters** 1 USD = 10,000 billing units, 1 billing unit = 1,000 CU (1 USD = 10,000,000 CU). **Formula**: CU weight × 1,000,000 ÷ (10,000 × 1,000) USD. | Method | CU per call | Price per 1M calls (USD) | | --- | --- | --- | | `eth_blockNumber` | 1 | $0.10 | | `eth_call` | 15 | $1.50 | | `eth_getLogs` | 30 | $3.00 | | `debug_traceTransaction` | 100 | $10.00 | | `data.block` | 5 | $0.50 | ### Comparing with alternative providers For a complete workload checklist and self-tests, start with [How to choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/). When evaluating infrastructure budgets for EVM contract reads and log queries, see how compute unit pricing and tier limits compare with other platforms: * [Compare providers for supported RPC reads](https://docs.blockvectra.com/en/guides/alchemy-alternative/): Compare published `eth_call` and `eth_getLogs` compute rates, free-tier log ranges, and operational workload assumptions. ## Billing boundaries: what is not billed BlockVectra bills only upon response; early rejections are never charged. Because billing rules span HTTP status codes, JSON-RPC error codes, and Data API responses, this guide does not repeat every edge case. For the full table of rules and recommended developer actions, please refer directly to the dedicated guide: [What is not billed: error codes and billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) ## How to estimate your per-cycle costs Estimating per-cycle costs helps teams choose between the Free Plan allowance and upgrading to paid capacity: ### 1. Identify your method distribution and frequency Break down your application's expected traffic by method: * Lightweight polling or sync checks (such as `eth_blockNumber`); * User-triggered contract calls (such as `eth_call`); * Event indexing or historical transfer queries (such as `eth_getLogs` or Data API transfer endpoints). ### 2. Use the official usage estimator Rather than calculating manually, you can use the interactive estimator on the Pricing page: [Go to the Pricing page usage estimator](https://blockvectra.com/en/pricing/#estimate) Select your methods and enter daily call volumes. The estimator will calculate: * Total CU per usage cycle; * Share of the Free Plan cycle allowance; * Implied average calls per second; * Estimated cost at list price for usage exceeding the free quota. ### 3. Review the free plan guide To see what the free allowance covers, refer to the [Free Plan guide](https://docs.blockvectra.com/en/guides/free-plan/). After estimating usage, [top up your RPC account programmatically](https://docs.blockvectra.com/en/guides/agent-topup/); check open networks and tokens before transferring funds. ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # Robinhood Chain RPC URL: mainnet and testnet Source: https://docs.blockvectra.com/en/guides/robinhood-chain/ | Network | Chain ID | Public HTTP RPC | | ------- | -------- | --------------------------------------------------------- | | Mainnet | `4663` | `https://api.blockvectra.com/v1/robinhood_mainnet/public` | | Testnet | `46630` | `https://api.blockvectra.com/v1/robinhood_testnet/public` | Building on testnet? Start with the [testnet starter](https://docs.blockvectra.com/en/guides/robinhood-testnet-starter/) or get [test ETH from the faucet](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/). Robinhood Chain mainnet uses chain ID `4663`, and its keyless public RPC URL is `https://api.blockvectra.com/v1/robinhood_mainnet/public` (3 requests per second per IP). The testnet uses chain ID `46630`. Developers and AI agents use the same endpoints; Public methods are limited by `public.methods`; anonymous `eth_getLogs` is available only where listed and subject to `public.logs`. Check each network separately. WebSocket and the Data API need a key. [Choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/). The RPC endpoints in this guide are provided by BlockVectra; Robinhood's own public RPC endpoints and network parameters are listed in its [official connection documentation](https://docs.robinhood.com/chain/connecting/). ```bash curl -s "https://api.blockvectra.com/v1/robinhood_mainnet/public" -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' ``` Checked 2026-11-12. Public endpoints serve HTTP JSON-RPC reads without an API key; the testnet endpoint is `https://api.blockvectra.com/v1/robinhood_testnet/public`. Keep mainnet and testnet requests separate. * **First step:** [Read mainnet without a key](https://docs.blockvectra.com/en/guides/robinhood-chain/#read-mainnet-without-a-key) with the three commands, or [connect with viem or ethers](https://docs.blockvectra.com/en/guides/robinhood-chain/#connect-with-viem-or-ethers) if you want to save `network.mjs` and a client example first. * **Done when:** The TypeScript keyless read confirms mainnet chain ID `4663` and prints the latest block number; the Python example confirms chain identity with chain ID `4663`. A custom client confirms that the RPC chain ID matches the catalog's `chain_id` and prints the latest block number without an `RPC chain ID mismatch` error. [Mainnet parameters and access options](https://blockvectra.com/en/chains/robinhood_mainnet/). ## Read mainnet without a key For a ready-to-run TypeScript example, use the [BlockVectra agent-quickstart](https://github.com/blockvectra/agent-quickstart) repository. With Node.js 22 (>=22.18) or Node.js >=24.12, and Git, run the native TypeScript entry without installing dependencies. It reads Robinhood mainnet by default: it reads the chain directory, confirms chain ID `4663`, then reads the latest block number. That command makes at most 3 HTTP requests, including 2 JSON-RPC calls, and needs no wallet, sign-up or API key. ```bash git clone https://github.com/blockvectra/agent-quickstart.git cd agent-quickstart node src/public-read-cli.ts ``` For other Node.js versions (Node.js >=18), run these commands from the cloned repository: ```bash npm ci --ignore-scripts npm run read:public ``` Done when the output shows chain ID `4663` and the latest mainnet block number. The repository's `npm start` is a separate full sign-up flow, not part of this keyless read. For a Python 3.10+ alternative, run this from the cloned repository. It uses only the standard library, needs no packages, and succeeds by confirming chain ID `4663`; it does not read a block height. It makes at most 2 HTTP requests, including 1 RPC call. ```bash python3 examples/public_chain.py ``` For your own viem or ethers client, the [section below](https://docs.blockvectra.com/en/guides/robinhood-chain/#connect-with-viem-or-ethers) still works. It starts on testnet by default; set `BLOCKVECTRA_CHAIN=robinhood_mainnet` to read mainnet. ## Tasks this guide helps you complete * [Probe Robinhood Chain RPC](https://docs.blockvectra.com/en/guides/robinhood-chain/#connect-with-viem-or-ethers) with a public read using viem or ethers, then use a key for authenticated methods. * [Check the testnet RPC connection](https://docs.blockvectra.com/en/guides/robinhood-chain/#testnet) by reading `eth_chainId` before running testnet operations. * [Query tokenized stock activity](https://docs.blockvectra.com/en/guides/robinhood-chain/#tokenized-stock-data) with the mainnet Data API after checking dataset support; the metrics describe on-chain activity, not stock prices. ## BlockVectra MCP or Robinhood Trading MCP Use the [BlockVectra MCP server](https://docs.blockvectra.com/en/guides/mcp-server/) when an agent needs on-chain RPC calls or Data API results for Robinhood Chain. Use Robinhood's official Trading MCP, set up through its [onboarding guide](https://robinhood.com/us/en/support/articles/agentic-trading-overview/), when an agent needs to work with brokerage accounts, holdings or orders. A BlockVectra service account authenticates requests to BlockVectra's RPC and data endpoints. A Robinhood brokerage account is a separate account held at Robinhood. Robinhood Chain does not connect to it, and a BlockVectra service account does not give access to it. ## RPC and WebSocket access * **Public RPC URL**: Find the no-key endpoint, supported public methods, and rate limits on the [Robinhood Chain mainnet page](https://blockvectra.com/en/chains/robinhood_mainnet/) or [testnet page](https://blockvectra.com/en/chains/robinhood_testnet/). * **JSON-RPC with an API key**: Use the endpoints and curl examples below. For logs, see the [eth\_getLogs method reference](https://docs.blockvectra.com/en/api/json-rpc/methods/eth_getLogs/) and [block range limit guide](https://docs.blockvectra.com/en/guides/getlogs-block-range/). * **WebSocket with an API key**: Use the WebSocket endpoints below and follow the [WebSocket subscriptions guide](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) for `newHeads` and `logs`. Public RPC access is HTTP JSON-RPC; WebSocket connections require a key. ## Network information and endpoints Every request to Robinhood Chain identifies its target network explicitly in the URL path using the slug `robinhood_mainnet`. JSON-RPC supports both path-based key authentication and request header authentication (`x-api-key`), while the Data API serves REST endpoints under `/v1/data/robinhood_mainnet/`. The parameters and endpoints below reflect active network parameters: | Parameter / Endpoint | Value / Template | Authentication | |---|---|---| | Chain ID (EIP-155) | `4663` | — | | JSON-RPC (path key) | `POST https://api.blockvectra.com/v1/robinhood_mainnet/{api_key}` | API key in URL path | | JSON-RPC (header key) | `POST https://api.blockvectra.com/v1/robinhood_mainnet` | Header x-api-key: {api_key} | | WebSocket (path key) | `wss://api.blockvectra.com/v1/robinhood_mainnet/{api_key}` | API key in URL path | | WebSocket (header key) | `wss://api.blockvectra.com/v1/robinhood_mainnet` | Header x-api-key: {api_key} or Authorization: Bearer {api_key} | | WebSocket subscriptions | `newHeads, logs` | — | | Data API base | `GET https://api.blockvectra.com/v1/data/robinhood_mainnet/…` | Header x-api-key: {api_key} | | Public status | `GET https://api.blockvectra.com/v1/status` | Unauthenticated (public) | ## Connect with viem or ethers Developers and AI Agents can use the same server-side settings. Use Node.js 24 or later, viem 2 or ethers 6, and start with public reads. Set `BLOCKVECTRA_API_KEY` securely in the environment for keyed methods and WebSocket. Keep keys and RPC URLs containing keys out of browser code, logs and version control. Save this as `network.mjs`. Start on testnet; set `BLOCKVECTRA_CHAIN=robinhood_mainnet` to move to mainnet. It reads `chain_id` and method policy from [GET /v1/chains](https://api.blockvectra.com/v1/chains). For keyless reads, use the catalog’s `public.url` and only methods listed in `public.methods`; public HTTP availability does not imply WebSocket access. ```js const chainSlug = process.env.BLOCKVECTRA_CHAIN ?? 'robinhood_testnet'; const key = process.env.BLOCKVECTRA_API_KEY; const catalogUrl = 'https://api.blockvectra.com/v1/chains'; const response = await fetch(catalogUrl, { signal: AbortSignal.timeout(15_000) }); if (!response.ok) throw new Error(`Chains HTTP ${response.status}`); const catalog = await response.json(); export const chainInfo = catalog.chains.find(item => item.chain === chainSlug); if (!chainInfo || !Number.isSafeInteger(chainInfo.chain_id) || chainInfo.chain_id <= 0) { throw new Error('Missing chain or chain_id'); } export function allows(method) { const matches = pattern => pattern.endsWith('*') ? method.startsWith(pattern.slice(0, -1)) : pattern === method; if (!key) return (chainInfo.public?.methods ?? []).some(matches); return (chainInfo.methods?.allow ?? []).some(matches) && !(chainInfo.methods?.deny ?? []).some(matches); } if (!allows('eth_chainId')) throw new Error('eth_chainId is unavailable'); export const rpcUrl = key ? new URL(`./${chainSlug}/${encodeURIComponent(key)}`, catalogUrl).href : chainInfo.public?.url; if (!rpcUrl) throw new Error('Public RPC is unavailable; set BLOCKVECTRA_API_KEY'); ``` Save as `viem-client.mjs`, install with `npm install viem@2`, then run `node viem-client.mjs`. ```js import { createPublicClient, defineChain, http } from 'viem'; import { chainInfo, rpcUrl } from './network.mjs'; export const chain = defineChain({ id: chainInfo.chain_id, name: chainInfo.name, nativeCurrency: { name: 'ETH', symbol: 'ETH', decimals: 18 }, rpcUrls: { default: { http: [rpcUrl] } }, }); export const client = createPublicClient({ chain, transport: http(rpcUrl) }); if (await client.getChainId() !== chain.id) throw new Error('RPC chain ID mismatch'); console.log(await client.getBlockNumber()); ``` To read mainnet with this client: ```bash BLOCKVECTRA_CHAIN=robinhood_mainnet node viem-client.mjs ``` For ethers, save as `ethers-client.mjs`, install with `npm install ethers@6`, then run `node ethers-client.mjs`. ```js import { JsonRpcProvider } from 'ethers'; import { chainInfo, rpcUrl } from './network.mjs'; const provider = new JsonRpcProvider(rpcUrl, chainInfo.chain_id, { batchMaxCount: 1 }); const network = await provider.getNetwork(); if (network.chainId !== BigInt(chainInfo.chain_id)) throw new Error('RPC chain ID mismatch'); console.log(await provider.getBlockNumber()); provider.destroy(); ``` To read mainnet with this client: ```bash BLOCKVECTRA_CHAIN=robinhood_mainnet node ethers-client.mjs ``` ## Route through eRPC If you already run [eRPC](https://github.com/erpc/erpc) as a local RPC proxy, add BlockVectra as two explicit upstreams. eRPC does not discover these chains on its own, so every upstream below sets its endpoint and chain ID. This file was checked against eRPC [0.5.0](https://github.com/erpc/erpc/releases/tag/0.5.0) (install that release first); the [reference Gist](https://gist.github.com/gjwang/fb8d4cde5f159b6d1d54ee8ae1c10a51/e944e29fadd7b586f48f7f565c21eeeb8af4d778) has the files to reproduce it. This needs your own API key; the keyless public endpoint is not a substitute. Save as `erpc.blockvectra.yaml`. The key is read from the environment, so it never appears in the file: ```yaml logLevel: error server: listenV4: true httpHostV4: 127.0.0.1 httpPortV4: 4000 listenV6: false metrics: enabled: false projects: - id: blockvectra upstreams: - id: blockvectra-rh-mainnet endpoint: https://api.blockvectra.com/v1/robinhood_mainnet evm: chainId: 4663 jsonRpc: headers: x-api-key: "${BLOCKVECTRA_API_KEY}" - id: blockvectra-rh-testnet endpoint: https://api.blockvectra.com/v1/robinhood_testnet evm: chainId: 46630 jsonRpc: headers: x-api-key: "${BLOCKVECTRA_API_KEY}" ``` An unset variable expands to an empty header, so stop before starting if the key is missing, then validate and run: ```bash : "${BLOCKVECTRA_API_KEY:?Set BLOCKVECTRA_API_KEY first}" erpc --config erpc.blockvectra.yaml --require-config validate erpc --config erpc.blockvectra.yaml --require-config ``` The proxy listens on `127.0.0.1:4000` only. From another terminal, read the chain ID through the local route and check that it matches: ```bash curl -s "http://127.0.0.1:4000/blockvectra/evm/4663" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' ``` The `result` should be the hex form of `4663`. For testnet, use `/blockvectra/evm/46630` and expect the hex form of `46630`. Notes: * `validate` only checks the local file. Methods, log ranges and state history still come from [GET /v1/chains](https://api.blockvectra.com/v1/chains). * On startup eRPC contacts the upstreams for bootstrap and health checks, and those background requests count toward your CU and request budget along with your own calls. * Do not print the config or request headers in logs; they carry your key. ## Deploy with Foundry or Hardhat Fund the deployer with test ETH via the [testnet faucet](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/) first; mainnet transactions need mainnet ETH. The [official network and deployment guide](https://docs.robinhood.com/chain/deploy-smart-contracts/) lists the mainnet and testnet chain IDs (accessed: 2026-10-07). The endpoint tables on this page use `/v1/chains`. Export the selected URL and chain ID from `network.mjs`. Check `eth_sendRawTransaction` against `methods.allow` and `methods.deny` before broadcasting. ```bash export RPC_URL="$(node --input-type=module -e "import { rpcUrl, allows } from './network.mjs'; if (!allows('eth_sendRawTransaction')) throw new Error('Broadcast unavailable'); console.log(rpcUrl)")" export CHAIN_ID="$(node --input-type=module -e "import { chainInfo } from './network.mjs'; console.log(chainInfo.chain_id)")" ``` Continue with the shared [Foundry or Hardhat deployment tutorial](https://docs.blockvectra.com/en/guides/deploy-contract/) for `Hello.sol`, tool settings, broadcasting and receipt checks. ## Listen to contract events over WebSocket Save as `watch-logs.mjs` and set `LOG_ADDRESS` to the deployed contract or token contract you watch. Run `node watch-logs.mjs`. The code checks `ws` and `subscriptions` from `/v1/chains` before subscribing to `logs`. ```js import { createPublicClient, webSocket, isAddress } from 'viem'; import { chain } from './viem-client.mjs'; import { chainInfo, rpcUrl } from './network.mjs'; if (!process.env.BLOCKVECTRA_API_KEY) throw new Error('WebSocket requires BLOCKVECTRA_API_KEY'); const address = process.env.LOG_ADDRESS; if (!chainInfo.ws || !chainInfo.subscriptions?.includes('logs')) { throw new Error('WebSocket logs are unavailable; use HTTP backfill or webhook push'); } if (!address || !isAddress(address)) throw new Error('Set LOG_ADDRESS'); const wsUrl = new URL(rpcUrl); wsUrl.protocol = 'wss:'; const client = createPublicClient({ chain, transport: webSocket(wsUrl.href) }); const unwatch = client.watchEvent({ address, poll: false, onLogs: logs => console.log(logs), onError: error => console.error(error), }); process.once('SIGINT', () => { unwatch(); process.exit(0); }); ``` After the listener starts, send a `ping()` transaction from another terminal using the same exported deployment variables: ```bash cast send "$CONTRACT_ADDRESS" "ping()" --rpc-url "$RPC_URL" \ --private-key "$DEPLOYER_PRIVATE_KEY" ``` Persist the last processed block and deduplicate by `(blockHash, transactionHash, logIndex)`. After reconnecting, backfill missed blocks with bounded `eth_getLogs` requests; reconcile logs marked `removed` on a reorg. See [WebSocket subscriptions](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) and [block range limits](https://docs.blockvectra.com/en/guides/getlogs-block-range/). For address events delivered to your HTTPS receiver, **GET /v1/push/chains lists supported chains** and confirmation settings; use an `x-api-key` header. Follow the [webhook push guide](https://docs.blockvectra.com/en/guides/webhook-push/) for subscriptions, signature verification, deduplication and replay. For mainnet stock-token activity queries, continue with the [stocks guide](https://docs.blockvectra.com/en/guides/stocks/). ## Direct curl examples You can make JSON-RPC calls immediately using standard HTTP clients. Replace `{api_key}` with your BlockVectra API key: **eth_chainId (Header)** Query the EIP-155 chain ID using the `x-api-key` request header: ```bash curl -s "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H "Content-Type: application/json" \ -H "x-api-key: {api_key}" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' ``` **eth_blockNumber (Path)** Query the latest block number by passing your API key in the URL path: ```bash curl -s "https://api.blockvectra.com/v1/robinhood_mainnet/{api_key}" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' ``` ### Response structure Responses follow the JSON-RPC 2.0 specification: * **Success**: Returns an envelope with `jsonrpc: "2.0"`, the same `id`, and a `result` string containing the hexadecimal-encoded quantity (`eth_chainId` returns the hex-encoded chain ID; `eth_blockNumber` returns the latest block height). * **Disallowed methods**: Requesting a method outside the network's allowed methods returns JSON-RPC error code `-32601` (`method not available`, not billed). * **Out-of-window queries**: Historical state requests earlier than the state retention window return JSON-RPC error code `-32011` (not billed). * **Invalid parameters**: Malformed or unallowed request parameters return JSON-RPC error code `-32602` (not billed). ## Capability and method policy Available JSON-RPC methods, log block range limits, and historical state retention on Robinhood Chain are published dynamically via `GET /v1/chains`. Execution tracing (`debug_trace*`, including `debug_traceTransaction`) is governed by the chain's method policy: ### Network parameters and limits - **eth_getLogs block range**: Max 1000 blocks per request - **Historical state window**: Recent 900 blocks (queries beyond return -32011) - **Execution tracing (debug_trace*)**: Supported (debug_traceTransaction, debug_traceCall, debug_traceBlockByNumber, debug_traceBlockByHash) Per-chain allowed methods: [Supported Chains](https://docs.blockvectra.com/en/chains/) ## Testnet To obtain test ETH for transactions, see the [Robinhood Chain testnet faucet guide](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/). Robinhood Chain Testnet (chain ID: 46630) uses the same API key as mainnet at endpoint `https://api.blockvectra.com/v1/robinhood_testnet`, authenticated via the `x-api-key` request header. Testnet requests use the same CU weights as mainnet and draw from the same balance and free credits. Available JSON-RPC methods and historical state retention on Robinhood Chain Testnet are published dynamically via `GET /v1/chains`. For a runnable three-step starter that reads the testnet without a key, streams logs over WebSocket, and then moves the same key to mainnet, see the [Robinhood Chain Testnet starter guide](https://docs.blockvectra.com/en/guides/robinhood-testnet-starter/). ```bash curl -s "https://api.blockvectra.com/v1/robinhood_testnet" \ -H "Content-Type: application/json" \ -H "x-api-key: {api_key}" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' ``` Expected response: ```json {"jsonrpc":"2.0","id":1,"result":"0xb626"} ``` | Parameter / Endpoint | Value / Template | Authentication | |---|---|---| | Chain ID (EIP-155) | `46630` | — | | JSON-RPC (path key) | `POST https://api.blockvectra.com/v1/robinhood_testnet/{api_key}` | API key in URL path | | JSON-RPC (header key) | `POST https://api.blockvectra.com/v1/robinhood_testnet` | Header x-api-key: {api_key} | | WebSocket (path key) | `wss://api.blockvectra.com/v1/robinhood_testnet/{api_key}` | API key in URL path | | WebSocket (header key) | `wss://api.blockvectra.com/v1/robinhood_testnet` | Header x-api-key: {api_key} or Authorization: Bearer {api_key} | | WebSocket subscriptions | `newHeads, logs` | — | | Data API base | `Not available yet` | — | | Public status | `GET https://api.blockvectra.com/v1/status` | Unauthenticated (public) | ### Network parameters and limits - **eth_getLogs block range**: Max 1000 blocks per request - **Historical state window**: Recent 1023 blocks (queries beyond return -32011) - **Execution tracing (debug_trace*)**: Supported (debug_traceTransaction, debug_traceCall, debug_traceBlockByNumber, debug_traceBlockByHash) Per-chain allowed methods: [Supported Chains](https://docs.blockvectra.com/en/chains/) ## Tokenized stock data On Robinhood Chain, the BlockVectra Data API provides daily on-chain metrics and metadata for tokenized stocks across two endpoints: * **Daily leaderboard (`GET /v1/data/robinhood_mainnet/stocks`)**: Daily activity leaderboard of tokenized stocks for a specified UTC date, ordered by transfer activity descending. * **Get one tokenized stock (`GET /v1/data/robinhood_mainnet/stocks/{token}`)**: Token contract metadata and up to 30 days of recent daily metrics by token address. For detailed request parameters, response envelopes (`StockDailyListEnvelope` and `StockTokenEnvelope`), pagination notes, and CU consumption estimates, see the [Tokenized stocks guide](https://docs.blockvectra.com/en/guides/stocks/). Complete starter template: [blockvectra/robinhood-stock-tokens](https://github.com/blockvectra/robinhood-stock-tokens) ## Getting started and API keys New accounts get 30,000,000 CU on sign-up — no credit card. You can try the keyless public endpoint `https://api.blockvectra.com/v1/robinhood_mainnet/public` first (wallet JSON-RPC methods only, Data API requires a key; methods and limits are subject to `/v1/chains`); sign up for an account if you need a higher rate limit. * **Web console**: Sign up via Ethereum wallet signature, and generate an API key in the [Console](https://console.blockvectra.com/login/?next=%2Fkeys%2F). See the [Quickstart guide](https://docs.blockvectra.com/en/quickstart/) for setup details. * **Programmatic sign-up**: Autonomous AI agents, automated scripts, and CI pipelines can sign in and provision API keys using Ethereum wallet signatures (EIP-191) without a browser. Follow the [Programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/). * **AI agents**: Autonomous AI agents can discover Robinhood Chain capabilities using the BlockVectra Model Context Protocol (MCP) server. See [Connecting AI Agents to BlockVectra](https://docs.blockvectra.com/en/guides/ai-agents/). * **Upgrading limits**: After topping up, the account-wide calls-per-second limit is removed; each key remains subject to Compute Unit (CU) rate and burst limits. For current rates and billing units, see the [Pricing page](https://blockvectra.com/en/pricing/). ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # Robinhood Chain testnet faucet and RPC: claim test ETH, then connect Source: https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/ To claim Robinhood Chain testnet ETH, send `POST https://api.blockvectra.com/v1/faucet/robinhood_testnet` with your own API key in `x-api-key` and the recipient address in the JSON body; each accepted claim sends 0.001 test ETH, limited to one per account and one per address in a rolling 24 hours. The testnet RPC URL is `https://api.blockvectra.com/v1/robinhood_testnet/public` (chain ID `46630`), keyless at 3 requests per second per IP; use it to confirm the claim after it is accepted. Checked 2026-11-12. Use the faucet to obtain test ETH for transactions on Robinhood Chain testnet (`robinhood_testnet`, chain ID `46630`). Claiming is free and consumes no CU. For subsequent RPC calls, the keyless public endpoint supports the chain's `public.methods` from `GET /v1/chains`; RPC calls authenticated with an API key use normal CU billing. * **First step:** [Send a claim](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/#send-a-claim) with your own API key and recipient address using the curl example below. * **Done when:** HTTP `202` and a `tx_hash` confirm acceptance; use the transaction-receipt query below to check on-chain inclusion before treating the claim as confirmed. [Testnet parameters and access options](https://blockvectra.com/en/chains/robinhood_testnet/). ## Before claiming Register a BlockVectra account and use one of your own API keys. Create a key in the [console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) or follow the [programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/). Use `0x` followed by 40 hexadecimal characters, either lowercase or mixed case with a valid EIP-55 checksum. Responses use lowercase addresses; different spellings of the same address share the same claim limit. ## Send a claim Call `POST https://api.blockvectra.com/v1/faucet/robinhood_testnet` with `Content-Type: application/json` and your key in `x-api-key`. This endpoint does not read a key from the URL path or `Authorization`. Replace `{api_key}` with your key and the example address with your recipient address: ```bash curl -i "https://api.blockvectra.com/v1/faucet/robinhood_testnet" \ -H "Content-Type: application/json" \ -H "x-api-key: {api_key}" \ -d '{"address":"0x1111111111111111111111111111111111111111"}' ``` The JSON body contains only `address` and must fit within 64 KiB (see `POST /v1/faucet/robinhood_testnet` in the [full OpenAPI reference](https://docs.blockvectra.com/en/api/json-rpc/reference/)). Unknown fields or invalid JSON return `400 invalid_request`. Use the exact endpoint without query parameters. ## Claim window and limits * Each accepted claim sends **0.001 test ETH** (`1000000000000000` wei). * Each account and each recipient address can have **one new claim per rolling 24 hours**. Using another key on the same account does not increase the limit. * The faucet accepts at most **1,000 new claims per UTC day** across all users. * Requests share a **5 requests per second per key** limit with `/v1/account` (see `POST /v1/faucet/robinhood_testnet` in the [full OpenAPI reference](https://docs.blockvectra.com/en/api/json-rpc/reference/)). `next_eligible_at` is the acceptance time plus 24 hours, expressed as an RFC 3339 UTC timestamp. The account and address windows do not reset at UTC midnight. A claim-limit `429` includes `error.data.scope` (`account`, `address`, or `global`) and `error.data.next_eligible_at`; for `global`, the timestamp is the start of the next UTC day. A request-frequency `429` has no `scope`. ## Accepted does not mean confirmed HTTP **202 means accepted, not successfully included on-chain**. The JSON response contains: | Field | Meaning | | -------------------- | -------------------------------------------- | | `chain` / `chain_id` | `robinhood_testnet` / `46630` | | `address` | Lowercase recipient address | | `amount_wei` | Claim amount as a decimal integer string | | `tx_hash` | Stable hash of the accepted transaction | | `next_eligible_at` | Next eligibility time for the rolling window | Retrying the same normalized address from the same account within 24 hours returns the original `202` response and the same `tx_hash`, including when using another valid key from that account. It does not send another payment. If a response is lost, retry the same address with the same account. Check the transaction using the existing testnet RPC endpoint. Replace `{tx_hash}` with the hash from the accepted response; this RPC query uses normal CU billing: ```bash curl -s "https://api.blockvectra.com/v1/robinhood_testnet" \ -H "Content-Type: application/json" \ -H "x-api-key: {api_key}" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionReceipt","params":["{tx_hash}"]}' ``` ### Interpret the receipt result Read the JSON-RPC body: HTTP `200` alone does not establish receipt or payment success. | Response | Decision and action | | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `error` | **Query error**. Follow the existing retry policy and [error reference](https://docs.blockvectra.com/en/errors/); do not mark the claim successful. | | `result: null` | **Unconfirmed**. No receipt was returned; this establishes neither success nor failure. Check `tx_hash` and `robinhood_testnet`, then repeat this query with backoff and a maximum attempt count or deadline. | | `result.status = 0x1`, `blockHash != null`, `blockNumber != null` | **Execution succeeded**. Included in a block and executed successfully; this is not Ethereum finality. | | `result.status = 0x0` | **Execution failed**. Included in a block, but execution failed; do not count test ETH as received. | | Other values or missing fields | **Unconfirmed**. Missing status or block information, or unexpected values, do not establish success. | While waiting or after a timeout, keep the outcome unconfirmed and retain the original `tx_hash`; do not switch accounts or keys to claim again or bypass limits. See [Ethereum receipt fields](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth-gettransactionreceipt) and [Robinhood confirmation levels](https://docs.robinhood.com/chain/transaction-finality/). ## Errors and retries The error envelope contains `error.code`, `error.message`, and `error.data`. `error.data.reason` equals `error.code`; `docs_url`, `retryable`, and `request_id` provide the error reference, retry policy, and request identifier. For every `429` or `503`, wait the number of seconds in the **`Retry-After`** response header before retrying. Without an accepted response, do not assume test ETH has been sent. | HTTP | Error code | What to do | | ---- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | 400 | `invalid_address` | Correct the address format or EIP-55 checksum; `error.data.field` is `/address`. | | 400 | `invalid_request` | Send valid JSON containing only `address`. | | 401 | `missing_api_key` / `invalid_api_key` | Supply a valid key in `x-api-key`. | | 403 | `key_expired` | Create a new API key. | | 404 | `not_found` | Check the path, chain, POST method, and absence of query parameters; the faucet may be unavailable. | | 413 | `request_too_large` | Reduce the body to fit within 64 KiB (see `POST /v1/faucet/robinhood_testnet` in the [full OpenAPI reference](https://docs.blockvectra.com/en/api/json-rpc/reference/)). | | 429 | `rate_limited` | Wait for `Retry-After`; inspect `scope` and `next_eligible_at` when present. | | 503 | `faucet_empty` | The faucet has insufficient funds for the claim and fees. Wait for `Retry-After`. | | 503 | `service_unavailable` | Claim processing is temporarily unavailable, or a previous claim has no receipt yet. Wait for `Retry-After`. | | 503 | `auth_unavailable` / `upstream_unavailable` | Wait for `Retry-After`, then retry. | See the [error reference](https://docs.blockvectra.com/en/errors/) or [/errors.json](https://docs.blockvectra.com/errors.json) for machine-readable guidance, and the [Robinhood Chain guide](https://docs.blockvectra.com/en/guides/robinhood-chain/) for RPC access. Continue with the [Robinhood Chain Testnet RPC starter](https://docs.blockvectra.com/en/guides/robinhood-testnet-starter/) for keyless reads and WebSocket logs. Find the public RPC URL and supported methods on the [testnet chain page](https://blockvectra.com/en/chains/robinhood_testnet/). --- # Robinhood Chain testnet RPC URL and chain ID: keyless reads, WebSocket logs, faucet Source: https://docs.blockvectra.com/en/guides/robinhood-testnet-starter/ The Robinhood Chain testnet RPC URL is `https://api.blockvectra.com/v1/robinhood_testnet/public` and its chain ID is `46630`: keyless HTTP JSON-RPC at 3 requests per second per IP, with WebSocket logs behind an API key. Get test ETH from the [testnet faucet guide](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/). Checked 2026-11-12. The RPC endpoints in this guide are provided by BlockVectra; Robinhood's own public RPC endpoints and network parameters are listed in its [official connection documentation](https://docs.robinhood.com/chain/connecting/). BlockVectra serves Robinhood Chain Testnet (chain ID 46630) over JSON-RPC and WebSocket, and the same API key also works on Robinhood Chain mainnet. This guide follows the [Robinhood Chain Testnet starter](https://github.com/blockvectra/robinhood-testnet-starter?ref=docs-testnet-starter) template through three steps: read the testnet without a key, open an account programmatically and stream logs, then move the same key to mainnet. For endpoint parameters, method policy, and tokenized stock data, see the [Robinhood Chain guide](https://docs.blockvectra.com/en/guides/robinhood-chain/). ## Run the template ```bash git clone https://github.com/blockvectra/robinhood-testnet-starter cd robinhood-testnet-starter npm install npm run typecheck ``` Node.js 18 or newer. The three scripts are `npm run step1`, `npm run step2`, and `npm run step3`. Optional variables (`BLOCKVECTRA_API_KEY`, `WALLET_PRIVATE_KEY`) are read from the shell; nothing loads `.env` automatically. ### Run the complete flow ```bash npm run walkthrough ``` This reads the testnet without a key, subscribes to filtered logs for 30 seconds, then uses the same API key for the mainnet RPC and Data API reads. If `BLOCKVECTRA_API_KEY` holds a non-empty value, it reuses that key and skips login and key creation; otherwise, without `WALLET_PRIVATE_KEY`, the first run saves a dedicated login wallet in `.agent-wallet.json` and later runs reuse that account, while each run without a key creates a new server-side key. Replace the example contract address in `src/step2-key-and-logs.ts` before subscribing. The continuous command passes the key directly to the mainnet read; you do not need to copy it from masked output. If the keyless read fails, sign-up does not run. A reported subscription error stops the command before mainnet; a quiet window with no matching events does not by itself indicate failure. ## Step 1: read the testnet without a key The public endpoint `https://api.blockvectra.com/v1/robinhood_testnet/public` serves wallet JSON-RPC methods with no account and no API key. Query the EIP-155 chain ID directly: ```bash curl -s "https://api.blockvectra.com/v1/robinhood_testnet/public" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' ``` The response is `{"jsonrpc":"2.0","id":1,"result":"0xb626"}`; `0xb626` is the hexadecimal chain ID, which is 46630 in decimal. The template reads the chain entry from `GET /v1/chains` and builds a viem client from it, so the chain name and ID are not hard-coded. From `src/shared.ts`: ```ts import { createPublicClient, defineChain, http, webSocket } from "viem"; export const API_BASE = "https://api.blockvectra.com/v1"; export interface ChainEntry { chain: string; name: string; chain_id: number; data: boolean; ws: boolean; subscriptions: string[]; public?: { url: string }; } export async function getChain(slug: string): Promise { const res = await fetch(`${API_BASE}/chains`); if (!res.ok) throw new Error(`GET /v1/chains failed: ${res.status}`); const { chains } = (await res.json()) as { chains: ChainEntry[] }; const entry = chains.find((c) => c.chain === slug); if (!entry) throw new Error(`${slug} not found in /v1/chains`); return entry; } export function toViemChain(entry: ChainEntry, rpcUrl: string) { return defineChain({ id: entry.chain_id, name: entry.name, nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, rpcUrls: { default: { http: [rpcUrl] } }, }); } export function httpClient(entry: ChainEntry, url: string, apiKey?: string) { return createPublicClient({ chain: toViemChain(entry, url), transport: http(url, apiKey ? { fetchOptions: { headers: { "x-api-key": apiKey } } } : undefined), }); } export function wsClient(entry: ChainEntry, apiKey: string) { const base = "wss://api.blockvectra.com/v1"; const url = `${base}/${entry.chain}/${apiKey}`; return createPublicClient({ chain: toViemChain(entry, url), transport: webSocket(url) }); } ``` The template’s `src/step1-public-read.ts` validates the catalog chain ID, then compares it with `eth_chainId` before reading the latest block and an address balance. Invalid catalog metadata or a mismatched network stops step 1 with a non-zero exit; `npm run walkthrough` then stops before sign-up: ```ts import { formatEther, type Address } from "viem"; import { API_BASE, getChain, httpClient } from "./shared.js"; // Step 1: no account, no key. Read Robinhood Chain Testnet through the public endpoint. const SLUG = "robinhood_testnet"; // Any address works; override with the first CLI argument. const address = (process.argv[2] ?? "0x0000000000000000000000000000000000000000") as Address; const chain = await getChain(SLUG); if (!Number.isSafeInteger(chain.chain_id) || chain.chain_id <= 0) { throw new Error( `invalid catalog chain_id for ${SLUG}: expected a positive safe integer, got ${String(chain.chain_id)}`, ); } const client = httpClient(chain, `${API_BASE}/${SLUG}/public`); // Confirm the network before any other read. const chainId = await client.getChainId(); if (chainId !== chain.chain_id) { throw new Error( `chain ID mismatch for ${SLUG}: expected ${chain.chain_id} (catalog), actual ${chainId} (eth_chainId)`, ); } const [blockNumber, balance] = await Promise.all([ client.getBlockNumber(), client.getBalance({ address }), ]); console.log(`chain : ${chain.name} (${SLUG})`); console.log(`eth_chainId : ${chainId} (0x${chainId.toString(16)})`); console.log(`block : ${blockNumber}`); console.log(`balance : ${formatEther(balance)} ETH (${address})`); ``` ## Step 2: open an account programmatically and subscribe to logs `src/step2-key-and-logs.ts` signs in with a wallet (SIWE, EIP-191) at `https://console-api.blockvectra.com/v1`. A first sign-in creates the account; the client then creates an API key. New accounts get 30,000,000 CU on sign-up — no credit card. ```ts import { loadOrCreateWallet } from "./wallet.js"; const CONSOLE_API = "https://console-api.blockvectra.com/v1"; const REF = "gh-robinhood-testnet-starter"; async function post(path: string, body: unknown, token?: string): Promise { const res = await fetch(`${CONSOLE_API}${path}`, { method: "POST", headers: { "Content-Type": "application/json", ...(token ? { Authorization: `Bearer ${token}` } : {}) }, body: JSON.stringify(body), }); if (!res.ok) throw new Error(`${path} failed: ${res.status} ${await res.text()}`); return (await res.json()) as T; } async function provisionKey(): Promise { const { account } = loadOrCreateWallet({ walletFile: ".agent-wallet.json", privateKey: process.env.WALLET_PRIVATE_KEY, }); console.log(`wallet: ${account.address}`); // SIWE: ask for a challenge, sign it verbatim (EIP-191), log in. A first sign-in creates the account. const { message } = await post<{ message: string }>("/auth/siwe/challenge", { address: account.address, purpose: "login", }); const signature = await account.signMessage({ message }); const login = await post<{ session: { token: string }; account_created: boolean }>("/auth/siwe/login", { message, signature, ref: REF, }); console.log(`account_created: ${login.account_created}`); const created = await post<{ api_key: string }>("/keys", { label: "robinhood-testnet-starter" }, login.session.token); return created.api_key; } const apiKey = process.env.BLOCKVECTRA_API_KEY?.trim() || (await provisionKey()); ``` With a non-empty `BLOCKVECTRA_API_KEY`, step2 skips login and any wallet-file read or creation. Otherwise `WALLET_PRIVATE_KEY` takes precedence; an invalid value stops the run instead of falling back to the file. Without it, the first run saves a dedicated login wallet in `.agent-wallet.json` in the current directory, and later runs there reuse the same identity. A first sign-in for that wallet creates the account. The implementation is in [`src/wallet.ts`](https://github.com/blockvectra/robinhood-testnet-starter/blob/f5aaaebaca69ccfc9858af9858f715db697d4913/src/wallet.ts). The file contains a plaintext private key, is created with POSIX mode `0600`, and matches `*wallet*.json`, so Git ignores it. Protect and back it up, do not commit it, do not put the key on the command line, and do not use a wallet holding funds. A damaged, invalid, unreadable, or unwritable identity stops step2 before its SIWE challenge without overwriting the file or switching to a new identity; walkthrough still performs step1 public reads first. Without an existing API key, every run creates another server-side key, keys are not automatically revoked, and reusing the account does not reuse its keys. The WebSocket URL puts the key in the path: `wss://api.blockvectra.com/v1/robinhood_testnet/{api_key}`. The template checks the live `ws` flag and the `subscriptions` list from `GET /v1/chains` before subscribing: Run the template's [subscription implementation](https://github.com/blockvectra/robinhood-testnet-starter/blob/f5aaaebaca69ccfc9858af9858f715db697d4913/src/step2-key-and-logs.ts) from this checkout. It starts the 30-second window only after `eth_subscribe` returns a subscription ID, then requires `eth_unsubscribe` to return `true`. Connection or subscription errors, or a failed unsubscribe, stop the walkthrough before mainnet; an empty log window alone does not prove success. ```bash npm run step2 ``` Every `logs` subscription filter must include an `address` or a `topic0`; replace the example address with the contract you want to watch. See the [WebSocket subscriptions guide](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) for filter rules, close codes, and reconnection. ## Step 3: switch the same key to mainnet For a standalone mainnet read, export an existing API key and run step 3. It does not inherit a key from a finished step 2 process; use `npm run walkthrough` for the automatic handoff. The script uses `robinhood_mainnet` and calls [the mainnet reader](https://github.com/blockvectra/robinhood-testnet-starter/blob/main/src/mainnet-read.ts) for the block number and Robinhood stock-token Data API. ```bash export BLOCKVECTRA_API_KEY=YOUR_EXISTING_API_KEY npm run step3 ``` The same leaderboard endpoint in curl: ```bash curl -s -H "x-api-key: $BLOCKVECTRA_API_KEY" \ "https://api.blockvectra.com/v1/data/robinhood_mainnet/stocks" ``` The Data API is mainnet-only: `GET /v1/chains` reports `data: false` for `robinhood_testnet` and `data: true` for `robinhood_mainnet`. For request parameters and response envelopes, see the [Tokenized stocks guide](https://docs.blockvectra.com/en/guides/stocks/). ## Discover limits and capabilities from the API Read `GET /v1/chains` for the live `jsonrpc`, `data`, `ws`, and `subscriptions` flags, the allowed JSON-RPC methods, log block ranges, state retention, and each chain's public endpoint. Read `GET /v1/plans` for current prices and plan limits. ```bash curl -s "https://api.blockvectra.com/v1/chains" ``` ## Related guides * [Find the testnet RPC URL and limits](https://blockvectra.com/en/chains/robinhood_testnet/). * [Claim test ETH from the testnet faucet](https://docs.blockvectra.com/en/guides/robinhood-testnet-faucet/) before sending transactions. ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # Simulate before you send: dry-running transactions with eth_simulateV1 Source: https://docs.blockvectra.com/en/guides/simulate-transactions/ Before broadcasting transactions to a blockchain network, dry-running them allows developers to inspect execution results, verify contract state transitions, and observe event logs in advance, avoiding unnecessary gas fees caused by contract reverts. The Ethereum execution layer provides several ways to evaluate transactions before sending: * `eth_call`: Executes a single read-only message call without state persistence across successive calls. * `eth_estimateGas`: Calculates the gas limit required for execution, but does not provide multi-transaction sequential state transitions or full event logs. * `eth_simulateV1`: Defined in the Ethereum Execution APIs standard specification, this method allows sequential simulation of multiple transactions across blocks, accumulates state changes between transactions, and supports overriding block parameters and account state. ## Supported chains and method policy Network capabilities are published dynamically via `GET /v1/chains`. Read `methods.allow` from that response to see which chains allow `eth_simulateV1`; a chain where it is not listed rejects the call with JSON-RPC error `-32601` (`method not available`, not billed). ### Node state conditions `eth_simulateV1` is a state query method: * **Sync gate (`-32010`)**: When the target chain's node is syncing and not yet ready, the call returns `-32010` (`node is syncing`, not billed). * **State window (`-32011`)**: On Robinhood Chain, requests targeting blocks older than the chain's `state_window_blocks` (`GET /v1/chains`), or specifying `safe`, `finalized`, or `earliest` block tags, return `-32011` (not billed). The default block tag is `latest`. ## Request structure and basic example According to the execution layer specification ([Ethereum Execution APIs eth\_simulateV1 definition](https://ethereum.github.io/execution-apis/api/methods/eth_simulateV1)), `eth_simulateV1` accepts two positional parameters: 1. **Payload object**: * `blockStateCalls` (required array): An array of simulated block objects. Each object contains an array of transaction calls `calls`, optional block header overrides `blockOverrides`, and optional account state overrides `stateOverrides`. * `validation` (optional boolean, default `false`): When `false`, behaves like `eth_call`; when `true`, runs all EVM validation except signature checks. * `traceTransfers` (optional boolean): When `true`, returns event logs for native token transfers. 2. **Block tag** (optional string, default `'latest'`): Block number, block hash, or block tag. ### Basic example: dry-running an ERC-20 transfer The following example dry-runs an ERC-20 `transfer(address,uint256)` call on Robinhood Chain. Replace `$BLOCKVECTRA_API_KEY` with your actual API key: **cURL** ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -s "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H "Content-Type: application/json" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "eth_simulateV1", "params": [ { "blockStateCalls": [ { "calls": [ { "from": "0x1111111111111111111111111111111111111111", "to": "0x2222222222222222222222222222222222222222", "data": "0xa9059cbb00000000000000000000000033333333333333333333333333333333333333330000000000000000000000000000000000000000000000000de0b6b3a7640000", "value": "0x0" } ] } ] }, "latest" ] }' ``` **TypeScript (viem)** ```ts import { createPublicClient, http } from "viem"; const apiKey = process.env.BLOCKVECTRA_API_KEY!; const client = createPublicClient({ transport: http(`https://api.blockvectra.com/v1/robinhood_mainnet/${apiKey}`), }); // Call eth_simulateV1 directly via viem's client.request const simulationResult = await client.request({ method: "eth_simulateV1" as any, params: [ { blockStateCalls: [ { calls: [ { from: "0x1111111111111111111111111111111111111111", to: "0x2222222222222222222222222222222222222222", data: "0xa9059cbb00000000000000000000000033333333333333333333333333333333333333330000000000000000000000000000000000000000000000000de0b6b3a7640000", value: "0x0", }, ], }, ], }, "latest", ], }); console.log(simulationResult); ``` ### Inspecting the response structure Under the Ethereum execution specification, the `result` field contains an array of simulated block results with the following schema: #### Block-level fields * `number`: Block number of the simulated block (hex string). * `hash`: Simulated block hash (32-byte hex string). * `parentHash`: Hash of the parent block. * `miner`: Fee recipient of the simulated block (20-byte hex address prefixed with `0x`). * `timestamp`: Block timestamp (hex string). * `gasLimit`: Block gas limit. * `gasUsed`: Total gas consumed across all simulated calls in this block. * `baseFeePerGas`: Base fee per gas for the block. * Other block header fields returned by the chain node depend on that node implementation. * `calls`: Array of execution results for each simulated call. #### Call-level fields (`calls` array items) * `status`: Call status as a hex string. `0x1` indicates success, while `0x0` indicates failure or revert. * `gasUsed`: Actual gas consumed by this call (hex string). * `maxUsedGas` (optional): Peak gas used during execution before refunds. * `returnData`: Hex-encoded return data. On a successful ERC-20 transfer, this contains boolean `true`; on revert, it contains the error selector or revert data. * `logs`: Array of event logs emitted by the call. On success, contains event logs such as `Transfer`: * `address`: Contract address that emitted the event. * `topics`: Array of 32-byte topic hashes (`topics[0]` is the event signature hash, such as the `Transfer` event signature). * `data`: Hex-encoded non-indexed event data. * `blockNumber`, `blockHash`, `transactionHash`, `transactionIndex`, `logIndex`, `removed`. * `error` (present on failure): Object containing `code` (`3` for a revert, `-32015` for a VM error) and `message` (such as `execution reverted`). ## Pricing and CU weights BlockVectra measures consumption in Compute Units (CU). The weight for each JSON-RPC method is published dynamically by `GET /v1/plans`: **CU weight per call** | Method | CU per call | | --- | --- | | `eth_simulateV1` | 20 | | `eth_call` | 15 | | `eth_estimateGas` | 20 | For unit conversion formulas and top-up details, visit the [Pricing page](https://blockvectra.com/en/pricing/). Requests rejected — including node syncing (`-32010`), outside state window (`-32011`), or method not available (`-32601`) — are not billed. See [Which requests are free](https://docs.blockvectra.com/en/guides/billing-rules/) for complete billing rules. ## Using with AI Agents and MCP Autonomous AI Agents can invoke `eth_simulateV1` directly through BlockVectra's Model Context Protocol (MCP) server. The keyed `rpc_call` tool allows executing JSON-RPC methods on supported chains. The API key must be configured in the MCP client HTTP headers (`x-api-key: {api_key}` or `Authorization: Bearer {api_key}`), never passed inside tool parameters or conversation prompts. Example `rpc_call` tool invocation payload on Robinhood Chain: ```json { "chain": "robinhood_mainnet", "method": "eth_simulateV1", "params": [ { "blockStateCalls": [ { "calls": [ { "from": "0x1111111111111111111111111111111111111111", "to": "0x2222222222222222222222222222222222222222", "data": "0xa9059cbb00000000000000000000000033333333333333333333333333333333333333330000000000000000000000000000000000000000000000000de0b6b3a7640000", "value": "0x0" } ] } ] }, "latest" ] } ``` Agents can check `status === "0x1"` to verify contract interaction validity and assess gas consumption before submitting raw transactions. For setup and usage instructions, see the [AI Agent integration guide](https://docs.blockvectra.com/en/guides/ai-agents/). ## Next steps * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # How to Monitor USDT / USDC Payments with Webhooks and RPC Source: https://docs.blockvectra.com/en/guides/stablecoin-payments/ For stablecoin payment monitoring or exchange deposit detection, monitor incoming ERC-20 USDT / USDC transfers on EVM chains using Webhooks, WebSocket logs or HTTP polling. Developers and AI agents use the same APIs; select the chain, token contract, recipient and confirmation depth before processing payments. Choose a deposit, merchant-notification or payout workflow in the [USDT / USDC transfer monitoring solution](https://blockvectra.com/en/use-cases/stablecoin-payments/). * **First step:** [Create a subscription and watch the recipient](https://docs.blockvectra.com/en/guides/stablecoin-payments/#create-a-subscription-and-watch-the-recipient), starting with an API key and your HTTPS receiver. * **Done when:** A matching transfer passes signature, chain, token, recipient and integer-amount checks, is stored once as a payment candidate, and the receiver returns HTTP `204`; verify it on-chain under your confirmation policy before crediting it. [Stablecoin payment workflows](https://blockvectra.com/en/use-cases/stablecoin-payments/). Basic transfer monitoring is available. Amount and token filtering runs in your receiver. Server-side conditions, multiple confirmation stages and IM alerts are coming soon. For developers and AI Agents: start with an [API key](https://console.blockvectra.com/login/?next=%2Fkeys%2F) and your own HTTPS receiver; filter token contracts and amounts in your application. [Copy the webhook setup](https://docs.blockvectra.com/en/guides/stablecoin-payments/#create-a-subscription-and-watch-the-recipient). ## Tasks this guide helps you complete * [Receive USDT / USDC payment notifications](https://docs.blockvectra.com/en/guides/stablecoin-payments/#receive-payments-with-webhooks) at your HTTPS endpoint after checking Push support for the selected chain. * [Validate a transfer candidate](https://docs.blockvectra.com/en/guides/stablecoin-payments/#verify-deduplicate-and-validate-payments) by checking its chain, token contract, recipient and integer amount before applying your on-chain verification and confirmation policy. * [Backfill missing transfer logs](https://docs.blockvectra.com/en/guides/stablecoin-payments/#cursor-polling-and-block-range-limits) with bounded `eth_getLogs` queries and a saved cursor. ## Choose Webhook, WebSocket or polling | Method | Use it for | Recovery | | ------------------------------------------------ | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | [Webhook](https://docs.blockvectra.com/en/guides/webhook-push/) | Address activity sent to your HTTPS receiver, including incoming token transfers | Verify signatures, deduplicate event IDs and handle `subscription.gap` / `chain.reorg`; replay retained matches | | [WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) | Filtered `logs` over a persistent connection | Reconnect, re-subscribe and backfill missed blocks | | HTTP polling | Scheduled monitoring or historical log backfill with your own cursor | Query bounded `eth_getLogs` ranges and persist progress | Read `ws` and `subscriptions` in the public `GET /v1/chains` response before choosing WebSocket. Push support is a separate check: read `GET /v1/push/chains` with your API key. A chain without WebSocket can use address Webhooks if it is listed there. Use polling when you need to scan earlier blocks or run without a persistent connection. ## Receive payments with Webhooks ### Create a subscription and watch the recipient [Get an API key](https://blockvectra.com/en/get-api-key/) and deploy an HTTPS receiver on port 443. Select `CHAIN` from the authenticated Push chain list, set `RECIPIENT` to your deposit address and `RECEIVER_URL` to your receiver URL. This shell example requires `jq`; `{}` uses the chain's default confirmation count. Inspect `min_confirmations`, `default_confirmations` and `max_confirmations` before choosing a different count. The [Push OpenAPI](https://docs.blockvectra.com/openapi/push.yaml) defines these requests. ```bash set -eu umask 077 : "${BLOCKVECTRA_API_KEY:?Set your API key}" : "${CHAIN:?Select a chain from the Push chain list}" : "${RECIPIENT:?Set the watched EVM recipient address}" : "${RECEIVER_URL:?Set your HTTPS receiver URL}" PUSH_URL='https://api.blockvectra.com/v1/push' curl --fail-with-body -sS "$PUSH_URL/chains" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" > push-chains.json jq -e --arg chain "$CHAIN" 'any(.chains[]; .chain == $chain)' push-chains.json jq -n --arg url "$RECEIVER_URL" --arg chain "$CHAIN" \ '{url: $url, chains: {($chain): {}}}' > create.json curl --fail-with-body -sS "$PUSH_URL/subscriptions" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -H 'Content-Type: application/json' -d @create.json > subscription.json SUBSCRIPTION_ID=$(jq -er '.id' subscription.json) jq -n --arg recipient "$RECIPIENT" '{addresses: [$recipient]}' > addresses.json curl --fail-with-body -sS "$PUSH_URL/subscriptions/$SUBSCRIPTION_ID/addresses/add" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -H 'Content-Type: application/json' -d @addresses.json > address-change.json curl --fail-with-body -sS "$PUSH_URL/subscriptions/$SUBSCRIPTION_ID" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` Creation returns `id` and `secret`. Store the secret securely for the receiver; `subscription.json` contains a credential. Poll the subscription until `applied_version >= change_version` from `address-change.json`, then record `chains[CHAIN].applied_from_block`. New addresses match from that block, so keep polling for any earlier payment interval. ### Verify, deduplicate and validate payments Save the [raw-body signature function](https://docs.blockvectra.com/en/guides/webhook-push/#verify-signatures) as `verify-push.js`. The receiver below accepts a Web API `Request` in Node.js and reads its original bytes before JSON parsing. Build `secrets` as a `Map` of subscription ID strings to stored secrets. Set trusted `expected` configuration to `{ chain, token, recipient, amountUnits }`: `token` is the verified stablecoin contract on that chain and `amountUnits` is the expected positive integer amount in its smallest units. Compare amounts with `BigInt`, never floating-point numbers or the token symbol. ```js import { verifyPush } from './verify-push.js'; export function selectPayment(data, event, expected) { if (data.chain !== expected.chain || event.type !== 'token.transfer' || event.standard !== 'erc20') return null; const address = value => typeof value === 'string' && /^0x[0-9a-fA-F]{40}$/.test(value); if (![event.token, event.to, expected.token, expected.recipient].every(address)) return null; if (event.token.toLowerCase() !== expected.token.toLowerCase() || event.to.toLowerCase() !== expected.recipient.toLowerCase()) return null; const integer = value => typeof value === 'string' && /^[1-9][0-9]{0,77}$/.test(value); if (!integer(event.amount) || !integer(expected.amountUnits)) return null; const amount = BigInt(event.amount); if (amount >= (1n << 256n) || amount !== BigInt(expected.amountUnits)) return null; if (typeof event.id !== 'string' || typeof event.ref !== 'string' || !/^0x[0-9a-f]{64}$/.test(event.tx_hash) || !/^0x[0-9a-f]{64}$/.test(event.block_hash) || !Number.isSafeInteger(event.log_index) || event.log_index < 0 || !Number.isSafeInteger(event.block_number) || event.block_number < 0) return null; return { eventId: event.id, ref: event.ref, chain: data.chain, token: event.token, recipient: event.to, amountUnits: event.amount, txHash: event.tx_hash, logIndex: event.log_index, blockHash: event.block_hash, blockNumber: event.block_number, }; } export async function receivePayments(request, expected, secrets, store) { const rawBody = Buffer.from(await request.arrayBuffer()); const headers = Object.fromEntries(request.headers); if (!verifyPush(rawBody, headers, secrets)) return new Response(null, { status: 401 }); let message; try { message = JSON.parse(rawBody.toString('utf8')); } catch { return new Response(null, { status: 400 }); } const data = message?.data; if (message?.type !== 'push.events' || !Number.isSafeInteger(data?.subscription_id) || data.subscription_id <= 0 || String(data.subscription_id) !== headers['bv-subscription-id'] || data.chain !== expected.chain || !Array.isArray(data.events)) { return new Response(null, { status: 400 }); } try { await store.transaction(async tx => { for (const event of data.events) { if (!event || typeof event.id !== 'string') continue; const recovery = event.type === 'subscription.gap' || event.type === 'chain.reorg'; const payment = selectPayment(data, event, expected); if (!recovery && !payment) continue; if (!await tx.insertEventOnce(data.subscription_id, event)) continue; if (recovery) await tx.enqueueRecovery(data.chain, event); else await tx.recordPaymentCandidate(payment); } }); } catch { return new Response(null, { status: 503 }); } return new Response(null, { status: 204 }); } ``` Implement `store.transaction` with durable storage. Within one transaction, `insertEventOnce` inserts an event under a unique `(subscription_id, event.id)` key and returns false for a duplicate; commit it together with `recordPaymentCandidate` or `enqueueRecovery`. Roll back all writes on failure so a retry can process the event. Recovery jobs must also be idempotent. Return 2xx within 10 seconds only after committing; enforce the 1 MiB body limit in your HTTP server. This example checks one expected payment amount. For multiple orders, look up trusted payment configuration by chain, token and recipient, and reconcile partial or excess payments under your own rules. A candidate still needs on-chain verification and your confirmation policy before crediting it. Across subscriptions and polling, reconcile the same transfer by chain, transaction hash and log index so two delivery paths do not credit it twice; retain the block hash to track replaced blocks. ### Recover missing or replaced blocks For `subscription.gap`, enqueue a scan of `from_block` through `to_block` using the polling path below or available Data API datasets. `chain.reorg` is a free notice that delivered blocks were replaced, not a delivery gap. Mark or discard old events in that range by `ref`; reconcile payment records by `ref` and `tx_hash` against the canonical chain before processing automatically redelivered canonical events with new IDs. Deduplicate those events by `id`. The reorg notice does not advance completed progress; record `complete_through_block` per chain, never infer completion from the largest event block number. [Replay](https://docs.blockvectra.com/en/guides/webhook-push/#delivery-retries-and-replay) accepts `chain` and `from_block` inside the current `replayable_from_block` boundary. It only resends retained matches; it does not scan periods before the address or chain was added, or periods when the subscription was offline. Keep a polling cursor to cover those intervals and expired gaps. Request failures and invalid replay ranges are covered in the [error reference](https://docs.blockvectra.com/en/errors/); delivery, history and address-day charges are explained in [billing rules](https://docs.blockvectra.com/en/guides/billing-rules/#webhook-push-billing). The remaining sections implement ERC-20 log filtering and cursor-based polling for monitoring and recovery. ## Transfer Event and Filter Parameters Standard ERC-20 token contracts emit the following event on every transfer: ```solidity event Transfer(address indexed from, address indexed to, uint256 value); ``` When calling `eth_getLogs`, pass the token contract address and the `topics` array to filter matching logs: | Parameter | Value | Description | | ----------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `address` | Token contract address (or array of addresses) | Target stablecoin contract address. You can specify a single address (e.g. BSC USDT `0x55d398326f99059fF775485246999027B3197955`, Base USDC `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`), or an array of addresses to monitor multiple tokens concurrently | | `topics[0]` | `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef` | Event signature hash: `keccak256("Transfer(address,address,uint256)")` | | `topics[1]` | `null` | Sender address (`from`). Because deposit monitoring accepts funds from any user wallet, pass `null` to match any sender | | `topics[2]` | 32-byte zero-padded recipient address | Destination address (`to`). Under EVM log specifications, `indexed` address parameters occupy 32 bytes (64 hex characters). Left-pad the 20-byte recipient address with 12 zero bytes (24 hexadecimal zero characters) to form a 32-byte topic. | | `fromBlock` | Starting block (hexadecimal) | Beginning of the query block range (inclusive) | | `toBlock` | Ending block (hexadecimal) | End of the query block range (inclusive) | The unindexed `value` (transfer amount) is encoded in the log object's `data` field as a 32-byte hexadecimal `uint256`. Divide this raw amount by 10^decimals to get the human-readable token amount (e.g. 18 decimals for BSC USDT; 6 decimals for Base and Ethereum USDC). ## Cursor Polling and Block Range Limits A polling service queries new blocks at regular intervals (such as every 3 to 5 seconds). ### Cursor Advancement Maintain a persistent cursor `last_polled_block` (the highest block processed and committed) in your database: 1. For each polling cycle, set `fromBlock = last_polled_block + 1`. 2. Query the current chain head via `eth_blockNumber`, and calculate the safe target height `safe_head` based on your confirmation depth. 3. If `fromBlock <= safe_head`, query logs in chunks up to `safe_head`. After successfully processing each chunk, advance the cursor. ### Block Range Limit The block span of a single `eth_getLogs` call is calculated as `toBlock − fromBlock + 1`. It must not exceed the `max_logs_block_range` published for that chain in `GET /v1/chains`. If a request exceeds this range, the service rejects the call with error code `-32602`: ```json { "jsonrpc": "2.0", "id": 1, "error": { "code": -32602, "message": "eth_getLogs block range too large: max 1000 blocks", "data": { "reason": "logs_range_too_large", "docs_url": "https://docs.blockvectra.com/en/errors/#logs_range_too_large", "retryable": false } } } ``` Requests exceeding the block range return JSON-RPC error `-32602` (not billed). In your application logic, read `max_logs_block_range` from `GET /v1/chains` and clamp each poll slice: `chunk_end = min(fromBlock + max_logs_block_range - 1, safe_head)`. ## Handling Block Reorganizations and Confirmation Depth Near the tip of the blockchain, temporary block reorganizations (reorgs) can occur. Crediting payments at `latest` without confirmation depth risks crediting transactions on an orphaned branch that is subsequently discarded. Apply the following safeguards to protect payment processing: ### Confirmation Depth Instead of querying up to `latest`, query up to a safe target block height: `safe_head = current_head - CONFIRMATION_DEPTH` Set `CONFIRMATION_DEPTH` according to your application's risk tolerance. Querying only up to `safe_head` ensures only blocks with sufficient confirmations are processed. ### Reorganizations during Polling Standard EVM JSON-RPC sets `removed: true` on log objects only in WebSocket logs subscription streams when a previously emitted event is reverted due to a chain reorg. When polling over HTTP with `eth_getLogs`, queries return logs from the canonical chain; reorged logs will simply not appear in subsequent queries. Polling within `safe_head` ensures payments are processed only on sufficiently confirmed blocks. ## Deduplication by (transactionHash, logIndex) Payment listeners must enforce strict idempotency: 1. **Multiple Transfers in One Transaction**: A single transaction can contain multiple `Transfer` events to the same deposit address (for example, token routers splitting swaps or multi-payout contracts). **Important:** `transactionHash` alone is not unique per payment. 2. **Overlapping Polling & Retries**: When polling services restart, recover from transient network errors, or rewind several blocks to handle shallow reorgs, logs from the same block range are queried multiple times. 3. **Log Index Uniqueness**: The `logIndex` identifies the relative position of the event log within the block. Under EVM specifications, the canonical composite unique identifier for an event is `(transactionHash, logIndex)`. In relational database schemas, declare a composite unique index on your deposit records table: ```sql CREATE UNIQUE INDEX idx_transfers_tx_log ON deposit_records (transaction_hash, log_index); ``` Before processing a deposit, check against existing `(transactionHash, logIndex)` entries to guarantee that each on-chain transfer is credited exactly once. ## Complete Code Examples The examples below illustrate fetching network capabilities from `/v1/chains`, calculating safe block ranges, polling stablecoin `Transfer` logs in compliance with range limits, and deduplicating events. **TypeScript** ```ts import { createPublicClient, formatUnits, http, parseAbiItem } from "viem"; const apiKey = process.env.BLOCKVECTRA_API_KEY; if (!apiKey) { throw new Error("BLOCKVECTRA_API_KEY environment variable is not set"); } const CHAIN = "bsc_mainnet"; const RPC_URL = "https://api.blockvectra.com/v1/bsc_mainnet"; const CHAINS_URL = "https://api.blockvectra.com/v1/chains"; // Target stablecoin contract address (BSC USDT used in this example) const TOKEN_CONTRACT = "0x55d398326f99059fF775485246999027B3197955" as const; const TOKEN_DECIMALS = 18; // Monitored deposit address const RECIPIENT_ADDRESS = "0xdded13D555B6DA811103cC1794D3d4330F69632C" as const; // Confirmation depth to guard against chain reorgs const CONFIRMATION_DEPTH = 15n; // 1. Fetch chain capabilities from public metadata endpoint (unauthenticated, unbilled) const chainsRes = await fetch(CHAINS_URL); const { chains } = (await chainsRes.json()) as { chains: Array<{ chain: string; ws: boolean; subscriptions: string[]; max_logs_block_range: number; }>; }; const chainConfig = chains.find((c) => c.chain === CHAIN); if (!chainConfig) { throw new Error(`Chain ${CHAIN} not found in /v1/chains`); } const maxLogsRange = BigInt(chainConfig.max_logs_block_range || 1000); console.log(`Chain: ${CHAIN} | WebSocket supported: ${chainConfig.ws} | Max logs range: ${maxLogsRange}`); // 2. Initialize viem client with x-api-key header const client = createPublicClient({ transport: http(RPC_URL, { fetchOptions: { headers: { "x-api-key": apiKey }, }, }), }); // Set to track processed events by composite key: (transactionHash, logIndex) const processedLogs = new Set(); // 3. Compute query range: subtract confirmation depth from current head const currentHead = await client.getBlockNumber(); const safeHead = currentHead - CONFIRMATION_DEPTH; // For demonstration, start cursor 10 blocks before safeHead let cursor = safeHead > 10n ? safeHead - 10n : 0n; console.log(`Current head: ${currentHead} | Safe head: ${safeHead} | Polling cursor: ${cursor}`); while (cursor <= safeHead) { const chunkEnd = cursor + maxLogsRange - 1n < safeHead ? cursor + maxLogsRange - 1n : safeHead; const logs = await client.getLogs({ address: TOKEN_CONTRACT, event: parseAbiItem( "event Transfer(address indexed from, address indexed to, uint256 value)" ), args: { to: RECIPIENT_ADDRESS, }, fromBlock: cursor, toBlock: chunkEnd, }); for (const log of logs) { const dedupKey = `${log.transactionHash}-${log.logIndex}`; if (processedLogs.has(dedupKey)) { continue; } processedLogs.add(dedupKey); const tokenAmount = formatUnits(log.args.value ?? 0n, TOKEN_DECIMALS); console.log( `[Payment Received] Amount: ${tokenAmount} | ` + `Tx: ${log.transactionHash} | Log: ${log.logIndex} | Block: ${log.blockNumber}` ); } cursor = chunkEnd + 1n; } // Run with: npx tsx example.mts ``` **Python** ```python from decimal import Decimal import os import requests api_key = os.environ.get("BLOCKVECTRA_API_KEY") if not api_key: raise RuntimeError("BLOCKVECTRA_API_KEY environment variable is not set") CHAIN = "bsc_mainnet" RPC_URL = "https://api.blockvectra.com/v1/bsc_mainnet" CHAINS_URL = "https://api.blockvectra.com/v1/chains" # Target stablecoin contract address (BSC USDT used in this example) TOKEN_CONTRACT = "0x55d398326f99059fF775485246999027B3197955" TOKEN_DECIMALS = 18 # Monitored deposit address RECIPIENT_ADDRESS = "0xdded13D555B6DA811103cC1794D3d4330F69632C" # Transfer(address,address,uint256) signature hash TRANSFER_TOPIC0 = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" # Left-pad 20-byte address to 32 bytes (64 hex characters) padded_recipient = f"0x{RECIPIENT_ADDRESS.lower()[2:].rjust(64, '0')}" # Confirmation depth to guard against chain reorgs CONFIRMATION_DEPTH = 15 # 1. Fetch chain capabilities from public metadata endpoint (unauthenticated, unbilled) chains_res = requests.get(CHAINS_URL, timeout=10) chains_res.raise_for_status() chain_list = chains_res.json().get("chains", []) chain_config = next((c for c in chain_list if c["chain"] == CHAIN), None) if not chain_config: raise RuntimeError(f"Chain {CHAIN} not found in /v1/chains") max_logs_range = chain_config.get("max_logs_block_range", 1000) ws_supported = chain_config.get("ws", False) print(f"Chain: {CHAIN} | WebSocket supported: {ws_supported} | Max logs range: {max_logs_range}") def rpc_request(method: str, params: list): res = requests.post( RPC_URL, headers={ "Content-Type": "application/json", "x-api-key": api_key, }, json={"jsonrpc": "2.0", "id": 1, "method": method, "params": params}, timeout=15, ) res.raise_for_status() payload = res.json() if "error" in payload: err = payload["error"] raise RuntimeError(f"JSON-RPC error {err.get('code')}: {err.get('message')}") return payload["result"] # 2. Query latest block number and calculate safe head current_head_hex = rpc_request("eth_blockNumber", []) current_head = int(current_head_hex, 16) safe_head = max(0, current_head - CONFIRMATION_DEPTH) # For demonstration, start cursor 10 blocks before safe_head cursor = max(0, safe_head - 10) print(f"Current head: {current_head} | Safe head: {safe_head} | Polling cursor: {cursor}") # In-memory deduplication set using (transactionHash, logIndex) processed_logs = set() while cursor <= safe_head: chunk_end = min(cursor + max_logs_range - 1, safe_head) logs = rpc_request( "eth_getLogs", [ { "address": TOKEN_CONTRACT, "fromBlock": hex(cursor), "toBlock": hex(chunk_end), "topics": [ TRANSFER_TOPIC0, None, # match any sender padded_recipient, # match monitored recipient ], } ], ) for log in logs: tx_hash = log["transactionHash"] log_index = int(log["logIndex"], 16) dedup_key = (tx_hash, log_index) if dedup_key in processed_logs: continue processed_logs.add(dedup_key) raw_amount = int(log["data"], 16) token_amount = Decimal(raw_amount) / (Decimal(10) ** TOKEN_DECIMALS) block_number = int(log["blockNumber"], 16) print( f"[Payment Received] Amount: {token_amount} | " f"Tx: {tx_hash} | Log: {log_index} | Block: {block_number}" ) cursor = chunk_end + 1 # Run with: python example.py ``` ## Billing Rules and Related Guides * For details on request metering, CU weights, and error code billing determinations, see [Billing Rules: Errors and Non-Billed Requests](https://docs.blockvectra.com/en/guides/billing-rules/). * For in-depth guidance on `eth_getLogs` block range limits and chunking logic, see [eth\_getLogs Block Range Limits and Chunked Queries](https://docs.blockvectra.com/en/guides/getlogs-block-range/). * For differences between real-time RPC node queries and indexed historical transfer APIs, see [Head-of-Chain vs Indexed History: When to Use eth\_getLogs vs Transfers](https://docs.blockvectra.com/en/guides/logs-vs-transfers/). ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # Robinhood Chain stock tokens: reading the multiplier, holders and daily activity with one API key Source: https://docs.blockvectra.com/en/guides/stock-token-multiplier/ > Data is derived from public on-chain records and smart contract state. It is for informational purposes only and does not constitute investment advice. Stock tokens carry jurisdictional restrictions. Robinhood Chain supports tokenized real-world assets (RWAs), including tokenized US equities and exchange-traded funds (ETFs). While standard ERC-20 tokens map balances 1:1, tokenized stocks introduce a corporate-action multiplier to accommodate stock splits and dividend adjustments without changing wallet balances. This guide explains how the stock token multiplier operates, how to convert raw token balances into underlying share counts, how to query `uiMultiplier` on-chain using JSON-RPC `eth_call`, and how to retrieve daily holders and transfer activity through the BlockVectra Data API. For broad network parameters, method policies, and RPC setup, see the [Robinhood Chain guide](https://docs.blockvectra.com/en/guides/robinhood-chain/). For comprehensive field references and Compute Unit (CU) usage models for the dataset, see the [Tokenized stocks guide](https://docs.blockvectra.com/en/guides/stocks/). ## What is the stock token multiplier Robinhood stock tokens are standard ERC-20 tokens (with 18 decimals) issued by Robinhood Assets (Jersey) Limited (RHJ). To handle corporate actions such as stock splits and reinvested dividends, these contracts implement **ERC-8056 (Scaled UI Amount Extension)**. The multiplier (`uiMultiplier`) defines the `shares-per-token` ratio: * **Precision**: `uiMultiplier()` is represented as an 18-decimal fixed-point number, where `1e18` equals `1.0`. * **Initial value**: At token issuance, the multiplier is initialized to `1e18` (one token represents one underlying share). * **Corporate actions**: When a corporate event takes place (such as a forward stock split or a reinvested dividend), the token contract updates `uiMultiplier` and emits the `UIMultiplierUpdated(uint256 oldMultiplier, uint256 newMultiplier, uint256 effectiveAtTimestamp)` event. ### Fixed token balances during splits Stock tokens are **not rebasing tokens**. During corporate actions: * Wallet balances (`balanceOf(account)`) and total token issuance (`totalSupply()`) **remain unchanged**. * Only the scaling multiplier changes. For example, if an underlying stock executes a 2-for-1 forward split: * A holder who owns 10 tokens continues to hold 10 tokens in `balanceOf`. * The contract updates `uiMultiplier` from `1.0` (`1e18`) to `2.0` (`2e18`). * Each token now represents 2 underlying shares, giving the holder an effective exposure of 20 shares. ### Converting balances to share count To compute the number of underlying shares represented by a token balance, use the ERC-8056 formula: ```text underlying shares = raw token amount × uiMultiplier ÷ 1e18 ``` ERC-8056 token contracts also expose read-only helper functions on-chain: * `balanceOfUI(address account)`: Directly returns the account's balance expressed in underlying shares (scaled by `uiMultiplier`, 18 decimals). * `totalSupplyUI()`: Directly returns the total token supply expressed in underlying shares. In addition, token transfers emit the `TransferWithScaledUI(address indexed from, address indexed to, uint256 value, uint256 uiValue)` event, recording both the raw token amount and the scaled underlying-share count. ### Multiplier and oracle price feeds Robinhood Chain deploys a dedicated Chainlink price feed (`AggregatorV3Interface`) for each stock token: * The Chainlink price feed (`latestRoundData()`) **already incorporates the multiplier**. It reflects the full market price of one token (underlying share price multiplied by the multiplier). * Applications reading the on-chain Chainlink oracle receive the multiplier-adjusted price directly and **must not** apply the multiplier a second time. * Off-chain metadata can also be checked via Robinhood's REST endpoint `GET https://api.robinhood.com/rhj/assets`, which provides `currentMultiplier` and `pendingMultiplier`. ## Reading the multiplier with JSON-RPC eth\_call You can inspect the multiplier of any tokenized stock directly via BlockVectra's JSON-RPC endpoint for Robinhood Chain using `eth_call`. * **Function**: `uiMultiplier()` * **4-byte function selector**: `0xa60bf13d` (`bytes4(keccak256("uiMultiplier()"))`) * **Return format**: 32-byte hex-encoded `uint256` (18-decimal fixed-point value) BlockVectra serves Robinhood Chain JSON-RPC requests under `https://api.blockvectra.com/v1/robinhood_mainnet`. Pass your API key via the `x-api-key` header or append it to the path (`https://api.blockvectra.com/v1/robinhood_mainnet/{api_key}`). ### Code examples The examples below query `uiMultiplier()` on the Everpure stock token contract (`0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D`): **cURL** ```bash curl -s "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H "Content-Type: application/json" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "eth_call", "params": [ { "to": "0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D", "data": "0xa60bf13d" }, "latest" ] }' ``` **viem (TypeScript)** ```ts import { createPublicClient, defineChain, http, parseAbi } from "viem"; const robinhoodMainnet = defineChain({ id: 4663, name: "Robinhood Chain", nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, rpcUrls: { default: { http: ["https://api.blockvectra.com/v1/robinhood_mainnet"] }, }, }); const client = createPublicClient({ chain: robinhoodMainnet, transport: http("https://api.blockvectra.com/v1/robinhood_mainnet", { fetchOptions: { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }, }), }); const stockTokenAbi = parseAbi([ "function uiMultiplier() external view returns (uint256)", "function balanceOfUI(address account) external view returns (uint256)", "function balanceOf(address account) external view returns (uint256)", ]); const tokenAddress = "0x1Cdad396DB64BDa184d5182A97Dd9B3C62100b7D"; // 1. Read the corporate-action multiplier (18 decimals, 1e18 = 1.0) const multiplier = await client.readContract({ address: tokenAddress, abi: stockTokenAbi, functionName: "uiMultiplier", }); console.log("uiMultiplier (raw uint256):", multiplier.toString()); // 2. Read raw balance and convert to underlying shares const holderAddress = "0x0000000000000000000000000000000000000001"; const rawBalance = await client.readContract({ address: tokenAddress, abi: stockTokenAbi, functionName: "balanceOf", args: [holderAddress], }); const underlyingShares = (rawBalance * multiplier) / 10n ** 18n; console.log("Calculated underlying shares:", underlyingShares.toString()); // 3. Or read pre-scaled shares directly using balanceOfUI const directShares = await client.readContract({ address: tokenAddress, abi: stockTokenAbi, functionName: "balanceOfUI", args: [holderAddress], }); console.log("Direct balanceOfUI shares:", directShares.toString()); ``` ## Querying holders and daily activity with the Data API The BlockVectra Data API provides pre-indexed daily summaries for tokenized stocks. Use `GET /v1/data/robinhood_mainnet/stocks` for the daily activity leaderboard and `GET /v1/data/robinhood_mainnet/stocks/{token}` for one token's metadata and up to 30 days of daily metrics. For request parameters, response fields, and examples, see the [Tokenized stocks guide](https://docs.blockvectra.com/en/guides/stocks/). ## Regulatory notes Stock tokens are tokenised debt securities issued by Robinhood Assets (Jersey) Limited (RHJ). See the [Robinhood RHJ documentation](https://docs.robinhood.com/rhj) for prospectuses, final terms, and jurisdictional notices. ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # Stock token holders and transfers API on Robinhood Chain Source: https://docs.blockvectra.com/en/guides/stocks/ Query stock token transfers, holders and balances on Robinhood Chain (chain ID 4663) with one API key. ```text GET /v1/data/robinhood_mainnet/tokens/{token}/transfers?standard=erc20 — lists a token's transfers /tokens/{token}/holders — lists its holders /addresses/{address}/balances — lists a wallet's balances ``` `/stocks` ranks tokens by daily transfers and `holder_count`. Chain name and ID come from `GET /v1/chains`. Checked 2026-11-12 ```bash export BLOCKVECTRA_API_KEY='replace-with-your-key' curl -sS "https://api.blockvectra.com/v1/data/robinhood_mainnet/stocks?limit=5" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` | Question | Endpoint | Fields to read | | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------- | | Which stock tokens were most active, and how many holders do they have? | `GET /{chain}/stocks` | `transfers`, `holder_count` | | What are one token's daily metrics for the last 30 days? | `GET /{chain}/stocks/{token}` | `daily[]` | | What transfers did one token have? | `GET /{chain}/tokens/{token}/transfers?standard=erc20` | `from`, `to`, `amount`, `block_number`, `tx_hash` | | Who holds one token? | `GET /{chain}/tokens/{token}/holders` | `holder`, `balance` | | What does one wallet hold? | `GET /{chain}/addresses/{address}/balances` | `token`, `balance`, `symbol`, `decimals` | | What did one wallet send or receive of a token? | `GET /{chain}/addresses/{address}/transfers?standard=erc20&token=…&from_block=…&to_block=…` | `from`, `to`, `amount`, `block_number` | Stock tokens are ERC-20 contracts, so use `standard=erc20`. Amounts are decimal strings of the raw token amount; see the [multiplier guide](https://docs.blockvectra.com/en/guides/stock-token-multiplier/) to convert them to share counts. > Data is derived from public on-chain records and is for informational purposes only. It does not constitute investment advice. For contract deployment and event listening on Robinhood Chain, follow the [RPC and WebSocket guide](https://docs.blockvectra.com/en/guides/robinhood-chain/). * **First step:** [Read the latest block without an API key](https://docs.blockvectra.com/en/guides/stocks/#1-read-the-latest-block-without-an-api-key) using the curl command below. * **Done when:** The authenticated stocks query returns `data` and `meta`; available records include `day`, `token`, `transfers` and `holder_count`, while `data: []` means no activity records are available. [Mainnet parameters and datasets](https://blockvectra.com/en/chains/robinhood_mainnet/). ## Three-step task: query stock activity on Robinhood Chain Find the most active tokenized stocks on the latest recorded UTC day, then read their transfer counts and holder counts. Use one API key to query mainnet stock-token activity and holders for an activity dashboard. These are on-chain activity metrics, not stock quotes. ### 1. Read the latest block without an API key ```bash curl -sS "https://api.blockvectra.com/v1/robinhood_mainnet/public" \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' ``` The JSON-RPC `result` is the latest block number in hexadecimal. This public RPC call requires no key; the Data API query in step 3 requires one. ### 2. Create a key for the same chain [Log in to the console and open API Keys](https://console.blockvectra.com/login/?next=%2Fkeys%2F\&ref=docs-stocks-task). Create a key and save the secret shown in the dialog. The same key works for JSON-RPC and the Data API on `robinhood_mainnet`. For an AI Agent using HTTP without a browser, follow the [Programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/?ref=docs-stocks-task) to sign up with an Ethereum wallet signature and create a key; do not ask the user to paste the key into chat. ### 3. Query stock activity with your key Replace `replace-with-your-key` below with your saved key, then run the command on your server or in a local terminal. Omitting `day` selects the latest recorded day; `limit=5` returns up to five stocks ordered by transfer activity descending. ```bash export BLOCKVECTRA_API_KEY='replace-with-your-key' curl -sS "https://api.blockvectra.com/v1/data/robinhood_mainnet/stocks?limit=5" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` Read these fields in the response: | Field | Meaning | | --------------------- | --------------------------------------------------------------------------------- | | `data[].day` | UTC date of the daily metrics. | | `data[].token` | Stock token contract address returned by the query. | | `data[].symbol` | Token symbol. | | `data[].transfers` | Number of on-chain transfers on that day. | | `data[].holder_count` | Total holder address count. | | `meta.as_of_block` | Current indexed head, rather than the block height of the daily metrics snapshot. | | `meta.refreshed_at` | Snapshot update time; treat the data as stale when this is `null`. | An empty `data` array means no activity records are available. To inspect a stock from the result, use its `token` value with `GET /robinhood_mainnet/stocks/{token}` as described below. ## Transfers, holders and balances per token and wallet Set `TOKEN` to a `token` value from the `/stocks` response and `WALLET` to the address you track, then run: ```bash TOKEN='0x1111111111111111111111111111111111111111' WALLET='0x2222222222222222222222222222222222222222' # Transfers of one token, newest first curl -sS "https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens/$TOKEN/transfers?standard=erc20&limit=20" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" # Holders of one token, largest balance first curl -sS "https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens/$TOKEN/holders?limit=20" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" # Non-zero ERC-20 balances of one wallet curl -sS "https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/$WALLET/balances" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` * `limit` defaults to 50 and is clamped to 500; pass `next_cursor` back unchanged as `cursor` to read the next page. * Token transfers accept optional `from_block` and `to_block`. Wallet transfers require both, and a window wider than 100,000 blocks returns `409 window_too_large` unless `clamp=true`. * Holders and balances come from a snapshot refreshed every 6 hours, so rows can be about 6.5 hours old. Read the snapshot time from `meta.refreshed_at`; `null` means treat the data as stale. * An address without balances returns `200` with `data: []`. ## What is the tokenized stocks dataset The BlockVectra Data API provides daily on-chain metrics and metadata for tokenized stocks. This dataset aggregates daily transfers, mints, burns, net supply changes, holder distributions, and decentralized exchange (DEX) trading metrics, enabling developers to track public activity for tokenized stocks. For chains that offer this dataset, see the [Supported Chains](https://docs.blockvectra.com/en/chains/) page. * **Base URL**: `https://api.blockvectra.com/v1/data` — except for `GET /chains`, all Data API routes are prefixed with a chain identifier (e.g. `https://api.blockvectra.com/v1/data/{chain}/…`) * **Example chain**: `robinhood_mainnet` (used as an example path parameter; check [Supported Chains](https://docs.blockvectra.com/en/chains/) for all chains offering this dataset) * **Authentication**: Provide your API key in the `x-api-key: $BLOCKVECTRA_API_KEY` request header * **Billing and coverage**: Metered in Compute Units (CU); only 2xx successful responses are billed. If a chain lacks stock coverage, the endpoint returns HTTP `422 no_coverage` (not billed) ## Daily leaderboard (`GET /{chain}/stocks`) The `GET /{chain}/stocks` endpoint returns a daily activity leaderboard of tokenized stocks for a specified UTC date, including display metadata (symbol, name, etc.), ordered by transfer activity descending (most active tokens first). ### Request parameters * `{chain}` (path parameter, required): Chain identifier (for example, `robinhood_mainnet`). * `day` (query parameter, optional): UTC calendar date in `YYYY-MM-DD` format. When omitted, defaults to the latest recorded day (if no activity is recorded, returns `200` with `data: []`). If provided but not a valid `YYYY-MM-DD` calendar date, returns HTTP `400` (`error.code = "bad_request"`). * `limit` (query parameter, optional): Caps the number of records returned. Defaults to 50; values above 500 are clamped to 500; passing `0` or a non-integer returns HTTP `400` (`error.code = "bad_request"`). ### Pagination behavior This endpoint is **not paginated**. The `limit` parameter caps the maximum number of records returned. In the enclosing `StockDailyListEnvelope` (`data` and `meta`), stock endpoints do not return `next_cursor` (the key is absent entirely, never `null`). ### Code examples Complete starter template on Robinhood Chain: [blockvectra/robinhood-stock-tokens](https://github.com/blockvectra/robinhood-stock-tokens) **cURL** ```bash curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/stocks?day=2026-09-29&limit=10" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts const res = await fetch( "https://api.blockvectra.com/v1/data/robinhood_mainnet/stocks?day=2026-09-29&limit=10", { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }, ); const body = await res.json(); console.log(body); ``` **Python** ```python import os import requests res = requests.get( "https://api.blockvectra.com/v1/data/robinhood_mainnet/stocks?day=2026-09-29&limit=10", headers={"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]}, ) print(res.json()) ``` ### Response structure The response envelope is `StockDailyListEnvelope`, containing `data` and `meta`: * `data` (array): A list of daily leaderboard records (`StockDaily`), ordered by transfer activity descending (most active tokens first). Each item includes token identifiers (`token`, `symbol`, `name`), transfer activity (`transfers`, `unique_senders`, `unique_receivers`), supply metrics (`mint_raw_amount`, `burn_raw_amount`, `net_supply_change`), distribution metrics (`holder_count`, `top10_holder_share_bps`), DEX trading metrics (`dex_swap_count`, `dex_raw_volume`), and refresh timestamp (`refreshed_at`). * `meta` (object): Chain metadata (`chain`, `chain_slug`, `chain_external_id`, `as_of_block`, `safe_block`, `finalized_block`, `coverage`, `refreshed_at`). `meta.refreshed_at` may be `null`: `null` means the update time of this data is unknown and it should be treated as stale; block-based endpoints always return a value. ## Get one tokenized stock (`GET /{chain}/stocks/{token}`) The `GET /{chain}/stocks/{token}` endpoint fetches metadata and up to 30 days of recent daily metrics for a specific tokenized stock by its token address. ### Request parameters * `{chain}` (path parameter, required): Chain identifier (for example, `robinhood_mainnet`). * `{token}` (path parameter, required): 20-byte token contract address; `0x` prefix is optional and either case is accepted (returned addresses are normalized to `0x` followed by 40 lowercase hex digits). An invalid address format returns HTTP `400` (`error.code = "bad_request"`). * An unknown or not-public `{chain}` returns HTTP `404` (`error.code = "not_found"`, `error.data.reason = "unknown_chain"`) before token validation. On a served chain, an unknown tokenized stock still returns HTTP `404` (`error.code = "not_found"`). ### Code examples **cURL** ```bash curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/stocks/0x1111111111111111111111111111111111111111" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts const token = "0x1111111111111111111111111111111111111111"; const res = await fetch( `https://api.blockvectra.com/v1/data/robinhood_mainnet/stocks/${token}`, { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }, ); const body = await res.json(); console.log(body); ``` **Python** ```python import os import requests token = "0x1111111111111111111111111111111111111111" res = requests.get( f"https://api.blockvectra.com/v1/data/robinhood_mainnet/stocks/{token}", headers={"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]}, ) print(res.json()) ``` ### Response structure The response envelope is `StockTokenEnvelope`, containing `data` and `meta`: * `data` (object): A `StockToken` object containing token contract metadata (`address`, `symbol`, `name`, `decimals`, `created_block`, `created_tx_hash`, `factory`, `creator`, `mint_address`, `burn_address`, `refreshed_at`) and recent daily metrics array `daily`. * `daily` (array): An array of recent daily metrics (`StockDailyMetric`), up to 30 days, ordered by date descending (newest first). Each daily item shares the same metrics schema as the leaderboard above (without the redundant `token`, `symbol`, and `name` fields). * `meta` (object): Chain metadata object consistent with the leaderboard response. ## Key return fields explained ### Daily metric fields (StockDaily and StockDailyMetric) Both the leaderboard and single-token historical daily items include the following core fields: | Field | Type | Description | | ------------------------ | -------------------- | ---------------------------------------------------------------------------------------------------------------- | | `day` | `string` (date) | UTC aggregation date formatted as `YYYY-MM-DD`. | | `token` | `string` (address) | Token contract address (present only in leaderboard `StockDaily`), 40 lowercase hex characters with `0x` prefix. | | `symbol` | `string` | Token symbol (for example, `"EXMPL"`). | | `name` | `string` | Token display name; empty string `""` when matching name metadata is unavailable. | | `transfers` | `integer` (int64) | Total number of on-chain transfers on this UTC day. | | `unique_senders` | `integer` (int64) | Number of unique sender addresses that initiated transfers on this day. | | `unique_receivers` | `integer` (int64) | Number of unique recipient addresses that received transfers on this day. | | `mint_raw_amount` | `string` (decimal) | Total raw token amount minted on this day. | | `burn_raw_amount` | `string` (decimal) | Total raw token amount burned on this day. | | `net_supply_change` | `string` (decimal) | Net supply change on this day (signed decimal string, may be negative). | | `holder_count` | `integer` (int64) | Total holder address count. | | `top10_holder_share_bps` | `integer` | Share of the top 10 holders in basis points (0–10000, 1 bps = 0.01%). | | `dex_swap_count` | `integer` (int64) | Number of DEX swaps involving this token on this day. | | `dex_raw_volume` | `string` (decimal) | Total DEX raw trading volume on this day. | | `refreshed_at` | `string` (timestamp) | ISO-8601 UTC timestamp of when this daily record was last refreshed. | ### Token metadata fields (StockToken) When querying a single token, the outer `data` object contains contract metadata and recent daily metrics: | Field | Type | Description | | ----------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------- | | `address` | `string` (address) | Token contract address. | | `symbol` | `string` | Token symbol. | | `name` | `string` | Full token name. | | `decimals` | `integer` or `null` | Token decimals (0–255), or `null` if unavailable. | | `created_block` | `integer` (int64) | Block number in which the token contract was created. | | `created_tx_hash` | `string` (hash) | Contract creation transaction hash, 64 lowercase hex characters with `0x` prefix. | | `factory` | `string` (address) | Factory contract address. | | `creator` | `string` (address) or `null` | Creator address, or `null` if unavailable. | | `mint_address` | `string` (address) or `null` | Mint address, or `null` if unavailable. | | `burn_address` | `string` (address) or `null` | Burn address, or `null` if unavailable. | | `daily` | `array` | Array of recent daily metrics (`StockDailyMetric`), up to 30 days, ordered by date descending (newest first). | | `refreshed_at` | `string` (timestamp) | ISO-8601 UTC timestamp of when token metadata was last refreshed. | ### Encoding conventions The API adheres to strict encoding rules across all endpoints to preserve numerical precision and consistency: * **Money-safety**: Any value that can exceed `2^53` (256-bit integers such as `mint_raw_amount`, `burn_raw_amount`, `net_supply_change`, and `dex_raw_volume`) is serialized as a **decimal string**, never a JSON number and never scientific or hex notation. This prevents precision loss in runtimes like JavaScript. In JavaScript/TypeScript, parse with `BigInt(str)` (e.g. `const net = BigInt(body.data.daily[0].net_supply_change)`); in Python, parse with `int(str)`. Counters staying well below `2^53` (`transfers`, `unique_senders`, `unique_receivers`, `holder_count`, `top10_holder_share_bps`, `dex_swap_count`, `created_block`) are plain JSON numbers. * **Binary and hex values**: Addresses are `0x` followed by 40 lowercase hexadecimal characters; hashes are `0x` followed by 64 lowercase hexadecimal characters. All returned hex values are strictly lowercase. * **Timestamps and dates**: Timestamps such as `refreshed_at` use `YYYY-MM-DDTHH:MM:SSZ` (ISO-8601 UTC with second precision). Daily aggregates (`day`) use plain calendar dates (`YYYY-MM-DD`). ## Usage estimate (refreshing 50 tokens daily) Data API queries consume Compute Units (CU) based on platform method weights. The estimate below evaluates a scenario where 50 tokens each call `GET /{chain}/stocks/{token}` once daily, evaluated against active method weights: - **Method weight per call:** Each `data.stock` call consumes 15 CU (list price $1.50 per 1M calls). - **Refreshing 50 tokens daily** (one `GET /{chain}/stocks/{token}` call per token, 50 calls/day): daily consumption is 750 CU; over a 30-day cycle this totals 1,500 calls consuming 22,500 CU, about <0.1% of the free quota (30,000,000 CU). If exceeding the free allowance or on a paid plan, total usage at list price is about <$0.01/month. ## Getting started and upgrading The free quota is ideal for development, testing, and lightweight workloads. When your traffic expands and requires higher concurrency or more compute units, top up on-chain on the console [Billing page](https://console.blockvectra.com/billing/); once confirmed on-chain and credited, the account-wide calls-per-second cap is removed. Each key remains subject to CU rate and burst limits, as described in the [JSON-RPC documentation](https://docs.blockvectra.com/en/api/json-rpc/#method-policy). Any unused Free Credits stay in your Credits and can still be used. For current rates and billing units, please see the [Pricing page](https://blockvectra.com/en/pricing/). ## Frequently asked questions **Does the API return stock prices or quotes?** No. The stocks endpoints return on-chain activity: transfers, mints, burns, holder counts and DEX swap counts and volume. They are not stock quotes. **Do I need an API key?** Yes. The Data API requires one. The keyless public endpoint serves JSON-RPC reads only. **Are holders and balances live?** No. They come from a snapshot refreshed every 6 hours, and the `/stocks` leaderboard from a daily table refreshed once a day, so the latest day can be missing or partial. Check `meta.refreshed_at`. **Is the `/stocks` leaderboard paginated?** No. `limit` caps the page at 500 and no `next_cursor` is returned. Transfers, holders and balances are cursor-paginated. **Is the balance a share count?** No. `balance` and `amount` are raw token amounts. Apply the multiplier from the [multiplier guide](https://docs.blockvectra.com/en/guides/stock-token-multiplier/) to get underlying shares. **What happens on a chain without stock coverage?** The stocks endpoints return HTTP `422 no_coverage`, which is not billed. ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # Transaction traces: debug_traceTransaction and the Data API trace endpoints Source: https://docs.blockvectra.com/en/guides/transaction-traces/ ## Two ways to reconstruct a call tree A transaction trace is the reconstructed call tree of an execution: which contract was called, with which input, how much gas it consumed, and which sub-calls it made. BlockVectra exposes it through two surfaces: * **JSON-RPC `debug_trace` methods** (such as `debug_traceTransaction`) — run against the chain's node through the JSON-RPC endpoint, so they can trace recent state the node still has. * **Data API traces** — `GET /{chain}/transactions/{hash}/trace` and `GET /{chain}/blocks/{number}/traces` return stored, indexed call trees over REST. Both use the same API key and are metered in CU by method weight (see the weights below). Which one fits depends on whether you need a single transaction or a whole block, how recent the target is, and whether you want to walk a full block without pagination. ## Limits that apply to debug\_trace methods `debug_trace` requests are accepted only for methods and tracers the chain's method policy allows: * **Allowed tracers**: the `tracer` parameter accepts only the built-in native tracers — `callTracer`, `flatCallTracer`, `prestateTracer`, `4byteTracer`, `noopTracer`, or omitting it to use the default struct logger. Any other value is rejected with JSON-RPC error `-32602 tracer not allowed` (not billed). * **Trace timeout**: the `timeout` parameter must be a valid duration and at most 30s; otherwise the request is rejected with `-32602 trace timeout not allowed` (not billed). * **Node sync guard**: while a chain's node is not synced, every method except `eth_chainId` — including `debug_trace` methods — returns `-32010` (not billed). * **State window**: `debug_traceCall`, `debug_traceBlockByNumber`, `debug_traceTransaction`, and `debug_traceBlockByHash` target a block that must be inside the chain's state window. A target earlier than the window, or one that uses the `safe`, `finalized`, or `earliest` tag, returns `-32011` (not billed). * **Hash and block lookups**: a malformed or unknown hash returns `-32000 transaction not found` / `block not found`; a temporary failure returns `-32603 upstream unavailable` (retryable). Not billed. * **Per-chain method policy**: which `debug_trace` methods a chain allows is published by the public `GET /v1/chains` response. Read it at runtime instead of hardcoding a method list; chains are listed on [Supported Chains](https://docs.blockvectra.com/en/chains/), and the method reference is in the [JSON-RPC methods](https://docs.blockvectra.com/en/api/json-rpc/methods/) page. ### Requesting debug\_traceTransaction with callTracer The call below adds the `tracer` parameter to request a call tree: **cURL** ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key # Add "tracer" to request a call tree with one of the allowed native tracers. curl -s "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "debug_traceTransaction", "params": [ "0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd", { "tracer": "callTracer" } ] }' ``` **TypeScript** ```ts const RPC_ENDPOINT = "https://api.blockvectra.com/v1/robinhood_mainnet"; const res = await fetch(RPC_ENDPOINT, { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": process.env.BLOCKVECTRA_API_KEY!, }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "debug_traceTransaction", params: [ "0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd", { tracer: "callTracer" }, ], }), }); const body = (await res.json()) as { result?: unknown; error?: { code: number; message: string }; }; if (body.error) { throw new Error(`debug_traceTransaction error ${body.error.code}: ${body.error.message}`); } console.log(body.result); // npx tsx example.mts ``` **Python** ```python import os import requests RPC_ENDPOINT = "https://api.blockvectra.com/v1/robinhood_mainnet" res = requests.post( RPC_ENDPOINT, headers={ "Content-Type": "application/json", "x-api-key": os.environ["BLOCKVECTRA_API_KEY"], }, json={ "jsonrpc": "2.0", "id": 1, "method": "debug_traceTransaction", "params": [ "0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd", {"tracer": "callTracer"}, ], }, ) res.raise_for_status() body = res.json() if "error" in body: err = body["error"] raise RuntimeError(f"debug_traceTransaction error {err.get('code')}: {err.get('message')}") print(body["result"]) ``` ## What the Data API trace endpoints provide The Data API returns stored call trees for two scopes. Neither is paginated: `next_cursor` is never present. * `GET /{chain}/transactions/{hash}/trace` — the call frame of one transaction, looked up by transaction hash. * `GET /{chain}/blocks/{number}/traces` — one call tree per transaction in a block, in `tx_index` order. A block with no transactions returns `data: []`. The response envelope is: * `TxTraceEnvelope`: `data` is a `CallFrame` directly, plus `meta`. * `BlockTracesEnvelope`: `data` is an array of `BlockTraceItem`, each with `txHash` and the `result` `CallFrame`, plus `meta`. Both trace endpoints return the standard Ethereum `callTracer` format. This is an exception to the Data API's money-safety encoding: elsewhere, a value that can exceed `2^53` is serialized as a decimal string; on these two endpoints, `value`, `gas`, and `gasUsed` are `0x`-prefixed hex quantities, not decimal strings. Every `CallFrame` carries `type`, `from`, `gas`, `gasUsed`, and `input`; `type` is one of `CALL`, `DELEGATECALL`, `STATICCALL`, `CREATE`, `CREATE2`, or `SELFDESTRUCT`. `to` is absent for a `CREATE`/`CREATE2` frame's target, and `value` is absent for a `STATICCALL` frame. Optional members are `output` (absent when the call returned no data), `error` (absent on success), `revertReason` (present only for an `Error(string)` revert), and `calls` (nested sub-calls in call order). Additional members of the frame are preserved. To make the shape concrete, here is the `CallFrame` field skeleton: ```jsonc { "type": "CALL | DELEGATECALL | STATICCALL | CREATE | CREATE2 | SELFDESTRUCT", "from": "0x…", // 20-byte address "to": "0x…", // absent for a CREATE/CREATE2 target "value": "0x…", // 0x-prefixed hex quantity; absent for STATICCALL "gas": "0x…", // 0x-prefixed hex quantity "gasUsed": "0x…", // 0x-prefixed hex quantity "input": "0x…", "output": "0x…", // absent when the call returned no data "error": "…", // absent on success "revertReason": "…", // absent unless the call reverted with Error(string) "calls": [] // nested sub-calls in call order; absent for a leaf frame } ``` ### Parameters * `{chain}` (path parameter, required): chain identifier, the `chain` value of an entry in `GET /chains`. Matching is exact and case-sensitive; aliases and numeric chain IDs are not accepted. * `{hash}` (path parameter, required for the transaction trace): 32-byte transaction hash, `0x` prefix optional, either digit case. * `{number}` (path parameter, required for the block traces): non-negative block height. ### Coverage and finality * Both endpoints belong to the `traces` capability. A chain without it returns `422 no_coverage`. Chains that provide this dataset are subject to the [Supported Chains](https://docs.blockvectra.com/en/chains/) page and the dataset directory. * Trace data can start later than the rest of a chain's indexed history. `GET /chains` reports the boundary as `coverage.traces_from_block`; a request before it, or inside a range that could not be traced, returns `422 no_coverage`. * For transaction traces: if the hash is not found, it returns `404 not_found` (for a just-submitted or mined transaction, retry after a few seconds before treating this as permanent); if the hash resolves to a block higher than `as_of_block`, it returns `409 not_indexed_yet` instead. * The block traces endpoint takes a block number. A `{number}` above `as_of_block` returns `409 not_indexed_yet` with `indexed_through`; a `{number}` at or below `as_of_block` is served immediately. * A recent block with transactions but no trace data yet returns `503 unavailable` with a `Retry-After` header. ### Requesting a trace from the Data API **cURL** ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key # One transaction's call frame. curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/transactions/0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd/trace" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" # One call tree per transaction in a block. curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/blocks/79900000/traces" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts const hash = "0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd"; const txRes = await fetch( `https://api.blockvectra.com/v1/data/robinhood_mainnet/transactions/${hash}/trace`, { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! } }, ); const txBody = await txRes.json(); console.log(txBody.data, txBody.meta); const blockRes = await fetch("https://api.blockvectra.com/v1/data/robinhood_mainnet/blocks/79900000/traces", { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }); const blockBody = await blockRes.json(); console.log(blockBody.data.map((item: { txHash: string }) => item.txHash)); // npx tsx example.mts ``` **Python** ```python import os import requests hash_ = "0xcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd" headers = {"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]} tx = requests.get( f"https://api.blockvectra.com/v1/data/robinhood_mainnet/transactions/{hash_}/trace", headers=headers, ) tx.raise_for_status() tx_body = tx.json() print(tx_body["data"], tx_body["meta"]) block = requests.get( "https://api.blockvectra.com/v1/data/robinhood_mainnet/blocks/79900000/traces", headers=headers, ) block.raise_for_status() block_body = block.json() print([item["txHash"] for item in block_body["data"]]) ``` ## Which one to use | Typical task | Better fit | Why | | ----------------------------------------------------------------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------- | | Reconstruct a single transaction right after it lands | `debug_traceTransaction` | It runs against the node's current state; availability follows the chain's method policy. | | Read a single transaction's stored call tree | `GET /{chain}/transactions/{hash}/trace` | Returns the transaction's `CallFrame` directly over REST; served up to `as_of_block`. | | Read every call tree in one block in one request | `GET /{chain}/blocks/{number}/traces` | Returns the whole block unpaginated, in `tx_index` order; served up to `as_of_block`. | | Trace state the node still has but the dataset has not stored yet | `debug_trace` methods | The Data API serves stored data up to `as_of_block`; the node can answer for blocks not yet written. | ## CU per call Every method is billed by its CU weight. The weights below are read from the platform plans API: **CU weight per call** | Method | CU per call | | --- | --- | | `debug_traceBlockByHash` | 100 | | `debug_traceBlockByNumber` | 100 | | `debug_traceCall` | 100 | | `debug_traceTransaction` | 100 | | `trace_block` | 100 | | `trace_call` | 100 | | `trace_get` | 100 | | `trace_replayTransaction` | 100 | | `trace_transaction` | 100 | | `data.block_traces` | 200 | | `data.transaction_trace` | 200 | Rejected requests are not billed. For the full billing rules, see [What is not billed: error codes and billing rules](https://docs.blockvectra.com/en/guides/billing-rules/). ## Next steps * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # How to Verify a LineKey Agent Payment Receipt with RPC Source: https://docs.blockvectra.com/en/guides/verify-agent-payments/ An agent that pays through a Priors LineKey leaves a transaction receipt with three logs. This guide gives you a script that reads one receipt through BlockVectra RPC and checks it against an invoice you already trust: a direct `spend` call on the LineKey contract on Robinhood Chain mainnet (`robinhood_mainnet`, chain ID 4663), paid in USDG. The script only reads: it never signs, sends, pays, lends, waits or scans logs. A match is an observation about one receipt, not a finality guarantee. * **First step:** [Save the script](https://docs.blockvectra.com/en/guides/verify-agent-payments/#the-script) as `verify-payment.mjs` in a project of your own, install `viem@2.57.2`, and set the invoice values from your own records. * **Done when:** the script prints one JSON object with `"match": true`, and you have stored its `idempotencyKey` before acting on it. For developers and AI Agents: you need an [API key](https://console.blockvectra.com/login/?next=%2Fkeys%2F) and a transaction hash from your own invoice record. [Jump to the script](https://docs.blockvectra.com/en/guides/verify-agent-payments/#the-script). ## What a match tells you `LineKey.spend(agentId, payee, amount, ref)` draws a loan on the agent's credit line and the pool pays USDG straight to the payee. One such transaction emits three logs you can check: | Log | Emitted by | Carries | | ---------- | --------------- | --------------------------------------------------------- | | `Paid` | LineKey | `agentId`, `payee`, `ref`, `amount`, `loanId`, `operator` | | `Borrowed` | the credit pool | `loanId`, `agentId`, `principal`, `to` | | `Transfer` | the USDG token | `from` (the pool), `to` (the payee), `value` | The script accepts the receipt only when all of these hold: * The receipt belongs to the requested transaction, its status is success, and `receipt.to` is the pinned LineKey address. This is a direct call: a spend sent through a smart account, relayer or any other contract is rejected, because then the receipt's `to` is not LineKey. * Each log is attributed by the address that emitted it before it is decoded. Any contract can emit an event named `Paid`, so only the pinned LineKey, pool and USDG addresses count. Logs from other addresses, and other events from those addresses, are ignored. * There is exactly one `Paid`, exactly one `Borrowed`, and exactly one USDG `Transfer` from the pool to your payee. Missing, duplicated or malformed known logs reject the receipt. A log marked `removed` rejects it. Each known log must also be canonically encoded: the script decodes it, re-encodes it with the same ABI, and requires identical topics and data, so padded address bytes or trailing data are rejected. The three accepted logs must have different log indexes, because the idempotency key is built from the `Paid` log index. * `Paid` matches your `agentId`, `payee`, `amount` and `ref`. `Borrowed` matches the same loan, agent and payee, and its principal equals the amount. The `Transfer` value equals the amount. `Paid.operator` is the transaction sender, and your `EXPECTED_OPERATOR` if you set one. A match does not mean the payment is irreversible, that the agent's key is still authorized, or that the credit line is backed or solvent. The payment is a loan of the agent, not a transfer from the agent's wallet; repayment and defaults are outside this check. ## Trusted inputs The invoice values must come from your own system of record, never from the receipt, the payer or this RPC response. | Variable | Meaning | | --------------------- | --------------------------------------------------------------------------------------------------------------------- | | `BLOCKVECTRA_API_KEY` | Your API key. Read from the environment and sent only in the `x-api-key` header | | `TX_HASH` | The 32-byte transaction hash you are checking | | `AGENT_ID` | The agent's registry ID, a decimal integer | | `PAYEE` | The address the invoice expects to be paid | | `AMOUNT_RAW` | The invoiced amount in USDG base units, a positive integer string. Amounts and IDs use `BigInt`, never floating point | | `REF` | The invoice reference, a nonzero 32-byte hex value | | `EXPECTED_OPERATOR` | Optional. The operator address you expect, which tightens the check | The script requires a nonzero `REF`. LineKey itself accepts a zero reference, but a zero value identifies no invoice and is not limited to one use per payee, so this script treats it as invalid input. The contract addresses are pinned in the script from records published by the upstream Priors project at commit `aca596ad3a13ed6354d21ecb2a6249bcbce6c5f8`. The script does not verify the deployed bytecode, so review the records and source before you rely on them, and update the script if the upstream deployment changes. * LineKey and pool on Robinhood Chain: [deployments/4663.line-key.json](https://github.com/priors-agents/priors/blob/aca596ad3a13ed6354d21ecb2a6249bcbce6c5f8/deployments/4663.line-key.json) * USDG token on Robinhood Chain: [deployments/4663.v2.json](https://github.com/priors-agents/priors/blob/aca596ad3a13ed6354d21ecb2a6249bcbce6c5f8/deployments/4663.v2.json) * Event definitions: [src/LineKey.sol](https://github.com/priors-agents/priors/blob/aca596ad3a13ed6354d21ecb2a6249bcbce6c5f8/src/LineKey.sol) and [sdk/priors-v2.mjs](https://github.com/priors-agents/priors/blob/aca596ad3a13ed6354d21ecb2a6249bcbce6c5f8/sdk/priors-v2.mjs) * How LineKey works: [docs/LINE-KEY.md](https://github.com/priors-agents/priors/blob/aca596ad3a13ed6354d21ecb2a6249bcbce6c5f8/docs/LINE-KEY.md) ## The script Save this as `verify-payment.mjs`. It is written for Node.js 24 and `viem@2.57.2`. ```js import { createPublicClient, decodeEventLog, encodeAbiParameters, encodeEventTopics, getAddress, http, isAddress, isHex, parseAbi, toEventSelector } from 'viem'; // Pinned addresses (lineKey, pool, usdg) from the upstream deployment records at commit aca596ad. const CHAIN_ID = 4663n; // robinhood_mainnet const RPC_URL = 'https://api.blockvectra.com/v1/robinhood_mainnet'; const LINE_KEY = getAddress('0x1090Df1B8A4B3F1e7D9aeDaA06fd29f56B9214fB'); const POOL = getAddress('0x281210097f0de7A8FB6F87310AF0f089c9C8DE21'); const USDG = getAddress('0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168'); const [paidEvent, borrowedEvent, transferEvent] = parseAbi([ 'event Paid(uint256 indexed agentId, address indexed payee, bytes32 indexed ref, uint256 amount, uint256 loanId, address operator, uint64 generation)', 'event Borrowed(uint256 indexed loanId, uint256 indexed agentId, uint256 indexed sponsorId, uint256 principal, uint256 fee, uint64 dueAt, address to)', 'event Transfer(address indexed from, address indexed to, uint256 value)', ]); // Emitter, topic0 and exact topic count of each known event. const KNOWN = [ { name: 'Paid', event: paidEvent, emitter: LINE_KEY, topics: 4 }, { name: 'Borrowed', event: borrowedEvent, emitter: POOL, topics: 4 }, { name: 'Transfer', event: transferEvent, emitter: USDG, topics: 3 }, ].map((k) => ({ ...k, topic0: toEventSelector(k.event) })); class Reject extends Error {} const reject = (message) => { throw new Reject(message); }; const UINT256_LIMIT = 1n << 256n; const isQuantity = (v) => typeof v === 'string' && /^0x(0|[1-9a-f][0-9a-f]*)$/.test(v); function readInvoice(env) { const { TX_HASH, AGENT_ID, PAYEE, AMOUNT_RAW, REF, EXPECTED_OPERATOR, BLOCKVECTRA_API_KEY } = env; if (!/^0x[0-9a-fA-F]{64}$/.test(TX_HASH ?? '')) reject('TX_HASH must be a 32-byte hex hash'); if (!/^(0|[1-9][0-9]{0,77})$/.test(AGENT_ID ?? '') || BigInt(AGENT_ID) >= UINT256_LIMIT) reject('AGENT_ID must be a uint256 decimal integer'); if (!isAddress(PAYEE ?? '') || /^0x0{40}$/i.test(PAYEE)) reject('PAYEE must be a valid nonzero address'); if (!/^[1-9][0-9]{0,77}$/.test(AMOUNT_RAW ?? '') || BigInt(AMOUNT_RAW) >= UINT256_LIMIT) reject('AMOUNT_RAW must be a positive integer in token base units'); if (!/^0x[0-9a-fA-F]{64}$/.test(REF ?? '') || /^0x0{64}$/.test(REF)) reject('REF must be a nonzero 32-byte hex value'); if (EXPECTED_OPERATOR !== undefined && (!isAddress(EXPECTED_OPERATOR) || /^0x0{40}$/i.test(EXPECTED_OPERATOR))) reject('EXPECTED_OPERATOR must be a valid nonzero address'); if (!/^[\x21-\x7e]+$/.test(BLOCKVECTRA_API_KEY ?? '')) reject('BLOCKVECTRA_API_KEY must be set (printable characters only)'); return { txHash: TX_HASH.toLowerCase(), agentId: BigInt(AGENT_ID), payee: getAddress(PAYEE), amount: BigInt(AMOUNT_RAW), ref: REF.toLowerCase(), operator: EXPECTED_OPERATOR === undefined ? undefined : getAddress(EXPECTED_OPERATOR), }; } const sameAddress = (a, b) => typeof a === 'string' && isAddress(a) && getAddress(a) === b; function decodeKnown(known, log) { const { topics, data } = log; if (!Array.isArray(topics) || topics.length !== known.topics || !topics.every((t) => isHex(t, { strict: true }) && t.length === 66)) reject(`malformed ${known.name} topics`); if (!isHex(data, { strict: true })) reject(`malformed ${known.name} data`); let args; let canonical; try { args = decodeEventLog({ abi: [known.event], data, topics, strict: true }).args; const plain = known.event.inputs.filter((input) => !input.indexed); canonical = [...encodeEventTopics({ abi: [known.event], eventName: known.name, args }), encodeAbiParameters(plain, plain.map((input) => args[input.name]))]; } catch { return reject(`undecodable ${known.name} log`); } // Decoding ignores address padding and trailing bytes; the re-encoded log must equal the received lowercase hex exactly. if (canonical.join() !== [...topics, data].join()) reject(`non-canonical ${known.name} encoding`); return args; } function matchReceipt(receipt, invoice) { if (!receipt || typeof receipt !== 'object') reject('no receipt'); if (receipt.status !== '0x1') reject('transaction did not succeed'); if (String(receipt.transactionHash).toLowerCase() !== invoice.txHash) reject('receipt is for a different transaction'); if (!sameAddress(receipt.to, LINE_KEY)) reject('not a direct call to the pinned LineKey'); if (!isAddress(receipt.from ?? '')) reject('receipt has no sender'); if (!isHex(receipt.blockHash, { strict: true }) || receipt.blockHash.length !== 66) reject('receipt has no block hash'); if (!isQuantity(receipt.blockNumber)) reject('receipt has no block number'); if (!Array.isArray(receipt.logs)) reject('receipt has no logs'); const found = { Paid: [], Borrowed: [], Transfer: [] }; for (const log of receipt.logs) { if (!log || typeof log !== 'object' || typeof log.address !== 'string' || !isAddress(log.address)) reject('malformed log'); const emitter = getAddress(log.address); const known = KNOWN.find((k) => k.emitter === emitter && Array.isArray(log.topics) && String(log.topics[0]).toLowerCase() === k.topic0); if (!known) continue; // logs from other contracts or other events are not part of the check if (log.removed === true) reject(`removed ${known.name} log`); if (String(log.transactionHash).toLowerCase() !== invoice.txHash || String(log.blockHash).toLowerCase() !== receipt.blockHash.toLowerCase()) reject(`${known.name} log belongs to another transaction or block`); if (!isQuantity(log.logIndex)) reject(`${known.name} log has no log index`); found[known.name].push({ args: decodeKnown(known, log), logIndex: BigInt(log.logIndex) }); } if (found.Paid.length !== 1) reject(`expected exactly one Paid log, found ${found.Paid.length}`); if (found.Borrowed.length !== 1) reject(`expected exactly one Borrowed log, found ${found.Borrowed.length}`); const poolToPayee = found.Transfer.filter((t) => t.args.from === POOL && t.args.to === invoice.payee); if (poolToPayee.length !== 1) reject(`expected exactly one pool-to-payee USDG Transfer, found ${poolToPayee.length}`); const paid = found.Paid[0]; const indices = [paid, found.Borrowed[0], poolToPayee[0]].map((entry) => entry.logIndex); if (new Set(indices).size !== indices.length) reject('Paid, Borrowed and Transfer logs share a log index'); const { agentId, payee, ref, amount, loanId, operator } = paid.args; if (agentId !== invoice.agentId || payee !== invoice.payee || amount !== invoice.amount || ref.toLowerCase() !== invoice.ref) reject('Paid does not match the invoice'); if (operator !== getAddress(receipt.from)) reject('Paid operator is not the transaction sender'); if (invoice.operator && operator !== invoice.operator) reject('Paid operator is not the expected operator'); const borrowed = found.Borrowed[0].args; if (borrowed.loanId !== loanId || borrowed.agentId !== invoice.agentId || borrowed.principal !== invoice.amount || borrowed.to !== invoice.payee) reject('Borrowed does not match Paid and the invoice'); if (poolToPayee[0].args.value !== invoice.amount) reject('USDG Transfer value does not match the invoice'); return { chainId: Number(CHAIN_ID), txHash: invoice.txHash, blockHash: receipt.blockHash, blockNumber: BigInt(receipt.blockNumber).toString(), paidLogIndex: paid.logIndex.toString(), loanId: loanId.toString(), agentId: agentId.toString(), payee, amountRaw: amount.toString(), ref, operator, idempotencyKey: `${CHAIN_ID}:${invoice.txHash}:${paid.logIndex}`, }; } async function main() { const invoice = readInvoice(process.env); const userAgent = 'AgentPaymentReceiptExample/1' + (process.env.BLOCKVECTRA_INTERNAL_QA === '1' ? ' BlockVectraQA/1' : ''); const client = createPublicClient({ transport: http(RPC_URL, { retryCount: 0, batch: false, timeout: 15_000, fetchOptions: { headers: { 'x-api-key': process.env.BLOCKVECTRA_API_KEY, 'user-agent': userAgent } }, }), }); const chainId = BigInt(await client.request({ method: 'eth_chainId' })); if (chainId !== CHAIN_ID) reject(`endpoint reports chain ${chainId}, expected ${CHAIN_ID}`); const receipt = await client.request({ method: 'eth_getTransactionReceipt', params: [invoice.txHash] }); if (receipt === null) reject('no receipt yet: pending or unknown transaction, nothing to report'); const observation = matchReceipt(receipt, invoice); console.log(JSON.stringify({ match: true, ...observation }, null, 2)); } main().catch((error) => { console.error(`verify-payment: ${error instanceof Reject ? error.message : (error.shortMessage ?? 'request failed')}`); process.exitCode = error instanceof Reject ? 1 : 2; }); ``` Run it from a project where `viem@2.57.2` is installed. Keep the key out of the command line and out of shell history: ```bash npm install viem@2.57.2 read -rs BLOCKVECTRA_API_KEY && export BLOCKVECTRA_API_KEY export TX_HASH='0x' export AGENT_ID='' export PAYEE='' export AMOUNT_RAW='' export REF='0x' node verify-payment.mjs ``` Exit code `0` means the receipt matched. `1` means the input or the receipt was rejected, with the reason on stderr. `2` means a request failed. A match prints `chainId`, `txHash`, `blockHash`, `blockNumber`, `paidLogIndex`, `loanId`, `agentId`, `payee`, `amountRaw`, `ref`, `operator` and `idempotencyKey`; amounts, IDs, block numbers and log indexes are decimal strings. The script sends exactly two JSON-RPC requests: `eth_chainId`, then `eth_getTransactionReceipt` once. It stops after the first if the endpoint reports a different chain ID, and the inputs are validated before any request. Retries and batching are off, the timeout is 15 seconds, and there is no polling. A missing receipt (pending or unknown transaction) or a request error ends the run without a result. ## Before you act on a match * **Store the identity of the payment.** Use the unique key `chain ID + transaction hash + Paid log index`, which the script prints as `idempotencyKey`. A transaction hash alone can cover more than one event, and a repeated run or delivery must not apply the same payment twice. * **A receipt is not a confirmation policy.** The receipt can sit in a block near the chain head that a reorg later replaces. The script does not read confirmations. Decide your own depth or waiting rule, then run the script again once it is met. If the stored `blockHash` has changed, or the receipt is gone or no longer matches, treat the earlier observation as superseded and apply your reorg handling. Block replacement is covered in [Stablecoin payments](https://docs.blockvectra.com/en/guides/stablecoin-payments/#handling-block-reorganizations-and-confirmation-depth). * **A match is not a credit decision.** Crediting, fulfilling or releasing goods remains your business rule. This check says nothing about whether the agent's authorization is still current or whether the line behind it is backed. * **Know what is out of scope.** Other payment routes, spends made through another contract, partial or repeated payments for one invoice, and refunds need their own checks. For endpoint details on Robinhood Chain and its RPC limits, see [the Robinhood Chain guide](https://docs.blockvectra.com/en/guides/robinhood-chain/). ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # Wallet token balances API: list ERC-20 assets for an address Source: https://docs.blockvectra.com/en/guides/wallet-assets/ One request to `GET /{chain}/addresses/{address}/balances` returns a wallet's non-zero ERC-20 token balances; add the [Token Transfers API](https://blockvectra.com/en/data/transfers/) for history. Developers and AI agents use the same authenticated requests, and the [Token Balances API](https://blockvectra.com/en/data/balances/) page lists the fields. ```bash curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/0x1111111111111111111111111111111111111111/balances?limit=50" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` Before querying, read [GET /v1/status](https://api.blockvectra.com/v1/data) and check the selected chain's `data_features` and `data_status`; balance coverage varies by chain. Request parameters and response schemas are in the [Data API reference](https://docs.blockvectra.com/en/api/data/). ## Tasks this guide helps you complete * [Read wallet token balances](https://docs.blockvectra.com/en/guides/wallet-assets/#request-1-address-balances) with a key and paginate non-zero ERC-20 holdings. * [Read wallet transfer history](https://docs.blockvectra.com/en/guides/wallet-assets/#request-2-address-transfers) within a fixed block window and follow cursors for the selected address. * [Fill in token metadata](https://docs.blockvectra.com/en/guides/wallet-assets/#request-3-token-metadata-and-tokensbatch) to display names and symbols alongside raw integer balances, preserving missing fields. ## The three kinds of data a wallet assets page needs A wallet assets page can show an address's ERC-20 token balances, token transfer history and token metadata. The Data API provides an endpoint for each: * **Balances**: `GET /{chain}/addresses/{address}/balances` returns the address's non-zero ERC-20 balances, ordered by `token` address ascending, with token `symbol` and `decimals` included where available. An address with no balances returns `200` with `data: []`. * **Transfers**: `GET /{chain}/addresses/{address}/transfers` returns token transfers involving the address within a required block window, ordered by `(block_number, log_index)` descending. * **Token metadata**: `GET /{chain}/tokens/{token}` reads one token's name, symbol, decimals, and total supply by contract address; `POST /{chain}/tokens:batch` reads the same metadata for up to 100 addresses in one request. All three use `https://api.blockvectra.com/v1/data` as the base URL and the `x-api-key` request header, with `robinhood_mainnet` as the example chain. They belong to the `balances`, `transfers`, and `token_metadata` capabilities respectively; for chains that offer each capability, see the [Supported Chains](https://docs.blockvectra.com/en/chains/) page. On a chain without the capability, the endpoint returns `422 no_coverage`. ## Request 1: address balances This endpoint takes fewer parameters, which makes it a good first request for a page: * `{chain}` (path parameter, required): chain identifier, the `chain` value of an entry in `GET /chains` (for example `robinhood_mainnet`). Matching is exact and case-sensitive; aliases and numeric chain IDs are not accepted. * `{address}` (path parameter, required): 20-byte address; the `0x` prefix is optional and either case is accepted. * `limit` (query parameter, optional): page size. Defaults to 50; values above 500 are clamped to 500; `0` or a non-integer returns `400 bad_request`. * `cursor` (query parameter, optional): the previous response's `next_cursor`, passed back unchanged to fetch the next page. A cursor is valid only for the chain, endpoint, and query parameters that issued it; reusing it elsewhere returns `400 bad_request`. It is keyset-paginated: `next_cursor` appears only when there is another page. On the last page the key is absent entirely, never `null`. **cURL** ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/0x1111111111111111111111111111111111111111/balances?limit=50" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts const address = "0x1111111111111111111111111111111111111111"; const url = new URL( `https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/${address}/balances`, ); url.searchParams.set("limit", "50"); const res = await fetch(url, { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }); const balanceBody = await res.json(); console.log(balanceBody.data, balanceBody.meta); // npx tsx example.mts ``` **Python** ```python import os import requests address = "0x1111111111111111111111111111111111111111" res = requests.get( f"https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/{address}/balances", params={"limit": 50}, headers={"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]}, ) res.raise_for_status() balance_body = res.json() print(balance_body["data"], balance_body["meta"]) ``` The response envelope is `AddressBalanceListEnvelope`, containing `data` and `meta`. Each item of `data` is an `AddressBalance`: | Field | Type | Description | | ---------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `token` | `string` (address) | Token contract address; canonical form is `0x` plus 40 lowercase hex digits. | | `balance` | `string` (decimal) | Raw integer balance, which may exceed `2^53`, returned as a plain decimal string — never a JSON number, scientific notation, or hex. | | `symbol` | `string` or `null` | Token symbol, or `null` when unavailable. | | `decimals` | `integer` or `null` | Token decimals, `0`–`255`, or `null` when unavailable. | ## Request 2: address transfers The transfers endpoint requires an explicit block window: `from_block` and `to_block` are both required and must satisfy `from_block <= to_block`. It takes a few more parameters: * `standard` (query parameter, required): `erc20` or `erc721`. Address-scoped queries do not cover `erc1155`; passing it returns `422 no_coverage`. * `direction` (query parameter, optional): `in`, `out`, or `any`; defaults to `any` and filters by direction relative to the address. * `token` (query parameter, optional): restrict results to one token contract. * `clamp` (query parameter, optional): only the literal string `true` enables it; any other value is treated as `false`. Window bounds and finality: an explicit `to_block` above `as_of_block` returns `409 not_indexed_yet` unless `clamp=true` truncates it down to `as_of_block`; a window wider than the chain's limit (`limits.max_window_blocks` from `GET /chains`) returns `409 window_too_large` unless `clamp=true` truncates from the older end (raising `from_block` and keeping `to_block` fixed). If `from_block` itself is already past `as_of_block`, it stays a hard `409` even with `clamp=true`. When the window is clamped or partially covered, the response `meta.coverage` is `"partial"`; otherwise it is `"full"`. In the transfer records, ERC-20 items add `amount`; ERC-721 items add `token_id`. Both include `token`, `standard`, `from`, `to`, `block_number`, `block_timestamp`, `tx_hash`, `tx_index`, and `log_index`. **cURL** ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key # 1) Read as_of_block from the balances response. AS_OF_BLOCK=$(curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/0x1111111111111111111111111111111111111111/balances" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" | grep -o '"as_of_block":[0-9]*' | cut -d: -f2) # 2) clamp=true truncates a too-wide window, or a to_block above as_of_block, instead of returning 409. curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/0x1111111111111111111111111111111111111111/transfers?standard=erc20&from_block=0&to_block=$AS_OF_BLOCK&direction=any&clamp=true" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts const address = "0x1111111111111111111111111111111111111111"; // 1) Read as_of_block from any previous response's meta. const head = await fetch( `https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/${address}/balances`, { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! } }, ).then((r) => r.json()); // 2) Use as_of_block as the transfer window's upper bound. const url = new URL( `https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/${address}/transfers`, ); url.searchParams.set("standard", "erc20"); url.searchParams.set("from_block", "0"); url.searchParams.set("to_block", String(head.meta.as_of_block)); url.searchParams.set("direction", "any"); url.searchParams.set("clamp", "true"); const res = await fetch(url, { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }); const body = await res.json(); console.log(body.data, body.meta); // npx tsx example.mts ``` **Python** ```python import os import requests address = "0x1111111111111111111111111111111111111111" headers = {"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]} # 1) Read as_of_block from any previous response's meta. head = requests.get( f"https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/{address}/balances", headers=headers, ).json() # 2) Use as_of_block as the transfer window's upper bound. res = requests.get( f"https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/{address}/transfers", params={ "standard": "erc20", "from_block": 0, "to_block": head["meta"]["as_of_block"], "direction": "any", "clamp": "true", }, headers=headers, ) res.raise_for_status() body = res.json() print(body["data"], body["meta"]) ``` ## Paginating through all transfers The address transfers endpoint's `next_cursor` is optimistic: it appears only when the page returned exactly `limit` rows, so a page can carry a `next_cursor` and still turn out to be the last page. Do not stop when a page is empty; follow `next_cursor` until the key is absent. The code below fetches every transfer in the window: **TypeScript** ```ts const address = "0x1111111111111111111111111111111111111111"; const head = await fetch( `https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/${address}/balances`, { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! } }, ).then((r) => r.json()); const asOfBlock = head.meta.as_of_block; const transfers: unknown[] = []; let cursor: string | undefined; do { const url = new URL( `https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/${address}/transfers`, ); url.searchParams.set("standard", "erc20"); url.searchParams.set("from_block", "0"); url.searchParams.set("to_block", String(asOfBlock)); url.searchParams.set("limit", "500"); // clamp truncates from the older end url.searchParams.set("clamp", "true"); if (cursor) url.searchParams.set("cursor", cursor); const res = await fetch(url, { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }); const page = await res.json(); transfers.push(...page.data); cursor = page.next_cursor; // absent on the last page } while (cursor); ``` **Python** ```python import os import requests address = "0x1111111111111111111111111111111111111111" head = requests.get( f"https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/{address}/balances", headers={"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]}, ).json() as_of_block = head["meta"]["as_of_block"] transfers = [] cursor = None while True: params = { "standard": "erc20", "from_block": 0, "to_block": as_of_block, "limit": 500, # clamp truncates from the older end "clamp": "true", } if cursor: params["cursor"] = cursor res = requests.get( f"https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/{address}/transfers", params=params, headers={"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]}, ) res.raise_for_status() page = res.json() transfers.extend(page["data"]) cursor = page.get("next_cursor") # absent on the last page if not cursor: break ``` ## Request 3: token metadata and tokens:batch Read a single token with `GET /{chain}/tokens/{token}`; the path takes only `{chain}` and `{token}`, with no pagination. The response envelope is `TokenEnvelope`, and `data` is a `Token`: | Field | Type | Description | | --------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `address` | `string` (address) | Token contract address. | | `standard` | `string` | `erc20`, `erc721`, or `unknown`. | | `name` | `string` or `null` | Token name, or `null` when unavailable. | | `symbol` | `string` or `null` | Token symbol, or `null` when unavailable. | | `decimals` | `integer` or `null` | Token decimals, `0`–`255`, or `null` when unavailable. | | `total_supply` | `string` or `null` | Raw total supply; the API does not apply `decimals` scaling. `null` when unavailable. | | `first_seen_block` | `integer` (int64) | Block height where the token was first seen. | | `metadata_updated_at` | `string` (timestamp) | UTC time when the metadata was last updated. | | `metadata_block` | `integer` (int64) | Block height at which the metadata was read. | | `metadata_status` | `string` | `ok`, `partial`, or `unavailable`. | | `metadata_issues` | `object` | Per-field issue records keyed by `name`, `symbol`, `decimals`, `total_supply`, with values `reverted`, `no_data`, `invalid_encoding`, or `temporarily_unavailable`. | An unknown or not-public `{chain}` returns HTTP `404` with `error.code: not_found` and `error.data.reason: unknown_chain` before token or request-body validation. On a served chain, a `{token}` that is not a valid 20-byte address returns `400 bad_request`, and an unknown `{token}` returns `404 not_found`. The balances endpoint already includes `symbol` and `decimals` where available, but both can be `null`. To fill in the name and decimals for every token in a wallet, use `POST /{chain}/tokens:batch`: * The request body is `{"addresses": [...]}` with at most 100 addresses per request; more than 100 entries, or an entry that is not a valid 20-byte address, returns `400 bad_request` (it fails on the first invalid address it walks to). * Addresses that are not found do not trigger an error; they are listed in `data.missing`, while `data.tokens` contains only the tokens whose metadata was found. * Duplicate addresses are deduplicated in both `tokens` and `missing`, each in first-occurrence request order. **cURL** ```bash export BLOCKVECTRA_API_KEY=rgw_your_api_key # Single token curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens/0x1111111111111111111111111111111111111111" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" # Batch: up to 100 addresses per request curl -s -X POST "https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens:batch" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"addresses":["0x1111111111111111111111111111111111111111","0x2222222222222222222222222222222222222222"]}' ``` **TypeScript** ```ts // Single token const single = await fetch( "https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens/0x1111111111111111111111111111111111111111", { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! } }, ).then((r) => r.json()); console.log(single.data); // Batch: group by 100 addresses to enrich the tokens from the balances response const BATCH_SIZE = 100; const addresses = balanceBody.data.map((item: { token: string }) => item.token); const tokens = new Map(); const missing: string[] = []; for (let i = 0; i < addresses.length; i += BATCH_SIZE) { const res = await fetch("https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens:batch", { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": process.env.BLOCKVECTRA_API_KEY!, }, body: JSON.stringify({ addresses: addresses.slice(i, i + BATCH_SIZE) }), }); const body = await res.json(); for (const token of body.data.tokens) tokens.set(token.address, token); missing.push(...body.data.missing); } // npx tsx example.mts ``` **Python** ```python import os import requests headers = {"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]} # Single token single = requests.get( "https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens/0x1111111111111111111111111111111111111111", headers=headers, ).json() print(single["data"]) # Batch: group by 100 addresses to enrich the tokens from the balances response BATCH_SIZE = 100 addresses = [item["token"] for item in balance_body["data"]] tokens = {} missing = [] for i in range(0, len(addresses), BATCH_SIZE): res = requests.post( "https://api.blockvectra.com/v1/data/robinhood_mainnet/tokens:batch", json={"addresses": addresses[i : i + BATCH_SIZE]}, headers={**headers, "Content-Type": "application/json"}, ) res.raise_for_status() body = res.json() for token in body["data"]["tokens"]: tokens[token["address"]] = token missing.extend(body["data"]["missing"]) ``` ## Scaling amounts by decimals The balance field `balance` and the ERC-20 transfer field `amount` are raw integers rendered as decimal strings (`UInt256String`); a token's `total_supply` is also a raw on-chain integer with no `decimals` scaling applied. To show a human-readable quantity, divide by `10 ** decimals` for that token. * `decimals` comes from the balance item's own `symbol`/`decimals`, or from `GET /{chain}/tokens/{token}` and `POST /{chain}/tokens:batch`; it can be `null`. * These values may exceed `2^53`, so do not do the arithmetic with a JSON number: use `BigInt` in TypeScript and `int` in Python, parsing the decimal string as-is to avoid precision loss. **TypeScript** ```ts function toDisplayAmount(raw: string, decimals: number | null): string { if (decimals === null) return raw; // no decimals metadata: keep the raw integer const value = BigInt(raw); const base = 10n ** BigInt(decimals); const whole = value / base; const fraction = (value % base) .toString() .padStart(decimals, "0") .replace(/0+$/, ""); return fraction ? `${whole}.${fraction}` : whole.toString(); } // balance.balance is a raw decimal string; decimals comes from the same item or tokens:batch. const display = toDisplayAmount(balance.balance, balance.decimals); ``` **Python** ```python def to_display_amount(raw: str, decimals: int | None) -> str: if decimals is None: return raw # no decimals metadata: keep the raw integer value = int(raw) # parse the decimal string exactly whole, remainder = divmod(value, 10 ** decimals) fraction = str(remainder).rjust(decimals, "0").rstrip("0") return f"{whole}.{fraction}" if fraction else str(whole) # balance["balance"] is a raw decimal string; decimals comes from the same item or tokens:batch. display = to_display_amount(balance["balance"], balance["decimals"]) ``` ## Data freshness Every chain-scoped success response carries `meta`: * `as_of_block`: the chain's newest fully written block. Block-scoped endpoints serve data up to this height. * `safe_block`: a marker indicating the node's consensus `safe` block tag (`null` while unknown). Never below `finalized_block`, and does not truncate, reject, or delay responses. * `finalized_block`: a marker indicating the node's consensus `finalized` block tag (`null` while unknown). It does not truncate, reject, or delay responses; clients decide what safety they need from the marker (such as confirmation status). * `coverage`: `"full"` or `"partial"`. Address transfers and similar endpoints report `"partial"` when `clamp` narrowed the served window, or when the window starts before the chain's first indexed block. * `refreshed_at`: when the data behind the response was last updated (UTC). May be `null`: `null` means the update time of the data is unknown and it should be treated as stale; block-based endpoints always return a value. * It also repeats `chain`, `chain_slug`, and `chain_external_id`. A common pattern: read `meta.as_of_block` from any first response to read up to the newest indexed block, and check `meta.safe_block` / `meta.finalized_block` if you want to display confirmed status. ## CU estimate for one page load Every method is billed by its CU weight, read from the platform plans API: **CU weight per call** | Method | CU per call | | --- | --- | | `data.address_balances` | 25 | | `data.address_transfers` | 25 | | `data.tokens_batch` | 10 | **One page load (estimated)** 1 balances request + 3 transfer pages + 1 `tokens:batch` request(s), 5 calls total, about 110 CU. Actual usage depends on the number of pages and tokens. For billing decisions and non-billed error responses, see [billing rules](https://docs.blockvectra.com/en/guides/billing-rules/). If what you need is not indexed transfer history but logs from the most recent blocks, read [Recent node data vs indexed history](https://docs.blockvectra.com/en/guides/logs-vs-transfers/) first before deciding whether to switch to `eth_getLogs`. ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # MetaMask and Rabby Custom RPC Setup: URL and Chain ID Source: https://docs.blockvectra.com/en/guides/wallet-custom-rpc/ Add the RPC URL, chain ID and native symbol in MetaMask or Rabby, and use a dedicated wallet key when authentication is required. * **First step:** [Read the wallet network parameter table](https://docs.blockvectra.com/en/guides/wallet-custom-rpc/#supported-chains-network-parameter-table) and enter its fields in your wallet, using `/v1/{chain}/{api_key}` for authenticated RPC. * **Done when:** Saving adds the network and switches to it in MetaMask; the configured chain ID matches the ID returned by the endpoint. [Chain parameters and access options](https://blockvectra.com/en/chains/robinhood_mainnet/). ## 1. Why use a custom RPC Blockchain ecosystems generally provide default public RPC endpoints for basic community usage and developer onboarding. However, official network documentation defines explicit rate limits and usage scope for these endpoints: * **Robinhood Chain**: The official documentation page [Connecting to Robinhood Chain](https://docs.robinhood.com/chain/connecting) notes that the public endpoint `https://rpc.mainnet.chain.robinhood.com` is rate-limited and not recommended for production workloads (*The following public endpoints are available but are rate-limited and not recommended for production use. For production, use a provider*). * **HyperEVM**: The official documentation page [Rate limits and user limits](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/rate-limits-and-user-limits) specifies an IP-based limit for the public endpoint `rpc.hyperliquid.xyz/evm` of a maximum of 100 EVM JSON-RPC requests per minute (*Maximum of 100 EVM JSON-RPC requests per minute for rpc.hyperliquid.xyz/evm*). ## 2. Required wallet fields and network parameters EVM wallets require several specific fields when adding or editing a network: 1. **Network Name**: The human-readable label displayed in the wallet interface. 2. **RPC URL**: The communication endpoint. **The API key must be placed in the URL path**, using path `/v1/{chain}/{api_key}` on `api.blockvectra.com`: ```http /v1/{chain}/{api_key} ``` > **Important**: Wallets like MetaMask and Rabby only accept standard HTTP(S) URLs in their RPC URL field and **do not support custom request headers** (such as `x-api-key: {api_key}`). Consequently, wallet connections must supply the API key directly in the URL path. Do not include a trailing slash after `{api_key}`, and note that requests targeting an unknown `{chain}` return HTTP 404. 3. **Chain ID**: The EIP-155 integer chain identifier. 4. **Currency Symbol**: The symbol of the chain's native gas asset (e.g. `ETH`, `HYPE`). 5. **Block Explorer URL**: The primary web address of the network's block explorer. ### Supported chains network parameter table | Network Name | RPC URL (Path Key) | Chain ID | Currency Symbol | Block Explorer URL | | --- | --- | --- | --- | --- | | [Arbitrum One](https://blockvectra.com/en/chains/arb_mainnet/) | `https://api.blockvectra.com/v1/arb_mainnet/{api_key}` | 42161 | [ETH](https://docs.arbitrum.io/build-decentralized-apps/reference/node-providers) | [arbiscan.io](https://arbiscan.io) | | [Arc](https://blockvectra.com/en/chains/arc_mainnet/) | `https://api.blockvectra.com/v1/arc_mainnet/{api_key}` | 5042 | — | — | | [Avalanche C-Chain](https://blockvectra.com/en/chains/avax_mainnet/) | `https://api.blockvectra.com/v1/avax_mainnet/{api_key}` | 43114 | — | — | | [Base](https://blockvectra.com/en/chains/base_mainnet/) | `https://api.blockvectra.com/v1/base_mainnet/{api_key}` | 8453 | [ETH](https://docs.base.org/docs/network-information/) | [basescan.org](https://basescan.org) | | [Berachain](https://blockvectra.com/en/chains/berachain_mainnet/) | `https://api.blockvectra.com/v1/berachain_mainnet/{api_key}` | 80094 | — | — | | [Boba](https://blockvectra.com/en/chains/boba_mainnet/) | `https://api.blockvectra.com/v1/boba_mainnet/{api_key}` | 288 | — | — | | [BNB Smart Chain](https://blockvectra.com/en/chains/bsc_mainnet/) | `https://api.blockvectra.com/v1/bsc_mainnet/{api_key}` | 56 | [BNB](https://docs.bnbchain.org/) | [bscscan.com](https://bscscan.com) | | [Celo](https://blockvectra.com/en/chains/celo_mainnet/) | `https://api.blockvectra.com/v1/celo_mainnet/{api_key}` | 42220 | — | — | | [Ethereum](https://blockvectra.com/en/chains/eth_mainnet/) | `https://api.blockvectra.com/v1/eth_mainnet/{api_key}` | 1 | [ETH](https://ethereum.org/) | [etherscan.io](https://etherscan.io) | | [Ethereum Sepolia](https://blockvectra.com/en/chains/eth_sepolia/) | `https://api.blockvectra.com/v1/eth_sepolia/{api_key}` | 11155111 | [SepoliaETH](https://ethereum.org/en/developers/docs/networks/#sepolia) | [sepolia.etherscan.io](https://sepolia.etherscan.io) | | [Fraxtal](https://blockvectra.com/en/chains/fraxtal_mainnet/) | `https://api.blockvectra.com/v1/fraxtal_mainnet/{api_key}` | 252 | [FRAX](https://docs.frax.com/fraxtal/network/network-information) | [fraxscan.com](https://fraxscan.com) | | [Gnosis](https://blockvectra.com/en/chains/gnosis_mainnet/) | `https://api.blockvectra.com/v1/gnosis_mainnet/{api_key}` | 100 | — | — | | [HyperEVM](https://blockvectra.com/en/chains/hyperevm_mainnet/) | `https://api.blockvectra.com/v1/hyperevm_mainnet/{api_key}` | 999 | [HYPE](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/hyperevm) | [hyperscan.com](https://www.hyperscan.com/) | | [Ink](https://blockvectra.com/en/chains/ink_mainnet/) | `https://api.blockvectra.com/v1/ink_mainnet/{api_key}` | 57073 | [ETH](https://docs.inkonchain.com/general/network-information) | [explorer.inkonchain.com](https://explorer.inkonchain.com) | | [Katana](https://blockvectra.com/en/chains/katana_mainnet/) | `https://api.blockvectra.com/v1/katana_mainnet/{api_key}` | 747474 | [ETH](https://docs.katana.network/katana/technical-reference/network-information/) | [katanascan.com](https://katanascan.com) | | [Linea](https://blockvectra.com/en/chains/linea_mainnet/) | `https://api.blockvectra.com/v1/linea_mainnet/{api_key}` | 59144 | — | — | | [Metal L2](https://blockvectra.com/en/chains/metall2_mainnet/) | `https://api.blockvectra.com/v1/metall2_mainnet/{api_key}` | 1750 | — | — | | [Mode](https://blockvectra.com/en/chains/mode_mainnet/) | `https://api.blockvectra.com/v1/mode_mainnet/{api_key}` | 34443 | — | — | | [OP Mainnet](https://blockvectra.com/en/chains/op_mainnet/) | `https://api.blockvectra.com/v1/op_mainnet/{api_key}` | 10 | — | — | | [Polygon](https://blockvectra.com/en/chains/polygon_mainnet/) | `https://api.blockvectra.com/v1/polygon_mainnet/{api_key}` | 137 | [POL](https://docs.polygon.technology/) | [polygonscan.com](https://polygonscan.com) | | [Robinhood Chain](https://blockvectra.com/en/chains/robinhood_mainnet/) | `https://api.blockvectra.com/v1/robinhood_mainnet/{api_key}` | 4663 | [ETH](https://docs.robinhood.com/chain/connecting) | [robinhoodchain.blockscout.com](https://robinhoodchain.blockscout.com) | | [Robinhood Chain Testnet](https://blockvectra.com/en/chains/robinhood_testnet/) | `https://api.blockvectra.com/v1/robinhood_testnet/{api_key}` | 46630 | [ETH](https://docs.robinhood.com/chain/connecting) | [explorer.testnet.chain.robinhood.com](https://explorer.testnet.chain.robinhood.com) | | [Rootstock](https://blockvectra.com/en/chains/rootstock_mainnet/) | `https://api.blockvectra.com/v1/rootstock_mainnet/{api_key}` | 30 | — | — | | [Soneium](https://blockvectra.com/en/chains/soneium_mainnet/) | `https://api.blockvectra.com/v1/soneium_mainnet/{api_key}` | 1868 | — | — | | [Sonic](https://blockvectra.com/en/chains/sonic_mainnet/) | `https://api.blockvectra.com/v1/sonic_mainnet/{api_key}` | 146 | — | — | | [Unichain](https://blockvectra.com/en/chains/unichain_mainnet/) | `https://api.blockvectra.com/v1/unichain_mainnet/{api_key}` | 130 | [ETH](https://developers.uniswap.org/docs/unichain/technical-information/network-information) | [uniscan.xyz](https://uniscan.xyz) | | [World Chain](https://blockvectra.com/en/chains/world_mainnet/) | `https://api.blockvectra.com/v1/world_mainnet/{api_key}` | 480 | — | — | | [X Layer](https://blockvectra.com/en/chains/xlayer_mainnet/) | `https://api.blockvectra.com/v1/xlayer_mainnet/{api_key}` | 196 | — | — | | [Zora](https://blockvectra.com/en/chains/zora_mainnet/) | `https://api.blockvectra.com/v1/zora_mainnet/{api_key}` | 7777777 | — | — | > **HyperEVM send-method boundary**: Keyed BlockVectra HyperEVM endpoints list eth\_sendRawTransaction in methods.allow; the public keyless endpoint does not. Before sending from your wallet, confirm the selected endpoint allows eth\_sendRawTransaction and matches the chain ID. See [Deploy with Foundry or Hardhat](https://docs.blockvectra.com/en/guides/hyperevm-backfill/#deploy-with-foundry-or-hardhat) in the HyperEVM guide for details. An API key works across supported chains by substituting `{chain}` in the path with the desired chain slug. For details on shared quotas and URL routing, see the [One key, many chains guide](https://docs.blockvectra.com/en/guides/one-key-many-chains/). ## 3. Step-by-step wallet instructions ### MetaMask configuration steps Based on the official MetaMask help guide [How to add a custom network RPC](https://support.metamask.io/networks-and-sidechains/managing-networks/how-to-add-a-custom-network-rpc/): 1. Open the MetaMask browser extension or mobile application. 2. Click the network selector dropdown at the top of the interface (or navigate to Settings > Networks). 3. Select **Add network**, then choose **Add a network manually** at the bottom. 4. Fill in the network details using the table above: * **Network Name**: Enter the chain name from the table above. * **New RPC URL**: Enter your path-authenticated endpoint, such as `https://api.blockvectra.com/v1/robinhood_mainnet/{api_key}` (replace `{api_key}` with your actual API key). * **Chain ID**: Enter the integer chain ID from the table above. * **Currency Symbol**: Enter the native asset symbol from the table above. * **Block Explorer URL**: Enter the official block explorer address from the table above (optional). 5. Click **Save** to add the network and switch to it. > **Sending transactions on HyperEVM**: Keyed BlockVectra HyperEVM endpoints list eth\_sendRawTransaction in methods.allow; the public keyless endpoint does not. Before sending from your wallet, confirm the selected endpoint allows eth\_sendRawTransaction and matches the chain ID. (see [HyperEVM broadcasting explanation](https://docs.blockvectra.com/en/guides/hyperevm-backfill/#deploy-with-foundry-or-hardhat)). > **Editing an existing network**: To update the RPC endpoint for a network already in your list, go to Settings > Networks, select the target network, edit or add your BlockVectra URL in the RPC URL field, and save your changes. ### Rabby Wallet configuration steps In Rabby's custom network or custom RPC settings, enter the parameters from the table above: Network Name, RPC URL (with path key `https://api.blockvectra.com/v1/{chain}/{api_key}`), Chain ID, Currency Symbol, and Block Explorer URL. > **Note**: When adding a custom network or testnet, ensure that the Chain ID matches the ID returned by the endpoint to prevent network ID mismatch errors. ## 4. Security tips and usage management Keep the following security and billing principles in mind when operating a custom RPC: > \[!WARNING] > **API Key exposure risk**: The RPC URL path contains your API key in plain text. Never share screenshots of your wallet's network configuration in public chat rooms or forums, and do not commit URLs containing your live key into public code repositories or documentation. 1. **Wallet requests count toward account usage**: Opening the wallet, switching accounts, or refreshing asset lists triggers live JSON-RPC calls (such as `eth_blockNumber`, `eth_getBalance`, and `eth_call`). These requests consume capacity according to the called method's CU weight (see the [pricing page](https://blockvectra.com/en/pricing/)) against your account limits. 2. **Create a dedicated API key for each wallet**: In the [Console](https://console.blockvectra.com/login/?next=%2Fkeys%2F), create a dedicated API key labeled specifically for your wallet (e.g. `metamask-desktop` or `rabby-extension`). This keeps your personal wallet traffic isolated from your server applications, automated scripts, and AI Agents. 3. **Independent revocation on compromise**: If you suspect an API key configured in a wallet has been exposed, revoke that individual key in the console immediately without impacting any other running keys or services. If your session expires or a key is lost, refer to [Lost your session or API key?](https://docs.blockvectra.com/en/guides/programmatic-signup/#lost-your-session-or-api-key) in the programmatic sign-up guide to regain control using your Ethereum wallet signature. ## 5. Related resources * [Historical state limits](https://docs.blockvectra.com/en/guides/evm-historical-state/): Check authenticated state windows and keyless history before requesting an earlier balance or contract value; log query spans are a separate limit. * [One key, many chains guide](https://docs.blockvectra.com/en/guides/one-key-many-chains/): Detailed URL routing rules, programmatic discovery with `GET /v1/chains`, and cross-chain quota mechanics. * [Pricing and plan limits](https://blockvectra.com/en/pricing/): Information on CU weights, throughput replenishment rates, and payment deposit upgrades. ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # How to monitor wallet addresses for transfers and receive webhooks Source: https://docs.blockvectra.com/en/guides/webhook-push/ To monitor a set of wallet addresses and receive their transfers as webhooks, create one subscription over HTTP: your HTTPS receiver URL, the chains to watch and up to 1,000,000 addresses per self-service subscription. Matching native transfers, token transfers and contract logs are POSTed to your URL with a signed body, at least once, after `applied_version >= change_version`. Rates come from `GET /v1/plans`. Checked 2026-10-21 ```bash PUSH_URL='https://api.blockvectra.com/v1/push' curl --fail-with-body -sS "$PUSH_URL/subscriptions" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"url":"https://hooks.example.com/push","chains":{"base_mainnet":{}},"addresses":["0x9725db73f2cd8657f3e1841e5689f210ee54a92d"]}' ``` The response returns the subscription `id` and the signing `secret`, shown only once. Pick the chains from `GET /v1/push/chains`; the sections below cover the receiver, signature check and replay. Watch an EVM wallet address and receive its native transfers, token transfers and matching contract logs at your HTTPS endpoint for wallet activity notifications or smart contract event monitoring. Developers and AI agents use the same HTTP subscription API. For ERC-20 USDT / USDC payment notifications, follow the [stablecoin payment receiver](https://docs.blockvectra.com/en/guides/stablecoin-payments/#receive-payments-with-webhooks). * **First step:** [Deploy a receiver that verifies raw-body signatures](https://docs.blockvectra.com/en/guides/webhook-push/#verify-signatures), using the verification example below. * **Done when:** After `applied_version >= change_version`, matching on-chain activity reaches your receiver, passes signature verification and is persisted by event `id`; creating a subscription does not send a test message. [Webhook access options](https://blockvectra.com/en/webhooks/). ## Tasks this guide helps you complete * [Receive wallet address activity](https://docs.blockvectra.com/en/guides/webhook-push/#connect-wallet-address-activity) by creating an authenticated subscription, adding watched addresses and verifying incoming events. * [Monitor matching contract logs](https://docs.blockvectra.com/en/guides/webhook-push/#event-format) by inspecting `log` events for watched addresses and filtering `address`, `topics` and `data` in your receiver. * [Recover interrupted delivery](https://docs.blockvectra.com/en/guides/webhook-push/#delivery-retries-and-replay) by checking subscription progress and replaying retained matches, then backfilling gaps outside the replay window. A subscription combines one HTTPS receiving URL, a signing secret, watched EVM addresses and a required `chains` object. Addresses apply to every chain in that object. Use the API with an `x-api-key` header; any active key in your account can manage all of its subscriptions. [Get an API key](https://blockvectra.com/en/get-api-key/?ref=docs-webhook-push) before starting. The [Push OpenAPI](https://docs.blockvectra.com/openapi/push.yaml) lists every operation and webhook schema. ## Connect wallet address activity 1. Deploy a receiver that [verifies the original request body](https://docs.blockvectra.com/en/guides/webhook-push/#verify-signatures), persists events by `id` and acknowledges them within 10 seconds. 2. Read `GET /v1/push/chains`, then [create a subscription](https://docs.blockvectra.com/en/guides/webhook-push/#create-a-subscription) with your HTTPS URL and selected chains. Save the returned `id` and `secret`. 3. [Add the wallet addresses](https://docs.blockvectra.com/en/guides/webhook-push/#add-and-list-addresses). Wait for `applied_version >= change_version` and record each chain's `applied_from_block`; matching starts there. 4. Handle transfers and logs, and [recover gaps or replaced blocks](https://docs.blockvectra.com/en/guides/webhook-push/#delivery-retries-and-replay). Filter token contracts, recipients and integer amounts before using notifications in payment processing. ## Choose Webhook, WebSocket or polling * **Webhook** sends watched-address events to an HTTPS receiver, with delivery retries and replay of retained matches. * **[WebSocket](https://docs.blockvectra.com/en/guides/websocket-subscriptions/)** streams `newHeads` and filtered `logs` over a persistent connection. Reconnect, re-subscribe and query missed blocks after a disconnect. * **[Polling](https://docs.blockvectra.com/en/guides/stablecoin-payments/)** queries `eth_getLogs` in bounded block ranges with your own cursor; use it to monitor payments or backfill missing logs. Check `ws` and `subscriptions` in `GET /v1/chains` for WebSocket support. If `ws` is false, address Webhooks are still an option when that chain appears in the authenticated `GET /v1/push/chains` list. RPC support alone does not establish Push support. ## Address capacity Self-service supports up to 1,000,000 addresses per subscription and is available on sign-up. A subscription covers multiple chains with one receiving URL. Enterprise capacity supports 10,000,000 / 100,000,000 addresses per subscription; [contact us to enable it](https://blockvectra.com/en/contact/). Developers and AI agents have the same capacity options and prices. Both tiers use the same address-day and delivered-event rates shown in [pricing](https://blockvectra.com/en/pricing/). ## Create a subscription Read `GET /v1/push/chains` for available chains and their minimum, default and maximum confirmation counts. A block is released when `head - block + 1 >= confirmations`. Each chain can use its default by supplying `{}`. At least one chain is required; new chains do not automatically join existing subscriptions. Save the following example as `create.json`, replacing the URL with your receiver and selecting chains from the chain list. The URL must use HTTPS on port 443, a hostname rather than an IP literal, and contain no user information or fragment. ```json { "url": "https://hooks.example.com/push", "chains": { "bsc_mainnet": { "confirmations": 1 }, "base_mainnet": {} } } ``` Set `BLOCKVECTRA_API_KEY` in your environment, then run: ```bash PUSH_URL='https://api.blockvectra.com/v1/push' curl --fail-with-body -sS "$PUSH_URL/chains" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" curl --fail-with-body -sS "$PUSH_URL/subscriptions" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -H 'Content-Type: application/json' \ -d @create.json > subscription.json ``` A successful create returns HTTP 201 and an `online` subscription with no addresses. Store its numeric `id` and `secret` securely. The secret is returned only on creation or `POST /subscriptions/{subscription_id}/rotate-secret`; rotation takes effect immediately on all chains, with no overlap. No test message is sent. ## Add and list addresses Save an address batch as `addresses.json`, replacing the example addresses with the ones you watch: ```json { "addresses": [ "0x9725db73f2cd8657f3e1841e5689f210ee54a92d", "0x99d47bB552ae095159C251836De6A5d524076872" ] } ``` Set `SUBSCRIPTION_ID` to the returned subscription ID: ```bash curl --fail-with-body -sS "$PUSH_URL/subscriptions/$SUBSCRIPTION_ID/addresses/add" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -H 'Content-Type: application/json' -d @addresses.json curl --fail-with-body -sS "$PUSH_URL/subscriptions/$SUBSCRIPTION_ID/addresses" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" curl --fail-with-body -sS "$PUSH_URL/subscriptions/$SUBSCRIPTION_ID" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` Each add call accepts at most 10,000 addresses. Input addresses are lowercase or valid EIP-55 mixed case; invalid input rejects the whole batch. Repeated addresses count as `unchanged`, so resending the same add request is safe. Address lists use `limit` and `page_token`; `next_page_token: null` marks the last page. Adding addresses returns `change_version`. Poll or inspect `GET /subscriptions/{subscription_id}` until `applied_version >= change_version`; changes normally take about 1 second to apply. Each chain’s `applied_from_block` identifies the effective block from which on-chain transactions and logs are matched. New addresses are not matched retroactively. Creating a subscription returns HTTP 201 to confirm that the subscription resource was created; HTTP 201 does not mean your receiver has received any webhook push. The platform does not send verification or test messages upon creation or address registration. You must wait until matching on-chain activity occurs on the watched addresses and chains to verify delivery at your receiver. ## Event format Every POST has `type: push.events`, `created_at` and `data`. `data` contains `subscription_id`, one `chain`, `complete_through_block` and `events`. Record progress per chain: a block can span messages, so individual event block numbers are not a completion marker. Each message contains at most 1,000 events, 1 MiB and 50 blocks. ```json { "type": "push.events", "created_at": "2026-10-02T03:00:05Z", "data": { "subscription_id": 48213, "chain": "bsc_mainnet", "complete_through_block": 64000121, "events": [ { "id": "evt_payvsqb6ogymhmehrs2wl5xcky", "type": "native.transfer", "ref": "eip155:56:0x7b19944dc683c33e8dedba259cb6939f7271f70f2eeb6ca5e456cccb57cc1eff:tx", "from": "0xe0a2100d7dad33f70c4bb765323cb96b2400c844", "to": "0x9725db73f2cd8657f3e1841e5689f210ee54a92d", "amount": "150000000000000000", "block_number": 64000120, "block_hash": "0x327892a3e5699a43981f0fbcc5e490628641d92c040eb0429fb550ba3a73c3bf", "block_timestamp": "2026-10-02T03:00:00Z", "tx_hash": "0x7b19944dc683c33e8dedba259cb6939f7271f70f2eeb6ca5e456cccb57cc1eff", "tx_index": 3, "matched": [ { "address": "0x9725db73f2cd8657f3e1841e5689f210ee54a92d", "role": "to" } ] }, { "id": "evt_lgcdattb6l2k3ejuhe4mtdljkm", "type": "token.transfer", "ref": "eip155:56:0x3be3448e6f54ebfa928d5997a0cb2d5e9d3186c5ebfa293ad45b7edc72483a76:7", "standard": "erc20", "token": "0x55d398326f99059ff775485246999027b3197955", "from": "0x0f94e5283c41c29a8f4dff8c17f68bdfb59f07df", "to": "0x99d47bb552ae095159c251836de6a5d524076872", "token_id": null, "amount": "25000000000000000000", "batch_index": null, "block_number": 64000121, "block_hash": "0x6a8146159162f182c091d17eac7d03e95dc92ce80de704c958ca2528306aff15", "block_timestamp": "2026-10-02T03:00:00Z", "tx_hash": "0x3be3448e6f54ebfa928d5997a0cb2d5e9d3186c5ebfa293ad45b7edc72483a76", "tx_index": 5, "log_index": 7, "matched": [ { "address": "0x99d47bb552ae095159c251836de6a5d524076872", "role": "to" } ] }, { "id": "evt_sgliw3ficdf6gaa6zzx4ew6vni", "type": "log", "ref": "eip155:56:0x3be3448e6f54ebfa928d5997a0cb2d5e9d3186c5ebfa293ad45b7edc72483a76:8", "address": "0xb54ffbe723264b84cf74947127a6914cf87fc593", "topics": [ "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x00000000000000000000000099d47bb552ae095159c251836de6a5d524076872", "0x000000000000000000000000b54ffbe723264b84cf74947127a6914cf87fc593" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", "block_number": 64000121, "block_hash": "0x6a8146159162f182c091d17eac7d03e95dc92ce80de704c958ca2528306aff15", "block_timestamp": "2026-10-02T03:00:00Z", "tx_hash": "0x3be3448e6f54ebfa928d5997a0cb2d5e9d3186c5ebfa293ad45b7edc72483a76", "tx_index": 5, "log_index": 8, "matched": [ { "address": "0x99d47bb552ae095159c251836de6a5d524076872", "role": "topic1" } ] } ] } } ``` | Event type | What to handle | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `native.transfer` | Successful top-level native-value transfers involving a watched address; `amount` is an integer decimal string. Internal native transfers are excluded. | | `token.transfer` | ERC-20, ERC-721 and ERC-1155 transfers involving watched addresses; inspect `standard`, `token`, `token_id`, `amount` and `batch_index`. ERC-1155 batch transfers produce one event per item. | | `log` | Other logs naming a watched address as the emitting contract or in topics 1–3; inspect `address`, `topics`, `data` and `matched`. | | `subscription.gap` | A range from `from_block` to `to_block` is unavailable for delivery, with `reason: retention_expired`; backfill with Data API or `eth_getLogs`. | | `chain.reorg` | Free reorg notice: delivered blocks in `from_block`–`to_block` were replaced. Mark or discard their old events by `ref`, then keep automatically redelivered canonical events and deduplicate by `id`. | Within a subscription, deduplicate by event `id`; across subscriptions use `ref` and `type`. Ignore unknown fields and event types. Verify on-chain facts before taking financial action. ## Verify signatures The headers are `webhook-id`, `webhook-timestamp`, `webhook-signature` and `bv-subscription-id`. Pick the secret only from subscriptions you created; reject unknown IDs. Verify HMAC-SHA256 over `webhook-id.webhook-timestamp.raw-body`, using the bytes of the original request body, before parsing JSON. The signature is `v1,`; allow about five minutes of timestamp skew and compare in constant time. This Node.js function accepts the raw body as a `Buffer`, request headers and a map of subscription IDs to stored secrets: ```js import { createHmac, timingSafeEqual } from 'node:crypto'; export function verifyPush(rawBody, headers, secrets) { const subscriptionId = headers['bv-subscription-id']; const id = headers['webhook-id']; const timestamp = headers['webhook-timestamp']; const signature = headers['webhook-signature']; if ([subscriptionId, id, timestamp, signature].some(v => typeof v !== 'string')) return false; const secret = secrets.get(subscriptionId); if (typeof secret !== 'string' || !secret.startsWith('whsec_')) return false; if (!/^\d{10}$/.test(timestamp) || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false; const match = /^v1,([A-Za-z0-9+/]{43}=)$/.exec(signature); if (!match) return false; const received = Buffer.from(match[1], 'base64'); const expected = createHmac('sha256', Buffer.from(secret.slice(6), 'base64')) .update(`${id}.${timestamp}.`).update(rawBody).digest(); return received.length === expected.length && timingSafeEqual(received, expected); } ``` After verification, parse the body, persist processing and return 2xx within 10 seconds. The subscription ID header is untrusted until the signature is verified. ## Verify your first event Keep the subscription online. After the address change is applied, wait for matching on-chain activity and check that your receiver verifies and durably stores the event. ## Stop listening after verification To stop watching addresses, save the addresses to remove in `addresses.json` and call `POST /subscriptions/{subscription_id}/addresses/remove`: ```bash curl --fail-with-body -sS "$PUSH_URL/subscriptions/$SUBSCRIPTION_ID/addresses/remove" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -H 'Content-Type: application/json' -d @addresses.json ``` Each remove call accepts at most 10,000 addresses. An address not currently watched counts as `unchanged`. The call returns `change_version`. Once `applied_version >= change_version`, blocks from that effective block onward no longer match the removed addresses. Previously matched events (in flight, retrying, or queued) are still delivered; events already delivered are not withdrawn. To temporarily pause listening without deleting configuration or addresses, set `status` to `offline`: ```bash curl --fail-with-body -sS -X PATCH "$PUSH_URL/subscriptions/$SUBSCRIPTION_ID" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"status":"offline"}' ``` An `offline` subscription stops listening and delivery, unloads addresses from the matching index, and incurs no address fee for any full UTC day it remains offline. All configuration (URL, secret, addresses, chains and confirmations) is preserved. Patching `{"status":"online"}` resumes listening from the current effective block and does not backfill the offline period. Use JSON Merge Patch on `PATCH /subscriptions/{subscription_id}` to change `url`, `key_id`, `status` or `chains`: a chain object adds or updates it, and `null` removes it. At least one chain must remain. To permanently delete the subscription: ```bash curl --fail-with-body -sS -X DELETE "$PUSH_URL/subscriptions/$SUBSCRIPTION_ID" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` `DELETE` permanently removes the subscription, stops delivery across all chains immediately, and destroys the secret and addresses. ## Delivery, retries and replay Delivery is at least once. Each subscription’s chain is ordered by block and position in the block; failed batches block later events on that chain. Different chains have independent progress and can POST concurrently. A retry of an identical batch retains `webhook-id`, but a changed batch can have a new ID: deduplicate events, not batches. Any 2xx within 10 seconds acknowledges durable processing. Redirects are not followed; 3xx and 410 are failures. After a failure, retries follow immediate, 5-second, 30-second, 2-minute, 10-minute, 30-minute and 1-hour intervals, then hourly. A 429 `Retry-After` can extend the wait up to one hour. Inspect each chain’s `condition`, `last_error` and `next_attempt_at` when delivery stops. The conditions are `receiver_failing`, `insufficient_balance` and `key_revoked`; the last requires patching `key_id` to another active account key. Undelivered events expire outside the retention window and produce `subscription.gap`. `POST /subscriptions/{subscription_id}/replay` takes `chain` and `from_block`; consult `replayable_from_block` in `GET /push/chains` and the subscription’s progress. Replay delivers existing matches and cannot recover events from before an address or chain was added. `chain.reorg` notifies you that already delivered blocks were replaced; it does not indicate a delivery gap. Reorgs shallower than your confirmation count are invisible. For reorgs affecting delivered blocks up to 1,024 blocks deep, canonical events are automatically redelivered with new `id`s. Mark or discard replaced events by `ref`, keep the canonical events and deduplicate by `id`; for payment records, reconcile by `ref` and `tx_hash`. A deeper reorg halts the chain: check `halted` in `GET /push/chains`; canonical redelivery follows after the chain is restored. The control event does not advance `complete_through_block`. Query delivered data events with `GET /subscriptions/{subscription_id}/events?chain=...`, optionally adding `from_block`, `to_block`, `limit` and `page_token`. History rows contain `event`, `replay_epoch`, `orphaned` and `delivered_at`; `orphaned: true` marks a block later replaced. History admission can return 402 `insufficient_balance` (`data.reason`: `balance_exhausted` or `free_grant_exhausted`), 403 `key_cap_exhausted` (`data.cu_cap`), or 429 `rate_limited` (`key_rate_limit` or `free_plan_call_limit`). A 429 `cost_exceeds_burst` has reason `request_exceeds_burst` and `data.max`: increase burst capacity before retrying. See [error handling](https://docs.blockvectra.com/en/errors/) for invalid ranges and retry guidance. ## Billing and example Weights come from `GET /v1/plans`. Delivered data events, successful history requests and address-days have separate weights; management calls other than history, control events, failed deliveries and automatic retries are free. Each delivered event is charged once; customer replay and canonical-event redelivery incur new delivery charges. Address billing uses each subscription’s largest address count during its online portion of the UTC day, after the account free-address allowance shared across subscriptions (older subscriptions first). The same address in two subscriptions counts twice; adding chains changes event charges, not address charges. A subscription offline for the entire UTC day has no address charge. | Usage | Billing unit | CU | | --- | --- | --- | | `push.address_day` | Billable address-day | 33 | | `push.history` | Successful history request | 25 | | `push.log` | Delivered data event | 150 | | `push.native_transfer` | Delivered data event | 150 | | `push.token_transfer` | Delivered data event | 150 | Free addresses per account per UTC day: 1000 Free address allowance per account per UTC day, shared by all subscription groups regardless of plan. For each group, count its maximum address count while online during that day; allocate the allowance in ascending group ID order. The same address in two groups counts twice; the number of chains in a group does not multiply its address count. A group offline or deleted for the entire day contributes nothing. For each group, the remaining count after its share of the allowance is multiplied by the `push.address_day` CU weight in `method_weights`. The current configured allowance comes from the same pricing policy used for the address-day charge; it is not an account capacity limit or a separate allowance per group. Example: 10 delivered native.transfer events, 2 successful history requests and 10 billable address-days cost 10 × 150 + 2 × 25 + 10 × 33 = 1880 CU. Billable address-days are counted after the account free-address allowance. See [billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) and the [pricing page](https://blockvectra.com/en/pricing/) for CU metering and conversion. ## Frequently asked questions **How many addresses can one subscription watch?** Self-service supports up to 1,000,000 addresses per subscription, and one subscription can cover several chains with one receiving URL. Enterprise capacity is 10,000,000 / 100,000,000 addresses per subscription; [contact us to enable it](https://blockvectra.com/en/contact/). **Which events are delivered?** `native.transfer` for successful top-level native-value transfers, `token.transfer` for ERC-20, ERC-721 and ERC-1155 transfers, and `log` for other logs that name a watched address. See [Event format](https://docs.blockvectra.com/en/guides/webhook-push/#event-format). **Are native transfers sent by contracts delivered?** No. Internal native transfers, for example withdrawals from multisig or exchange contracts, are not pushed. Only successful top-level native-value transfers produce `native.transfer`. **Is there a test message when I create a subscription?** No. Creating a subscription returns HTTP 201 and sends nothing; the first message carries real on-chain events for the watched addresses. **Are transfers from before an address was added delivered?** No. Matching starts at each chain's `applied_from_block`, and replay only re-delivers matches that were already stored. Read earlier activity with the Data API by address. **Can one subscription watch every chain automatically?** No. `chains` is required, there is no all-chains wildcard, and chains added later never join an existing subscription; add them with one `PATCH`. **Is delivery exactly once?** No. Delivery is at least once and a retry can carry the same event again, so deduplicate by event `id`. See [Delivery, retries and replay](https://docs.blockvectra.com/en/guides/webhook-push/#delivery-retries-and-replay). ## Related resources * Compare supported events, chain coverage and pricing in the [Blockchain Webhook API overview](https://blockvectra.com/en/webhooks/). --- # Choose Webhooks, WebSocket or RPC Polling Source: https://docs.blockvectra.com/en/guides/webhook-vs-websocket/ Use address Webhooks for delivery to an HTTPS receiver, WebSocket for supported live subscriptions and bounded polling when the workflow needs its own cursor and recovery. Building on-chain event listeners for developers and AI agents requires matching application architecture to network capabilities, delivery guarantees, receiver constraints, and operational cost. ## Decision matrix The table below contrasts all three integration mechanisms across supported network capabilities, infrastructure requirements, recovery strategies, and billing models: | Dimension | Address Webhooks | WebSocket Subscriptions | Bounded RPC Polling | | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Primary mechanism** | Push notification delivered via HTTPS POST to a public endpoint | Pull-stream subscription over persistent TLS connection (`wss://`) | Client-initiated HTTP JSON-RPC batch or scheduled queries | | **Chain availability** | All supported networks declared in [GET /v1/push/chains](https://api.blockvectra.com/v1/push/chains) | Networks with `ws: true` in [GET /v1/chains](https://api.blockvectra.com/v1/chains); subscription types are listed in `subscriptions` | All supported networks in [GET /v1/chains](https://api.blockvectra.com/v1/chains) via keyless public RPC or authenticated JSON-RPC | | **Receiver requirements** | Publicly accessible HTTPS URL, valid TLS certificate, 2xx response within timeout, raw-body HMAC SHA-256 signature verification | Outbound TCP/TLS client connection (`wss://`); handles ping/pong heartbeats and reconnection backoff | Stateless HTTP client or scheduled worker; stores local block cursor | | **Delivery & ordering** | At-least-once delivery with exponential retry backoff; receiver must deduplicate by event `id`, or by `ref` + `type` across subscriptions | Strictly ordered frames on a single active socket; notifications dropped during disconnections | Deterministic pull responses for confirmed block heights; client paces execution | | **Chain reorganizations** | Control notifications emitted for `chain.reorg`; receiver discards replaced events before applying canonical replays | Log notifications carry `"removed": true` for reorged logs; `newHeads` requires parent hash checking | Client tracks `parentHash` chain continuity across poll ticks to detect reorgs | | **Failure recovery** | Server retention window allows replay via `POST /v1/push/subscriptions/{id}/replay`; gaps before activation block require `eth_getLogs` backfill | No server-side queue; client reconnects and backfills missed ranges via `eth_getLogs` deduplicated by `(blockHash, transactionHash, logIndex)` | Resumes querying from stored `last_synced_block`; partitions chunks by network `max_logs_block_range` from [GET /v1/chains](https://api.blockvectra.com/v1/chains) | | **Billing model** | Per-group daily address fee, based on the largest address count while online during the UTC day, plus CU for delivered data events; see [Webhook billing](https://docs.blockvectra.com/en/guides/webhook-push/#billing-and-example) | Handshake and heartbeats unbilled; `eth_subscribe` / `eth_unsubscribe` and flushed socket notification units billed in CU | Metered per request in Compute Units: `eth_blockNumber`, `eth_call`, `eth_getLogs`; method weights and CU per $1 from [GET /v1/plans](https://console-api.blockvectra.com/v1/plans), shown below | | **Best suited for** | User deposit monitoring, hot-wallet address tracking, merchant checkouts, asynchronous event webhooks | Live `newHeads` and filtered `logs`, reactive bots, interactive UIs on supported networks | Batch reconciliation, cron jobs, ETL pipelines | **Active Conversion Parameters** 1 USD = 10,000 billing units, 1 billing unit = 1,000 CU (1 USD = 10,000,000 CU). **Formula**: CU weight × 1,000,000 ÷ (10,000 × 1,000) USD. | Method | CU per call | Price per 1M calls (USD) | | --- | --- | --- | | `eth_blockNumber` | 1 | $0.10 | | `eth_call` | 15 | $1.50 | | `eth_getLogs` | 30 | $3.00 | | `debug_traceTransaction` | 100 | $10.00 | | `data.block` | 5 | $0.50 | ## When to choose address Webhooks Choose the [Blockchain Webhook API](https://docs.blockvectra.com/en/guides/webhook-push/) when your backend runs as a standard web service capable of receiving inbound HTTPS requests: * **Large address lists**: Monitor deposits or withdrawals across thousands of customer addresses without maintaining persistent sockets per wallet. * **Serverless or containerized receivers**: Serverless functions (AWS Lambda, Cloudflare Workers) spin up on incoming webhooks and do not need to keep continuous connections alive. * **Automated retries and replay**: Transient receiver outages are mitigated by automatic retry backoff. Within the server retention window, missed deliveries can be redelivered using the replay endpoint. * **Activation boundary considerations**: Matching begins only after the subscription change is applied (`applied_from_block`). Events that occurred before an address was added or while a subscription was `offline` must be queried via historical RPC logs. Review [signature verification and replay workflows](https://docs.blockvectra.com/en/guides/webhook-push/#verify-signatures) before exposing production webhook receivers. ## When to choose WebSocket subscriptions Choose [WebSocket Subscriptions](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) when low latency is required and your process can maintain a long-running outbound socket: * **Live block headers**: Stream `newHeads` as each block is appended to the chain head. * **Contract event filters**: Stream real-time contract `logs` matching an address or specific `topic0`. * **Private environments**: Ideal for local scripts, CLI agents, or backend services behind NAT or firewalls that cannot expose an inbound public HTTPS port. * **Network availability check**: Check the target network's `ws` and `subscriptions` fields in [GET /v1/chains](https://api.blockvectra.com/v1/chains). HyperEVM can also use WebSocket; availability is always determined by that catalog. If a network does not serve WebSocket, the connection returns HTTP 404 ([`unknown_chain`](https://docs.blockvectra.com/en/errors/#unknown_chain)). * **Disconnection discipline**: WebSocket notifications are not retained on the server across disconnections. When the socket drops, clients must reconnect with randomized exponential backoff and backfill missed blocks via `eth_getLogs`. Review the [WebSocket Subscriptions guide](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) for filter limits, connection caps (20 per key, 50 per account), and viem connection examples. ## When to choose bounded RPC polling Choose bounded JSON-RPC polling when running scheduled workers, data pipelines, or operating on networks where WebSocket is unavailable: * **Scheduled and backfill processing**: HyperEVM (`hyperevm_mainnet`) can continue to use HTTP `eth_blockNumber` and `eth_getLogs` for bounded polling and historical backfill; this does not mean WebSocket is unavailable. * **Controlled query pacing**: Polling allows developers and AI agents to govern request frequency, manage Compute Unit consumption against per-key rate limits, and avoid socket drops during long-running tasks. Per-key limits — defaults are 100 CU/s and burst 400 CU; after a paid top-up each key is at least 2,000 CU/s and burst 10,000 CU, and higher custom limits are kept. * **Block range limits**: Authenticated `eth_getLogs` queries are capped by the network's `max_logs_block_range` from [GET /v1/chains](https://api.blockvectra.com/v1/chains). Exceeding this limit returns error code `-32602` ([`logs_range_too_large`](https://docs.blockvectra.com/en/errors/#logs_range_too_large)). Split wider intervals into consecutive chunks not exceeding the target network's `max_logs_block_range`. | Chain | Chain slug | max_logs_block_range (blocks) | | --- | --- | --- | | Arbitrum One | `arb_mainnet` | 1,000 | | Arc | `arc_mainnet` | 1,000 | | Avalanche C-Chain | `avax_mainnet` | 1,000 | | Base | `base_mainnet` | 1,000 | | Berachain | `berachain_mainnet` | 1,000 | | Boba | `boba_mainnet` | 1,000 | | BNB Smart Chain | `bsc_mainnet` | 1,000 | | Celo | `celo_mainnet` | 1,000 | | Ethereum | `eth_mainnet` | 1,000 | | Ethereum Sepolia | `eth_sepolia` | 1,000 | | Fraxtal | `fraxtal_mainnet` | 1,000 | | Gnosis | `gnosis_mainnet` | 1,000 | | HyperEVM | `hyperevm_mainnet` | 1,000 | | Ink | `ink_mainnet` | 1,000 | | Katana | `katana_mainnet` | 1,000 | | Linea | `linea_mainnet` | 1,000 | | Metal L2 | `metall2_mainnet` | 1,000 | | Mode | `mode_mainnet` | 1,000 | | OP Mainnet | `op_mainnet` | 1,000 | | Polygon | `polygon_mainnet` | 1,000 | | Robinhood Chain | `robinhood_mainnet` | 1,000 | | Robinhood Chain Testnet | `robinhood_testnet` | 1,000 | | Rootstock | `rootstock_mainnet` | 1,000 | | Soneium | `soneium_mainnet` | 1,000 | | Sonic | `sonic_mainnet` | 1,000 | | Unichain | `unichain_mainnet` | 1,000 | | World Chain | `world_mainnet` | 1,000 | | X Layer | `xlayer_mainnet` | 1,000 | | Zora | `zora_mainnet` | 1,000 | See the [HyperEVM log backfill guide](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) and the [eth\_getLogs block range guide](https://docs.blockvectra.com/en/guides/getlogs-block-range/) for chunking algorithms. For a complete workload checklist and self-tests, start with [How to choose an RPC provider](https://docs.blockvectra.com/en/guides/choose-rpc-provider/). When choosing a provider for low-volume polling, [compare providers for standard RPC billing and coverage](https://docs.blockvectra.com/en/guides/quicknode-alternative/). Compare usage billing with trial and subscription costs; notification and backfill costs use different meters from RPC reads. ## Implementation guides ### WebSocket on Robinhood Chain For live `newHeads` or filtered `logs` on Robinhood Chain, follow the [WebSocket Subscriptions guide](https://docs.blockvectra.com/en/guides/websocket-subscriptions/) for authentication and subscription requests. After a disconnect, reconnect with backoff, re-subscribe and backfill missed blocks from a saved cursor with `eth_getLogs`; deduplicate logs by `(blockHash, transactionHash, logIndex)`. ### Bounded polling on HyperEVM For HyperEVM (`hyperevm_mainnet`), follow the [HyperEVM log backfill guide](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) for bounded polling and recovery. Query from the saved cursor in chunks within `max_logs_block_range`, persist events and progress together after successful processing, and retry incomplete ranges. Check chain continuity and scan overlapping ranges to handle reorgs. ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # WebSocket Subscriptions Source: https://docs.blockvectra.com/en/guides/websocket-subscriptions/ BlockVectra provides secure WebSocket connections (`wss://`) for streaming real-time Ethereum event subscriptions alongside standard JSON-RPC requests. ## Choose WebSocket, Webhook or polling Use WebSocket for live `newHeads` and filtered `logs` when your application can maintain a connection. Use the [Blockchain Webhook API](https://docs.blockvectra.com/en/guides/webhook-push/) to receive watched-wallet activity at an HTTPS endpoint, with [raw-body signature verification](https://docs.blockvectra.com/en/guides/webhook-push/#verify-signatures), retries and replay of retained matches. Use [HTTP polling](https://docs.blockvectra.com/en/guides/stablecoin-payments/) for scheduled ERC-20 payment monitoring and historical log backfill. The stablecoin guide also shows a [USDT / USDC Webhook receiver](https://docs.blockvectra.com/en/guides/stablecoin-payments/#receive-payments-with-webhooks). For an architectural comparison across chain support, receiver requirements, and recovery trade-offs for developers and AI agents, see the [guide to choosing Webhooks, WebSocket or RPC polling](https://docs.blockvectra.com/en/guides/webhook-vs-websocket/). WebSocket support comes from `ws` and `subscriptions` in `GET /v1/chains`; Push support comes from the authenticated `GET /v1/push/chains` list. A chain without WebSocket can still use address Webhooks if listed there. WebSocket disconnections require re-subscription and backfill; they do not emit the Push control events `subscription.gap` or `chain.reorg`. For Webhooks, a gap needs a range scan; a reorg notice needs replaced events to be marked or discarded before keeping automatically redelivered canonical events. [Push replay](https://docs.blockvectra.com/en/guides/webhook-push/#delivery-retries-and-replay) resends retained matches, not data from before an address or chain was added or while the subscription was offline. Review [billing rules](https://docs.blockvectra.com/en/guides/billing-rules/) and the [error reference](https://docs.blockvectra.com/en/errors/) when implementing recovery. ## Available chains You can check whether WebSocket subscriptions are active on a network by reading `ws` (boolean) and `subscriptions` (array of supported types) in `GET /v1/chains`. The table below reflects networks where WebSocket support is enabled: | Chain | WebSocket Endpoint (Path Key) | | --- | --- | | Arbitrum One | `wss://api.blockvectra.com/v1/arb_mainnet/{api_key}` | | Arc | `wss://api.blockvectra.com/v1/arc_mainnet/{api_key}` | | Avalanche C-Chain | `wss://api.blockvectra.com/v1/avax_mainnet/{api_key}` | | Base | `wss://api.blockvectra.com/v1/base_mainnet/{api_key}` | | Berachain | `wss://api.blockvectra.com/v1/berachain_mainnet/{api_key}` | | Boba | `wss://api.blockvectra.com/v1/boba_mainnet/{api_key}` | | BNB Smart Chain | `wss://api.blockvectra.com/v1/bsc_mainnet/{api_key}` | | Celo | `wss://api.blockvectra.com/v1/celo_mainnet/{api_key}` | | Ethereum | `wss://api.blockvectra.com/v1/eth_mainnet/{api_key}` | | Ethereum Sepolia | `wss://api.blockvectra.com/v1/eth_sepolia/{api_key}` | | Fraxtal | `wss://api.blockvectra.com/v1/fraxtal_mainnet/{api_key}` | | Gnosis | `wss://api.blockvectra.com/v1/gnosis_mainnet/{api_key}` | | HyperEVM | `wss://api.blockvectra.com/v1/hyperevm_mainnet/{api_key}` | | Ink | `wss://api.blockvectra.com/v1/ink_mainnet/{api_key}` | | Katana | `wss://api.blockvectra.com/v1/katana_mainnet/{api_key}` | | Linea | `wss://api.blockvectra.com/v1/linea_mainnet/{api_key}` | | Metal L2 | `wss://api.blockvectra.com/v1/metall2_mainnet/{api_key}` | | Mode | `wss://api.blockvectra.com/v1/mode_mainnet/{api_key}` | | OP Mainnet | `wss://api.blockvectra.com/v1/op_mainnet/{api_key}` | | Polygon | `wss://api.blockvectra.com/v1/polygon_mainnet/{api_key}` | | Robinhood Chain | `wss://api.blockvectra.com/v1/robinhood_mainnet/{api_key}` | | Robinhood Chain Testnet | `wss://api.blockvectra.com/v1/robinhood_testnet/{api_key}` | | Rootstock | `wss://api.blockvectra.com/v1/rootstock_mainnet/{api_key}` | | Soneium | `wss://api.blockvectra.com/v1/soneium_mainnet/{api_key}` | | Sonic | `wss://api.blockvectra.com/v1/sonic_mainnet/{api_key}` | | Unichain | `wss://api.blockvectra.com/v1/unichain_mainnet/{api_key}` | | World Chain | `wss://api.blockvectra.com/v1/world_mainnet/{api_key}` | | X Layer | `wss://api.blockvectra.com/v1/xlayer_mainnet/{api_key}` | | Zora | `wss://api.blockvectra.com/v1/zora_mainnet/{api_key}` | ## Connection and authentication Clients establish a secure TLS WebSocket connection (`wss://`). The API key can be supplied in two ways: * **Path key**: `wss://api.blockvectra.com/v1/{chain}/{api_key}` * **Header key**: `wss://api.blockvectra.com/v1/{chain}` with the `x-api-key: {api_key}` or `Authorization: Bearer {api_key}` header during the HTTP Upgrade handshake. With a path key, the path key is used and both authentication headers are ignored. Without a path key, a non-empty `x-api-key` takes precedence over `Authorization: Bearer`. Browser WebSocket APIs cannot set these headers; use the path-key URL. ### Handshake admission checks The handshake can fail with: * **Authentication**: An absent API key returns HTTP 401 ([`missing_api_key`](https://docs.blockvectra.com/en/errors/#missing_api_key)); an unknown, disabled, or revoked API key returns HTTP 401 ([`invalid_api_key`](https://docs.blockvectra.com/en/errors/#invalid_api_key)); if authentication is temporarily unavailable, the response is HTTP 503 ([`auth_unavailable`](https://docs.blockvectra.com/en/errors/#auth_unavailable)). * **Account balance**: An account with zero or negative prepaid balance returns HTTP 402 ([`balance_exhausted`](https://docs.blockvectra.com/en/errors/#balance_exhausted)); if billing state cannot be confirmed, the response is HTTP 503 ([`billing_unavailable`](https://docs.blockvectra.com/en/errors/#billing_unavailable)). * **Connection limits**: Exceeding the per-key limit (20 connections) or per-account limit (50 connections) returns HTTP 429 ([`ws_connection_limit`](https://docs.blockvectra.com/en/errors/#ws_connection_limit)). * **Chain availability**: Requesting an unknown or unserved chain returns HTTP 404 ([`unknown_chain`](https://docs.blockvectra.com/en/errors/#unknown_chain)). * **Server capacity**: When the server is busy or overloaded, the handshake returns HTTP 503 ([`overloaded`](https://docs.blockvectra.com/en/errors/#overloaded)) with a `Retry-After` header. Once connected, clients can send standard JSON-RPC 2.0 requests (such as `eth_blockNumber` or `eth_call`) and subscription control methods formatted as UTF-8 text frames. ## Billing rules * Establishing a connection, keeping an idle connection open, and ping/pong heartbeats are not billed. * Successful `eth_subscribe` and `eth_unsubscribe` calls are billed, including an unsubscribe returning `false`; failed calls are not billed. Ordinary JSON-RPC calls follow the [JSON-RPC billing rules](https://docs.blockvectra.com/en/guides/billing-rules/). * `newHeads` notifications count once per block hash per connection, regardless of how many `newHeads` subscriptions the connection has. * `logs` notifications count once per subscription per block hash and phase with matching logs; blocks without matches are not billed. Multiple matching logs in the same block and phase do not multiply the charge. Separate subscriptions count separately, even when their filters overlap. Reorganization logs (`removed: true`) form a separate unit; a replacement block at the same height has a different hash and is a different unit. * Notifications are billed only after they are successfully flushed to the socket send buffer; queued or dropped notifications that were not flushed are not billed. Notifications queued before an `eth_unsubscribe` answer count if flushed. WebSocket messages carry no HTTP billing headers; consult account usage for metered CU. ## Subscription methods The API implements the standard Ethereum pub/sub interface: `eth_subscribe` and `eth_unsubscribe`. ### `newHeads` Emits a new block header object whenever a new block is appended to the chain head. * **Subscribe request**: ```json {"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]} ``` * **Subscribe response**: Returns an opaque hexadecimal subscription identifier: ```json {"jsonrpc":"2.0","id":1,"result":"0x1"} ``` * **Push notification frame**: ```json {"jsonrpc":"2.0","method":"eth_subscription","params":{"subscription":"0x1","result":{"number":"0x1b4","hash":"0x..."}}} ``` ### `logs` Emits log events matching specified filter criteria. * **Filter requirement**: Every `logs` subscription filter **must** specify an `address` (a contract address or array of addresses) or a `topic0` (the first topic position, non-null). A filter specifying neither (such as `{}` or `{"topics":[null,"0x..."]}`) is rejected with error code `-32602` ([`logs_filter_required`](https://docs.blockvectra.com/en/errors/#logs_filter_required)). * **Filter limits**: At most 100 addresses; at most 4 topic positions with at most 16 candidate hashes per position. * **Filter capacity**: If active log filters reach capacity, the subscription returns error code `-32022` ([`ws_filter_capacity`](https://docs.blockvectra.com/en/errors/#ws_filter_capacity)). * **Chain reorganizations**: If a block is removed due to a chain reorg, log notifications for removed logs carry `"removed": true`. * **Subscribe request**: ```json {"jsonrpc":"2.0","id":2,"method":"eth_subscribe","params":["logs",{"address":"0x1234567890123456789012345678901234567890"}]} ``` ### `eth_unsubscribe` Terminates an active subscription using its subscription identifier. * **Unsubscribe request**: ```json {"jsonrpc":"2.0","id":3,"method":"eth_unsubscribe","params":["0x1"]} ``` * **Unsubscribe response**: ```json {"jsonrpc":"2.0","id":3,"result":true} ``` ## Runnable examples **viem v2 (TypeScript)** Connect using [viem](https://viem.sh) v2 via `createPublicClient` and the `webSocket` transport. Replace `{chain}` with the target chain identifier and `{api_key}` with your API key: ```ts import { createPublicClient, webSocket } from 'viem'; const apiKey = process.env.BLOCKVECTRA_API_KEY || '{api_key}'; const url = `wss://api.blockvectra.com/v1/robinhood_mainnet/${apiKey}`; const client = createPublicClient({ transport: webSocket(url), }); // 1. Subscribe to new block headers (newHeads) const unwatchBlocks = client.watchBlocks({ onBlock: (block) => { console.log('New block header received:', block.number, block.hash); }, onError: (error) => { console.error('watchBlocks error:', error); }, }); // 2. Subscribe to contract event logs (filter requires address or topic0) const unwatchEvents = client.watchEvent({ address: '0x1234567890123456789012345678901234567890', onLogs: (logs) => { console.log('Matching logs received:', logs); }, onError: (error) => { console.error('watchEvent error:', error); }, }); ``` **Command line (websocat / wscat)** Connect using command-line tools like `websocat` or `wscat` and send raw JSON-RPC frames: ```bash # Connect with path-based API key using websocat websocat "wss://api.blockvectra.com/v1/{chain}/{api_key}" # Alternatively, pass the key via request header websocat -H="x-api-key: {api_key}" "wss://api.blockvectra.com/v1/{chain}" # Or connect using wscat wscat -c "wss://api.blockvectra.com/v1/{chain}/{api_key}" ``` Send subscription commands into the interactive session: ```json {"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]} {"jsonrpc":"2.0","id":2,"method":"eth_subscribe","params":["logs",{"address":"0x1234567890123456789012345678901234567890"}]} {"jsonrpc":"2.0","id":3,"method":"eth_unsubscribe","params":["0x1"]} ``` ## Close codes and client actions When the server terminates a WebSocket session, it sends a Close frame with a specific close code and short reason. The table below lists the close codes emitted by the server and recommended actions: | Close code | Reason string | Description | Retryable | Client action | | -----------------------: | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [1001](https://docs.blockvectra.com/en/errors/#1001) | `idle` | Inactive connection without subscriptions or messages for 3600 seconds (1 hour) | Yes | Reconnect as needed. | | [1003](https://docs.blockvectra.com/en/errors/#1003) | `binary frames are not accepted` | Binary WebSocket frame received; UTF-8 text frames only | No | Do not reconnect automatically. Update client to send text frames. | | [1009](https://docs.blockvectra.com/en/errors/#1009) | `message too large` | Inbound payload exceeded 1 MiB | No | Do not reconnect automatically. Split large requests or reduce payload size. | | [1012](https://docs.blockvectra.com/en/errors/#1012) | `service restart` | Server restarting, or session reached maximum lifetime (24 hours) | Yes | Reconnect using randomized jitter backoff, re-establish subscriptions, and backfill missed data. | | [1013](https://docs.blockvectra.com/en/errors/#1013) | `chain unavailable` | Chain unavailable | Yes | Reconnect using full-jitter exponential backoff, re-establish subscriptions, and backfill missed data. | | [1013](https://docs.blockvectra.com/en/errors/#1013) | `overloaded` | Server temporarily overloaded | Yes | Reconnect using full-jitter exponential backoff, re-establish subscriptions, and backfill missed data. | | [4402](https://docs.blockvectra.com/en/errors/#4402) | `insufficient balance` | Account balance exhausted | No | Do not reconnect automatically. [Top up your balance, then reconnect](https://docs.blockvectra.com/en/guides/billing-rules/). | | [4404](https://docs.blockvectra.com/en/errors/#4404) | `invalid api key` | API key is unknown, disabled, or revoked | No | Do not reconnect automatically. Verify or rotate API key in the console before reconnecting. | | [4408](https://docs.blockvectra.com/en/errors/#4408) | `slow consumer` | The server closes a session whose push queue passes 512 KiB and drops pending notifications; clients may not receive a close frame (browser reports 1006) | Yes | Treat unexpected disconnects (no close frame received, browser reports 1006) like 4408: reconnect with backoff, re-establish subscriptions, and backfill dropped data with `eth_getLogs`; subscribe to less, or read faster. | | [4429](https://docs.blockvectra.com/en/errors/#4429) | `push rate exceeded` | Notification rate exceeded 1,000 pushes/second | Yes | Reduce subscriptions or narrow filters; reconnect with backoff, re-subscribe, and backfill. | | [4503](https://docs.blockvectra.com/en/errors/#4503) | `billing unavailable` | Billing temporarily unavailable | Yes | Transient state; reconnect using full-jitter exponential backoff. | ## Control log-query frequency on fast chains A `newHeads` notification need not trigger a separate `eth_getLogs` call. On fast chains, fetching logs for every pushed head can make more requests than polling that naturally groups several blocks. If your application can accept a short update interval, coalesce head notifications before starting the next scan: * Keep one scan in flight per chain and a bounded pending-head record instead of queuing one scan per notification. A pending head is a hint to check the chain, not a committed checkpoint or proof of canonical history. * At scan start, capture a fixed block number and hash as the upper bound. Read the entire uncommitted interval in chunks within the catalog's `max_logs_block_range`; do not skip intermediate blocks when several notifications are combined. Commit results and the checkpoint together. On failure, keep the previous committed checkpoint and stop that pass. * Notifications received during the scan can schedule one later pass, subject to your chosen interval and resource limits. Recheck block hashes and apply the [reorganization recovery rules](https://docs.blockvectra.com/en/guides/websocket-subscriptions/#backfilling-missed-data-after-reconnection); a higher head number alone does not resolve a conflicting hash. The interval trades freshness for fewer scan opportunities; it does not guarantee lower total CU. Measure actual log queries, block reads and end-to-end lag, and account for WebSocket notifications separately under the [billing rules](https://docs.blockvectra.com/en/guides/websocket-subscriptions/#billing-rules). A filtered `logs` subscription can deliver matching events directly, but still needs the disconnect and reorganization recovery below. ## Reconnection and exponential backoff To prevent synchronized reconnection storms when connections drop, clients must implement exponential backoff with full jitter: * **Backoff formula**: Before the n-th reconnection attempt (n = 0, 1, 2, ...), wait for a duration chosen uniformly at random: ``` delay = random(0, min(20s, 0.5s * 2^n)) ``` * **Reset counter**: Reset retry counter n to 0 only after maintaining an uninterrupted, stable connection for at least `60 seconds`. * **Close code 1012**: Introduce randomized initial delay before first reconnect attempt to avoid synchronized reconnection spikes. * **Non-retryable codes**: Do not reconnect automatically on [4402](https://docs.blockvectra.com/en/errors/#4402), [4404](https://docs.blockvectra.com/en/errors/#4404), [1003](https://docs.blockvectra.com/en/errors/#1003), or [1009](https://docs.blockvectra.com/en/errors/#1009). ### Backfilling missed data after reconnection WebSocket subscriptions do not persist across connections; notifications emitted during a disconnection are not retained on the server. Following reconnection, clients should execute a catch-up strategy: 1. **Backfill logs with `eth_getLogs`**: * Persist `last_processed_block` together with its block hash as the durable checkpoint for contiguous committed work. Keep it separate from the highest live block notification seen; receiving one log does not prove the rest of that block has been processed. * On reconnect, re-subscribe with the same `address`/`topics` filter first, then buffer live events while catching up. Keep the buffer bounded; on overflow or catch-up failure, stop advancing the checkpoint and resume from durable state instead of silently dropping events. * After subscribing, call `eth_getBlockByNumber("latest", false)` once for this catch-up pass and capture its number and hash as a fixed upper bound (`catchup_to_block`). Do not wait for a log notification to choose the bound, and do not move the `latest` tag between chunks. * Replay the checkpoint block inclusively with `fromBlock: last_processed_block` and `toBlock: catchup_to_block`, keeping the same filter. Inclusive replay covers a disconnect in the middle of that block. Split the interval into chunks that respect the network's `max_logs_block_range` from `GET /v1/chains`. * Deduplicate replayed and buffered live logs by `(blockHash, transactionHash, logIndex)`. Advance the checkpoint only after the entire contiguous replay interval succeeds and its effects and checkpoint are durably committed; on failure, keep the previous committed checkpoint. A live log alone never advances this recovery boundary. * Compare saved block hashes against the chain for reorgs. On a mismatch, roll back to a known common ancestor and replay; deduplication alone does not perform that rollback. 2. **Backfill block headers with `eth_getBlockByNumber`**: * Record the latest block number and hash received before disconnect. * Re-subscribe to `newHeads`. * Query `eth_getBlockByNumber("latest", false)` and fetch missing intermediate blocks sequentially. Verify `parentHash` chain continuity to detect reorgs. ## Limits | Limit | Value | Result when exceeded | | ------------------------------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------- | | Subscriptions per WebSocket connection | 100 | `-32022` [`subscription_limit`](https://docs.blockvectra.com/en/errors/#subscription_limit) | | `newHeads` subscriptions per WebSocket connection | 4 | `-32022` [`subscription_limit`](https://docs.blockvectra.com/en/errors/#subscription_limit) | | `logs` subscription filter requirements | Must specify an `address` or a `topic0` (first position in `topics`) | `-32602` [`logs_filter_required`](https://docs.blockvectra.com/en/errors/#logs_filter_required) | ## Next steps * [Browse the datasets directory](https://blockvectra.com/en/data/) to see every dataset BlockVectra indexes. * [See the free plan and pricing](https://blockvectra.com/en/pricing/#free) to check what your account includes. * [Log in to the console](https://console.blockvectra.com/login/?next=%2Fkeys%2F) to create an API key. --- # Quickstart Source: https://docs.blockvectra.com/en/quickstart/ Developers and AI agents can use this free blockchain RPC API with no API key: try the public RPC without a key, then create a key to continue. ## 1. Read a block height without a key Call the public JSON-RPC endpoint for the example chain without creating an account or providing an API key: ```bash curl -s "https://api.blockvectra.com/v1/robinhood_mainnet/public" \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' ``` The response's `id: 1` matches this request; `result` is a hexadecimal block height and can change between calls. If the response contains `error`, check its code and reason. See [free public RPC endpoints](https://blockvectra.com/en/free/#public-rpc) for public methods, history ranges and per-IP limits. For a Python 3.10+ alternative, clone [agent-quickstart](https://github.com/blockvectra/agent-quickstart) and run its [public chain example](https://github.com/blockvectra/agent-quickstart/blob/main/examples/public_chain.py). It uses only the Python standard library, needs no packages, and defaults to `robinhood_mainnet` (chain ID `4663`). Success confirms chain identity; it makes at most 2 HTTP requests, including 1 RPC call. ```bash git clone https://github.com/blockvectra/agent-quickstart.git cd agent-quickstart python3 examples/public_chain.py ``` ## 2. Create an API key Go to the [console](https://console.blockvectra.com/login/?next=%2Fkeys%2F), log in with GitHub, Google or an Ethereum wallet (your account is created on first login), and create an API key. The secret is only displayed once: store it securely and set it as the environment variable `BLOCKVECTRA_API_KEY`. Keep it out of client-side browser code. New accounts get 30,000,000 CU on sign-up — no credit card. > **No API key yet?** > > If you have an Ethereum wallet: follow the [Programmatic sign-up guide](https://docs.blockvectra.com/en/guides/programmatic-signup/) to sign up and create an API key using an Ethereum wallet signature without a browser. If you do not have a wallet: ask the user to sign in at [console.blockvectra.com](https://console.blockvectra.com/login/?next=%2Fkeys%2F), create a key, and set it as the environment variable `BLOCKVECTRA_API_KEY`. Do not ask the user to paste the key into the chat. ## 3. Send your first authenticated call Read the same chain's block height with the `x-api-key` header. The URL ends with the chain name, without a trailing slash: ```bash : "${BLOCKVECTRA_API_KEY:?Set BLOCKVECTRA_API_KEY first}" curl -s "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' ``` `result` is again a hexadecimal block height. This request consumes CU; see the [JSON-RPC reference](https://docs.blockvectra.com/en/api/json-rpc/) for method weights and error codes, and [Pricing](https://blockvectra.com/en/pricing/) for current prices. A new key takes effect in about 5 seconds; if you get `invalid_api_key`, wait a moment and retry. See [Common errors](https://docs.blockvectra.com/en/quickstart/#common-errors) below for other failures. ## 4. Continue with a business task * [Query on-chain tokenized stock activity on Robinhood Chain](https://docs.blockvectra.com/en/guides/stocks/) * [Backfill HyperEVM logs in chunks](https://docs.blockvectra.com/en/guides/hyperevm-backfill/) * [Receive wallet activity and token transfers with webhooks](https://docs.blockvectra.com/en/guides/webhook-push/) ## Reference ### API keys and balance Complete starter template: [blockvectra/agent-quickstart](https://github.com/blockvectra/agent-quickstart) Every key looks like `rgw_` followed by 64 hex characters, for example `rgw_1f2e...` (truncated). Keep it secret — anyone with the key can spend your balance. > When your balance is insufficient, the server returns HTTP 402 (JSON-RPC error code `-32020`; Data API `error.code` `insufficient_balance`). Go to the console [Billing page](https://console.blockvectra.com/billing/) to check your balance and top-up methods. ### Try without a key You can call the public JSON-RPC endpoint immediately without creating an account or providing an API key. The endpoint in the example below is rate-limited per IP (3 req/s, burst 20, batch max 10). Requests that exceed rate limits return HTTP 429 with reason `public_rate_limit` or `public_pool_busy` (with a `Retry-After` header); unsupported methods return JSON-RPC error `-32601` (`method_not_public`). ```bash # Direct public endpoint: curl -s "https://api.blockvectra.com/v1/robinhood_mainnet/public" \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' # Or using the API key fallback pattern (defaults to public when BLOCKVECTRA_API_KEY is unset): curl -s "https://api.blockvectra.com/v1/robinhood_mainnet/${BLOCKVECTRA_API_KEY:-public}" \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' ``` #### Public endpoints by chain - Arbitrum One: https://api.blockvectra.com/v1/arb_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Arc: https://api.blockvectra.com/v1/arc_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Avalanche C-Chain: https://api.blockvectra.com/v1/avax_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Base: https://api.blockvectra.com/v1/base_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Berachain: https://api.blockvectra.com/v1/berachain_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Boba: https://api.blockvectra.com/v1/boba_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - BNB Smart Chain: https://api.blockvectra.com/v1/bsc_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Celo: https://api.blockvectra.com/v1/celo_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Ethereum: https://api.blockvectra.com/v1/eth_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Ethereum Sepolia: https://api.blockvectra.com/v1/eth_sepolia/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Fraxtal: https://api.blockvectra.com/v1/fraxtal_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Gnosis: https://api.blockvectra.com/v1/gnosis_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - HyperEVM: https://api.blockvectra.com/v1/hyperevm_mainnet/public — Read-only - Ink: https://api.blockvectra.com/v1/ink_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Katana: https://api.blockvectra.com/v1/katana_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Linea: https://api.blockvectra.com/v1/linea_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Metal L2: https://api.blockvectra.com/v1/metall2_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Mode: https://api.blockvectra.com/v1/mode_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - OP Mainnet: https://api.blockvectra.com/v1/op_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Polygon: https://api.blockvectra.com/v1/polygon_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Robinhood Chain: https://api.blockvectra.com/v1/robinhood_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Robinhood Chain Testnet: https://api.blockvectra.com/v1/robinhood_testnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Rootstock: https://api.blockvectra.com/v1/rootstock_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Soneium: https://api.blockvectra.com/v1/soneium_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Sonic: https://api.blockvectra.com/v1/sonic_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Unichain: https://api.blockvectra.com/v1/unichain_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - World Chain: https://api.blockvectra.com/v1/world_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - X Layer: https://api.blockvectra.com/v1/xlayer_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) - Zora: https://api.blockvectra.com/v1/zora_mainnet/public — Read and broadcast signed transactions (eth_sendRawTransaction) Arbitrum One: public.history_blocks: 1000 Arc: public.history_blocks: 1000 Avalanche C-Chain: public.history_blocks: 128 Base: public.history_blocks: 1000 Berachain: public.history_blocks: 1000 Boba: public.history_blocks: 1000 BNB Smart Chain: public.history_blocks: 100 Celo: public.history_blocks: 1000 Ethereum: public.history_blocks: 1000 Ethereum Sepolia: public.history_blocks: 1000 Fraxtal: public.history_blocks: 1000 Gnosis: public.history_blocks: 1000 HyperEVM: public.history_blocks: 1000 Ink: public.history_blocks: 1000 Katana: public.history_blocks: 1000 Linea: public.history_blocks: 128 Metal L2: public.history_blocks: 1000 Mode: public.history_blocks: 1000 OP Mainnet: public.history_blocks: 1000 Polygon: public.history_blocks: 126 Robinhood Chain: eth_getLogs / public.logs: {"address_required":true,"max_addresses":1,"max_block_range":100,"max_results":1000,"max_response_bytes":1048576,"batch_max":1,"block_hash_supported":false} Robinhood Chain: public.history_blocks: 900 Robinhood Chain Testnet: public.history_blocks: 1000 Rootstock: public.history_blocks: 1000 Soneium: public.history_blocks: 1000 Sonic: public.history_blocks: 1000 Unichain: public.history_blocks: 1000 World Chain: public.history_blocks: 1000 X Layer: public.history_blocks: 1000 Zora: public.history_blocks: 1000 The following two public metadata endpoints show service status and each chain's configuration; they require no API key and are not billed. ### Check service and chain health status ```bash curl https://api.blockvectra.com/v1/status ``` Returns the check timestamp `checked_at`, service operational status `gateway.status`, and each supported chain's node sync progress `sync`, head block height, and latency `head`: ```json { "checked_at": "2026-10-03T13:30:47Z", "gateway": { "status": "ok" }, "chains": [ { "chain": "bsc_mainnet", "name": "BNB Smart Chain", "chain_id": 56, "jsonrpc": true, "data": true, "data_features": [ "blocks", "transactions", "address_transactions", "transfers", "token_metadata", "freshness" ], "data_status": "ok", "data_head_block": 125492675, "data_head_age_seconds": 3, "status": "ok", "sync": { "stage": "synced", "node_block": 125492676, "target_block": null }, "head": { "block": 125492676, "time": "2026-10-03T13:30:45Z", "lag_seconds": 2 } } ] } ``` ### Query supported chains and method policies ```bash curl https://api.blockvectra.com/v1/chains ``` Returns each supported chain's `chain_id`, capability flags for JSON-RPC, Data API, and WebSocket, method allow and deny policies (`methods.allow` and `methods.deny`), single-query log block range limit `max_logs_block_range`, and historical state window `state_window_blocks`: ```json { "chains": [ { "chain": "bsc_mainnet", "name": "BNB Smart Chain", "chain_id": 56, "jsonrpc": true, "data": true, "ws": false, "subscriptions": [], "methods": { "allow": [ "eth_blockNumber", "eth_call", "eth_chainId", "eth_getLogs" ], "deny": [ "eth_newFilter", "eth_subscribe", "eth_unsubscribe" ] }, "max_logs_block_range": 1000, "state_window_blocks": 100, "info": {} } ] } ``` ### Choose a chain Every BlockVectra endpoint is scoped to a chain: JSON-RPC requests carry the chain name `{chain}` in the URL path, and Data API requests prefix the route with it. See [Supported Chains](https://docs.blockvectra.com/en/chains/) for the chains currently available and their identifiers. JSON-RPC endpoint examples follow the example chain selection. The Data API examples below use `robinhood_mainnet`. ### Other authentication options and language examples JSON-RPC endpoints are scoped to a chain: `POST /v1/{chain}/{api_key}` with the key in the path, or `POST /v1/{chain}` with the key in the `x-api-key` header. `{chain}` is the chain name the Data API also uses; the example endpoint is `https://api.blockvectra.com/v1/robinhood_mainnet`. Calling `eth_subscribe` over HTTP returns `-32601`; WebSocket subscriptions are listed per chain in [Supported Chains](https://docs.blockvectra.com/en/chains/). The API sends `Access-Control-Allow-Origin: *`, but you should keep your API key secret and make requests from a backend service rather than client-side browser code. You can pass the key in one of three ways: in the URL path (`POST /v1/{chain}/{api_key}`, which uses only the key in the path and ignores both headers), in the `x-api-key` header, or in an `Authorization: Bearer ` header. #### Key in the URL path **cURL** ```bash : "${BLOCKVECTRA_API_KEY:?Set BLOCKVECTRA_API_KEY first}" curl -s "https://api.blockvectra.com/v1/robinhood_mainnet/$BLOCKVECTRA_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' ``` **TypeScript** ```ts import { createPublicClient, http } from "viem"; const key = process.env.BLOCKVECTRA_API_KEY!; const client = createPublicClient({ transport: http(`https://api.blockvectra.com/v1/robinhood_mainnet/${key}`), }); console.log(await client.getBlockNumber()); // Run with: npx tsx example.mts ``` Complete starter template: [blockvectra/multichain-viem](https://github.com/blockvectra/multichain-viem) **Python** ```python import os from web3 import Web3 w3 = Web3(Web3.HTTPProvider("https://api.blockvectra.com/v1/robinhood_mainnet/" + os.environ["BLOCKVECTRA_API_KEY"])) print(w3.eth.block_number) ``` **Go** ```go // Run with: go mod init example && go get github.com/ethereum/go-ethereum && go mod tidy && go run . package main import ( "context" "fmt" "log" "os" "github.com/ethereum/go-ethereum/ethclient" ) func main() { client, err := ethclient.Dial("https://api.blockvectra.com/v1/robinhood_mainnet/" + os.Getenv("BLOCKVECTRA_API_KEY")) if err != nil { log.Fatal(err) } number, err := client.BlockNumber(context.Background()) if err != nil { log.Fatal(err) } fmt.Println(number) } ``` **Rust** ```toml [dependencies] alloy = { version = "1", features = ["provider-http", "rpc-types"] } tokio = { version = "1", features = ["macros", "rt-multi-thread"] } ``` ```rust use alloy::providers::{Provider, ProviderBuilder}; #[tokio::main] async fn main() -> Result<(), Box> { let key = std::env::var("BLOCKVECTRA_API_KEY")?; let url = format!("https://api.blockvectra.com/v1/robinhood_mainnet/{key}"); let provider = ProviderBuilder::new().connect_http(url.parse()?); println!("{}", provider.get_block_number().await?); Ok(()) } ``` #### Key in a request header **cURL** ```bash : "${BLOCKVECTRA_API_KEY:?Set BLOCKVECTRA_API_KEY first}" curl -s "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' ``` **TypeScript** ```ts import { createPublicClient, http } from "viem"; const key = process.env.BLOCKVECTRA_API_KEY!; const client = createPublicClient({ transport: http("https://api.blockvectra.com/v1/robinhood_mainnet", { fetchOptions: { headers: { "x-api-key": key } }, }), }); console.log(await client.getBlockNumber()); // Run with: npx tsx example.mts ``` **Python** ```python import os from web3 import Web3 key = os.environ["BLOCKVECTRA_API_KEY"] # request_kwargs replaces the provider's default headers entirely, so # Content-Type must be repeated here or the server can't parse the body. headers = {"Content-Type": "application/json", "x-api-key": key} w3 = Web3(Web3.HTTPProvider("https://api.blockvectra.com/v1/robinhood_mainnet", request_kwargs={"headers": headers})) print(w3.eth.block_number) ``` **Go** ```go // Run with: go mod init example && go get github.com/ethereum/go-ethereum && go mod tidy && go run . package main import ( "context" "fmt" "log" "os" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rpc" ) func main() { ctx := context.Background() c, err := rpc.DialOptions(ctx, "https://api.blockvectra.com/v1/robinhood_mainnet", rpc.WithHeader("x-api-key", os.Getenv("BLOCKVECTRA_API_KEY"))) if err != nil { log.Fatal(err) } number, err := ethclient.NewClient(c).BlockNumber(ctx) if err != nil { log.Fatal(err) } fmt.Println(number) } ``` **Rust** ```toml [dependencies] alloy = { version = "1", features = ["provider-http", "rpc-types"] } tokio = { version = "1", features = ["macros", "rt-multi-thread"] } reqwest = "0.13" ``` ```rust use alloy::providers::{Provider, ProviderBuilder}; use alloy::rpc::client::RpcClient; use reqwest::header::{HeaderMap, HeaderValue}; #[tokio::main] async fn main() -> Result<(), Box> { let key = std::env::var("BLOCKVECTRA_API_KEY")?; let mut headers = HeaderMap::new(); headers.insert("x-api-key", HeaderValue::from_str(&key)?); let http_client = reqwest::Client::builder().default_headers(headers).build()?; let rpc_client = RpcClient::new_http_with_client(http_client, "https://api.blockvectra.com/v1/robinhood_mainnet".parse()?); let provider = ProviderBuilder::new().connect_client(rpc_client); println!("{}", provider.get_block_number().await?); Ok(()) } ``` > **No trailing slash** > > When you pass the key in a header, call `https://api.blockvectra.com/v1/robinhood_mainnet` exactly as shown: the URL ends > with the chain name, **without** a trailing slash. JSON-RPC is served only at `/v1/{chain}` > and `/v1/{chain}/{api_key}`. A trailing slash (like `/v1/{chain}/`) or a request without a chain segment (like `/v1` or `/v1/`) returns `404` with an empty body. An `Authorization: Bearer ` header also works. On `POST /v1/{chain}`, a non-empty `x-api-key` takes precedence over Bearer, and Bearer is used only when `x-api-key` is absent or empty. The path form ignores both headers. ### Batch calls Send an array to make several calls in one request (up to 100 per batch). Note that each API key has a CU bucket (`cu_per_sec` refill, `burst_cu` capacity — defaults are 100 CU/s and burst 400 CU; after a paid top-up each key is at least 2,000 CU/s and burst 10,000 CU, and higher custom limits are kept; 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`, even under the 100-calls-per-batch limit; split it into smaller batches. This example reads the chain ID and an account balance in a single round trip: **cURL** ```bash curl -s "https://api.blockvectra.com/v1/robinhood_mainnet" \ -H 'Content-Type: application/json' \ -H "x-api-key: $BLOCKVECTRA_API_KEY" \ -d '[ {"jsonrpc":"2.0","id":1,"method":"eth_chainId"}, {"jsonrpc":"2.0","id":2,"method":"eth_getBalance","params":["0x1111111111111111111111111111111111111111","latest"]} ]' ``` **TypeScript** ```ts import { createPublicClient, http } from "viem"; const key = process.env.BLOCKVECTRA_API_KEY!; const client = createPublicClient({ transport: http("https://api.blockvectra.com/v1/robinhood_mainnet", { batch: true, fetchOptions: { headers: { "x-api-key": key } }, }), }); // viem coalesces concurrent requests into a single JSON-RPC batch. const [chainId, balance] = await Promise.all([ client.getChainId(), client.getBalance({ address: "0x1111111111111111111111111111111111111111" }), ]); console.log(chainId, balance); // Run with: npx tsx example.mts ``` **Python** ```python import os from web3 import Web3 key = os.environ["BLOCKVECTRA_API_KEY"] headers = {"Content-Type": "application/json", "x-api-key": key} w3 = Web3(Web3.HTTPProvider("https://api.blockvectra.com/v1/robinhood_mainnet", request_kwargs={"headers": headers})) with w3.batch_requests() as batch: batch.add(w3.eth.chain_id) batch.add(w3.eth.get_balance("0x1111111111111111111111111111111111111111")) chain_id, balance = batch.execute() print(chain_id, balance) ``` **Go** ```go // Run with: go mod init example && go get github.com/ethereum/go-ethereum && go mod tidy && go run . package main import ( "context" "fmt" "log" "os" "github.com/ethereum/go-ethereum/rpc" ) func main() { ctx := context.Background() c, err := rpc.DialOptions(ctx, "https://api.blockvectra.com/v1/robinhood_mainnet", rpc.WithHeader("x-api-key", os.Getenv("BLOCKVECTRA_API_KEY"))) if err != nil { log.Fatal(err) } var chainID, balance string calls := []rpc.BatchElem{ {Method: "eth_chainId", Result: &chainID}, {Method: "eth_getBalance", Args: []any{"0x1111111111111111111111111111111111111111", "latest"}, Result: &balance}, } if err := c.BatchCallContext(ctx, calls); err != nil { log.Fatal(err) } for _, call := range calls { if call.Error != nil { log.Fatal(call.Error) } } fmt.Println(chainID, balance) } ``` **Rust** ```toml [dependencies] alloy = { version = "1", features = ["provider-http", "rpc-types"] } tokio = { version = "1", features = ["macros", "rt-multi-thread"] } reqwest = "0.13" ``` ```rust use alloy::primitives::{Address, U256}; use alloy::rpc::client::RpcClient; use reqwest::header::{HeaderMap, HeaderValue}; #[tokio::main] async fn main() -> Result<(), Box> { let key = std::env::var("BLOCKVECTRA_API_KEY")?; let mut headers = HeaderMap::new(); headers.insert("x-api-key", HeaderValue::from_str(&key)?); let http_client = reqwest::Client::builder().default_headers(headers).build()?; let rpc_client = RpcClient::new_http_with_client(http_client, "https://api.blockvectra.com/v1/robinhood_mainnet".parse()?); let address: Address = "0x1111111111111111111111111111111111111111".parse()?; let mut batch = rpc_client.new_batch(); let chain_id = batch.add_call::<_, U256>("eth_chainId", &())?; let balance = batch.add_call::<_, U256>("eth_getBalance", &(address, "latest"))?; batch.send().await?; println!("{} {}", chain_id.await?, balance.await?); Ok(()) } ``` Responses come back as an array, in the same order as the requests, matched by `id`. If the server rejects the whole batch instead — insufficient balance, rate limiting, burst capacity, or an oversized batch (see [Common errors](https://docs.blockvectra.com/en/quickstart/#common-errors) 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. ### Understand CU billing Every billed call consumes **Compute Units (CU)**: cheap calls like `eth_blockNumber` or `eth_chainId` cost the least, common reads like `eth_getBlockByNumber` cost a little more, heavier calls like `eth_call` or `eth_getLogs` cost more, and execution trace methods (such as `debug_traceTransaction`) cost the most. Usage is charged per account per hourly period, rounded down to whole billing units (1 unit = 1,000 CU), with the remainder carrying over to the next period (so across periods the total charged is `floor(total CU / 1,000)`); settlement runs about 15 minutes after the period ends. For example: 508 CU carried over + 2557 CU consumed = 3065 CU, resulting in 3 billing units charged and 65 CU carried over to the next period. See [Pricing](https://blockvectra.com/en/pricing/) for current prices. The full method-by-method weight table and error codes live in [API Reference → JSON-RPC](https://docs.blockvectra.com/en/api/json-rpc/) — this page only covers the shape of a request. #### Common errors | What you did | What comes back | Action | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Unknown or not yet public chain | HTTP `404` with JSON body `error.data.reason: "unknown_chain"` | Check the chain name in the URL | | Request without a chain segment (e.g. `/v1` or `/v1/`) | HTTP `404` with an empty body | Include the chain name in the URL (`/v1/{chain}`) | | API key missing, unknown or disabled | HTTP `401`, JSON-RPC code `-32024` (`missing_api_key` or `invalid_api_key`) | Use a valid, active API key (brand-new or rotated keys take effect on every instance within about 5 seconds; during this time they may return 401 `invalid_api_key`, or 503 `-32021` (with `Retry-After`) when the billing state cannot be confirmed for the moment, so wait a moment and retry) | | Balance is zero or negative | HTTP `402`, JSON-RPC code `-32020` | Top up your balance or wait for the free refill | | Sent requests too quickly (rate limit or temporary overload) | HTTP `429` (or `200`), JSON-RPC code `-32005` | Retry later (honour `Retry-After` when present) | | Single request or batch exceeds key burst capacity (`burst_cu`, default 400 CU; default rate 100 CU/s) (paid accounts: at least 10,000 CU burst, 2,000 CU/s) | HTTP `429`, JSON-RPC code `-32022` (`request_exceeds_burst`) | Split the request into smaller batches (can never succeed as sent) | | Free-plan batch exceeds the per-second call-count limit (25 calls/s) | HTTP `429`, JSON-RPC code `-32022` (`free_plan_batch_too_large`), with `error.data.max` | Split the batch to fit the call-count limit (can never succeed as sent) | | Upstream node is temporarily unavailable | HTTP `200`, JSON-RPC code `-32603` (`upstream unavailable`), not billed | Retry the request | | Historical state outside this chain's state window (see `state_window_blocks` in `GET /v1/chains`) | HTTP `200`, JSON-RPC code `-32011`, not billed | Query a more recent block | | Transaction or block not found, or response too large; on Ethereum, block / receipt / log queries outside the recent window also return -32000 "old data not available due to pruning" (not billed; see [Supported Chains → Ethereum](https://docs.blockvectra.com/en/chains/#ethereum)) | HTTP `200`, JSON-RPC code `-32000` | Change the request (verify hash or block number; malformed trace hashes return transaction not found) | | Tracer not allowed, or trace timeout not allowed (`debug_trace` calls) | HTTP `200`, JSON-RPC code `-32602`, not billed | Use an allowed native tracer (`callTracer`, `flatCallTracer`, `prestateTracer`, `4byteTracer`, `noopTracer`, or omit) and timeout ≤ 30s | | A method the chain's method list does not allow (see [Supported Chains](https://docs.blockvectra.com/en/chains/)) | HTTP `200`, JSON-RPC code `-32601`, not billed | Call only methods the chain allows | | Malformed JSON body | HTTP `200`, JSON-RPC code `-32700`, not billed | Fix request JSON syntax | | More than 100 calls in one batch | HTTP `200`, JSON-RPC code `-32600` (`batch too large`), not billed | Split the batch into at most 100 calls | For key-authenticated JSON-RPC requests, within these two limit checks, the free-plan call-count check precedes the key CU burst check. If both limits would reject the batch, the reason is `free_plan_batch_too_large`. Neither `-32022` rejection includes `Retry-After`; split the request rather than retrying it unchanged. The rejections above are never billed. 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 the Billed column in [Error Codes](https://docs.blockvectra.com/en/api/json-rpc/#error-codes)). ### Call the Data API The Data API exposes read-only chain data (blocks, transactions, balances, holders, DEX activity, and more) as REST/JSON. Every route except `GET https://api.blockvectra.com/v1/data/chains` is prefixed with a chain identifier: `robinhood_mainnet` is the chain identifier (the `chain` field returned by `/chains` and in `meta`) used in every path below. `GET https://api.blockvectra.com/v1/data/chains` lists only public chains and returns only `{"data": [...]}` (no `meta`, no `next_cursor`). Requests are metered and billed in Compute Units (CU); only 2xx successful responses are billed. Every request requires the same API key as JSON-RPC — pass it in the `x-api-key` header. Every chain-scoped success response contains `data` (the payload) and `meta` (`chain`, `chain_slug` (upper-case form of `chain`), `chain_external_id`, `as_of_block`, `safe_block`, `finalized_block`, `coverage`, `refreshed_at`; `refreshed_at` may be `null`, which means the update time of the data is unknown and it should be treated as stale — block-based endpoints always return a value). Paginated list endpoints may also return `next_cursor` (an opaque string, never `null`). Pass a returned cursor back unchanged and continue until `next_cursor` is absent; some endpoints return an optimistic cursor after a full page, so the next page may be empty. Check the [Data API reference](https://docs.blockvectra.com/en/api/data/) for each endpoint's pagination support. Error responses usually contain `{"error":{"code","message"}}` — `409 not_indexed_yet` adds `indexed_through` (the highest indexed block). An unknown or not-public chain returns HTTP `404` with `error.code` `not_found` (not billed; chain names must be exact lowercase slugs); a missing, unknown, or disabled API key returns HTTP `401` with `error.code` `missing_api_key` or `invalid_api_key`. Rate-limited requests return HTTP `429` (`error.code` `rate_limited`, `data.reason: "key_rate_limit"`), and exhausted balance returns HTTP `402` (`error.code` `insufficient_balance`); both are not billed. Values that can exceed 2^53 (balances, token amounts) are decimal strings, never JSON numbers. **Look up a block by number:** **cURL** ```bash curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/blocks/72838701" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts const res = await fetch("https://api.blockvectra.com/v1/data/robinhood_mainnet/blocks/72838701", { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }); const body = await res.json(); console.log(body); // Run with: npx tsx example.mts ``` **Python** ```python import os, requests res = requests.get( "https://api.blockvectra.com/v1/data/robinhood_mainnet/blocks/72838701", headers={"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]}, ) print(res.json()) ``` ```json { "data": { "number": 72838701, "hash": "0x9f2c1e7a4b6d3f805e1c9a72b4d6f1e0a3c8b5d7e2f4a1c6b9d3e7f0a2c4b6d8", "parent_hash": "0x1a3c5e7f9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a3c5e7b9d1f3a", "timestamp": "2026-09-26T05:41:07Z", "miner": "0x00000000000000000000000000000000000a4b05", "gas_limit": 32000000, "gas_used": 4821932, "base_fee_per_gas": "100000000", "state_root": "0x2b4d6f8a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d", "transactions_root": "0x3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a3c5e", "receipts_root": "0x4d6f8a1c3e5b7d9f1a3c5e7b9d1f3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f", "tx_count": 239, "size": 48213, "l1_block_number": null, "extra": {} }, "meta": { "chain": "robinhood_mainnet", "chain_slug": "ROBINHOOD_MAINNET", "chain_external_id": "eip155:4663", "as_of_block": 72838957, "safe_block": 72838800, "finalized_block": 72838701, "coverage": "full", "refreshed_at": "2026-09-27T02:15:03Z" } } ``` A number above the indexed head (`as_of_block`) is `409` (`error.code: "not_indexed_yet"`) with `indexed_through` telling you the highest indexed block — the data isn't there yet, so retry later. A block number entirely before the chain's covered history (`coverage.from_block`) returns `422` (`error.code: "no_coverage"`). Within coverage, a number at or below `as_of_block` with no live row (never indexed, or rolled back by a reorg) is `404` (`error.code: "not_found"`). **Check data freshness** (how far each tracked dataset lags behind the chain head — useful for a status page or a pre-flight check before you trust a query): **cURL** ```bash curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/status/freshness" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts const res = await fetch("https://api.blockvectra.com/v1/data/robinhood_mainnet/status/freshness", { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! }, }); const body = await res.json(); console.log(body); // Run with: npx tsx example.mts ``` **Python** ```python import os, requests res = requests.get( "https://api.blockvectra.com/v1/data/robinhood_mainnet/status/freshness", headers={"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]}, ) print(res.json()) ``` ```json { "data": [ { "dataset": "blocks", "category": "raw", "max_block_number": 72838957, "max_day": null, "max_time": "2026-09-27T02:15:01Z", "seconds_behind": 0, "blocks_behind": null, "days_behind": null, "checked_at": "2026-09-27T02:15:07Z" } ], "meta": { "chain": "robinhood_mainnet", "chain_slug": "ROBINHOOD_MAINNET", "chain_external_id": "eip155:4663", "as_of_block": 72838957, "safe_block": 72838800, "finalized_block": 72838701, "coverage": "full", "refreshed_at": "2026-09-27T02:15:07Z" } } ``` *(Abridged: the response has one row per dataset; only the `blocks` row is shown. The `traces` row also carries `coverage_from_block`, `coverage_to_block` and `coverage_complete`.)* If freshness data is temporarily unavailable for this chain, this returns `503` (`error.code: "unavailable"`) instead of a partial result; the response carries a `Retry-After` header (seconds) — wait at least that long, then retry. **List an address's ERC-20 balances** (a snapshot filtered to non-zero balances, ordered by token): **cURL** ```bash curl -s "https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/0x1111111111111111111111111111111111111111/balances" \ -H "x-api-key: $BLOCKVECTRA_API_KEY" ``` **TypeScript** ```ts const res = await fetch( "https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/0x1111111111111111111111111111111111111111/balances", { headers: { "x-api-key": process.env.BLOCKVECTRA_API_KEY! } }, ); const body = await res.json(); console.log(body); // Run with: npx tsx example.mts ``` **Python** ```python import os, requests res = requests.get( "https://api.blockvectra.com/v1/data/robinhood_mainnet/addresses/0x1111111111111111111111111111111111111111/balances", headers={"x-api-key": os.environ["BLOCKVECTRA_API_KEY"]}, ) print(res.json()) ``` ```json { "data": [ { "token": "0x0bd7d308f8e1639fab988df18a8011f41eacad73", "balance": "185371464119396", "symbol": "WETH", "decimals": 18 }, { "token": "0x2295f15bd4914ae9b4685f01d52f4e6f89bf8b03", "balance": "10000000000000000", "symbol": "WNVDA", "decimals": 18 } ], "meta": { "chain": "robinhood_mainnet", "chain_slug": "ROBINHOOD_MAINNET", "chain_external_id": "eip155:4663", "as_of_block": 72838957, "safe_block": 72838800, "finalized_block": 72838701, "coverage": "full", "refreshed_at": "2026-09-27T02:10:00Z" } } ``` An address with no non-zero balances still returns `200` with `data: []` — never `404`. Pass `?limit=` (default 50, max 500) and the returned `next_cursor` to page through more. Full endpoint coverage — blocks, transactions, addresses, tokens, NFTs, DEX, tokenized stocks — is available in [API Reference → Data API](https://docs.blockvectra.com/en/api/data/). ### Further reading * [API Reference → JSON-RPC](https://docs.blockvectra.com/en/api/json-rpc/) — methods, CU weights, error codes * [Full JSON-RPC Reference](https://docs.blockvectra.com/en/api/json-rpc/reference/) — complete specifications, parameters, and return schemas for all supported methods * [API Reference → Data API](https://docs.blockvectra.com/en/api/data/) — REST endpoints for chain data * [Datasets](https://docs.blockvectra.com/en/datasets/) — derived datasets across supported chains * [Guides](https://docs.blockvectra.com/en/guides/) — practical guides for API integration, CU management, and multi-chain workflows * [Supported Chains](https://docs.blockvectra.com/en/chains/) — network identifiers and endpoint URLs ## FAQ ### Which chains are supported? 29 chains are supported: Arbitrum One, Arc, Avalanche C-Chain, Base, Berachain, Boba, BNB Smart Chain, Celo, Ethereum, Ethereum Sepolia, Fraxtal, Gnosis, HyperEVM, Ink, Katana, Linea, Metal L2, Mode, OP Mainnet, Polygon, Robinhood Chain, Robinhood Chain Testnet, Rootstock, Soneium, Sonic, Unichain, World Chain, X Layer, Zora. The list follows GET /v1/chains and updates when new chains launch. See the [status page](https://blockvectra.com/en/status/) for live status. [See supported chains](https://blockvectra.com/en/chains/) ### Is WebSocket supported? Calling eth_subscribe over HTTP returns -32601; on chains where ws is true in /v1/chains, eth_subscribe is available over WebSocket. Otherwise, poll eth_getLogs. [See supported chains](https://blockvectra.com/en/chains/) ### Can I query historical state and traces? Yes, but it varies by chain. The historical state window is the state_window_blocks field of /v1/chains (null means full history); whether traces are available depends on whether methods.allow for that chain includes debug_trace methods (such as debug_traceTransaction); the maximum block span for a single eth_getLogs request is max_logs_block_range. [See the chain directory and per-chain parameters](https://blockvectra.com/en/chains/) ### Can one API key be used on all chains? Yes. One API key works for JSON-RPC on every supported chain and for the Data API on chains that offer it; a key belongs to the account, not to a specific chain. [Read the one key, many chains guide](https://docs.blockvectra.com/en/guides/one-key-many-chains/)