eth_getTransactionByHash

Returns the information about a transaction requested by transaction 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.

  • blockNumber: QUANTITY - block number where this transaction was in.

  • from: DATA, 20 Bytes - address of the sender.

  • gas: QUANTITY - gas provided by the sender.

  • gasPrice: QUANTITY - gas price provided by the sender in Wei.

  • hash: DATA, 32 Bytes - hash of the transaction.

  • input: DATA - the data send along with the transaction.

  • nonce: QUANTITY - the number of transactions made by the sender prior to this one.

  • to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction.

  • transactionIndex: QUANTITY - integer of the transactions index position in the block.

  • value: QUANTITY - value transferred in Wei.

  • v: QUANTITY - ECDSA recovery id

  • r: DATA, 32 Bytes - ECDSA signature r

  • s: DATA, 32 Bytes - ECDSA signature s

Example:

// Request
curl https://x1-testnet.blockpi.network/v1/rpc/your-rpc-key -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x467c5d3d6a5cf29cd7efe06c64fe7e098b4c6983aec72a61fadcdf520d074ef5"],"id":1}'

// Result
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "blockHash": "0xc34fe2c67469e68e3f65db9d6ba8b8387939304c27eefa8f7425fd814fbd6b10",
        "blockNumber": "0x7e765",
        "chainId": "0xc3",
        "from": "0x8934b2a42aff8b6015bcfe66e7714d7e4fb8077f",
        "gas": "0x1af03",
        "gasPrice": "0x1ec559900",
        "hash": "0x467c5d3d6a5cf29cd7efe06c64fe7e098b4c6983aec72a61fadcdf520d074ef5",
        "input": "0xcd58657900000000000000000000000000000000000000000000000000000000000000000000000000000000000000008934b2a42aff8b6015bcfe66e7714d7e4fb8077f000000000000000000000000000000000000000000000000048d4a431e5400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0",
        "r": "0xe9c24cdc200875b6e55ce27be279a37557937d09c9d9c268f9aa2255e2d1c163",
        "s": "0x67f76a90ac9d42f197859ab226831f880fe63b238d00e6de0a2bf57a03142e5e",
        "to": "0x7a4ee6f9f0ab037fe771fc36d39c1e19bcc0fdb5",
        "transactionIndex": "0x0",
        "type": "0x0",
        "v": "0x1aa",
        "value": "0x48d4a431e540000"
    }
}

Last updated