Skip to main content

bulk_client/api/parts/
config.rs

1use std::time::Duration;
2use crate::transaction::TransactionSigner;
3
4/// Bulk Websocket API configuration
5#[derive(Debug, Clone)]
6pub struct WSConfig {
7    pub url: String,
8    pub symbols: Vec<String>,
9    pub signer: Option<TransactionSigner>,
10    pub default_timeout: Duration,
11    pub track_account: bool,
12    pub track_ticker: bool,
13}
14
15/// Bulk HTTP API configuration
16#[derive(Debug, Clone)]
17pub struct HttpConfig {
18    pub base_url: String,
19    pub signer: Option<TransactionSigner>,
20    pub default_timeout: Duration,
21}
22
23impl Default for WSConfig {
24    fn default() -> Self {
25        Self {
26            url: "wss://exchange-wss.bulk.trade".into(),
27            symbols: vec!["BTC-USD".into(), "ETH-USD".into(), "SOL-USD".into()],
28            signer: None,
29            default_timeout: Duration::from_secs(10),
30            track_ticker: true,
31            track_account: true,
32        }
33    }
34}
35
36impl Default for HttpConfig {
37    fn default() -> Self {
38        Self {
39            base_url: "https://exchange-api2.bulk.trade/api/v1".into(),
40            signer: None,
41            default_timeout: Duration::from_secs(10),
42        }
43    }
44}