diff options
Diffstat (limited to 'app/scripts/popup.js')
-rw-r--r-- | app/scripts/popup.js | 25 |
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 |