diff --git a/crates/esplora/Cargo.toml b/crates/esplora/Cargo.toml index 54065c967..011f057ec 100644 --- a/crates/esplora/Cargo.toml +++ b/crates/esplora/Cargo.toml @@ -17,13 +17,13 @@ workspace = true [dependencies] bdk_core = { path = "../core", version = "0.6.1", default-features = false } -esplora-client = { version = "0.12.3", default-features = false } +esplora-client = { git = "https://github.com/luisschwab/rust-esplora-client", branch = "chore/api-fixups" } async-trait = { version = "0.1.66", optional = true } futures = { version = "0.3.26", optional = true } serde_json = { version = "1.0", features = ["alloc"] } [dev-dependencies] -esplora-client = { version = "0.12.0" } +esplora-client = { git = "https://github.com/luisschwab/rust-esplora-client", branch = "chore/api-fixups" } bdk_chain = { path = "../chain" } bdk_testenv = { path = "../testenv" } tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] } diff --git a/crates/esplora/src/async_ext.rs b/crates/esplora/src/async_ext.rs index 2b3828952..8bd39bce9 100644 --- a/crates/esplora/src/async_ext.rs +++ b/crates/esplora/src/async_ext.rs @@ -7,7 +7,7 @@ use bdk_core::{ bitcoin::{BlockHash, OutPoint, Txid}, BlockId, CheckPoint, ConfirmationBlockTime, Indexed, TxUpdate, }; -use esplora_client::Sleeper; +use esplora_client::{EsploraTx, Sleeper}; use futures::{stream::FuturesOrdered, TryStreamExt}; use crate::{insert_anchor_or_seen_at_from_status, insert_prevouts}; @@ -314,7 +314,7 @@ where I: Iterator> + Send, S: Sleeper + Clone + Send + Sync, { - type TxsOfSpkIndex = (u32, Vec, HashSet); + type TxsOfSpkIndex = (u32, Vec, HashSet); let mut update = TxUpdate::::default(); let mut last_active_index = Option::::None; @@ -335,7 +335,7 @@ where let mut last_seen = None; let mut spk_txs = Vec::new(); loop { - let txs = client.scripthash_txs(&spk, last_seen).await?; + let txs = client.get_scripthash_txs(&spk, last_seen).await?; let tx_count = txs.len(); last_seen = txs.last().map(|tx| tx.txid); spk_txs.extend(txs); diff --git a/crates/esplora/src/blocking_ext.rs b/crates/esplora/src/blocking_ext.rs index 225b574ea..49828dd1b 100644 --- a/crates/esplora/src/blocking_ext.rs +++ b/crates/esplora/src/blocking_ext.rs @@ -6,7 +6,7 @@ use bdk_core::{ bitcoin::{BlockHash, OutPoint, Txid}, BlockId, CheckPoint, ConfirmationBlockTime, Indexed, TxUpdate, }; -use esplora_client::{OutputStatus, Tx}; +use esplora_client::{EsploraTx, OutputStatus}; use std::thread::JoinHandle; use crate::{insert_anchor_or_seen_at_from_status, insert_prevouts}; @@ -282,7 +282,7 @@ fn fetch_txs_with_keychain_spks last_revealed: Option, parallel_requests: usize, ) -> Result<(TxUpdate, Option), Error> { - type TxsOfSpkIndex = (u32, Vec, HashSet); + type TxsOfSpkIndex = (u32, Vec, HashSet); let mut update = TxUpdate::::default(); let mut last_active_index = Option::::None; @@ -303,7 +303,7 @@ fn fetch_txs_with_keychain_spks let mut last_txid = None; let mut spk_txs = Vec::new(); loop { - let txs = client.scripthash_txs(&spk, last_txid)?; + let txs = client.get_scripthash_txs(&spk, last_txid)?; let tx_count = txs.len(); last_txid = txs.last().map(|tx| tx.txid); spk_txs.extend(txs); @@ -414,7 +414,7 @@ fn fetch_txs_with_txids>( .map(|t| (txid, t)) }) }) - .collect::), Error>>>>(); + .collect::), Error>>>>(); if handles.is_empty() { break; diff --git a/crates/esplora/src/lib.rs b/crates/esplora/src/lib.rs index 60b4f1eb3..ab7efd2ff 100644 --- a/crates/esplora/src/lib.rs +++ b/crates/esplora/src/lib.rs @@ -21,7 +21,7 @@ //! [`esplora_client::AsyncClient`]. #![cfg_attr(coverage_nightly, feature(coverage_attribute))] -use bdk_core::bitcoin::{Amount, OutPoint, TxOut, Txid}; +use bdk_core::bitcoin::{OutPoint, TxOut, Txid}; use bdk_core::{BlockId, ConfirmationBlockTime, TxUpdate}; use esplora_client::TxStatus; @@ -76,7 +76,7 @@ fn insert_prevouts( OutPoint::new(prev_txid, prev_vout), TxOut { script_pubkey: prev_txout.scriptpubkey, - value: Amount::from_sat(prev_txout.value), + value: prev_txout.value, }, ); }