pub struct Transfer {
pub creator: Pubkey,
pub recipient: Pubkey,
pub lamports: u64,
}Expand description
A multisig Transfer account data.
§Examples
Here is how to query the Transfer PDA account on Devnet.
use std::rc::Rc;
use solana_sdk::commitment_config::CommitmentConfig;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::signature::read_keypair_file;
use solana_sdk::signer::Signer;
use anchor_client::{Client, Cluster};
let url = Cluster::Devnet;
let funder = Rc::new(read_keypair_file(
shellexpand::tilde("~/.config/solana/id.json").as_ref(),
)?);
let opts = CommitmentConfig::processed();
let pid = multisig_lite::id();
let program = Client::new_with_options(url, funder.clone(), opts).program(pid);
// Gets the PDAs.
let (state_pda, _state_bump) =
Pubkey::find_program_address(&[b"state", funder.pubkey().as_ref()], &pid);
// Query the `multisig_lite::State` account to get the queued transfers.
let state: multisig_lite::State = program.account(state_pda)?;
// Query the `multisig_lite::Transfer` accounts iteratively.
for transfer in state.queue {
let transfer: multisig_lite::Transfer = program.account(transfer)?;
println!("{transfer:?}");
}Fields§
§creator: PubkeyAn creator of the transfer, one of the multisig signers.
recipient: PubkeyA recipient of the transfer.
lamports: u64A lamports to transfer.
Trait Implementations§
Source§impl AccountDeserialize for Transfer
impl AccountDeserialize for Transfer
Source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a
Mint account into a token
Account.Source§fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>
Deserializes account data without checking the account discriminator.
This should only be used on account initialization, when the bytes of
the account are zeroed.
Source§impl AccountSerialize for Transfer
impl AccountSerialize for Transfer
Source§impl BorshDeserialize for Transfer
impl BorshDeserialize for Transfer
Source§impl BorshSerialize for Transfer
impl BorshSerialize for Transfer
Source§impl Discriminator for Transfer
impl Discriminator for Transfer
const DISCRIMINATOR: [u8; 8]
fn discriminator() -> [u8; 8]
Auto Trait Implementations§
impl Freeze for Transfer
impl RefUnwindSafe for Transfer
impl Send for Transfer
impl Sync for Transfer
impl Unpin for Transfer
impl UnwindSafe for Transfer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more