Skip to main content

Rust SDK API Reference / Record instructions / update_record_v2_instruction

Function: update_record_v2_instruction()

pub fn update_record_v2_instruction(domain: &str, record: Record, content: &str, owner: Pubkey, payer: Pubkey) -> Result<Instruction, SnsError>

Defined in: record_v2.rs:61

Derives the V2 record and domain keys, serializes replacement content, and builds an edit instruction.

Parameters

domain is a canonical lowercase .sns name; record selects its encoding; owner authorizes the update and payer funds it.

Returns

An unsigned Instruction. Parsing and serialization failures return SnsError.

Example

use sns_sdk::{bindings::record_v2::update_record_v2_instruction, record::Record};

let instruction = update_record_v2_instruction("example.sns", Record::Url, "https://new.example", owner, payer)?;