Skip to main content
The ERC-20 paymaster flow lets users pay gas in tokens like ASTR or USDC instead of holding native ETH. The Startale Token Paymaster quotes the cost in tokens, the user (or your dapp) approves the spend once, and every subsequent UserOperation charges the token directly.
Source: StartaleGroup/scs-aa-sdk. Token addresses for each network are listed in Supported networks.

How it works

1. Build the token-paymaster client

The client looks like the sponsored client, except paymasterContext.token replaces paymasterContext.paymasterId.

2. Quote the cost in tokens

Before sending a UserOperation, ask the paymaster for the cost across the tokens you support. getTokenPaymasterQuotes returns one entry per token plus a list of unsupported addresses you passed in.
Show the user a token picker built from feeQuotes. Disable the entries in quotes.unsupportedTokens so they cannot be selected.

3. Send the UserOperation

Once the user picks a token, send the UserOperation with the token-paymaster client. The SDK takes care of the approval flow and packing the token into paymasterAndData.

Common errors

Next steps

Sponsored paymaster

Compare token gas to a fully sponsored flow.

Supported tokens

Look up the exact token address for the network you target.

Contract interactions

Combine token gas with batched calls.

Smart sessions

Pair token gas with scoped sessions for high-frequency UX.