eth_estimateUserOperationGas

Estimates the gas values for a UserOperation.

📘

Supported EntryPoints

eth_sendUserOperation supports versions v0.6 and v0.7 of ERC-4337. Check our FAQs to determine which version you should use.

🚧

Dummy Signature

This endpoint requires a dummy signature in the userOp. Check our FAQs to learn what a dummy signature is and which dummy signature you should use.

Parameters

  1. UserOperation (Object): Contains gas limits and prices (optional). This can be either a v0.6 or v0.7 user operation but must match the version of the EntryPoint at the address of the second parameter.

  2. entryPoint (String): The address to which the request should be sent. This must be one of the EntryPoint returned by the supportedEntryPoints method and should match the version of the userOp in the first parameter.

  3. stateOverrideSet (Object): Allows changes to the state of a contract before executing the call. For example, you can modify variable values (like balances or approvals) for that call without changing the contract itself on the blockchain.

    In more technical terms, the state override set is an optional parameter that allows executing the call against a modified chain state. It is an address-to-state mapping, where each entry specifies some state to be overridden prior to executing the call. Each address maps to an object containing:

    FIELDTYPEBYTESDESCRIPTION
    balanceQuantity (Hex string)≤32Fake balance to set for the account before executing the call.
    nonceQuantity (Hex string)≤8Fake nonce to set for the account before executing the call.
    codeBinary (Hex string)anyFake EVM bytecode to inject into the account before executing the call.
    stateObjectanyFake key-value mapping to override all slots in the account storage before executing the call.
    stateDiffObjectanyFake key-value mapping to override individual slots in the account storage before executing the call.
Path Params
string
required
Defaults to docs-demo

For higher throughput, create your own API key

Body Params
integer
Defaults to 1
string
Defaults to 2.0
string
Defaults to eth_estimateUserOperationGas
params
array
length between 2 and 2
  1. Object - The UserOperation object (gas limits and prices are optional). This can be either a v0.6 or v0.7 user operation, but MUST match the version of the entry point at the address of the second parameter.
  2. String - The entrypoint address the request should be sent through. This MUST be one of the entry points returned by the supportedEntryPoints rpc call and match the version of the user operation in the first parameter.
params
Response

Response body
object
integer
string
result
object
entrypointV06Response
object
entrypointV07Response
object
Language
URL
Click Try It! to start a request and see the response here! Or choose an example:
application/json
ReadMe
Support Hub