From d506d2252f4e5b17c593b71989119891bc087e37 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 21 May 2026 15:31:21 -0500 Subject: [PATCH 1/5] feat: add electrum client timeout option --- bdk-ffi/src/electrum.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bdk-ffi/src/electrum.rs b/bdk-ffi/src/electrum.rs index bdb080f9..9251cbd5 100644 --- a/bdk-ffi/src/electrum.rs +++ b/bdk-ffi/src/electrum.rs @@ -29,15 +29,20 @@ pub struct ElectrumClient(BdkBdkElectrumClient, + timeout: Option, validate_domain: bool, ) -> Result { let mut config = bdk_electrum::electrum_client::ConfigBuilder::new(); config = config.validate_domain(validate_domain); + if let Some(timeout) = timeout { + config = config.timeout(Some(timeout)); + } if let Some(socks5) = socks5 { config = config.socks5(Some(bdk_electrum::electrum_client::Socks5Config::new( socks5.as_str(), From e0454c2d9d3737ac12d023197376c6183f8c37b3 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 21 May 2026 15:33:38 -0500 Subject: [PATCH 2/5] feat: add electrum client retry option --- bdk-ffi/src/electrum.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bdk-ffi/src/electrum.rs b/bdk-ffi/src/electrum.rs index 9251cbd5..70224a0f 100644 --- a/bdk-ffi/src/electrum.rs +++ b/bdk-ffi/src/electrum.rs @@ -30,12 +30,14 @@ impl ElectrumClient { /// Creates a new bdk client from a electrum_client::ElectrumApi /// Optional: Set the proxy of the builder /// Optional: Set the timeout of the builder + /// Optional: Set the retry attempts number of the builder /// Optional: Set whether the server's TLS certificate is validated. - #[uniffi::constructor(default(socks5 = None, timeout = None, validate_domain = true))] + #[uniffi::constructor(default(socks5 = None, timeout = None, retry = None, validate_domain = true))] pub fn new( url: String, socks5: Option, timeout: Option, + retry: Option, validate_domain: bool, ) -> Result { let mut config = bdk_electrum::electrum_client::ConfigBuilder::new(); @@ -43,6 +45,9 @@ impl ElectrumClient { if let Some(timeout) = timeout { config = config.timeout(Some(timeout)); } + if let Some(retry) = retry { + config = config.retry(retry); + } if let Some(socks5) = socks5 { config = config.socks5(Some(bdk_electrum::electrum_client::Socks5Config::new( socks5.as_str(), From 08bbab8064a7b0f06cd15dc63406ce0e8f202699 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 22 May 2026 11:58:28 -0500 Subject: [PATCH 3/5] chore: electrum timeout retry changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8930d6da..e1d618d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ This is version `3.0.0` of the BDK language bindings! This release uses the foll - New `DescriptorPublicKey::add_wildcard` method, which adds an unhardened wildcard to the derivation path of the descriptor [#853] - New `DescriptorSecretKey::add_wildcard(wildcard_type: WildcardType)` method, which adds a wildcard to the derivation path of the descriptor [#853] - Exposed `new_sh`, `new_wsh`,`new_bare` and `new_sh_wsh` methods on `Descriptor` type [#988] +- Add optional `timeout` and `retry` parameters to the Electrum client constructor [#1010] [#853]: https://github.com/bitcoindevkit/bdk-ffi/pull/853 [#945]: https://github.com/bitcoindevkit/bdk-ffi/pull/945 @@ -43,6 +44,7 @@ This is version `3.0.0` of the BDK language bindings! This release uses the foll [#973]: https://github.com/bitcoindevkit/bdk-ffi/pull/973 [#986]: https://github.com/bitcoindevkit/bdk-ffi/pull/986 [#988]: https://github.com/bitcoindevkit/bdk-ffi/pull/988 +[#1010]: https://github.com/bitcoindevkit/bdk-ffi/pull/1010 ## [v2.3.0] From 9d4b6eb1d61428d18fc43933a6e337a0be6b8436 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 22 May 2026 13:00:32 -0500 Subject: [PATCH 4/5] chore: bump bdk electrum to 0.24.0 --- bdk-ffi/Cargo.lock | 85 ++++++++++++++++++++++++++++++++++++++--- bdk-ffi/Cargo.toml | 2 +- bdk-ffi/src/electrum.rs | 7 ++-- 3 files changed, 85 insertions(+), 9 deletions(-) diff --git a/bdk-ffi/Cargo.lock b/bdk-ffi/Cargo.lock index 9ef4f515..14266ad8 100644 --- a/bdk-ffi/Cargo.lock +++ b/bdk-ffi/Cargo.lock @@ -86,6 +86,28 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "aws-lc-rs" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ec2f1fc3ec205783a5da9a7e6c1509cc69dedf09a1949e412c1e18469326d00" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a2f9779ce85b93ab6170dd940ad0169b5766ff848247aff13bb788b832fe3f4" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + [[package]] name = "base58ck" version = "0.1.0" @@ -156,9 +178,9 @@ dependencies = [ [[package]] name = "bdk_electrum" -version = "0.23.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b59a3f7fbe678874fa34354097644a171276e02a49934c13b3d61c54610ddf39" +checksum = "00a9846105bf6e751adbb6946b000ff919ce24a15a941cbfe68485549b552a9c" dependencies = [ "bdk_core", "electrum-client", @@ -414,6 +436,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98" dependencies = [ "find-msvc-tools", + "jobserver", + "libc", "shlex", ] @@ -468,11 +492,26 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "electrum-client" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5059f13888a90486e7268bbce59b175f5f76b1c55e5b9c568ceaa42d2b8507c" +checksum = "1970c5d7bd9de6d4041cbfc3e46faa3e85fe7efcea2b0eb06750d3ae1ef577b7" dependencies = [ "bitcoin", "byteorder", @@ -554,6 +593,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "getrandom" version = "0.2.17" @@ -565,6 +610,18 @@ dependencies = [ "wasi", ] +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + [[package]] name = "getrandom" version = "0.4.2" @@ -573,7 +630,7 @@ checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ "cfg-if", "libc", - "r-efi", + "r-efi 6.0.0", "wasip2", "wasip3", ] @@ -683,6 +740,16 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + [[package]] name = "leb128fmt" version = "0.1.0" @@ -843,6 +910,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "r-efi" version = "6.0.0" @@ -944,6 +1017,7 @@ version = "0.23.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" dependencies = [ + "aws-lc-rs", "log", "once_cell", "ring", @@ -978,6 +1052,7 @@ version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", diff --git a/bdk-ffi/Cargo.toml b/bdk-ffi/Cargo.toml index 0f620045..419ed529 100644 --- a/bdk-ffi/Cargo.toml +++ b/bdk-ffi/Cargo.toml @@ -17,7 +17,7 @@ path = "uniffi-bindgen.rs" [dependencies] bdk_wallet = { version = "=3.0.0", features = ["all-keys", "keys-bip39", "rusqlite"] } bdk_esplora = { version = "0.22.1", default-features = false, features = ["std", "blocking", "blocking-https-rustls"] } -bdk_electrum = { version = "0.23.2", default-features = false, features = ["use-rustls-ring"] } +bdk_electrum = { version = "0.24.0", default-features = false, features = ["use-rustls-ring"] } bdk_kyoto = { version = "0.17.0" } uniffi = { version = "=0.30.0", features = ["cli"]} diff --git a/bdk-ffi/src/electrum.rs b/bdk-ffi/src/electrum.rs index 70224a0f..57288c15 100644 --- a/bdk-ffi/src/electrum.rs +++ b/bdk-ffi/src/electrum.rs @@ -19,6 +19,7 @@ use bdk_wallet::bitcoin::hex::{Case, DisplayHex}; use std::collections::BTreeMap; use std::convert::TryFrom; use std::sync::Arc; +use std::time::Duration; /// Wrapper around an electrum_client::ElectrumApi which includes an internal in-memory transaction /// cache to avoid re-fetching already downloaded transactions. @@ -29,7 +30,7 @@ pub struct ElectrumClient(BdkBdkElectrumClient Result { self.0 .inner - .estimate_fee(number as usize) + .estimate_fee(number as usize, None) .map_err(ElectrumError::from) } From 69c29f91bf5fad9b6afdec4e6b2441f79fe901cc Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 22 May 2026 13:06:10 -0500 Subject: [PATCH 5/5] chore: bdk_electrum version changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1d618d4..2fe0d243 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), This is version `3.0.0` of the BDK language bindings! This release uses the following Rust dependencies: - bdk_wallet `3.0.0` -- bdk_electrum `0.23.2` +- bdk_electrum `0.24.0` - bdk_esplora `0.22.1` - bdk_kyoto `0.17.0` - bitcoin `0.32.8`