Rust SDK API Reference / Name-registry instructions / transfer_name_ownership
Function: transfer_name_ownership()
pub fn transfer_name_ownership(name_account: Pubkey, new_owner: Pubkey, current_owner: Pubkey, name_class: Option<Pubkey>) -> Result<Instruction, SnsError>
Defined in: name_registry.rs:64
Builds a transfer instruction for a name account. The current owner must authorize the submitted transaction.
Parameters
name_account is transferred from current_owner to new_owner; provide name_class when the account has one.
Returns
An unsigned Instruction, or SnsError::SolanaProgramError from instruction construction.
Example
use sns_sdk::bindings::name_registry::transfer_name_ownership;
let instruction = transfer_name_ownership(name_account, new_owner, current_owner, None)?;