openlimits_nash/
nash_parameters.rs

1use tokio::time::Duration;
2pub use nash_native_client::Client;
3use super::NashCredentials;
4use openlimits_exchange::exchange::Environment;
5
6/// This struct represents the parameters
7#[derive(Clone)]
8pub struct NashParameters {
9    pub affiliate_code: Option<String>,
10    pub credentials: Option<NashCredentials>,
11    pub client_id: u64,
12    pub environment: Environment,
13    pub timeout: Duration,
14    pub sign_states_loop_interval: Option<Duration>,
15}
16
17impl NashParameters {
18    pub fn production() -> Self {
19        Self {
20            affiliate_code: None,
21            credentials: None,
22            client_id: 1,
23            environment: Environment::Production,
24            timeout: Duration::new(10, 0),
25            sign_states_loop_interval: None
26        }
27    }
28
29    pub fn sandbox() -> Self {
30        Self {
31            affiliate_code: None,
32            credentials: None,
33            client_id: 1,
34            environment: Environment::Sandbox,
35            timeout: Duration::new(10, 0),
36            sign_states_loop_interval: None
37        }
38    }
39}