JSON-RPC

JSON-RPC

Metode JSON-RPC yang didukung, bobot CU, dan kode error. Siapkan endpoint, pilih rantai, dan periksa ketersediaan metode, harga, serta aturan penagihan.

Ikhtisar

Semua permintaan dihitung dalam Compute Unit (CU) dan dibatasi laju per kunci.

  • Endpoint: POST /v1/{chain}/{api_key} (kunci di path) atau POST /v1/{chain} (kunci di header). Untuk Robinhood Chain, {chain} adalah robinhood_mainnet: https://api.blockvectra.com/v1/robinhood_mainnet. API key yang sama berfungsi di setiap rantai yang didukung
  • Protokol: HTTP POST, panggilan tunggal atau batch
  • Pengukuran: Total biaya CU permintaan dihitung terhadap kapasitas burst kunci Anda segera setelah tiba. Setiap panggilan yang diterima dan mendapatkan respons akan ditagih sesuai bobot CU yang dipublikasikan; Referensi error mencantumkan kasus yang tidak ditagih. Penagihan diselesaikan setiap jam (dibulatkan ke bawah ke unit utuh, sisa dipindahkan ke periode berikutnya, dijalankan ~15 menit setelah periode berakhir)
  • Ethereum: daftar metodenya sendiri dan jendela status yang ditentukan oleh state_window_blocks — lihat Rantai yang Didukung → Ethereum.

Untuk skema parameter lengkap, tanda tangan metode, dan pengujian permintaan interaktif di semua metode, lihat Referensi Lengkap. Untuk penerapan versi path, aturan kompatibilitas mundur, dan rekomendasi SDK, lihat Penerapan versi dan kompatibilitas API.

Untuk mendapatkan API key dan mengirim permintaan pertama, lihat Mulai Cepat; bagian ini juga membahas pengiriman kunci dan permintaan batch.

Panggilan umum

Contoh praktis untuk panggilan umum.

Kueri log (eth_getLogs)

Filter log kontrak pada rentang blok terkini — di sini, peristiwa ERC-20 Transfer (topik 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef). Lihat tabel Aturan pengukuran CU di bawah untuk bobot CU saat ini dari eth_getLogs; rentang yang lebih luas dari max_logs_block_range rantai (dari GET /v1/chains) akan ditolak dengan -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
  }'

Lacak transaksi (debug_traceTransaction)

Lacak panggilan internal transaksi dengan callTracer. Lihat tabel Aturan pengukuran CU di bawah untuk bobot CU saat ini dari debug_traceTransaction. Seperti metode pembacaan status lainnya, metode ini ditolak saat blok target berada di luar jendela status terkini rantai (-32011). Ukuran jendela adalah state_window_blocks rantai (dari GET /v1/chains). Pada rantai yang menyediakan trace, gunakan Data API untuk trace historis.

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
  }'

Aturan pengukuran CU

Bobot Compute Unit (CU) untuk setiap metode JSON-RPC.

MetodeBobot (CU)
eth_blockNumber1
eth_chainId1
eth_getBlockByNumber5
eth_blobBaseFee10
eth_feeHistory10
eth_gasPrice10
eth_getBalance10
eth_getBlockByHash10
eth_getBlockReceipts10
eth_getBlockTransactionCountByHash10
eth_getBlockTransactionCountByNumber10
eth_getCode10
eth_getHeaderByHash10
eth_getHeaderByNumber10
eth_getProof10
eth_getRawTransactionByBlockHashAndIndex10
eth_getRawTransactionByBlockNumberAndIndex10
eth_getRawTransactionByHash10
eth_getStorageAt10
eth_getTransactionByBlockHashAndIndex10
eth_getTransactionByBlockNumberAndIndex10
eth_getTransactionByHash10
eth_getTransactionCount10
eth_getTransactionReceipt10
eth_getUncleByBlockHashAndIndex10
eth_getUncleByBlockNumberAndIndex10
eth_getUncleCountByBlockHash10
eth_getUncleCountByBlockNumber10
eth_maxPriorityFeePerGas10
eth_syncing10
net_version10
web3_clientVersion10
web3_sha310
eth_call15
eth_createAccessList20
eth_estimateGas20
eth_simulateV120
eth_getLogs30
eth_sendRawTransaction30
debug_traceBlockByHash100
debug_traceBlockByNumber100
debug_traceCall100
debug_traceTransaction100
trace_block100
trace_call100
trace_get100
trace_replayTransaction100
trace_transaction100

Kebijakan metode

Metode yang tersedia bervariasi menurut rantai; daftar setiap rantai ditampilkan di bawah, dan Rantai yang Didukung mencakup informasi lainnya. Hanya metode yang cocok dengan nama atau pola yang diizinkan yang dapat dijangkau; metode lainnya mengembalikan -32601 method not available.

Diizinkan di semua rantai di bawah ini

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

Arbitrum One

Rentang blok maksimum eth_getLogs: 1,000 blok; Jendela status: 6,000 blok

Juga diizinkan

  • debug_traceBlockByHash
  • debug_traceBlockByNumber
  • debug_traceCall
  • debug_traceTransaction
  • eth_blobBaseFee
  • eth_createAccessList
  • eth_getHeaderByHash
  • eth_getHeaderByNumber
  • eth_getProof
  • eth_getRawTransactionByBlockHashAndIndex
  • eth_getRawTransactionByBlockNumberAndIndex
  • eth_getRawTransactionByHash
  • eth_getUncleByBlockHashAndIndex
  • eth_getUncleByBlockNumberAndIndex
  • eth_getUncleCountByBlockHash
  • eth_getUncleCountByBlockNumber
  • eth_sendRawTransaction
  • eth_simulateV1
  • web3_sha3

Base

