Skip to content

Commit

Permalink
feat: add get_height to esplora
Browse files Browse the repository at this point in the history
  • Loading branch information
reez authored and thunderbiscuit committed Nov 8, 2024
1 parent 8c71fb7 commit 20eebc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bdk-ffi/src/bdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,9 @@ interface EsploraClient {

[Throws=EsploraError]
Transaction? get_tx(string txid);

[Throws=EsploraError]
u32 get_height();
};

// ------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions bdk-ffi/src/esplora.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32, EsploraError> {
self.0.get_height().map_err(EsploraError::from)
}
}

0 comments on commit 20eebc8

Please sign in to comment.