searchTransactionsForWalletType function
Implementation
Future<(Set<ElectrumTransactionInfo>, Set<NodeWithAddress>)>
searchTransactionsForWalletType({
required BipNode masterNode,
required HDWalletPurpose? purpose,
required Iterable<AddressType> addressTypes,
required UTXONetworkType networkType,
required List<(String, int)> endpoints,
required List<NodeWithAddress> cachedNodes,
required IsolateManager isolateManager,
}) async {
final receiveTxsFuture = searchForTransactions(
masterNode: masterNode,
chainIndex: EXTERNAL_CHAIN_INDEX,
addressTypes: addressTypes,
walletPurpose: purpose,
networkType: networkType,
endpoints: endpoints,
cachedNodes: cachedNodes,
isolateManager: isolateManager,
);
final changeTxsFuture = searchForTransactions(
masterNode: masterNode,
chainIndex: INTERNAL_CHAIN_INDEX,
addressTypes: addressTypes,
walletPurpose: purpose,
networkType: networkType,
endpoints: endpoints,
cachedNodes: cachedNodes,
isolateManager: isolateManager,
);
final allTxsResult = await Future.wait([receiveTxsFuture, changeTxsFuture]);
final allTxs = allTxsResult.expand((element) => element.$1).toSet();
final nodes = allTxsResult.expand((element) => element.$2).toSet();
return (allTxs, nodes);
}