fedimint_core/
setup_code.rs1use serde::Serialize;
2
3use crate::encoding::{Decodable, Encodable};
4use crate::util::SafeUrl;
5
6#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Serialize)]
7pub struct PeerSetupCode {
9 pub name: String,
11 pub endpoints: PeerEndpoints,
13 pub federation_name: Option<String>,
15 pub disable_base_fees: Option<bool>,
17}
18
19#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Serialize)]
20pub enum PeerEndpoints {
21 Tcp {
22 api_url: SafeUrl,
24 p2p_url: SafeUrl,
26 #[serde(with = "::fedimint_core::encoding::as_hex")]
28 cert: Vec<u8>,
29 },
30 Iroh {
31 api_pk: iroh_base::PublicKey,
33 p2p_pk: iroh_base::PublicKey,
35 },
36}