pub struct Transaction {
pub smart_wallet: Pubkey,
pub index: u64,
pub bump: u8,
pub proposer: Pubkey,
pub instructions: Vec<TXInstruction>,
pub signers: Vec<bool>,
pub owner_set_seqno: u32,
pub eta: i64,
pub executor: Pubkey,
pub executed_at: i64,
}
Expand description
A Transaction is a series of instructions that may be executed by a SmartWallet.
Fields§
§smart_wallet: Pubkey
The SmartWallet account this transaction belongs to.
index: u64
The auto-incremented integer index of the transaction. All transactions on the SmartWallet can be looked up via this index, allowing for easier browsing of a wallet’s historical transactions.
bump: u8
Bump seed.
proposer: Pubkey
The proposer of the Transaction.
instructions: Vec<TXInstruction>
The instruction.
signers: Vec<bool>
signers[index]
is true iff [SmartWallet]::owners[index]
signed the transaction.
owner_set_seqno: u32
Owner set sequence number.
eta: i64
Estimated time the Transaction will be executed.
- If set to crate::NO_ETA, the transaction may be executed at any time.
- Otherwise, the Transaction may be executed at any point after the ETA has elapsed.
executor: Pubkey
The account that executed the Transaction.
executed_at: i64
When the transaction was executed. -1 if not executed.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn space(instructions: Vec<TXInstruction>) -> usize
pub fn space(instructions: Vec<TXInstruction>) -> usize
Computes the space a Transaction uses.
Sourcepub fn num_signers(&self) -> usize
pub fn num_signers(&self) -> usize
Number of signers.
Trait Implementations§
Source§impl AccountDeserialize for Transaction
impl AccountDeserialize for Transaction
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 Transaction
impl AccountSerialize for Transaction
Source§impl BorshDeserialize for Transaction
impl BorshDeserialize for Transaction
Source§impl BorshSerialize for Transactionwhere
Pubkey: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
Vec<TXInstruction>: BorshSerialize,
Vec<bool>: BorshSerialize,
u32: BorshSerialize,
i64: BorshSerialize,
impl BorshSerialize for Transactionwhere
Pubkey: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
Vec<TXInstruction>: BorshSerialize,
Vec<bool>: BorshSerialize,
u32: BorshSerialize,
i64: BorshSerialize,
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Transaction
impl Debug for Transaction
Source§impl Default for Transaction
impl Default for Transaction
Source§fn default() -> Transaction
fn default() -> Transaction
Returns the “default value” for a type. Read more
Source§impl Discriminator for Transaction
impl Discriminator for Transaction
fn discriminator() -> [u8; 8]
Source§impl PartialEq for Transaction
impl PartialEq for Transaction
impl StructuralPartialEq for Transaction
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
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