Wallet EVM 7702 Gasless API Reference
Complete API documentation for @tetherto/wdk-wallet-evm-7702-gasless.
Table of Contents
| Export | Description |
|---|---|
| WalletManagerEvm7702Gasless | Default export. Manages EIP-7702 gasless EVM wallet accounts. |
| WalletAccountEvm7702Gasless | Owned EIP-7702 gasless account with signing, approval, transfer, and send methods. |
| WalletAccountReadOnlyEvm7702Gasless | Read-only account with balances, quotes, receipts, allowances, and verification. |
| ConfigurationError | Error thrown for invalid wallet configuration. |
| Config Types | Evm7702GaslessWalletConfig and related fee-mode types. |
WalletManagerEvm7702Gasless
Default export from @tetherto/wdk-wallet-evm-7702-gasless.
import WalletManagerEvm7702Gasless from '@tetherto/wdk-wallet-evm-7702-gasless'Constructor
new WalletManagerEvm7702Gasless(seed, config)| Parameter | Type | Description |
|---|---|---|
seed | string | Uint8Array | BIP-39 mnemonic seed phrase or seed bytes. |
config | Evm7702GaslessWalletConfig | Wallet configuration with common fields and one fee mode. |
Methods
| Method | Parameters | Returns | Notes |
|---|---|---|---|
getAccount(index?) | index?: number | Promise\<WalletAccountEvm7702Gasless\> | Defaults to index 0 and derives 0'/0/{index}. |
getAccountByPath(path) | path: string | Promise\<WalletAccountEvm7702Gasless\> | Returns a cached account for the derivation path suffix. |
getFeeRates() | - | Promise\<{ normal: bigint, fast: bigint }\> | Uses provider fee data. Throws if no provider is connected. |
dispose() | - | void | Inherited from WalletManager; disposes managed accounts. |
getFeeRates() returns fee rates in wei. The normal value applies the EVM wallet normal multiplier, and fast applies the EVM wallet fast multiplier to the provider fee.
WalletAccountEvm7702Gasless
Named export for owned EIP-7702 gasless accounts.
import { WalletAccountEvm7702Gasless } from '@tetherto/wdk-wallet-evm-7702-gasless'Constructors
new WalletAccountEvm7702Gasless(seed, path, config)
new WalletAccountEvm7702Gasless(walletAccountEvm, config)| Parameter | Type | Description |
|---|---|---|
seed | string | Uint8Array | BIP-39 mnemonic seed phrase or seed bytes. |
path | string | EVM derivation path suffix, for example "0'/0/0". |
walletAccountEvm | WalletAccountEvm | Existing EVM account to wrap. |
config | Evm7702GaslessWalletConfig | Wallet configuration. |
Properties
| Property | Type | Description |
|---|---|---|
index | number | Derivation path index from the wrapped EVM account. |
path | string | Full derivation path from the wrapped EVM account. |
keyPair | KeyPair | Read-only view of the wrapped EVM account key pair. |
Treat the arrays returned through keyPair as read-only. Call dispose() when the account is no longer needed.
Methods
| Method | Parameters | Returns | Notes |
|---|---|---|---|
getAddress() | - | Promise\<string\> | Inherited read-only method. Returns the EOA address. |
getBalance() | - | Promise\<bigint\> | Native token balance in wei. |
getTokenBalance(tokenAddress) | tokenAddress: string | Promise\<bigint\> | ERC-20 balance in base units. |
getTokenBalances(tokenAddresses) | tokenAddresses: string[] | Promise\<Record\<string, bigint\>\> | Multiple ERC-20 balances in base units. |
getPaymasterTokenBalance() | - | Promise\<bigint\> | Throws ConfigurationError when no paymasterToken is configured. |
sign(message) | message: string | Promise\<string\> | Signs with the wrapped EVM account. |
signTypedData(typedData) | TypedData | Promise\<string\> | Signs EIP-712 typed data. |
verify(message, signature) | message: string, signature: string | Promise\<boolean\> | Verifies a plain message signature. |
verifyTypedData(typedData, signature) | TypedData, signature: string | Promise\<boolean\> | Verifies EIP-712 typed data. |
signTransaction(tx, config?) | EvmTransaction | EvmTransaction[], partial fee-mode config | Promise\<UserOperationV8\> | Signs a self-contained UserOperation without broadcasting it. |
approve(options) | ApproveOptions | Promise\<TransactionResult\> | Sends an ERC-20 approval as a UserOperation. |
quoteSendTransaction(tx, config?) | EvmTransaction | EvmTransaction[] | UserOperationV8, partial fee-mode config | Promise\<Omit\<TransactionResult, 'hash'\>\> | Returns { fee }; owned accounts cache paymaster-token quotes for up to 2 minutes and validate the nonce before reuse. |
sendTransaction(tx, config?) | EvmTransaction | EvmTransaction[] | UserOperationV8, partial fee-mode config | Promise\<TransactionResult\> | Builds and signs an operation, or broadcasts an already-signed UserOperation. |
quoteTransfer(options, config?) | EvmTransferOptions, partial fee-mode config | Promise\<Omit\<TransferResult, 'hash'\>\> | Quotes an ERC-20 transfer. |
transfer(options, config?) | EvmTransferOptions, partial fee-mode config | Promise\<TransferResult\> | Sends an ERC-20 transfer as a UserOperation. |
getAllowance(token, spender) | token: string, spender: string | Promise\<bigint\> | Reads ERC-20 allowance. |
getUserOperationReceipt(hash) | hash: string | Promise\<UserOperationReceipt | null\> | Reads the raw bundler receipt. |
getTransactionReceipt(hash) | hash: string | Promise\<EvmTransactionReceipt | null\> | Maps a UserOperation hash to an EVM receipt when included. |
toReadOnlyAccount() | - | Promise\<WalletAccountReadOnlyEvm7702Gasless\> | Returns a cached read-only account. |
dispose() | - | void | Clears quote cache and disposes the wrapped EVM account. |
Quote and Send Behavior
- Sponsored mode returns
fee: 0nfrom quote methods. - Paymaster-token mode returns fees in the configured paymaster token's base units.
signTransaction()returns a signedUserOperationV8without broadcasting it. The type comes fromabstractionkitand is not re-exported from this package's root.- Quoting a signed UserOperation avoids paymaster calls. Sponsorship mode returns
fee: 0n; paymaster-token mode derives a native-gas ceiling in wei from its existing gas fields rather than returning the token amount established by the paymaster. - Sending a signed UserOperation broadcasts its supplied nonce, authorization, gas fields, and signature unchanged, without rebuilding or signing it.
- Owned account paymaster-token quotes are cached for up to 2 minutes for the same serialized transaction. Before reusing a cached UserOperation, the account reads the current EntryPoint nonce and re-quotes if it has moved.
- The cache key contains the transaction but not the per-call fee-mode configuration. Use the same fee-mode and paymaster settings for a quote and its matching
sendTransaction()ortransfer()call. - Unsigned transaction inputs are built and signed before submission. A
UserOperationV8input is broadcast with its supplied signature unchanged. - If the account is already delegated to
delegationAddress, the send path does not include a new EIP-7702 authorization. A send that needs a fresh authorization rebuilds the UserOperation instead of reusing the cached one.
Nonce Lane Behavior
- The default EntryPoint lane uses key
0.nonceKeytakes precedence overparallel, and different keys have no ordering relationship. - A string
nonceKeyis hashed to a deterministic 192-bit key. Numeric keys must be within the uint192 range; use bigint or string form above JavaScript's safe integer range. - Let the first delegation reach the chain before using concurrent lanes. Overlapping operations on the same lane can return hashes even when one can never receive a receipt.
- A fresh
parallellane creates a permanent EntryPoint nonce slot. Reuse a bounded set of named lanes for sustained workloads. - The runtime accepts lane fields in per-call overrides for signing, sending, and transfers, but the beta.3 second-argument declarations omit them. Constructor-level lane fields are correctly typed.
Transfer Fee Cap
transfer() checks transferMaxFee only in paymaster-token mode. It throws when the estimated fee is greater than or equal to the configured cap.
USDT Approval Rule
On Ethereum mainnet, approve() checks the USDT allowance rule. If the current allowance is non-zero and the requested amount is non-zero, the method throws before sending. Send an approval with amount 0 first, then send the new non-zero approval.
WalletAccountReadOnlyEvm7702Gasless
Named export for read-only accounts.
import { WalletAccountReadOnlyEvm7702Gasless } from '@tetherto/wdk-wallet-evm-7702-gasless'Constructor
new WalletAccountReadOnlyEvm7702Gasless(address, config)| Parameter | Type | Description |
|---|---|---|
address | string | EOA address. |
config | Omit\<Evm7702GaslessWalletConfig, 'transferMaxFee'\> | Read-only configuration. |
Methods
| Method | Parameters | Returns | Notes |
|---|---|---|---|
getAddress() | - | Promise\<string\> | Returns the configured address. |
getBalance() | - | Promise\<bigint\> | Native token balance in wei. |
getTokenBalance(tokenAddress) | tokenAddress: string | Promise\<bigint\> | ERC-20 balance in base units. |
getTokenBalances(tokenAddresses) | tokenAddresses: string[] | Promise\<Record\<string, bigint\>\> | Multiple ERC-20 balances. |
getPaymasterTokenBalance() | - | Promise\<bigint\> | Reads the configured paymaster token balance. |
quoteSendTransaction(tx, config?) | EvmTransaction | EvmTransaction[], partial fee-mode config | Promise\<Omit\<TransactionResult, 'hash'\>\> | Quotes without signing or sending. |
quoteTransfer(options, config?) | EvmTransferOptions, partial fee-mode config | Promise\<Omit\<TransferResult, 'hash'\>\> | Quotes an ERC-20 transfer. |
getAllowance(token, spender) | token: string, spender: string | Promise\<bigint\> | Reads ERC-20 allowance. |
getUserOperationReceipt(hash) | hash: string | Promise\<UserOperationReceipt | null\> | Reads the raw bundler receipt. |
getTransactionReceipt(hash) | hash: string | Promise\<EvmTransactionReceipt | null\> | Returns null until the UserOperation maps to an EVM transaction. |
verify(message, signature) | message: string, signature: string | Promise\<boolean\> | Verifies a plain message signature. |
verifyTypedData(typedData, signature) | TypedData, signature: string | Promise\<boolean\> | Verifies EIP-712 typed data. |
Read-only accounts cannot sign, approve, send, or transfer.
ConfigurationError
import { ConfigurationError } from '@tetherto/wdk-wallet-evm-7702-gasless'ConfigurationError extends Error and is thrown when wallet configuration is invalid.
Known configuration errors include:
- missing
provider; - missing
bundlerUrl; - missing
delegationAddress; - missing
paymasterTokenwhenisSponsoredis absent orfalse; - empty provider array;
- configured
paymasterAddressdoes not match the paymaster returned by the RPC.
Config Types
Evm7702GaslessWalletCommonConfig
| Field | Type | Required | Description |
|---|---|---|---|
provider | string | Eip1193Provider | Array\<string | Eip1193Provider\> | Yes | RPC endpoint, EIP-1193 provider, or provider failover list. |
retries | number | No | Additional retry attempts for provider arrays. Defaults to 3. |
bundlerUrl | string | Yes | ERC-4337 bundler endpoint. |
paymasterUrl | string | No | Paymaster endpoint when different from bundlerUrl. |
delegationAddress | string | Yes | Smart-account implementation address used for EIP-7702 delegation. |
parallel | boolean | No | Uses a fresh random nonce lane for each sign, send, or transfer operation unless nonceKey is set. |
nonceKey | number | bigint | string | No | Uses a reusable explicit uint192 nonce lane; strings are hashed deterministically. |
Evm7702GaslessSponsorshipPolicyConfig
| Field | Type | Required | Description |
|---|---|---|---|
isSponsored | true | Yes | Enables sponsored fee mode. |
sponsorshipPolicyId | string | No | Paymaster sponsorship policy ID. |
Evm7702GaslessPaymasterTokenConfig
| Field | Type | Required | Description |
|---|---|---|---|
isSponsored | false | No | Omit or set to false for paymaster-token mode. |
paymasterAddress | string | No | Expected paymaster contract address. |
paymasterToken.address | string | Yes | ERC-20 token used for fee payment. |
transferMaxFee | number | bigint | No | Maximum fee for transfer() in token base units. |
Evm7702GaslessWalletConfig
type Evm7702GaslessWalletConfig =
Evm7702GaslessWalletCommonConfig &
(Evm7702GaslessSponsorshipPolicyConfig | Evm7702GaslessPaymasterTokenConfig)Exported Types
The package also re-exports EVM wallet types from @tetherto/wdk-wallet-evm, including FeeRates, KeyPair, EvmTransaction, TransactionResult, EvmTransferOptions, TransferResult, EvmTransactionReceipt, ApproveOptions, TypedData, TypedDataDomain, and TypedDataField.
Module-specific exported types include UserOperationReceipt, Eip7702AuthorizationOverride, BuildSponsoredUserOperationOverrides, and SponsoredUserOperation. In beta.3, BuildSponsoredUserOperationOverrides adds optional nonce?: bigint for explicitly selecting the EntryPoint nonce in lower-level builder typing; it does not expose the protected builder as a public method.