> ## 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.

# Getting the Wallet Account Given an Address and Chain

Most of the wallet-related functions require you to pass a wallet account object.
If you want to get a wallet account object from an address, you can use the `getWalletAccountFromAddress` function.

The WalletAccount object will be successfully returned, as long as there is a wallet account associated to the address in the wallet accounts list.

## Usage

<Tabs>
  <Tab title="JavaScript">
    ```javascript theme={"system"}
    import { getWalletAccountFromAddress } from '@dynamic-labs-sdk/client';

    const findWalletAccount = async () => {
      // Replace with the address and chain you want to find
      const walletAccount = await getWalletAccountFromAddress({ address: '0x1234567890abcdef1234567890abcdef12345678', chain: 'eip155' });
      console.log(walletAccount);
    }
    ```
  </Tab>

  <Tab title="React">
    `getWalletAccountFromAddress` is a synchronous lookup, so there's no dedicated hook. Read the reactive `useGetWalletAccounts` so the lookup re-runs whenever accounts change:

    ```tsx theme={"system"}
    import { getWalletAccountFromAddress } from '@dynamic-labs-sdk/client';
    import { useGetWalletAccounts } from '@dynamic-labs-sdk/react-hooks';
    import { useMemo } from 'react';

    function useWalletAccountFromAddress(address: string, chain: string) {
      const { data: walletAccounts = [] } = useGetWalletAccounts();

      return useMemo(
        () => (address ? getWalletAccountFromAddress({ address, chain }) : null),
        [address, chain, walletAccounts],
      );
    }
    ```
  </Tab>
</Tabs>

## Related functions

* [Getting Wallet Accounts](/javascript/reference/wallets/get-wallet-accounts)
* [Connecting and Verifying a Wallet](/javascript/reference/wallets/connect-and-verify-wallet)
* [Getting Available Wallets to Connect](/javascript/reference/wallets/get-available-wallets-to-connect)
