From 392a8d2a26199a6ba5e19866b39e17cb69e0e2ef Mon Sep 17 00:00:00 2001 From: raphjaph Date: Fri, 16 Aug 2024 13:57:25 +0200 Subject: [PATCH] List all Bitcoin Core wallets --- src/subcommand.rs | 4 ++++ src/subcommand/wallets.rs | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 src/subcommand/wallets.rs diff --git a/src/subcommand.rs b/src/subcommand.rs index fd90a9fd0d..3b4a9b1a31 100644 --- a/src/subcommand.rs +++ b/src/subcommand.rs @@ -16,6 +16,7 @@ pub mod supply; pub mod teleburn; pub mod traits; pub mod wallet; +pub mod wallets; #[derive(Debug, Parser)] pub(crate) enum Subcommand { @@ -51,6 +52,8 @@ pub(crate) enum Subcommand { Traits(traits::Traits), #[command(about = "Wallet commands")] Wallet(wallet::WalletCommand), + #[command(about = "List all Bitcoin Core wallets")] + Wallets, } impl Subcommand { @@ -77,6 +80,7 @@ impl Subcommand { Self::Teleburn(teleburn) => teleburn.run(), Self::Traits(traits) => traits.run(), Self::Wallet(wallet) => wallet.run(settings), + Self::Wallets => wallets::run(settings), } } } diff --git a/src/subcommand/wallets.rs b/src/subcommand/wallets.rs new file mode 100644 index 0000000000..6c942b8201 --- /dev/null +++ b/src/subcommand/wallets.rs @@ -0,0 +1,7 @@ +use super::*; + +pub(crate) fn run(settings: Settings) -> SubcommandResult { + Ok(Some(Box::new( + settings.bitcoin_rpc_client(None)?.list_wallet_dir()?, + ))) +}