Check if a wallet is an Ethereum wallet
You can use theisEthereumWallet helper method to check if a wallet is a Ethereum wallet. That way, TypeScript will know which methods are available to you.
Ethereum Wallet Methods
Read only actions
If you want to read data from the blockchain, you will want either a “Public Client” (Viem terminology), or a “Provider” (Ethers terminology). Both allow you read only access to the blockchain.- Viem
- Ethers
Write actions
If you want to write data to the blockchain, you will need a “Wallet Client” (Viem terminology), or a “Signer” (Ethers terminology). Both allow you to sign transactions with the private key.- Viem
- Ethers
Send multiple transactions atomically
If you want to send multiple transactions atomically, you can use thesendCalls method. This requires the wallet to support EIP-5792.