Base Account enables users to pay for gas in ERC20 tokens
pm_getPaymasterStubData
and pm_getPaymasterData
JSON-RPC requests specified by ERC-7677 in addition to pm_getAcceptedPaymentTokens
. We step through each request and response below.
erc20
.data
field in the JSONRPC response which could be used to approve the paymaster and includes:acceptedTokens
array which is a struct including the token addresspaymasterAddress
field which is the paymaster address which will perform the token transfers.tokenPayment
field in the result. This includes:tokenAddress
address of the token used for paymentmaxFee
the maximum fee to show in the UIdecimals
decimals to use in the UIname
name of the tokenpm_getAcceptedPaymentTokens
returns an array of tokens the paymaster will accept for payment.
The request contains the entrypoint and the chain id with optional context.