This is a React-only guide.
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
Method | Description |
---|---|
getPublicClient(): Promise<PublicClient<Transport, Chain>> | Retrieves the public client. |
getWalletClient(chainId?: string): Promise<WalletClient<Transport, Chain, Account>> | Retrieves the wallet client. |
isAtomicSupported(chainId?: number): Promise<boolean> | If the wallet supports atomic actions (EIP-5792). |
isPaymasterServiceSupported(chainId?: number): Promise<boolean> | If the wallet supports paymaster services (EIP-5792). |
sendCalls(callParams: Omit<SendCallsParameters, ‘account’>, options?: { paymasterURL?: string }): Promise<SendCallsReturnType> | Sends multiple transactions atomically. Requires EIP-5792 support. |
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.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.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.