use async_trait::async_trait;
use nautilus_model::identifiers::{ClientId, Venue};
use super::log_not_implemented;
use crate::messages::data::{
RequestBars, RequestBookDepth, RequestBookSnapshot, RequestCustomData, RequestForwardPrices,
RequestFundingRates, RequestInstrument, RequestInstruments, RequestQuotes, RequestTrades,
SubscribeBars, SubscribeBookDeltas, SubscribeBookDepth10, SubscribeCustomData,
SubscribeFundingRates, SubscribeIndexPrices, SubscribeInstrument, SubscribeInstrumentClose,
SubscribeInstrumentStatus, SubscribeInstruments, SubscribeMarkPrices, SubscribeOptionGreeks,
SubscribeQuotes, SubscribeTrades, UnsubscribeBars, UnsubscribeBookDeltas,
UnsubscribeBookDepth10, UnsubscribeCustomData, UnsubscribeFundingRates, UnsubscribeIndexPrices,
UnsubscribeInstrument, UnsubscribeInstrumentClose, UnsubscribeInstrumentStatus,
UnsubscribeInstruments, UnsubscribeMarkPrices, UnsubscribeOptionGreeks, UnsubscribeQuotes,
UnsubscribeTrades,
};
#[cfg(feature = "defi")]
use crate::messages::defi::{
RequestPoolSnapshot, SubscribeBlocks, SubscribePool, SubscribePoolFeeCollects,
SubscribePoolFlashEvents, SubscribePoolLiquidityUpdates, SubscribePoolSwaps, UnsubscribeBlocks,
UnsubscribePool, UnsubscribePoolFeeCollects, UnsubscribePoolFlashEvents,
UnsubscribePoolLiquidityUpdates, UnsubscribePoolSwaps,
};
#[async_trait(?Send)]
pub trait DataClient {
fn client_id(&self) -> ClientId;
fn venue(&self) -> Option<Venue>;
fn start(&mut self) -> anyhow::Result<()>;
fn stop(&mut self) -> anyhow::Result<()>;
fn reset(&mut self) -> anyhow::Result<()>;
fn dispose(&mut self) -> anyhow::Result<()>;
fn is_connected(&self) -> bool;
fn is_disconnected(&self) -> bool;
async fn connect(&mut self) -> anyhow::Result<()> {
Ok(())
}
async fn disconnect(&mut self) -> anyhow::Result<()> {
Ok(())
}
fn subscribe(&mut self, cmd: SubscribeCustomData) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_instruments(&mut self, cmd: SubscribeInstruments) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_instrument(&mut self, cmd: SubscribeInstrument) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_book_deltas(&mut self, cmd: SubscribeBookDeltas) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_book_depth10(&mut self, cmd: SubscribeBookDepth10) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_quotes(&mut self, cmd: SubscribeQuotes) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_trades(&mut self, cmd: SubscribeTrades) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_mark_prices(&mut self, cmd: SubscribeMarkPrices) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_index_prices(&mut self, cmd: SubscribeIndexPrices) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_funding_rates(&mut self, cmd: SubscribeFundingRates) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_bars(&mut self, cmd: SubscribeBars) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_instrument_status(
&mut self,
cmd: SubscribeInstrumentStatus,
) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_instrument_close(&mut self, cmd: SubscribeInstrumentClose) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn subscribe_option_greeks(&mut self, cmd: SubscribeOptionGreeks) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn subscribe_blocks(&mut self, cmd: SubscribeBlocks) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn subscribe_pool(&mut self, cmd: SubscribePool) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn subscribe_pool_swaps(&mut self, cmd: SubscribePoolSwaps) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn subscribe_pool_liquidity_updates(
&mut self,
cmd: SubscribePoolLiquidityUpdates,
) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn subscribe_pool_fee_collects(&mut self, cmd: SubscribePoolFeeCollects) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn subscribe_pool_flash_events(&mut self, cmd: SubscribePoolFlashEvents) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe(&mut self, cmd: &UnsubscribeCustomData) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_instruments(&mut self, cmd: &UnsubscribeInstruments) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_instrument(&mut self, cmd: &UnsubscribeInstrument) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_book_deltas(&mut self, cmd: &UnsubscribeBookDeltas) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_book_depth10(&mut self, cmd: &UnsubscribeBookDepth10) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_quotes(&mut self, cmd: &UnsubscribeQuotes) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_trades(&mut self, cmd: &UnsubscribeTrades) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_mark_prices(&mut self, cmd: &UnsubscribeMarkPrices) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_index_prices(&mut self, cmd: &UnsubscribeIndexPrices) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_funding_rates(&mut self, cmd: &UnsubscribeFundingRates) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_bars(&mut self, cmd: &UnsubscribeBars) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_instrument_status(
&mut self,
cmd: &UnsubscribeInstrumentStatus,
) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_instrument_close(
&mut self,
cmd: &UnsubscribeInstrumentClose,
) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn unsubscribe_option_greeks(&mut self, cmd: &UnsubscribeOptionGreeks) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn unsubscribe_blocks(&mut self, cmd: &UnsubscribeBlocks) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn unsubscribe_pool(&mut self, cmd: &UnsubscribePool) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn unsubscribe_pool_swaps(&mut self, cmd: &UnsubscribePoolSwaps) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn unsubscribe_pool_liquidity_updates(
&mut self,
cmd: &UnsubscribePoolLiquidityUpdates,
) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn unsubscribe_pool_fee_collects(
&mut self,
cmd: &UnsubscribePoolFeeCollects,
) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
#[cfg(feature = "defi")]
fn unsubscribe_pool_flash_events(
&mut self,
cmd: &UnsubscribePoolFlashEvents,
) -> anyhow::Result<()> {
log_not_implemented(&cmd);
Ok(())
}
fn request_data(&self, request: RequestCustomData) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
fn request_instruments(&self, request: RequestInstruments) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
fn request_instrument(&self, request: RequestInstrument) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
fn request_book_snapshot(&self, request: RequestBookSnapshot) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
fn request_quotes(&self, request: RequestQuotes) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
fn request_trades(&self, request: RequestTrades) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
fn request_funding_rates(&self, request: RequestFundingRates) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
fn request_forward_prices(&self, request: RequestForwardPrices) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
fn request_bars(&self, request: RequestBars) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
fn request_book_depth(&self, request: RequestBookDepth) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
#[cfg(feature = "defi")]
fn request_pool_snapshot(&self, request: RequestPoolSnapshot) -> anyhow::Result<()> {
log_not_implemented(&request);
Ok(())
}
}