Rentang blok maksimum eth_getLogs: 1,000 blok; Jendela status: 10,000 blok

Juga diizinkan

  • eth_blobBaseFee
  • eth_createAccessList
  • eth_getProof
  • eth_simulateV1
  • eth_getRawTransactionByHash
  • eth_getRawTransactionByBlockHashAndIndex
  • eth_getRawTransactionByBlockNumberAndIndex
  • eth_getUncleCountByBlockNumber
  • eth_getUncleCountByBlockHash
  • eth_getUncleByBlockNumberAndIndex
  • eth_getUncleByBlockHashAndIndex
  • eth_getHeaderByNumber
  • eth_getHeaderByHash
  • eth_sendRawTransaction
  • web3_sha3

BNB Smart Chain

Rentang blok maksimum eth_getLogs: 1,000 blok; Jendela status: 100 blok

Juga diizinkan

  • eth_sendRawTransaction

Ethereum

Rentang blok maksimum eth_getLogs: 1,000 blok; Jendela status: 250,000 blok

Juga diizinkan

  • debug_traceBlockByHash
  • debug_traceBlockByNumber
  • debug_traceCall
  • debug_traceTransaction
  • eth_blobBaseFee
  • eth_createAccessList
  • eth_getProof
  • eth_sendRawTransaction
  • trace_block
  • trace_call
  • trace_get
  • trace_replayTransaction
  • trace_transaction
  • web3_sha3

Ethereum Sepolia

Rentang blok maksimum eth_getLogs: 1,000 blok; Jendela status: —

Juga diizinkan

  • eth_blobBaseFee
  • eth_createAccessList
  • eth_getProof
  • eth_sendRawTransaction
  • web3_sha3

HyperEVM

Pengiriman transaksi belum didukung di rantai ini (eth_sendRawTransaction mengembalikan -32601 method_not_allowed); metode baca berfungsi normal.

Rentang blok maksimum eth_getLogs: 1,000 blok; Jendela status: —

Polygon

Rentang blok maksimum eth_getLogs: 1,000 blok; Jendela status: 126 blok

Juga diizinkan

  • debug_traceBlockByHash
  • debug_traceBlockByNumber
  • debug_traceCall
  • debug_traceTransaction
  • eth_blobBaseFee
  • eth_createAccessList
  • eth_getHeaderByHash
  • eth_getHeaderByNumber
  • eth_getProof
  • eth_getRawTransactionByBlockHashAndIndex
  • eth_getRawTransactionByBlockNumberAndIndex
  • eth_getRawTransactionByHash
  • eth_getUncleByBlockHashAndIndex
  • eth_getUncleByBlockNumberAndIndex
  • eth_getUncleCountByBlockHash
  • eth_getUncleCountByBlockNumber
  • eth_sendRawTransaction
  • eth_simulateV1
  • web3_sha3

Robinhood Chain

Rentang blok maksimum eth_getLogs: 1,000 blok; Jendela status: 900 blok

Juga diizinkan

  • eth_blobBaseFee
  • eth_createAccessList
  • eth_getProof
  • eth_simulateV1
  • eth_getRawTransactionByHash
  • eth_getRawTransactionByBlockHashAndIndex
  • eth_getRawTransactionByBlockNumberAndIndex
  • eth_getUncleCountByBlockNumber
  • eth_getUncleCountByBlockHash
  • eth_getUncleByBlockNumberAndIndex
  • eth_getUncleByBlockHashAndIndex
  • eth_getHeaderByNumber
  • eth_getHeaderByHash
  • eth_sendRawTransaction
  • web3_sha3
  • debug_traceTransaction
  • debug_traceCall
  • debug_traceBlockByNumber
  • debug_traceBlockByHash

Robinhood Chain Testnet

Rentang blok maksimum eth_getLogs: 1,000 blok; Jendela status: 1,023 blok

Juga diizinkan

  • debug_traceBlockByHash
  • debug_traceBlockByNumber
  • debug_traceCall
  • debug_traceTransaction
  • eth_blobBaseFee
  • eth_createAccessList
  • eth_getHeaderByHash
  • eth_getHeaderByNumber
  • eth_getProof
  • eth_getRawTransactionByBlockHashAndIndex
  • eth_getRawTransactionByBlockNumberAndIndex
  • eth_getRawTransactionByHash
  • eth_getUncleByBlockHashAndIndex
  • eth_getUncleByBlockNumberAndIndex
  • eth_getUncleCountByBlockHash
  • eth_getUncleCountByBlockNumber
  • eth_sendRawTransaction
  • eth_simulateV1
  • web3_sha3

Batas:

  • Batch: maksimal 100 panggilan per permintaan; juga dibatasi oleh burst CU kunci, lihat di bawah.
  • Body permintaan: maksimal 2 MiB
  • Burst CU: setiap API key memiliki bucket CU (pengisian ulang cu_per_sec, kapasitas burst_cu — default adalah 400 CU/dtk dan burst 1,600 CU; ditampilkan per kunci di tabel Keys konsol). Permintaan tunggal — termasuk seluruh batch JSON-RPC — yang total CU-nya melebihi kapasitas burst kunci akan ditolak dengan -32022 request_exceeds_burst (request cost <N> CU exceeds burst capacity <M> CU); bagi menjadi beberapa batch yang lebih kecil.

Kode error

Lihat Referensi error untuk setiap kode error, apakah ditagih, dan apa yang harus dilakukan.

Referensi OpenAPI lengkap

Lihat Referensi OpenAPI lengkap untuk spesifikasi lengkap yang dapat dibaca mesin beserta semua tanda tangan metode, skema permintaan dan respons, serta detail parameter yang dirender secara interaktif.

Terakhir diperbarui:

Di halaman ini