use self::trade::GateioFuturesTrades;
use super::Gateio;
use crate::{
exchange::{ExchangeId, ExchangeServer, StreamSelector},
subscription::trade::PublicTrades,
transformer::stateless::StatelessTransformer,
ExchangeWsStream,
};
pub mod trade;
pub const WEBSOCKET_BASE_URL_GATEIO_PERPETUALS_USD: &str = "wss://fx-ws.gateio.ws/v4/ws/usdt";
pub type GateioPerpetualsUsd = Gateio<GateioServerPerpetualsUsd>;
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
pub struct GateioServerPerpetualsUsd;
impl ExchangeServer for GateioServerPerpetualsUsd {
const ID: ExchangeId = ExchangeId::GateioPerpetualsUsd;
fn websocket_url() -> &'static str {
WEBSOCKET_BASE_URL_GATEIO_PERPETUALS_USD
}
}
impl StreamSelector<PublicTrades> for GateioPerpetualsUsd {
type Stream = ExchangeWsStream<StatelessTransformer<Self, PublicTrades, GateioFuturesTrades>>;
}
pub const WEBSOCKET_BASE_URL_GATEIO_PERPETUALS_BTC: &str = "wss://fx-ws.gateio.ws/v4/ws/btc";
pub type GateioPerpetualsBtc = Gateio<GateioServerPerpetualsBtc>;
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
pub struct GateioServerPerpetualsBtc;
impl ExchangeServer for GateioServerPerpetualsBtc {
const ID: ExchangeId = ExchangeId::GateioPerpetualsBtc;
fn websocket_url() -> &'static str {
WEBSOCKET_BASE_URL_GATEIO_PERPETUALS_BTC
}
}
impl StreamSelector<PublicTrades> for GateioPerpetualsBtc {
type Stream = ExchangeWsStream<StatelessTransformer<Self, PublicTrades, GateioFuturesTrades>>;
}