Struct smart_wallet::SmartWallet
source · [−]pub struct SmartWallet {
pub base: Pubkey,
pub bump: u8,
pub threshold: u64,
pub minimum_delay: i64,
pub grace_period: i64,
pub owner_set_seqno: u32,
pub num_transactions: u64,
pub owners: Vec<Pubkey>,
pub reserved: [u64; 16],
}Expand description
A SmartWallet is a multisig wallet with Timelock capabilities.
Fields
base: PubkeyBase used to derive.
bump: u8Bump seed for deriving PDA seeds.
threshold: u64Minimum number of owner approvals needed to sign a Transaction.
minimum_delay: i64Minimum delay between approval and execution, in seconds.
grace_period: i64Time after the ETA until a Transaction expires.
owner_set_seqno: u32Sequence of the ownership set.
This may be used to see if the owners on the multisig have changed since the last time the owners were checked. This is used on Transaction approval to ensure that owners cannot approve old transactions.
num_transactions: u64Total number of Transactions on this SmartWallet.
owners: Vec<Pubkey>Owners of the SmartWallet.
reserved: [u64; 16]Extra space for program upgrades.
Implementations
sourceimpl SmartWallet
impl SmartWallet
sourcepub fn space(max_owners: u8) -> usize
pub fn space(max_owners: u8) -> usize
Computes the space a SmartWallet uses.
sourcepub fn owner_index(&self, key: Pubkey) -> Result<usize>
pub fn owner_index(&self, key: Pubkey) -> Result<usize>
Gets the index of the key in the owners Vec, or error
Trait Implementations
sourceimpl AccountDeserialize for SmartWallet
impl AccountDeserialize for SmartWallet
sourcefn try_deserialize(buf: &mut &[u8]) -> Result<Self, ProgramError>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self, ProgramError>
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. Read more
sourceimpl AccountSerialize for SmartWallet
impl AccountSerialize for SmartWallet
sourceimpl BorshDeserialize for SmartWallet where
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
u64: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
u32: BorshDeserialize,
u64: BorshDeserialize,
Vec<Pubkey>: BorshDeserialize,
[u64; 16]: BorshDeserialize,
impl BorshDeserialize for SmartWallet where
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
u64: BorshDeserialize,
i64: BorshDeserialize,
i64: BorshDeserialize,
u32: BorshDeserialize,
u64: BorshDeserialize,
Vec<Pubkey>: BorshDeserialize,
[u64; 16]: BorshDeserialize,
sourceimpl BorshSerialize for SmartWallet where
Pubkey: BorshSerialize,
u8: BorshSerialize,
u64: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
u32: BorshSerialize,
u64: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
[u64; 16]: BorshSerialize,
impl BorshSerialize for SmartWallet where
Pubkey: BorshSerialize,
u8: BorshSerialize,
u64: BorshSerialize,
i64: BorshSerialize,
i64: BorshSerialize,
u32: BorshSerialize,
u64: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
[u64; 16]: BorshSerialize,
sourceimpl Clone for SmartWallet
impl Clone for SmartWallet
sourcefn clone(&self) -> SmartWallet
fn clone(&self) -> SmartWallet
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for SmartWallet
impl Debug for SmartWallet
sourceimpl Default for SmartWallet
impl Default for SmartWallet
sourcefn default() -> SmartWallet
fn default() -> SmartWallet
Returns the “default value” for a type. Read more
sourceimpl Discriminator for SmartWallet
impl Discriminator for SmartWallet
fn discriminator() -> [u8; 8]
sourceimpl Owner for SmartWallet
impl Owner for SmartWallet
sourceimpl PartialEq<SmartWallet> for SmartWallet
impl PartialEq<SmartWallet> for SmartWallet
sourcefn eq(&self, other: &SmartWallet) -> bool
fn eq(&self, other: &SmartWallet) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &SmartWallet) -> bool
fn ne(&self, other: &SmartWallet) -> bool
This method tests for !=.
impl StructuralPartialEq for SmartWallet
Auto Trait Implementations
impl RefUnwindSafe for SmartWallet
impl Send for SmartWallet
impl Sync for SmartWallet
impl Unpin for SmartWallet
impl UnwindSafe for SmartWallet
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
pub default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more