nautilus_binance/spot/websocket/
client.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2025 Nautech Systems Pty Ltd. All rights reserved.
3//  https://nautechsystems.io
4//
5//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6//  You may not use this file except in compliance with the License.
7//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9//  Unless required by applicable law or agreed to in writing, software
10//  distributed under the License is distributed on an "AS IS" BASIS,
11//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//  See the License for the specific language governing permissions and
13//  limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16//! Binance Spot WebSocket client for SBE market data streams.
17//!
18//! ## Connection Details
19//!
20//! - Endpoint: `stream-sbe.binance.com` or `stream-sbe.binance.com:9443`
21//! - Authentication: Ed25519 API key in `X-MBX-APIKEY` header
22//! - Max streams: 1024 per connection
23//! - Connection validity: 24 hours
24//! - Ping/pong: Every 20 seconds
25
26/// SBE stream endpoint.
27pub const SBE_STREAM_URL: &str = "wss://stream-sbe.binance.com";
28
29/// Binance Spot WebSocket client for SBE market data streams.
30#[derive(Debug)]
31pub struct BinanceSpotWebSocketClient {
32    // TODO: Add fields
33    // - ws_client: WebSocketClient
34    // - subscriptions: AHashMap<String, Subscription>
35    // - handler: BinanceSpotWebSocketHandler
36    _private: (),
37}
38
39impl BinanceSpotWebSocketClient {
40    /// Create a new Binance Spot WebSocket client.
41    #[must_use]
42    pub fn new() -> Self {
43        Self { _private: () }
44    }
45}
46
47impl Default for BinanceSpotWebSocketClient {
48    fn default() -> Self {
49        Self::new()
50    }
51}