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

# Getting a Wallet Account Address by Type

A single wallet account can expose multiple addresses, each with a different purpose. For example, a Bitcoin wallet may have a `payment` address and an `ordinals` address, or a Midnight wallet may have `midnight_unshielded` and `midnight_dust` addresses.

Use `getWalletAccountAddressByType` to pick the address that matches the type you need.

## Usage

> [tab] JavaScript
>
> ```javascript theme={"system"}
> import { getWalletAccountAddressByType } from '@dynamic-labs-sdk/client';
>
> const paymentAddress = getWalletAccountAddressByType({
>   walletAccount,
>   type: 'payment',
> });
>
> console.log('Payment address:', paymentAddress);
> ```

> [tab] React
>
> `getWalletAccountAddressByType` is a synchronous lookup, so there is no dedicated hook. Read the reactive `useGetWalletAccounts` and re-derive the address whenever accounts change:
>
> ```tsx theme={"system"}
> import { getWalletAccountAddressByType } from '@dynamic-labs-sdk/client';
> import { useGetWalletAccounts } from '@dynamic-labs-sdk/react-hooks';
> import { useMemo } from 'react';
>
> function PaymentAddress() {
>   const { data: walletAccounts = [] } = useGetWalletAccounts();
>
>   const address = useMemo(() => {
>     const walletAccount = walletAccounts[0];
>     if (!walletAccount) return null;
>
>     return getWalletAccountAddressByType({ walletAccount, type: 'payment' });
>   }, [walletAccounts]);
>
>   return <p>Payment address: {address ?? 'N/A'}</p>;
> }
> ```

## Parameters

| Parameter | Type | Description |
| - | - | - |
| `walletAccount` | `WalletAccount` | The wallet account to read the address from. |
| `type` | `WalletAddressType` | The address type to look for. |

## Common address types

| Type | Description |
| - | - |
| `payment` | Default spend/receive address. |
| `ordinals` | Bitcoin ordinals / inscriptions address. |
| `evm` | EVM-specific address entry. |
| `stellar` | Stellar-specific address entry. |
| `ton` | TON-specific address entry. |
| `cosmos` | Cosmos-specific address entry. |
| `midnight_unshielded` | Midnight unshielded address. |
| `midnight_dust` | Midnight dust address. |
| `midnight_shielded` | Midnight shielded address. |

## Returns

The matching address as a `string`, or `undefined` if the wallet account does not have an address of the requested type.

## Related functions

* [Getting Wallet Accounts](https://www.dynamic.xyz/docs/javascript/reference/wallets/get-wallet-accounts.md)
* [Getting the Wallet Account Given an Address and Chain](https://www.dynamic.xyz/docs/javascript/reference/wallets/get-wallet-account-from-address.md)
* [Checking Wallet Account Availability](https://www.dynamic.xyz/docs/javascript/reference/wallets/check-wallet-account-availability.md)


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