Files
cdk/crates/cdk-cli/src/sub_commands/decode_token.rs
thesimplekid 5ebdd4f506 feat: cdk-cli
2024-06-09 00:04:20 +01:00

19 lines
387 B
Rust

use std::str::FromStr;
use anyhow::Result;
use cdk::nuts::Token;
use clap::Args;
#[derive(Args)]
pub struct DecodeTokenSubCommand {
/// Cashu Token
token: String,
}
pub fn decode_token(sub_command_args: &DecodeTokenSubCommand) -> Result<()> {
let token = Token::from_str(&sub_command_args.token)?;
println!("{:}", serde_json::to_string_pretty(&token)?);
Ok(())
}