Created
May 25, 2021 04:19
-
-
Save neopunisher/396a04b116d862f3452b8088ec55e93c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var EventSource = require("eventsource"); | |
var es = new EventSource( | |
"https://horizon-testnet.stellar.org/accounts/GB7JFK56QXQ4DVJRNPDBXABNG3IVKIXWWJJRJICHRU22Z5R5PI65GAK3/payments", | |
); | |
es.onmessage = function (message) { | |
var result = message.data ? JSON.parse(message.data) : message; | |
console.log("New payment:"); | |
console.log(result); | |
}; | |
es.onerror = function (error) { | |
console.log("An error occurred!"); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment