3

How do I get a simple and fast balance of ETH and all Token owned/stored within a wallet address?

I have seen similar question and the closer answer was in this demo: http://wbobeirne.com/eth-balance-checker-demo/

but why it returns only a subset of tokens? and does it make sens that it seems to "scan" all smart contracts looking for "holdings?

thank you all

1
  • I have progressed on my "tests"... apologize if this is too low level, but I am a newbie in the Ethereum World.... below my steps: 1) created an account in infura.io in order to have access to a full node (t be used as EVM) 2) installed web3.js in nodejs -> npm install web3 3) got ethereum balance with: web3.eth.getBalance(address [, defaultBlock] [, callback]) (connecting to the infura server) Is it there any way to list and look on all token generating contracts? How site like this one ethplorer.io gets the individual token balances?
    – FiNaR
    Jul 8, 2019 at 9:48

2 Answers 2

1

Disclosure - I work with QuickNode.

You can use the QuickNode Token API to get a wallet address's tokens.

  • qn_getWalletTokenBalance - Using this RPC method on a QuickNode Ethereum endpoint, you can fetch ERC-20 token a wallet holds.
0

If you want to implement this yourself, you'll have to iterate over each erc20 smart contract to get the balance for a specific address. Some APIs offer this functionality, so you don't have to do the heavy lifting.

An example is Cindercloud, which has APIs to access balance / token balances.

2
  • Thank you for this.... I am actually trying to do some testing and I was curious to do it myself..... any tip on where to start?
    – FiNaR
    Jul 2, 2019 at 14:22
  • I have progressed on my "tests"... apologize if this is too low level, but I am a newbie in the Ethereum World.... below my steps: 1) created an account in infura.io in order to have access to a full node (t be used as EVM)
    – FiNaR
    Jul 8, 2019 at 9:41

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.