tensor_eigen/args/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
use std::path::PathBuf;

mod derive;
mod eigen;
mod fees;
mod pool;
mod whitelist;

pub use derive::*;
pub use eigen::*;
pub use fees::*;
pub use pool::*;
pub use whitelist::*;

use clap::{Args as ClapArgs, Parser, Subcommand};
use solana_sdk::pubkey::Pubkey;

#[derive(Parser)]
#[clap(author, version, about)]
pub struct Args {
    #[clap(subcommand)]
    pub command: Commands,
}

#[derive(Subcommand)]
pub enum Commands {
    Decode(DecodeArgs),

    #[clap(subcommand)]
    Derive(DeriveSubcommands),

    Download(DownloadArgs),

    Error(ErrorArgs),

    #[clap(subcommand)]
    Fees(FeesSubcommands),

    #[clap(subcommand)]
    Pool(PoolSubcommands),

    #[clap(subcommand, name = "self")]
    Eigen(EigenSubcommands),

    #[clap(subcommand)]
    Whitelist(WhitelistSubcommands),
}

// Global options for read commands
#[derive(ClapArgs)]
pub struct ReadOptions {
    /// RPC URL for the Solana cluster.
    #[arg(short, long)]
    pub rpc_url: Option<String>,
}

// Global options for write commands
#[derive(ClapArgs)]
pub struct WriteOptions {
    /// Path to the keypair file.
    #[arg(short, long)]
    pub keypair_path: Option<PathBuf>,

    /// RPC URL for the Solana cluster.
    #[arg(short, long)]
    pub rpc_url: Option<String>,
}

#[derive(ClapArgs)]
pub struct DecodeArgs {
    #[command(flatten)]
    pub read_options: ReadOptions,

    /// Address to decode.
    pub address: Pubkey,

    /// Print raw bytes.
    #[arg(long)]
    pub raw: bool,
}

#[derive(ClapArgs)]
pub struct DownloadArgs {
    #[clap(flatten)]
    pub read_options: ReadOptions,

    /// Address to download.
    pub address: Pubkey,

    /// Output directory.
    pub output_dir: Option<PathBuf>,
}

#[derive(ClapArgs)]
pub struct ErrorArgs {
    /// Error code.
    pub error_code: String,
}