I'm trying to set up a transaction listening stream. I have taken the Java snippet directly from the docs. Below is the part that is giving me an issue.
Server server = new Server("https://horizon-testnet.stellar.org");
final KeyPair account = KeyPair.fromAccountId("GC2BKLYOOYPDEFJKLKY6FNNRQMGFLVHJKQRGNSSRRGSMPGF32LHCQVGF");
PaymentsRequestBuilder paymentsRequest = server.payments().forAccount(account);
paymentsRequest.stream(new EventListener<OperationResponse>() {
@Override
public void onEvent(OperationResponse payment) { ... }
}
I'm getting an error on the OperationResponse
as the type parameter in the EventListener
, specifically stating:
Type java.util.EventListener
does not have type parameters
Also, the @Override
is not overriding a method from its superclass and onEvent
is never used.
I can't think what I am missing as this is taken straight from the docs and I know that the Stellar SDK is correctly setup in my app as I am already performing successful transactions.
FYI, this code snippet is sitting within the following method:
public void StellarTransactionListner(){
...
}