Skip to main content

Services documentation

Use high performance APIs provided by Infura to scale your dapp or Snap.

eth_getUserOperationReceipt

Fetches the receipt of a user operation by providing its hash. If the receipt is not available, it will return null. This method uses 80 credits from your daily balance.

Parameters

  • userOpHash: (string) - The 32-byte hash of the user operation for which to retrieve the receipt.

Returns

An object containing the user operation receipt information, or null if the receipt is not available. When available, the receipt object contains:

  • entryPoint: (string) - The entry point contract address.
  • userOpHash: (string) - The hash of the user operation.
  • sender: (string) - The address of the account that initiated the user operation.
  • nonce: (string) - The nonce used for the user operation.
  • actualGasUsed: (string) - The actual amount of gas used during execution.
  • actualGasCost: (string) - The actual cost of gas in wei.
  • success: (boolean) - Whether the user operation was successful.
  • logs: (array) - Array of log entries generated during execution.
  • receipt: (object) - The underlying transaction receipt containing:
    • transactionHash: (string) - The hash of the transaction.
    • transactionIndex: (string) - The index of the transaction in the block.
    • blockHash: (string) - The hash of the block containing the transaction.
    • blockNumber: (string) - The number of the block containing the transaction.
    • from: (string) - The address that initiated the transaction.
    • to: (string) - The address that received the transaction.
    • cumulativeGasUsed: (string) - The total gas used by all transactions in the block up to this one.
    • gasUsed: (string) - The amount of gas used by this transaction.
    • address: (string) - The contract address created, if any.
    • logs: (array) - Array of log entries for this transaction.
    • logsBloom: (string) - The bloom filter for the logs.
    • status: (string) - The status of the transaction (0x1 for success, 0x0 for failure).
    • effectiveGasPrice: (string) - The effective gas price used for the transaction.

Example

Replace <YOUR-API-KEY> with an API key from your MetaMask Developer dashboard.

Request

curl https://mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getUserOperationReceipt",
"params": ["0xa5a579c6fd86c2d8a4d27f5bb22796614d3a31bbccaba8f3019ec001e001b95f"],
"id": 1
}'

Response

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"entryPoint": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"userOpHash": "0xa5a579c6fd86c2d8a4d27f5bb22796614d3a31bbccaba8f3019ec001e001b95f",
"sender": "0x8C6bdb488F664EB98E12cB2671fE2389Cc227D33",
"nonce": "0x18554d9a95404c5e8ac591f8608a18f80000000000000000",
"actualGasUsed": "0x7f550",
"actualGasCost": "0x4b3b147f788710",
"success": true,
"logs": [
// ...
],
"receipt": {
"transactionHash": "0x57465d20d634421008a167cfcfcde94847dba9d6b5d3652b071d4b84e5ce74ff",
"transactionIndex": "0x20",
"blockHash": "0xeaeec1eff4095bdcae44d86574cf1bf08b14b26be571b7c2290f32f9f250c103",
"blockNumber": "0x31de70e",
"from": "0x43370996A3Aff7B66B3AC7676dD973d01Ecec039",
"to": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"cumulativeGasUsed": "0x4724c3",
"gasUsed": "0x7ff5a",
"address": null,
"logs": [
// ...
],
"logsBloom": "0x010004000800020000000040000000000000040000000000000010000004000000080000001000000212841100000000041080000000000020000240000000000800000022001000400000080000028000040000000000200001000010000000000000000a0000000000000000800800000000004110004080800110282000000000000002000000000000000000000000000200000400000000000000240040200002000000000000400000000002000140000000000000000002200000004000000002000000000021000000000000000000000000800080108020000020000000080000000000000000000000000000000000000000000108000000102000",
"status": "0x1",
"effectiveGasPrice": "0x89b098f46"
}
}
}