I need to retrieve some transactions from a specific account and then read the memo. I've tried a couple of different methods with no success. My first attempt was as below, but I get odd looking memo values that look like this: 1txn = org.stellar.sdk.MemoText@223d2c72 .
System.out.println("Transactions for account " + currentUser.userKeys.getAccountId());
System.out.println("And secret seed: " + String.valueOf(currentUser.userKeys.getSecretSeed()));
System.out.println(" ");
Server server = new Server("https://horizon-testnet.stellar.org");
TransactionsRequestBuilder txnRequests = server.transactions().forAccount(currentUser.userKeys)
.order(RequestBuilder.Order.DESC);
List<TransactionResponse> responses = new ArrayList<>();
Page<TransactionResponse> page = txnRequests.execute();
System.out.println(page.toString());
responses.addAll(page.getRecords());
responses.forEach(txn -> {System.out.println("1txn = " + txn.getMemo());});
I read another post stating that MemoText is a class and that I should use MemoText.getText() to get the text from the transactions i receive, but can't figure out how to use the class to retrieve the memo. It would be very helpful if someone could provide a short example. Thanks in advance.