//! DM chat session management for Polkadot Host products — iOS v2 interop.
//!
//! This crate provides the shared session management layer for the chat-v1
//! DM protocol between a Polkadot Host product and iOS v2.
//!
//! ## Architecture
//!
//! ```text
//! chat-v1 (pure protocol)  →  host-chat-v1 (session management)  →  host adapters
//! ```
//!
//! All I/O (transport, storage, key resolution, event delivery) is injected via
//! the traits in [`traits`]. The crate has **no direct I/O dependencies**.
//!
//! ## Usage
//!
//! 1. Implement [`traits::ChatTransport`], [`traits::ChatKeyResolver`], and
//!    [`traits::ChatEventSink`] for your platform.
//! 2. Obtain the local chat identity from `host-wallet` via `chat_material()`.
//! 3. Construct a [`manager::ChatManager`] with the local identity and adapters.
//! 4. Call `open_conversation` before sending messages to a peer.
//! 5. Route raw inbound statements through `handle_incoming_statement`.

pub mod crypto;
pub mod error;
pub mod events;
pub mod manager;
pub mod session;
pub mod traits;

#[cfg(feature = "chain-subscription")]
pub mod subscription_handler;

pub use error::ChatV1Error;
pub use events::{
    ChatMessageEvent, ChatRequestEvent, ContentType, DeliveryStatus, DeliveryStatusEvent,
};
pub use manager::ChatManager;
pub use session::{ConversationState, PeerSession};
pub use traits::{ChatEventSink, ChatKeyResolver, ChatTransport, StatementCallback};
