spark_rust/wallet/config/
mod.rs

1use std::sync::Arc;
2
3// crate
4use crate::error::SparkSdkError;
5use crate::SparkNetwork;
6
7// from self
8pub(crate) mod spark;
9use spark::SparkConfig;
10
11/// Wallet configuration
12#[derive(Clone)]
13pub(crate) struct WalletConfig {
14    /// Spark configuration
15    pub(crate) spark_config: Arc<SparkConfig>,
16}
17
18impl WalletConfig {
19    pub(crate) async fn new(spark_network: SparkNetwork) -> Result<Self, SparkSdkError> {
20        let spark_config = SparkConfig::new(spark_network).await?;
21
22        Ok(Self {
23            spark_config: Arc::new(spark_config),
24        })
25    }
26}