# eth_getUserOperationReceipt

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://eth-mainnet.g.alchemy.com/v2/{apiKey}

Get the `UserOperationReceipt` based on the `userOpHash`.

<Note title="Limitations">
  This method retrieves and decodes userOperations from the logs of mined transactions by querying the node. The number of blocks scanned in a single request is limited. Use `blockOption` to position a bounded lookup window when searching historical blocks.
</Note>

### Maximum Scan Width

The maximum number of blocks a single request may scan for the operation's `UserOperationEvent` depends on the chain and your plan tier. This limits the width of the scan, not the age of the operation. A `blockOption` may position the scan at historical blocks, provided the resulting range does not exceed this width:

| Chain | Free | Pay As You Go | Enterprise |
|-------|------|---------------|------------|
| Arbitrum Mainnet, Arbitrum Sepolia, Arc Mainnet, Base Mainnet, Base Sepolia, Ethereum Mainnet, Ethereum Sepolia, OP Mainnet, OP Sepolia, Polygon PoS Amoy, Polygon PoS Mainnet, Robinhood Chain Mainnet, World Chain Mainnet, World Chain Sepolia | 150 | unlimited | unlimited |
| Avalanche Fuji, Hyperliquid Mainnet | 150 | 2,000 | 2,000 |
| Avalanche Mainnet, Robinhood Chain Testnet | 150 | 5,000 | 5,000 |
| BNB Smart Chain Testnet | 50 | 50 | 50 |
| Monad Mainnet | 150 | 1,000 | 1,000 |

Chains not listed here use a 150-block limit on every tier.


Reference: https://www.alchemy.com/docs/wallets/api-reference/bundler-api/bundler-api-endpoints/eth-get-user-operation-receipt

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| userOpHash | string | Yes | The `userOpHash` of the `UserOperation` to get the receipt for (as returned by `eth_sendUserOperation`). |
| blockOption | enum or object or string or null | No | The block scope for checking the UO status: the legacy "pending" or "latest" tag, a `{ fromBlock, toBlock }` range, or a single block hash. Defaults to "latest". |

## Result

**UserOperationReceipt** (object or null): `UserOperationReceipt` object representing the outcome of a `UserOperation`, or null if no receipt is found.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "eth_getUserOperationReceipt",
  "params": [
    "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "userOpHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "entryPoint": "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
    "sender": "0x1111111111111111111111111111111111111111",
    "nonce": "0x1",
    "paymaster": "0x0000000000000000000000000000000000000000",
    "actualGasCost": "0x5208",
    "actualGasUsed": "0x5208",
    "success": true,
    "reason": "",
    "logs": [
      {
        "address": "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
        "topics": [
          "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
        ],
        "data": "0x"
      }
    ],
    "receipt": {
      "blockHash": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
      "blockNumber": "0x12a3b4c",
      "contractAddress": null,
      "cumulativeGasUsed": "0x5208",
      "effectiveGasPrice": "0x59682f00",
      "from": "0x3333333333333333333333333333333333333333",
      "gasUsed": "0x5208",
      "logs": [
        {
          "address": "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
          "blockHash": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
          "blockNumber": "0x12a3b4c",
          "data": "0x",
          "logIndex": "0x0",
          "removed": false,
          "topics": [
            "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
          ],
          "transactionHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
          "transactionIndex": "0x0"
        }
      ],
      "logsBloom": "0x00",
      "status": "0x1",
      "to": "0x4444444444444444444444444444444444444444",
      "transactionHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
      "transactionIndex": "0x0",
      "type": "0x2"
    }
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://eth-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getUserOperationReceipt",
  "params": [
    "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "pending"
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'eth_getUserOperationReceipt',
    params: [
      '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
      'pending'
    ]
  })
};

