Created
April 14, 2018 20:13
-
-
Save saurfang/648d9b5d8f06591ce151e0ac475da166 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get accounts managed by Metamask | |
var account; | |
web3.eth.getAccounts((err, acc) => {account = acc[0]}); | |
console.log(account); | |
// get balance | |
web3.eth.getBalance(account, (err, balance) => { | |
console.log(web3.fromWei(web3.toDecimal(balance), 'ether')) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment