Skip to content

Commit c50a023

Browse files
feat: get_raw_transaction_multi
1 parent d7df63e commit c50a023

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

client/src/client.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
99
//
1010

11-
use std::collections::HashMap;
11+
use std::collections::{BTreeMap, HashMap};
1212
use std::fs::File;
1313
use std::iter::FromIterator;
1414
use std::path::PathBuf;
@@ -437,6 +437,16 @@ pub trait RpcApi: Sized {
437437
Ok(dashcore::consensus::encode::deserialize(&bytes)?)
438438
}
439439

440+
fn get_raw_transaction_multi(
441+
&self,
442+
transactions_by_block_hash: BTreeMap<&BlockHash, Vec<&dashcore::Txid>>,
443+
) -> Result<BTreeMap<dashcore::Txid, Transaction>> {
444+
let mut args = [into_json(transactions_by_block_hash)?, into_json(false)?];
445+
let hex: String = self.call("getrawtransactionmulti", handle_defaults(&mut args, &[null()]))?;
446+
let bytes: Vec<u8> = FromHex::from_hex(&hex)?;
447+
Ok(dashcore::consensus::encode::deserialize(&bytes)?)
448+
}
449+
440450
fn get_raw_transaction_hex(
441451
&self,
442452
txid: &dashcore::Txid,

0 commit comments

Comments
 (0)