fetch('https://eth-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://eth-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getUserOperationReceipt",
    "params": ["0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "pending"]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://eth-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getUserOperationReceipt\",\n  \"params\": [\n    \"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n    \"pending\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://eth-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getUserOperationReceipt\",\n  \"params\": [\n    \"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n    \"pending\"\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://eth-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getUserOperationReceipt\",\n  \"params\": [\n    \"0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n    \"pending\"\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: eth_getUserOperationReceipt
description: |
  Get the `UserOperationReceipt` based on the `userOpHash`.

  <Note title="Limitations">
    This method retrieves and decodes userOperations from the logs of mined transactions by querying the node. The number of blocks scanned in a single request is limited. Use `blockOption` to position a bounded lookup window when searching historical blocks.
  </Note>

  ### Maximum Scan Width

  The maximum number of blocks a single request may scan for the operation's `UserOperationEvent` depends on the chain and your plan tier. This limits the width of the scan, not the age of the operation. A `blockOption` may position the scan at historical blocks, provided the resulting range does not exceed this width:

  | Chain | Free | Pay As You Go | Enterprise |
  |-------|------|---------------|------------|
  | Arbitrum Mainnet, Arbitrum Sepolia, Arc Mainnet, Base Mainnet, Base Sepolia, Ethereum Mainnet, Ethereum Sepolia, OP Mainnet, OP Sepolia, Polygon PoS Amoy, Polygon PoS Mainnet, Robinhood Chain Mainnet, World Chain Mainnet, World Chain Sepolia | 150 | unlimited | unlimited |
  | Avalanche Fuji, Hyperliquid Mainnet | 150 | 2,000 | 2,000 |
  | Avalanche Mainnet, Robinhood Chain Testnet | 150 | 5,000 | 5,000 |
  | BNB Smart Chain Testnet | 50 | 50 | 50 |
  | Monad Mainnet | 150 | 1,000 | 1,000 |

  Chains not listed here use a 150-block limit on every tier.
x-compute-units: 20
params:
  - name: userOpHash
    required: true
    description: The `userOpHash` of the `UserOperation` to get the receipt for (as returned by `eth_sendUserOperation`).
    schema:
      type: string
      pattern: ^0x[0-9a-fA-F]*$
      minLength: 66
      maxLength: 66
  - name: blockOption
    required: false
    description: 'The block scope for checking the UO status: the legacy "pending" or "latest" tag, a `{ fromBlock, toBlock }` range, or a single block hash. Defaults to "latest".'
    schema:
      anyOf:
        - anyOf:
            - type: string
              enum:
                - pending
                - latest
            - anyOf:
                - type: object
                  properties:
                    fromBlock:
                      anyOf:
                        - type: string
                          pattern: ^0x[0-9a-fA-F]*$
                          minLength: 3
                          maxLength: 66
                        - type: string
                          enum:
                            - earliest
                            - finalized
                            - safe
                            - latest
                            - pending
                    toBlock:
                      anyOf:
                        - type: string
                          pattern: ^0x[0-9a-fA-F]*$
                          minLength: 3
                          maxLength: 66
                        - type: string
                          enum:
                            - earliest
                            - finalized
                            - safe
                            - latest
                            - pending
                - type: string
                  pattern: ^0x[0-9a-fA-F]*$
                  minLength: 66
                  maxLength: 66
        - type: 'null'
result:
  name: UserOperationReceipt
  description: '`UserOperationReceipt` object representing the outcome of a `UserOperation`, or null if no receipt is found.'
  schema:
    anyOf:
      - type: object
        required:
          - userOpHash
          - entryPoint
          - sender
          - nonce
          - actualGasCost
          - actualGasUsed
          - success
          - logs
          - receipt
        properties:
          userOpHash:
            type: string
            pattern: ^0x[0-9a-fA-F]*$
            minLength: 66
            maxLength: 66
            description: The hash of the `UserOperation`.
          entryPoint:
            type: string
            pattern: ^0x[0-9a-fA-F]*$
            minLength: 42
            maxLength: 42
            description: The EntryPoint address the request should be sent through. This MUST be one of the EntryPoints returned by the `supportedEntryPoints` RPC call.
          sender:
            type: string
            pattern: ^0x[0-9a-fA-F]*$
            minLength: 42
            maxLength: 42
            description: The account initiating the `UserOperation`.
          nonce:
            type: string
            pattern: ^0x[0-9a-fA-F]*$
            minLength: 3
            maxLength: 66
            description: The nonce used in the `UserOperation`.
          paymaster:
            type: string
            pattern: ^0x[0-9a-fA-F]*$
            minLength: 42
            maxLength: 42
            description: The paymaster used for this `UserOperation` (or empty if self-sponsored).
          actualGasCost:
            type: string
            pattern: ^0x[0-9a-fA-F]*$
            minLength: 3
            maxLength: 66
            description: The actual amount paid (by account or paymaster) for this `UserOperation`.
          actualGasUsed:
            type: string
            pattern: ^0x[0-9a-fA-F]*$
            minLength: 3
            maxLength: 66
            description: The total gas used by this `UserOperation` (including `preVerification`, `creation`, `validation`, and `execution`).
          success:
            type: boolean
            description: Indicates whether the execution completed without reverting.
          reason:
            type: string
            description: In case of revert, this is the revert reason.
          logs:
            type: array
            description: The logs generated by this `UserOperation` (not including logs of other `UserOperations` in the same bundle).
            items:
              type: object
              required:
                - address
                - topics
                - data
              title: UserOperation log
              properties:
                address:
                  type: string
                  pattern: ^0x[0-9a-fA-F]*$
                  minLength: 42
                  maxLength: 42
                  description: 20 Bytes - address from which this userOperation log originated.
                topics:
                  type: array
                  description: Array of indexed log argument topics for this userOperation log.
                  items:
                    type: string
                    pattern: ^0x[0-9a-fA-F]*$
                    minLength: 66
                    maxLength: 66
                data:
                  type: string
                  pattern: ^0x[0-9a-fA-F]*$
                  description: Non-indexed log data for this userOperation.
          receipt:
            type: object
            required:
              - cumulativeGasUsed
              - effectiveGasPrice
              - from
              - gasUsed
              - logs
              - logsBloom
              - status
              - to
              - transactionHash
              - type
            description: The `TransactionReceipt` object for the entire bundle, not only for this `UserOperation`.
            title: Transaction receipt
            properties:
              type:
                anyOf:
                  - type: string
                    pattern: ^0x[0-9a-fA-F]*$
                    minLength: 3
                    maxLength: 66
                  - type: string
                description: The type of the transaction.
              blockHash:
                anyOf:
                  - type: string
                    pattern: ^0x[0-9a-fA-F]*$
                    minLength: 66
                    maxLength: 66
                  - type: 'null'
                description: 32 Bytes - The hash of the block where the given transaction was included.
              blockNumber:
                anyOf:
                  - type: string
                    pattern: ^0x[0-9a-fA-F]*$
                    minLength: 3
                    maxLength: 66
                  - type: 'null'
                description: The number of the block where the given transaction was included.
              contractAddress:
                anyOf:
                  - type: string
                    pattern: ^0x[0-9a-fA-F]*$
                    minLength: 42
                    maxLength: 42
                  - type: 'null'
                description: 20 Bytes - The contract address created if the transaction was a contract creation, otherwise null.
              cumulativeGasUsed:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                minLength: 3
                maxLength: 66
                description: The total amount of gas used when this transaction was executed in the block.
              effectiveGasPrice:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                minLength: 3
                maxLength: 66
                description: The actual price per unit of gas paid by the sender.
              from:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                minLength: 42
                maxLength: 42
                description: 20 Bytes - address of the sender.
              gasUsed:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                minLength: 3
                maxLength: 66
                description: The amount of gas used by this specific transaction alone.
              logs:
                type: array
                description: Array of `Log` objects.
                items:
                  type: object
                  required:
                    - address
                    - data
                    - removed
                    - topics
                  title: Transaction log
                  properties:
                    address:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      minLength: 42
                      maxLength: 42
                      description: 20 Bytes - address from which this log originated.
                    blockHash:
                      anyOf:
                        - type: string
                          pattern: ^0x[0-9a-fA-F]*$
                          minLength: 66
                          maxLength: 66
                        - type: 'null'
                      description: The hash of the block where this log was included.
                    blockNumber:
                      anyOf:
                        - type: string
                          pattern: ^0x[0-9a-fA-F]*$
                          minLength: 3
                          maxLength: 66
                        - type: 'null'
                      description: The block number.
                    data:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: Contains one or more 32 Bytes non-indexed arguments of the log.
                    logIndex:
                      anyOf:
                        - type: string
                          pattern: ^0x[0-9a-fA-F]*$
                          minLength: 3
                          maxLength: 66
                        - type: 'null'
                      description: The log index position in the block.
                    removed:
                      type: boolean
                      description: '`true` when the log was removed due to a chain reorganization. `false` if it is a valid log.'
                    topics:
                      type: array
                      description: Array of zero to four 32 Bytes DATA values for indexed log arguments.
                      items:
                        type: string
                        pattern: ^0x[0-9a-fA-F]*$
                        minLength: 66
                        maxLength: 66
                    transactionHash:
                      anyOf:
                        - type: string
                          pattern: ^0x[0-9a-fA-F]*$
                          minLength: 66
                          maxLength: 66
                        - type: 'null'
                      description: The hash of the transaction this log was created from.
                    transactionIndex:
                      anyOf:
                        - type: string
                          pattern: ^0x[0-9a-fA-F]*$
                          minLength: 3
                          maxLength: 66
                        - type: 'null'
                      description: The transaction index position for the transaction that created this log.
              logsBloom:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                description: 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.
              status:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                minLength: 3
                maxLength: 66
                description: Either `0x1` (success) or `0x0` (failure).
              to:
                anyOf:
                  - type: string
                    pattern: ^0x[0-9a-fA-F]*$
                    minLength: 42
                    maxLength: 42
                  - type: 'null'
                description: 20 Bytes - address of the receiver. Null when it is a contract creation transaction.
              transactionHash:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                minLength: 66
                maxLength: 66
                description: 32 Bytes - The hash of the transaction.
              transactionIndex:
                anyOf:
                  - type: string
                    pattern: ^0x[0-9a-fA-F]*$
                    minLength: 3
                    maxLength: 66
                  - type: 'null'
                description: The index of the transaction in the block.
              blobGasPrice:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                minLength: 3
                maxLength: 66
              blobGasUsed:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                minLength: 3
                maxLength: 66
              blockTimestamp:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                minLength: 3
                maxLength: 66
              root:
                type: string
                pattern: ^0x[0-9a-fA-F]*$
                minLength: 66
                maxLength: 66
                description: 32 bytes of post-transaction state root (pre-Byzantium hard fork).
        additionalProperties: {}
        title: UserOperationReceipt
      - type: 'null'
examples:
  - name: eth_getUserOperationReceipt example
    params:
      - name: userOpHash
        value: '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
    result:
      name: UserOperationReceipt
      value:
        userOpHash: '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
        entryPoint: '0x0000000071727De22E5E9d8BAf0edAc6f37da032'
        sender: '0x1111111111111111111111111111111111111111'
        nonce: '0x1'
        paymaster: '0x0000000000000000000000000000000000000000'
        actualGasCost: '0x5208'
        actualGasUsed: '0x5208'
        success: true
        reason: ''
        logs:
          - address: '0x0000000071727De22E5E9d8BAf0edAc6f37da032'
            topics:
              - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
            data: 0x
        receipt:
          blockHash: '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'
          blockNumber: '0x12a3b4c'
          contractAddress: null
          cumulativeGasUsed: '0x5208'
          effectiveGasPrice: '0x59682f00'
          from: '0x3333333333333333333333333333333333333333'
          gasUsed: '0x5208'
          logs:
            - address: '0x0000000071727De22E5E9d8BAf0edAc6f37da032'
              blockHash: '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'
              blockNumber: '0x12a3b4c'
              data: 0x
              logIndex: '0x0'
              removed: false
              topics:
                - '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
              transactionHash: '0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'
              transactionIndex: '0x0'
          logsBloom: '0x00'
          status: '0x1'
          to: '0x4444444444444444444444444444444444444444'
          transactionHash: '0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'
          transactionIndex: '0x0'
          type: '0x2'
```
