Jelajahi Sumber

feat: pending mints

thesimplekid 10 bulan lalu
induk
melakukan
ea05cc37a3

+ 3 - 0
crates/cdk-cli/src/main.rs

@@ -44,6 +44,8 @@ enum Commands {
     Balance,
     /// Pay bolt11 invoice
     Melt(sub_commands::melt::MeltSubCommand),
+    /// Claim pending mints
+    PendingMint,
     /// Receive token
     Receive(sub_commands::receive::ReceiveSubCommand),
     /// Send
@@ -115,6 +117,7 @@ async fn main() -> Result<()> {
         Commands::Mint(sub_command_args) => {
             sub_commands::mint::mint(wallet, sub_command_args).await
         }
+        Commands::PendingMint => sub_commands::pending_mints::pending_mints(wallet).await,
         Commands::Burn(sub_command_args) => {
             sub_commands::burn::burn(wallet, sub_command_args).await
         }

+ 1 - 0
crates/cdk-cli/src/sub_commands/mod.rs

@@ -5,6 +5,7 @@ pub mod decode_token;
 pub mod melt;
 pub mod mint;
 pub mod mint_info;
+pub mod pending_mints;
 pub mod receive;
 pub mod restore;
 pub mod send;

+ 9 - 0
crates/cdk-cli/src/sub_commands/pending_mints.rs

@@ -0,0 +1,9 @@
+use anyhow::Result;
+use cdk::wallet::Wallet;
+
+pub async fn pending_mints(wallet: Wallet) -> Result<()> {
+    let amount_claimed = wallet.check_all_mint_quotes().await?;
+
+    println!("Amount minted: {amount_claimed}");
+    Ok(())
+}