# rundler_dropLocalUserOperation

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

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

Drops a local userOperation from the bundler mempool when it has not yet been bundled.

To authorize the drop, submit a signed replacement userOperation with the same sender and nonce. The replacement must set `preVerificationGas`, `callGasLimit`, and `maxFeePerGas` to `0x0`, set `callData` to `0x`, keep the original `initCode` if one was used (otherwise `0x`), and include enough `verificationGasLimit` for account validation. The signature must be valid for that replacement userOperation. This only removes the operation from the local mempool and does not cancel an operation that has already been bundled or propagated elsewhere.

Reference: https://www.alchemy.com/docs/wallets/api-reference/bundler-api/bundler-api-endpoints/rundler-drop-local-user-operation

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| UserOperation | object | Yes | The UserOperation object. This can be a v0.6, v0.7, or v0.8 user operation, but MUST match the version of the entry point at the address of the second parameter. |
| entryPoint | string | Yes | The EntryPoint address the request should be sent through. This MUST be one of the EntryPoints returned by the `supportedEntryPoints` RPC call. |

## Result

**Dropped userOperation hash** (string or null): The dropped `userOpHash`, or null if no matching local userOperation was dropped.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "rundler_dropLocalUserOperation",
  "params": [
    {
      "sender": "0x1111111111111111111111111111111111111111",
      "nonce": "0x1",
      "factory": "0x5555555555555555555555555555555555555555",
      "factoryData": "0x1234",
      "callData": "0x",
      "callGasLimit": "0x5208",
      "verificationGasLimit": "0x186a0",
      "preVerificationGas": "0x7530",
      "maxFeePerGas": "0x59682f00",
      "maxPriorityFeePerGas": "0x59682f",
      "paymaster": "0x0000000000000000000000000000000000000000",
      "paymasterVerificationGasLimit": "0x7530",
      "paymasterPostOpGasLimit": "0x5208",
      "paymasterData": "0x",
      "signature": "0x"
    },
    "0x0000000071727De22E5E9d8BAf0edAc6f37da032"
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "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": "rundler_dropLocalUserOperation",
  "params": [
    {
      "sender": "0x1111111111111111111111111111111111111111",
      "nonce": "0x1",
      "factory": "0x5555555555555555555555555555555555555555",
      "factoryData": "0x1234",
      "callData": "0x",
      "callGasLimit": "0x5208",
      "verificationGasLimit": "0x186a0",
      "preVerificationGas": "0x7530",
      "maxFeePerGas": "0x59682f00",
      "maxPriorityFeePerGas": "0x59682f",
      "paymaster": "0x0000000000000000000000000000000000000000",
      "paymasterVerificationGasLimit": "0x7530",
      "paymasterPostOpGasLimit": "0x5208",
      "paymasterData": "0x",
      "signature": "0x"
    },
    "0x0000000071727De22E5E9d8BAf0edAc6f37da032"
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'rundler_dropLocalUserOperation',
    params: [
      {
        sender: '0x1111111111111111111111111111111111111111',
        nonce: '0x1',
        factory: '0x5555555555555555555555555555555555555555',
        factoryData: '0x1234',
        callData: '0x',
        callGasLimit: '0x5208',
        verificationGasLimit: '0x186a0',
        preVerificationGas: '0x7530',
        maxFeePerGas: '0x59682f00',
        maxPriorityFeePerGas: '0x59682f',
        paymaster: '0x0000000000000000000000000000000000000000',
        paymasterVerificationGasLimit: '0x7530',
        paymasterPostOpGasLimit: '0x5208',
        paymasterData: '0x',
        signature: '0x'
      },
      '0x0000000071727De22E5E9d8BAf0edAc6f37da032'
    ]
  })
};

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": "rundler_dropLocalUserOperation",
    "params": [
        {
            "sender": "0x1111111111111111111111111111111111111111",
            "nonce": "0x1",
            "factory": "0x5555555555555555555555555555555555555555",
            "factoryData": "0x1234",
            "callData": "0x",
            "callGasLimit": "0x5208",
            "verificationGasLimit": "0x186a0",
            "preVerificationGas": "0x7530",
            "maxFeePerGas": "0x59682f00",
            "maxPriorityFeePerGas": "0x59682f",
            "paymaster": "0x0000000000000000000000000000000000000000",
            "paymasterVerificationGasLimit": "0x7530",
            "paymasterPostOpGasLimit": "0x5208",
            "paymasterData": "0x",
            "signature": "0x"
        },
        "0x0000000071727De22E5E9d8BAf0edAc6f37da032"
    ]
}
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\": \"rundler_dropLocalUserOperation\",\n  \"params\": [\n    {\n      \"sender\": \"0x1111111111111111111111111111111111111111\",\n      \"nonce\": \"0x1\",\n      \"factory\": \"0x5555555555555555555555555555555555555555\",\n      \"factoryData\": \"0x1234\",\n      \"callData\": \"0x\",\n      \"callGasLimit\": \"0x5208\",\n      \"verificationGasLimit\": \"0x186a0\",\n      \"preVerificationGas\": \"0x7530\",\n      \"maxFeePerGas\": \"0x59682f00\",\n      \"maxPriorityFeePerGas\": \"0x59682f\",\n      \"paymaster\": \"0x0000000000000000000000000000000000000000\",\n      \"paymasterVerificationGasLimit\": \"0x7530\",\n      \"paymasterPostOpGasLimit\": \"0x5208\",\n      \"paymasterData\": \"0x\",\n      \"signature\": \"0x\"\n    },\n    \"0x0000000071727De22E5E9d8BAf0edAc6f37da032\"\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\": \"rundler_dropLocalUserOperation\",\n  \"params\": [\n    {\n      \"sender\": \"0x1111111111111111111111111111111111111111\",\n      \"nonce\": \"0x1\",\n      \"factory\": \"0x5555555555555555555555555555555555555555\",\n      \"factoryData\": \"0x1234\",\n      \"callData\": \"0x\",\n      \"callGasLimit\": \"0x5208\",\n      \"verificationGasLimit\": \"0x186a0\",\n      \"preVerificationGas\": \"0x7530\",\n      \"maxFeePerGas\": \"0x59682f00\",\n      \"maxPriorityFeePerGas\": \"0x59682f\",\n      \"paymaster\": \"0x0000000000000000000000000000000000000000\",\n      \"paymasterVerificationGasLimit\": \"0x7530\",\n      \"paymasterPostOpGasLimit\": \"0x5208\",\n      \"paymasterData\": \"0x\",\n      \"signature\": \"0x\"\n    },\n    \"0x0000000071727De22E5E9d8BAf0edAc6f37da032\"\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\": \"rundler_dropLocalUserOperation\",\n  \"params\": [\n    {\n      \"sender\": \"0x1111111111111111111111111111111111111111\",\n      \"nonce\": \"0x1\",\n      \"factory\": \"0x5555555555555555555555555555555555555555\",\n      \"factoryData\": \"0x1234\",\n      \"callData\": \"0x\",\n      \"callGasLimit\": \"0x5208\",\n      \"verificationGasLimit\": \"0x186a0\",\n      \"preVerificationGas\": \"0x7530\",\n      \"maxFeePerGas\": \"0x59682f00\",\n      \"maxPriorityFeePerGas\": \"0x59682f\",\n      \"paymaster\": \"0x0000000000000000000000000000000000000000\",\n      \"paymasterVerificationGasLimit\": \"0x7530\",\n      \"paymasterPostOpGasLimit\": \"0x5208\",\n      \"paymasterData\": \"0x\",\n      \"signature\": \"0x\"\n    },\n    \"0x0000000071727De22E5E9d8BAf0edAc6f37da032\"\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: rundler_dropLocalUserOperation
description: |-
  Drops a local userOperation from the bundler mempool when it has not yet been bundled.

  To authorize the drop, submit a signed replacement userOperation with the same sender and nonce. The replacement must set `preVerificationGas`, `callGasLimit`, and `maxFeePerGas` to `0x0`, set `callData` to `0x`, keep the original `initCode` if one was used (otherwise `0x`), and include enough `verificationGasLimit` for account validation. The signature must be valid for that replacement userOperation. This only removes the operation from the local mempool and does not cancel an operation that has already been bundled or propagated elsewhere.
