pub struct RevenueModule { /* private fields */ }Implementations§
Source§impl RevenueModule
impl RevenueModule
pub fn new() -> Self
pub fn set_treasury(&mut self, address: Address)
pub fn create_distribution( &mut self, source: Address, routes: Vec<RevenueRoute>, total_amount: u128, current_height: u64, ) -> Result<Hash32, RuntimeError>
pub fn distribute( &mut self, distribution_id: &Hash32, balances: &mut HashMap<Address, u128>, ) -> Result<Vec<(Address, u128)>, RuntimeError>
pub fn calculate_fee( &self, prompt_tokens: u64, output_tokens: u64, base_fee: u64, token_fee: u64, ) -> u64
pub fn route_revenue( &self, amount: u128, split: &RevenueSplit, model_owner: Address, operator: Address, validator: Address, ) -> Vec<RevenueRoute>
pub fn get_distribution( &self, distribution_id: &Hash32, ) -> Option<&RevenueDistribution>
pub fn pending_count(&self) -> usize
pub fn all_distributions(&self) -> &HashMap<Hash32, RevenueDistribution>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RevenueModule
impl RefUnwindSafe for RevenueModule
impl Send for RevenueModule
impl Sync for RevenueModule
impl Unpin for RevenueModule
impl UnsafeUnpin for RevenueModule
impl UnwindSafe for RevenueModule
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