JSON-RPC
対応する JSON-RPC メソッド、CU 重み付け、エラーコード。エンドポイントを設定し、チェーンを選び、メソッドの利用可否、料金、課金ルールを確認できます。
概要
すべてのリクエストは Compute Units (CU) で利用量を計測し、キーごとにレート制限を適用します。
- エンドポイント:
POST /v1/{chain}/{api_key}(パスにキーを指定)またはPOST /v1/{chain}(ヘッダーにキーを指定)。Robinhood Chain では、{chain}はrobinhood_mainnetです:https://api.blockvectra.com/v1/robinhood_mainnet。同じ API key をすべての対応チェーンで利用できます - プロトコル:HTTP
POST、単一の呼び出しまたはバッチ - 利用量の計測:リクエストの合計 CU コストは、到着時点でキーのバースト容量から差し引かれます。受け付けられてレスポンスが返された呼び出しは、メソッドの公開 CU 重み付けで課金されます。課金されないケースはエラーリファレンスに記載されています。料金は 1 時間ごとに精算します(整数単位に切り捨て、端数は繰り越し、期間終了の約 15 分後に実行)
- Ethereum:独自のメソッド一覧と、
state_window_blocksによって決まる状態の参照範囲があります。対応チェーン → Ethereumをご覧ください。
すべてのメソッドの完全なパラメータスキーマ、メソッドシグネチャ、インタラクティブなリクエストテストは、完全リファレンスをご覧ください。パスのバージョン管理、後方互換性のルール、推奨 SDK については、API のバージョン管理と互換性をご覧ください。
API key を取得して最初のリクエストを送信するには、クイックスタートをご覧ください。キーの渡し方とバッチリクエストも説明しています。
よく使う呼び出し
よく使う呼び出しの実例です。
ログの取得(eth_getLogs)
直近のブロック範囲でコントラクトのログを絞り込みます。ここでは ERC-20 の Transfer イベント(トピック 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef)を対象にしています。eth_getLogs の現在の CU 重み付けは、以下の CU 計測ルールの表をご覧ください。チェーンの max_logs_block_range(GET /v1/chains から取得)を超える範囲は、-32602 で拒否されます。
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
}'トランザクションのトレース(debug_traceTransaction)
callTracer を使って、トランザクションの内部呼び出しをトレースします。debug_traceTransaction の現在の CU 重み付けは、以下の CU 計測ルールの表をご覧ください。他の状態読み取りメソッドと同様に、対象ブロックがそのチェーンの直近の状態の参照範囲外になると、リクエストは拒否されます(-32011)。範囲の大きさはチェーンの state_window_blocks(GET /v1/chains から取得)です。トレースを提供するチェーンでは、過去のトレースの取得に Data API を利用してください。
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
}'CU 計測ルール
各 JSON-RPC メソッドの Compute Unit(CU)ウェイト。
| メソッド | ウェイト(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 |
メソッドポリシー
利用可能なメソッドはチェーンによって異なります。チェーンごとの一覧を以下に示します。その他の情報は対応チェーンをご覧ください。許可された名前またはパターンに一致するメソッドのみ呼び出せます。それ以外のメソッドは -32601 method not available を返します。
以下のすべてのチェーンで許可
eth_blockNumbereth_calleth_chainIdeth_estimateGaseth_feeHistoryeth_gasPriceeth_getBalanceeth_getBlockByHasheth_getBlockByNumbereth_getBlockReceiptseth_getBlockTransactionCountByHasheth_getBlockTransactionCountByNumbereth_getCodeeth_getLogseth_getStorageAteth_getTransactionByBlockHashAndIndexeth_getTransactionByBlockNumberAndIndexeth_getTransactionByHasheth_getTransactionCounteth_getTransactionReceipteth_maxPriorityFeePerGaseth_syncingnet_versionweb3_clientVersion
Arbitrum One
eth_getLogs の最大ブロック範囲:1,000 ブロック;状態の取得範囲:6,000 ブロック
追加で許可
debug_traceBlockByHashdebug_traceBlockByNumberdebug_traceCalldebug_traceTransactioneth_blobBaseFeeeth_createAccessListeth_getHeaderByHasheth_getHeaderByNumbereth_getProofeth_getRawTransactionByBlockHashAndIndexeth_getRawTransactionByBlockNumberAndIndexeth_getRawTransactionByHasheth_getUncleByBlockHashAndIndexeth_getUncleByBlockNumberAndIndexeth_getUncleCountByBlockHasheth_getUncleCountByBlockNumbereth_sendRawTransactioneth_simulateV1web3_sha3
Base
eth_getLogs の最大ブロック範囲:1,000 ブロック;状態の取得範囲:10,000 ブロック
追加で許可
eth_blobBaseFeeeth_createAccessListeth_getProofeth_simulateV1eth_getRawTransactionByHasheth_getRawTransactionByBlockHashAndIndexeth_getRawTransactionByBlockNumberAndIndexeth_getUncleCountByBlockNumbereth_getUncleCountByBlockHasheth_getUncleByBlockNumberAndIndexeth_getUncleByBlockHashAndIndexeth_getHeaderByNumbereth_getHeaderByHasheth_sendRawTransactionweb3_sha3
BNB Smart Chain
eth_getLogs の最大ブロック範囲:1,000 ブロック;状態の取得範囲:100 ブロック
追加で許可
eth_sendRawTransaction
Ethereum
eth_getLogs の最大ブロック範囲:1,000 ブロック;状態の取得範囲:250,000 ブロック
追加で許可
debug_traceBlockByHashdebug_traceBlockByNumberdebug_traceCalldebug_traceTransactioneth_blobBaseFeeeth_createAccessListeth_getProofeth_sendRawTransactiontrace_blocktrace_calltrace_gettrace_replayTransactiontrace_transactionweb3_sha3
Ethereum Sepolia
eth_getLogs の最大ブロック範囲:1,000 ブロック;状態の取得範囲:—
追加で許可
eth_blobBaseFeeeth_createAccessListeth_getProofeth_sendRawTransactionweb3_sha3
HyperEVM
このチェーンではまだトランザクションの送信に対応していません(eth_sendRawTransaction は -32601 method_not_allowed を返します)。読み取りメソッドは通常どおり利用できます。
eth_getLogs の最大ブロック範囲:1,000 ブロック;状態の取得範囲:—
Polygon
eth_getLogs の最大ブロック範囲:1,000 ブロック;状態の取得範囲:126 ブロック
追加で許可
debug_traceBlockByHashdebug_traceBlockByNumberdebug_traceCalldebug_traceTransactioneth_blobBaseFeeeth_createAccessListeth_getHeaderByHasheth_getHeaderByNumbereth_getProofeth_getRawTransactionByBlockHashAndIndexeth_getRawTransactionByBlockNumberAndIndexeth_getRawTransactionByHasheth_getUncleByBlockHashAndIndexeth_getUncleByBlockNumberAndIndexeth_getUncleCountByBlockHasheth_getUncleCountByBlockNumbereth_sendRawTransactioneth_simulateV1web3_sha3
Robinhood Chain
eth_getLogs の最大ブロック範囲:1,000 ブロック;状態の取得範囲:900 ブロック
追加で許可
eth_blobBaseFeeeth_createAccessListeth_getProofeth_simulateV1eth_getRawTransactionByHasheth_getRawTransactionByBlockHashAndIndexeth_getRawTransactionByBlockNumberAndIndexeth_getUncleCountByBlockNumbereth_getUncleCountByBlockHasheth_getUncleByBlockNumberAndIndexeth_getUncleByBlockHashAndIndexeth_getHeaderByNumbereth_getHeaderByHasheth_sendRawTransactionweb3_sha3debug_traceTransactiondebug_traceCalldebug_traceBlockByNumberdebug_traceBlockByHash
Robinhood Chain Testnet
eth_getLogs の最大ブロック範囲:1,000 ブロック;状態の取得範囲:1,023 ブロック
追加で許可
debug_traceBlockByHashdebug_traceBlockByNumberdebug_traceCalldebug_traceTransactioneth_blobBaseFeeeth_createAccessListeth_getHeaderByHasheth_getHeaderByNumbereth_getProofeth_getRawTransactionByBlockHashAndIndexeth_getRawTransactionByBlockNumberAndIndexeth_getRawTransactionByHasheth_getUncleByBlockHashAndIndexeth_getUncleByBlockNumberAndIndexeth_getUncleCountByBlockHasheth_getUncleCountByBlockNumbereth_sendRawTransactioneth_simulateV1web3_sha3
制限:
- バッチ:リクエストごとに最大 100 呼び出し。キーの CU バースト容量による制限も適用されます。以下をご覧ください。
- リクエストボディ:最大 2 MiB
- CU バースト:各 API key には CU バケットがあります(補充速度は
cu_per_sec、容量はburst_cu— デフォルトは 400 CU/s、バースト容量は 1,600 CU。コンソールのキー一覧表にキーごとに表示)。JSON-RPC バッチ全体を含め、1 つのリクエストの合計 CU がキーのバースト容量を超えると、-32022 request_exceeds_burst(request cost <N> CU exceeds burst capacity <M> CU)で拒否されます。より小さなバッチに分割してください。
エラーコード
すべてのエラーコード、課金対象かどうか、対応方法は、エラーリファレンスをご覧ください。
OpenAPI 完全リファレンス
すべてのメソッドシグネチャ、リクエストとレスポンスのスキーマ、パラメータの詳細をインタラクティブに表示する、完全な機械可読仕様は、OpenAPI 完全リファレンスをご覧ください。
最終更新: