diff options
author | frankiebee <frankie.diamond@gmail.com> | 2017-04-03 17:08:31 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2017-04-03 17:09:03 +0800 |
commit | 57655073f6ab4e93b9947302d46a20bd2c7288f1 (patch) | |
tree | 3bce06d9ccd8f003cec720b8444d489e1ed6c050 /library/example | |
parent | 9736e96a93799f081ede01bc7ecd295fa264ffd5 (diff) | |
download | tangerine-wallet-browser-57655073f6ab4e93b9947302d46a20bd2c7288f1.tar tangerine-wallet-browser-57655073f6ab4e93b9947302d46a20bd2c7288f1.tar.gz tangerine-wallet-browser-57655073f6ab4e93b9947302d46a20bd2c7288f1.tar.bz2 tangerine-wallet-browser-57655073f6ab4e93b9947302d46a20bd2c7288f1.tar.lz tangerine-wallet-browser-57655073f6ab4e93b9947302d46a20bd2c7288f1.tar.xz tangerine-wallet-browser-57655073f6ab4e93b9947302d46a20bd2c7288f1.tar.zst tangerine-wallet-browser-57655073f6ab4e93b9947302d46a20bd2c7288f1.zip |
Rename mascara root directory
Diffstat (limited to 'library/example')
-rw-r--r-- | library/example/index.html | 17 | ||||
-rw-r--r-- | library/example/index.js | 57 |
2 files changed, 0 insertions, 74 deletions
diff --git a/library/example/index.html b/library/example/index.html deleted file mode 100644 index 47d6da34f..000000000 --- a/library/example/index.html +++ /dev/null @@ -1,17 +0,0 @@ -<!doctype html> - -<html lang="en"> -<head> - <meta charset="utf-8"> - - <title>MetaMask ZeroClient Example</title> - -</head> - -<body> - <button class="action-button-1">SYNC TX</button> - <button class="action-button-2">ASYNC TX</button> - <script src="./zero.js"></script> - <script src="./app.js"></script> -</body> -</html>
\ No newline at end of file diff --git a/library/example/index.js b/library/example/index.js deleted file mode 100644 index aae7ccd19..000000000 --- a/library/example/index.js +++ /dev/null @@ -1,57 +0,0 @@ -window.addEventListener('load', web3Detect) -window.addEventListener('message', console.warn) - -function web3Detect() { - if (global.web3) { - logToDom('web3 detected!') - startApp() - } else { - logToDom('no web3 detected!') - } -} - -function startApp(){ - console.log('app started') - - var primaryAccount - console.log('getting main account...') - web3.eth.getAccounts((err, addresses) => { - if (err) console.error(err) - console.log('set address', addresses[0]) - 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, - value: 0, - }, function(err, txHash){ - if (err) throw err - console.log('sendTransaction result:', err || txHash) - }) - }) - document.querySelector('.action-button-2').addEventListener('click', function(){ - console.log('saw click') - setTimeout(function(){ - console.log('sending tx') - web3.eth.sendTransaction({ - from: primaryAccount, - to: primaryAccount, - value: 0, - }, function(err, txHash){ - if (err) throw err - console.log('sendTransaction result:', err || txHash) - }) - }) - }) - -} - -function logToDom(message){ - document.body.appendChild(document.createTextNode(message)) - console.log(message) -} |