eth_getTransactionByBlockNumberAndIndex

根据区块编号和交易索引位置返回关于交易的信息。

Parameters

  • BLOCK-NUMBER [必须] 十六进制块号,或字符串latest, earliest or pending默认块号参数

  • TRANSACTION-INDEX [必须] 表示交易位置的索引。

Request

curl https://eth-mainnet.solarpath.io/v1/YOUR-API-KEY \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_getTransactionByBlockNumberAndIndex", "params": ["0x658a13", "0x0"]}'

Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    // 区块Hash
    "blockHash": "0xe429155011f1e8bcd46802dd261c6855e5fe3ed4d1622d047920e40dcb0e0da8",
    // 区块号
    "blockNumber": "0x658a13",
    // 发送者地址
    "from": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
    // 接收者地址
    "to": "0x1fb8a3f0a7fee2e7424c1a5ea3b0ad3b7cce33d4",
    // 发送者支付的Gas数量
    "gas": "0xc350",
    // 发送至提供的Gas价格
    "gasPrice": "0x3b9aca00",
    // 交易Hash
    "hash": "0xbfd5ac780d84990912e5b64a94de421fb3c64db15576eff80860251c43dacd0f",
    // 与交易一起发送的数据
    "input": "0x",
    // 发送者在此之前的交易数量。
    "nonce": "0xf8680e",
    // 在此区块中的交易位置索引
    "transactionIndex": "0x0",
    // 交易的价值,以Wei为单位
    "value": "0x1b5b85a213cb2f1",
    // 0x0常规交易,遵循EIP-2718
    // 0x1访问列表交易,遵循EIP-2930中引入的交易
    // 0x2为EIP-1559交易
    "type": "0x0",
    // 链ID
    "chainId": "0x1",
    // ECDSA恢复ID
    "v": "0x25",
    // ECDSA签名r
    "r": "0xa8069bc4927bceb52abfd561b8b035dd712125da9af6591ccc3aa7d38c084d7a",
    // ECDSA签名s
    "s": "0x2545b52af4e8d8ae9201ca64cddbf7a09af3399d3442a004989e3fa1147ed7a9"
  }
}

交易类型请参阅: 以太坊交易类型

最后更新于