pub struct Config {
pub platform_authority: Pubkey,
pub pending_authority: Option<Pubkey>,
pub max_platform_fee_bps: u16,
pub min_platform_fee_bps: u16,
pub min_period_seconds: u64,
pub default_allowance_periods: u8,
pub allowed_mint: Pubkey,
pub max_withdrawal_amount: u64,
pub max_grace_period_seconds: u64,
pub paused: bool,
pub keeper_fee_bps: u16,
pub bump: u8,
}Expand description
Global configuration account for program constants and settings
PDA seeds: ["config"]
Fields§
Platform authority pubkey for admin operations
Pending authority for two-step authority transfer
max_platform_fee_bps: u16Maximum platform fee in basis points (e.g., 1000 = 10%)
min_platform_fee_bps: u16Minimum platform fee in basis points (e.g., 50 = 0.5%)
min_period_seconds: u64Minimum subscription period in seconds (e.g., 86400 = 24 hours)
default_allowance_periods: u8Default allowance periods multiplier (e.g., 3)
allowed_mint: PubkeyAllowed token mint address (e.g., official USDC mint) This prevents merchants from using fake or arbitrary tokens
max_withdrawal_amount: u64Maximum withdrawal amount per transaction in USDC microlamports Prevents accidental or malicious drainage of entire treasury
max_grace_period_seconds: u64Maximum grace period in seconds (e.g., 604800 = 7 days) Prevents excessively long grace periods that increase merchant payment risk
paused: boolEmergency pause state - when true, all user-facing operations are disabled This allows the platform authority to halt operations in case of security incidents
keeper_fee_bps: u16Keeper fee in basis points (e.g., 25 = 0.25%) This fee is paid to the transaction caller (keeper) to incentivize decentralized renewal network Capped at 100 basis points (1%) to prevent excessive keeper fees
bump: u8PDA bump seed
Trait Implementations§
Source§impl BorshDeserialize for Config
impl BorshDeserialize for Config
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 Configwhere
Pubkey: BorshSerialize,
Option<Pubkey>: BorshSerialize,
u16: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
bool: BorshSerialize,
impl BorshSerialize for Configwhere
Pubkey: BorshSerialize,
Option<Pubkey>: BorshSerialize,
u16: BorshSerialize,
u64: BorshSerialize,
u8: BorshSerialize,
bool: BorshSerialize,
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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