Paymaster Endpoint

As per ERC-4337, Paymasters facilitate transaction sponsorship, allowing third-party-designed mechanisms to pay for transactions. Many of these mechanisms could be done by having the paymaster wrap a UserOperation with their own, but there are some important fundamental limitations to that approach:

  • No possibility for “passive” paymasters (eg. that accept fees in some ERC-20 token at an exchange rate pulled from an on-chain DEX)

  • Paymasters run the risk of getting griefed, as users could send ops that appear to pay the paymaster but then change their behavior after a block

Utilize the following APIs to get paymaster data and signature.

/getpaymasterdata

Get the paymaster data, that can be sent in the user operations.

GET https://api.expand.network/aa/getpaymasterdata

Query Parameters

Name
Type
Description

chainId

String

chainSymbol

String

sender*

String

On-chain wallet address.

rpc

String

Remote procedural call URL.

nonce

String

Anti-replay parameter.

initCode

String

The initCode of the account. (needed if and only if the account is not yet on-chain and needs to be created)

preVerificationGas

String

The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata.

verificationGasLimit

String

The amount of gas to allocate for the verification step.

gasLimit

String

Maximum gas limit provided by the sender, for the transaction.

callGasLimit

String

The amount of gas to allocate the main execution call.

callData

String

Encoded data for executing the primary function call or operation within the user's transaction.

maxPriorityFeePerGas

String

Maximum priority fee per gas. (similar to EIP-1559 max_priority_fee_per_gas)

maxFeePerGas

String

signature

String

Data passed into the account along with the nonce during the verification step.

paymasterAndData

String

Address of paymaster sponsoring the transaction, followed by extra data to send to the paymaster. (empty for self-sponsored transaction)

paymasterContractAddress*

String

Address of the contract from where, gas is to be paid.

mockValidAfter*

String

The UserOp is valid only after this time, to be sent in epoch time format.

mockValidUntil*

String

The UserOp is valid only up to this time, to be sent in epoch time format.

Get the paymaster data, that can be sent in the user operations.

GET https://api.expand.network/aa/getpaymasterdata

Query Parameters

Name
Type
Description

chainId

String

X79PAlDpiaAZ

chainSymbol

String

esqlLV2TQKmk

sender*

String

P1M0DEYPkhul

rpc

String

mvCcan4eD3NF

nonce

String

FwJEI70Wht3S

initCode

String

1R3FlTfCYUBa

preVerificationGas

String

1eT6RqX0nqyG

verificationGasLimit

String

DnX9VugMVloH

gasLimit

String

zUdzNOxJDGRH

callGasLimit

String

audo3kF3xw8x

callData

String

3oP8OogWHUDq

maxPriorityFeePerGas

String

cpKmYjMzPbbG

maxFeePerGas

String

IwpNV9XEA7x8

signature

String

bw8qaPcJIVzh

paymasterAndData

String

Eah522POkXVY

paymasterContractAddress*

String

BSIZZLCoVeNC

mockValidAfter*

String

sORl7ndQ8x86

mockValidUntil*

String

Kig8L9DXgPRt

https://api.expand.network/aa/getpaymasterdata?sender=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&chainId=1&paymasterContractAddress=0xba60b04029be2bfd16d76e70290acfad3a8b582c&mockValidUntil=0x00000000deadbeef&mockValidAfter=0x0

Last updated