Configuration options and settings for @tetherto/wdk-wallet-evm-erc-4337
Wallet Configuration
The WalletManagerEvmErc4337 requires a complete ERC-4337 configuration object with all required parameters:
importWalletManagerEvmErc4337from'@tetherto/wdk-wallet-evm-erc-4337'constconfig={ // Required parameterschainId:1,provider:'https://rpc.mevblocker.io/fast',safeModulesVersion:'0.3.0',// '0.2.0' and '0.3.0' are validentryPointAddress:'0x0000000071727De22E5E9d8BAf0edAc6f37da032',bundlerUrl:`https://api.pimlico.io/v1/ethereum/rpc?apikey=${PIMLICO_API_KEY}`,paymasterUrl:`https://api.pimlico.io/v2/ethereum/rpc?apikey=${PIMLICO_API_KEY}`,paymasterAddress:'0x777777777777AeC03fd955926DbF81597e66834C',transferMaxFee:100000000000000,paymasterToken:{address:'0xdAC17F958D2ee523a2206206994597C13D831ec7'}}constwallet=newWalletManagerEvmErc4337(seedPhrase,config)
Account Configuration
Both WalletAccountEvmErc4337 and WalletAccountReadOnlyEvmErc4337 use the same configuration structure:
Configuration Options
Chain ID
The chainId option specifies the blockchain network ID. Required for fee estimation and Safe4337Pack initialization.
Type:numberRequired: Yes
Examples:
Provider
The provider option specifies the RPC endpoint or EIP-1193 provider instance for blockchain interactions. Required for all operations.
Type:string | Eip1193ProviderRequired: Yes
Examples:
Bundler URL
The bundlerUrl option specifies the URL of the ERC-4337 bundler service that handles UserOperation bundling and submission to the mempool. Required for transaction processing.
Type:stringRequired: Yes
Example:
Paymaster URL
The paymasterUrl option specifies the URL of the paymaster service that sponsors transaction fees using ERC-20 tokens or sponsorship policies.
Type:stringRequired: Yes, for Paymaster Token mode and Sponsorship Policy mode. Not used in Native Coins mode.
Example:
Paymaster Address
The paymasterAddress option specifies the address of the paymaster smart contract.
Type:stringRequired: Yes, for Paymaster Token mode only. Not used in Sponsorship Policy or Native Coins modes.
Example:
Entry Point Address
The entryPointAddress option specifies the address of the ERC-4337 EntryPoint smart contract. Required for UserOperation processing.
Type:stringRequired: Yes
Standard EntryPoint v0.7:
Safe Modules Version
The safeModulesVersion option specifies the Safe modules version for smart contract wallet implementation. Required for Safe4337Pack initialization.
Type:stringRequired: Yes
Example:
Paymaster Token
The paymasterToken option specifies the ERC-20 token used for paying transaction fees through the paymaster.
Type:objectRequired: Yes, for Paymaster Token mode only. Not used in Sponsorship Policy or Native Coins modes.
Properties:
address (string): The ERC-20 token contract address
Example:
Sponsorship Policy ID
The sponsorshipPolicyId option specifies the sponsorship policy identifier for sponsored transactions.
Type:stringRequired: No (optional), only used in Sponsorship Policy mode.
Example:
Gas Payment Mode Flags
These boolean flags control which gas payment mode is used. Only one mode should be active at a time.
isSponsored
Enables Sponsorship Policy mode, where a sponsor covers transaction fees.
Type:booleanDefault:false
useNativeCoins
Enables Native Coins mode, where the user pays fees in the chain's native currency (ETH, MATIC, etc.).
Type:booleanDefault:false
Transfer Max Fee
The transferMaxFee option sets the maximum fee amount in paymaster token units for transfer operations. This prevents transactions with unexpectedly high fees. Optional parameter.
Type:number | bigintRequired: No (optional)
Unit: Paymaster token base units
Example:
Network-Specific Configurations
Ethereum Mainnet
Supported Paymaster Tokens
The following tokens are supported for gas payments on Ethereum Mainnet:
USD₮: 0xdAC17F958D2ee523a2206206994597C13D831ec7
USA₮: 0x07041776f5007aca2a54844f50503a18a72a8b68
XAU₮: 0x68749665ff8d2d112fa859aa293f07a622782f38
Polygon Mainnet
Arbitrum One
Avalanche C-Chain
Plasma
Sepolia Testnet (USD₮ ERC-20 mock/testnet only)
Important Ethereum Sepolia is a testnet. The USD₮ tokens available at the links below are not real and do not entitle the holder to anything. In particular, they cannot be redeemed with Tether International, S.A. de C.V. ("Tether International") and are not Tether Tokens as described in Tether International's Terms of Service. The USD₮ tokens available at the links below on this testnet are intended for testing WDK on Ethereum Sepolia. The links below are links to third-party websites and are Third-Party Information as described in Tether Operations, S.A. de C.V.'s Website Terms