There are plenty of examples of reading the balance of an ERC20 token from an address via a
balanceOf.call when knowing the token contract address beforehand. However, how would one go about reading the balance of an address without knowing which tokens the address might hold?
For example, a user wishes to know the total balance (ETH + tokens) of his address. What would be the most efficient way of retrieving this information without doing any unnecessary calculations?
Should I just loop through an array of the most popular token contract addresses? Look at the incoming token transfer events? or are there more efficient ways?
Just to specify, I am looking for a solution with a private node not an API.
Examples of pages that have achieved this:
Any help would be greatly appreciated!