getTransactionsByAccount method

Future<List<RosettaTransaction>> getTransactionsByAccount(
  1. dynamic accountAddress
)

Return an array of Transaction objects based on the specified parameters, or an empty array if none found. @param {string} accountAddress The account address to get the transactions of. @returns {Promise<Array

Implementation

Future<List<RosettaTransaction>> getTransactionsByAccount(
    accountAddress) async {
  try {
    final response = await transactionsByAccount(accountAddress);
    final transactions = response.transactions
        .map((rosetta.BlockTransaction blockTransaction) {
      return RosettaTransaction(blockTransaction.transaction,
          blockTransaction.block_identifier.index);
    }).toList();

    return transactions.reversed.toList();
  } catch (error) {
    //console.log(error);
    rethrow;
    // return TransactionError(
    //     error.message, axios.isAxiosError(error) ? error?.response?.status : undefined);
  }
}