From: Rob N Date: Sun, 16 Feb 2025 19:37:12 +0000 (-1000) Subject: feat(wallet): generalize `add_recipient` to accept `Address` X-Git-Tag: wallet-1.2.0~13^2 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/static/struct.CommandStringError.html?a=commitdiff_plain;h=de2c44fc183b3b43816cfe6c868c8cea7d749d7b;p=bdk feat(wallet): generalize `add_recipient` to accept `Address` --- diff --git a/crates/wallet/src/wallet/tx_builder.rs b/crates/wallet/src/wallet/tx_builder.rs index 235987fc..7d693761 100644 --- a/crates/wallet/src/wallet/tx_builder.rs +++ b/crates/wallet/src/wallet/tx_builder.rs @@ -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, + amount: Amount, + ) -> &mut Self { + self.params.recipients.push((script_pubkey.into(), amount)); self }