|
13 | 13 | //! All subcommands are defined in the below enums. |
14 | 14 |
|
15 | 15 | #![allow(clippy::large_enum_variant)] |
| 16 | + |
16 | 17 | use bdk_wallet::bitcoin::{ |
17 | 18 | Address, Network, OutPoint, ScriptBuf, |
18 | 19 | bip32::{DerivationPath, Xpriv}, |
19 | 20 | }; |
20 | 21 | use clap::{Args, Parser, Subcommand, ValueEnum, value_parser}; |
21 | 22 |
|
| 23 | +#[cfg(feature = "dns_payment")] |
| 24 | +use crate::utils::parse_dns_recipients; |
22 | 25 | #[cfg(any(feature = "electrum", feature = "esplora", feature = "rpc"))] |
23 | 26 | use crate::utils::parse_proxy_auth; |
24 | 27 | use crate::utils::{parse_address, parse_outpoint, parse_recipient}; |
@@ -127,6 +130,10 @@ pub enum CliSubCommand { |
127 | 130 | }, |
128 | 131 | /// List all saved wallet configurations. |
129 | 132 | Wallets, |
| 133 | + |
| 134 | + #[cfg(feature = "dns_payment")] |
| 135 | + /// Resolves the given hrn payment instructions |
| 136 | + ResolveDnsRecipient { hrn: String , resolver: Option<String>}, |
130 | 137 | } |
131 | 138 | /// Wallet operation subcommands. |
132 | 139 | #[derive(Debug, Subcommand, Clone, PartialEq)] |
@@ -298,6 +305,14 @@ pub enum OfflineWalletSubCommand { |
298 | 305 | // Address and amount parsing is done at run time in handler function. |
299 | 306 | #[arg(env = "ADDRESS:SAT", long = "to", required = true, value_parser = parse_recipient)] |
300 | 307 | recipients: Vec<(ScriptBuf, u64)>, |
| 308 | + #[cfg(feature = "dns_payment")] |
| 309 | + /// Adds DNS recipients to the transaction |
| 310 | + #[arg(long = "to_dns", value_parser = parse_dns_recipients)] |
| 311 | + dns_recipients: Vec<(String, u64)>, |
| 312 | + #[cfg(feature = "dns_payment")] |
| 313 | + /// Custom resolver DNS IP to be used for resolution. |
| 314 | + #[arg(long = "dns_resolver", default_value = "8.8.8.8:53")] |
| 315 | + dns_resolver: String, |
301 | 316 | /// Sends all the funds (or all the selected utxos). Requires only one recipient with value 0. |
302 | 317 | #[arg(long = "send_all", short = 'a')] |
303 | 318 | send_all: bool, |
|
0 commit comments