API Reference

eth_getTransactionByHash - zkSync Era

Returns the information about a transaction requested by transaction hash. In the response object, blockHash, blockNumber, and transactionIndex are null when the transaction is pending.

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. Null when its pending.
  • blockNumber: QUANTITY - Block number where this transaction was in. Null when it's pending.
  • 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 it's a contract creation transaction.
  • transactionIndex: QUANTITY - Integer of the transactions index position in the block. null when its pending.
  • 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 --location --request POST 'https://zksync-era-mainnet.unifra.io/v1/your-api-key' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0xcfbb1d0539edf78d869e35099f28e105f08ac270117e64d589c88f00180cef85"],"id":0}'

Result

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "blockHash": "0xdecf7d1109c108ec3c01cd71e9bff4bd5b8790b86654f95e495012eb66524e25",
        "blockNumber": "0x2f",
        "from": "0x000070300830ffc8501cf42402015bad12699d71",
        "gas": "0x32728",
        "gasPrice": "0x4a167ca6e",
        "hash": "0xcfbb1d0539edf78d869e35099f28e105f08ac270117e64d589c88f00180cef85",
        "input": "0x9e353c700000000000000000000000007136311d65fe0e65eae4f389a4d86f9bd731d97c000000000000000000000000704da9bc96a89b98f7a3890aba3deebb8b69b04300000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006361084e000000000000000000000000000000000000000000000000000000000000000900000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000a4232e87480000000000000000000000003ba3b56f992bb8fdb946b8f5e33310f86560359b0000000000000000000000003ba3b56f992bb8fdb946b8f5e33310f86560359b00000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x9",
        "to": "0xcb4567f103a6ba4cc348547a5094be0d93e88835",
        "transactionIndex": "0x0",
        "value": "0x0",
        "type": "0x1",
        "accessList": [],
        "chainId": "0x518935",
        "v": "0x1",
        "r": "0x193da2e7b703b5fd6840b7f8fbdc8d4793d10c60ba47db5ca8e686e8ad99534b",
        "s": "0x6221f1f71ad9ca7724f3ca35f38ecb6cdc2ab9d358c53544715d09de5f00c606"
    }
}
Language
Click Try It! to start a request and see the response here!