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

# Resolve Solana .sol Domains with SNS RPC Methods

> Resolve primary .sol domains, look up wallet names in batches, list owned domains, and find domain owners with Solana Tracker RPC.

Use the SNS RPC methods to turn wallet addresses into `.sol` display names or resolve a domain to its owner. Batch primary-domain lookups when rendering a holder list or leaderboard.

> [!NOTE]
>
> Each SNS RPC method costs **1 credit** per call. Twitter/X handles (`.twitter`) are not supported.

| Goal | Method |
| - | - |
| Get one wallet's primary `.sol` domain | [`getPrimaryDomain`](https://docs.solanatracker.io/solana-rpc/http/getprimarydomain) |
| Resolve primary domains for many wallets | [`getMultiplePrimaryDomains`](https://docs.solanatracker.io/solana-rpc/http/getmultipleprimarydomains) |
| List all `.sol` domains owned by a wallet | [`getAllDomains`](https://docs.solanatracker.io/solana-rpc/http/getalldomains) |
| Resolve `name.sol` to an owner wallet | [`resolveSolDomain`](https://docs.solanatracker.io/solana-rpc/http/resolvesoldomain) |

## RPC endpoint

All examples use JSON-RPC 2.0 over HTTP:

```bash theme={null}
https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY
```

## Get a wallet's primary domain

Use `getPrimaryDomain` for the wallet's primary `.sol` display name.

```bash cURL theme={null}
curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getPrimaryDomain",
    "params": ["9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p"]
  }'
```

```javascript JavaScript theme={null}
const rpcUrl = "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY";

const { result } = await fetch(rpcUrl, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getPrimaryDomain",
    params: ["9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p"]
  })
}).then(r => r.json());

const label = result.value.domain ?? result.value.wallet;
console.log(label);
```

```python Python theme={null}
import requests

res = requests.post(
    "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY",
    json={
        "jsonrpc": "2.0",
        "id": 1,
        "method": "getPrimaryDomain",
        "params": ["9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p"]
    }
)

result = res.json()["result"]["value"]
print(result["domain"] or result["wallet"])
```

When a domain exists:

```json theme={null}
{
  "context": { "slot": 423867852, "apiVersion": "3.0.0" },
  "value": {
    "wallet": "9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p",
    "domain": "solanatracker.sol"
  }
}
```

When no primary domain exists, `domain` is `null`:

```json theme={null}
{
  "context": { "slot": 423867852, "apiVersion": "3.0.0" },
  "value": {
    "wallet": "FMmaHPDL47V1gXsfh9WjgAT7Er3dfDvarQubTU1Jxc1r",
    "domain": null
  }
}
```

> [!TIP]
>
> In UI, use the domain as the label when present, and fall back to a shortened wallet address when `domain` is `null`.

## Batch primary domains

Use `getMultiplePrimaryDomains` for a list of wallets:

The method accepts up to **100 wallets** and returns results in the same order as the input list.

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getMultiplePrimaryDomains",
  "params": [
    [
      "9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p",
      "FMmaHPDL47V1gXsfh9WjgAT7Er3dfDvarQubTU1Jxc1r"
    ]
  ]
}
```

Example response:

```json theme={null}
{
  "context": { "slot": 423867852, "apiVersion": "3.0.0" },
  "value": {
    "results": [
      {
        "wallet": "9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p",
        "domain": "solanatracker.sol"
      },
      {
        "wallet": "FMmaHPDL47V1gXsfh9WjgAT7Er3dfDvarQubTU1Jxc1r",
        "domain": null
      }
    ]
  }
}
```

Because the response preserves input order, you can merge it back into a wallet list by array index:

```javascript theme={null}
const wallets = [
  "9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p",
  "FMmaHPDL47V1gXsfh9WjgAT7Er3dfDvarQubTU1Jxc1r"
];

const { result } = await fetch(rpcUrl, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getMultiplePrimaryDomains",
    params: [wallets]
  })
}).then(r => r.json());

const rows = wallets.map((wallet, i) => ({
  wallet,
  displayName: result.value.results[i].domain ?? `${wallet.slice(0, 4)}...${wallet.slice(-4)}`
}));
```

## Get all domains owned by a wallet

Use `getAllDomains` to list the `.sol` domains owned by a wallet.

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAllDomains",
  "params": ["9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p"]
}
```

Response:

```json theme={null}
{
  "context": { "slot": 423867852, "apiVersion": "3.0.0" },
  "value": {
    "wallet": "9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p",
    "domains": ["solanatracker.sol", "othername.sol"]
  }
}
```

If the wallet has no domains, `domains` is an empty array.

## Resolve a domain to an owner

Use `resolveSolDomain` to resolve a `.sol` name to its owner wallet.

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "resolveSolDomain",
  "params": ["solanatracker.sol"]
}
```

Response:

```json theme={null}
{
  "context": { "slot": 423867852, "apiVersion": "3.0.0" },
  "value": {
    "domain": "solanatracker.sol",
    "owner": "9aoUCn5J4sxhvYERCVwVnakPQxyXTHQVXe86CUJYxY8p",
    "nameAccount": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
  }
}
```

If the domain is not found, `value` is `null`.

`resolveSolDomain` supports root `.sol` domains like `name.sol` and one-level subdomains like `sub.parent.sol`.

## Example: wallet identity helper

This helper uses primary domains for display and keeps the wallet address available for linking, copying, or transaction actions.

```javascript theme={null}
function shortWallet(wallet) {
  return `${wallet.slice(0, 4)}...${wallet.slice(-4)}`;
}

async function getWalletIdentity(wallet) {
  const { result } = await fetch(
    "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY",
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        jsonrpc: "2.0",
        id: 1,
        method: "getPrimaryDomain",
        params: [wallet]
      })
    }
  ).then(r => r.json());

  return {
    wallet,
    label: result.value.domain ?? shortWallet(wallet),
    domain: result.value.domain
  };
}
```

## Choosing the right SNS method

| Situation | Recommendation |
| - | - |
| Single wallet profile header | `getPrimaryDomain` |
| Leaderboard or holder table | `getMultiplePrimaryDomains` |
| Domain portfolio page | `getAllDomains` |
| Search input accepts `.sol` names | `resolveSolDomain` |
| PnL V2 response already includes `identity.sns` | Use the included PnL V2 identity field |

> [!NOTE]
>
> PnL V2 already includes SNS identity in supported wallet and token analytics responses. Use these RPC methods when you need SNS resolution directly from the Solana RPC surface.

## UI and product tips

* Always keep the wallet address available, even when showing a domain.
* Treat `domain: null` as a normal result, not an error.
* Use batch resolution for tables and feeds instead of calling `getPrimaryDomain` in a loop.
* Show `.sol` names as labels, but copy and link the underlying wallet address.
* For user search, resolve `.sol` names first, then continue with the returned owner wallet.

> [card] [getMultiplePrimaryDomains](https://docs.solanatracker.io/solana-rpc/http/getmultipleprimarydomains.md)
>
> Batch primary `.sol` domains for up to 100 wallets.

> [card] [SNS wallet names](https://docs.solanatracker.io/guides/pnl-v2/sns-identity.md)
>
> See where SNS identity appears in PnL V2 responses.


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