Skip to main content

Rust SDK API Reference

Rust SDK APIs are grouped by whether they are shared across client modes or use a non-blocking or blocking Solana RPC client.

The default crate features expose sns_sdk::non_blocking. Enabling blocking replaces that namespace with sns_sdk::blocking. Shared parsing, derivation, types, and instruction builders are available in either mode.

Shared APIs

API familyDescription
Name-registry instructionsCreate, update, transfer, and delete raw name accounts
Domain registrationBuild top-level .sns registration instructions
Record instructionsBuild V2 record content and verification instructions
DerivationSNS, SRS, record, and name-account key derivation
Tokenized domainsShared tokenized-domain result types
Primary domainsPrimary-domain account parsing, derivation, and instruction construction
Record types and keysRecord enums, versions, classes, and account-key derivation
Record V1 codecsLegacy record serialization, deserialization, and signature checks
Record V2 codecsCurrent record decoding, content codecs, and verification
TLD parsingSupported read suffixes and canonical .sns write validation

Non-blocking APIs

These modules use solana_client::nonblocking::rpc_client::RpcClient and are available in the default build.

API familyDescription
Domain resolutionResolve full domains with ordinary or safe SRS/SNS target checks
Name registriesRead one or multiple SPL Name Service accounts
Reverse lookupReverse-resolve one or multiple name-account keys
Wallet domainsList top-level name-account keys owned by a wallet
Tokenized domainsRetrieve tokenized domains and NFT owners
Primary domainsRetrieve a wallet's primary name-account key
Record V1Read legacy record accounts
Record V2Read current record accounts
SubdomainsQuery subdomains; sub-registrar queries require the subdomain feature
Sub-registrarsRead sub-registrar state; requires the subdomain feature

Blocking APIs

These modules use solana_client::rpc_client::RpcClient and are available when the crate enables blocking.

API familyDescription
Domain resolutionResolve full domains with ordinary or safe SRS/SNS target checks
Name registriesRead one or multiple SPL Name Service accounts
Reverse lookupReverse-resolve one or multiple name-account keys
Wallet domainsList top-level name-account keys owned by a wallet
Tokenized domainsRetrieve tokenized domains and NFT owners
Primary domainsRetrieve a wallet's primary name-account key
Record V1Read legacy record accounts
Record V2Read current record accounts
SubdomainsQuery subdomains; sub-registrar queries require the subdomain feature
Sub-registrarsRead sub-registrar state; requires blocking and subdomain