|
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 | use clap_complete::Shell; |
22 | 23 |
|
| 24 | +#[cfg(feature = "dns_payment")] |
| 25 | +use crate::utils::parse_dns_recipient; |
23 | 26 | #[cfg(any(feature = "electrum", feature = "esplora", feature = "rpc"))] |
24 | 27 | use crate::utils::parse_proxy_auth; |
25 | 28 | use crate::utils::{parse_address, parse_outpoint, parse_recipient}; |
@@ -182,6 +185,16 @@ pub enum CliSubCommand { |
182 | 185 | #[arg(value_enum)] |
183 | 186 | shell: Shell, |
184 | 187 | }, |
| 188 | + |
| 189 | + #[cfg(feature = "dns_payment")] |
| 190 | + /// Resolves BIP-353 DNS payment instructions for a human-readable name. |
| 191 | + ResolveDnsRecipient { |
| 192 | + /// Human-readable name (e.g. user@domain.com) |
| 193 | + hrn: String, |
| 194 | + /// DNS resolver address |
| 195 | + #[arg(long, default_value = "8.8.8.8")] |
| 196 | + resolver: String, |
| 197 | + }, |
185 | 198 | } |
186 | 199 |
|
187 | 200 | /// Wallet operation subcommands. |
@@ -354,6 +367,14 @@ pub enum OfflineWalletSubCommand { |
354 | 367 | // Address and amount parsing is done at run time in handler function. |
355 | 368 | #[arg(env = "ADDRESS:SAT", long = "to", required = true, value_parser = parse_recipient)] |
356 | 369 | recipients: Vec<(ScriptBuf, u64)>, |
| 370 | + #[cfg(feature = "dns_payment")] |
| 371 | + /// Adds DNS recipients to the transaction |
| 372 | + #[arg(long = "to_dns", value_parser = parse_dns_recipient)] |
| 373 | + dns_recipients: Vec<(String, u64)>, |
| 374 | + #[cfg(feature = "dns_payment")] |
| 375 | + /// Custom resolver DNS IP to be used for resolution. |
| 376 | + #[arg(long = "dns_resolver", default_value = "8.8.8.8:53")] |
| 377 | + dns_resolver: String, |
357 | 378 | /// Sends all the funds (or all the selected utxos). Requires only one recipient with value 0. |
358 | 379 | #[arg(long = "send_all", short = 'a')] |
359 | 380 | send_all: bool, |
|
0 commit comments