diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-03-30 01:53:43 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-03-30 01:53:43 +0800 |
commit | 84b3415b4479eb849b69d77a7e178c67fcaaf3fb (patch) | |
tree | cb6b0d50c9fd4f24283edffe6ba05c93dadef113 /library/example/index.js | |
parent | a20a237282c38da86b03625d08b48c2e58e83523 (diff) | |
download | tangerine-wallet-browser-84b3415b4479eb849b69d77a7e178c67fcaaf3fb.tar tangerine-wallet-browser-84b3415b4479eb849b69d77a7e178c67fcaaf3fb.tar.gz tangerine-wallet-browser-84b3415b4479eb849b69d77a7e178c67fcaaf3fb.tar.bz2 tangerine-wallet-browser-84b3415b4479eb849b69d77a7e178c67fcaaf3fb.tar.lz tangerine-wallet-browser-84b3415b4479eb849b69d77a7e178c67fcaaf3fb.tar.xz tangerine-wallet-browser-84b3415b4479eb849b69d77a7e178c67fcaaf3fb.tar.zst tangerine-wallet-browser-84b3415b4479eb849b69d77a7e178c67fcaaf3fb.zip |
WIP: lost enital call from dapp to getAccounts
Diffstat (limited to 'library/example/index.js')
-rw-r--r-- | library/example/index.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/library/example/index.js b/library/example/index.js index 329302a4d..aae7ccd19 100644 --- a/library/example/index.js +++ b/library/example/index.js @@ -1,4 +1,5 @@ window.addEventListener('load', web3Detect) +window.addEventListener('message', console.warn) function web3Detect() { if (global.web3) { @@ -12,18 +13,18 @@ function web3Detect() { function startApp(){ console.log('app started') - var primaryAccount = null + var primaryAccount console.log('getting main account...') - web3.eth.getAccounts(function(err, addresses){ - if (err) throw err + web3.eth.getAccounts((err, addresses) => { + if (err) console.error(err) console.log('set address', addresses[0]) - debugger primaryAccount = addresses[0] }) document.querySelector('.action-button-1').addEventListener('click', function(){ console.log('saw click') console.log('sending tx') + primaryAccount web3.eth.sendTransaction({ from: primaryAccount, to: primaryAccount, |