File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -444,6 +444,14 @@ impl<S: Sleeper> AsyncClient<S> {
444444 self . get_response_json ( & path) . await
445445 }
446446
447+ /// Get mempool [`Transaction`] history for the
448+ /// specified [`Script`] hash, sorted with newest first.
449+ pub async fn get_mempool_scripthash_txs ( & self , script : & Script ) -> Result < Vec < Tx > , Error > {
450+ let script_hash = sha256:: Hash :: hash ( script. as_bytes ( ) ) ;
451+ let path = format ! ( "/scripthash/{script_hash:x}/txs/mempool" ) ;
452+
453+ self . get_response_json ( & path) . await
454+ }
447455 /// Get an map where the key is the confirmation target (in number of
448456 /// blocks) and the value is the estimated feerate (in sat/vB).
449457 pub async fn get_fee_estimates ( & self ) -> Result < HashMap < u16 , f64 > , Error > {
Original file line number Diff line number Diff line change @@ -378,6 +378,14 @@ impl BlockingClient {
378378 self . get_response_json ( & path)
379379 }
380380
381+ /// Get mempool [`Transaction`] history for the
382+ /// specified [`Script`] hash, sorted with newest first.
383+ pub fn get_mempool_scripthash_txs ( & self , script : & Script ) -> Result < Vec < Tx > , Error > {
384+ let script_hash = sha256:: Hash :: hash ( script. as_bytes ( ) ) ;
385+ let path = format ! ( "/scripthash/{script_hash:x}/txs/mempool" ) ;
386+
387+ self . get_response_json ( & path)
388+ }
381389 /// Gets some recent block summaries starting at the tip or at `height` if
382390 /// provided.
383391 ///
You can’t perform that action at this time.
0 commit comments