Skip to main content

JavaScript SDK API Reference / Domain / resolve

Function: resolve()

resolve(connection, domain, config?): Promise<PublicKey>

Defined in: resolve/index.ts:42

Resolves a full .sns or .sol domain name to its effective target public key.

.sns resolution applies SNS ownership precedence: an active tokenized-domain owner, then valid V2 and V1 SOL records, then the registry owner.

.sol currently falls back to SNS-backed resolution until finalized slot 452_825_395, then pauses automatically. SRS-backed .sol resolution will be restored in a future SDK update.

Parameters

connection

Connection

Solana RPC connection

domain

string

Full domain name with a supported .sns or .sol suffix

config?

ResolveConfig = ...

PDA allowance policy. Defaults to { allowPda: false }

Returns

Promise<PublicKey>

Effective target as a web3.js PublicKey

See

safeResolve for .sol resolution that verifies the SRS and corresponding SNS targets match when SRS-backed resolution is enabled.

Throws

Example

const target = await resolve(connection, "name.sns");
console.log(target.toBase58());
// => "<BASE58_PUBLIC_KEY>"