mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-23 15:44:50 +01:00
feat: cdk-cli
This commit is contained in:
23
crates/cdk-cli/src/sub_commands/mint_info.rs
Normal file
23
crates/cdk-cli/src/sub_commands/mint_info.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use anyhow::Result;
|
||||
use cdk::url::UncheckedUrl;
|
||||
use cdk::HttpClient;
|
||||
use clap::Args;
|
||||
|
||||
#[derive(Args)]
|
||||
pub struct MintInfoSubcommand {
|
||||
/// Cashu Token
|
||||
#[arg(short, long)]
|
||||
mint_url: UncheckedUrl,
|
||||
}
|
||||
|
||||
pub async fn mint_info(sub_command_args: &MintInfoSubcommand) -> Result<()> {
|
||||
let client = HttpClient::default();
|
||||
|
||||
let info = client
|
||||
.get_mint_info(sub_command_args.mint_url.clone().try_into()?)
|
||||
.await?;
|
||||
|
||||
println!("{:#?}", info);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user