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
- Errors.UnsupportedTldError when the name is bare, has an unsupported suffix, or uses
.solafter the SDK-managed pause. - Errors.DomainDoesNotExist when the domain account does not exist.
- Errors.PdaOwnerNotAllowed when the fallback registry owner is a PDA not allowed by
config.
Example
const target = await resolve(connection, "name.sns");
console.log(target.toBase58());
// => "<BASE58_PUBLIC_KEY>"