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
use self::l2::BinanceSpotBookUpdater;
use super::{Binance, ExchangeServer};
use crate::{
exchange::{ExchangeId, StreamSelector},
subscription::book::OrderBooksL2,
transformer::book::MultiBookTransformer,
ExchangeWsStream,
};
pub mod l2;
pub const WEBSOCKET_BASE_URL_BINANCE_SPOT: &str = "wss://stream.binance.com:9443/ws";
pub type BinanceSpot = Binance<BinanceServerSpot>;
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
pub struct BinanceServerSpot;
impl ExchangeServer for BinanceServerSpot {
const ID: ExchangeId = ExchangeId::BinanceSpot;
fn websocket_url() -> &'static str {
WEBSOCKET_BASE_URL_BINANCE_SPOT
}
}
impl StreamSelector<OrderBooksL2> for BinanceSpot {
type Stream =
ExchangeWsStream<MultiBookTransformer<Self, OrderBooksL2, BinanceSpotBookUpdater>>;
}