aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/popup.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-01-15 18:03:42 +0800
committerkumavis <aaron@kumavis.me>2016-01-15 18:03:42 +0800
commit7347a66eb0f4d5ab7f7d95e3657179408f4319f9 (patch)
tree397654c26a511ec07d9e914ff85ffb32f2eb1db4 /app/scripts/popup.js
parent3eaf027e30a3a28d75fb8f93cd30387a777c5814 (diff)
downloadtangerine-wallet-browser-7347a66eb0f4d5ab7f7d95e3657179408f4319f9.tar
tangerine-wallet-browser-7347a66eb0f4d5ab7f7d95e3657179408f4319f9.tar.gz
tangerine-wallet-browser-7347a66eb0f4d5ab7f7d95e3657179408f4319f9.tar.bz2
tangerine-wallet-browser-7347a66eb0f4d5ab7f7d95e3657179408f4319f9.tar.lz
tangerine-wallet-browser-7347a66eb0f4d5ab7f7d95e3657179408f4319f9.tar.xz
tangerine-wallet-browser-7347a66eb0f4d5ab7f7d95e3657179408f4319f9.tar.zst
tangerine-wallet-browser-7347a66eb0f4d5ab7f7d95e3657179408f4319f9.zip
integrate metamask-ui with id mgmt
Diffstat (limited to 'app/scripts/popup.js')
-rw-r--r--app/scripts/popup.js25
1 files changed, 21 insertions, 4 deletions
diff --git a/app/scripts/popup.js b/app/scripts/popup.js
index 03530ce66..a7e33e7ff 100644
--- a/app/scripts/popup.js
+++ b/app/scripts/popup.js
@@ -1,13 +1,30 @@
+const Dnode = require('dnode')
const MetaMaskUi = require('metamask-ui')
const MetaMaskUiCss = require('metamask-ui/css')
const injectCss = require('inject-css')
+const PortStream = require('./lib/port-stream.js')
-var container = document.getElementById('app-content')
+// setup communication with background
+var pluginPort = chrome.runtime.connect({name: 'popup'})
+var duplex = new PortStream(pluginPort)
+var background = Dnode({
+ // setUnconfirmedTxs: setUnconfirmedTxs,
+})
+duplex.pipe(background).pipe(duplex)
+background.once('remote', setupApp)
+// setup app
var css = MetaMaskUiCss()
injectCss(css)
-var app = MetaMaskUi({
- container: container,
-})
+function setupApp(accountManager){
+
+ var container = document.getElementById('app-content')
+
+ var app = MetaMaskUi({
+ container: container,
+ accountManager: accountManager,
+ })
+
+} \ No newline at end of file