cfx_getTransactionByHash
Get transaction by its hash.
- CURL
curl --request POST \
--url https://main.confluxrpc.com \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": ["0x0000000000000000000000000000000000000000000000000000000000000000"],
"method": "cfx_getTransactionByHash"
}'
Params
tx_hash required
Schema
type : string
Pattern :
^0x[0-9,a-f,A-F]{64}$
Result
Schema
type : object
accessList accessList
type : arrayitems[x]
CfxAccessListItemtype : objectaddress address
type : stringPattern :^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
storageKeys storageKeys
type : arrayitems[x]
H256type : stringPattern :^0x[0-9,a-f,A-F]{64}$
blockHash blockHash
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
chainId chainId
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
contractCreated contractCreated
type : stringPattern :^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
data data
type : stringPattern :^0x[0-9a-f]*$
epochHeight epochHeight
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
from from
type : stringPattern :^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
gas gas
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
gasPrice gasPrice
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
hash hash
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
maxFeePerGas maxFeePerGas
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
maxPriorityFeePerGas maxPriorityFeePerGas
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
nonce nonce
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
r r
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
s s
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
space space
type : stringPossible values :native
ethereum
status status
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,15}|0)$
storageLimit storageLimit
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
to to
type : stringPattern :^(NET\d+|CFX|CFXTEST)(:TYPE\..*|):[ABCDEFGHJKMNPRSTUVWXYZ0123456789]{42}$
transactionIndex transactionIndex
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,15}|0)$
transactionType transactionType
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,15}|0)$
v v
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
value value
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
yParity yParity
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,15}|0)$
Examples
- cfx_getTransactionByHash
- cfx_getTransactionByHash
- cfx_getTransactionByHash
- cfx_getTransactionByHash
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getTransactionByHash",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000000000"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
null
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getTransactionByHash",
"params": [
"0xaf35f1b3ceede1f26d81241b46450c836d481b6b01ce5829ce6e686358c1f7bf"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"accessList": [],
"blockHash": "0x08659936ca25de4ac0e50555918941f45dbb9de8d867aa2ae5289a829ee0ad0c",
"chainId": "0x22b8",
"contractCreated": null,
"data": "0x",
"epochHeight": "0x27bc2",
"from": "CFXTEST:TYPE.USER:AAPYWAAAAAAAAAAAAAAAAAAAAAAAAAAUAEUTRS455H",
"gas": "0x5208",
"gasPrice": "0x4f790d55",
"hash": "0x1b6a88dc91c1870f05242ee2121c36a9a16a736b510634f1c664bcd2cc02909b",
"maxFeePerGas": "0x4f790d55",
"maxPriorityFeePerGas": "0x0",
"nonce": "0x1",
"r": "0x9d08a7f2189e8be844eb0fc0e695c84eac29f40653a9dab11360497793390e22",
"s": "0x1f712887d60b595eb73b71973dc3e17fd5978d5401532f6e15746d57ac834fb0",
"status": "0x0",
"storageLimit": "0x0",
"to": "CFXTEST:TYPE.USER:AAPYWAAAAAAAAAAAAAAAAAAAAAAAAAAUAEUTRS455H",
"transactionIndex": "0x0",
"type": "0x2",
"v": "0x1",
"value": "0xde0b6b3a7640000",
"yParity": "0x1"
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getTransactionByHash",
"params": [
"0xad1b8a95f43d903a400900e0af752bcf4b684136a125f2dcd4ac5be27e54d5f9"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"accessList": [],
"blockHash": "0xf5b0cc1fbec2ed6c1afbaa6329f6e57c9e542f21859a96b71b335b44e79089a1",
"chainId": "0x22b8",
"contractCreated": null,
"data": "0x",
"epochHeight": "0x27ebe",
"from": "CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",
"gas": "0x5208",
"gasPrice": "0x3b9aca00",
"hash": "0x2268313b45a382afc2cd1b7d3a376a0d3e5518a9d16b00a8372615809c484c48",
"nonce": "0x3",
"r": "0x2ca7540ad010bee124612142891c0fc0f3f2be97e901a4fcf90b9c6cbb45cc0a",
"s": "0x21b779ef80270b39852aed0c7fd71eabf6dc14b769b744949eed624f12f04d1",
"status": "0x0",
"storageLimit": "0x0",
"to": "CFXTEST:TYPE.USER:AATGGCS6J4VMKE5M10WY04SKDZ7D27RDX2CZXKDMY3",
"transactionIndex": "0x0",
"type": "0x1",
"v": "0x0",
"value": "0xde0b6b3a7640000",
"yParity": "0x0"
}
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_getTransactionByHash",
"params": [
"0x4a84dcf81aff3efbc93ba697463755641c5bc3e9facf501ae3d2c17d9071202e"
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"blockHash": "0x0751c946613a66dd2e5f9698c3666ede8d5b3d35aaa07378bc0afc2be05e6e72",
"chainId": "0x22b8",
"contractCreated": null,
"data": "0x",
"epochHeight": "0x27fc9",
"from": "CFXTEST:TYPE.USER:AAPYWAAAAAAAAAAAAAAAAAAAAAAAAAAUAEUTRS455H",
"gas": "0x5208",
"gasPrice": "0x3b9aca00",
"hash": "0xc04aceb6ebeaa67fa63445f1130269ce48913144e8c200f2fdb1a96d9e39c7b7",
"nonce": "0x4",
"r": "0xb3075267e521c66fc8ad9d4cb601d2b0eabdb41d33ae3d07960c8c341467a560",
"s": "0x3de56e41dc23c96d25d595d90f786a97770d40de2225f00bc71e14b75d65a65a",
"status": "0x0",
"storageLimit": "0x0",
"to": "CFXTEST:TYPE.USER:AAPYWAAAAAAAAAAAAAAAAAAAAAAAAAAUAEUTRS455H",
"transactionIndex": "0x0",
"type": "0x0",
"v": "0x1",
"value": "0xde0b6b3a7640000"
}