Some EVM methods require you to pass a EVM WalletAccount object. If you want to check if a certain wallet account is a
EVM WalletAccount, you can use the isEvmWalletAccount helper method to avoid type errors.
Copy
Ask AI
import { isEvmWalletAccount } from '@dynamic-labs-sdk/evm';import { createWalletClientForWalletAccount } from '@dynamic-labs-sdk/evm/viem';const sendTransaction = async (walletAccount, transaction) => { if (!isEvmWalletAccount(walletAccount)) { throw new Error('This wallet account is not a EVM wallet account'); } const walletClient = await createWalletClientForWalletAccount({ walletAccount }); const result = await walletClient.sendTransaction(transaction); console.log('Transaction sent:', result); // ...}