Open basharov opened 2 years ago
You could try subscribeToForwards
balance changing overall does not have an API
You could try subscribeToForwards
balance changing overall does not have an API
First, thank you Alex for the lightning-fast response! Second, yes, seems like it's what I need, shows the correct final balance, thank you!
Actually seems like this one returns the balance in similar way as invoice subscription, with the value which then changes without any way to detect it. Probably I can just run a background service which would query via rpc periodically, like every 5 seconds?
Yes since there is no balance changing API you can do polling
I can subscribe to outcoming payments with this:
When I get this event, I fetch the balance via calling
getChainBalance()
which returns me the accurate updated balance.However, when I create an invoice and pay it from another wallet, I only see this option to track the event of the incoming payment:
But, it won't return the accurate updated balance sometimes. It returns some balance but then it changes and this is not accurate.
So, I hope there is some other subscription I can use to see the fact of the balance change.
Is there any?
Thanks!