network: ctx.network.to_string(),
ext_descriptor: self.wallet_opts.ext_descriptor.clone(),
int_descriptor: self.wallet_opts.int_descriptor.clone(),
-
#[cfg(any(feature = "sqlite", feature = "redb"))]
database_type: match self.wallet_opts.database_type {
#[cfg(feature = "sqlite")]
let psbt = tx_builder.finish()?;
+ // let psbt_base64 = BASE64_STANDARD.encode(psbt.serialize());
+
Ok(PsbtResult::new(&psbt, Some(false)))
}
}
Ok(acc)
})?;
- Ok(PsbtResult::new(&final_psbt, None))
+ Ok(PsbtResult::new(&final_psbt, Some(false)))
}
}
use crate::utils::output::FormatOutput;
use crate::utils::runtime::WalletRuntime;
use crate::utils::{command_requires_db, prepare_home_dir};
-use clap::Parser;
+use clap::{CommandFactory, Parser};
#[tokio::main]
async fn main() {
cmd.execute(&mut ctx)?.write_out(std::io::stdout())?;
}
- CliSubCommand::Completions { shell: _ } => unimplemented!(),
-
+ CliSubCommand::Completions { shell } => {
+ clap_complete::generate(
+ shell,
+ &mut CliOpts::command(),
+ "bdk-cli",
+ &mut std::io::stdout(),
+ );
+ }
#[cfg(feature = "silent-payments")]
CliSubCommand::SilentPaymentCode(cmd) => {
let mut ctx = AppContext::new(cli_opts.network, home_dir);
let sign_json: Value = serde_json::from_slice(&sign_output.stdout).unwrap();
let proof = sign_json["proof"].as_str().unwrap();
- // A tampered message should fail verification gracefully (valid: false)
+ // A tampered message should fail
cli.wallet_cmd(&[
"--wallet",
WALLET_NAME,
pub struct BdkCli {
pub network: String,
pub datadir: Option<PathBuf>,
- pub verbosity: bool,
pub recv_desc: Option<String>,
pub change_desc: Option<String>,
pub server_url: Option<String>,
Self {
network: network.to_string(),
datadir,
- verbosity: false,
recv_desc: None,
change_desc: None,
server_url: None,
cmd.arg("--datadir").arg(dir);
}
- if self.verbosity {
- cmd.arg("--verbose");
- }
-
if let Some(url) = &self.server_url {
cmd.arg("--server").arg(url);
}