From 20eebc8569bbc28cf3f666b82da7a0666e55300e Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 5 Nov 2024 21:17:08 -0600 Subject: [PATCH] feat: add get_height to esplora --- bdk-ffi/src/bdk.udl | 3 +++ bdk-ffi/src/esplora.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/bdk-ffi/src/bdk.udl b/bdk-ffi/src/bdk.udl index 1c716777..12b87851 100644 --- a/bdk-ffi/src/bdk.udl +++ b/bdk-ffi/src/bdk.udl @@ -601,6 +601,9 @@ interface EsploraClient { [Throws=EsploraError] Transaction? get_tx(string txid); + + [Throws=EsploraError] + u32 get_height(); }; // ------------------------------------------------------------------------ diff --git a/bdk-ffi/src/esplora.rs b/bdk-ffi/src/esplora.rs index 934a9079..7708cdf7 100644 --- a/bdk-ffi/src/esplora.rs +++ b/bdk-ffi/src/esplora.rs @@ -89,4 +89,8 @@ impl EsploraClient { let tx_opt = self.0.get_tx(&txid)?; Ok(tx_opt.map(|inner| Arc::new(Transaction::from(inner)))) } + + pub fn get_height(&self) -> Result { + self.0.get_height().map_err(EsploraError::from) + } }