diff options
author | kumavis <aaron@kumavis.me> | 2016-08-27 08:39:19 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2016-08-27 08:39:19 +0800 |
commit | b7aab955196a7cef2705e8546814b5c6c1830da7 (patch) | |
tree | 19c1b72359af5372bb800b2e268ce7f146ddb915 /library/example/index.js | |
parent | 23a144fb8b0b214b9c352ee523405d5ecd03046e (diff) | |
download | tangerine-wallet-browser-b7aab955196a7cef2705e8546814b5c6c1830da7.tar.gz tangerine-wallet-browser-b7aab955196a7cef2705e8546814b5c6c1830da7.tar.zst tangerine-wallet-browser-b7aab955196a7cef2705e8546814b5c6c1830da7.zip |
library - basic test server + partial safari fixes
Diffstat (limited to 'library/example/index.js')
-rw-r--r-- | library/example/index.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/library/example/index.js b/library/example/index.js index d24c26f87..bdde2b47f 100644 --- a/library/example/index.js +++ b/library/example/index.js @@ -4,8 +4,10 @@ window.addEventListener('load', web3Detect) function web3Detect() { if (global.web3) { document.body.innerHTML += 'web3 detected!' + console.log('web3 detected!') } else { document.body.innerHTML += 'no web3 detected!' + console.log('no web3 detected!') } startApp() } @@ -13,12 +15,17 @@ function web3Detect() { var primaryAccount = null web3.eth.getAccounts(function(err, addresses){ if (err) throw err + console.log('set address') primaryAccount = addresses[0] }) function startApp(){ + console.log('app started') + document.querySelector('.action-button-1').addEventListener('click', function(){ + console.log('saw click') + console.log('sending tx') web3.eth.sendTransaction({ from: primaryAccount, value: 0, @@ -28,7 +35,9 @@ function startApp(){ }) }) document.querySelector('.action-button-2').addEventListener('click', function(){ + console.log('saw click') setTimeout(function(){ + console.log('sending tx') web3.eth.sendTransaction({ from: primaryAccount, value: 0, |