fedimint_core/
setup_code.rs1use std::collections::BTreeSet;
2
3use serde::Serialize;
4
5use crate::core::ModuleKind;
6use crate::encoding::{Decodable, Encodable};
7use crate::util::SafeUrl;
8
9#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Serialize)]
10pub struct PeerSetupCode {
12 pub name: String,
14 pub endpoints: PeerEndpoints,
16 pub federation_name: Option<String>,
18 pub disable_base_fees: Option<bool>,
20 pub enabled_modules: Option<BTreeSet<ModuleKind>>,
23 pub federation_size: Option<u32>,
26}
27
28#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Serialize)]
29pub enum PeerEndpoints {
30 Tcp {
31 api_url: SafeUrl,
33 p2p_url: SafeUrl,
35 #[serde(with = "::fedimint_core::encoding::as_hex")]
37 cert: Vec<u8>,
38 },
39 Iroh {
40 api_pk: iroh_base::PublicKey,
42 p2p_pk: iroh_base::PublicKey,
44 },
45}