//! Esplora by way of `reqwest` HTTP client.
use std::collections::{HashMap, HashSet};
+use std::ops::Deref;
use bitcoin::consensus::{deserialize, serialize};
use bitcoin::hashes::hex::{FromHex, ToHex};
use crate::error::Error;
use crate::FeeRate;
+/// Structure encapsulates Esplora client
#[derive(Debug)]
-struct UrlClient {
+pub struct UrlClient {
url: String,
// We use the async client instead of the blocking one because it automatically uses `fetch`
// when the target platform is wasm32.
}
}
+impl Deref for EsploraBlockchain {
+ type Target = UrlClient;
+
+ fn deref(&self) -> &Self::Target {
+ &self.url_client
+ }
+}
+
impl StatelessBlockchain for EsploraBlockchain {}
#[maybe_async]
use std::collections::{HashMap, HashSet};
use std::io;
use std::io::Read;
+use std::ops::Deref;
use std::time::Duration;
#[allow(unused_imports)]
use crate::error::Error;
use crate::FeeRate;
+/// Structure encapsulates ureq Esplora client
#[derive(Debug, Clone)]
-struct UrlClient {
+pub struct UrlClient {
url: String,
agent: Agent,
}
}
}
+impl Deref for EsploraBlockchain {
+ type Target = UrlClient;
+
+ fn deref(&self) -> &Self::Target {
+ &self.url_client
+ }
+}
+
impl StatelessBlockchain for EsploraBlockchain {}
impl GetHeight for EsploraBlockchain {