1

There is some way that I can subscribe to the balance to a address using web3js of Eth

2
  • When you use the word 'subscribe' here, do you mean get live updates as the balance changes? Or simply retrieve the data about the Ethereum balance? Commented Jul 20, 2018 at 18:13
  • yes when the balance of an account changes, using the subscribe of web3js Commented Jul 20, 2018 at 18:48

3 Answers 3

1

You can't directly subscribe to a value stored on the blockchain, though if you emit an event in the balance function then you can set up listeners for those events. See the documentation for more details.

1

Ethereum nodes missing APIs and events for Ether deposits and withdrawals. This has been "a missing feature" since 2014. So, you cannot easily know if there has been new ETH deposited an address. The only way to find out is to use tracing APIs designed for debugging.

This limitation applies only to the native currency of GoEthereum based blockchain nodes, like ETH for Ethereum, MATIC for Polygon and so on. ERC-20 tokens are easier.

0

Yes, you can subscribe to Balance updates using this API.

Here is an example https://ide.bitquery.io/Subscribe-to-balance-updates

Learn more from Bitquery Docs - https://docs.bitquery.io/docs/examples/balances/balance-api/

Your Answer

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

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