Skip to content

Commit 063b641

Browse files
committed
update config
1 parent 3f69340 commit 063b641

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[kraken]
22
trading_pair = "XBTUSD"
33
endpoint = "https://api.kraken.com/0/public/Depth"
4+
5+
[huobi]
6+
trading_pair = "btcusdt"
7+
endpoint = "https://api.huobi.pro/market/depth"

src/config.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@ use config::{Config, ConfigError, Environment, File};
33
use serde::Deserialize;
44

55
#[derive(Debug, Deserialize)]
6-
pub struct AppConfig {
7-
pub kraken: KrakenConfig,
8-
// Additional exchange configurations can be added here.
6+
pub struct KrakenConfig {
7+
pub trading_pair: String,
8+
pub endpoint: String,
99
}
1010

1111
#[derive(Debug, Deserialize)]
12-
pub struct KrakenConfig {
12+
pub struct HuobiConfig {
1313
pub trading_pair: String,
1414
pub endpoint: String,
1515
}
1616

17+
#[derive(Debug, Deserialize)]
18+
pub struct AppConfig {
19+
pub kraken: KrakenConfig,
20+
pub huobi: HuobiConfig,
21+
}
22+
1723
/// Loads configuration from a file (e.g., config.toml) and environment variables.
1824
pub fn load_config() -> Result<AppConfig, ConfigError> {
1925
let config = Config::builder()

0 commit comments

Comments
 (0)