I am working on using the Nud method calls but every time I make a call to check the balance of an address it always returns 0.
For example if I do the call
./nud -unit=B getreceivedbyaddress BL3vYTwJmWKMAqPXaSNbiYtZdQaegTM9uA
It returns 0. Even tho at the time of this posting the address has funds in it. I have also tried adding a 0 or 1 at the end to say 0 or 1 confirmation but still get 0 returned.
This command works only for addresses you own. It furthermore doesn’t return what you want. getreceivedbyaddress returns the total amount of coins that were ever received by the address. Furthermore it is unsafe to trace the balance of an address because of change addresses.
What you would need are watch-only addresses. Then you can call "setaccount " and afterwards retrieve the balance through getbalance. However, I don’t know if watch-only addresses are on the development roadmap right now.
So currently the only way I see is to make a blocknotify that checks if the address is involved in one of the transactions of the block and updates the balance accordingly.
Basically you have all you need (to ge the balance of an address) on a machine with a fully synchronized block chain.
But if you don’t want to store information about transactions in a database where you can comfortably look for balances per address, you need to scan the whole block chain for a balance of an address.
While one could argue that it’d be nice to have that included in the wallet, there are other convenient ways to do that.
Here you are: https://blockexplorer.nu/address/BL3vYTwJmWKMAqPXaSNbiYtZdQaegTM9uA/1/newest
Thanks. It could need some rebranding Is it planned to extend this PPC based implementation to allow the query of Nu related stuff like votes, liquidity etc?