Skip to content

Commit

Permalink
List all Bitcoin Core wallets (ordinals#3902)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph committed Aug 16, 2024
1 parent 2de128f commit ef2de89
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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),
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/subcommand/wallets.rs
Original file line number Diff line number Diff line change
@@ -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()?,
)))
}

0 comments on commit ef2de89

Please sign in to comment.