fedimint_server_core/
setup_ui.rs
1use 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 ) -> Result<String>;
31
32 async fn add_peer_setup_code(&self, info: String) -> Result<String>;
34
35 async fn start_dkg(&self) -> Result<()>;
37
38 fn into_dyn(self) -> DynSetupApi
40 where
41 Self: Sized + Send + Sync + 'static,
42 {
43 Arc::new(self)
44 }
45}