Skip to main content

openlimits_binance/
binance_parameters.rs

1use super::BinanceCredentials;
2use openlimits_exchange::exchange::Environment;
3
4/// This struct represents the type of environment that will be used and receives a boolean and the credentials as parameters.
5#[derive(Default, Clone, Debug)]
6pub struct BinanceParameters {
7    pub environment: Environment,
8    pub credentials: Option<BinanceCredentials>,
9}
10
11impl BinanceParameters {
12    /// Sandbox environment
13    pub fn sandbox() -> Self {
14        Self {
15            environment: Environment::Sandbox,
16            ..Default::default()
17        }
18    }
19
20    /// Production environment
21    pub fn production() -> Self {
22        Self {
23            environment: Environment::Production,
24            ..Default::default()
25        }
26    }
27}