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

# EVM Wallets

There are methods in the Ethereum wallet specific to EVM which we list below, but in general all the methods you need are present on the generic Wallet [described here](/wallets/using-wallets/interacting-with-wallets).

## Check if a wallet is an Ethereum wallet

You can use the `isEthereumWallet` helper method to check if a wallet is a Ethereum wallet. That way, TypeScript will know which methods are available to you.

```ts
import { isEthereumWallet } from '@dynamic-labs/ethereum';

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

const client = await primaryWallet.getWalletClient();

```

## 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"](https://viem.sh/docs/clients/public.html) (Viem terminology), or a ["Provider"](https://docs.ethers.org/v5/getting-started/#getting-started--glossary) (Ethers terminology). Both allow you read only access to the blockchain.

<Tabs>
  <Tab title="Viem">
    ```jsx
    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
    }
    ```
  </Tab>

  <Tab title="Ethers">
    ```jsx
    import { getWeb3Provider } from '@dynamic-labs/ethers-v6';
    import { useDynamicContext } from '@dynamic-labs/sdk-react-core';

    const { primaryWallet } = useDynamicContext();

    const getBalance = async () => {
      const provider = await getWeb3Provider(primaryWallet);

      // Now you can use the provider to read data from the blockchain
      const balance = await provider?.getBalance(primaryWallet.address);
      return balance
    }
    ```
  </Tab>
</Tabs>

### Write actions

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.

<Tabs>
  <Tab title="Viem">
    ```jsx
    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
    }
    ```
  </Tab>

  <Tab title="Ethers">
    ```jsx
    import { getSigner } from '@dynamic-labs/ethers-v6';
    import { useDynamicContext } from '@dynamic-labs/sdk-react-core';

    const { primaryWallet } = useDynamicContext();

    const sendTransaction = async () => {
      const signer = await getSigner(primaryWallet);

      // Now you can use the signer to write data to the blockchain
      const tx = await signer?.sendTransaction({
        to: '0x1234567890abcdef',
        value: '1000000000000000000'
      });
      return tx
    }
    ```
  </Tab>
</Tabs>

## 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
    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](/wallets/using-wallets/evm/get-balance-for-all-wallets)
* [Get balance for a single wallet](/wallets/using-wallets/evm/get-wallet-balance)
* [Send a transaction](/wallets/using-wallets/evm/send-a-transaction)
* [Send a transaction with Wagmi](/wallets/using-wallets/evm/send-a-transaction-wagmi)
* [Send balance using embedded wallet](/wallets/using-wallets/evm/send-balance)
* [Sign a message](/wallets/using-wallets/evm/sign-a-message)
