> ## 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 with the address in the wallet accounts list.

## Usage

> [tab] 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: 'EVM' });
>   console.log(walletAccount);
> }
> ```

> [tab] 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 type { Chain } from '@dynamic-labs-sdk/client';
> import { useGetWalletAccounts } from '@dynamic-labs-sdk/react-hooks';
> import { useMemo } from 'react';
>
> function useWalletAccountFromAddress(address: string, chain: Chain) {
>   const { data: walletAccounts = [] } = useGetWalletAccounts();
>
>   return useMemo(
>     () => (address ? getWalletAccountFromAddress({ address, chain }) : null),
>     [address, chain, walletAccounts],
>   );
> }
> ```

## Related functions

* [Getting Wallet Accounts](https://docs.dynamic.xyz/docs/javascript/reference/wallets/get-wallet-accounts.md)
* [Comparing Two Addresses on a Chain](https://docs.dynamic.xyz/docs/javascript/reference/wallets/is-same-address.md)
* [Connecting and Verifying a Wallet](https://docs.dynamic.xyz/docs/javascript/reference/wallets/connect-and-verify-wallet.md)
* [Getting Available Wallets to Connect](https://docs.dynamic.xyz/docs/javascript/reference/wallets/get-available-wallets-to-connect.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.