Skip to content
Alchemy Logo

alchemy_requestPaymasterAndData

POST
/{apiKey}

Requests gas coverage for a UserOperation.

To be deprecated

Please use alchemy_requestGasAndPaymasterAndData instead.

While you can use alchemy_requestPaymasterAndData to request a paymaster signature, it's important to note that this function requires gas fields to be part of the UserOperation passed as a parameter. These gas fields are influenced by the response of this endpoint, creating a circular dependency.

To simplify this process, we introduced alchemy_requestGasAndPaymasterAndData. This function both estimates gas and provides signed paymaster and paymasterData fields, therefore resolving the circular dependency.

Path Parameters

stringrequireddefaults to docs-demo

For higher throughput, create your own API key

Request

string or string[]required

The Gas Manager policy ID or list of Gas Manager policy IDs.

object

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

stringformat: "^0[xX][0-9a-fA-F]*$"required

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.

objectrequired

Test Partial UserOperation object, missing paymasterAndData and signature fields. This can be either a v0.6 or v0.7 userOperation, but MUST match the version of the EntryPoint at the address in the entryPoint field.

string

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

Responses

200

The response object may be one of two types:

Was this page helpful?