Struct squads_multisig_program::state::SpendingLimit
source · pub struct SpendingLimit {
pub multisig: Pubkey,
pub create_key: Pubkey,
pub vault_index: u8,
pub mint: Pubkey,
pub amount: u64,
pub period: Period,
pub remaining_amount: u64,
pub last_reset: i64,
pub bump: u8,
pub members: Vec<Pubkey>,
pub destinations: Vec<Pubkey>,
}Fields§
§multisig: PubkeyThe multisig this belongs to.
create_key: PubkeyKey that is used to seed the SpendingLimit PDA.
vault_index: u8The index of the vault that the spending limit is for.
mint: PubkeyThe token mint the spending limit is for. Pubkey::default() means SOL. use NATIVE_MINT for Wrapped SOL.
amount: u64The amount of tokens that can be spent in a period.
This amount is in decimals of the mint,
so 1 SOL would be 1_000_000_000 and 1 USDC would be 1_000_000.
period: PeriodThe reset period of the spending limit.
When it passes, the remaining amount is reset, unless it’s Period::OneTime.
remaining_amount: u64The remaining amount of tokens that can be spent in the current period. When reaches 0, the spending limit cannot be used anymore until the period reset.
last_reset: i64Unix timestamp marking the last time the spending limit was reset (or created).
bump: u8PDA bump.
members: Vec<Pubkey>Members of the multisig that can use the spending limit. In case a member is removed from the multisig, the spending limit will remain existent (until explicitly deleted), but the removed member will not be able to use it anymore.
destinations: Vec<Pubkey>The destination addresses the spending limit is allowed to sent funds to. If empty, funds can be sent to any address.
Implementations§
Trait Implementations§
source§impl AccountDeserialize for SpendingLimit
impl AccountDeserialize for SpendingLimit
source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self>
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>
source§impl AccountSerialize for SpendingLimit
impl AccountSerialize for SpendingLimit
source§impl BorshDeserialize for SpendingLimitwhere
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
u64: BorshDeserialize,
Period: BorshDeserialize,
i64: BorshDeserialize,
Vec<Pubkey>: BorshDeserialize,
impl BorshDeserialize for SpendingLimitwhere Pubkey: BorshDeserialize, u8: BorshDeserialize, u64: BorshDeserialize, Period: BorshDeserialize, i64: BorshDeserialize, Vec<Pubkey>: BorshDeserialize,
source§impl BorshSerialize for SpendingLimitwhere
Pubkey: BorshSerialize,
u8: BorshSerialize,
u64: BorshSerialize,
Period: BorshSerialize,
i64: BorshSerialize,
Vec<Pubkey>: BorshSerialize,
impl BorshSerialize for SpendingLimitwhere Pubkey: BorshSerialize, u8: BorshSerialize, u64: BorshSerialize, Period: BorshSerialize, i64: BorshSerialize, Vec<Pubkey>: BorshSerialize,
source§impl Clone for SpendingLimit
impl Clone for SpendingLimit
source§fn clone(&self) -> SpendingLimit
fn clone(&self) -> SpendingLimit
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more