]> Untitled Git - bdk/commitdiff
feat(wallet): generalize `add_recipient` to accept `Address`
authorRob N <rob.netzke@gmail.com>
Sun, 16 Feb 2025 19:37:12 +0000 (09:37 -1000)
committervalued mammal <valuedmammal@protonmail.com>
Mon, 10 Mar 2025 16:25:17 +0000 (12:25 -0400)
crates/wallet/src/wallet/tx_builder.rs

index 235987fc0491a93695e47f5aaf8f449efe5a6d46..7d6937619e2dd91ea981e63ad21f1caafaa85c36 100644 (file)
@@ -602,8 +602,12 @@ impl<'a, Cs> TxBuilder<'a, Cs> {
     }
 
     /// Add a recipient to the internal list
-    pub fn add_recipient(&mut self, script_pubkey: ScriptBuf, amount: Amount) -> &mut Self {
-        self.params.recipients.push((script_pubkey, amount));
+    pub fn add_recipient(
+        &mut self,
+        script_pubkey: impl Into<ScriptBuf>,
+        amount: Amount,
+    ) -> &mut Self {
+        self.params.recipients.push((script_pubkey.into(), amount));
         self
     }