From 7e10c5e7c325b0a487ae595b46efc6e71aae402b Mon Sep 17 00:00:00 2001 From: rishflab Date: Tue, 9 Feb 2021 17:32:04 +1100 Subject: [PATCH] Add command to generate bitcoin deposit address --- swap/src/cli.rs | 4 ++++ swap/src/main.rs | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/swap/src/cli.rs b/swap/src/cli.rs index 16f80f2b..bc068ac4 100644 --- a/swap/src/cli.rs +++ b/swap/src/cli.rs @@ -52,6 +52,10 @@ pub enum Command { Resume(Resume), Cancel(Cancel), Refund(Refund), + Deposit { + #[structopt(flatten)] + config: Config, + }, } #[derive(structopt::StructOpt, Debug)] diff --git a/swap/src/main.rs b/swap/src/main.rs index af67dc98..01579a94 100644 --- a/swap/src/main.rs +++ b/swap/src/main.rs @@ -331,6 +331,18 @@ async fn main() -> Result<()> { ) .await??; } + Command::Deposit { config } => { + let (bitcoin_wallet, _) = init_wallets( + config.path, + bitcoin_network, + &wallet_data_dir, + monero_network, + seed, + ) + .await?; + let address = bitcoin_wallet.new_address().await?; + info!("Deposit bitcoin here: {}", address); + } }; Ok(())