pub struct Config {
pub chains: ChainsConfig,
pub output: OutputConfig,
pub address_book: AddressBookConfig,
pub monitor: MonitorConfig,
pub ghola: GholaConfig,
pub web: WebConfig,
pub market: MarketConfig,
}Expand description
Application configuration.
Contains all settings for blockchain clients, output formatting,
and address book management. Use Config::load to load from file
or Config::default for sensible defaults.
§Examples
use scope::Config;
// Load from default location or custom path
let config = Config::load(None).unwrap_or_default();
println!("Output format: {:?}", config.output.format);Fields§
§chains: ChainsConfigBlockchain chain client configuration.
output: OutputConfigOutput formatting configuration.
address_book: AddressBookConfigAddress book configuration (label → address mapping storage).
monitor: MonitorConfigMonitor TUI configuration (layout, widgets, refresh rate).
ghola: GholaConfigGhola sidecar configuration for stealth HTTP transport.
web: WebConfigWeb server configuration.
market: MarketConfigMarket analysis configuration (order book health thresholds).
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(path: Option<&Path>) -> Result<Self>
pub fn load(path: Option<&Path>) -> Result<Self>
Loads configuration from a file path or the default location.
§Arguments
path- Optional path to a configuration file. IfNone, looks for config at~/.scope-bca/config.yaml.
§Returns
Returns the loaded configuration, or defaults if no config file exists.
§Errors
Returns ScopeError::Config if the file exists but cannot be read
or contains invalid YAML.
§Examples
use scope::Config;
use std::path::Path;
// Load from default location
let config = Config::load(None).unwrap_or_default();
// Load from custom path
let config = Config::load(Some(Path::new("/custom/config.yaml")));Sourcepub fn default_path() -> PathBuf
pub fn default_path() -> PathBuf
Returns the default configuration file path: <home>/config.yaml
(see crate::paths).
Sourcepub fn config_path() -> Option<PathBuf>
pub fn config_path() -> Option<PathBuf>
Returns the configuration file path that setup and scope web
write: <home>/config.yaml.
Sourcepub fn default_data_dir() -> PathBuf
pub fn default_data_dir() -> PathBuf
Returns the default data directory for address book storage:
<home>/data.