use crate::{
error::DataError,
event::MarketEvent,
subscription::{Map, SubscriptionKind},
};
use async_trait::async_trait;
use barter_integration::{Transformer, protocol::websocket::WsMessage};
use tokio::sync::mpsc;
pub mod stateless;
#[async_trait]
pub trait ExchangeTransformer<Exchange, InstrumentKey, Kind>
where
Self: Transformer<Output = MarketEvent<InstrumentKey, Kind::Event>, Error = DataError> + Sized,
Kind: SubscriptionKind,
{
async fn init(
instrument_map: Map<InstrumentKey>,
initial_snapshots: &[MarketEvent<InstrumentKey, Kind::Event>],
ws_sink_tx: mpsc::UnboundedSender<WsMessage>,
) -> Result<Self, DataError>;
}