Skip to content

Commit a1e4fd3

Browse files
committed
feat(client): add get_mempool_recent_txs method
1 parent aa02d59 commit a1e4fd3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/async.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,11 @@ impl<S: Sleeper> AsyncClient<S> {
458458
self.get_response_json("/mempool").await
459459
}
460460

461+
// Get a list of the last 10 [`Transaction`]s to enter the mempool.
462+
pub async fn get_mempool_recent_txs(&self) -> Result<Vec<MempoolRecentTx>, Error> {
463+
self.get_response_json("/mempool/recent").await
464+
}
465+
461466
/// Get an map where the key is the confirmation target (in number of
462467
/// blocks) and the value is the estimated feerate (in sat/vB).
463468
pub async fn get_fee_estimates(&self) -> Result<HashMap<u16, f64>, Error> {

src/blocking.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ impl BlockingClient {
321321
self.get_response_json("/mempool")
322322
}
323323

324+
// Get a list of the last 10 [`Transaction`]s to enter the mempool.
325+
pub fn get_mempool_recent_txs(&self) -> Result<Vec<MempoolRecentTx>, Error> {
326+
self.get_response_json("/mempool/recent")
327+
}
328+
324329
/// Get an map where the key is the confirmation target (in number of
325330
/// blocks) and the value is the estimated feerate (in sat/vB).
326331
pub fn get_fee_estimates(&self) -> Result<HashMap<u16, f64>, Error> {

0 commit comments

Comments
 (0)