JSON-RPC 方法
L0vd 端点使用标准的
Ethereum JSON-RPC API。
每个请求都是带有 Content-Type: application/json 的 HTTP POST。
{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0xADDRESS","0x10D4F"]}
区块参数
读取状态的方法接受区块参数:十六进制区块号("0x10D4F")、"latest"、"safe"、
"finalized" 或 "earliest"。由于端点由归档节点支撑,任何历史区块号都可用。
常用方法
每个方法都有单独页面,包含参数、真实响应以及 cURL、viem、ethers.js、web3.py、Python 和 Go 代码:见方法参考。
| 方法 | 用途 | 归档? |
|---|---|---|
eth_blockNumber |
当前高度 | — |
eth_chainId |
确认网络 | — |
eth_getBlockByNumber / eth_getBlockByHash |
区块头与交易 | ✓ |
eth_getTransactionByHash |
交易详情 | ✓ |
eth_getTransactionReceipt |
状态、Gas、日志 | ✓ |
eth_getBlockReceipts |
一次获取区块内全部收据 | ✓ |
eth_call |
在任意区块读取合约 | ✓ |
eth_getBalance |
任意区块的原生余额 | ✓ |
eth_getCode |
任意区块的合约字节码 | ✓ |
eth_getStorageAt |
任意区块的存储槽 | ✓ |
eth_getLogs |
按地址/主题查询区块范围内的事件 | ✓ |
eth_estimateGas |
Gas 估算 | — |
eth_feeHistory、eth_gasPrice、eth_maxPriorityFeePerGas |
手续费数据 | — |
批量请求
在一次 HTTP 调用中发送请求数组以减少往返。批量中的每个请求都计入 RPS 上限。
[
{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0xA…","0x112A880"]},
{"jsonrpc":"2.0","id":2,"method":"eth_getBalance","params":["0xB…","0x112A880"]}
]
共享端点不支持
- 发送交易(
eth_sendRawTransaction)不包含在归档套餐中,如有需要请联系我们。 - WebSocket 订阅(
eth_subscribe)。 debug_*与trace_*是否可用取决于网络;如依赖这些方法,请申请专用节点。