Getting a balance for a token from the JSON RPC is simple. This is all I need to get a Tronix balance. The "0xf230b790e05390fc8295f4d3f60332c93bed42e2" part is the contract address for Tronix.
But, how do I check what contracts are at an address?
If I do a eth_getTransactionReceipt on a transaction, I can get the contract address, but I need to know what transactions are at the address first. I can't figure this one out... How can I know which transactions have hit an address?
This Ethsplorer API call is exactly what I'm looking for, but I can't figure out how to do this with the JSON RPC: https://api.ethplorer.io/getAddressInfo/0xff71cb760666ab06aa73f34995b42dd4b85ea07b?apiKey=freekey
From doing some reading, a lot of people are saying that I have to scan the entire Blockchain, but I am 90% sure that it is possible to achieve what I am looking for because MyEtherWallet does it. When I connect my Trezor, it makes the above eth_call call and passes the Tronix contract address in to the call, so it knows that there is Tronix at the address, but how does it know this? It's clear that MEW is not scanning the entire Blockchain when I query my wallet, so either they have figured out how to do this with the normal JSON RPC with a call that I'm not understanding properly, or they are making a secret call to some server indexed by addresses.