aboutsummaryrefslogblamecommitdiffstats
path: root/app/scripts/popup.js
blob: a7e33e7ff9ec2125df43189830658680cd0cb6e0 (plain) (tree)
1
2
3
4
5
6
7
                              


                                                
                                                  

 







                                                        
 
            


                         









                                                        
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')


// 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)

function setupApp(accountManager){

  var container = document.getElementById('app-content')

  var app = MetaMaskUi({
    container: container,
    accountManager: accountManager,
  })

}