File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -603,6 +603,20 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
603603 }
604604}
605605
606+ /// Creates a new BDK Electrum client from a URL with custom configuration.
607+ /// can be used as a convenience method for creating an Electrum client with custom settings
608+ /// such as JWT authorization providers, timeouts, or proxy settings.
609+ impl BdkElectrumClient < electrum_client:: Client > {
610+ /// [`electrum_client::ConfigBuilder`]: crate::electrum_client::ConfigBuilder
611+ pub fn from_config (
612+ url : & str ,
613+ config : electrum_client:: Config ,
614+ ) -> Result < Self , electrum_client:: Error > {
615+ let client = electrum_client:: Client :: from_config ( url, config) ?;
616+ Ok ( Self :: new ( client) )
617+ }
618+ }
619+
606620/// Return a [`CheckPoint`] of the latest tip, that connects with `prev_tip`. The latest blocks are
607621/// fetched to construct checkpoint updates with the proper [`BlockHash`] in case of re-org.
608622fn fetch_tip_and_latest_blocks (
Original file line number Diff line number Diff line change 1616//! [`example_electrum`]: https://github.com/bitcoindevkit/bdk/tree/master/examples/example_electrum
1717//! [`SyncResponse`]: bdk_core::spk_client::SyncResponse
1818//! [`FullScanResponse`]: bdk_core::spk_client::FullScanResponse
19+ //! [`AuthProvider`]: electrum_client::config::AuthProvider
1920#![ cfg_attr( coverage_nightly, feature( coverage_attribute) ) ]
2021#![ warn( missing_docs) ]
2122
@@ -24,3 +25,5 @@ pub use bdk_electrum_client::*;
2425
2526pub use bdk_core;
2627pub use electrum_client;
28+
29+ pub use electrum_client:: { Config , ConfigBuilder } ;
You can’t perform that action at this time.
0 commit comments