> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Using EVM Wallets

<Card title="Recommended: JavaScript SDK with React Hooks" icon="react" color="#4779FE">
  For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](/javascript/reference/react-quickstart) to get started.
</Card>

## Check if a wallet is an Ethereum wallet

Before calling EVM-specific methods like `getWalletClient()`, you must narrow the wallet type with the `isEthereumWallet` guard. Without it, TypeScript won't expose EVM methods and the call will throw at runtime with no hint about what went wrong.

```tsx theme={"system"}
import { isEthereumWallet } from '@dynamic-labs/ethereum';

if (!isEthereumWallet(wallet)) {
  throw new Error('This wallet is not an Ethereum wallet');
}

// wallet is now typed as EthereumWallet — EVM methods are available
const walletClient = await wallet.getWalletClient();
```

<Tip>
  `isEthereumWallet` is exported from `@dynamic-labs/ethereum`. It checks `wallet.chain === 'EVM'` and narrows the type to `EthereumWallet`, which exposes `getWalletClient()`, `getPublicClient()`, and other EVM-specific methods.
</Tip>

### Read only actions/Viem Public Client

If you want to read data from the blockchain, you will want a ["Public Client"](https://viem.sh/docs/clients/public.html) (Viem terminology)

```jsx theme={"system"}
     import { useDynamicContext } from '@dynamic-labs/sdk-react-core';

    const { primaryWallet } = useDynamicContext();

    const getEnsName = async () => {
      const publicClient = await primaryWallet?.getPublicClient()

      // Now you can use the public client to read data from the blockchain
      const ens = await publicClient?.getEnsName({ address: primaryWallet.address })
      return ens
    }
```

### Write actions/Viem Wallet Client

If you want to write data to the blockchain, you will need a ["Wallet Client"](https://viem.sh/docs/clients/wallet.html) (Viem terminology), or a ["Signer"](https://docs.ethers.io/v5/api/signer/) (Ethers terminology). Both allow you to sign transactions with the private key.

```jsx theme={"system"}
    import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
    import { isEthereumWallet } from '@dynamic-labs/ethereum';
    const { primaryWallet } = useDynamicContext();

    const sendTransaction = async () => {
      if(!primaryWallet || !isEthereumWallet(primaryWallet)) {
        return;
      }

      const walletClient = await primaryWallet.getWalletClient();

      // Now you can use the wallet client to write data to the blockchain
      const tx = await walletClient?.sendTransaction({
        to: '0x1234567890abcdef',
        value: '1000000000000000000'
      });
      return tx
    }
```

## Send multiple transactions atomically

If you want to send multiple transactions atomically, you can use the `sendCalls` method. This requires the wallet to support EIP-5792.

```jsx theme={"system"}
    import { parseEther } from 'viem';
    import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
    import { isEthereumWallet } from '@dynamic-labs/ethereum';

    const { primaryWallet } = useDynamicContext();

    const sendTransactions = async () => {
      if(!primaryWallet || !isEthereumWallet(primaryWallet) || !primaryWallet.isAtomicSupported()) {
        return;
      }

      // Now you can use the wallet client to write data to the blockchain
      const { id } = await primaryWallet.sendCalls({
        calls: [
          {
            to: '0x1111111111111111111111111111111111111111',
            value: parseEther('0.001'),
          },
          {
            to: '0x2222222222222222222222222222222222222222',
            value: parseEther('0.001'),
          },
        ],
        version: '2.0.0',
      });

      return id
    }
```

## Examples

We've included a few examples of how to use the EVM wallet connector in this section:

* [Get balance for all connected wallets](/react/wallets/using-wallets/evm/get-balance-for-all-wallets)
* [Get balance for a single wallet](/react/wallets/using-wallets/evm/get-wallet-balance)
* [Send a transaction](/react/wallets/using-wallets/evm/send-a-transaction)
* [Send a transaction with Wagmi](/react/wallets/using-wallets/evm/send-a-transaction-wagmi)
* [Send balance using embedded wallet](/react/wallets/using-wallets/general/send-balance)
* [Sign a message](/react/wallets/using-wallets/evm/sign-a-message)
