eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash. Note that the receipt is not available for pending transactions.

REQUEST

1
POST https://<network>.infura.io/v3/YOUR-PROJECT-ID
Copied!

HEADERS

1
Content-Type: application/json
Copied!

REQUEST PARAMS

  • TRANSACTION HASH [required] - a string representing the hash (32 bytes) of a transaction

EXAMPLE

1
## JSON-RPC over HTTPS POST
2
## Replace YOUR-PROJECT-ID with a Project ID from your Infura Dashboard
3
## You can also replace mainnet with a different supported network
4
curl https://mainnet.infura.io/v3/YOUR-PROJECT-ID \
5
-X POST \
6
-H "Content-Type: application/json" \
7
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"],"id":1}'
8
9
## JSON-RPC over WSS
10
## Replace YOUR-PROJECT-ID with a Project ID from your Infura Dashboard
11
## You can also replace mainnet with a different supported network
12
wscat -c wss://mainnet.infura.io/ws/v3/YOUR-PROJECT-ID
13
>{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params": ["0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0"],"id":1}
Copied!

RESPONSE

RESULT FIELDS

  • TRANSACTION RECEIPT - A transaction receipt object, or null when no receipt was found:
    • blockHash: 32 Bytes - hash of the block including this transaction.
    • blockNumber: block number including this transaction.
    • contractAddress: 20 Bytes - the contract address created, if the transaction was a contract creation, otherwise null.
    • cumulativeGasUsed: the total amount of gas used when this transaction was executed in the block.
    • effectiveGasPrice: the actual value per gas deducted from the sender's account. Before EIP-1559, equal to the gas price.
    • from: 20 Bytes - address of the sender.
    • gasUsed: the amount of gas used by this specific transaction alone.
    • logs: Array - Array of log objects, which this transaction generated.
    • logsBloom: 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.
    • One of the following:
      • root : 32 bytes of post-transaction stateroot (pre Byzantium)
      • status: either 1 (success) or 0 (failure)
    • to: 20 Bytes - address of the receiver. null when the transaction is a contract creation transaction.
    • transactionHash: 32 Bytes - hash of the transaction.
    • transactionIndex: hexadecimal of the transaction's index position in the block.
    • type: the transaction type.

BODY

1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": {
5
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
6
"blockNumber": "0x5bad55",
7
"contractAddress": null,
8
"cumulativeGasUsed": "0xb90b0",
9
"effectiveGasPrice":"0x746a528800",
10
"from": "0x398137383b3d25c92898c656696e41950e47316b",
11
"gasUsed": "0x1383f",
12
"logs": [
13
{
14
"address": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
15
"blockHash": "0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35",
16
"blockNumber": "0x5bad55",
17
"data": "0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35",
18
"logIndex": "0x6",
19
"removed": false,
20
"topics": [
21
"0x241ea03ca20251805084d27d4440371c34a0b85ff108f6bb5611248f73818b80"
22
],
23
"transactionHash": "0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0",
24
"transactionIndex": "0x11"
25
}
26
],
27
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000",
28
"status": "0x1",
29
"to": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
30
"transactionHash": "0xbb3a336e3f823ec18197f1e13ee875700f08f03e2cab75f0d0b118dabb44cba0",
31
"transactionIndex": "0x11",
32
"type": "0x0"
33
}
34
}
Copied!
Copy link