alchemy_requestGasAndPaymasterAndData

Requests gas and coverage for a UserOperation on EMV networks. Returns paymasterAndData and gas parameters if approved, errors if not. Optionally accepts fee parameter overrides to be used in the UserOperation.

🚧

Dummy Signature

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.

Parameters

  • Object: This object contains all necessary fields to estimate gas and coverage:

    • policyId (string): The gas policy ID.

    • entryPoint (string): The address where the request should be sent through. This must be one of the entry points returned by the supportedEntryPoints RPC call and should match the version of the user operation.

    • dummySignature (string): A dummy signature for the operation. This helps estimate gas costs.

    • userOperation (object): 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.

    • overrides (object): Optional fields that override our gas and fee estimates. Use this parameter to optionally override available fields: maxFeePerGas, maxPriorityFeePerGas, callGasLimit, verificationGasLimit, orpreVerificationGas. This will apply either:

      1. absolutes overrides (using a hex string) simply overriding estimated values entirely OR
      2. 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.


        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.
      "overrides": {
        "maxFeePerGas": "hex string" | { "multiplier": number },
        "maxPriorityFeePerGas": "hex string" | { "multiplier": number },
        "callGasLimit": "hex string" | { "multiplier": number },
        "verificationGasLimit": "hex string" | { "multiplier": number },
        "preVerificationGas": "hex string" | { "multiplier": number },
      }
      

      ⚠️Deprecated: previous override using "percentage" has been deprecated in favor of "multiplier" values

    • stateOverrideSet (Object): 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. Each address maps to an object containing:

      FIELDTYPEBYTESDESCRIPTION
      balanceQuantity (Hex string)≤32Fake balance to set for the account before executing the call.
      nonceQuantity (Hex string)≤8Fake nonce to set for the account before executing the call.
      codeBinary (Hex string)anyFake EVM bytecode to inject into the account before executing the call.
      stateObjectanyFake key-value mapping to override all slots in the account storage before executing the call.
      stateDiffObjectanyFake key-value mapping to override individual slots in the account storage before executing the call.
Path Params
string
required
Defaults to docs-demo

For higher throughput, create your own API key

Body Params
integer
Defaults to 1
string
Defaults to 2.0
string
Defaults to alchemy_requestGasAndPaymasterAndData
params
array of objects
length between 1 and 1

Parameters for requesting gas and coverage

params
string

Additional data you wish to include in the request, such as proof of humanity.

Defaults to 69d524a7-e932-4214-8673-dcdcba31bb42

The policy ID or list of policy IDs

string
Defaults to 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789

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.

string
Defaults to 0xe8fe34b166b64d118dccf44c7198648127bf8a76a48a042862321af6058026d276ca6abb4ed4b60ea265d1e57e33840d7466de75e13f072bbd3b7e64387eebfe1b

Dummy signature for the operation. This is useful for estimating gas costs.

Partial UserOperation object, missing gas parameters, paymasterAndData and signature fields. This can be either a v0.6 or v0.7 user operation, but MUST match the version of the entry point at the address in the entryPoint field.

overrides
object

Optional fields to override default gas and fee behavior - this will apply either multiplier overrides relative to our default estimates or absolute overrides

Response

Response body
object
integer
string
result
object
entrypointV06Response
object
entrypointV07Response
object
Language
URL
Click Try It! to start a request and see the response here! Or choose an example:
application/json
ReadMe
Support Hub