diff --git a/bdk-ffi/src/bdk.udl b/bdk-ffi/src/bdk.udl index 29f8a2c0..d01858e8 100644 --- a/bdk-ffi/src/bdk.udl +++ b/bdk-ffi/src/bdk.udl @@ -616,6 +616,9 @@ interface Address { [Throws=AddressError] constructor(string address, Network network); + [Name=from_script, Throws=AddressError] + constructor(Script script, Network network); + Network network(); Script script_pubkey(); diff --git a/bdk-ffi/src/bitcoin.rs b/bdk-ffi/src/bitcoin.rs index 9ac67c51..4433163e 100644 --- a/bdk-ffi/src/bitcoin.rs +++ b/bdk-ffi/src/bitcoin.rs @@ -89,6 +89,12 @@ impl Address { Ok(Address(network_checked_address)) } + pub fn from_script(script: Arc