@@ -603,6 +603,44 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
603603 }
604604}
605605
606+ impl BdkElectrumClient < electrum_client:: Client > {
607+ /// Creates a new BDK Electrum client from a URL with custom configuration.
608+ ///
609+ /// This is a convenience method for creating an Electrum client with custom settings
610+ /// such as JWT authorization providers, timeouts, or proxy settings.
611+ ///
612+ /// # Example with JWT Authentication
613+ ///
614+ /// ```no_run
615+ /// # use bdk_electrum::{BdkElectrumClient, electrum_client};
616+ /// # use std::sync::Arc;
617+ /// let config = electrum_client::ConfigBuilder::new()
618+ /// .authorization_provider(Some(Arc::new(|| {
619+ /// // Your token provider that fetches/refreshes JWT
620+ /// Some("Bearer your-jwt-token".to_string())
621+ /// })))
622+ /// .timeout(Some(30))
623+ /// .build();
624+ ///
625+ /// let client = BdkElectrumClient::from_config("tcp://server:50001", config)?;
626+ /// # Ok::<(), electrum_client::Error>(())
627+ /// ```
628+ ///
629+ /// # Arguments
630+ ///
631+ /// * `url` - Electrum server URL (e.g., "tcp://host:port" or "ssl://host:port")
632+ /// * `config` - Configuration created via [`electrum_client::ConfigBuilder`]
633+ ///
634+ /// [`electrum_client::ConfigBuilder`]: crate::electrum_client::ConfigBuilder
635+ pub fn from_config (
636+ url : & str ,
637+ config : electrum_client:: Config ,
638+ ) -> Result < Self , electrum_client:: Error > {
639+ let client = electrum_client:: Client :: from_config ( url, config) ?;
640+ Ok ( Self :: new ( client) )
641+ }
642+ }
643+
606644/// Return a [`CheckPoint`] of the latest tip, that connects with `prev_tip`. The latest blocks are
607645/// fetched to construct checkpoint updates with the proper [`BlockHash`] in case of re-org.
608646fn fetch_tip_and_latest_blocks (
0 commit comments