Rust SDK API Reference / Record V2 reads / get_multiple_records_v2
Function: get_multiple_records_v2()
pub fn get_multiple_records_v2(
rpc_client: &RpcClient,
domain: &str,
records: &[Record],
) -> Result<Vec<Option<(NameRecordHeader, Vec<u8>)>>, SnsError>
Defined in: rust-crates/sns-sdk/src/blocking/record_v2.rs:22
Validates and trims a full supported domain, derives one V2 address per requested record, and fetches those accounts in a batch. Results preserve records order.
Availability
Requires the blocking feature.
Parameters
| Parameter | Type | Description |
|---|---|---|
rpc_client | &solana_client::rpc_client::RpcClient | Blocking client used for batched record reads. |
domain | &str | Full supported .sns or .sol domain. |
records | &[Record] | SNS record kinds to fetch, in desired output order. |
Returns
Result<Vec<Option<(NameRecordHeader, Vec<u8>)>>, SnsError> with one header-and-payload result or None per requested record, in records order.
Errors
SnsError::UnsupportedTldfor a bare, unsupported, or unavailable.soldomain.SnsError::InvalidNameAccountDatawhen a present record account is malformed or has the wrong owner.SnsError::SolanaClientfor RPC failures.
Example
use sns_sdk::{blocking::record_v2::get_multiple_records_v2, record::Record};
use solana_client::rpc_client::RpcClient;
let client = RpcClient::new("https://your-rpc-endpoint.example".to_string());
let records = [Record::Url, Record::Email];
let values = get_multiple_records_v2(&client, "example.sns", &records)?;
println!("{} results", values.len());