pub struct FeeProcessor { /* private fields */ }Expand description
Fee processor
Processes incoming fees and distributes them according to configuration.
Implementations§
Source§impl FeeProcessor
impl FeeProcessor
Sourcepub fn process_fee(
&self,
asset_id: AssetId,
amount: u128,
source: FeeSource,
) -> Result<FeeRecord>
pub fn process_fee( &self, asset_id: AssetId, amount: u128, source: FeeSource, ) -> Result<FeeRecord>
Processes a fee
§Arguments
asset_id- Asset of the feeamount- Fee amountsource- Source of the fee
Returns the fee record
Sourcepub fn get_fee_stats(&self) -> FeeStats
pub fn get_fee_stats(&self) -> FeeStats
Returns fee statistics
Sourcepub fn get_distribution_history(
&self,
period: &str,
) -> Option<DistributionHistory>
pub fn get_distribution_history( &self, period: &str, ) -> Option<DistributionHistory>
Returns distribution history for a period
Sourcepub fn get_all_history(&self) -> Vec<(String, DistributionHistory)>
pub fn get_all_history(&self) -> Vec<(String, DistributionHistory)>
Returns all distribution history
Sourcepub fn start_new_period(&self, period_id: String, start_time: Timestamp)
pub fn start_new_period(&self, period_id: String, start_time: Timestamp)
Starts a new history period
Sourcepub fn update_config(&self, config: FeeDistributionConfig) -> Result<()>
pub fn update_config(&self, config: FeeDistributionConfig) -> Result<()>
Updates the fee distribution configuration
Sourcepub fn get_config(&self) -> FeeDistributionConfig
pub fn get_config(&self) -> FeeDistributionConfig
Returns the current configuration
Sourcepub fn get_fee_record(&self, fee_id: &str) -> Option<FeeRecord>
pub fn get_fee_record(&self, fee_id: &str) -> Option<FeeRecord>
Returns a fee record by ID
Sourcepub fn get_all_fee_records(&self) -> Vec<FeeRecord>
pub fn get_all_fee_records(&self) -> Vec<FeeRecord>
Returns all fee records
Trait Implementations§
Source§impl Debug for FeeProcessor
impl Debug for FeeProcessor
Auto Trait Implementations§
impl !Freeze for FeeProcessor
impl !RefUnwindSafe for FeeProcessor
impl Send for FeeProcessor
impl Sync for FeeProcessor
impl Unpin for FeeProcessor
impl UnsafeUnpin for FeeProcessor
impl UnwindSafe for FeeProcessor
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
Mutably borrows from an owned value. Read more