IGlobalClientContext

Trait IGlobalClientContext 

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 'life0: 'async_trait,
             Self: 'async_trait;
    fn api(&self) -> &DynGlobalApi;
    fn decoders(&self) -> &ModuleRegistry<Decoder, DecodingMode>;
    fn claim_inputs_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>,
        inputs: ClientInputBundle<Box<dyn IInput + Sync + Send>, Box<dyn IState + Sync + Send>>,
    ) -> Pin<Box<dyn Future<Output = Result<OutPointRange, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
    fn fund_output_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>,
        outputs: ClientOutputBundle<Box<dyn IOutput + Sync + Send>, Box<dyn IState + Sync + Send>>,
    ) -> Pin<Box<dyn Future<Output = Result<OutPointRange, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: '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 + Sync + Send>,
    ) -> Pin<Box<dyn Future<Output = Result<(), AddStateMachinesError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: '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, u16)>,
        payload: Value,
        persist: EventPersistence,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
    fn transaction_update_stream<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Pin<Box<dyn Stream<Item = TxSubmissionStatesSM> + Send + 'life0>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn core_api_version<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ApiVersion> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Re-exporting of everything from fedimint_client_module

This should be removed when the splitting of [fedimint_client_module] is complete.

Required Methods§

fn module_api(&self) -> DynModuleApi

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

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

fn api(&self) -> &DynGlobalApi

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

fn decoders(&self) -> &ModuleRegistry<Decoder, DecodingMode>

fn claim_inputs_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, inputs: ClientInputBundle<Box<dyn IInput + Sync + Send>, Box<dyn IState + Sync + Send>>, ) -> Pin<Box<dyn Future<Output = Result<OutPointRange, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: '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.

fn fund_output_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, outputs: ClientOutputBundle<Box<dyn IOutput + Sync + Send>, Box<dyn IState + Sync + Send>>, ) -> Pin<Box<dyn Future<Output = Result<OutPointRange, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: '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.

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

Adds a state machine to the executor.

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

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

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

Returns the core API version that the federation supports

Implementations on Foreign Types§

§

impl IGlobalClientContext for ()

§

fn module_api(&self) -> DynModuleApi

§

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

§

fn api(&self) -> &DynGlobalApi

§

fn decoders(&self) -> &ModuleRegistry<Decoder, DecodingMode>

§

fn claim_inputs_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, _input: ClientInputBundle<Box<dyn IInput + Sync + Send>, Box<dyn IState + Sync + Send>>, ) -> Pin<Box<dyn Future<Output = Result<OutPointRange, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, (): 'async_trait,

§

fn fund_output_dyn<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>, _outputs: ClientOutputBundle<Box<dyn IOutput + Sync + Send>, Box<dyn IState + Sync + Send>>, ) -> Pin<Box<dyn Future<Output = Result<OutPointRange, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, (): '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 + Sync + Send>, ) -> Pin<Box<dyn Future<Output = Result<(), AddStateMachinesError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, (): '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, u16)>, _payload: Value, _persist: EventPersistence, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, (): 'async_trait,

§

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

§

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

Implementors§