WalletAccountEvm
Defined in: wallet-evm/src/account.ts:87
An EVM account with a signer: signs messages, typed data, permits and transactions, and sends transfers and approvals. Before signing it checks the chain id and simulates the transaction (when a provider is configured), and refuses value sent to the zero address.
Extends
Section titled “Extends”Implements
Section titled “Implements”IWalletAccount
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WalletAccountEvm(
signer,publicKey,path,config?):WalletAccountEvm
Defined in: wallet-evm/src/account.ts:118
publicKey is the signer’s compressed secp256k1 key (33 bytes); it is needed synchronously for the address.
Parameters
Section titled “Parameters”signer
Section titled “signer”Signer
publicKey
Section titled “publicKey”Uint8Array
string
config?
Section titled “config?”EvmConfig = {}
Returns
Section titled “Returns”WalletAccountEvm
Overrides
Section titled “Overrides”WalletAccountReadOnlyEvm.constructor
Properties
Section titled “Properties”_client
Section titled “_client”
protectedreadonly_client: { } |undefined
Defined in: wallet-evm/src/read-only-account.ts:129
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm._client
_config
Section titled “_config”
protectedreadonly_config:EvmConfig
Defined in: wallet-evm/src/read-only-account.ts:128
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm._config
address
Section titled “address”
readonlyaddress:`0x${string}`
Defined in: wallet-evm/src/read-only-account.ts:127
Checksummed address.
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.address
needsNetwork
Section titled “needsNetwork”
readonlyneedsNetwork:false=false
Defined in: wallet-evm/src/account.ts:88
True when signTransaction itself needs the network (TON seqno, Solana
blockhash, BTC UTXOs, Tron ref block). EVM signs offline.
Implementation of
Section titled “Implementation of”IWalletAccount.needsNetwork
readonlypath:string
Defined in: wallet-evm/src/account.ts:90
Derivation path, or external for an external signer.
publicKey
Section titled “publicKey”
readonlypublicKey:Uint8Array
Defined in: wallet-evm/src/account.ts:92
Compressed secp256k1 public key (33 bytes).
signerKind
Section titled “signerKind”
readonlysignerKind:"external"|"key"|"seed"
Defined in: wallet-evm/src/account.ts:100
What holds the key: seed, key (one imported key) or external.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get chain():
string
Defined in: wallet-evm/src/read-only-account.ts:140
CAIP-2 id; “eip155:unknown” until the chain id is known (offline wallet without chainId).
Returns
Section titled “Returns”string
Implementation of
Section titled “Implementation of”IWalletAccount.chain
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.chain
Get Signature
Section titled “Get Signature”get index():
number|undefined
Defined in: wallet-evm/src/account.ts:132
Account index when the path is the standard m/44’/60’/0’/0/i, else undefined.
Returns
Section titled “Returns”number | undefined
Methods
Section titled “Methods”approve()
Section titled “approve()”approve(
options,writeOptions?):Promise<TransferResult>
Defined in: wallet-evm/src/account.ts:474
ERC-20 approve. Mainnet USDT non-zero → non-zero is refused or auto-reset (autoResetAllowance).
writeOptions.maxFee (and transactionMaxFee) holds for each transaction signed, the reset too.
Parameters
Section titled “Parameters”options
Section titled “options”writeOptions?
Section titled “writeOptions?”WriteOptions = {}
Returns
Section titled “Returns”Promise<TransferResult>
callParams()
Section titled “callParams()”
protectedcallParams(tx):object
Defined in: wallet-evm/src/read-only-account.ts:243
Calldata/value/to in the shape viem’s call / estimateGas take — with an EIP-7702
transaction’s authorizations, so the dry run executes the delegate’s code, not the account’s.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”object
account
Section titled “account”account:
`0x${string}`
authorizationList?
Section titled “authorizationList?”
optionalauthorizationList?:undefined
optionaldata?:`0x${string}`
optionalto?:`0x${string}`
value?
Section titled “value?”
optionalvalue?:bigint
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.callParams
dispose()
Section titled “dispose()”dispose():
void
Defined in: wallet-evm/src/account.ts:519
Dispose the signer (zeroizes a local key). Idempotent.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IWalletAccount.dispose
feeFields()
Section titled “feeFields()”
protectedfeeFields(tx,chainId):Promise<FeeFields>
Defined in: wallet-evm/src/read-only-account.ts:265
The fee fields a send signs: the transaction’s own where it sets them, the network’s for the rest. One function for the quote and the signature, so a cap checked on the quote holds for what is signed.
Parameters
Section titled “Parameters”chainId
Section titled “chainId”number
Returns
Section titled “Returns”Promise<FeeFields>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.feeFields
gasFor()
Section titled “gasFor()”
protectedgasFor(tx):Promise<bigint>
Defined in: wallet-evm/src/read-only-account.ts:255
Gas limit: the tx’s own, else one estimate.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<bigint>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.gasFor
getAddress()
Section titled “getAddress()”getAddress():
Promise<string>
Defined in: wallet-evm/src/read-only-account.ts:151
The checksummed address.
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.getAddress
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.getAddress
getAllowance()
Section titled “getAllowance()”getAllowance(
token,spender):Promise<bigint>
Defined in: wallet-evm/src/read-only-account.ts:181
ERC-20 allowance(owner, spender) in base units.
Parameters
Section titled “Parameters”string
spender
Section titled “spender”string
Returns
Section titled “Returns”Promise<bigint>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.getAllowance
getBalance()
Section titled “getBalance()”getBalance():
Promise<bigint>
Defined in: wallet-evm/src/read-only-account.ts:162
Native balance in wei.
Returns
Section titled “Returns”Promise<bigint>
Implementation of
Section titled “Implementation of”IWalletAccount.getBalance
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.getBalance
getChainId()
Section titled “getChainId()”getChainId():
Promise<number>
Defined in: wallet-evm/src/read-only-account.ts:156
Chain id from the config, or asked from the RPC once and cached.
Returns
Section titled “Returns”Promise<number>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.getChainId
getFeeRate()
Section titled “getFeeRate()”getFeeRate():
Promise<bigint>
Defined in: wallet-evm/src/read-only-account.ts:230
Current fee rate: maxFeePerGas, falling back to gasPrice.
Returns
Section titled “Returns”Promise<bigint>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.getFeeRate
getPermitInfo()
Section titled “getPermitInfo()”getPermitInfo(
token):Promise<PermitInfo>
Defined in: wallet-evm/src/account.ts:419
Does token implement EIP-2612 permit, and with which domain? Supported
only when the domain separator we rebuild from name/version/chainId/
verifyingContract equals the contract’s own — so a signature we produce
is one the contract will accept. DAI’s legacy permit(holder, spender, nonce, expiry, allowed) is NOT recognised.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<PermitInfo>
getTokenBalance()
Section titled “getTokenBalance()”getTokenBalance(
token):Promise<bigint>
Defined in: wallet-evm/src/read-only-account.ts:167
ERC-20 balanceOf in the token’s base units.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<bigint>
Implementation of
Section titled “Implementation of”IWalletAccount.getTokenBalance
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.getTokenBalance
getTokenBalances()
Section titled “getTokenBalances()”getTokenBalances(
tokens):Promise<Record<string,bigint>>
Defined in: wallet-evm/src/read-only-account.ts:174
Several ERC-20 balances in parallel, keyed by the token addresses as given.
Parameters
Section titled “Parameters”tokens
Section titled “tokens”string[]
Returns
Section titled “Returns”Promise<Record<string, bigint>>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.getTokenBalances
getTokenInfo()
Section titled “getTokenInfo()”getTokenInfo(
token):Promise<TokenInfo>
Defined in: wallet-evm/src/read-only-account.ts:193
An ERC-20’s decimals, symbol, name and total supply, read from the contract, and upgradeable
when it sits behind an EIP-1967 / EIP-1822 / beacon / ZeppelinOS proxy. bytes32 symbols (MKR
style) are decoded. Throws NotATokenError when there is no contract at the address or it
has no decimals() (an NFT, a wallet, a plain contract).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<TokenInfo>
Implementation of
Section titled “Implementation of”IWalletAccount.getTokenInfo
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.getTokenInfo
getTransactionByHash()
Section titled “getTransactionByHash()”getTransactionByHash(
hash):Promise<{ } | { } | { } | { } | { }>
Defined in: wallet-evm/src/read-only-account.ts:359
The transaction as the RPC returns it (viem shape).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<{ } | { } | { } | { } | { }>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.getTransactionByHash
getTransactionReceipt()
Section titled “getTransactionReceipt()”getTransactionReceipt(
hash):Promise<EvmReceipt|undefined>
Defined in: wallet-evm/src/read-only-account.ts:344
The receipt, or undefined while the transaction is not mined.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<EvmReceipt | undefined>
Implementation of
Section titled “Implementation of”IWalletAccount.getTransactionReceipt
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.getTransactionReceipt
quoteSendTransaction()
Section titled “quoteSendTransaction()”quoteSendTransaction(
tx):Promise<{fee:bigint; }>
Defined in: wallet-evm/src/read-only-account.ts:293
Upper-bound fee in wei: gas × fee cap, with the cap the transaction would be signed with —
its own gasPrice / maxFeePerGas when it sets one, else the network’s (gasPrice on chains
without EIP-1559).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<{ fee: bigint; }>
Implementation of
Section titled “Implementation of”IWalletAccount.quoteSendTransaction
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.quoteSendTransaction
quoteTransfer()
Section titled “quoteTransfer()”quoteTransfer(
options):Promise<{fee:bigint; }>
Defined in: wallet-evm/src/read-only-account.ts:339
Network fee of a transfer, in wei.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<{ fee: bigint; }>
Implementation of
Section titled “Implementation of”IWalletAccount.quoteTransfer
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.quoteTransfer
requireClient()
Section titled “requireClient()”
protectedrequireClient(what):object
Defined in: wallet-evm/src/read-only-account.ts:145
The RPC client, or a NetworkError naming the action when the wallet is offline.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”object
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.requireClient
sendTransaction()
Section titled “sendTransaction()”sendTransaction(
tx,options?):Promise<TransferResult>
Defined in: wallet-evm/src/account.ts:402
Sign and broadcast; options.maxFee caps the signed fee on top of transactionMaxFee.
Parameters
Section titled “Parameters”options?
Section titled “options?”WriteOptions = {}
Returns
Section titled “Returns”Promise<TransferResult>
Implementation of
Section titled “Implementation of”IWalletAccount.sendTransaction
sign()
Section titled “sign()”sign(
message):Promise<string>
Defined in: wallet-evm/src/account.ts:151
EIP-191 personal_sign; returns 65-byte hex with v ∈ {27, 28} (ethers encoding).
Parameters
Section titled “Parameters”message
Section titled “message”string | Uint8Array<ArrayBufferLike>
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.sign
signPermit()
Section titled “signPermit()”signPermit(
options):Promise<SignedPermit>
Defined in: wallet-evm/src/account.ts:448
Sign an EIP-2612 permit for spender. Nothing is broadcast; the spender submits it.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<SignedPermit>
signTransaction()
Section titled “signTransaction()”signTransaction(
tx,options?):Promise<string>
Defined in: wallet-evm/src/account.ts:284
Sign WITHOUT broadcasting. Fully-specified EIP-1559 / legacy txs sign
offline; the chain and zero-address refusals still apply. Simulation is
NOT run here (nothing is sent) — sendTransaction runs it.
Parameters
Section titled “Parameters”options?
Section titled “options?”WriteOptions = {}
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.signTransaction
signTypedData()
Section titled “signTypedData()”signTypedData(
typed):Promise<string>
Defined in: wallet-evm/src/account.ts:193
EIP-712. Accepts {domain, types, message}; primaryType is inferred when absent.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<string>
simulateTransaction()
Section titled “simulateTransaction()”simulateTransaction(
tx):Promise<SimulationResult>
Defined in: wallet-evm/src/read-only-account.ts:316
Dry-run the transaction from this account (eth_call + gas estimate).
A revert comes back as {ok: false, reason} with the decoded Error(string),
Panic(uint256) or custom-error selector; only transport failures throw.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<SimulationResult>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.simulateTransaction
toReadOnlyAccount()
Section titled “toReadOnlyAccount()”toReadOnlyAccount():
IWalletAccountReadOnly
Defined in: wallet-evm/src/account.ts:513
The same address as a WalletAccountReadOnlyEvm.
Returns
Section titled “Returns”IWalletAccountReadOnly
Implementation of
Section titled “Implementation of”IWalletAccount.toReadOnlyAccount
transfer()
Section titled “transfer()”transfer(
options,writeOptions?):Promise<TransferResult>
Defined in: wallet-evm/src/account.ts:406
Native or token transfer; the account builds the transaction.
Parameters
Section titled “Parameters”options
Section titled “options”writeOptions?
Section titled “writeOptions?”WriteOptions = {}
Returns
Section titled “Returns”Promise<TransferResult>
Implementation of
Section titled “Implementation of”IWalletAccount.transfer
verify()
Section titled “verify()”verify(
message,signature):Promise<boolean>
Defined in: wallet-evm/src/read-only-account.ts:364
True when signature is this address’s EIP-191 signature of message.
Parameters
Section titled “Parameters”message
Section titled “message”string | Uint8Array<ArrayBufferLike>
signature
Section titled “signature”string
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”IWalletAccount.verify
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.verify
verifyTypedData()
Section titled “verifyTypedData()”verifyTypedData(
typed,signature):Promise<boolean>
Defined in: wallet-evm/src/read-only-account.ts:373
True when signature is this address’s EIP-712 signature of typed.
Parameters
Section titled “Parameters”signature
Section titled “signature”string
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyEvm.verifyTypedData
fromPrivateKey()
Section titled “fromPrivateKey()”
staticfromPrivateKey(privateKey,publicKey,path,config?):WalletAccountEvm
Defined in: wallet-evm/src/account.ts:127
Back-compat: wrap a raw derived key in a LocalSigner (the account takes ownership; it cannot derive).
Parameters
Section titled “Parameters”privateKey
Section titled “privateKey”Uint8Array
publicKey
Section titled “publicKey”Uint8Array
string
config?
Section titled “config?”EvmConfig = {}
Returns
Section titled “Returns”WalletAccountEvm