How can I programmatically watch for change in balance for a account or just new incoming transactions?

looking for js-stellar-sdk method

1 Answer 1


Well, I just got this from another answer.

var StellarSdk = require('stellar-sdk')
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');

// Get a message any time a payment occurs. Cursor is set to "now" to be notified
// of payments happening starting from when this script runs (as opposed to from
// the beginning of time).
var es = server.payments()
    onmessage: function (message) {

To watch for a particular account you may try

var es = server.transactions()
        onmessage: txHandler

as explained here

  • did you ever get streaming balance data? The above is good example of streaming but the balance question remains. Jun 27, 2022 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.