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

# Comparing Two Addresses on a Chain

The same address can appear in different forms, such as different letter casing on EVM. Comparing raw strings misses those cases. Use `isSameAddress` to compare two addresses on a chain after the SDK normalizes both.

`isSameAddress` takes an `IsSameAddressOptions` object with `chain`, `left`, and `right`, and returns a boolean.

## Usage

**JavaScript**

```javascript theme={"system"}
import { isSameAddress } from '@dynamic-labs-sdk/client';
import type { WalletAccount } from '@dynamic-labs-sdk/client';

// walletAccount comes from your wallet accounts list (see getWalletAccounts).
const isPayingWallet = (walletAccount: WalletAccount, address: string) =>
  isSameAddress({ chain: walletAccount.chain, left: walletAccount.address, right: address });
```

**React**

`isSameAddress` is a pure helper, so there's no dedicated hook. Call it wherever you compare addresses:

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

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

  return useMemo(
    () => walletAccounts.some((walletAccount) =>
      isSameAddress({ chain, left: walletAccount.address, right: address }),
    ),
    [address, chain, walletAccounts],
  );
}
```

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


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