getTransactionsBatch method

Future<Map<String, BitcoinTransaction>> getTransactionsBatch(
  1. List<String> txids
)

Batch get transactions by txid list

Returns a map of txid → transaction for all found transactions. Like getTransaction without a wallet id, a txid stored by several wallets maps to the row of the wallet that stored it first. Default implementation loops over single-item getTransaction.

Implementation

Future<Map<String, BitcoinTransaction>> getTransactionsBatch(List<String> txids) async {
  final result = <String, BitcoinTransaction>{};
  for (final txid in txids) {
    final tx = await getTransaction(txid);
    if (tx != null) result[txid] = tx;
  }
  return result;
}