JavaScript SDK API Reference / Domain / getSnsDomainKeySync
Function: getSnsDomainKeySync()
getSnsDomainKeySync(
domain,record?):SnsDomainKey
Defined in: utils/getSnsDomainKeySync.ts:59
Derives an SNS namespace account from a TLD-trimmed domain name.
The caller must trim the TLD suffix before calling this function. For
example, pass "example" instead of "example.sns", and pass
"sub.example" instead of "sub.example.sns".
Parameters
domain
string
Domain name with its TLD suffix trimmed
record?
Optional record version when deriving a record account
Returns
Derived account key, name hash, and parent/subdomain metadata
Throws
When the trimmed domain has unsupported nesting
Example
const { pubkey } = getSnsDomainKeySync("example");