use clap::{Parser, Subcommand};
#[derive(Debug, Clone, Subcommand)]
pub enum CliCommand {
Info,
OfferContract(Offer),
Offers,
AcceptOffer(Accept),
Contracts,
#[clap(subcommand)]
Wallet(WalletCommand),
#[clap(subcommand)]
Oracle(OracleCommand),
Peers,
Connect {
#[arg(help = "The counter party to connect to. <PUBKEY>@<HOST>")]
connect_string: String,
},
}
#[derive(Parser, Clone, Debug)]
pub struct Offer {
#[arg(help = "Path to a contract input file. Eventually to be a repl asking contract params")]
#[arg(short = 'f', long = "file")]
pub contract_input_file: Option<String>,
#[arg(help = "The contract counterparty to send to.")]
pub counter_party: String,
}
#[derive(Clone, Debug, Subcommand)]
pub enum WalletCommand {
#[command(about = "Get the wallet balance.")]
Balance,
#[command(about = "Generate a new, unused address from the wallet.")]
NewAddress,
#[command(about = "Get the wallet transactions.")]
Transactions,
#[command(about = "Get the wallet utxos.")]
Utxos,
#[command(about = "Send a Bitcoin amount to an address")]
Send {
address: String,
amount: u64,
fee_rate: u64,
},
}
#[derive(Clone, Debug, Subcommand)]
pub enum OracleCommand {
#[command(about = "Get all known oracle announcements.")]
Announcements,
}
#[derive(Parser, Clone, Debug)]
pub struct Accept {
pub contract_id: String,
}
#[derive(Parser, Clone, Debug)]
pub struct Connect {
#[arg(help = "The public key to connect to.")]
pub pubkey: String,
}