getTransactionContent method

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

Query the network to find a transaction from a list of addresses

Implementation

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

  try {
    final transactionChainMap = await getTransaction(
      addresses,
      request: 'data { content }',
    );

    final contentMap = <String, String>{};

    transactionChainMap.forEach((key, transaction) {
      final content = transaction.data?.content;
      if (content != null) {
        contentMap[key] = content;
      }
    });

    return removeAliasPrefix<String>(contentMap) ?? {};
  } catch (e, stack) {
    _logger.severe(
      'getTransactionContent failed',
      e,
      stack,
    );
    rethrow;
  }
}