lastAddressFromAddress method

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

Get the last addresses from a list of addresses @param {String} address TransactionChain address

Implementation

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

  final Map<String, Transaction> transactionMap = await ApiService(endpoint!)
      .getLastTransaction(addresses, request: ' address ');

  final Map<String, String> lastAddressMap = <String, String>{};
  transactionMap.forEach((String key, Transaction value) {
    lastAddressMap[key] = value.address!;
  });

  return removeAliasPrefix<String>(lastAddressMap) ?? {};
}