#![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;
#[cfg(all(feature = "kubo", not(target_arch = "wasm32")))]
pub use kubo::{cat_bytes, ipfs_add};
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, CODEC_ED25519_PUB, CODEC_EDDSA_SIG,
CODEC_X25519_PUB, KEY_AGREEMENT_KEY_TYPE,
};
pub use msg::{
decode_content, encode_content, Envelope, Headers, Message, ReplayGuard,
DEFAULT_MAX_CLOCK_SKEW_SECS, DEFAULT_MESSAGE_TTL_SECS, DEFAULT_REPLAY_WINDOW_SECS,
MESSAGE_PREFIX,
};
pub use multiformat::{CODEC_DAG_CBOR, CODEC_DAG_JSON, CODEC_IDENTITY, CODEC_RAW};
#[cfg(feature = "acl")]
pub use acl::Acl;
pub use service::{
Service, BROADCAST_TOPIC, CONTENT_TYPE_CBOR, INBOX_PROTOCOL_ID, IPFS_PROTOCOL_ID,
MESSAGE_TYPE_BROADCAST, MESSAGE_TYPE_CHAT, MESSAGE_TYPE_DOC, MESSAGE_TYPE_EMOTE,
MESSAGE_TYPE_IPFS_REQUEST, MESSAGE_TYPE_IPFS_STORE, MESSAGE_TYPE_MESSAGE, MESSAGE_TYPE_RPC,
MESSAGE_TYPE_RPC_REPLY, 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::*;