fedimint_client

Trait IGlobalClientContext

Source
pub trait IGlobalClientContext:
    Debug
    + MaybeSend
    + MaybeSync
    + 'static {
    // Required methods
    fn module_api(&self) -> DynModuleApi;
    fn client_config<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ClientConfig> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn api(&self) -> &DynGlobalApi;
    fn decoders(&self) -> &ModuleDecoderRegistry;
    fn claim_inputs_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>,
        inputs: InstancelessDynClientInputBundle,
    ) -> Pin<Box<dyn Future<Output = Result<(TransactionId, Vec<OutPoint>)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn fund_output_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>,
        outputs: InstancelessDynClientOutputBundle,
    ) -> Pin<Box<dyn Future<Output = Result<(TransactionId, Vec<OutPoint>)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn add_state_machine_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>,
        sm: Box<dyn IState + Send + Sync>,
    ) -> Pin<Box<dyn Future<Output = AddStateMachinesResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn log_event_json<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>,
        kind: EventKind,
        module: Option<(ModuleKind, ModuleInstanceId)>,
        payload: Value,
        transient: bool,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn transaction_update_stream<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = BoxStream<'_, TxSubmissionStatesSM>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn module_api(&self) -> DynModuleApi

Returned a reference client’s module API client, so that module-specific calls can be made

Source

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

Source

fn api(&self) -> &DynGlobalApi

Returns a reference to the client’s federation API client. The provided interface IGlobalFederationApi typically does not provide the necessary functionality, for this extension traits like fedimint_api_client::api::IGlobalFederationApi have to be used.

Source

fn decoders(&self) -> &ModuleDecoderRegistry

Source

fn claim_inputs_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, inputs: InstancelessDynClientInputBundle, ) -> Pin<Box<dyn Future<Output = Result<(TransactionId, Vec<OutPoint>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

This function is mostly meant for internal use, you are probably looking for DynGlobalClientContext::claim_inputs. Returns transaction id of the funding transaction and an optional OutPoint that represents change if change was added.

Source

fn fund_output_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, outputs: InstancelessDynClientOutputBundle, ) -> Pin<Box<dyn Future<Output = Result<(TransactionId, Vec<OutPoint>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

This function is mostly meant for internal use, you are probably looking for DynGlobalClientContext::fund_output. Returns transaction id of the funding transaction and an optional OutPoint that represents change if change was added.

Source

fn add_state_machine_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, sm: Box<dyn IState + Send + Sync>, ) -> Pin<Box<dyn Future<Output = AddStateMachinesResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Adds a state machine to the executor.

Source

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

Source

fn transaction_update_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = BoxStream<'_, TxSubmissionStatesSM>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementations on Foreign Types§

Source§

impl IGlobalClientContext for ()

Source§

fn module_api(&self) -> DynModuleApi

Source§

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

Source§

fn api(&self) -> &DynGlobalApi

Source§

fn decoders(&self) -> &ModuleDecoderRegistry

Source§

fn claim_inputs_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, _input: InstancelessDynClientInputBundle, ) -> Pin<Box<dyn Future<Output = Result<(TransactionId, Vec<OutPoint>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn fund_output_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, _outputs: InstancelessDynClientOutputBundle, ) -> Pin<Box<dyn Future<Output = Result<(TransactionId, Vec<OutPoint>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn add_state_machine_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, _sm: Box<dyn IState + Send + Sync>, ) -> Pin<Box<dyn Future<Output = AddStateMachinesResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn log_event_json<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, _kind: EventKind, _module: Option<(ModuleKind, ModuleInstanceId)>, _payload: Value, _transient: bool, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source§

fn transaction_update_stream<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = BoxStream<'_, TxSubmissionStatesSM>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§