|
1 | 1 | //! Esplora
|
2 | 2 | //!
|
3 |
| -//! This module defines a [`EsploraBlockchain`] struct that can query an Esplora |
4 |
| -//! backend populate the wallet's [database](crate::database::Database) by: |
| 3 | +//! This module defines a [`Builder`] struct that can create a blocking or |
| 4 | +//! async Esplora client to query an Esplora backend: |
5 | 5 | //!
|
6 |
| -//! ## Example |
| 6 | +//! ## Examples |
7 | 7 | //!
|
8 | 8 | //! ```no_run
|
9 |
| -//! # use bdk::blockchain::esplora::EsploraBlockchain; |
10 |
| -//! let blockchain = EsploraBlockchain::new("https://blockstream.info/testnet/api", 20); |
11 |
| -//! # Ok::<(), bdk::Error>(()) |
| 9 | +//! # use esplora_client::Builder; |
| 10 | +//! let builder = Builder::new("https://blockstream.info/testnet/api"); |
| 11 | +//! let blocking_client = builder.build_blocking(); |
| 12 | +//! # Ok::<(), esplora_client::Error>(()); |
| 13 | +//! ``` |
| 14 | +//! ```no_run |
| 15 | +//! # use esplora_client::Builder; |
| 16 | +//! let builder = Builder::new("https://blockstream.info/testnet/api"); |
| 17 | +//! let async_client = builder.build_async(); |
| 18 | +//! # Ok::<(), esplora_client::Error>(()); |
12 | 19 | //! ```
|
13 | 20 | //!
|
14 |
| -//! Esplora blockchain can use either `ureq` or `reqwest` for the HTTP client |
| 21 | +//! Esplora client can use either `ureq` or `reqwest` for the HTTP client |
15 | 22 | //! depending on your needs (blocking or async respectively).
|
16 | 23 | //!
|
17 | 24 | //! Please note, to configure the Esplora HTTP client correctly use one of:
|
18 |
| -//! Blocking: --features='esplora,ureq' |
19 |
| -//! Async: --features='async-interface,esplora,reqwest' --no-default-features |
| 25 | +//! Blocking: --features='blocking' |
| 26 | +//! Async: --features='async' |
20 | 27 | use std::collections::HashMap;
|
21 | 28 | use std::fmt;
|
22 | 29 | use std::io;
|
@@ -200,12 +207,12 @@ mod test {
|
200 | 207 | )
|
201 | 208 | .unwrap();
|
202 | 209 | assert_eq!(
|
203 |
| - into_fee_rate(6, esplora_fees.clone()).unwrap(), |
204 |
| - FeeRate::from_sat_per_vb(2.236) |
| 210 | + convert_fee_rate(6, esplora_fees.clone()).unwrap(), |
| 211 | + 2.236 |
205 | 212 | );
|
206 | 213 | assert_eq!(
|
207 |
| - into_fee_rate(26, esplora_fees).unwrap(), |
208 |
| - FeeRate::from_sat_per_vb(1.015), |
| 214 | + convert_fee_rate(26, esplora_fees).unwrap(), |
| 215 | + 1.015, |
209 | 216 | "should inherit from value for 25"
|
210 | 217 | );
|
211 | 218 | }
|
|
0 commit comments