you_getTransactionByHash
描述:返回指定哈希对应的交易。
parameter
数据类型 | 备注 |
---|---|
String, 32 字节 | 交易哈希 |
"params": ["0x9422e043ba07f4e50e978d1b16a14e6f6f43984baa8d05825bffbc896a67b2e5"]
return
Object - 交易对象,如果没有找到匹配的交易则返回 null。结构如下:
参数名 | 数据类型 | 备注 |
---|---|---|
hash | String, 32 字节 | 交易哈希 |
nonce | String | 本次交易之前发送方已经生成的交易数量 |
blockHash | String, 32 字节 | 交易所在块的哈希,对于挂起块,该值为 null |
blockNumber | String | 交易所在块的编号,对于挂起块,该值为 null |
transactionIndex | String | 交易在块中的索引位置,挂起块该值为 null |
from | String, 20 字节 | 交易发送方地址 |
to | String, 20 字节 | 交易接收方地址,对于合约创建交易,该值为 null |
value | String | 发送的YOU数量,单位:lu |
gasPrice | String | 发送方提供的 gas 价格,单位:lu |
gas | String | 发送方提供的 gas 可用量 |
input | String | 随交易发送的数据 |
example
Request:
curl -X POST \
http://127.0.0.1:8283 \
-H 'Content-Type: application/json' \
-d '{"jsonrpc": "2.0", "id": 1, "method": "you_getTransactionByHash", "params": ["0x9422e043ba07f4e50e978d1b16a14e6f6f43984baa8d05825bffbc896a67b2e5"]}'
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x7872e01fe5ead75f79ca64a9f56384a71bfa3a0521eba36f84fbde5cd616254e",
"blockNumber": "0x531d",
"from": "0x59677fD68ec54e43aD4319D915f81748B5a6Ff8B",
"gas": "0x5208",
"gasPrice": "0x3b9aca00",
"hash": "0x9422e043ba07f4e50e978d1b16a14e6f6f43984baa8d05825bffbc896a67b2e5",
"input": "0x",
"nonce": "0xea",
"to": "0x8009a7Cbd192B3aeD4adb983D5284552c16C7451",
"transactionIndex": "0x0",
"value": "0x53444835ec580000",
"v": "0x1c",
"r": "0x8b79eae1f3e4799a785913ca277ffa6af7af6daa36f8d51badef9beaec583309",
"s": "0x3cb90dc0c326d1d35ebbcf6b6a8d9d564e6f08a70d3f5fe263ced2b4953b89bd"
}
}