fedimint_server_core/
setup_ui.rs1use std::sync::Arc;
2
3use anyhow::Result;
4use async_trait::async_trait;
5use fedimint_core::module::ApiAuth;
6
7pub type DynSetupApi = Arc<dyn ISetupApi + Send + Sync + 'static>;
8
9#[async_trait]
11pub trait ISetupApi {
12    async fn setup_code(&self) -> Option<String>;
14
15    async fn auth(&self) -> Option<ApiAuth>;
17
18    async fn connected_peers(&self) -> Vec<String>;
20
21    async fn reset_setup_codes(&self);
23
24    async fn set_local_parameters(
26        &self,
27        auth: ApiAuth,
28        name: String,
29        federation_name: Option<String>,
30        disable_base_fees: Option<bool>,
31    ) -> Result<String>;
32
33    async fn add_peer_setup_code(&self, info: String) -> Result<String>;
35
36    async fn start_dkg(&self) -> Result<()>;
38
39    fn into_dyn(self) -> DynSetupApi
41    where
42        Self: Sized + Send + Sync + 'static,
43    {
44        Arc::new(self)
45    }
46}