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 account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>,
) -> Pin<Box<dyn Future<Output = Account> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
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<OutPointRange, TransactionSubmitError>> + 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<OutPointRange, TransactionSubmitError>> + 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,
persist: EventPersistence,
) -> 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 log_event_json_no_dbtx<'life0, 'async_trait>(
&'life0 self,
kind: EventKind,
module_kind: Option<ModuleKind>,
payload: Value,
persist: EventPersistence,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: '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;
fn core_api_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ApiVersion> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn module_api(&self) -> DynModuleApi
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
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn api(&self) -> &DynGlobalApi
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) -> &ModuleDecoderRegistry
Sourcefn account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>,
) -> Pin<Box<dyn Future<Output = Account> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn account<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
dbtx: &'life1 mut ClientSMDatabaseTransaction<'life2, 'life3>,
) -> Pin<Box<dyn Future<Output = Account> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
The account the state machine’s operation acts on: the balance the primary module funds its transactions from and credits its change, claims and refunds to. Read from the operation’s record rather than carried by the state machine, so no machine’s persisted shape depends on it.
Sourcefn 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<OutPointRange, TransactionSubmitError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
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<OutPointRange, TransactionSubmitError>> + 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.
Sourcefn 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<OutPointRange, TransactionSubmitError>> + 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<OutPointRange, TransactionSubmitError>> + 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.
Sourcefn 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 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.
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,
persist: EventPersistence,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Sourcefn log_event_json_no_dbtx<'life0, 'async_trait>(
&'life0 self,
kind: EventKind,
module_kind: Option<ModuleKind>,
payload: Value,
persist: EventPersistence,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn log_event_json_no_dbtx<'life0, 'async_trait>(
&'life0 self,
kind: EventKind,
module_kind: Option<ModuleKind>,
payload: Value,
persist: EventPersistence,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Like Self::log_event_json, but opens its own database transaction
instead of borrowing a ClientSMDatabaseTransaction. Meant for call
sites that run outside a state transition (e.g. the submission retry
loop) and therefore have no dbtx in scope. The implementation pairs the
event’s module kind with its own module instance id, mirroring what
log_event_json derives from the transaction’s module_id().
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,
Sourcefn core_api_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ApiVersion> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn core_api_version<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ApiVersion> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the core API version that the federation supports