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_input_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>,
        input: InstancelessDynClientInput,
    ) -> 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>,
        output: InstancelessDynClientOutput,
    ) -> 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,
    ) -> 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_input_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, input: InstancelessDynClientInput, ) -> 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_input. 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>, output: InstancelessDynClientOutput, ) -> 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, ) -> 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_input_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, _input: InstancelessDynClientInput, ) -> 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>, _output: InstancelessDynClientOutput, ) -> 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, ) -> 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§