#[macro_export]
macro_rules! impl_sync_method {
($trait_name:ident, $method:ident, ($($param_name:ident: $param_type:ty),*) -> $ret:ty) => {
fn $method(&self $(, $param_name: $param_type)*) -> $ret {
match self {
Self::Binance(c) => c.$method($($param_name),*),
Self::Bybit(c) => c.$method($($param_name),*),
Self::OKX(c) => c.$method($($param_name),*),
Self::KuCoin(c) => c.$method($($param_name),*),
Self::Kraken(c) => c.$method($($param_name),*),
Self::Coinbase(c) => c.$method($($param_name),*),
Self::GateIO(c) => c.$method($($param_name),*),
Self::Bitfinex(c) => c.$method($($param_name),*),
Self::Bitstamp(c) => c.$method($($param_name),*),
Self::Gemini(c) => c.$method($($param_name),*),
Self::MEXC(c) => c.$method($($param_name),*),
Self::HTX(c) => c.$method($($param_name),*),
Self::Bitget(c) => c.$method($($param_name),*),
Self::BingX(c) => c.$method($($param_name),*),
Self::CryptoCom(c) => c.$method($($param_name),*),
Self::Upbit(c) => c.$method($($param_name),*),
Self::Deribit(c) => c.$method($($param_name),*),
Self::HyperLiquid(c) => c.$method($($param_name),*),
Self::Lighter(c) => c.$method($($param_name),*),
Self::Dydx(c) => c.$method($($param_name),*),
Self::Polygon(c) => c.$method($($param_name),*),
Self::Finnhub(c) => c.$method($($param_name),*),
Self::Tiingo(c) => c.$method($($param_name),*),
Self::Twelvedata(c) => c.$method($($param_name),*),
Self::Alpaca(c) => c.$method($($param_name),*),
Self::AngelOne(c) => c.$method($($param_name),*),
Self::Zerodha(c) => c.$method($($param_name),*),
Self::Upstox(c) => c.$method($($param_name),*),
Self::Dhan(c) => c.$method($($param_name),*),
Self::Fyers(c) => c.$method($($param_name),*),
Self::JQuants(c) => c.$method($($param_name),*),
Self::Krx(c) => c.$method($($param_name),*),
Self::Moex(c) => c.$method($($param_name),*),
Self::Tinkoff(c) => c.$method($($param_name),*),
Self::Oanda(c) => c.$method($($param_name),*),
Self::Dukascopy(c) => c.$method($($param_name),*),
Self::AlphaVantage(c) => c.$method($($param_name),*),
Self::WhaleAlert(c) => c.$method($($param_name),*),
Self::Bitquery(c) => c.$method($($param_name),*),
Self::IB(c) => c.$method($($param_name),*),
Self::YahooFinance(c) => c.$method($($param_name),*),
Self::CryptoCompare(c) => c.$method($($param_name),*),
}
}
};
}
#[macro_export]
macro_rules! impl_async_method {
($trait_name:ident, $method:ident, ($($param_name:ident: $param_type:ty),*) -> $ret:ty) => {
async fn $method(&self $(, $param_name: $param_type)*) -> $ret {
match self {
Self::Binance(c) => c.$method($($param_name),*).await,
Self::Bybit(c) => c.$method($($param_name),*).await,
Self::OKX(c) => c.$method($($param_name),*).await,
Self::KuCoin(c) => c.$method($($param_name),*).await,
Self::Kraken(c) => c.$method($($param_name),*).await,
Self::Coinbase(c) => c.$method($($param_name),*).await,
Self::GateIO(c) => c.$method($($param_name),*).await,
Self::Bitfinex(c) => c.$method($($param_name),*).await,
Self::Bitstamp(c) => c.$method($($param_name),*).await,
Self::Gemini(c) => c.$method($($param_name),*).await,
Self::MEXC(c) => c.$method($($param_name),*).await,
Self::HTX(c) => c.$method($($param_name),*).await,
Self::Bitget(c) => c.$method($($param_name),*).await,
Self::BingX(c) => c.$method($($param_name),*).await,
Self::CryptoCom(c) => c.$method($($param_name),*).await,
Self::Upbit(c) => c.$method($($param_name),*).await,
Self::Deribit(c) => c.$method($($param_name),*).await,
Self::HyperLiquid(c) => c.$method($($param_name),*).await,
Self::Lighter(c) => c.$method($($param_name),*).await,
Self::Dydx(c) => c.$method($($param_name),*).await,
Self::Polygon(c) => c.$method($($param_name),*).await,
Self::Finnhub(c) => c.$method($($param_name),*).await,
Self::Tiingo(c) => c.$method($($param_name),*).await,
Self::Twelvedata(c) => c.$method($($param_name),*).await,
Self::Alpaca(c) => c.$method($($param_name),*).await,
Self::AngelOne(c) => c.$method($($param_name),*).await,
Self::Zerodha(c) => c.$method($($param_name),*).await,
Self::Upstox(c) => c.$method($($param_name),*).await,
Self::Dhan(c) => c.$method($($param_name),*).await,
Self::Fyers(c) => c.$method($($param_name),*).await,
Self::JQuants(c) => c.$method($($param_name),*).await,
Self::Krx(c) => c.$method($($param_name),*).await,
Self::Moex(c) => c.$method($($param_name),*).await,
Self::Tinkoff(c) => c.$method($($param_name),*).await,
Self::Oanda(c) => c.$method($($param_name),*).await,
Self::Dukascopy(c) => c.$method($($param_name),*).await,
Self::AlphaVantage(c) => c.$method($($param_name),*).await,
Self::WhaleAlert(c) => c.$method($($param_name),*).await,
Self::Bitquery(c) => c.$method($($param_name),*).await,
Self::IB(c) => c.$method($($param_name),*).await,
Self::YahooFinance(c) => c.$method($($param_name),*).await,
Self::CryptoCompare(c) => c.$method($($param_name),*).await,
}
}
};
}