mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-05 21:14:32 -04:00
Add command to display bitcoin wallet balance
This commit is contained in:
parent
7e10c5e7c3
commit
eb310be2c0
2 changed files with 16 additions and 0 deletions
|
@ -56,6 +56,10 @@ pub enum Command {
|
|||
#[structopt(flatten)]
|
||||
config: Config,
|
||||
},
|
||||
Balance {
|
||||
#[structopt(flatten)]
|
||||
config: Config,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(structopt::StructOpt, Debug)]
|
||||
|
|
|
@ -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(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue