Rust SDK API Reference / Sub-registrars / get_sub_registrar_info
Function: get_sub_registrar_info()
pub fn get_sub_registrar_info(rpc_client: &RpcClient, domain: &str) -> Result<Registrar, SnsError>
Defined in: rust-crates/sns-sdk/src/blocking/subdomain.rs:66
Derives the SNS name account and its associated sub-registrar PDA, then reads and deserializes the registrar state.
Availability
Requires both the blocking and subdomain features.
Parameters
| Parameter | Type | Description |
|---|---|---|
rpc_client | &solana_client::rpc_client::RpcClient | Blocking client used to fetch registrar state. |
domain | &str | Full supported .sns or .sol domain. |
Returns
Result<Registrar, SnsError> containing the deserialized sub-registrar state.
Errors
SnsError::UnsupportedTldfor a bare, unsupported, or unavailable.soldomain.SnsError::InvalidSubRegistrarwhen the registrar account is absent, has the wrong owner or tag, or cannot be deserialized.SnsError::SolanaClientfor RPC failures.
Example
use sns_sdk::blocking::subdomain::get_sub_registrar_info;
use solana_client::rpc_client::RpcClient;
let client = RpcClient::new("https://your-rpc-endpoint.example".to_string());
let registrar = get_sub_registrar_info(&client, "example.sns")?;
println!("{}", registrar.authority);