fedimint_core/
setup_code.rs1use std::collections::BTreeSet;
2
3use bitcoin::Network;
4use serde::Serialize;
5
6use crate::core::ModuleKind;
7use crate::encoding::{Decodable, Encodable};
8use crate::util::SafeUrl;
9
10#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Serialize)]
11pub struct PeerSetupCode {
13 pub name: String,
15 pub endpoints: PeerEndpoints,
17 pub federation_name: Option<String>,
19 pub disable_base_fees: Option<bool>,
21 pub enabled_modules: Option<BTreeSet<ModuleKind>>,
24 pub federation_size: Option<u32>,
27 pub network: Network,
29}
30
31#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Serialize)]
32pub enum PeerEndpoints {
33 Tcp {
34 api_url: SafeUrl,
36 p2p_url: SafeUrl,
38 #[serde(with = "::fedimint_core::encoding::as_hex")]
40 cert: Vec<u8>,
41 },
42 Iroh {
43 api_pk: iroh_base::PublicKey,
45 p2p_pk: iroh_base::PublicKey,
47 },
48}