hide You are viewing an archived web page, collected at the request of Ethereum Foundation using Archive-It. This page was captured on 15:18:39 Jun 25, 2021 , and is part of the Community collection. The information on this web page may be out of date. See All versions of this archived page. Loading media information

How Does MEW Know What Tokens I Have?

MelbourneDeveloperMelbourneDeveloper Member Posts: 4
edited June 2018 in web3-js
This is really a question about JSON RPC. I know that I can get eth_call to get the balance of a token at an address, but I've been looking everywhere to be able to figure out how to get the tokens that are at a given address.

This here will get the balance of TRX at an address:
{"id":1,"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0xf230b790e05390fc8295f4d3f60332c93bed42e2","data":"[ADDRESS ABI]"},"latest"]}

But, the above won't tell me which tokens are at a given address. However, MyEtherWallet somehow knows...

When I plugged my Trezor in, it saw that there was TRX associated with my account. I did a trace with fiddler, and the only HTTP transfer I saw was the above JSON RPC call. How is MEW figuring out which tokens are at the address?

This is an API that allows this to be done, but I'm guessing that is from an indexed database and not through the JSON RPC:


  • dra9onsdra9ons Member Posts: 7
    The address of the token contract is required to know the balance of the token. You can retrieve the balance of the desired address by calling the balanceOf method of the token contract.
Sign In or Register to comment.