Using just 41 lines of HTML + JS, we create a Web3.JS application which can get the ETH Balance of an Ethereum Address
Read my Blog Post here: http://shawntabrizi.com/ethereum/ethereum-web3-js-hello-world-get-eth-balance-ethereum-address/
Read my correction to my original sample here: http://shawntabrizi.com/ethereum/correcting-ethereum-web3-js-hello-world/
Try it out here: http://shawntabrizi.com/ethbalance/
Using Web3.js: https://github.com/ethereum/web3.js
Using Infura.io: https://infura.io/
This project relies on an Ethereum provider to access data from the main network.
This app will first try to access any injected Web3 provider like that included with Metamask or the Brave browser.
Do note though, that if you want to use the injected Web3 provider, you must host this page on a local webserver, not just open the html file on your local filesystem.
Otherwise, you can provide an HTTP Web3 provider using a free API key generated by Infura or similar services. You will need to replace <APIKEY>
in this project.
https://github.com/shawntabrizi/ERC-20-Token-Balance
https://github.com/shawntabrizi/ETH-Balance-Graph