JavaScript SDK API Reference / Utilities
Utilities
Low-level name-account, reverse-lookup, and TLD utilities.
Type Aliases
| Type Alias | Description |
|---|---|
| SupportedTld | A top-level-domain suffix supported by SNS utilities. |
Variables
| Variable | Description |
|---|---|
| SNS_TLD | The SNS top-level-domain suffix. |
| SOL_TLD | The Solana Name Service top-level-domain suffix. |
| SUPPORTED_TLDS | TLD suffixes accepted by the current SDK configuration. |
Functions
| Function | Description |
|---|---|
| check | Throws error unless bool is true, preserving its concrete SNS error type. |
| deserializeReverse | Decodes an SNS reverse-lookup account payload into a domain name. |
| getArtistPubkey | Returns the public key associated with a custom background. |
| getCustomBgKeys | Derives the name account keys for a custom background. |
| getHashedNameSync | Hashes a name using the SNS name-service seed derivation. |
| getNameAccountKeySync | Derives a synchronous SPL Name Service account PDA from hashed name inputs. |
| getPythFeedAccountKey | Derives a Pyth push-oracle price-feed account address from its shard and feed ID. |
| getReverseKeyFromDomainKey | Derives the reverse lookup account for a domain account. |
| getReverseKeySync | Derives the reverse lookup account for a domain name. |
| getTld | Returns the matching TLD from supportedTlds if domain ends with one, or undefined otherwise. |
| parseSnsTld | Validates that domain ends with .sns, strips that suffix, and returns a [trimmedDomain, SNS_TLD] tuple. |
| parseSupportedTld | Validates that domain ends with one of the supportedTlds, strips that suffix, and returns a [trimmedDomain, tld] tuple. |
References
reverseLookup
Re-exports reverseLookup
reverseLookupBatch
Re-exports reverseLookupBatch