soroban_cli/commands/fees/
mod.rs

1use crate::commands::global;
2use clap::Subcommand;
3
4mod default;
5mod stats;
6mod unset;
7
8#[derive(Debug, Subcommand)]
9pub enum Cmd {
10    /// Fetch the feestats from the network
11    Stats(stats::Cmd),
12    /// Set the default inclusion fee settings for the CLI
13    #[command(name = "use")]
14    Default(default::Cmd),
15    /// Remove the default inclusion fee settings for the CLI
16    #[command(name = "unset")]
17    Unset(unset::Cmd),
18}
19
20#[derive(thiserror::Error, Debug)]
21pub enum Error {
22    #[error(transparent)]
23    Stats(#[from] stats::Error),
24    #[error(transparent)]
25    Default(#[from] default::Error),
26    #[error(transparent)]
27    Unset(#[from] unset::Error),
28}
29
30impl Cmd {
31    pub async fn run(&self, global_args: &global::Args) -> Result<(), Error> {
32        match &self {
33            Cmd::Stats(cmd) => cmd.run(global_args).await?,
34            Cmd::Default(cmd) => cmd.run(global_args).await?,
35            Cmd::Unset(cmd) => cmd.run(global_args)?,
36        }
37        Ok(())
38    }
39}