getTransactionIndex method

Future<Map<String, int>> getTransactionIndex(
  1. List<String> addresses
)

Implementation

Future<Map<String, int>> getTransactionIndex(List<String> addresses) async {
  if (addresses.isEmpty) {
    return {};
  }

  final lastTransactionMap =
      await getLastTransaction(addresses, request: 'chainLength');

  final lastTransactionIndexMap = <String, int>{};
  lastTransactionMap.forEach((key, value) {
    lastTransactionIndexMap[key] = value.chainLength ?? 0;
  });

  return removeAliasPrefix<int>(lastTransactionIndexMap) ?? {};
}