Skip to content

Commit b24fe96

Browse files
committed
feat(client): add get_mempool_address_txs method
1 parent d2c1128 commit b24fe96

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/async.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,14 @@ impl<S: Sleeper> AsyncClient<S> {
419419
self.get_response_json(&path).await
420420
}
421421

422-
/// Get confirmed transaction history for the specified address/scripthash,
422+
/// Get mempool [`Transaction`]s for the specified [`Address`], sorted with newest first.
423+
pub async fn get_mempool_address_txs(&self, address: &Address) -> Result<Vec<Tx>, Error> {
424+
let path = format!("/address/{address}/txs/mempool");
425+
426+
self.get_response_json(&path).await
427+
}
428+
429+
/// Get transaction history for the specified address/scripthash,
423430
/// sorted with newest first. Returns 25 transactions per page.
424431
/// More can be requested by specifying the last txid seen by the previous
425432
/// query.

src/blocking.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,14 @@ impl BlockingClient {
354354
self.get_response_json(&path)
355355
}
356356

357-
/// Get confirmed transaction history for the specified address/scripthash,
357+
/// Get mempool [`Transaction`]s for the specified [`Address`], sorted with newest first.
358+
pub fn get_mempool_address_txs(&self, address: &Address) -> Result<Vec<Tx>, Error> {
359+
let path = format!("/address/{address}/txs/mempool");
360+
361+
self.get_response_json(&path)
362+
}
363+
364+
/// Get transaction history for the specified scripthash,
358365
/// sorted with newest first. Returns 25 transactions per page.
359366
/// More can be requested by specifying the last txid seen by the previous
360367
/// query.

0 commit comments

Comments
 (0)