alchemy_requestGasAndPaymasterAndData
Requests gas and coverage for a UserOperation
. Returns paymasterAndData
and gas parameters if approved, errors if not. Optionally accepts fee parameter overrides to be used in the UserOperation
.
Path parameters
Request
The Gas Policy ID or list of Gas Policy IDs.
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 userOperation
field.
Dummy signature for the operation. This is useful for estimating gas costs.
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.
An object containing optional gas parameters, paymasterAndData
, and signature fields. It can be either a v0.6 or v0.7 user operation but must match the version of the entry point at the specified entryPoint
.
Optional fields that override our gas and fee estimates. Use this parameter to optionally override available fields: 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 estimatedmaxPriorityFeePerGas
of the userOp.
These overrides will be applied for every userOp sent with this provider. A higher buffer may give userOps a better chance to mine if the L1/L2 gas and fees change.
Previous override using “percentage” has been deprecated in favor of “multiplier” values
Optional.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.
Additional data you wish to include in the request, such as proof of humanity.
Response
The transformed response object that wraps the original gas and paymaster response. It includes an array of asset change objects, a gasUsed field, and an error field.