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 transactionMap = await ApiService(
    endpoint!,
  ).getLastTransaction(addresses, request: ' address ');

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

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