JSON-RPC
เมธอด JSON-RPC ที่รองรับ, น้ำหนัก CU และรหัสข้อผิดพลาด ตั้งค่า endpoint, เลือกเชน และตรวจสอบความพร้อมใช้งานของเมธอด, ราคา และกฎการเรียกเก็บเงิน
ภาพรวม
คำขอทั้งหมดจะได้รับการนับเป็น Compute Units (CU) และมีการจำกัดอัตราต่อแต่ละคีย์
- Endpoint:
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 รวมของคำขอจะถูกนับหักจากความจุ burst ของคีย์ของคุณทันทีที่คำขอมาถึง ทุกการเรียกที่ได้รับการยอมรับและได้รับการตอบกลับจะถูกคิดค่าบริการตามน้ำหนัก CU ที่ประกาศไว้ของเมธอดนั้น; ข้อมูลอ้างอิงข้อผิดพลาด แสดงรายการกรณีที่ไม่คิดค่าบริการ การเรียกเก็บเงินจะสรุปยอดเป็นรายชั่วโมง (ปัดเศษลงเป็นหน่วยเต็ม ส่วนที่เหลือจะยกยอดไป ดำเนินการ ~15 นาทีหลังจากสิ้นสุดแต่ละรอบเวลา)
- Ethereum: มีรายการเมธอดของตนเองและหน้าต่างสถานะที่กำหนดโดย
state_window_blocks— ดู เชนที่รองรับ → Ethereum
สำหรับสคีมาพารามิเตอร์ฉบับสมบูรณ์, ลายเซ็นเมธอด และการทดสอบคำขอแบบอินเทอร์แอคทีฟสำหรับทุกเมธอด โปรดดู ข้อมูลอ้างอิงฉบับสมบูรณ์ สำหรับการกำหนดเวอร์ชันของพาธ, กฎความเข้ากันได้ย้อนหลัง และคำแนะนำเกี่ยวกับ SDK โปรดดู การกำหนดเวอร์ชันและความเข้ากันได้ของ API
หากต้องการรับ API key และส่งคำขอแรก โปรดดู เริ่มต้นใช้งานอย่างรวดเร็ว ซึ่งครอบคลุมถึงการส่งคีย์และคำขอแบบเป็นชุดด้วยเช่นกัน
การเรียกที่พบบ่อย
ตัวอย่างการใช้งานจริงสำหรับการเรียกที่พบบ่อย
ดึงข้อมูล Log (eth_getLogs)
กรอง log ของสัญญาตามช่วงบล็อกล่าสุด — ในที่นี้คือเหตุการณ์ Transfer ของ ERC-20 (topic 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef) ดูตาราง กฎการวัดปริมาณ CU ด้านล่างสำหรับน้ำหนัก CU ปัจจุบันของ eth_getLogs; คำขอที่ระบุช่วงบล็อกกว้างกว่า 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
}'Trace ธุรกรรม (debug_traceTransaction)
ติดตามการเรียกภายในของธุรกรรมด้วย callTracer ดูตาราง กฎการวัดปริมาณ CU ด้านล่างสำหรับน้ำหนัก CU ปัจจุบันของ debug_traceTransaction เช่นเดียวกับเมธอดอ่านสถานะอื่นๆ คำขอจะถูกปฏิเสธหากบล็อกเป้าหมายอยู่นอกหน้าต่างสถานะล่าสุดของเชนนั้น (-32011) ขนาดของหน้าต่างสถานะคือ state_window_blocks ของเชน (จาก GET /v1/chains) สำหรับเชนที่ให้บริการ trace โปรดใช้ Data API เพื่อดึงข้อมูล trace ย้อนหลัง
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
น้ำหนัก Compute Unit (CU) สำหรับแต่ละเมธอด JSON-RPC
| เมธอด | น้ำหนัก (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 บล็อก; หน้าต่างสถานะ: 5,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 burst ของคีย์เช่นกัน ดูรายละเอียดด้านล่าง
- เนื้อหาคำขอ: สูงสุด 2 MiB
- CU burst: แต่ละ API key มีบักเก็ต CU (
cu_per_secอัตราเติม,burst_cuความจุ — ค่าเริ่มต้นคือ 400 CU/s และ burst 1,600 CU; แสดงแยกตามคีย์ในตาราง Keys ของคอนโซล) คำขอเดี่ยว — ซึ่งรวมถึงการเรียก JSON-RPC ทั้งชุด — ที่มี CU รวมเกินกว่าความจุ burst ของคีย์จะถูกปฏิเสธด้วย-32022 request_exceeds_burst(request cost <N> CU exceeds burst capacity <M> CU); โปรดแยกออกเป็นชุดย่อยลง
รหัสข้อผิดพลาด
โปรดดู ข้อมูลอ้างอิงข้อผิดพลาด สำหรับรหัสข้อผิดพลาดทั้งหมด การคิดค่าบริการ และสิ่งที่ควรปฏิบัติ
ข้อมูลอ้างอิง OpenAPI ฉบับสมบูรณ์
ดู ข้อมูลอ้างอิง OpenAPI ฉบับสมบูรณ์ สำหรับข้อกำหนดที่เครื่องอ่านได้แบบสมบูรณ์ พร้อมด้วยลายเซ็นเมธอดทั้งหมด, สคีมาคำขอและการตอบกลับ ตลอดจนรายละเอียดพารามิเตอร์ที่แสดงผลแบบอินเทอร์แอคทีฟ
อัปเดตล่าสุด:
เชนที่รองรับ
เครือข่ายบล็อกเชนที่รองรับ, Chain ID, โครงสร้าง URL และความพร้อมใช้งานของฟีเจอร์ ตรวจสอบ endpoint, เมธอด และความครอบคลุมของชุดข้อมูลในแต่ละเชน
ข้อมูลอ้างอิงฉบับสมบูรณ์
ข้อกำหนด API JSON-RPC 2.0 ฉบับสมบูรณ์และดัชนี endpoint เรียกดูเมธอดที่รองรับทั้งหมด รูปแบบคำขอและการตอบกลับ ชนิดสคีมา และรหัสข้อผิดพลาด