<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="google" content="notranslate">
<meta http-equiv="Content-Language" content="en">
<title>Global - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous"></script>
<script src="scripts/semantic.min.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
<link type="text/css" rel="stylesheet" href="styles/semantic.min.css">
<link type="text/css" rel="stylesheet" href="styles/override.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><div class="ui vertical accordion"><div class="title"><div class="ui list"><div class="item"><i class="dropdown icon"></i><a href="ComposableObservableStore.html">ComposableObservableStore</a></div></div></div><div class="content"><ul class='methods'><li data-type='method'><a href="ComposableObservableStore.html#getFlatState">getFlatState</a></li><li data-type='method'><a href="ComposableObservableStore.html#updateStructure">updateStructure</a></li></ul></div></li></div><div class="ui vertical accordion"><div class="title"><div class="ui list"><div class="item"><i class="dropdown icon"></i><a href="EdgeEncryptor.html">EdgeEncryptor</a></div></div></div><div class="content"><ul class='methods'><li data-type='method'><a href="EdgeEncryptor.html#decrypt">decrypt</a></li><li data-type='method'><a href="EdgeEncryptor.html#encrypt">encrypt</a></li></ul></div></li></div><div class="ui vertical accordion"><div class="title"><div class="ui list"><div class="item"><i class="dropdown icon"></i><a href="TokenRatesController.html">TokenRatesController</a></div></div></div><div class="content"><ul class='methods'><li data-type='method'><a href="TokenRatesController.html#fetchExchangeRate">fetchExchangeRate</a></li><li data-type='method'><a href="TokenRatesController.html#updateExchangeRates">updateExchangeRates</a></li></ul></div></li></div><div class="ui vertical accordion"><div class="title"><div class="ui list"><div class="item"><i class="inverted dropdown icon"></i><a href="module.exports_module.exports.html">exports</a></div></div></div></li></div></ul><h3>Global</h3><ul><li><a href="global.html#blacklistedDomainCheck">blacklistedDomainCheck</a></li><li><a href="global.html#cleanContextForImports">cleanContextForImports</a></li><li><a href="global.html#config">config</a></li><li><a href="global.html#connectToAccountManager">connectToAccountManager</a></li><li><a href="global.html#doctypeCheck">doctypeCheck</a></li><li><a href="global.html#documentElementCheck">documentElementCheck</a></li><li><a href="global.html#initializePopup">initializePopup</a></li><li><a href="global.html#initialState">initialState</a></li><li><a href="global.html#logStreamDisconnectWarning">logStreamDisconnectWarning</a></li><li><a href="global.html#redirectToPhishingWarning">redirectToPhishingWarning</a></li><li><a href="global.html#restoreContextAfterImports">restoreContextAfterImports</a></li><li><a href="global.html#setupControllerConnection">setupControllerConnection</a></li><li><a href="global.html#setupInjection">setupInjection</a></li><li><a href="global.html#setupStreams">setupStreams</a></li><li><a href="global.html#setupWeb3Connection">setupWeb3Connection</a></li><li><a href="global.html#shouldInjectWeb3">shouldInjectWeb3</a></li><li><a href="global.html#suffixCheck">suffixCheck</a></li></ul>
</nav>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2>
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="config"><span class="type-signature">(constant) </span>config<span class="type-signature"> :<a href="global.html#Config">Config</a></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config.js.html">config.js</a>, <a href="config.js.html#line52">line 52</a>
</li></ul></dd>
</dl>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="global.html#Config">Config</a></span>
</li>
</ul>
<h4 class="name" id="initialState"><span class="type-signature">(constant) </span>initialState<span class="type-signature"> :<a href="global.html#FirstTimeState">FirstTimeState</a></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="first-time-state.js.html">first-time-state.js</a>, <a href="first-time-state.js.html#line14">line 14</a>
</li></ul></dd>
</dl>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type"><a href="global.html#FirstTimeState">FirstTimeState</a></span>
</li>
</ul>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="blacklistedDomainCheck"><span class="type-signature"></span>blacklistedDomainCheck<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="contentscript.js.html">contentscript.js</a>, <a href="contentscript.js.html#line172">line 172</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Checks if the current domain is blacklisted</p>
</div>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if the current domain is blacklisted</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="cleanContextForImports"><span class="type-signature"></span>cleanContextForImports<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="inpage.js.html">inpage.js</a>, <a href="inpage.js.html#line57">line 57</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Caches reference to global define object and deletes it</p>
</div>
<h4 class="name" id="connectToAccountManager"><span class="type-signature"></span>connectToAccountManager<span class="signature">(connectionStream, cb)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="popup-core.js.html">popup-core.js</a>, <a href="popup-core.js.html#line32">line 32</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Establishes streamed connections to background scripts and a Web3 provider</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>connectionStream</code></td>
<td class="type">
<span class="param-type">any</span>
</td>
<td class="description last"><p>PortStream instance establishing a background connection</p></td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Called when controller connection is established</p></td>
</tr>
</tbody>
</table>
<h4 class="name" id="doctypeCheck"><span class="type-signature"></span>doctypeCheck<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="contentscript.js.html">contentscript.js</a>, <a href="contentscript.js.html#line127">line 127</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Checks the doctype of the current document if it exists</p>
</div>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if the doctype is html or if none exists</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="documentElementCheck"><span class="type-signature"></span>documentElementCheck<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="contentscript.js.html">contentscript.js</a>, <a href="contentscript.js.html#line159">line 159</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Checks the documentElement of the current document</p>
</div>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if the documentElement is an html node or if none exists</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="initializePopup"><span class="type-signature"></span>initializePopup<span class="signature">(config, cb)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="popup-core.js.html">popup-core.js</a>, <a href="popup-core.js.html#line18">line 18</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Asynchronously initializes the MetaMask popup UI</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>Popup configuration object</p></td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Called when initialization is comlete</p></td>
</tr>
</tbody>
</table>
<h4 class="name" id="logStreamDisconnectWarning"><span class="type-signature"></span>logStreamDisconnectWarning<span class="signature">(remoteLabel, err)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="contentscript.js.html">contentscript.js</a>, <a href="contentscript.js.html#line106">line 106</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Error handler for page to plugin stream disconnections</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>remoteLabel</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Remote stream name</p></td>
</tr>
<tr>
<td class="name"><code>err</code></td>
<td class="type">
<span class="param-type">Error</span>
</td>
<td class="description last"><p>Stream connection error</p></td>
</tr>
</tbody>
</table>
<h4 class="name" id="redirectToPhishingWarning"><span class="type-signature"></span>redirectToPhishingWarning<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="contentscript.js.html">contentscript.js</a>, <a href="contentscript.js.html#line193">line 193</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Redirects the current page to a phishing information page</p>
</div>
<h4 class="name" id="restoreContextAfterImports"><span class="type-signature"></span>restoreContextAfterImports<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="inpage.js.html">inpage.js</a>, <a href="inpage.js.html#line69">line 69</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Restores global define object from cached reference</p>
</div>
<h4 class="name" id="setupControllerConnection"><span class="type-signature"></span>setupControllerConnection<span class="signature">(connectionStream, cb)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="popup-core.js.html">popup-core.js</a>, <a href="popup-core.js.html#line62">line 62</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Establishes a streamed connection to the background account manager</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>connectionStream</code></td>
<td class="type">
<span class="param-type">any</span>
</td>
<td class="description last"><p>PortStream instance establishing a background connection</p></td>
</tr>
<tr>
<td class="name"><code>cb</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last"><p>Called when the remote account manager connection is established</p></td>
</tr>
</tbody>
</table>
<h4 class="name" id="setupInjection"><span class="type-signature"></span>setupInjection<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="contentscript.js.html">contentscript.js</a>, <a href="contentscript.js.html#line29">line 29</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Creates a script tag that injects inpage.js</p>
</div>
<h4 class="name" id="setupStreams"><span class="type-signature"></span>setupStreams<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="contentscript.js.html">contentscript.js</a>, <a href="contentscript.js.html#line47">line 47</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Sets up two-way communication streams between the
browser extension and local per-page browser context</p>
</div>
<h4 class="name" id="setupWeb3Connection"><span class="type-signature"></span>setupWeb3Connection<span class="signature">(connectionStream)</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="popup-core.js.html">popup-core.js</a>, <a href="popup-core.js.html#line46">line 46</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Establishes a streamed connection to a Web3 provider</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>connectionStream</code></td>
<td class="type">
<span class="param-type">any</span>
</td>
<td class="description last"><p>PortStream instance establishing a background connection</p></td>
</tr>
</tbody>
</table>
<h4 class="name" id="shouldInjectWeb3"><span class="type-signature"></span>shouldInjectWeb3<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="contentscript.js.html">contentscript.js</a>, <a href="contentscript.js.html#line117">line 117</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Determines if Web3 should be injected</p>
</div>
<h5>Returns:</h5>
<div class="param-desc">
<p>True of Web3 should be injected</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="suffixCheck"><span class="type-signature"></span>suffixCheck<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="contentscript.js.html">contentscript.js</a>, <a href="contentscript.js.html#line141">line 141</a>
</li></ul></dd>
</dl>
<div class="description">
<p>Checks the current document extension</p>
</div>
<h5>Returns:</h5>
<div class="param-desc">
<p>True if the current extension is not prohibited</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<h4 class="name" id="Config">Config</h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config.js.html">config.js</a>, <a href="config.js.html#line41">line 41</a>
</li></ul></dd>
</dl>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>network</code></td>
<td class="type">
<span class="param-type"><a href="global.html#UrlConfig">UrlConfig</a></span>
</td>
<td class="description last"><p>Network configuration parameters</p></td>
</tr>
<tr>
<td class="name"><code>networkBeta</code></td>
<td class="type">
<span class="param-type"><a href="global.html#UrlConfig">UrlConfig</a></span>
</td>
<td class="description last"><p>Beta UI network configuration parameters</p></td>
</tr>
<tr>
<td class="name"><code>networkNames</code></td>
<td class="type">
<span class="param-type"><a href="global.html#NameConfig">NameConfig</a></span>
</td>
<td class="description last"><p>Network name configuration parameters</p></td>
</tr>
<tr>
<td class="name"><code>enums</code></td>
<td class="type">
<span class="param-type"><a href="global.html#EnumConfig">EnumConfig</a></span>
</td>
<td class="description last"><p>Application-wide string constants</p></td>
</tr>
</tbody>
</table>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h4 class="name" id="EnumConfig">EnumConfig</h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config.js.html">config.js</a>, <a href="config.js.html#line34">line 34</a>
</li></ul></dd>
</dl>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>DEFAULT_RPC</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Default network provider URL</p></td>
</tr>
<tr>
<td class="name"><code>OLD_UI_NETWORK_TYPE</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>BETA_UI_NETWORK_TYPE</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h4 class="name" id="FirstTimeState">FirstTimeState</h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="first-time-state.js.html">first-time-state.js</a>, <a href="first-time-state.js.html#line5">line 5</a>
</li></ul></dd>
</dl>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>Initial configuration parameters</p></td>
</tr>
<tr>
<td class="name"><code>NetworkController</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>Network controller state</p></td>
</tr>
</tbody>
</table>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h4 class="name" id="NameConfig">NameConfig</h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config.js.html">config.js</a>, <a href="config.js.html#line27">line 27</a>
</li></ul></dd>
</dl>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>3</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>URL of local RPC provider</p></td>
</tr>
<tr>
<td class="name"><code>4</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>URL of mainnet RPC provider</p></td>
</tr>
<tr>
<td class="name"><code>42</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>URL of Ropsten testnet RPC provider</p></td>
</tr>
</tbody>
</table>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h4 class="name" id="UrlConfig">UrlConfig</h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="config.js.html">config.js</a>, <a href="config.js.html#line18">line 18</a>
</li></ul></dd>
</dl>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>localhost</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>URL of local RPC provider</p></td>
</tr>
<tr>
<td class="name"><code>mainnet</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>URL of mainnet RPC provider</p></td>
</tr>
<tr>
<td class="name"><code>ropsten</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>URL of Ropsten testnet RPC provider</p></td>
</tr>
<tr>
<td class="name"><code>kovan</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>URL of Kovan testnet RPC provider</p></td>
</tr>
<tr>
<td class="name"><code>rinkeby</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>URL of Rinkeby testnet RPC provider</p></td>
</tr>
</tbody>
</table>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Apr 18 2018 17:21:38 GMT-0400 (EDT) using the radgrad jsdoc theme. Derived from docdash.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
<script>$('.ui.accordion').accordion();</script>
</body>
</html>