Spaces:
Sleeping
Sleeping
| use clap::{Args, Parser, Subcommand, ValueEnum}; | |
| use serde::{Deserialize, Serialize}; | |
| pub enum OutputFormat { | |
| Json, | |
| Table, | |
| Plain, | |
| } | |
| pub enum Network { | |
| Devnet, | |
| Mainnet, | |
| } | |
| pub enum Asset { | |
| Sol, | |
| Usdc, | |
| } | |
| pub struct Cli { | |
| pub format: Option<OutputFormat>, | |
| pub network: Option<Network>, | |
| pub api_key: Option<String>, | |
| pub quiet: bool, | |
| pub idempotency_key: Option<String>, | |
| pub command: Commands, | |
| } | |
| pub enum Commands { | |
| Auth { | |
| command: AuthCommands, | |
| }, | |
| Deposit { | |
| command: DepositCommands, | |
| }, | |
| Card { | |
| command: CardCommands, | |
| }, | |
| Balance, | |
| Config { | |
| command: ConfigCommands, | |
| }, | |
| Debug { | |
| command: DebugCommands, | |
| }, | |
| } | |
| pub enum AuthCommands { | |
| Login(AuthLoginArgs), | |
| Status, | |
| } | |
| pub struct AuthLoginArgs { | |
| pub api_key: Option<String>, | |
| } | |
| pub enum DepositCommands { | |
| Address(DepositAddressArgs), | |
| Status(DepositStatusArgs), | |
| List, | |
| } | |
| pub struct DepositAddressArgs { | |
| pub asset: Asset, | |
| } | |
| pub struct DepositStatusArgs { | |
| pub id: String, | |
| pub wait: bool, | |
| pub timeout: u64, | |
| } | |
| pub enum CardCommands { | |
| Buy(CardBuyArgs), | |
| Show(CardShowArgs), | |
| List, | |
| Freeze(CardFreezeArgs), | |
| } | |
| pub struct CardBuyArgs { | |
| pub amount: String, | |
| } | |
| pub struct CardShowArgs { | |
| pub id: String, | |
| } | |
| pub struct CardFreezeArgs { | |
| pub id: String, | |
| pub confirm: bool, | |
| pub dry_run: bool, | |
| } | |
| pub enum ConfigCommands { | |
| Set(ConfigSetArgs), | |
| } | |
| pub struct ConfigSetArgs { | |
| pub key: String, | |
| pub value: String, | |
| } | |
| pub enum DebugCommands { | |
| ConfirmDeposit(DebugConfirmDepositArgs), | |
| } | |
| pub struct DebugConfirmDepositArgs { | |
| pub id: String, | |
| pub amount_usd: String, | |
| pub amount_native: Option<String>, | |
| } | |