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