POST
/
bundlers
/
{chainId}
/
rpc
eth_estimateUserOperationGas
curl --request POST \
  --url https://api.gelato.digital/bundlers/{chainId}/rpc \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_estimateUserOperationGas",
  "params": [
    {
      "sender": "0x....",
      "nonce": "0x....",
      "factory": "0x....",
      "factoryData": "0x....",
      "authorization": "0x....",
      "callData": "0x....",
      "signature": "0x....",
      "maxFeePerGas": "0x....",
      "maxPriorityFeePerGas": "0x....",
      "paymaster": "0x....",
      "paymasterData": "0x...."
    },
    "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
    {
      "0xsender": {
        "balance": "0x....",
        "nonce": "0x....",
        "code": "0x...."
      }
    }
  ]
}'
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "preVerificationGas": "0x0",
    "verificationGasLimit": "0x148a6",
    "callGasLimit": "0x358e"
  }
}
Update: State overrides are now supported in this API endpoint. Checkout this example to understand how to use it.
  • In the Playground, click Add an Item to include the StateOverrideSet object.
  • Then, click Add a Property and add sender address there.
  • Now you can add the override values such as balance, nonce, code, state, stateDiff etc.
Before using the API Endpoints, make sure to check out the Quick Start guide to understand the required parameters for different payment methods with the Gelato Bundler.
The API Playground below defaults to EntryPoint v0.7 parameters, If you’re working with EntryPoint v0.6, please change the object parameter to UserOperationEntryPoint0.6.Important: After entering the userOperation parameters, make sure to click Add an Item to include the EntryPoint address.

Path Parameters

chainId
number
required

Target network chain identifier.

Query Parameters

apiKey
string

Gelato API key for higher rate limits. This must be provided if sponsoring off-chain via Gas Tank.

sponsored
boolean

Whether the request should be sponsored off-chain via Gas Tank

Body

application/json

Response

200
application/json

Successful response

The response is of type object.