# 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(),
    },
  },
];
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sns.id/dev/sns-sdk/get-all-domains-of-wallet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
