eth_getTransactionReceipt

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

This method will use 40 Compute Units.


Reference: Here

Parameters

  1. DATA, 32 Bytes - hash of a transaction

params: ["0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5"]

Returns

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

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

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

  • 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.

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

  • cumulativeGasUsed : QUANTITY - The total amount of gas used when this transaction was executed in the block.

  • effectiveGasPrice : QUANTITY - The sum of the base fee and tip paid per unit of gas.

  • gasUsed : QUANTITY - The amount of gas used by this specific transaction alone.

  • contractAddress : DATA, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.

  • logs: Array - Array of log objects, which this transaction generated.

  • logsBloom: DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.

  • type: DATA - integer of the transaction type, 0x00 for legacy transactions, 0x01 for access list types, 0x02 for dynamic fees. It also returns either :

  • root : DATA 32 bytes of post-transaction stateroot (pre Byzantium)

  • status: QUANTITY either 1 (success) or 0 (failure)

// Result
{
	"jsonrpc": "2.0",
	"id": 1,
	"result": {
		"transactionHash": "0xc540c72ca4bab03c79e4dc7273941073e49fc102e395774ba39597fa9b3aef9d",
		"transactionIndex": "0x8",
		"blockHash": "0xdf15d721c064ad201f44fa868d19462b264b3ca7ad111b5dafe696c344af15b8",
		"blockNumber": "0x8693195",
		"from": "0x0f3335487ce9004892764bc66f8d6cf78761f62b",
		"to": "0x00000000009a1e02f00e280dcfa4c81c55724212",
		"cumulativeGasUsed": "0xe7c35",
		"gasUsed": "0x48bb2",
		"contractAddress": null,
		"type": "0x2",
		"status": "0x1",
		"logsBloom": "0x00000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000008800000000000000000000000008000000800000000000000020000000400000000000800000000000000000000000010000000000000000000000000000000000000000400000000000000000000000000000000000100000000000000000000000000000000040000000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000",
		"logs": [
			{
				"address": "0x39b14c544b76ab81289a92c3e96e909f3d36daa3",
				"topics": [
					"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
					"0x0000000000000000000000000000000000000000000000000000000000000000",
					"0x0000000000000000000000000f3335487ce9004892764bc66f8d6cf78761f62b",
					"0x0000000000000000000000000000000000000000000000000000000003948fa6"
				],
				"data": "0x",
				"blockNumber": "0x8693195",
				"transactionHash": "0xc540c72ca4bab03c79e4dc7273941073e49fc102e395774ba39597fa9b3aef9d",
				"transactionIndex": "0x8",
				"blockHash": "0xdf15d721c064ad201f44fa868d19462b264b3ca7ad111b5dafe696c344af15b8",
				"logIndex": "0xa"
			}
		],
		"effectiveGasPrice": "0x165a0bc00"
	}
}
curl https://testnet.somnia.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x85d995eba9763907fdf35cd2034144dd9d53ce32cbec21349d4b12823c6860c5"],"id":1}'

Last updated

Was this helpful?