diff --git a/swap/src/cli.rs b/swap/src/cli.rs index bc068ac4..e590b387 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -56,6 +56,10 @@ pub enum Command { #[structopt(flatten)] config: Config, }, + Balance { + #[structopt(flatten)] + config: Config, + }, } #[derive(structopt::StructOpt, Debug)] diff --git a/swap/src/main.rs b/swap/src/main.rs index 01579a94..c912c7ac 100644 --- a/swap/src/main.rs +++ b/swap/src/main.rs @@ -343,6 +343,18 @@ async fn main() -> Result<()> { let address = bitcoin_wallet.new_address().await?; info!("Deposit bitcoin here: {}", address); } + Command::Balance { config } => { + let (bitcoin_wallet, _) = init_wallets( + config.path, + bitcoin_network, + &wallet_data_dir, + monero_network, + seed, + ) + .await?; + let balance = bitcoin_wallet.balance().await?; + info!("Bitcoin wallet balance: {}", balance.as_btc()); + } }; Ok(())