Skip to content

Commit

Permalink
feat: transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfire2103 committed Feb 1, 2025
1 parent 1278023 commit 031ecef
Show file tree
Hide file tree
Showing 5 changed files with 316 additions and 15 deletions.
125 changes: 125 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ edition = "2021"
anyhow = "1.0.95"
clap = { version = "4", features = ["derive", "env"] }
reqwest = { version = "0.12.12", features = ["json"] }
hex = "0.4.3"
secp256k1 = "0.30.0"
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.138"
tokio = { version = "1.43.0", features = ["full"] }
32 changes: 21 additions & 11 deletions src/args.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use clap::{Parser, Subcommand, ValueHint};

use crate::wallet::WalletsSubcommands;
use crate::infos::InfosSubcommands;
use crate::events::EventsSubcommands;
use crate::infos::InfosSubcommands;
use crate::transactions::TransactionsSubcommands;
use crate::wallet::WalletsSubcommands;

#[derive(Parser)]
#[command(version)]
Expand All @@ -17,22 +18,31 @@ pub struct Kermit {

#[derive(Subcommand)]
pub enum KermitSubcommand {
/// Wallet management utilities.
#[command(visible_alias = "w")]
Wallets {
/// Event for contract, block and hash.
#[command(visible_alias = "e")]
Events {
#[command(subcommand)]
command: WalletsSubcommands,
command: EventsSubcommands,
},

/// Infos about node and hashrate.
#[command(visible_alias = "i")]
Infos {
#[command(subcommand)]
command: InfosSubcommands,
},
/// Event for contract, block and hash.
#[command(visible_alias = "e")]
Events {

/// Transactions management utilities
#[command(visible_alias = "tx")]
Transactions {
#[command(subcommand)]
command: EventsSubcommands,
}
command: TransactionsSubcommands,
},

/// Wallet management utilities.
#[command(visible_alias = "w")]
Wallets {
#[command(subcommand)]
command: WalletsSubcommands,
},
}
10 changes: 6 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
mod args;
mod events;
mod infos;
mod transactions;
mod utils;
mod wallet;
mod infos;
mod events;

use anyhow::Result;
use args::{Kermit, KermitSubcommand};
Expand All @@ -20,9 +21,10 @@ async fn run() -> Result<()> {
let kermit = Kermit::parse();

match kermit.cmd {
KermitSubcommand::Wallets { command } => command.run(&kermit.url).await?,
KermitSubcommand::Infos { command } => command.run(&kermit.url).await?,
KermitSubcommand::Events { command } => command.run(&kermit.url).await?,
KermitSubcommand::Infos { command } => command.run(&kermit.url).await?,
KermitSubcommand::Transactions { command } => command.run(&kermit.url).await?,
KermitSubcommand::Wallets { command } => command.run(&kermit.url).await?,
}

Ok(())
Expand Down
Loading

0 comments on commit 031ecef

Please sign in to comment.