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 #[command(about = "Sync the wallet and contracts.")]
32 Sync,
33}
34
35#[derive(Parser, Clone, Debug)]
36pub struct Offer {
37 #[arg(help = "Generate a contract automatically with peer.")]
38 #[arg(short = 'g', long = "generate", default_value = "false")]
39 pub generate: bool,
40 #[arg(help = "The contract counterparty to send to.")]
41 pub counter_party: String,
42}
43
44#[derive(Clone, Debug, Subcommand)]
45pub enum WalletCommand {
46 #[command(about = "Generate a new, unused address from the wallet.")]
47 NewAddress,
48 #[command(about = "Get the wallet transactions.")]
49 Transactions,
50 #[command(about = "Get the wallet utxos.")]
51 Utxos,
52 #[command(about = "Send a Bitcoin amount to an address")]
53 Send {
54 address: String,
56 amount: u64,
58 fee_rate: u64,
60 },
61 #[command(about = "Sync the on-chain wallet.")]
62 Sync,
63}
64
65#[derive(Clone, Debug, Subcommand)]
66pub enum OracleCommand {
67 #[command(about = "Get all known oracle announcements.")]
68 Announcements {
69 #[arg(help = "The announcement id to get.")]
70 event_id: String,
71 },
72 #[command(about = "Create an enum oracle event.")]
73 CreateEnum {
74 #[arg(help = "The maturity of the event.")]
75 maturity: u32,
76 #[arg(help = "The outcomes of the event. Separate by spaces.")]
77 outcomes: Vec<String>,
78 },
79}
80#[derive(Parser, Clone, Debug)]
81pub struct Accept {
82 pub contract_id: String,
84}
85
86#[derive(Parser, Clone, Debug)]
87pub struct Connect {
88 #[arg(help = "The public key to connect to.")]
89 pub pubkey: String,
90}