diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/balance.html | 1 | ||||
-rw-r--r-- | example/contract.html | 1 | ||||
-rw-r--r-- | example/node-app.js | 18 |
3 files changed, 7 insertions, 13 deletions
diff --git a/example/balance.html b/example/balance.html index 60b8bbe87..88f55315a 100644 --- a/example/balance.html +++ b/example/balance.html @@ -2,7 +2,6 @@ <html> <head> -<script type="text/javascript" src="js/es6-promise/promise.min.js"></script> <script type="text/javascript" src="js/bignumber.js/bignumber.min.js"></script> <script type="text/javascript" src="../dist/ethereum.js"></script> <script type="text/javascript"> diff --git a/example/contract.html b/example/contract.html index f3dd7d3af..da2282c86 100644 --- a/example/contract.html +++ b/example/contract.html @@ -2,7 +2,6 @@ <html> <head> -<script type="text/javascript" src="js/es6-promise/promise.min.js"></script> <script type="text/javascript" src="js/bignumber.js/bignumber.min.js"></script> <script type="text/javascript" src="../dist/ethereum.js"></script> <script type="text/javascript"> diff --git a/example/node-app.js b/example/node-app.js index f63fa9115..8c2fc0ba3 100644 --- a/example/node-app.js +++ b/example/node-app.js @@ -1,16 +1,12 @@ #!/usr/bin/env node -require('es6-promise').polyfill(); - var web3 = require("../index.js"); -web3.setProvider(new web3.providers.HttpRpcProvider('http://localhost:8080')); +web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080')); + +var coinbase = web3.eth.coinbase; +console.log(coinbase); + +var balance = web3.eth.balanceAt(coinbase); +console.log(balance); -web3.eth.coinbase.then(function(result){ - console.log(result); - return web3.eth.balanceAt(result); -}).then(function(balance){ - console.log(web3.toDecimal(balance)); -}).catch(function(err){ - console.log(err); -});
\ No newline at end of file |