Browse Source
1f5a6f1 Merge branch 'develop' into cpp da4c2d5 removed promise dependency, updated readme, fixed node.js version of lib 5b70196 upgraded version to 0.0.9 c595632 gulp c561039 Merge branch 'master' into sync a7f4448 Merge branch 'develop' into sync 7807a4f polling every second e5d294d return null instead of undefined, if not provider is set d0b6f36 watches are calling callback with a single result object, not a full jsonrpc response fa93480 added addressbook 063f69d added local b2d23b9 Merge pull request #32 from kumavis/patch-1 e97478c WebsocketProvider - fixed incorrect variable name 507241f shh getMessage => getMessages git-subtree-dir: libjsqrc/ethereumjs git-subtree-split: 1f5a6f13419415b4c05519e126eedcdf815aff7ccl-refactor
Marek Kotewicz
10 years ago
20 changed files with 78 additions and 68 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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); |
|||
}); |
@ -0,0 +1,18 @@ |
|||
var addressName = {"0x12378912345789": "Gav", "0x57835893478594739854": "Jeff"}; |
|||
var nameAddress = {}; |
|||
|
|||
for (var prop in addressName) { |
|||
if (addressName.hasOwnProperty(prop)) { |
|||
nameAddress[addressName[prop]] = prop; |
|||
} |
|||
} |
|||
|
|||
var local = { |
|||
addressBook:{ |
|||
byName: addressName, |
|||
byAddress: nameAddress |
|||
} |
|||
}; |
|||
|
|||
if (typeof(module) !== "undefined") |
|||
module.exports = local; |
Loading…
Reference in new issue