#[cfg(not(target_arch = "wasm32"))]
use std::net::SocketAddr;
use std::time::Duration;
use nostr_relay_pool::RelayOptions;
#[derive(Debug, Clone)]
pub struct NostrWalletConnectOptions {
pub(super) relay: RelayOptions,
pub(super) timeout: Duration,
}
impl Default for NostrWalletConnectOptions {
fn default() -> Self {
Self {
relay: RelayOptions::default(),
timeout: Duration::from_secs(10),
}
}
}
impl NostrWalletConnectOptions {
pub fn new() -> Self {
Self::default()
}
#[cfg(not(target_arch = "wasm32"))]
pub fn proxy(self, proxy: Option<SocketAddr>) -> Self {
Self {
relay: self.relay.proxy(proxy),
..self
}
}
pub fn timeout(mut self, timeout: Duration) -> Self {
self.timeout = timeout;
self
}
}