eth_getTransactionByHash
网络: BSC · 主网 · Chain ID 56(0x38)
计为 1 个 Request。 计费规则见 Request Counting。
根据交易哈希返回交易详情。
参数
DATA(32 字节)— 交易哈希。
返回
Object|null — 交易对象;查不到时返回 null。
| 字段 | 类型 | 说明 |
|---|---|---|
| hash | DATA | 交易哈希 |
| nonce | QUANTITY | 发送方 nonce |
| from | DATA | 发送方地址 |
| to | DATA | 接收方地址 |
| value | QUANTITY | 转账金额(wei) |
| gas | QUANTITY | 交易 Gas 上限 |
| gasPrice | QUANTITY | Gas Price(wei) |
| input | DATA | 调用数据 |
| blockHash | DATA | 区块哈希(pending 时为 null) |
| blockNumber | QUANTITY | 区块号(pending 时为 null) |
| transactionIndex | QUANTITY | 区块内索引(pending 时为 null) |
请求
{
"jsonrpc": "2.0",
"method": "eth_getTransactionByHash",
"params": ["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],
"id": 1
}响应
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hash": "0x88df...",
"from": "0x...",
"to": "0x...",
"value": "0xde0b6b3a7640000",
"blockNumber": "0x134e82a",
"gasPrice": "0x3b9aca00"
}
}代码示例
curl -X POST https://bsc-rpc.blockreq.com/v1/rpc/public \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],"id":1}'