API Reference

cfx_getTransactionByHash - Conflux

Returns information about a transaction, identified by its hash.

Parameters

  • DATA, 32 Bytes - hash of a transaction

Returns

Object - a transaction object, or null when no transaction was found:

  • blockHash: DATA, 32 Bytes - Hash of the block where this transaction was in and got executed. Null when the transaction is pending.
  • chainId: QUANTITY - The chain ID specified by the sender.
  • contractCreated: BASE32 - Address of the contract created. Null when it is not a contract deployment transaction.
  • data: DATA - The data sent along with the transaction.
  • epochHeight: QUANTITY - The epoch proposed by the sender. Note that this is NOT the epoch of the block containing this transaction.
  • from: BASE32 - Address of the sender.
  • gas: QUANTITY - Gas provided by the sender.
  • gasPrice: QUANTITY - Gas price provided by the sender in Drip.
  • hash: DATA, 32 Bytes - Hash of the transaction.
  • nonce: QUANTITY - The number of transactions made by the sender prior to this one.
  • r: DATA, 32 Bytes - ECDSA signature r.
  • s: DATA, 32 Bytes - ECDSA signature s.
  • status: QUANTITY - 0 for success, 1 if an error occurred, 2 for skiped, null when the transaction is skipped or not packed.
  • storageLimit: QUANTITY - The storage limit specified by the sender.
  • to: BASE32 - Address of the receiver. null when it is a contract deployment transaction.
  • transactionIndex: QUANTITY - The transaction's position in the block. null when the transaction is pending.
  • v: QUANTITY - ECDSA recovery id.
  • value: QUANTITY - value transferred in Drip.

Note that the fields blockHash, contractCreated, status, and transactionIndex are provided by the node as they depend on the transaction's position within the ledger. The rest of the fields are included in or derived from the original transaction.


Example

Request

curl -X POST \
--data '{"jsonrpc":"2.0","method":"cfx_getTransactionByHash","params":["0xa2ae4700d3ca272c773628a6bf8c2a7fc794a2d3b27e675107df0f6b1a6cbad7"],"id":1}' \
-H "Content-Type: application/json" \
https://cfx-core.unifra.io/v1/ad2eb3c7a9404cc6a35a6641eaf70577 


Result

{
    "jsonrpc": "2.0",
    "result": {
        "blockHash": "0x23a6e84d9a24dffc8436e72b0e240688d23e29b8cda0b301ff20baab1573c9fd",
        "chainId": "0x405",
        "contractCreated": null,
        "data": "0x9bd9bbc60000000000000000000000008e45db7d866eb1a54992b24d2a8f45d53998100c0000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000101130e9d3b904b18586db51cc2db1559d47610e0000000000000000000000001ea847f89a3dd63e66e29b7b8b60540d84c78d0600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000429d069189e000000000000000000000000000000000000000000000000000006f05b59d3b20000",
        "epochHeight": "0x10c3e51",
        "from": "CFX:TYPE.USER:AATMUV92XJ87PTXG6MR11C5AMUG2KV6RA21G7PBBRP",
        "gas": "0x26882",
        "gasPrice": "0x1",
        "hash": "0xa2ae4700d3ca272c773628a6bf8c2a7fc794a2d3b27e675107df0f6b1a6cbad7",
        "nonce": "0x7",
        "r": "0xf0daa3ceb35f38be4a22309f003ae0cbfbfe62473300140a64d3131c64efbe45",
        "s": "0x12f7b8248effa5a49eae92b3c1b055e7dcd58f54fb1347958d9acef88490e53",
        "status": "0x0",
        "storageLimit": "0x80",
        "to": "CFX:TYPE.CONTRACT:ACHC8NXJ7R451C223M18W2DWJNMHKD6RXAWRVKVSY2",
        "transactionIndex": "0x0",
        "v": "0x0",
        "value": "0x0"
    },
    "id": 0
}
Language
URL
Click Try It! to start a request and see the response here!