getWalletTransactionLogs method

Future<TransactionLogList> getWalletTransactionLogs (UniqueId walletId)

Returns TransactionLogList of wallet whose wallet-id is passed as method parameter.

Throws AuthException if no m4e user is authenticated

Throws CacheException if no TransactionLog is returned from cache on no-internet connectivity

Throws ServerException if request fails. This could be as a result of a Request timeout, Socket Exception or General server error

Implementation

// TODO: Pass-in token from application when issueing a request
Future<TransactionLogList> getWalletTransactionLogs(UniqueId walletId) async {
  if ((await _connectionChecker.hasConnection) ?? false) {
    try {
      final _transactionLogs =
          await _transactionApi.getWalletTransactionLogs(walletId);

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

  throw ExceptionMessages.kNoInternetConnectionException;
}