mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-23 03:28:07 +00:00
* HTTP Basic Auth, some cleanups There’s no need for additional dependency `btoa` as `XHR2` already has the support for Basic Auth. * remove redundant code * fix semicolons * Rewrite Basic Auth to support both sync and async calls. * semicolon consistency * Documentation for Basic Auth connection added. * Add Community and Other implementations to README * remove contributors
13 lines
295 B
JavaScript
13 lines
295 B
JavaScript
#!/usr/bin/env node
|
|
|
|
var Web3 = require('../index.js');
|
|
var web3 = new Web3();
|
|
|
|
web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545'));
|
|
|
|
var coinbase = web3.eth.coinbase;
|
|
console.log(coinbase);
|
|
|
|
var balance = web3.eth.getBalance(coinbase);
|
|
console.log(balance.toString(10));
|