pub struct UiAmountToAmount<'a> {
pub mint: &'a AccountView<'a>,
pub ui_amount: &'a str,
}Expand description
UiAmountToAmount (24): parse a decimal string against the mint and
return the raw amount as a u64 in the return data. Read it with
return_data_u64. Strings longer than MAX_UI_AMOUNT_LEN bytes
are refused before the CPI.
Fields§
§mint: &'a AccountView<'a>§ui_amount: &'a strImplementations§
Source§impl UiAmountToAmount<'_>
impl UiAmountToAmount<'_>
pub fn invoke(&self) -> ProgramResult
Sourcepub fn query(&self, program: TokenProgram) -> Result<u64, ProgramError>
pub fn query(&self, program: TokenProgram) -> Result<u64, ProgramError>
Invoke on program and read the raw amount from the return data.
Source§impl UiAmountToAmount<'_>
impl UiAmountToAmount<'_>
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
mint
(one 32-byte compare). Any other owner is refused with
IncorrectProgramId before the CPI.
Trait Implementations§
Source§impl<'a, 'x: 'a> TokenInstruction<'a> for UiAmountToAmount<'x>
impl<'a, 'x: 'a> TokenInstruction<'a> for UiAmountToAmount<'x>
fn emit( &self, multisig_signers: &[&'a AccountView<'a>], sink: &mut impl TokenSink<'a>, ) -> ProgramResult
Auto Trait Implementations§
impl<'a> !Send for UiAmountToAmount<'a>
impl<'a> !Sync for UiAmountToAmount<'a>
impl<'a> Freeze for UiAmountToAmount<'a>
impl<'a> RefUnwindSafe for UiAmountToAmount<'a>
impl<'a> Unpin for UiAmountToAmount<'a>
impl<'a> UnsafeUnpin for UiAmountToAmount<'a>
impl<'a> UnwindSafe for UiAmountToAmount<'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