#![forbid(unsafe_code)]
#![allow(
clippy::cast_possible_truncation,
clippy::cast_precision_loss,
clippy::if_not_else,
clippy::items_after_statements,
clippy::manual_let_else,
clippy::map_unwrap_or,
clippy::missing_errors_doc,
clippy::must_use_candidate,
clippy::uninlined_format_args
)]
#[cfg(feature = "acl")]
pub mod acl;
#[cfg(feature = "config")]
pub mod config;
pub mod constants;
pub mod did;
pub mod doc;
pub mod endpoint;
pub mod error;
pub mod identity;
pub mod inbox;
pub mod interfaces;
pub mod ipfs;
#[cfg(feature = "iroh")]
#[allow(dead_code)]
mod iroh;
pub mod key;
#[cfg(all(feature = "kubo", not(target_arch = "wasm32")))]
mod kubo;
pub mod msg;
mod multiformat;
#[cfg(feature = "iroh")]
#[allow(dead_code)]
mod outbox;
pub mod service;
pub mod topic;
pub mod transport;
pub(crate) mod ttl_queue;
pub use did::{Did, DID_PREFIX};
pub use doc::{
now_iso_utc, Document, MaExtension, Proof, VerificationMethod, DEFAULT_DID_CONTEXT,
DEFAULT_PROOF_PURPOSE, DEFAULT_PROOF_TYPE,
};
pub use error::{Error, MaError, Result};
pub use identity::{
generate_identity, generate_identity_from_secret, ipns_from_secret, GeneratedIdentity,
};
pub use ipld_core::ipld::Ipld;
pub use key::{
EncryptionKey, SigningKey, ASSERTION_METHOD_KEY_TYPE, ED25519_PUB_CODEC, EDDSA_SIG_CODEC,
KEY_AGREEMENT_KEY_TYPE, X25519_PUB_CODEC,
};
pub use msg::{
Envelope, Headers, Message, ReplayGuard, DEFAULT_MAX_CLOCK_SKEW_SECS, DEFAULT_MESSAGE_TTL_SECS,
DEFAULT_REPLAY_WINDOW_SECS, MESSAGE_PREFIX,
};
#[cfg(feature = "acl")]
pub use acl::Acl;
pub use service::{
Service, BROADCAST_TOPIC, CONTENT_TYPE_BROADCAST, CONTENT_TYPE_DOC, CONTENT_TYPE_IPFS_REQUEST,
CONTENT_TYPE_MESSAGE, INBOX_PROTOCOL_ID, IPFS_PROTOCOL_ID, RPC_PROTOCOL_ID,
};
pub use inbox::Inbox;
pub use topic::{topic_id, Topic, TopicId};
pub use endpoint::{MaEndpoint, DEFAULT_DELIVERY_PROTOCOL_ID};
#[cfg(feature = "iroh")]
pub use outbox::Outbox;
#[cfg(feature = "iroh")]
pub async fn new_ma_endpoint(secret_bytes: [u8; 32]) -> Result<Box<dyn MaEndpoint>> {
let endpoint = iroh::new_endpoint(secret_bytes).await?;
Ok(Box::new(endpoint))
}
pub use transport::{
endpoint_id_from_transport, endpoint_id_from_transport_value, normalize_endpoint_id,
protocol_from_transport, resolve_endpoint_for_protocol, resolve_inbox_endpoint_id,
transport_string,
};
pub use identity::{generate_secret_key_file, load_secret_key_bytes, socket_addr_to_multiaddr};
#[cfg(all(feature = "config", not(target_arch = "wasm32")))]
pub use config::MaArgs;
#[cfg(feature = "config")]
pub use config::{BrowserIdentityExport, Config, SecretBundle};
pub use ipfs::gateway_resolver::{DidDocumentResolver, IpfsGatewayResolver};
pub use interfaces::{DidPublisher, IpfsPublisher};
pub use ipfs::*;