eth_getBlockByNumber

网络: Arbitrum Sepolia · 测试网 · Chain ID 421614(0x66eee)

计为 1 个 Request。 计费规则见 Request Counting。

根据区块号返回区块信息。

参数

  1. QUANTITY|TAG — 区块号,或字符串 "earliest"、"latest"、"safe"、"finalized"、"pending"。
  2. Boolean — true 返回完整交易对象,false 仅返回交易哈希列表。

返回

Object|null — 区块对象;查不到时返回 null。

字段类型说明
numberQUANTITY区块号
hashDATA区块哈希
parentHashDATA父区块哈希
timestampQUANTITYUnix 时间戳
gasUsedQUANTITY已使用 Gas
gasLimitQUANTITYGas 上限
baseFeePerGasQUANTITY基础费(EIP-1559)
transactionsArray交易哈希或交易对象

请求

{ "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["latest", false], "id": 1 }

响应

{ "jsonrpc": "2.0", "id": 1, "result": { "number": "0x134e82a", "hash": "0xabc...def", "parentHash": "0x123...456", "timestamp": "0x65a1b2c3", "gasUsed": "0x1234", "gasLimit": "0x1c9c380", "baseFeePerGas": "0x3b9aca00", "transactions": ["0x..."] } }

代码示例

curl -X POST https://arbitrum-sepolia-rpc.blockreq.com/v1/rpc/public \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":1}'

在线试用