WDK logoWDK documentation

Configuration

Configuration options for @tetherto/wdk-wallet-evm-7702-gasless.

Wallet Configuration

WalletManagerEvm7702Gasless, WalletAccountEvm7702Gasless, and WalletAccountReadOnlyEvm7702Gasless use the same base configuration. The account must also choose one fee mode: sponsorship policy or paymaster token.

Replace '<VERIFIED_DELEGATION_ADDRESS>' with a smart-account implementation address that you have verified for the target chain. The EOA delegates execution to this address.

Sponsored wallet configuration
import WalletManagerEvm7702Gasless from '@tetherto/wdk-wallet-evm-7702-gasless'

const wallet = new WalletManagerEvm7702Gasless(seedPhrase, {
  provider: 'https://rpc.mevblocker.io/fast',
  delegationAddress: '<VERIFIED_DELEGATION_ADDRESS>',
  bundlerUrl: 'https://api.pimlico.io/v2/1/rpc?apikey=YOUR_KEY',
  isSponsored: true,
  sponsorshipPolicyId: 'sp_my_policy'
})
Paymaster-token wallet configuration
const wallet = new WalletManagerEvm7702Gasless(seedPhrase, {
  provider: 'https://rpc.mevblocker.io/fast',
  delegationAddress: '<VERIFIED_DELEGATION_ADDRESS>',
  bundlerUrl: 'https://api.pimlico.io/v2/1/rpc?apikey=YOUR_KEY',
  paymasterAddress: '0x888888888888Ec68A58AB8094Cc1AD20Ba3D2402',
  paymasterToken: {
    address: '0xdAC17F958D2ee523a2206206994597C13D831ec7'
  },
  transferMaxFee: 100000n // 0.1 USDT when the token has 6 decimals
})

Required Common Fields

FieldTypeDescription
providerstring | Eip1193Provider | Array\<string | Eip1193Provider\>RPC endpoint, EIP-1193 provider, or ordered failover list.
bundlerUrlstringERC-4337 bundler endpoint used to build and submit UserOperations.
delegationAddressstringSmart-account implementation address used for EIP-7702 delegation.

Account constructors and per-call config overrides throw ConfigurationError if any required common field is missing.

Optional Common Fields

FieldTypeDefaultDescription
paymasterUrlstringbundlerUrlPaymaster endpoint when it differs from the bundler endpoint.
retriesnumber3Additional retry attempts when provider is an array. Total attempts are 1 + retries.

Provider Failover

Pass an ordered array when you want read and quote calls to retry against multiple RPC providers:

Provider failover
const wallet = new WalletManagerEvm7702Gasless(seedPhrase, {
  provider: [
    'https://rpc.mevblocker.io/fast',
    'https://eth.llamarpc.com'
  ],
  retries: 3,
  delegationAddress: '<VERIFIED_DELEGATION_ADDRESS>',
  bundlerUrl: 'https://api.pimlico.io/v2/1/rpc?apikey=YOUR_KEY',
  isSponsored: true
})

An empty provider array throws ConfigurationError. Include at least one RPC URL or EIP-1193 provider.

Fee Mode Configuration

Sponsorship Policy

Use sponsorship mode when a paymaster sponsors UserOperation fees.

FieldTypeRequiredDescription
isSponsoredtrueYesEnables sponsorship mode.
sponsorshipPolicyIdstringNoPolicy identifier passed to the paymaster context.
Sponsorship mode
const wallet = new WalletManagerEvm7702Gasless(seedPhrase, {
  provider: 'https://rpc.mevblocker.io/fast',
  delegationAddress: '<VERIFIED_DELEGATION_ADDRESS>',
  bundlerUrl: 'https://api.pimlico.io/v2/1/rpc?apikey=YOUR_KEY',
  isSponsored: true,
  sponsorshipPolicyId: 'sp_my_policy'
})

In sponsorship mode, quoteSendTransaction() and quoteTransfer() return { fee: 0n }.

Paymaster Token

Use paymaster-token mode when the account pays UserOperation fees with an ERC-20 token.

FieldTypeRequiredDescription
isSponsoredfalseNoOmit this field or set it to false.
paymasterToken.addressstringYesERC-20 token address used for fee payment.
paymasterAddressstringNoPins the expected paymaster contract address.
transferMaxFeenumber | bigintNoMaximum fee for transfer() operations, in paymaster-token base units. Choose the value using the token's decimals.

If isSponsored is omitted or false, paymasterToken is required.

Paymaster token mode
const wallet = new WalletManagerEvm7702Gasless(seedPhrase, {
  provider: 'https://rpc.mevblocker.io/fast',
  delegationAddress: '<VERIFIED_DELEGATION_ADDRESS>',
  bundlerUrl: 'https://api.pimlico.io/v2/1/rpc?apikey=YOUR_KEY',
  paymasterToken: {
    address: '0xdAC17F958D2ee523a2206206994597C13D831ec7'
  },
  transferMaxFee: 100000n // 0.1 USDT when the token has 6 decimals
})

When paymasterAddress is set, the account checks the paymaster address returned by the RPC response and throws ConfigurationError if it does not match.

Separate Paymaster Endpoint

Some providers use different bundler and paymaster URLs. Set paymasterUrl when the paymaster service is not available at bundlerUrl.

Separate paymaster endpoint
const wallet = new WalletManagerEvm7702Gasless(seedPhrase, {
  provider: 'https://rpc.mevblocker.io/fast',
  delegationAddress: '<VERIFIED_DELEGATION_ADDRESS>',
  bundlerUrl: 'https://api.candide.dev/bundler/v3/1/YOUR_KEY',
  paymasterUrl: 'https://api.candide.dev/paymaster/v3/1/YOUR_KEY',
  isSponsored: true,
  sponsorshipPolicyId: 'your_policy_id'
})

Per-call Overrides

quoteSendTransaction(), sendTransaction(), quoteTransfer(), and transfer() accept a partial fee-mode config override. Overrides are shallow-merged with the account config. Include isSponsored: false when switching a sponsored account to paymaster-token mode for one operation:

Override the paymaster token
const result = await account.sendTransaction({
  to: '0x742C4265F5Ba4F8E0842e2b9EfE66302F7a13B6F',
  value: 0n,
  data: '0x'
}, {
  isSponsored: false,
  paymasterToken: {
    address: '0x68749665FF8D2d112Fa859AA293F07A622782F38'
  }
})

When an override is provided, the merged config is validated before the operation runs.

On this page