pub struct UnwrapLamports<'a> {
pub source: &'a AccountView<'a>,
pub destination: &'a AccountView<'a>,
pub authority: &'a AccountView<'a>,
pub amount: Option<u64>,
}Expand description
UnwrapLamports (45): move lamports out of a native (wrapped SOL)
token account to destination without closing it, the whole balance
with amount: None or a part of it. The instruction exists in the
p-token build of SPL Token; a program that does not know discriminator
45 refuses it with InvalidInstructionData.
Fields§
§source: &'a AccountView<'a>§destination: &'a AccountView<'a>§amount: Option<u64>Implementations§
Source§impl UnwrapLamports<'_>
impl UnwrapLamports<'_>
pub fn invoke(&self) -> ProgramResult
pub fn invoke_signed(&self, signers: &[Signer<'_, '_>]) -> ProgramResult
pub fn invoke_multisig( &self, multisig_signers: &[&AccountView<'_>], ) -> ProgramResult
Source§impl UnwrapLamports<'_>
impl UnwrapLamports<'_>
Sourcepub fn invoke_on(
&self,
program: TokenProgram,
multisig_signers: &[&AccountView<'_>],
signers: &[Signer<'_, '_>],
) -> ProgramResult
pub fn invoke_on( &self, program: TokenProgram, multisig_signers: &[&AccountView<'_>], signers: &[Signer<'_, '_>], ) -> ProgramResult
Send this instruction to an explicit token program.
multisig_signers is empty for a single-key authority; when
signers is empty the authority (or every multisig signer)
must have signed the transaction directly.
Sourcepub fn invoke_for_owner(
&self,
multisig_signers: &[&AccountView<'_>],
signers: &[Signer<'_, '_>],
) -> ProgramResult
pub fn invoke_for_owner( &self, multisig_signers: &[&AccountView<'_>], signers: &[Signer<'_, '_>], ) -> ProgramResult
Send this instruction to whichever token program owns
source
(one 32-byte compare). Any other owner is refused with
IncorrectProgramId before the CPI.
Trait Implementations§
Source§impl<'a, 'x: 'a> TokenInstruction<'a> for UnwrapLamports<'x>
impl<'a, 'x: 'a> TokenInstruction<'a> for UnwrapLamports<'x>
fn emit( &self, multisig_signers: &[&'a AccountView<'a>], sink: &mut impl TokenSink<'a>, ) -> ProgramResult
Auto Trait Implementations§
impl<'a> !Send for UnwrapLamports<'a>
impl<'a> !Sync for UnwrapLamports<'a>
impl<'a> Freeze for UnwrapLamports<'a>
impl<'a> RefUnwindSafe for UnwrapLamports<'a>
impl<'a> Unpin for UnwrapLamports<'a>
impl<'a> UnsafeUnpin for UnwrapLamports<'a>
impl<'a> UnwindSafe for UnwrapLamports<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more