webull_rs/
config.rs

1use std::time::Duration;
2
3/// Configuration for the Webull API client.
4#[derive(Debug, Clone)]
5pub struct WebullConfig {
6    /// API key for authentication
7    pub api_key: Option<String>,
8
9    /// API secret for authentication
10    pub api_secret: Option<String>,
11
12    /// Device ID for authentication
13    pub device_id: Option<String>,
14
15    /// Timeout for API requests
16    pub timeout: Duration,
17
18    /// Base URL for API requests
19    pub base_url: String,
20
21    /// Whether to use paper trading
22    pub paper_trading: bool,
23}
24
25impl Default for WebullConfig {
26    fn default() -> Self {
27        Self {
28            api_key: None,
29            api_secret: None,
30            device_id: None,
31            timeout: Duration::from_secs(30),
32            base_url: "https://api.webull.com".to_string(),
33            paper_trading: false,
34        }
35    }
36}
37
38impl WebullConfig {
39    /// Create a new configuration with default values.
40    pub fn new() -> Self {
41        Self::default()
42    }
43}