https://github.com/shawntabrizi/ethbalance
Ethereum and Web3.js “Hello World”: Get the ETH Balance of an Ethereum Address
https://github.com/shawntabrizi/ethbalance
ethereum web3js
Last synced: 12 months ago
JSON representation
Ethereum and Web3.js “Hello World”: Get the ETH Balance of an Ethereum Address
- Host: GitHub
- URL: https://github.com/shawntabrizi/ethbalance
- Owner: shawntabrizi
- License: mit
- Created: 2017-11-02T10:17:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-27T21:40:14.000Z (over 5 years ago)
- Last Synced: 2025-04-23T14:41:20.256Z (about 1 year ago)
- Topics: ethereum, web3js
- Language: HTML
- Homepage: http://shawntabrizi.com/ethbalance/
- Size: 111 KB
- Stars: 28
- Watchers: 5
- Forks: 30
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ETH-Balance
### Ethereum and Web3.js “Hello World”: Get the ETH Balance of an Ethereum Address
#### 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/
## How To Use
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](https://metamask.io/) or the [Brave browser](https://brave.com/).
Do note though, that if you want to use the injected Web3 provider, you [must host this page on a local webserver](https://ethereum.stackexchange.com/questions/46399/unable-to-connect-to-metamask-using-web3), 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](https://infura.io/) or similar services. You will need to replace `` in this project.
## Check out other simple Web3.js samples
https://github.com/shawntabrizi/ERC-20-Token-Balance
https://github.com/shawntabrizi/ETH-Balance-Graph