pub mod crypto;
#[cfg(feature = "native-crypto")]
pub mod transport;
#[cfg(feature = "native-crypto")]
pub mod protocol;
#[cfg(feature = "native-crypto")]
pub mod node;
#[cfg(feature = "native-crypto")]
pub mod ai;
mod error;
#[cfg(feature = "native-crypto")]
mod identity;
pub use error::{Error, Result};
#[cfg(feature = "native-crypto")]
pub use identity::{Identity, Fingerprint};
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const BITCHAT_PROTOCOL_VERSION: u8 = 1;
pub const PQC_PROTOCOL_VERSION: u8 = 1;
#[derive(Debug, Clone)]
pub struct Config {
pub enable_pqc: bool,
pub enable_noise_fallback: bool,
pub enable_qrng: bool,
pub enable_qkd: bool,
pub enable_node: bool,
pub enable_validator: bool,
pub enable_ai_agent: bool,
pub nostr_relays: Vec<String>,
pub node_rpc: String,
}
impl Default for Config {
fn default() -> Self {
Self {
enable_pqc: true,
enable_noise_fallback: true,
enable_qrng: true,
enable_qkd: true,
enable_node: true,
enable_validator: false,
enable_ai_agent: false,
nostr_relays: vec![
"wss://relay.damus.io".into(),
"wss://nos.lol".into(),
"wss://relay.nostr.band".into(),
],
node_rpc: "http://localhost:9944".into(),
}
}
}
#[cfg(feature = "native-crypto")]
pub struct QuantumCommunicator {
config: Config,
identity: Identity,
}
#[cfg(feature = "native-crypto")]
impl QuantumCommunicator {
pub fn new(config: Config) -> Result<Self> {
let identity = Identity::generate()?;
Ok(Self { config, identity })
}
pub fn with_identity(config: Config, identity: Identity) -> Self {
Self { config, identity }
}
pub fn identity(&self) -> &Identity {
&self.identity
}
pub fn config(&self) -> &Config {
&self.config
}
}