> For the complete documentation index, see [llms.txt](https://docs.sns.id/dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sns.id/dev/sns-sdk/get-all-domains-of-wallet.md).

# Get all domains of wallet

Use the methods below to get all the domain names owned by a specific wallet address.

{% tabs %}
{% tab title="web3.js v1" %}

```typescript
import { getAllDomains } from "@bonfida/spl-name-service";

const domains = await getAllDomains(connection, user);
```

{% endtab %}

{% tab title="web3.js v2 (@solana/kit)" %}

<pre class="language-typescript"><code class="lang-typescript"><strong>import { getDomainsForAddress } from "@solana-name-service/sns-sdk-kit";
</strong>
const domainsForAddress = await getDomainsForAddress({ rpc, address, });
</code></pre>

{% endtab %}
{% endtabs %}

The web3.js v1 version of the function above will return an array of public keys. Use the toBase58() method to convert the public keys into base 58 encoded strings. The web3.js v2 solana/kit version of the method returns an array of objects containing both the domain address as well as the domains in human readable string format.&#x20;

Another option to retrieve public keys, as well as their corresponding domain names in a  human readable string format is to use the function below which returns an array of objects including public keys, and their corresponding domain name strings.

```typescript
import { getDomainKeysWithReverses } from "@bonfida/spl-name-service";

const domainsWithReverses = await getDomainKeysWithReverses(connection, user);
```

If you prefer to use a call to \`getProgramAccounts\`, you'll want to use the filters below.

```typescript
const filters = [
  {
    memcmp: {
      offset: 32,
      bytes: user.toBase58(),
    },
  },
  {
    memcmp: {
      offset: 0,
      bytes: ROOT_DOMAIN_ACCOUNT.toBase58(),
    },
  },
];
```
