1use newton_prover_core::config::{key::EcdsaKey, ConfigLoader};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
6pub struct NewtonCliConfig {
7 pub eth_rpc_url: String,
9 pub gateway_url: String,
11 pub signer: EcdsaKey,
13}
14
15impl ConfigLoader for NewtonCliConfig {
17 const FILE_NAME: &'static str = "newton-cli";
18 const ENV_PREFIX: &'static str = "NEWTON_CLI";
19}
20
21impl NewtonCliConfig {
22 pub fn set_eth_rpc_url(&mut self, eth_rpc_url: String) {
24 self.eth_rpc_url = eth_rpc_url;
25 }
26
27 pub fn set_gateway_url(&mut self, gateway_url: String) {
29 self.gateway_url = gateway_url;
30 }
31
32 pub fn set_signer(&mut self, signer: EcdsaKey) {
34 self.signer = signer;
35 }
36}