fedimint_client::module

Trait ClientContextIface

Source
pub trait ClientContextIface: MaybeSend + MaybeSync {
Show 16 methods // Required methods fn get_module( &self, instance: ModuleInstanceId, ) -> &(dyn IClientModule + Send + Sync); fn api_clone(&self) -> DynGlobalApi; fn decoders(&self) -> &ModuleDecoderRegistry; fn finalize_and_submit_transaction<'life0, 'life1, 'async_trait>( &'life0 self, operation_id: OperationId, operation_type: &'life1 str, operation_meta_gen: Box<dyn Fn(OutPointRange) -> Value + Send + Sync>, tx_builder: TransactionBuilder, ) -> Pin<Box<dyn Future<Output = Result<OutPointRange>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn finalize_and_submit_transaction_inner<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: &'life1 mut DatabaseTransaction<'life2>, operation_id: OperationId, tx_builder: TransactionBuilder, ) -> Pin<Box<dyn Future<Output = Result<OutPointRange>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn transaction_updates<'life0, 'async_trait>( &'life0 self, operation_id: OperationId, ) -> Pin<Box<dyn Future<Output = TransactionUpdates> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn await_primary_module_outputs<'life0, 'async_trait>( &'life0 self, operation_id: OperationId, outputs: Vec<OutPoint>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn operation_log(&self) -> &OperationLog; fn has_active_states<'life0, 'async_trait>( &'life0 self, operation_id: OperationId, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn operation_exists<'life0, 'async_trait>( &'life0 self, operation_id: OperationId, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn config<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ClientConfig> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn db(&self) -> &Database; fn executor(&self) -> &Executor; fn invite_code<'life0, 'async_trait>( &'life0 self, peer: PeerId, ) -> Pin<Box<dyn Future<Output = Option<InviteCode>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_internal_payment_markers(&self) -> Result<(PublicKey, u64)>; fn log_event_json<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: &'life1 mut DatabaseTransaction<'life2, NonCommittable>, module_kind: Option<ModuleKind>, module_id: ModuleInstanceId, kind: EventKind, payload: Value, persist: bool, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait;
}
Expand description

A fedimint-client interface exposed to client modules

To break the dependency of the client modules on the whole fedimint client and in particular the fedimint-client crate, the module gets access to an interface, that is implemented by the Client.

This allows lose coupling, less recompilation and better control and understanding of what functionality of the Client the modules get access to.

Required Methods§

Source

fn get_module( &self, instance: ModuleInstanceId, ) -> &(dyn IClientModule + Send + Sync)

Source

fn api_clone(&self) -> DynGlobalApi

Source

fn decoders(&self) -> &ModuleDecoderRegistry

Source

fn finalize_and_submit_transaction<'life0, 'life1, 'async_trait>( &'life0 self, operation_id: OperationId, operation_type: &'life1 str, operation_meta_gen: Box<dyn Fn(OutPointRange) -> Value + Send + Sync>, tx_builder: TransactionBuilder, ) -> Pin<Box<dyn Future<Output = Result<OutPointRange>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn finalize_and_submit_transaction_inner<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: &'life1 mut DatabaseTransaction<'life2>, operation_id: OperationId, tx_builder: TransactionBuilder, ) -> Pin<Box<dyn Future<Output = Result<OutPointRange>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn transaction_updates<'life0, 'async_trait>( &'life0 self, operation_id: OperationId, ) -> Pin<Box<dyn Future<Output = TransactionUpdates> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn await_primary_module_outputs<'life0, 'async_trait>( &'life0 self, operation_id: OperationId, outputs: Vec<OutPoint>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn operation_log(&self) -> &OperationLog

Source

fn has_active_states<'life0, 'async_trait>( &'life0 self, operation_id: OperationId, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn operation_exists<'life0, 'async_trait>( &'life0 self, operation_id: OperationId, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn config<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ClientConfig> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn db(&self) -> &Database

Source

fn executor(&self) -> &Executor

Source

fn invite_code<'life0, 'async_trait>( &'life0 self, peer: PeerId, ) -> Pin<Box<dyn Future<Output = Option<InviteCode>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_internal_payment_markers(&self) -> Result<(PublicKey, u64)>

Source

fn log_event_json<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, dbtx: &'life1 mut DatabaseTransaction<'life2, NonCommittable>, module_kind: Option<ModuleKind>, module_id: ModuleInstanceId, kind: EventKind, payload: Value, persist: bool, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§