x-compute-units: 1000
params:
  - name: UserOperation
    required: true
    description: The UserOperation object. This can be a v0.6, v0.7, or v0.8 user operation, but MUST match the version of the entry point at the address of the second parameter.
    schema:
      anyOf:
        - type: object
          required:
            - sender
            - nonce
            - initCode
            - callData
            - callGasLimit
            - verificationGasLimit
            - preVerificationGas
            - maxFeePerGas
            - maxPriorityFeePerGas
            - paymasterAndData
            - signature
          properties:
            sender:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 42
              maxLength: 42
              description: The account sending the userOperation.
            nonce:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: Anti-replay parameter; also used as the salt for first-time account creation.
            initCode:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              description: The initCode of the account (needed if and only if the account is not yet on-chain and needs to be created).
            callData:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              description: Encoded data for executing the primary function call or operation within the user's transaction, such as calling a smart contract function or transferring tokens. This data is passed to the sender's address during the execution of the userOperation.
            callGasLimit:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: The amount of gas to allocate for the main execution call.
            verificationGasLimit:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: The amount of gas to allocate for the verification step.
            preVerificationGas:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: The amount of gas to compensate the bundler for pre-verification execution and calldata.
            maxFeePerGas:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: The maximum fee per gas to pay for the execution of this operation (similar to EIP-1559 max_fee_per_gas).
            maxPriorityFeePerGas:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas).
            paymasterAndData:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              description: Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster (empty for self-sponsored transaction).
            signature:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              description: Data passed into the account along with the nonce during the verification step.
            eip7702Auth:
              anyOf:
                - type: object
                  required:
                    - chainId
                    - nonce
                    - address
                    - yParity
                    - r
                    - s
                  properties:
                    chainId:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: The chain ID authorized by this EIP-7702 tuple.
                    nonce:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: The nonce of the EIP-7702 authority.
                    address:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      minLength: 42
                      maxLength: 42
                      description: The contract address to set as code for the authority.
                    yParity:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: The y-parity value for the authorization signature.
                    r:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: The ECDSA r value.
                    s:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: The ECDSA s value.
                  additionalProperties: {}
                  title: EIP-7702 authorization
                - type: 'null'
            aggregator:
              anyOf:
                - anyOf:
                    - type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      minLength: 42
                      maxLength: 42
                    - type: string
                      enum:
                        - 0x
                - type: 'null'
          additionalProperties: {}
          title: User Operation v0.6
        - type: object
          required:
            - sender
            - nonce
            - callData
            - callGasLimit
            - verificationGasLimit
            - preVerificationGas
            - maxFeePerGas
            - maxPriorityFeePerGas
            - signature
          properties:
            sender:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 42
              maxLength: 42
              description: The account sending the userOperation.
            nonce:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: Anti-replay parameter; also used as the salt for first-time account creation.
            factory:
              anyOf:
                - anyOf:
                    - type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      minLength: 42
                      maxLength: 42
                    - type: string
                      enum:
                        - 0x
                - type: 'null'
              description: The account factory address (needed if and only if the account is not yet on-chain and needs to be created).
            factoryData:
              anyOf:
                - type: string
                  pattern: ^0x[0-9a-fA-F]*$
                - type: 'null'
              description: Data for the account factory (only if the account factory exists).
            callData:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              description: Encoded data for executing the primary function call or operation within the user's transaction, such as calling a smart contract function or transferring tokens. This data is passed to the sender's address during the execution of the userOperation.
            callGasLimit:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: The amount of gas to allocate for the main execution call.
            verificationGasLimit:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: The amount of gas to allocate for the verification step.
            preVerificationGas:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: The amount of gas to compensate the bundler for pre-verification execution and calldata.
            maxFeePerGas:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: The maximum fee per gas to pay for the execution of this operation (similar to EIP-1559 max_fee_per_gas).
            maxPriorityFeePerGas:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              minLength: 3
              maxLength: 66
              description: Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas).
            paymaster:
              anyOf:
                - anyOf:
                    - type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      minLength: 42
                      maxLength: 42
                    - type: string
                      enum:
                        - 0x
                - type: 'null'
              description: Address of the paymaster contract (or empty, if the account pays for itself).
            paymasterVerificationGasLimit:
              anyOf:
                - type: string
                  pattern: ^0x[0-9a-fA-F]*$
                  minLength: 3
                  maxLength: 66
                - type: 'null'
              description: The amount of gas to allocate for the paymaster validation code (only if a paymaster exists).
            paymasterPostOpGasLimit:
              anyOf:
                - type: string
                  pattern: ^0x[0-9a-fA-F]*$
                  minLength: 3
                  maxLength: 66
                - type: 'null'
              description: The amount of gas to allocate for the paymaster post-op code (only if a paymaster exists).
            paymasterData:
              anyOf:
                - type: string
                  pattern: ^0x[0-9a-fA-F]*$
                - type: 'null'
              description: Data for the paymaster (only if the paymaster exists).
            signature:
              type: string
              pattern: ^0x[0-9a-fA-F]*$
              description: Data passed into the account along with the nonce during the verification step.
            eip7702Auth:
              anyOf:
                - type: object
                  required:
                    - chainId
                    - nonce
                    - address
                    - yParity
                    - r
                    - s
                  properties:
                    chainId:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: The chain ID authorized by this EIP-7702 tuple.
                    nonce:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: The nonce of the EIP-7702 authority.
                    address:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      minLength: 42
                      maxLength: 42
                      description: The contract address to set as code for the authority.
                    yParity:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: The y-parity value for the authorization signature.
                    r:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: The ECDSA r value.
                    s:
                      type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      description: The ECDSA s value.
                  additionalProperties: {}
                  title: EIP-7702 authorization
                - type: 'null'
            aggregator:
              anyOf:
                - anyOf:
                    - type: string
                      pattern: ^0x[0-9a-fA-F]*$
                      minLength: 42
                      maxLength: 42
                    - type: string
                      enum:
                        - 0x
                - type: 'null'
          additionalProperties: {}
          title: User Operation v0.7 / v0.8
  - name: entryPoint
    required: true
    description: The EntryPoint address the request should be sent through. This MUST be one of the EntryPoints returned by the `supportedEntryPoints` RPC call.
    schema:
      type: string
      pattern: ^0x[0-9a-fA-F]*$
      minLength: 42
      maxLength: 42
result:
  name: Dropped userOperation hash
  description: The dropped `userOpHash`, or null if no matching local userOperation was dropped.
  schema:
    anyOf:
      - type: string
        pattern: ^0x[0-9a-fA-F]*$
        minLength: 66
        maxLength: 66
      - type: 'null'
examples:
  - name: rundler_dropLocalUserOperation example
    params:
      - name: UserOperation
        value:
          sender: '0x1111111111111111111111111111111111111111'
          nonce: '0x1'
          factory: '0x5555555555555555555555555555555555555555'
          factoryData: '0x1234'
          callData: 0x
          callGasLimit: '0x5208'
          verificationGasLimit: '0x186a0'
          preVerificationGas: '0x7530'
          maxFeePerGas: '0x59682f00'
          maxPriorityFeePerGas: '0x59682f'
          paymaster: '0x0000000000000000000000000000000000000000'
          paymasterVerificationGasLimit: '0x7530'
          paymasterPostOpGasLimit: '0x5208'
          paymasterData: 0x
          signature: 0x
      - name: entryPoint
        value: '0x0000000071727De22E5E9d8BAf0edAc6f37da032'
    result:
      name: Dropped userOperation hash
      value: '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
```
