Skip to main content

GET /primary-domain/:owner

Return a wallet's configured primary domain, reverse name, and ownership status.

Request

GET /primary-domain/:owner

Path parameters

owner

Required. The wallet's base58 public key.

Query parameters

rpc

Optional. A non-empty Solana RPC URL that overrides the proxy Worker's RPC_URL binding for this request.

Response

A successful request returns 200 OK:

type PrimaryDomainResponse = {
s: "ok";
result: {
domain: string;
reverse: string;
stale: boolean;
} | null;
};

domain is the primary domain's name-account public key. reverse is its TLD-less name. stale is true when owner no longer owns the configured domain. A wallet without a configured primary domain returns result: null.

Example

curl "https://sdk-proxy-v2.sns.id/primary-domain/<OWNER_PUBLIC_KEY>"
{
"s": "ok",
"result": {
"domain": "<DOMAIN_ACCOUNT_PUBLIC_KEY>",
"reverse": "name",
"stale": false
}
}

Errors

StatusresultWhen
400Invalid inputowner is not a valid Solana public key.
404Resource not foundA configured primary-domain account or referenced domain is absent.
502RPC unavailableThe selected RPC returns a JSON-RPC error.
500Internal errorNo RPC is configured, or another failure occurs.