Skip to main content
POST
estimateUserOperationGas

Understanding estimateUserOperationGas

  • estimateUserOperationGas takes a partial UserOperation object and returns detailed gas estimates to be used in continued UserOperation construction. It takes:
    • Partial user operation object:
      • sender - string.
      • nonce - string.
      • initCode - string.
      • callData - string.
      • signature - string.signature can be a dummy string, such as 0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c.
      • entrypointAddress - string.

Query example

JSON

Body

application/json

Request to estimate the gas cost of a user operation.

jsonrpc
string
default:2.0
required

Version of the JSON-RPC protocol, should be 2.0.

Example:

"2.0"

id
integer
default:1
required

The request identifier.

Example:

1

chainId
integer
required

The chain ID.

Example:

80001

method
enum<string>
required

API method being called.

Available options:
eth_estimateUserOperationGas
params
(object | string)[]
required

Parameters for gas estimation.

Response

200 - application/json

Successful response with gas estimation.

jsonrpc
string
default:2.0
required

Version of the JSON-RPC protocol, should be 2.0.

Example:

"2.0"

id
integer
default:1
required

The request identifier.

Example:

1

chainId
integer
required

The chain ID.

Example:

80001

result
object
required