52
52
//! capabilities using the platform's native TLS backend (likely OpenSSL).
53
53
//! * `blocking-https-bundled` enables [`minreq`], the blocking client with proxy and TLS (SSL)
54
54
//! capabilities using a bundled OpenSSL library backend.
55
+ //!
55
56
//! * `async` enables [`reqwest`], the async client with proxy capabilities.
56
57
//! * `async-https` enables [`reqwest`], the async client with support for proxying and TLS (SSL)
57
58
//! using the default [`reqwest`] TLS backend.
@@ -71,8 +72,6 @@ use std::collections::HashMap;
71
72
use std:: fmt;
72
73
use std:: num:: TryFromIntError ;
73
74
74
- use bitcoin:: consensus;
75
-
76
75
pub mod api;
77
76
78
77
#[ cfg( feature = "async" ) ]
@@ -103,6 +102,7 @@ pub fn convert_fee_rate(target: usize, estimates: HashMap<u16, f64>) -> Result<f
103
102
104
103
#[ derive( Debug , Clone ) ]
105
104
pub struct Builder {
105
+ /// The URL of the Esplora server.
106
106
pub base_url : String ,
107
107
/// Optional URL of the proxy to use to make requests to the Esplora server
108
108
///
@@ -117,7 +117,7 @@ pub struct Builder {
117
117
pub proxy : Option < String > ,
118
118
/// Socket timeout.
119
119
pub timeout : Option < u64 > ,
120
- /// HTTP headers to set on every request made to Esplora server
120
+ /// HTTP headers to set on every request made to Esplora server.
121
121
pub headers : HashMap < String , String > ,
122
122
}
123
123
@@ -150,20 +150,20 @@ impl Builder {
150
150
self
151
151
}
152
152
153
- /// build a blocking client from builder
153
+ /// Build a blocking client from builder
154
154
#[ cfg( feature = "blocking" ) ]
155
155
pub fn build_blocking ( self ) -> BlockingClient {
156
156
BlockingClient :: from_builder ( self )
157
157
}
158
158
159
- // build an asynchronous client from builder
159
+ // Build an asynchronous client from builder
160
160
#[ cfg( feature = "async" ) ]
161
161
pub fn build_async ( self ) -> Result < AsyncClient , Error > {
162
162
AsyncClient :: from_builder ( self )
163
163
}
164
164
}
165
165
166
- /// Errors that can happen during a sync with `Esplora`
166
+ /// Errors that can happen during a request to `Esplora` servers.
167
167
#[ derive( Debug ) ]
168
168
pub enum Error {
169
169
/// Error during `minreq` HTTP request
@@ -186,9 +186,9 @@ pub enum Error {
186
186
HexToBytes ( bitcoin:: hex:: HexToBytesError ) ,
187
187
/// Transaction not found
188
188
TransactionNotFound ( Txid ) ,
189
- /// Header height not found
189
+ /// Block Header height not found
190
190
HeaderHeightNotFound ( u32 ) ,
191
- /// Header hash not found
191
+ /// Block Header hash not found
192
192
HeaderHashNotFound ( BlockHash ) ,
193
193
/// Invalid HTTP Header name specified
194
194
InvalidHttpHeaderName ( String ) ,
@@ -221,7 +221,7 @@ impl_error!(::minreq::Error, Minreq, Error);
221
221
#[ cfg( feature = "async" ) ]
222
222
impl_error ! ( :: reqwest:: Error , Reqwest , Error ) ;
223
223
impl_error ! ( std:: num:: ParseIntError , Parsing , Error ) ;
224
- impl_error ! ( consensus:: encode:: Error , BitcoinEncoding , Error ) ;
224
+ impl_error ! ( bitcoin :: consensus:: encode:: Error , BitcoinEncoding , Error ) ;
225
225
impl_error ! ( bitcoin:: hex:: HexToArrayError , HexToArray , Error ) ;
226
226
impl_error ! ( bitcoin:: hex:: HexToBytesError , HexToBytes , Error ) ;
227
227
0 commit comments