Skip to main content

Rust SDK API Reference / Tokenized domains / get_nft_records

Function: get_nft_records()

pub async fn get_nft_records(
rpc_client: &RpcClient,
owner: &Pubkey,
) -> Result<Vec<NftRecord>, SnsError>

Defined in: rust-crates/sns-sdk/src/non_blocking/nft.rs:44

Finds legacy SPL Token accounts owned by owner with amount one, then queries the Name Tokenizer program for each mint. Invalid token-account data, mints without a first matching record, and malformed records are omitted rather than returned as errors.

Parameters

ParameterTypeDescription
rpc_client&RpcClientNon-blocking Solana RPC client.
owner&PubkeyWallet owner whose one-token legacy SPL accounts are queried.

Returns

Result<Vec<NftRecord>, SnsError> containing successfully resolved NftRecord values. Result order follows the RPC token-account result order after omitted entries are removed.

Errors

  • SnsError::SolanaClient when the token-account query or a name-tokenizer query fails.

Example

use sns_sdk::non_blocking::nft::get_nft_records;

let records = get_nft_records(&client, &owner).await?;
for record in records {
println!("{} -> {}", record.name_account, record.nft_mint);
}