Skip to content
Alchemy Logo

eth_estimateUserOperationGas

POST
/{apiKey}

Estimates the gas values for a UserOperation.

This endpoint requires a dummy signature in the userOp. Check our FAQs to learn what a dummy signature is.

Path Parameters

stringrequireddefaults to docs-demo

For higher throughput, create your own API key

Request

objectrequired

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

stringformat: "^0x[0-9a-fA-F]{40}$"required

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.

objectoptional

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.

Responses

200

Gas values estimated for the userOperation.

Was this page helpful?