1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
use self::trade::GateioFuturesTrades;
use super::Gateio;
use crate::{
exchange::{ExchangeId, ExchangeServer, StreamSelector},
subscription::trade::PublicTrades,
transformer::stateless::StatelessTransformer,
ExchangeWsStream,
};
use serde::{Deserialize, Serialize};
pub mod trade;
pub const WEBSOCKET_BASE_URL_GATEIO_FUTURES_USD: &str = "wss://fx-ws.gateio.ws/v4/ws/usdt";
pub type GateioFuturesUsd = Gateio<GateioServerFuturesUsd>;
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
pub struct GateioServerFuturesUsd;
impl ExchangeServer for GateioServerFuturesUsd {
const ID: ExchangeId = ExchangeId::GateioFuturesUsd;
fn websocket_url() -> &'static str {
WEBSOCKET_BASE_URL_GATEIO_FUTURES_USD
}
}
impl StreamSelector<PublicTrades> for GateioFuturesUsd {
type Stream = ExchangeWsStream<StatelessTransformer<Self, PublicTrades, GateioFuturesTrades>>;
}
pub const WEBSOCKET_BASE_URL_GATEIO_FUTURES_BTC: &str = "wss://fx-ws.gateio.ws/v4/ws/btc";
pub type GateioFuturesBtc = Gateio<GateioServerFuturesBtc>;
#[derive(
Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default, Deserialize, Serialize,
)]
pub struct GateioServerFuturesBtc;
impl ExchangeServer for GateioServerFuturesBtc {
const ID: ExchangeId = ExchangeId::GateioFuturesBtc;
fn websocket_url() -> &'static str {
WEBSOCKET_BASE_URL_GATEIO_FUTURES_BTC
}
}
impl StreamSelector<PublicTrades> for GateioFuturesBtc {
type Stream = ExchangeWsStream<StatelessTransformer<Self, PublicTrades, GateioFuturesTrades>>;
}