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