getWalletTransactions method

Future<M4eTransactionList> getWalletTransactions (M4eUniqueId walletId)

Returns [M4eTransactionList] of authenticated m4e user.

Throws [M4eServerException] if call to server fails

Throws [M4eServerException] with NO_INTERNET_CONNECTION error code device is not connected to the internet

Implementation

Future<M4eTransactionList> getWalletTransactions(M4eUniqueId walletId) async {
  if ((await _connectionChecker.hasConnection) ?? false) {
    try {
      final _transactionList =
          await _transactionApi.getWalletTransactions(walletId);

      if (_transactionList.transactions.isEmpty) {
        throw M4eExceptionMessages.kNotFoundException;
      }

      return _transactionList;
    } catch (e) {
      rethrow;
    }
  }

  throw M4eExceptionMessages.kNoInternetConnectionException;
}