Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions bdk-ffi/src/electrum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ pub struct ElectrumClient(BdkBdkElectrumClient<bdk_electrum::electrum_client::Cl
impl ElectrumClient {
/// Creates a new bdk client from a electrum_client::ElectrumApi
/// Optional: Set the proxy of the builder
#[uniffi::constructor(default(socks5 = None))]
pub fn new(url: String, socks5: Option<String>) -> Result<Self, ElectrumError> {
/// Optional: Set whether the server's TLS certificate is validated.
#[uniffi::constructor(default(socks5 = None, validate_domain = true))]
pub fn new(
url: String,
socks5: Option<String>,
validate_domain: bool,
) -> Result<Self, ElectrumError> {
let mut config = bdk_electrum::electrum_client::ConfigBuilder::new();
config = config.validate_domain(validate_domain);
if let Some(socks5) = socks5 {
config = config.socks5(Some(bdk_electrum::electrum_client::Socks5Config::new(
socks5.as_str(),
Expand Down
Loading