Skip to main content

Rust SDK API Reference / Address derivation / get_srs_domain_key

Function: get_srs_domain_key()

pub fn get_srs_domain_key(domain: &str) -> SrsDomainKey

Defined in: derivation.rs:123

Derives the canonical SRS record PDA from the SRS hash prefix and a TLD-trimmed .sol name. It performs no validation or RPC request.

Parameters

ParameterTypeDescription
domain&strTLD-trimmed .sol label, such as example.

Returns

SrsDomainKey, containing the derived key and 32-byte hashed name.

Example

use sns_sdk::derivation::get_srs_domain_key;

let domain = get_srs_domain_key("example");
println!("{}", domain.key);