alchemy_requestGasAndPaymasterAndData

Requests gas coverage for a UserOperation. Optionally accepts fee parameter overrides to be used in the UserOperation.

Path parameters

apiKeystringRequired

Request

This endpoint expects an object.
policyIdstring or list of stringsRequired
The Gas Manager Policy ID or list of Gas Manager Policy IDs.
entryPointstringRequiredformat: "^0[xX][0-9a-fA-F]*$"

The EntryPoint address the request should be sent through. This MUST be one of the EntryPoints returned by the supportedEntryPoints RPC call and match the version of the userOperation in the userOperation field.

dummySignaturestringRequired

Dummy signature for the userOperation. This is useful for estimating gas costs. Check our FAQs to learn what a dummy signature is.

userOperationobjectRequired

An object containing optional gas parameters, paymasterAndData, and signature fields. It can be either a v0.6 or v0.7 userOperation but must match the version of the EntryPoint at the specified entryPoint.

erc20ContextobjectOptional

Erc20 context, required to enable users to pay gas with ERC-20 tokens.

overridesobjectOptional

Optional fields that override our gas and fee estimates. Use this parameter to override: maxFeePerGas, maxPriorityFeePerGas, callGasLimit, verificationGasLimit, or preVerificationGas.

This will apply either:

  • absolutes overrides (using a hex string) simply overriding estimated values entirely OR
  • multiplier overrides relative to our estimates (in the format of { “multiplier”: number } with max precision of 4 decimal places). For example, if the override value is { multiplier: 1.1 } for the maxPriorityFeePerGas field, then a 1.1 multiplier, or a 10% increase, is applied to the estimated maxPriorityFeePerGas of the userOp.

A higher buffer may give userOps a better chance to mine if the L1/L2 gas and fees change.

1"overrides": {
2 "maxFeePerGas": "hex string" | { "multiplier": number },
3 "maxPriorityFeePerGas": "hex string" | { "multiplier": number },
4 "callGasLimit": "hex string" | { "multiplier": number },
5 "verificationGasLimit": "hex string" | { "multiplier": number },
6 "preVerificationGas": "hex string" | { "multiplier": number },
7}
stateOverrideSetobjectOptional

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.

webhookDatastringOptional
Additional data you can include in the request, such as proof of humanity, if you have enabled custom rules in your Gas Manager policy.

Response

The response object may be one of two types:

entrypointV06Responseobject
entrypointV07Responseobject