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) + } }