pub use hopr_types::chain::chain_events::ChainEvent;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum StateSyncOptions {
OpenedChannels,
PublicAccounts,
AllAccounts,
}
#[auto_impl::auto_impl(&, Box, Arc)]
pub trait ChainEvents {
type Error: std::error::Error + Send + Sync;
fn subscribe(&self) -> Result<impl futures::Stream<Item = ChainEvent> + Send + 'static, Self::Error> {
self.subscribe_with_state_sync(None)
}
fn subscribe_with_state_sync<I: IntoIterator<Item = StateSyncOptions>>(
&self,
options: I,
) -> Result<impl futures::Stream<Item = ChainEvent> + Send + 'static, Self::Error>;
}