@@ -566,6 +566,7 @@ impl<S: Read + Write> Client<S> {
566566
567567 Ok ( serde_json:: from_value ( result) ?)
568568 }
569+
569570 /// Batch version of [`script_list_unspent`](#method.script_list_unspent).
570571 ///
571572 /// Takes a list of scripts and returns a list of a list of utxos.
@@ -604,6 +605,17 @@ impl<S: Read + Write> Client<S> {
604605 impl_batch_call ! ( self , txids, transaction_get)
605606 }
606607
608+ /// Batch version of [`estimate_fee`](#method.estimate_fee).
609+ ///
610+ /// Takes a list of `numbers` of blocks and returns a list of fee required in
611+ /// **Satoshis per kilobyte** to confirm a transaction in the given number of blocks.
612+ pub fn batch_estimate_fee < ' s , I > ( & mut self , numbers : I ) -> Result < Vec < f64 > , Error >
613+ where
614+ I : IntoIterator < Item = usize > ,
615+ {
616+ impl_batch_call ! ( self , numbers, estimate_fee)
617+ }
618+
607619 /// Broadcasts a transaction to the network.
608620 pub fn transaction_broadcast ( & mut self , tx : & Transaction ) -> Result < Txid , Error > {
609621 let buffer: Vec < u8 > = serialize ( tx) ;
@@ -848,6 +860,18 @@ mod test {
848860 impl_test_conclusion ! ( test_case, client. stream) ;
849861 }
850862
863+ #[ test]
864+ fn test_batch_estimate_fee ( ) {
865+ let test_case = "batch_estimate_fee" ;
866+ let mut client = impl_test_prelude ! ( test_case) ;
867+
868+ let resp = client. batch_estimate_fee ( vec ! [ 10 , 20 ] ) . unwrap ( ) ;
869+ assert_eq ! ( resp[ 0 ] , 10.0 ) ;
870+ assert_eq ! ( resp[ 1 ] , 20.0 ) ;
871+
872+ impl_test_conclusion ! ( test_case, client. stream) ;
873+ }
874+
851875 #[ test]
852876 fn test_transaction_get ( ) {
853877 use bitcoin:: hashes:: hex:: FromHex ;
0 commit comments