pub struct Memo<'a, 'b, 'c> {
pub signers: &'a [&'a AccountView],
pub memo: &'b [u8],
pub program_id: Option<&'c Address>,
}Expand description
SPL Memo CPI builder.
signers are the accounts the memo program will assert signed the
surrounding transaction; pass an empty slice for unauthenticated
memos (the program then only logs the bytes). memo is the raw
payload - UTF-8 framing is the caller’s responsibility.
program_id selects the target program. Default (None) uses
MEMO_PROGRAM_ID (Memo v2). Pass Some(&v1::MEMO_V1_PROGRAM_ID)
for the legacy program.
The struct holds borrowed references only; nothing is allocated on the heap.
Fields§
§signers: &'a [&'a AccountView]Signing accounts the Memo program will validate.
memo: &'b [u8]Raw memo payload.
program_id: Option<&'c Address>Target program. None = Memo v2 (default).
Implementations§
Source§impl Memo<'_, '_, '_>
impl Memo<'_, '_, '_>
Sourcepub fn invoke(&self) -> Result<(), ProgramError>
pub fn invoke(&self) -> Result<(), ProgramError>
Invoke the Memo program with no PDA signer seeds.
Sourcepub fn invoke_signed(
&self,
signers_seeds: &[Signer<'_, '_>],
) -> Result<(), ProgramError>
pub fn invoke_signed( &self, signers_seeds: &[Signer<'_, '_>], ) -> Result<(), ProgramError>
Invoke the Memo program, supplying PDA signer seeds.
Any signer in self.signers whose address is a PDA must have
its derivation seeds in signers_seeds; the runtime will sign
the inner CPI on its behalf.