Skip to main content

hopr_ticket_manager/
lib.rs

1//! Implements complete logic of ticket management in the HOPR protocol.
2//!
3//! There are two major parts in the architecture of the ticket management:
4//! - [`HoprTicketManager`] is responsible for managing the incoming ticket queues and ticket redemption.
5//! - [`HoprTicketFactory`] is responsible for managing outgoing ticket indices and creating outgoing tickets.
6//!
7//! Usually, they are created together via [`HoprTicketManager::new_with_factory`].
8//!
9//! See the [`HoprTicketManager`] and [`HoprTicketFactory`] documentation for complete details.
10
11mod backend;
12#[cfg(feature = "redb")]
13mod chain_sync;
14mod errors;
15mod factory;
16mod manager;
17mod traits;
18mod utils;
19
20pub use crate::{
21    backend::{MemoryStore, MemoryTicketQueue},
22    errors::TicketManagerError,
23    factory::HoprTicketFactory,
24    manager::HoprTicketManager,
25    traits::{OutgoingIndexStore, TicketQueue, TicketQueueStore},
26};
27#[cfg(feature = "redb")]
28pub use crate::{
29    backend::{RedbStore, RedbTicketQueue},
30    chain_sync::{ticket_factory_from_chain, ticket_manager_from_chain},
31};