use serde::Serialize;
use crate::encoding::{Decodable, Encodable};
use crate::util::SafeUrl;
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Serialize)]
pub struct PeerSetupCode {
pub name: String,
pub endpoints: PeerEndpoints,
pub federation_name: Option<String>,
pub disable_base_fees: Option<bool>,
}
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable, Serialize)]
pub enum PeerEndpoints {
Tcp {
api_url: SafeUrl,
p2p_url: SafeUrl,
#[serde(with = "::fedimint_core::encoding::as_hex")]
cert: Vec<u8>,
},
Iroh {
api_pk: iroh_base::PublicKey,
p2p_pk: iroh_base::PublicKey,
},
}