1use clap::{Parser, Subcommand};
2
3#[derive(Debug, Clone, Subcommand)]
4pub enum CliCommand {
5 Info,
7 OfferContract(Offer),
9 Offers,
11 AcceptOffer(Accept),
13 Contracts,
15 #[command(about = "Get the wallet balance.")]
16 Balance,
17 #[clap(subcommand)]
19 Wallet(WalletCommand),
20 #[clap(subcommand)]
22 Oracle(OracleCommand),
23 Peers,
25 Connect {
27 #[arg(help = "The counter party to connect to. <PUBKEY>@<HOST>")]
28 connect_string: String,
29 },
30}
31
32#[derive(Parser, Clone, Debug)]
33pub struct Offer {
34 #[arg(help = "Generate a contract automatically with peer.")]
35 #[arg(short = 'g', long = "generate", default_value = "false")]
36 pub generate: bool,
37 #[arg(help = "The contract counterparty to send to.")]
38 pub counter_party: String,
39}
40
41#[derive(Clone, Debug, Subcommand)]
42pub enum WalletCommand {
43 #[command(about = "Generate a new, unused address from the wallet.")]
44 NewAddress,
45 #[command(about = "Get the wallet transactions.")]
46 Transactions,
47 #[command(about = "Get the wallet utxos.")]
48 Utxos,
49 #[command(about = "Send a Bitcoin amount to an address")]
50 Send {
51 address: String,
53 amount: u64,
55 fee_rate: u64,
57 },
58 #[command(about = "Sync the on-chain wallet.")]
59 Sync,
60}
61
62#[derive(Clone, Debug, Subcommand)]
63pub enum OracleCommand {
64 #[command(about = "Get all known oracle announcements.")]
65 Announcements,
66}
67
68#[derive(Parser, Clone, Debug)]
69pub struct Accept {
70 pub contract_id: String,
72}
73
74#[derive(Parser, Clone, Debug)]
75pub struct Connect {
76 #[arg(help = "The public key to connect to.")]
77 pub pubkey: String,
78}