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 SpendingLimit
impl BorshDeserialize for SpendingLimit
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
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 moreSource§impl Discriminator for SpendingLimit
impl Discriminator for SpendingLimit
const DISCRIMINATOR: [u8; 8]
fn discriminator() -> [u8; 8]
Auto Trait Implementations§
impl Freeze for SpendingLimit
impl RefUnwindSafe for SpendingLimit
impl Send for SpendingLimit
impl Sync for SpendingLimit
impl Unpin for SpendingLimit
impl UnwindSafe for SpendingLimit
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
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>
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>
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