diff --git a/crates/cdk-cli/src/main.rs b/crates/cdk-cli/src/main.rs index 76414252..71f34c0d 100644 --- a/crates/cdk-cli/src/main.rs +++ b/crates/cdk-cli/src/main.rs @@ -22,13 +22,13 @@ const DEFAULT_WORK_DIR: &str = ".cdk-cli"; #[derive(Parser)] #[command(name = "cashu-tool")] #[command(author = "thesimplekid ")] -#[command(version = "0.1")] +#[command(version = "0.1.0")] #[command(author, version, about, long_about = None)] struct Cli { /// Database engine to use (sqlite/redb) #[arg(short, long, default_value = "sqlite")] engine: String, - /// Path to Seed + /// Path to working dir #[arg(short, long)] work_dir: Option, #[command(subcommand)] @@ -42,9 +42,9 @@ enum Commands { /// Balance Balance, /// Pay bolt11 invoice - Melt(sub_commands::melt::MeltSubCommand), - /// Claim pending mints - PendingMint, + Pay, + /// Claim pending mint quotes that have been paid + MintPending, /// Receive token Receive(sub_commands::receive::ReceiveSubCommand), /// Send @@ -138,9 +138,7 @@ async fn main() -> Result<()> { sub_commands::decode_token::decode_token(sub_command_args) } Commands::Balance => sub_commands::balance::balance(wallets).await, - Commands::Melt(sub_command_args) => { - sub_commands::melt::melt(wallets, sub_command_args).await - } + Commands::Pay => sub_commands::melt::pay(wallets).await, Commands::Receive(sub_command_args) => { sub_commands::receive::receive( wallets, @@ -166,7 +164,7 @@ async fn main() -> Result<()> { ) .await } - Commands::PendingMint => sub_commands::pending_mints::pending_mints(wallets).await, + Commands::MintPending => sub_commands::pending_mints::mint_pending(wallets).await, Commands::Burn(sub_command_args) => { sub_commands::burn::burn(wallets, sub_command_args).await } diff --git a/crates/cdk-cli/src/sub_commands/melt.rs b/crates/cdk-cli/src/sub_commands/melt.rs index db77e05d..61f48e9b 100644 --- a/crates/cdk-cli/src/sub_commands/melt.rs +++ b/crates/cdk-cli/src/sub_commands/melt.rs @@ -7,17 +7,10 @@ use anyhow::{bail, Result}; use cdk::amount::SplitTarget; use cdk::wallet::Wallet; use cdk::{Bolt11Invoice, UncheckedUrl}; -use clap::Args; use crate::sub_commands::balance::mint_balances; -#[derive(Args)] -pub struct MeltSubCommand {} - -pub async fn melt( - wallets: HashMap, - _sub_command_args: &MeltSubCommand, -) -> Result<()> { +pub async fn pay(wallets: HashMap) -> Result<()> { let mints_amounts = mint_balances(wallets).await?; println!("Enter mint number to melt from"); diff --git a/crates/cdk-cli/src/sub_commands/mint.rs b/crates/cdk-cli/src/sub_commands/mint.rs index df878661..4366155e 100644 --- a/crates/cdk-cli/src/sub_commands/mint.rs +++ b/crates/cdk-cli/src/sub_commands/mint.rs @@ -19,6 +19,7 @@ pub struct MintSubCommand { /// Amount amount: u64, /// Currency unit e.g. sat + #[arg(default_value = "sat")] unit: String, } diff --git a/crates/cdk-cli/src/sub_commands/pending_mints.rs b/crates/cdk-cli/src/sub_commands/pending_mints.rs index d080dd11..d3464de9 100644 --- a/crates/cdk-cli/src/sub_commands/pending_mints.rs +++ b/crates/cdk-cli/src/sub_commands/pending_mints.rs @@ -4,7 +4,7 @@ use anyhow::Result; use cdk::wallet::Wallet; use cdk::{Amount, UncheckedUrl}; -pub async fn pending_mints(wallets: HashMap) -> Result<()> { +pub async fn mint_pending(wallets: HashMap) -> Result<()> { let mut amount_claimed = Amount::ZERO; for wallet in wallets.values() { let claimed = wallet.check_all_mint_quotes().await?;