Skip to main content

FaucetWriter

Trait FaucetWriter 

Source
pub trait FaucetWriter: Send + Sync {
    // Required method
    fn persist_faucet_credit<'life0, 'life1, 'async_trait>(
        &'life0 self,
        wallet: &'life1 WalletAddress,
        amount: Decimal,
        limit: Decimal,
        window_start_ms: i64,
    ) -> Pin<Box<dyn Future<Output = Result<FaucetCreditResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Faucet deposit persistence.

Required Methods§

Source

fn persist_faucet_credit<'life0, 'life1, 'async_trait>( &'life0 self, wallet: &'life1 WalletAddress, amount: Decimal, limit: Decimal, window_start_ms: i64, ) -> Pin<Box<dyn Future<Output = Result<FaucetCreditResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Atomically check credit limit and record a deposit audit event. Returns error if the credit would exceed the per-window limit.

Implementors§