aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorEsteban MIno <efmino@uc.cl>2018-08-04 02:56:02 +0800
committerEsteban MIno <efmino@uc.cl>2018-08-04 02:56:02 +0800
commit21a61f2987ae83a48bb1f7256ec9c34978413eb2 (patch)
tree3bc9ef3d342f17269942cd3fe58da1f3b97ef214 /app
parent0481335dda447ba4c228d146834952bac0ad641b (diff)
parentfa4423bab2886017996955f809b6e3102cbf1781 (diff)
downloadtangerine-wallet-browser-21a61f2987ae83a48bb1f7256ec9c34978413eb2.tar
tangerine-wallet-browser-21a61f2987ae83a48bb1f7256ec9c34978413eb2.tar.gz
tangerine-wallet-browser-21a61f2987ae83a48bb1f7256ec9c34978413eb2.tar.bz2
tangerine-wallet-browser-21a61f2987ae83a48bb1f7256ec9c34978413eb2.tar.lz
tangerine-wallet-browser-21a61f2987ae83a48bb1f7256ec9c34978413eb2.tar.xz
tangerine-wallet-browser-21a61f2987ae83a48bb1f7256ec9c34978413eb2.tar.zst
tangerine-wallet-browser-21a61f2987ae83a48bb1f7256ec9c34978413eb2.zip
merge develop
Diffstat (limited to 'app')
-rw-r--r--app/404.html52
-rw-r--r--app/_locales/en/messages.json158
-rw-r--r--app/_locales/index.json4
-rw-r--r--app/_locales/ja/messages.json33
-rw-r--r--app/error.html79
-rw-r--r--app/images/404.pngbin0 -> 39401 bytes
-rw-r--r--app/images/alert-red.svg14
-rw-r--r--app/images/alert.svg19
-rw-r--r--app/images/cancel.pngbin0 -> 10928 bytes
-rw-r--r--app/images/caret-left.svg18
-rw-r--r--app/images/connect-icon.svg11
-rw-r--r--app/images/deadface.pngbin0 -> 8333 bytes
-rw-r--r--app/images/ethereum-metamask-chrome.pngbin0 -> 60022 bytes
-rw-r--r--app/images/hardware-wallet-step-1.svg44
-rw-r--r--app/images/hardware-wallet-step-2.svg81
-rw-r--r--app/images/hardware-wallet-step-3.svg42
-rw-r--r--app/images/loginglogo.svg53
-rw-r--r--app/images/logo.pngbin0 -> 6589 bytes
-rw-r--r--app/images/pw-128x128.pngbin0 -> 94988 bytes
-rw-r--r--app/images/pw-48x48.pngbin0 -> 3279 bytes
-rw-r--r--app/images/pw128x128.pngbin0 -> 94988 bytes
-rw-r--r--app/loading.html35
-rw-r--r--app/manifest.json14
-rw-r--r--app/phishing.html60
-rw-r--r--app/scripts/background.js16
-rw-r--r--app/scripts/contentscript.js12
-rw-r--r--app/scripts/controllers/balance.js4
-rw-r--r--app/scripts/controllers/blacklist.js2
-rw-r--r--app/scripts/controllers/computed-balances.js2
-rw-r--r--app/scripts/controllers/currency.js8
-rw-r--r--app/scripts/controllers/detect-tokens.js130
-rw-r--r--app/scripts/controllers/network/enums.js3
-rw-r--r--app/scripts/controllers/network/network.js5
-rw-r--r--app/scripts/controllers/preferences.js30
-rw-r--r--app/scripts/controllers/recent-blocks.js2
-rw-r--r--app/scripts/controllers/transactions/nonce-tracker.js13
-rw-r--r--app/scripts/controllers/transactions/tx-gas-utils.js12
-rw-r--r--app/scripts/controllers/transactions/tx-state-manager.js6
-rw-r--r--app/scripts/lib/cleanErrorStack.js2
-rw-r--r--app/scripts/lib/contracts/registrar.js1
-rw-r--r--app/scripts/lib/contracts/resolver.js2
-rw-r--r--app/scripts/lib/createErrorMiddleware.js2
-rw-r--r--app/scripts/lib/createStreamSink.js2
-rw-r--r--app/scripts/lib/diagnostics-reporter.js6
-rw-r--r--app/scripts/lib/extractEthjsErrorMessage.js4
-rw-r--r--app/scripts/lib/get-first-preferred-lang-code.js2
-rw-r--r--app/scripts/lib/getObjStructure.js6
-rw-r--r--app/scripts/lib/inpage-provider.js5
-rw-r--r--app/scripts/lib/ipfsContent.js44
-rw-r--r--app/scripts/lib/local-store.js12
-rw-r--r--app/scripts/lib/notification-manager.js10
-rw-r--r--app/scripts/lib/port-stream.js2
-rw-r--r--app/scripts/lib/reportFailedTxToSentry.js2
-rw-r--r--app/scripts/lib/resolver.js71
-rw-r--r--app/scripts/lib/setupMetamaskMeshMetrics.js2
-rw-r--r--app/scripts/lib/setupRaven.js22
-rw-r--r--app/scripts/lib/util.js2
-rw-r--r--app/scripts/metamask-controller.js175
-rw-r--r--app/scripts/migrations/013.js2
-rw-r--r--app/scripts/migrations/023.js4
-rw-r--r--app/scripts/migrations/027.js35
-rw-r--r--app/scripts/migrations/index.js1
-rw-r--r--app/scripts/platforms/extension.js67
-rw-r--r--app/scripts/popup-core.js2
-rw-r--r--app/scripts/ui.js3
-rw-r--r--app/unsupport.html59
66 files changed, 1409 insertions, 100 deletions
diff --git a/app/404.html b/app/404.html
new file mode 100644
index 000000000..8a6df9d7a
--- /dev/null
+++ b/app/404.html
@@ -0,0 +1,52 @@
+<html>
+<head>
+ <title>MetaMask</title>
+ <style>
+ *{
+ padding: 0;
+ margin: 0;
+ box-sizing: border-box;
+ }
+ img{
+ display: block;
+ }
+ html, body{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 100%;
+ }
+ .app{
+ position: relative;
+ width: 100%;
+ height: auto;
+ overflow: hidden;
+ }
+ img{
+ display: block;
+ width: 100%;
+ height: auto;
+ }
+ h2{
+ display: block;
+ width: 100%;
+ overflow: hidden;
+ position: absolute;
+ bottom: 20%;
+ left: 0;
+ color: #1b243d;
+ text-align: center;
+ }
+ h2 > a{
+ color: #1b243d;
+ }
+ </style>
+</head>
+<body>
+ <div class="app">
+ <img src="./images/404.png" alt="">
+ <h2>Powered by <a href="https://www.portal.network/">Portal Network</a></h2>
+ </div>
+</body>
+</html>
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json
index 2579da87d..8d65bc596 100644
--- a/app/_locales/en/messages.json
+++ b/app/_locales/en/messages.json
@@ -11,6 +11,9 @@
"accountName": {
"message": "Account Name"
},
+ "accountSelectionRequired": {
+ "message": "You need to select an account!"
+ },
"address": {
"message": "Address"
},
@@ -40,6 +43,9 @@
"message": "MetaMask",
"description": "The name of the application"
},
+ "approve": {
+ "message": "Approve"
+ },
"approved": {
"message": "Approved"
},
@@ -77,6 +83,9 @@
"borrowDharma": {
"message": "Borrow With Dharma (Beta)"
},
+ "browserNotSupported": {
+ "message": "Your Browser is not supported..."
+ },
"builtInCalifornia": {
"message": "MetaMask is designed and built in California."
},
@@ -89,6 +98,9 @@
"buyCoinbaseExplainer": {
"message": "Coinbase is the world’s most popular way to buy and sell bitcoin, ethereum, and litecoin."
},
+ "bytes": {
+ "message": "Bytes"
+ },
"ok": {
"message": "Ok"
},
@@ -104,6 +116,9 @@
"close": {
"message": "Close"
},
+ "chromeRequiredForTrezor":{
+ "message": "You need to use Metamask on Google Chrome in order to connect to your TREZOR device."
+ },
"confirm": {
"message": "Confirm"
},
@@ -119,6 +134,24 @@
"confirmTransaction": {
"message": "Confirm Transaction"
},
+ "connectHardwareWallet": {
+ "message": "Connect Hardware Wallet"
+ },
+ "connect": {
+ "message": "Connect"
+ },
+ "connecting": {
+ "message": "Connecting..."
+ },
+ "connectToTrezor": {
+ "message": "Connect to Trezor"
+ },
+ "connectToTrezorHelp": {
+ "message": "Metamask is able to access your TREZOR ethereum accounts. First make sure your device is connected and unlocked."
+ },
+ "connectToTrezorTrouble": {
+ "message": "If you are having trouble, please make sure you are using the latest version of the TREZOR firmware."
+ },
"continue": {
"message": "Continue"
},
@@ -149,6 +182,9 @@
"copyContractAddress": {
"message": "Copy Contract Address"
},
+ "copyAddress": {
+ "message": "Copy address to clipboard"
+ },
"copyToClipboard": {
"message": "Copy to clipboard"
},
@@ -244,9 +280,15 @@
"done": {
"message": "Done"
},
+ "downloadGoogleChrome": {
+ "message": "Download Google Chrome"
+ },
"downloadStateLogs": {
"message": "Download State Logs"
},
+ "dontHaveATrezorWallet": {
+ "message": "Don't have a TREZOR hardware wallet?"
+ },
"dropped": {
"message": "Dropped"
},
@@ -265,6 +307,9 @@
"encryptNewDen": {
"message": "Encrypt your new DEN"
},
+ "ensNameNotFound": {
+ "message": "ENS name not found"
+ },
"enterPassword": {
"message": "Enter password"
},
@@ -274,6 +319,9 @@
"enterPasswordContinue": {
"message": "Enter password to continue"
},
+ "parameters": {
+ "message": "Parameters"
+ },
"passwordNotLongEnough": {
"message": "Password not long enough"
},
@@ -306,6 +354,9 @@
"followTwitter": {
"message": "Follow us on Twitter"
},
+ "forgetDevice": {
+ "message": "Forget this device"
+ },
"from": {
"message": "From"
},
@@ -315,6 +366,9 @@
"fromShapeShift": {
"message": "From ShapeShift"
},
+ "functionType": {
+ "message": "Function Type"
+ },
"gas": {
"message": "Gas",
"description": "Short indication of gas cost"
@@ -356,10 +410,28 @@
"message": "Get Ether from a faucet for the $1",
"description": "Displays network name for Ether faucet"
},
+ "getHelp": {
+ "message": "Get Help."
+ },
"greaterThanMin": {
"message": "must be greater than or equal to $1.",
"description": "helper for inputting hex as decimal input"
},
+ "hardware": {
+ "message": "hardware"
+ },
+ "hardwareWalletConnected": {
+ "message": "Hardware wallet connected"
+ },
+ "hardwareSupport": {
+ "message": "Hardware Support"
+ },
+ "hardwareSupportMsg": {
+ "message": "You can now view your Hardware accounts in MetaMask! Scroll down and read how it works."
+ },
+ "havingTroubleConnecting": {
+ "message": "Having trouble connecting?"
+ },
"here": {
"message": "here",
"description": "as in -click here- for more information (goes with troubleTokenBalances)"
@@ -367,6 +439,9 @@
"hereList": {
"message": "Here's a list!!!!"
},
+ "hexData": {
+ "message": "Hex Data"
+ },
"hide": {
"message": "Hide"
},
@@ -455,7 +530,7 @@
"message": "Max"
},
"learnMore": {
- "message": "Learn more."
+ "message": "Learn more"
},
"lessThanMax": {
"message": "must be less than or equal to $1.",
@@ -494,6 +569,9 @@
"mainnet": {
"message": "Main Ethereum Network"
},
+ "menu": {
+ "message": "Menu"
+ },
"message": {
"message": "Message"
},
@@ -560,12 +638,18 @@
"noDeposits": {
"message": "No deposits received"
},
+ "noConversionRateAvailable":{
+ "message": "No Conversion Rate Available"
+ },
"noTransactionHistory": {
"message": "No transaction history."
},
"noTransactions": {
"message": "No Transactions"
},
+ "notFound": {
+ "message": "Not Found"
+ },
"notStarted": {
"message": "Not Started"
},
@@ -575,10 +659,16 @@
"oldUIMessage": {
"message": "You have returned to the old UI. You can switch back to the New UI through the option in the top right dropdown menu."
},
+ "openInTab": {
+ "message": "Open in tab"
+ },
"or": {
"message": "or",
"description": "choice between creating or importing a new account"
},
+ "origin": {
+ "message": "Origin"
+ },
"password": {
"message": "Password"
},
@@ -609,6 +699,9 @@
"popularTokens": {
"message": "Popular Tokens"
},
+ "prev": {
+ "message": "Prev"
+ },
"privacyMsg": {
"message": "Privacy Policy"
},
@@ -661,6 +754,9 @@
"restoreVault": {
"message": "Restore Vault"
},
+ "restoreAccountWithSeed": {
+ "message": "Restore your Account with Seed Phrase"
+ },
"required": {
"message": "Required"
},
@@ -670,6 +766,9 @@
"walletSeed": {
"message": "Wallet Seed"
},
+ "restore": {
+ "message": "Restore"
+ },
"revealSeedWords": {
"message": "Reveal Seed Words"
},
@@ -688,6 +787,18 @@
"revert": {
"message": "Revert"
},
+ "remove": {
+ "message": "remove"
+ },
+ "removeAccount": {
+ "message": "Remove account"
+ },
+ "removeAccountDescription": {
+ "message": "This account will be removed from your wallet. Please make sure you have the original seed phrase or private key for this imported account before continuing. You can import or create accounts again from the account drop-down. "
+ },
+ "readyToConnect": {
+ "message": "Ready to Connect?"
+ },
"rinkeby": {
"message": "Rinkeby Test Network"
},
@@ -774,6 +885,9 @@
"sendTokens": {
"message": "Send Tokens"
},
+ "separateEachWord": {
+ "message": "Separate each word with a single space"
+ },
"onlySendToEtherAddress": {
"message": "Only send ETH to an Ethereum address."
},
@@ -781,15 +895,45 @@
"message": "Only send $1 to an Ethereum account address.",
"description": "displays token symbol"
},
+ "orderOneHere": {
+ "message": "Order one here."
+ },
"searchTokens": {
"message": "Search Tokens"
},
+ "selectAnAddress": {
+ "message": "Select an Address"
+ },
+ "selectAnAccount": {
+ "message": "Select an Account"
+ },
+ "selectAnAccountHelp": {
+ "message": "These are the accounts available in your hardware wallet. Select the one you’d like to use in MetaMask."
+ },
"sendTokensAnywhere": {
"message": "Send Tokens to anyone with an Ethereum account"
},
"settings": {
"message": "Settings"
},
+ "step1HardwareWallet": {
+ "message": "1. Connect Hardware Wallet"
+ },
+ "step1HardwareWalletMsg": {
+ "message": "Connect your hardware wallet directly to your computer."
+ },
+ "step2HardwareWallet": {
+ "message": "2. Select an Account"
+ },
+ "step2HardwareWalletMsg": {
+ "message": "Select the account you want to view. You can only choose one at a time."
+ },
+ "step3HardwareWallet": {
+ "message": "3. Start using dApps and more!"
+ },
+ "step3HardwareWalletMsg": {
+ "message": "Use your hardware account like you would with any Ethereum account. Log in to dApps, send Eth, buy and store ERC20 tokens and Non-Fungible tokens like CryptoKitties."
+ },
"info": {
"message": "Info"
},
@@ -899,9 +1043,15 @@
"transactionNumber": {
"message": "Transaction Number"
},
+ "transfer": {
+ "message": "Transfer"
+ },
"transfers": {
"message": "Transfers"
},
+ "trezorHardwareWallet": {
+ "message": "TREZOR Hardware Wallet"
+ },
"troubleTokenBalances": {
"message": "We had trouble loading your token balances. You can view them ",
"description": "Followed by a link (here) to view token balances"
@@ -927,12 +1077,18 @@
"unknown": {
"message": "Unknown"
},
+ "unknownFunction": {
+ "message": "Unknown Function"
+ },
"unknownNetwork": {
"message": "Unknown Private Network"
},
"unknownNetworkId": {
"message": "Unknown network ID"
},
+ "unlock": {
+ "message": "Unlock"
+ },
"unlockMessage": {
"message": "The decentralized web awaits"
},
diff --git a/app/_locales/index.json b/app/_locales/index.json
index 7717502b7..f50c09f88 100644
--- a/app/_locales/index.json
+++ b/app/_locales/index.json
@@ -17,6 +17,6 @@
{ "code": "tml", "name": "Tamil" },
{ "code": "tr", "name": "Turkish" },
{ "code": "vi", "name": "Vietnamese" },
- { "code": "zh_CN", "name": "Mandarin" },
- { "code": "zh_TW", "name": "Taiwanese" }
+ { "code": "zh_CN", "name": "Chinese (Simplified)" },
+ { "code": "zh_TW", "name": "Chinese (Traditional)" }
]
diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json
index 75deeaddf..c9d192139 100644
--- a/app/_locales/ja/messages.json
+++ b/app/_locales/ja/messages.json
@@ -122,6 +122,9 @@
"copy": {
"message": "コピー"
},
+ "copyContractAddress": {
+ "message": "コントラクトアドレスをコピー"
+ },
"copyToClipboard": {
"message": "クリップボードへコピー"
},
@@ -395,6 +398,9 @@
"mainnet": {
"message": "Ethereumメインネットワーク"
},
+ "menu": {
+ "message": "メニュー"
+ },
"message": {
"message": "メッセージ"
},
@@ -464,6 +470,9 @@
"oldUIMessage": {
"message": "旧UIを表示しています。右上のドロップダウンメニューのオプションより、新UIへ切り替えが可能です。"
},
+ "openInTab": {
+ "message": "タブを開く"
+ },
"or": {
"message": "または",
"description": "choice between creating or importing a new account"
@@ -573,6 +582,15 @@
"searchResults": {
"message": "検索結果"
},
+ "newPassword8Chars": {
+ "message": "新しいパスワード (8桁以上)"
+ },
+ "select": {
+ "message": "選択"
+ },
+ "selectCurrency": {
+ "message": "通貨を選択"
+ },
"selectService": {
"message": "サービスを選択"
},
@@ -586,10 +604,14 @@
"message": "ETHの送信"
},
"sendTokens": {
- "message": "トークンを送る"
+ "message": "トークンを送信"
},
"onlySendToEtherAddress": {
- "message": "ETHはイーサリウムアカウントのみに送信できます。"
+ "message": "ETH はイーサリウムアカウントのみに送信できます。"
+ },
+ "onlySendTokensToAccountAddress": {
+ "message": "$1 はイーサリアムアカウントのみに送信できます。",
+ "description": "displays token symbol"
},
"searchTokens": {
"message": "トークンの検索"
@@ -690,10 +712,10 @@
"message": "パスワードの入力"
},
"uiWelcome": {
- "message": "新UIへようこそ!(ベータ版)"
+ "message": "新UIへようこそ! (ベータ版)"
},
"uiWelcomeMessage": {
- "message": "現在Metamaskの新しいUIをお使いになっています。トークン送信など、新たな機能を試してみましょう!何か問題があればご報告ください。"
+ "message": "現在、MetaMask の新しいUIをお使いになっています。トークン送信など、新たな機能を試してみましょう! 何か問題があればご報告ください。"
},
"unavailable": {
"message": "有効ではありません。"
@@ -720,6 +742,9 @@
"viewAccount": {
"message": "アカウントを見る"
},
+ "viewOnEtherscan": {
+ "message": "Etherscan で見る"
+ },
"warning": {
"message": "警告"
},
diff --git a/app/error.html b/app/error.html
new file mode 100644
index 000000000..366b3d94a
--- /dev/null
+++ b/app/error.html
@@ -0,0 +1,79 @@
+<html>
+<head>
+ <title>MetaMask Error</title>
+ <link href="https://fonts.googleapis.com/css?family=Rokkitt" rel="stylesheet">
+ <style>
+ *{
+ padding: 0;
+ margin: 0;
+ box-sizing: border-box;
+ }
+ img{
+ display: block;
+ }
+ html, body{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 100%;
+ }
+ @keyframes logoAmin{
+ from {transform: scale(1);}
+ 50%{transform: scale(1.1);}
+ to {transform: scale(1);}
+ }
+ .errorBox{
+ width: 70%;
+ height: auto;
+ overflow: hidden;
+ background-image: url("./images/deadface.png");
+ background-repeat: no-repeat;
+ background-position: 100% 50%;
+ background-size: auto 90%;
+ padding: 5px;
+ }
+ .errorBox > img{
+ width: 100px;
+ height: auto;
+ margin-bottom: 25px;
+ animation: logoAmin 1s infinite linear;
+ }
+ .errorBox > h1, .errorBox > h2{
+ letter-spacing: 2px;
+ }
+ .errorBox > h1{
+ color: #9b9b9b;
+ font-size: 40px;
+ }
+ .errorBox > h2{
+ color: #1b243d;
+ font-size: 20px;
+ padding-top: 5px;
+ }
+ .errorBox > h2 >a{
+ color: #1b243d;
+ }
+ .errorBox > h2 >a:hover{
+ color: #44588e;
+ }
+
+ .errorBox > h1 > span{
+ color: #33559f;
+ }
+
+ </style>
+</head>
+<body>
+ <div class="errorBox">
+ <img src="./images/logo.png" alt="">
+ <h1><span id="name"></span> not found</h1>
+ <h2>Powered by <a href="https://www.portal.network/">Portal Network</a></h2>
+ </div>
+ <script>
+ let index = location.href.lastIndexOf("?name=")
+ let name = location.href.slice(index + 6)
+ document.getElementById("name").innerHTML = name
+ </script>
+</body>
+</html>
diff --git a/app/images/404.png b/app/images/404.png
new file mode 100644
index 000000000..b1a767dde
--- /dev/null
+++ b/app/images/404.png
Binary files differ
diff --git a/app/images/alert-red.svg b/app/images/alert-red.svg
new file mode 100644
index 000000000..ac5b30e27
--- /dev/null
+++ b/app/images/alert-red.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
+ <title>Artboard Copy</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="Artboard-Copy" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Group-48">
+ <circle id="Oval" fill="#D0021B" cx="8" cy="8" r="8"></circle>
+ <rect id="Rectangle-41" fill="#FFFFFF" x="7" y="3" width="2" height="7" rx="1"></rect>
+ <rect id="Rectangle-41" fill="#FFFFFF" x="7" y="11" width="2" height="2" rx="1"></rect>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/app/images/alert.svg b/app/images/alert.svg
new file mode 100644
index 000000000..534eda194
--- /dev/null
+++ b/app/images/alert.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="29px" height="29px" viewBox="0 0 29 29" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: sketchtool 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
+ <title>7414FFD8-B28A-4593-9D7E-19E73D687B50</title>
+ <desc>Created with sketchtool.</desc>
+ <defs></defs>
+ <g id="Action-Screens" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Approve---insufficient-amount" transform="translate(-69.000000, -166.000000)">
+ <g id="Group-7" transform="translate(53.000000, 51.000000)">
+ <g id="Group-34" transform="translate(0.000000, 91.000000)">
+ <g id="alert" transform="translate(16.000000, 24.000000)">
+ <circle id="Oval" fill="#605A1C" cx="14.5" cy="14.5" r="14.5"></circle>
+ <path d="M16,16.8282967 L14,16.8282967 L14,7 L16,7 L16,16.8282967 Z M16,21 L14,21 L14,19 L16,19 L16,21 Z" id="!" fill="#FFFCDB"></path>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/app/images/cancel.png b/app/images/cancel.png
new file mode 100644
index 000000000..4e0eb1143
--- /dev/null
+++ b/app/images/cancel.png
Binary files differ
diff --git a/app/images/caret-left.svg b/app/images/caret-left.svg
new file mode 100644
index 000000000..0ea266161
--- /dev/null
+++ b/app/images/caret-left.svg
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="9px" height="15px" viewBox="0 0 9 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: sketchtool 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
+ <title>8439120D-5704-4273-B416-FEE134322584</title>
+ <desc>Created with sketchtool.</desc>
+ <defs></defs>
+ <g id="Action-Screens" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Approve---insufficient-amount" transform="translate(-75.000000, -69.000000)" stroke="#3099F2" stroke-width="2">
+ <g id="Group-7" transform="translate(53.000000, 51.000000)">
+ <g id="cancel" transform="translate(24.000000, 14.000000)">
+ <g id="Group">
+ <polyline id="Path-8" points="6.1263881 18.0633906 0 11.6306831 6.31493631 5"></polyline>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/app/images/connect-icon.svg b/app/images/connect-icon.svg
new file mode 100644
index 000000000..84540999a
--- /dev/null
+++ b/app/images/connect-icon.svg
@@ -0,0 +1,11 @@
+<svg width="288" height="288" xmlns="http://www.w3.org/2000/svg">
+
+ <g>
+ <title>background</title>
+ <rect fill="none" id="canvas_background" height="402" width="582" y="-1" x="-1"/>
+ </g>
+ <g>
+ <title>Layer 1</title>
+ <path fill="#ffffff" id="svg_1" d="m122,25l15,-21c4,-5 10,-5 14,0l16,22c4,5 2,10 -5,10l-12,0l0,118c0,3 3,3 5,1l25,-25c4,-4 6,-10 6,-16l0,-24c-7,0 -12,-5 -12,-12l0,-12c0,-6 5,-12 12,-12l12,0c7,0 12,5 12,12l0,12c0,7 -5,12 -12,12l0,24c0,10 -3,18 -10,25l-31,31c-4,4 -7,6 -7,16l0,49c12,3 21,13 21,26c0,15 -12,27 -27,27s-27,-12 -27,-27c0,-13 9,-23 21,-26l0,-13c0,-10 -3,-13 -7,-17l-31,-31c-6,-6 -10,-14 -10,-24l0,-25c-7,-2 -12,-9 -12,-17c0,-10 8,-18 18,-18s18,8 18,18c0,8 -5,15 -12,17l0,25c0,7 3,12 7,16l25,25c2,2 4,2 4,-1l0,-154l-12,0c-7,0 -9,-5 -4,-11z"/>
+ </g>
+</svg> \ No newline at end of file
diff --git a/app/images/deadface.png b/app/images/deadface.png
new file mode 100644
index 000000000..e12476c03
--- /dev/null
+++ b/app/images/deadface.png
Binary files differ
diff --git a/app/images/ethereum-metamask-chrome.png b/app/images/ethereum-metamask-chrome.png
new file mode 100644
index 000000000..0b886babb
--- /dev/null
+++ b/app/images/ethereum-metamask-chrome.png
Binary files differ
diff --git a/app/images/hardware-wallet-step-1.svg b/app/images/hardware-wallet-step-1.svg
new file mode 100644
index 000000000..2b6596a43
--- /dev/null
+++ b/app/images/hardware-wallet-step-1.svg
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="213px" height="78px" viewBox="0 0 213 78" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: sketchtool 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
+ <title>2981A924-C7CB-4957-87AD-8C680802DAD7</title>
+ <desc>Created with sketchtool.</desc>
+ <defs></defs>
+ <g id="Import-account" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="hardware-connect" transform="translate(-406.000000, -602.000000)">
+ <g id="Group-9" transform="translate(356.000000, 522.000000)">
+ <g id="connect-hardware" transform="translate(51.000000, 81.000000)">
+ <path d="M4,9 L70,9 L70,17 L4,17 C1.790861,17 2.705415e-16,15.209139 0,13 L0,13 C-2.705415e-16,10.790861 1.790861,9 4,9 Z" id="Rectangle" fill="#D9F0FF"></path>
+ <g id="Group-4-Copy">
+ <g id="Group-2" transform="translate(91.000000, 31.000000)" stroke="#3098DC">
+ <polyline id="Stroke-10" points="7.33333333 0 13.4253333 5.29042105 7.33333333 10.5802632"></polyline>
+ <path d="M0,5.21052632 L13.5,5.21052632" id="Stroke-11"></path>
+ </g>
+ <g id="Group-3" transform="translate(109.000000, 0.000000)">
+ <path d="M92.535988,75.1897419 L9.16167665,75.1897419 C7.13816766,75.1897419 5.49700599,73.5434839 5.49700599,71.5123226 L5.49700599,3.67741935 C5.49700599,1.64625806 7.13816766,0 9.16167665,0 L92.535988,0 C94.5601078,0 96.2006587,1.64625806 96.2006587,3.67741935 L96.2006587,71.5123226 C96.2006587,73.5434839 94.5601078,75.1897419 92.535988,75.1897419" id="Fill-12" fill="#FEFEFE"></path>
+ <path d="M92.535988,75.1897419 L9.16167665,75.1897419 C7.13816766,75.1897419 5.49700599,73.5434839 5.49700599,71.5123226 L5.49700599,3.67741935 C5.49700599,1.64625806 7.13816766,0 9.16167665,0 L92.535988,0 C94.5601078,0 96.2006587,1.64625806 96.2006587,3.67741935 L96.2006587,71.5123226 C96.2006587,73.5434839 94.5601078,75.1897419 92.535988,75.1897419 Z" id="Stroke-13" stroke="#3098DC"></path>
+ <path d="M100.70576,75.6298065 L1.22155689,75.6298065 C0.546646707,75.6298065 0,75.0812581 0,74.404 L0,69.8709677 C0,69.1937097 0.546646707,68.6451613 1.22155689,68.6451613 L100.70576,68.6451613 C101.38006,68.6451613 101.927317,69.1937097 101.927317,69.8709677 L101.927317,74.404 C101.927317,75.0812581 101.38006,75.6298065 100.70576,75.6298065" id="Fill-14" fill="#D9F0FF"></path>
+ <path d="M100.70576,75.6298065 L1.22155689,75.6298065 C0.546646707,75.6298065 0,75.0812581 0,74.404 L0,69.8709677 C0,69.1937097 0.546646707,68.6451613 1.22155689,68.6451613 L100.70576,68.6451613 C101.38006,68.6451613 101.927317,69.1937097 101.927317,69.8709677 L101.927317,74.404 C101.927317,75.0812581 101.38006,75.6298065 100.70576,75.6298065 Z" id="Stroke-15" stroke="#3098DC"></path>
+ <polygon id="Fill-16" fill="#FEFEFE" points="9.77245509 63.6953548 92.1554731 63.6953548 92.1554731 4.90322581 9.77245509 4.90322581"></polygon>
+ <polygon id="Stroke-17" stroke="#3098DC" points="9.77245509 63.6953548 92.1554731 63.6953548 92.1554731 4.90322581 9.77245509 4.90322581"></polygon>
+ <path d="M53.4327111,51.4764454 L48.3815734,51.4764454 C48.2930105,51.4764454 48.2081123,51.4494776 48.1354296,51.3986067 L45.1462799,49.3073809 L43.8318847,48.2207035 L36.536747,50.2488002 C36.3101482,50.3113164 36.0719446,50.1770906 36.0059805,49.9490906 L33.8908548,42.6077357 C33.8664237,42.523768 33.8676452,42.4361228 33.8939087,42.352768 L36.1409626,35.2823164 L34.7923638,33.6826389 C34.7141841,33.5900906 34.6775374,33.4675099 34.6921961,33.346768 C34.7068548,33.226026 34.7709865,33.1157035 34.8693219,33.0446067 L35.1105793,32.8693164 L34.4368907,32.2484454 C34.3428308,32.1608002 34.2915255,32.0376067 34.2958009,31.9095099 C34.3006871,31.7808002 34.3611542,31.6612841 34.4607111,31.5822196 L34.8406153,31.2806712 L34.2218967,30.8044454 C34.1150105,30.7223164 34.0508787,30.5905422 34.0521003,30.4544776 C34.0533219,30.3178002 34.1180644,30.1872518 34.2273937,30.1057357 L34.6818129,29.7655744 L33.6019566,24.5289293 C33.5860763,24.4541551 33.5909626,24.3744776 33.6160045,24.3003164 L35.2620524,19.299026 C35.2993099,19.1862518 35.3805434,19.0930906 35.4862081,19.0428325 C35.5918728,18.9919615 35.7140284,18.9864454 35.8233578,19.0275099 L46.4826632,23.0506067 L55.3316213,23.0506067 L65.9903159,19.0275099 C66.0996452,18.9858325 66.2224117,18.9919615 66.3280763,19.0428325 C66.4343518,19.0937035 66.5155853,19.1868647 66.552232,19.299026 L68.1988907,24.3021551 C68.2227111,24.3732518 68.2275973,24.4517035 68.2123278,24.5277035 L67.1440763,29.7674131 L67.5911662,30.1081873 C67.6998847,30.1909293 67.7621841,30.3178002 67.7627949,30.4550906 C67.7634057,30.5905422 67.6998847,30.7210906 67.5936093,30.8038325 L66.9742799,31.2806712 L67.3535734,31.5822196 C67.453741,31.661897 67.5135973,31.7814131 67.5178728,31.9095099 C67.522759,32.0382196 67.4714536,32.1614131 67.3773937,32.2478325 L66.7037051,32.8693164 L66.9455734,33.0452196 C67.0432979,33.1157035 67.1074296,33.226026 67.1220883,33.3473809 C67.136747,33.4681228 67.0994895,33.5907035 67.0213099,33.6832518 L65.6739326,35.2817035 L67.9332021,42.3515422 C67.9600763,42.4336712 67.9612979,42.5225422 67.9374775,42.6071228 L65.8076931,49.9497035 C65.7423398,50.1770906 65.5035255,50.3100906 65.2775374,50.2488002 L57.9823997,48.2207035 L56.6283039,49.3368002 L53.6788548,51.3986067 C53.6061722,51.4494776 53.5206632,51.4764454 53.4327111,51.4764454" id="Fill-18" fill="#FEFEFE"></path>
+ <path d="M53.4327111,51.4764454 L48.3815734,51.4764454 C48.2930105,51.4764454 48.2081123,51.4494776 48.1354296,51.3986067 L45.1462799,49.3073809 L43.8318847,48.2207035 L36.536747,50.2488002 C36.3101482,50.3113164 36.0719446,50.1770906 36.0059805,49.9490906 L33.8908548,42.6077357 C33.8664237,42.523768 33.8676452,42.4361228 33.8939087,42.352768 L36.1409626,35.2823164 L34.7923638,33.6826389 C34.7141841,33.5900906 34.6775374,33.4675099 34.6921961,33.346768 C34.7068548,33.226026 34.7709865,33.1157035 34.8693219,33.0446067 L35.1105793,32.8693164 L34.4368907,32.2484454 C34.3428308,32.1608002 34.2915255,32.0376067 34.2958009,31.9095099 C34.3006871,31.7808002 34.3611542,31.6612841 34.4607111,31.5822196 L34.8406153,31.2806712 L34.2218967,30.8044454 C34.1150105,30.7223164 34.0508787,30.5905422 34.0521003,30.4544776 C34.0533219,30.3178002 34.1180644,30.1872518 34.2273937,30.1057357 L34.6818129,29.7655744 L33.6019566,24.5289293 C33.5860763,24.4541551 33.5909626,24.3744776 33.6160045,24.3003164 L35.2620524,19.299026 C35.2993099,19.1862518 35.3805434,19.0930906 35.4862081,19.0428325 C35.5918728,18.9919615 35.7140284,18.9864454 35.8233578,19.0275099 L46.4826632,23.0506067 L55.3316213,23.0506067 L65.9903159,19.0275099 C66.0996452,18.9858325 66.2224117,18.9919615 66.3280763,19.0428325 C66.4343518,19.0937035 66.5155853,19.1868647 66.552232,19.299026 L68.1988907,24.3021551 C68.2227111,24.3732518 68.2275973,24.4517035 68.2123278,24.5277035 L67.1440763,29.7674131 L67.5911662,30.1081873 C67.6998847,30.1909293 67.7621841,30.3178002 67.7627949,30.4550906 C67.7634057,30.5905422 67.6998847,30.7210906 67.5936093,30.8038325 L66.9742799,31.2806712 L67.3535734,31.5822196 C67.453741,31.661897 67.5135973,31.7814131 67.5178728,31.9095099 C67.522759,32.0382196 67.4714536,32.1614131 67.3773937,32.2478325 L66.7037051,32.8693164 L66.9455734,33.0452196 C67.0432979,33.1157035 67.1074296,33.226026 67.1220883,33.3473809 C67.136747,33.4681228 67.0994895,33.5907035 67.0213099,33.6832518 L65.6739326,35.2817035 L67.9332021,42.3515422 C67.9600763,42.4336712 67.9612979,42.5225422 67.9374775,42.6071228 L65.8076931,49.9497035 C65.7423398,50.1770906 65.5035255,50.3100906 65.2775374,50.2488002 L57.9823997,48.2207035 L56.6283039,49.3368002 L53.6788548,51.3986067 C53.6061722,51.4494776 53.5206632,51.4764454 53.4327111,51.4764454 Z" id="Stroke-19" stroke="#3098DC"></path>
+ <polygon id="Fill-20" fill="#3098DC" points="52.0480958 46.5806452 49.4779401 46.5806452 49.0320719 46.9355161 48.8622754 49.0745484 52.6637605 49.0745484 52.4933533 46.9355161"></polygon>
+ <path d="M54.8341371,38.1394234 L53.7713826,40.485617 C53.6852628,40.675617 53.8562808,40.8809396 54.0505083,40.8208751 L57.6742569,39.7017138 C57.8807,39.6379718 57.9014664,39.3425525 57.7054066,39.2493912 L55.1444125,38.0223589 C55.0277539,37.9665847 54.8891072,38.0186815 54.8341371,38.1394234" id="Fill-21" fill="#3098DC"></path>
+ <path d="M46.6690624,38.0223713 L44.1117331,39.2487906 C43.916284,39.3425648 43.9364397,39.6373713 44.1434936,39.7017261 L47.7666313,40.8208874 C47.9608589,40.8809519 48.1318768,40.6750164 48.0457571,40.4850164 L46.9793379,38.1388229 C46.9243678,38.0186939 46.7857211,37.9665971 46.6690624,38.0223713" id="Fill-22" fill="#3098DC"></path>
+ </g>
+ <g id="Group" transform="translate(0.000000, 9.000000)">
+ <path d="M66.9571429,59 L3.68571429,59 C1.65058571,59 0,57.3318526 0,55.2736842 L0,3.72631579 C0,1.66876842 1.65058571,0 3.68571429,0 L66.9571429,0 C68.9922714,0 70.6428571,1.66876842 70.6428571,3.72631579 L70.6428571,55.2736842 C70.6428571,57.3318526 68.9922714,59 66.9571429,59 Z" id="Stroke-1" stroke="#3098DC"></path>
+ <path d="M66.9571429,7.45263158 L3.68571429,7.45263158 C1.65058571,7.45263158 0,5.78448421 0,3.72631579 C0,1.66876842 1.65058571,0 3.68571429,0 L66.9571429,0 C68.9922714,0 70.6428571,1.66876842 70.6428571,3.72631579" id="Stroke-3" stroke="#3098DC"></path>
+ <path d="M66.9571429,7.45263158 C68.9922714,7.45263158 70.6428571,9.1214 70.6428571,11.1789474" id="Stroke-5" stroke="#3098DC"></path>
+ <polygon id="Stroke-7" stroke="#3098DC" points="70.6428571 23.5987579 85.5319143 23.5987579 85.5319143 19.8736842 70.6428571 19.8736842"></polygon>
+ <polygon id="Stroke-9" stroke="#3098DC" points="70.6428571 38.6530737 85.5319143 38.6530737 85.5319143 23.6 70.6428571 23.6"></polygon>
+ <path d="M35.2784286,22.3578947 L28.9666429,32.8356737 L35.2784286,36.5682 L41.5902143,32.8387789 L35.2784286,22.3578947 Z M35.1832143,37.7631053 L28.8714286,34.0336842 L35.1832143,42.9321263 L41.4986857,34.0336842 L35.1819857,37.7631053 L35.1832143,37.7631053 Z" id="Fill-23" fill="#3098DC"></path>
+ <path d="M50.4672571,32.9642316 C50.4672571,24.3626526 43.5700571,17.3894737 35.0622,17.3894737 C26.5543429,17.3894737 19.6571429,24.3626526 19.6571429,32.9642316 C19.6571429,41.5664316 26.5543429,48.5389895 35.0622,48.5389895 C43.5700571,48.5389895 50.4672571,41.5664316 50.4672571,32.9642316 Z" id="Stroke-24" stroke="#3098DC"></path>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/app/images/hardware-wallet-step-2.svg b/app/images/hardware-wallet-step-2.svg
new file mode 100644
index 000000000..9fff05b7e
--- /dev/null
+++ b/app/images/hardware-wallet-step-2.svg
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="302px" height="98px" viewBox="0 0 302 98" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: sketchtool 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
+ <title>27B850D0-B3BA-4F98-8BB4-B542D8BFDE3B</title>
+ <desc>Created with sketchtool.</desc>
+ <defs>
+ <rect id="path-1" x="0" y="0" width="294" height="32"></rect>
+ <filter x="-2.4%" y="-15.6%" width="104.8%" height="143.8%" filterUnits="objectBoundingBox" id="filter-2">
+ <feOffset dx="0" dy="2" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
+ <feGaussianBlur stdDeviation="2" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
+ <feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite>
+ <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.123075181 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
+ </filter>
+ </defs>
+ <g id="Import-account" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="hardware-connect" transform="translate(-361.000000, -797.000000)">
+ <g id="Group-10" transform="translate(356.000000, 717.000000)">
+ <g id="accounts" transform="translate(9.000000, 80.000000)">
+ <g id="Group-5" transform="translate(21.000000, 0.000000)">
+ <g id="Group-7" transform="translate(0.000000, 45.000000)">
+ <rect id="Rectangle-6-Copy" stroke="#AFDFFF" fill="#FFFFFF" x="0.5" y="0.5" width="250" height="26"></rect>
+ <text id="3" font-family="Roboto-Regular, Roboto" font-size="12" font-weight="normal" fill="#ABB4BB">
+ <tspan x="31" y="19">3</tspan>
+ </text>
+ <text id="OXz3…T3A4" font-family="Roboto-Regular, Roboto" font-size="12" font-weight="normal" fill="#ABB4BB">
+ <tspan x="50" y="19">OXz3…T3A4</tspan>
+ </text>
+ <text id="0.020000-ETH" font-family="Roboto-Regular, Roboto" font-size="12" font-weight="normal" fill="#ABB4BB">
+ <tspan x="142" y="19">0.020000 ETH</tspan>
+ </text>
+ <circle id="Oval-Copy" stroke="#AFDFFF" stroke-width="2" cx="16.5" cy="14.5" r="6.5"></circle>
+ </g>
+ <g id="Group-7-Copy">
+ <rect id="Rectangle-6-Copy" stroke="#AFDFFF" fill="#FFFFFF" x="0.5" y="0.5" width="250" height="26"></rect>
+ <text id="1" font-family="Roboto-Regular, Roboto" font-size="12" font-weight="normal" fill="#ABB4BB">
+ <tspan x="31" y="19">1</tspan>
+ </text>
+ <text id="OXa4…s0a2" font-family="Roboto-Regular, Roboto" font-size="12" font-weight="normal" fill="#ABB4BB">
+ <tspan x="50" y="19">OXa4…s0a2</tspan>
+ </text>
+ <text id="0.01500-ETH" font-family="Roboto-Regular, Roboto" font-size="12" font-weight="normal" fill="#ABB4BB">
+ <tspan x="142" y="19">0.01500 ETH</tspan>
+ </text>
+ <circle id="Oval-Copy" stroke="#AFDFFF" stroke-width="2" cx="16.5" cy="14.5" r="6.5"></circle>
+ </g>
+ <g id="Group-8" transform="translate(0.000000, 71.000000)">
+ <rect id="Rectangle-6-Copy-2" stroke="#AFDFFF" fill="#FFFFFF" x="0.5" y="0.5" width="250" height="26"></rect>
+ <text id="4" font-family="Roboto-Regular, Roboto" font-size="12" font-weight="normal" fill="#ABB4BB">
+ <tspan x="31" y="18">4</tspan>
+ </text>
+ <text id="OXd2…D0V4" font-family="Roboto-Regular, Roboto" font-size="12" font-weight="normal" fill="#ABB4BB">
+ <tspan x="50" y="18">OXd2…D0V4</tspan>
+ </text>
+ <text id="0.030000-ETH" font-family="Roboto-Regular, Roboto" font-size="12" font-weight="normal" fill="#ABB4BB">
+ <tspan x="142" y="18">0.030000 ETH</tspan>
+ </text>
+ <circle id="Oval-Copy-2" stroke="#AFDFFF" stroke-width="2" cx="16.5" cy="13.5" r="6.5"></circle>
+ </g>
+ </g>
+ <g id="Group-4" transform="translate(0.000000, 21.000000)">
+ <g id="Rectangle-6">
+ <use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
+ <rect stroke="#3098DC" stroke-width="1" stroke-linejoin="square" fill="#D9F0FF" fill-rule="evenodd" x="0.5" y="0.5" width="293" height="31"></rect>
+ </g>
+ <text id="2" font-family="Roboto-Regular, Roboto" font-size="16" font-weight="normal" fill="#4A4A4A">
+ <tspan x="36" y="22">2</tspan>
+ </text>
+ <text id="OXe7…B0a1" font-family="Roboto-Regular, Roboto" font-size="16" font-weight="normal" fill="#4A4A4A">
+ <tspan x="58" y="22">OXe7…B0a1</tspan>
+ </text>
+ <text id="0.041000-ETH" font-family="Roboto-Regular, Roboto" font-size="16" font-weight="normal" fill="#4A4A4A">
+ <tspan x="166" y="22">0.041000 ETH</tspan>
+ </text>
+ <circle id="Oval" stroke="#3098DC" stroke-width="2" cx="19.5" cy="16.5" r="7.5"></circle>
+ <polyline id="Path-5" stroke="#3098DC" stroke-width="2" points="15 17 17.5495098 19.5495098 24 13.9042921"></polyline>
+ </g>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/app/images/hardware-wallet-step-3.svg b/app/images/hardware-wallet-step-3.svg
new file mode 100644
index 000000000..4a7655b3b
--- /dev/null
+++ b/app/images/hardware-wallet-step-3.svg
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="108px" height="85px" viewBox="0 0 108 85" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: sketchtool 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
+ <title>CEB55C41-7BCE-405E-83CD-834B388B495F</title>
+ <desc>Created with sketchtool.</desc>
+ <defs></defs>
+ <g id="Import-account" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="hardware-connect" transform="translate(-457.000000, -1057.000000)">
+ <g id="Group-11" transform="translate(356.000000, 929.000000)">
+ <g id="use-dapps" transform="translate(102.000000, 129.000000)">
+ <g id="Group-3">
+ <path d="M96.2021481,83 L9.79785192,83 C7.70080469,83 6,81.2922121 6,79.1851351 L6,8.81486493 C6,6.70778787 7.70080469,5 9.79785192,5 L96.2021481,5 C98.2998283,5 100,6.70778787 100,8.81486493 L100,79.1851351 C100,81.2922121 98.2998283,83 96.2021481,83" id="Fill-12" fill="#FEFEFE"></path>
+ <path d="M96.2021481,83 L9.79785192,83 C7.70080469,83 6,81.2922121 6,79.1851351 L6,8.81486493 C6,6.70778787 7.70080469,5 9.79785192,5 L96.2021481,5 C98.2998283,5 100,6.70778787 100,8.81486493 L100,79.1851351 C100,81.2922121 98.2998283,83 96.2021481,83 Z" id="Stroke-13" stroke="#3098DC"></path>
+ <path d="M104.729634,83 L1.27036631,83 C0.568488923,83 0,82.4502457 0,81.7714988 L0,77.2285012 C0,76.5497543 0.568488923,76 1.27036631,76 L104.729634,76 C105.430876,76 106,76.5497543 106,77.2285012 L106,81.7714988 C106,82.4502457 105.430876,83 104.729634,83" id="Fill-14" fill="#D9F0FF"></path>
+ <path d="M104.729634,83 L1.27036631,83 C0.568488923,83 0,82.4502457 0,81.7714988 L0,77.2285012 C0,76.5497543 0.568488923,76 1.27036631,76 L104.729634,76 C105.430876,76 106,76.5497543 106,77.2285012 L106,81.7714988 C106,82.4502457 105.430876,83 104.729634,83 Z" id="Stroke-15" stroke="#3098DC"></path>
+ <polygon id="Fill-16" fill="#FEFEFE" points="10 71 96 71 96 10 10 10"></polygon>
+ <polygon id="Stroke-17" stroke="#3098DC" points="10 71 96 71 96 10 10 10"></polygon>
+ <rect id="Rectangle-2" stroke="#3098DC" fill="#FFFFFF" x="14.5" y="14.5" width="77" height="53" rx="2"></rect>
+ <path d="M14.5,21.5 L91.5,21.5 L91.5,16 C91.5,15.1715729 90.8284271,14.5 90,14.5 L16,14.5 C15.1715729,14.5 14.5,15.1715729 14.5,16 L14.5,21.5 Z" id="Rectangle-3" stroke="#3098DC" fill="#FFFFFF"></path>
+ <g id="Group-6" transform="translate(17.000000, 17.000000)" fill="#D9F0FF" stroke="#3098DC">
+ <circle id="Oval-2" cx="1" cy="1" r="1"></circle>
+ <circle id="Oval-2" cx="5.76923077" cy="1" r="1"></circle>
+ <circle id="Oval-2" cx="10.5384615" cy="1" r="1"></circle>
+ </g>
+ <g id="metamask-outline" transform="translate(73.000000, 0.000000)">
+ <g id="Group-6">
+ <path d="M19.2986136,29.0578722 L14.6471457,29.0578722 C14.5655903,29.0578722 14.4874097,29.0337432 14.420478,28.988227 L11.6678439,27.1171303 L10.4574498,26.1448399 L3.73953772,27.9594528 C3.53086848,28.0153883 3.31151268,27.8952915 3.250768,27.6912915 L1.30300094,21.1227109 C1.28050291,21.0475819 1.28162782,20.9691625 1.3058132,20.8945819 L3.37506962,14.5683883 L2.1331783,13.137098 C2.0611846,13.0542915 2.02743755,12.9446141 2.04093637,12.8365819 C2.05443519,12.7285496 2.11349252,12.6298399 2.20404709,12.566227 L2.42621515,12.4093883 L1.80583194,11.8538722 C1.71921452,11.7754528 1.67196866,11.665227 1.67590581,11.5506141 C1.68040542,11.4354528 1.73608805,11.3285174 1.82776752,11.2577754 L2.17761191,10.987969 L1.60784927,10.5618722 C1.50942038,10.4883883 1.45036305,10.3704851 1.45148795,10.2487432 C1.45261285,10.1264528 1.51223264,10.0096464 1.61291132,9.9367109 L2.0313747,9.63235606 L1.03696173,4.94693671 C1.02233801,4.88003348 1.02683761,4.80874316 1.04989809,4.74238832 L2.56570295,0.267549611 C2.60001244,0.166646385 2.6748184,0.0832915464 2.77212238,0.0383238044 C2.86942637,-0.00719232461 2.98191652,-0.0121278085 3.08259521,0.024614127 L12.8984862,3.62422703 L21.0472731,3.62422703 L30.8626017,0.024614127 C30.9632804,-0.0126761956 31.076333,-0.00719232461 31.173637,0.0383238044 C31.2715034,0.0838399335 31.3463093,0.167194772 31.3800564,0.267549611 L32.8964237,4.74403348 C32.9183593,4.80764639 32.9228589,4.87783993 32.9087976,4.94583993 L31.9250712,9.63400122 L32.3367852,9.93890445 C32.4369014,10.0129367 32.4942714,10.1264528 32.4948338,10.2492915 C32.4953963,10.3704851 32.4369014,10.4872915 32.339035,10.5613238 L31.7687099,10.987969 L32.1179918,11.2577754 C32.2102337,11.3290657 32.2653539,11.4360012 32.2692911,11.5506141 C32.2737907,11.6657754 32.2265448,11.7760012 32.1399274,11.8533238 L31.5195442,12.4093883 L31.7422747,12.5667754 C31.8322668,12.6298399 31.8913241,12.7285496 31.904823,12.8371303 C31.9183218,12.9451625 31.8840123,13.0548399 31.8120186,13.1376464 L30.5712522,14.5678399 L32.6517576,20.8934851 C32.6765054,20.966969 32.6776303,21.0464851 32.6556948,21.1221625 L30.6944289,27.6918399 C30.6342467,27.8952915 30.4143284,28.0142915 30.2062216,27.9594528 L23.4883095,26.1448399 L22.2413561,27.1434528 L19.5252813,28.988227 C19.4583497,29.0337432 19.3796066,29.0578722 19.2986136,29.0578722 Z" id="Stroke-19" stroke="#3098DC" fill="#FFFFFF"></path>
+ <polygon id="Fill-20" fill="#3098DC" points="18.0235556 24.6774194 15.6567628 24.6774194 15.2461737 24.9949355 15.0898124 26.9088065 18.590506 26.9088065 18.4335823 24.9949355"></polygon>
+ <path d="M20.5891522,17.1247473 L19.6104879,19.2239731 C19.5311823,19.3939731 19.6886685,19.5776828 19.8675279,19.5239408 L23.2045484,18.522586 C23.3946567,18.4655537 23.4137801,18.2012312 23.2332334,18.1178763 L20.8748772,17.0200054 C20.7674491,16.9701021 20.6397728,17.016715 20.5891522,17.1247473" id="Fill-21" fill="#3098DC"></path>
+ <path d="M13.0701367,17.0200164 L10.7151553,18.117339 C10.535171,18.2012422 10.5537319,18.4650164 10.7444027,18.5225971 L14.0808608,19.5239519 C14.2597201,19.5776938 14.4172063,19.3934358 14.3379008,19.2234358 L13.3558617,17.12421 C13.3052411,17.0167261 13.1775648,16.9701132 13.0701367,17.0200164" id="Fill-22" fill="#3098DC"></path>
+ </g>
+ </g>
+ </g>
+ <text id="LOGIN-WITH-METAMASK" font-family="RobotoMono-Bold, Roboto Mono" font-size="10" font-weight="bold" fill="#3098DC">
+ <tspan x="24.4951172" y="43">LOGIN WITH </tspan>
+ <tspan x="30.4960938" y="56">METAMASK</tspan>
+ </text>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/app/images/loginglogo.svg b/app/images/loginglogo.svg
new file mode 100644
index 000000000..ca8b0a2ee
--- /dev/null
+++ b/app/images/loginglogo.svg
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="128px" height="128px" viewBox="0 0 128 128" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 49.3 (51167) - http://www.bohemiancoding.com/sketch -->
+ <title>logo2</title>
+ <desc>Created with Sketch.</desc>
+ <defs>
+ <polygon id="path-1" points="0 82.118 126.527 82.118 126.527 0 0 0"></polygon>
+ </defs>
+ <g id="logo2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Page-1" transform="translate(1.000000, 23.000000)">
+ <path d="M6.8811,74.2729 C6.6901,74.0489 6.4661,73.8719 6.2111,73.7389 C5.9551,73.6069 5.6861,73.5409 5.4031,73.5409 L0.0001,73.5409 L0.0001,82.0769 L0.9581,82.0769 L0.9581,74.4029 L5.2261,74.4029 C5.4261,74.4029 5.6071,74.4549 5.7661,74.5599 C5.9251,74.6649 6.0601,74.7969 6.1701,74.9569 C6.2791,75.1159 6.3631,75.2939 6.4231,75.4899 C6.4821,75.6859 6.5111,75.8759 6.5111,76.0579 C6.5111,76.2219 6.4891,76.3949 6.4431,76.5779 C6.3981,76.7599 6.3221,76.9289 6.2171,77.0839 C6.1121,77.2389 5.9831,77.3669 5.8281,77.4669 C5.6731,77.5669 5.4851,77.6179 5.2671,77.6179 L3.9941,77.6179 L3.9941,78.4789 L5.4311,78.4789 C5.7141,78.4789 5.9801,78.4129 6.2311,78.2809 C6.4821,78.1489 6.7031,77.9709 6.8951,77.7479 C7.0861,77.5239 7.2361,77.2679 7.3461,76.9809 C7.4561,76.6939 7.5101,76.3909 7.5101,76.0719 C7.5101,75.7149 7.4531,75.3829 7.3391,75.0729 C7.2251,74.7629 7.0721,74.4959 6.8811,74.2729" id="Fill-1" fill="#1B243D"></path>
+ <path d="M16.43,79.1157 C16.247,79.5207 15.999,79.8797 15.684,80.1887 C15.369,80.4997 15.005,80.7457 14.59,80.9277 C14.175,81.1107 13.735,81.2017 13.27,81.2017 C12.805,81.2017 12.365,81.1107 11.95,80.9277 C11.534,80.7457 11.172,80.4997 10.862,80.1887 C10.552,79.8797 10.305,79.5207 10.123,79.1157 C9.941,78.7097 9.85,78.2787 9.85,77.8227 C9.85,77.3757 9.941,76.9447 10.123,76.5297 C10.305,76.1147 10.552,75.7527 10.862,75.4417 C11.172,75.1327 11.537,74.8837 11.956,74.6967 C12.376,74.5097 12.818,74.4167 13.284,74.4167 C13.748,74.4167 14.188,74.5097 14.603,74.6967 C15.018,74.8837 15.381,75.1327 15.691,75.4417 C16.001,75.7527 16.247,76.1147 16.43,76.5297 C16.612,76.9447 16.703,77.3757 16.703,77.8227 C16.703,78.2787 16.612,78.7097 16.43,79.1157 M16.341,74.7647 C15.953,74.3777 15.495,74.0697 14.966,73.8417 C14.437,73.6137 13.872,73.4997 13.27,73.4997 C12.668,73.4997 12.102,73.6137 11.574,73.8417 C11.044,74.0697 10.586,74.3777 10.199,74.7647 C9.811,75.1527 9.503,75.6087 9.275,76.1337 C9.047,76.6577 8.933,77.2167 8.933,77.8087 C8.933,78.4017 9.047,78.9607 9.275,79.4847 C9.503,80.0097 9.811,80.4657 10.199,80.8527 C10.586,81.2407 11.044,81.5487 11.574,81.7757 C12.102,82.0047 12.668,82.1177 13.27,82.1177 C13.872,82.1177 14.437,82.0047 14.966,81.7757 C15.495,81.5487 15.953,81.2407 16.341,80.8527 C16.728,80.4657 17.036,80.0097 17.264,79.4847 C17.492,78.9607 17.606,78.4017 17.606,77.8087 C17.606,77.2167 17.492,76.6577 17.264,76.1337 C17.036,75.6087 16.728,75.1527 16.341,74.7647" id="Fill-3" fill="#1B243D"></path>
+ <path d="M26.2249,74.2729 C26.0329,74.0489 25.8089,73.8719 25.5549,73.7389 C25.2989,73.6069 25.0299,73.5409 24.7469,73.5409 L19.3439,73.5409 L19.3439,82.0769 L20.3009,82.0769 L20.3009,74.4029 L24.5699,74.4029 C24.7699,74.4029 24.9499,74.4549 25.1099,74.5599 C25.2689,74.6649 25.4039,74.7969 25.5139,74.9569 C25.6229,75.1159 25.7069,75.2939 25.7669,75.4899 C25.8259,75.6859 25.8549,75.8759 25.8549,76.0579 C25.8549,76.2219 25.8319,76.3949 25.7869,76.5779 C25.7409,76.7599 25.6659,76.9289 25.5609,77.0839 C25.4559,77.2389 25.3269,77.3669 25.1709,77.4669 C25.0169,77.5669 24.8289,77.6179 24.6109,77.6179 L23.2969,77.6179 L25.5819,82.0769 L26.6079,82.0769 L24.7879,78.4789 C25.0709,78.4789 25.3379,78.4129 25.5889,78.2809 C25.8389,78.1489 26.0579,77.9709 26.2459,77.7479 C26.4319,77.5239 26.5799,77.2679 26.6899,76.9809 C26.7989,76.6939 26.8539,76.3909 26.8539,76.0719 C26.8539,75.7149 26.7969,75.3829 26.6829,75.0729 C26.5689,74.7629 26.4159,74.4959 26.2249,74.2729" id="Fill-5" fill="#1B243D"></path>
+ <polygon id="Fill-7" fill="#1B243D" points="35.8694 73.5405 28.4134 73.5405 28.4134 74.4025 31.6554 74.4025 31.6554 82.0765 32.6134 82.0765 32.6134 74.4025 35.8694 74.4025"></polygon>
+ <polygon id="Fill-9" fill="#1B243D" points="35.3084 82.0766 41.4234 82.0766 40.8344 81.2156 36.8134 81.2156 39.7814 75.1406 43.2294 82.0766 44.2964 82.0766 39.7814 73.0896"></polygon>
+ <polygon id="Fill-11" fill="#1B243D" points="46.7859 73.5405 45.8279 73.5405 45.8279 82.0765 52.3269 82.0765 52.3269 81.2155 46.7859 81.2155"></polygon>
+ <polygon id="Fill-13" fill="#1B243D" points="66.0471 81.27 60.6441 73.541 59.0431 73.541 59.0431 82.077 60.0011 82.077 60.0011 74.334 65.5001 82.077 67.0051 82.077 67.0051 73.541 66.0471 73.541"></polygon>
+ <polygon id="Fill-15" fill="#1B243D" points="68.9202 82.0766 75.4182 82.0766 75.4182 81.2156 69.8782 81.2156 69.8782 74.4026 75.4182 74.4026 75.4182 73.5406 68.9202 73.5406"></polygon>
+ <mask id="mask-2" fill="white">
+ <use xlink:href="#path-1"></use>
+ </mask>
+ <g id="Clip-18"></g>
+ <polygon id="Fill-17" fill="#1B243D" mask="url(#mask-2)" points="71.218 78.479 75.309 78.479 75.309 77.618 71.218 77.618"></polygon>
+ <polygon id="Fill-19" fill="#1B243D" mask="url(#mask-2)" points="77.2923 74.4028 80.5343 74.4028 80.5343 82.0768 81.4923 82.0768 81.4923 74.4028 84.7483 74.4028 84.7483 73.5408 77.2923 73.5408"></polygon>
+ <polygon id="Fill-20" fill="#1B243D" mask="url(#mask-2)" points="95.8284 81.3657 91.6694 73.0897 87.5794 81.2977 87.5794 73.5407 86.6214 73.5407 86.6214 82.0767 88.2634 82.0767 91.6694 75.0997 95.1174 82.0767 96.7864 82.0767 96.7864 73.5407 95.8284 73.5407"></polygon>
+ <path d="M106.0203,79.1157 C105.8373,79.5207 105.5893,79.8797 105.2743,80.1887 C104.9603,80.4997 104.5953,80.7457 104.1803,80.9277 C103.7653,81.1107 103.3253,81.2017 102.8603,81.2017 C102.3953,81.2017 101.9553,81.1107 101.5403,80.9277 C101.1243,80.7457 100.7623,80.4997 100.4523,80.1887 C100.1423,79.8797 99.8953,79.5207 99.7133,79.1157 C99.5313,78.7097 99.4403,78.2787 99.4403,77.8227 C99.4403,77.3757 99.5313,76.9447 99.7133,76.5297 C99.8953,76.1147 100.1423,75.7527 100.4523,75.4417 C100.7623,75.1327 101.1273,74.8837 101.5463,74.6967 C101.9663,74.5097 102.4093,74.4167 102.8743,74.4167 C103.3393,74.4167 103.7793,74.5097 104.1943,74.6967 C104.6083,74.8837 104.9713,75.1327 105.2813,75.4417 C105.5913,75.7527 105.8373,76.1147 106.0203,76.5297 C106.2023,76.9447 106.2933,77.3757 106.2933,77.8227 C106.2933,78.2787 106.2023,78.7097 106.0203,79.1157 M105.9313,74.7647 C105.5433,74.3777 105.0853,74.0697 104.5563,73.8417 C104.0273,73.6137 103.4623,73.4997 102.8603,73.4997 C102.2583,73.4997 101.6923,73.6137 101.1643,73.8417 C100.6343,74.0697 100.1763,74.3777 99.7893,74.7647 C99.4013,75.1527 99.0933,75.6087 98.8653,76.1337 C98.6373,76.6577 98.5233,77.2167 98.5233,77.8087 C98.5233,78.4017 98.6373,78.9607 98.8653,79.4847 C99.0933,80.0097 99.4013,80.4657 99.7893,80.8527 C100.1763,81.2407 100.6343,81.5487 101.1643,81.7757 C101.6923,82.0047 102.2583,82.1177 102.8603,82.1177 C103.4623,82.1177 104.0273,82.0047 104.5563,81.7757 C105.0853,81.5487 105.5433,81.2407 105.9313,80.8527 C106.3193,80.4657 106.6263,80.0097 106.8543,79.4847 C107.0823,78.9607 107.1963,78.4017 107.1963,77.8087 C107.1963,77.2167 107.0823,76.6577 106.8543,76.1337 C106.6263,75.6087 106.3193,75.1527 105.9313,74.7647" id="Fill-21" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M115.8152,74.2729 C115.6232,74.0489 115.4002,73.8719 115.1452,73.7389 C114.8892,73.6069 114.6202,73.5409 114.3372,73.5409 L108.9342,73.5409 L108.9342,82.0769 L109.8912,82.0769 L109.8912,74.4029 L114.1602,74.4029 C114.3602,74.4029 114.5402,74.4549 114.7002,74.5599 C114.8592,74.6649 114.9942,74.7969 115.1042,74.9569 C115.2132,75.1159 115.2972,75.2939 115.3572,75.4899 C115.4162,75.6859 115.4452,75.8759 115.4452,76.0579 C115.4452,76.2219 115.4222,76.3949 115.3772,76.5779 C115.3312,76.7599 115.2562,76.9289 115.1512,77.0839 C115.0462,77.2389 114.9172,77.3669 114.7612,77.4669 C114.6072,77.5669 114.4192,77.6179 114.2012,77.6179 L112.8872,77.6179 L115.1722,82.0769 L116.1982,82.0769 L114.3782,78.4789 C114.6612,78.4789 114.9282,78.4129 115.1792,78.2809 C115.4292,78.1489 115.6482,77.9709 115.8362,77.7479 C116.0222,77.5239 116.1702,77.2679 116.2802,76.9809 C116.3892,76.6939 116.4442,76.3909 116.4442,76.0719 C116.4442,75.7149 116.3872,75.3829 116.2732,75.0729 C116.1592,74.7629 116.0062,74.4959 115.8152,74.2729" id="Fill-22" fill="#1B243D" mask="url(#mask-2)"></path>
+ <polygon id="Fill-23" fill="#1B243D" mask="url(#mask-2)" points="126.5266 73.5405 125.4866 73.5405 123.3666 77.8505 125.4866 82.0765 126.5266 82.0765 124.4336 77.8505"></polygon>
+ <polygon id="Fill-24" fill="#1B243D" mask="url(#mask-2)" points="119.2078 73.5405 118.2498 73.5405 118.2498 82.0765 119.2078 82.0765 119.2078 78.2735 122.1078 78.2735 122.1078 77.4115 119.2078 77.4115"></polygon>
+ <path d="M72.4627,48.06 C67.3487,48.06 61.5897,46.102 56.2467,42.545 C55.7657,42.225 55.2427,42.234 55.0787,42.564 C54.9137,42.894 55.1697,43.421 55.6507,43.741 C61.4477,47.6 67.6967,49.725 73.2447,49.725 C77.8417,49.725 81.5387,48.281 83.9357,45.548 C86.2857,42.87 87.1877,39.202 86.5457,34.942 C86.4797,34.504 86.0177,34.036 85.5137,33.896 C85.0107,33.756 84.6557,33.998 84.7217,34.436 C85.3137,38.362 84.4817,41.743 82.3157,44.211 C80.1077,46.73 76.6997,48.06 72.4627,48.06" id="Fill-25" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M84.5081,28.4746 C84.2921,28.0146 83.7441,27.6416 83.2851,27.6416 C82.8251,27.6416 82.6281,28.0146 82.8431,28.4746 C83.2451,29.3286 83.5941,30.1886 83.8801,31.0306 C84.0341,31.4866 84.5521,31.9036 85.0361,31.9626 C85.0741,31.9676 85.1121,31.9706 85.1481,31.9706 C85.5591,31.9706 85.7741,31.6646 85.6311,31.2456 C85.3211,30.3326 84.9441,29.4006 84.5081,28.4746" id="Fill-26" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M71.5769,13.6919 C65.5769,9.5209 59.0759,7.2239 53.2699,7.2239 C48.6269,7.2239 44.9069,8.6949 42.5129,11.4779 C40.1969,14.1689 39.3079,17.9979 40.0099,22.2589 C40.0819,22.6979 40.5479,23.1639 41.0509,23.2979 C41.1429,23.3219 41.2309,23.3339 41.3109,23.3339 C41.6679,23.3339 41.8889,23.1039 41.8299,22.7449 C41.1839,18.8179 42.0039,15.2889 44.1379,12.8079 C46.3439,10.2439 49.7719,8.8879 54.0529,8.8879 C59.4039,8.8879 65.3959,11.0049 70.9259,14.8499 C71.4009,15.1799 71.9309,15.1889 72.1109,14.8689 C72.2909,14.5489 72.0519,14.0219 71.5769,13.6919" id="Fill-27" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M42.6355,25.9184 C42.4805,25.4624 41.9635,25.0444 41.4795,24.9854 C40.9955,24.9264 40.7285,25.2474 40.8845,25.7034 C41.1935,26.6164 41.5715,27.5484 42.0075,28.4744 C42.2225,28.9344 42.7705,29.3064 43.2305,29.3064 C43.6905,29.3064 43.8875,28.9344 43.6715,28.4744 C43.2695,27.6194 42.9215,26.7594 42.6355,25.9184" id="Fill-28" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M48.9544,5.5986 C48.9954,5.5986 49.0354,5.5956 49.0734,5.5896 C50.1214,5.4216 51.2354,5.3376 52.3844,5.3376 C52.8434,5.3376 53.0404,4.9646 52.8254,4.5046 C52.6094,4.0456 52.0614,3.6726 51.6014,3.6726 C50.3714,3.6726 49.1784,3.7636 48.0554,3.9426 C47.6324,4.0106 47.5174,4.4336 47.7984,4.8886 C48.0544,5.3016 48.5494,5.5986 48.9544,5.5986" id="Fill-29" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M38.4558,28.4746 C41.5898,35.1436 47.1408,41.4016 54.0858,46.0956 C54.3238,46.2566 54.5728,46.3366 54.7848,46.3366 C54.9988,46.3366 55.1738,46.2546 55.2598,46.0896 C55.4298,45.7636 55.1798,45.2356 54.7008,44.9126 C48.2228,40.5336 43.0448,34.6966 40.1208,28.4746 C37.7008,23.3246 37.0648,18.4506 38.2838,14.3796 C39.4638,10.4356 42.3918,7.5286 46.5268,6.1936 C46.9118,6.0696 46.9538,5.6106 46.6218,5.1676 C46.2888,4.7246 45.7088,4.4676 45.3248,4.5906 C40.8908,6.0226 37.7518,9.1386 36.4868,13.3646 C35.1808,17.7296 35.8618,22.9536 38.4558,28.4746" id="Fill-30" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M77.4417,51.3588 C76.3937,51.5268 75.2797,51.6118 74.1307,51.6118 C73.6717,51.6118 73.4737,51.9838 73.6907,52.4438 C73.9057,52.9028 74.4537,53.2758 74.9137,53.2758 C76.1437,53.2758 77.3367,53.1848 78.4607,53.0048 C78.8827,52.9378 78.9977,52.5148 78.7167,52.0598 C78.4357,51.6058 77.8647,51.2918 77.4417,51.3588" id="Fill-31" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M88.0589,28.4741 C84.9249,21.8061 79.3749,15.5481 72.4319,10.8551 C71.9539,10.5311 71.4279,10.5341 71.2579,10.8601 C71.0879,11.1871 71.3379,11.7141 71.8159,12.0371 C78.2939,16.4161 83.4709,22.2531 86.3949,28.4741 C88.7639,33.5141 89.4229,38.3051 88.3009,42.3281 C87.2169,46.2181 84.4469,49.1491 80.5019,50.5781 C80.1259,50.7151 80.0999,51.1811 80.4419,51.6201 C80.7209,51.9771 81.1569,52.2061 81.5129,52.2061 C81.5939,52.2061 81.6709,52.1951 81.7419,52.1691 C85.9709,50.6351 88.9399,47.4951 90.1029,43.3251 C91.3049,39.0121 90.5989,33.8771 88.0589,28.4741" id="Fill-32" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M36.5716,28.4746 C36.3556,28.0146 35.8076,27.6416 35.3476,27.6416 C34.8886,27.6416 34.6906,28.0146 34.9066,28.4746 C37.7026,34.4226 42.1996,40.1156 47.9136,44.9396 C48.1826,45.1666 48.4956,45.2876 48.7556,45.2876 C48.9226,45.2876 49.0686,45.2376 49.1656,45.1336 C49.4136,44.8656 49.2566,44.3466 48.8136,43.9726 C43.4356,39.4326 39.2026,34.0736 36.5716,28.4746" id="Fill-33" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M56.8172,49.5649 C55.1282,48.6039 53.4612,47.5269 51.8632,46.3639 C51.3942,46.0229 50.8562,45.9969 50.6592,46.3039 C50.4632,46.6129 50.6842,47.1389 51.1522,47.4799 C52.8492,48.7149 54.6202,49.8589 56.4142,50.8789 C56.6212,50.9979 56.8282,51.0549 57.0062,51.0549 C57.2542,51.0549 57.4482,50.9439 57.5132,50.7329 C57.6242,50.3699 57.3132,49.8469 56.8172,49.5649" id="Fill-34" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M75.7991,55.1606 C70.9321,55.1606 65.5491,53.8386 60.2301,51.3366 C59.7241,51.0986 59.2721,51.2246 59.2191,51.6186 C59.1671,52.0126 59.5341,52.5236 60.0391,52.7616 C65.6911,55.4206 71.4111,56.8246 76.5821,56.8246 C77.0411,56.8246 77.2381,56.4526 77.0231,55.9926 C76.8061,55.5326 76.2591,55.1606 75.7991,55.1606" id="Fill-35" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M71.843,8.6733 C75.749,11.1523 79.3,14.1083 82.396,17.4603 C85.599,20.9283 88.139,24.6343 89.944,28.4743 C90.16,28.9343 90.707,29.3063 91.167,29.3063 C91.627,29.3063 91.824,28.9343 91.608,28.4743 C89.691,24.3953 86.993,20.4583 83.588,16.7723 C80.3,13.2113 76.528,10.0713 72.379,7.4383 C71.893,7.1303 71.379,7.1563 71.231,7.4983 C71.083,7.8393 71.357,8.3653 71.843,8.6733" id="Fill-36" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M64.1145,4.6572 C65.5935,5.2632 67.0835,5.9662 68.5425,6.7462 C68.7385,6.8512 68.9315,6.9012 69.0985,6.9012 C69.3585,6.9012 69.5575,6.7802 69.6135,6.5532 C69.7045,6.1782 69.3735,5.6592 68.8735,5.3912 C67.3235,4.5622 65.7405,3.8162 64.1695,3.1722 C63.6625,2.9652 63.2385,3.1282 63.2225,3.5382 C63.2075,3.9492 63.6075,4.4492 64.1145,4.6572" id="Fill-37" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M50.7161,1.788 C53.6641,1.788 56.7851,2.266 59.9921,3.207 C60.0951,3.237 60.1921,3.252 60.2811,3.252 C60.6281,3.252 60.8491,3.034 60.8041,2.687 C60.7471,2.252 60.2931,1.78 59.7881,1.631 C56.3801,0.631 53.0651,0.123 49.9331,0.123 C49.4741,0.123 49.2761,0.496 49.4921,0.956 C49.7081,1.415 50.2561,1.788 50.7161,1.788" id="Fill-38" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M36.7913,1.5722 C37.1013,1.3622 37.0253,0.8602 36.6233,0.4512 C36.2213,0.0432 35.6443,-0.1178 35.3333,0.0932 C32.3243,2.1362 30.1993,4.9382 29.0183,8.4202 C28.8973,8.7782 29.1993,9.3012 29.6923,9.5912 C29.9053,9.7152 30.1183,9.7762 30.3023,9.7762 C30.5443,9.7762 30.7353,9.6702 30.8043,9.4672 C31.9243,6.1662 33.9383,3.5102 36.7913,1.5722" id="Fill-39" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M29.3557,10.9082 C28.8527,10.6582 28.3887,10.7682 28.3197,11.1542 C28.1767,11.9612 28.0807,12.8002 28.0327,13.6492 C28.0107,14.0562 28.4037,14.5592 28.9107,14.7732 C29.0647,14.8382 29.2117,14.8692 29.3417,14.8692 C29.6417,14.8692 29.8547,14.7072 29.8707,14.4242 C29.9157,13.6192 30.0067,12.8242 30.1427,12.0592 C30.2107,11.6732 29.8587,11.1582 29.3557,10.9082" id="Fill-40" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M96.823,47.3579 C96.33,47.0689 95.832,47.1249 95.711,47.4819 C94.591,50.7829 92.576,53.4389 89.723,55.3769 C89.414,55.5869 89.489,56.0889 89.891,56.4979 C90.174,56.7849 90.542,56.9499 90.844,56.9499 C90.972,56.9499 91.089,56.9199 91.181,56.8569 C94.191,54.8119 96.316,52.0099 97.497,48.5289 C97.617,48.1709 97.316,47.6469 96.823,47.3579" id="Fill-41" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M97.6082,41.9389 C97.1012,41.7279 96.6742,41.8889 96.6562,42.2969 C96.6162,43.1809 96.5212,44.0529 96.3722,44.8889 C96.3042,45.2749 96.6562,45.7909 97.1592,46.0409 C97.3412,46.1299 97.5192,46.1739 97.6742,46.1739 C97.9462,46.1739 98.1512,46.0409 98.1942,45.7939 C98.3512,44.9129 98.4522,43.9929 98.4942,43.0589 C98.5122,42.6509 98.1162,42.1489 97.6082,41.9389" id="Fill-42" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M70.7937,44.5092 C61.9517,44.5092 51.3777,37.3162 47.2227,28.4742 C43.0667,19.6332 46.8797,12.4392 55.7217,12.4392 C64.5637,12.4392 75.1377,19.6332 79.2927,28.4742 C83.4477,37.3162 79.6357,44.5092 70.7937,44.5092 M54.9397,10.7752 C45.1797,10.7752 40.9717,18.7152 45.5577,28.4742 C50.1447,38.2342 61.8157,46.1742 71.5757,46.1742 C81.3357,46.1742 85.5437,38.2342 80.9577,28.4742 C76.3707,18.7152 64.6987,10.7752 54.9397,10.7752" id="Fill-43" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M36.9939,5.7876 C36.5479,5.4176 35.9899,5.3376 35.7469,5.6096 C34.2189,7.3236 33.1309,9.3756 32.5139,11.7096 C32.4159,12.0796 32.7409,12.6006 33.2389,12.8726 C33.4379,12.9816 33.6359,13.0346 33.8059,13.0346 C34.0619,13.0346 34.2599,12.9166 34.3179,12.6946 C34.8999,10.4966 35.9239,8.5646 37.3629,6.9516 C37.6049,6.6786 37.4399,6.1586 36.9939,5.7876" id="Fill-44" fill="#1B243D" mask="url(#mask-2)"></path>
+ <path d="M90.5696,51.5581 C92.2026,49.8011 93.3576,47.6751 94.0016,45.2401 C94.0996,44.8691 93.7756,44.3481 93.2766,44.0761 C92.7776,43.8041 92.2946,43.8831 92.1966,44.2541 C91.5906,46.5471 90.5026,48.5491 88.9656,50.2041 C88.7166,50.4701 88.8746,50.9911 89.3176,51.3641 C89.5866,51.5911 89.8996,51.7121 90.1596,51.7121 C90.3266,51.7121 90.4716,51.6621 90.5696,51.5581" id="Fill-45" fill="#1B243D" mask="url(#mask-2)"></path>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/app/images/logo.png b/app/images/logo.png
new file mode 100644
index 000000000..db6ba7d6c
--- /dev/null
+++ b/app/images/logo.png
Binary files differ
diff --git a/app/images/pw-128x128.png b/app/images/pw-128x128.png
new file mode 100644
index 000000000..a0eb1b730
--- /dev/null
+++ b/app/images/pw-128x128.png
Binary files differ
diff --git a/app/images/pw-48x48.png b/app/images/pw-48x48.png
new file mode 100644
index 000000000..a96c59e15
--- /dev/null
+++ b/app/images/pw-48x48.png
Binary files differ
diff --git a/app/images/pw128x128.png b/app/images/pw128x128.png
new file mode 100644
index 000000000..a0eb1b730
--- /dev/null
+++ b/app/images/pw128x128.png
Binary files differ
diff --git a/app/loading.html b/app/loading.html
new file mode 100644
index 000000000..aef5d9607
--- /dev/null
+++ b/app/loading.html
@@ -0,0 +1,35 @@
+<html>
+<head>
+ <title>MetaMask Loading</title>
+ <style>
+ #div-logo {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ width: 256px;
+ }
+ #logo {
+ width: 100%;
+ animation: pulse 1s ease-in-out infinite;
+ }
+ @keyframes pulse {
+ 0% {
+ opacity: 1;
+ }
+ 50% {
+ opacity: 0.5;
+ transform: scale(0.95, 0.95);
+ }
+ 100% {
+ opacity: 1;
+ }
+ }
+ </style>
+</head>
+<body>
+ <div id="div-logo">
+ <img id="logo" src="./images/loginglogo.svg">
+ </div>
+</body>
+</html>
diff --git a/app/manifest.json b/app/manifest.json
index e3a7fd963..ed328f19f 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appName__",
- "version": "4.7.4",
+ "version": "4.8.0",
"manifest_version": 2,
"author": "https://metamask.io",
"description": "__MSG_appDescription__",
@@ -59,10 +59,16 @@
"unlimitedStorage",
"clipboardWrite",
"http://localhost:8545/",
- "https://*.infura.io/"
+ "https://*.infura.io/",
+ "activeTab",
+ "webRequest",
+ "*://*.eth/",
+ "*://*.test/",
+ "notifications"
],
"web_accessible_resources": [
- "inpage.js"
+ "inpage.js",
+ "phishing.html"
],
"externally_connectable": {
"matches": [
@@ -72,4 +78,4 @@
"*"
]
}
-} \ No newline at end of file
+}
diff --git a/app/phishing.html b/app/phishing.html
new file mode 100644
index 000000000..86f2985cc
--- /dev/null
+++ b/app/phishing.html
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML>
+
+<html>
+
+ <head>
+ <title>Phishing Warning</title>
+
+ <style>
+body {
+ background: #c50000;
+ padding: 50px;
+ display: flex;
+ justify-content: center;
+ font-family: sans-serif;
+}
+.centered {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ color: white;
+ max-width: 600px;
+}
+a {
+ color: white;
+}
+ </style>
+
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-37075177-6', 'auto');
+ ga('send', 'pageview');
+ //Send referral data to EAL
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-68598031-1', 'auto' {'allowLinker':true});
+ ga('send', 'pageview');
+ ga('require', 'linker');
+ ga('linker:autoLink', ['harrydenley.com', 'metamask.io'], false, true);
+ </script>
+
+ </head>
+
+ <body>
+ <div class="centered">
+
+ <img src="/images/ethereum-metamask-chrome.png" style="width:100%">
+ <h3>ATTENTION</h3>
+ <p>MetaMask believes this domain to have malicious intent and has prevented you from interacting with it.</p>
+ <p>This is because the site tested positive on the <a href="https://github.com/metamask/eth-phishing-detect">Ethereum Phishing Detector</a>.</p>
+ <p>You can turn MetaMask off to interact with this site, but it's advised not to.</p>
+ <p>If you think this domain is incorrectly flagged, <a href="https://github.com/metamask/eth-phishing-detect/issues/new">please file an issue</a>.</p>
+
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 2be600c4b..c0b00730d 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -26,6 +26,8 @@ const setupMetamaskMeshMetrics = require('./lib/setupMetamaskMeshMetrics')
const EdgeEncryptor = require('./edge-encryptor')
const getFirstPreferredLangCode = require('./lib/get-first-preferred-lang-code')
const getObjStructure = require('./lib/getObjStructure')
+const ipfsContent = require('./lib/ipfsContent.js')
+
const {
ENVIRONMENT_TYPE_POPUP,
ENVIRONMENT_TYPE_NOTIFICATION,
@@ -42,8 +44,8 @@ const notificationManager = new NotificationManager()
global.METAMASK_NOTIFIER = notificationManager
// setup sentry error reporting
-const release = platform.getVersion()
-const raven = setupRaven({ release })
+const releaseVersion = platform.getVersion()
+const raven = setupRaven({ releaseVersion })
// browser check if it is Edge - https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
// Internet Explorer 6-11
@@ -51,6 +53,7 @@ const isIE = !!document.documentMode
// Edge 20+
const isEdge = !isIE && !!window.StyleMedia
+let ipfsHandle
let popupIsOpen = false
let notificationIsOpen = false
const openMetamaskTabsIDs = {}
@@ -66,6 +69,7 @@ initialize().catch(log.error)
// setup metamask mesh testing container
setupMetamaskMeshMetrics()
+
/**
* An object representing a transaction, in whatever state it is in.
* @typedef TransactionMeta
@@ -155,6 +159,7 @@ async function initialize () {
const initLangCode = await getFirstPreferredLangCode()
await setupController(initState, initLangCode)
log.debug('MetaMask initialization complete.')
+ ipfsHandle = ipfsContent(initState.NetworkController.provider)
}
//
@@ -259,6 +264,11 @@ function setupController (initState, initLangCode) {
})
global.metamaskController = controller
+ controller.networkController.on('networkDidChange', () => {
+ ipfsHandle && ipfsHandle.remove()
+ ipfsHandle = ipfsContent(controller.networkController.providerStore.getState())
+ })
+
// report failed transactions to Sentry
controller.txController.on(`tx:status-update`, (txId, status) => {
if (status !== 'failed') return
@@ -379,7 +389,7 @@ function setupController (initState, initLangCode) {
}
// communication with page or other extension
- function connectExternal(remotePort) {
+ function connectExternal (remotePort) {
const originDomain = urlUtil.parse(remotePort.sender.url).hostname
const portStream = new PortStream(remotePort)
controller.setupUntrustedCommunication(portStream, originDomain)
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js
index 75e0a95b3..b7496f318 100644
--- a/app/scripts/contentscript.js
+++ b/app/scripts/contentscript.js
@@ -115,8 +115,8 @@ function logStreamDisconnectWarning (remoteLabel, err) {
* @returns {boolean} {@code true} if Web3 should be injected
*/
function shouldInjectWeb3 () {
- return doctypeCheck() && suffixCheck()
- && documentElementCheck() && !blacklistedDomainCheck()
+ return doctypeCheck() && suffixCheck() &&
+ documentElementCheck() && !blacklistedDomainCheck()
}
/**
@@ -177,6 +177,9 @@ function blacklistedDomainCheck () {
'cdn.shopify.com/s/javascripts/tricorder/xtld-read-only-frame.html',
'adyen.com',
'gravityforms.com',
+ 'harbourair.com',
+ 'ani.gamer.com.tw',
+ 'blueskybooking.com',
]
var currentUrl = window.location.href
var currentRegex
@@ -194,6 +197,7 @@ function blacklistedDomainCheck () {
* Redirects the current page to a phishing information page
*/
function redirectToPhishingWarning () {
- console.log('MetaMask - redirecting to phishing warning')
- window.location.href = 'https://metamask.io/phishing.html'
+ console.log('MetaMask - routing to Phishing Warning component')
+ let extensionURL = extension.runtime.getURL('phishing.html')
+ window.location.href = extensionURL
}
diff --git a/app/scripts/controllers/balance.js b/app/scripts/controllers/balance.js
index 86619fce1..4c97810a3 100644
--- a/app/scripts/controllers/balance.js
+++ b/app/scripts/controllers/balance.js
@@ -60,7 +60,7 @@ class BalanceController {
* Sets up listeners and subscriptions which should trigger an update of ethBalance. These updates include:
* - when a transaction changes state to 'submitted', 'confirmed' or 'failed'
* - when the current account changes (i.e. a new account is selected)
- * - when there is a block update
+ * - when there is a block update
*
* @private
*
@@ -100,7 +100,7 @@ class BalanceController {
/**
* Gets the pending transactions (i.e. those with a 'submitted' status). These are accessed from the
- * TransactionController passed to this BalanceController during construction.
+ * TransactionController passed to this BalanceController during construction.
*
* @private
* @returns {Promise<array>} Promises an array of transaction objects.
diff --git a/app/scripts/controllers/blacklist.js b/app/scripts/controllers/blacklist.js
index f100c4525..1d2191433 100644
--- a/app/scripts/controllers/blacklist.js
+++ b/app/scripts/controllers/blacklist.js
@@ -87,7 +87,7 @@ class BlacklistController {
*
* @private
* @param {object} config A config object like that found at {@link https://github.com/MetaMask/eth-phishing-detect/blob/master/src/config.json}
- *
+ *
*/
_setupPhishingDetector (config) {
this._phishingDetector = new PhishingDetector(config)
diff --git a/app/scripts/controllers/computed-balances.js b/app/scripts/controllers/computed-balances.js
index 1a6802f9a..e04ce2ef7 100644
--- a/app/scripts/controllers/computed-balances.js
+++ b/app/scripts/controllers/computed-balances.js
@@ -18,7 +18,7 @@ class ComputedbalancesController {
/**
* Creates a new controller instance
*
- * @param {ComputedBalancesOptions} [opts] Controller configuration parameters
+ * @param {ComputedBalancesOptions} [opts] Controller configuration parameters
*/
constructor (opts = {}) {
const { accountTracker, txController, blockTracker } = opts
diff --git a/app/scripts/controllers/currency.js b/app/scripts/controllers/currency.js
index 480c08b1c..a93aff49b 100644
--- a/app/scripts/controllers/currency.js
+++ b/app/scripts/controllers/currency.js
@@ -16,9 +16,9 @@ class CurrencyController {
* currentCurrency, conversionRate and conversionDate properties
* @property {string} currentCurrency A 2-4 character shorthand that describes a specific currency, currently
* selected by the user
- * @property {number} conversionRate The conversion rate from ETH to the selected currency.
+ * @property {number} conversionRate The conversion rate from ETH to the selected currency.
* @property {string} conversionDate The date at which the conversion rate was set. Expressed in in milliseconds
- * since midnight of January 1, 1970
+ * since midnight of January 1, 1970
* @property {number} conversionInterval The id of the interval created by the scheduleConversionInterval method.
* Used to clear an existing interval on subsequent calls of that method.
*
@@ -59,7 +59,7 @@ class CurrencyController {
/**
* A getter for the conversionRate property
*
- * @returns {string} The conversion rate from ETH to the selected currency.
+ * @returns {string} The conversion rate from ETH to the selected currency.
*
*/
getConversionRate () {
@@ -80,7 +80,7 @@ class CurrencyController {
* A getter for the conversionDate property
*
* @returns {string} The date at which the conversion rate was set. Expressed in milliseconds since midnight of
- * January 1, 1970
+ * January 1, 1970
*
*/
getConversionDate () {
diff --git a/app/scripts/controllers/detect-tokens.js b/app/scripts/controllers/detect-tokens.js
new file mode 100644
index 000000000..195ec918a
--- /dev/null
+++ b/app/scripts/controllers/detect-tokens.js
@@ -0,0 +1,130 @@
+const Web3 = require('web3')
+const contracts = require('eth-contract-metadata')
+const { warn } = require('loglevel')
+const { MAINNET } = require('./network/enums')
+// By default, poll every 3 minutes
+const DEFAULT_INTERVAL = 180 * 1000
+const ERC20_ABI = [{'constant': true, 'inputs': [{'name': '_owner', 'type': 'address'}], 'name': 'balanceOf', 'outputs': [{'name': 'balance', 'type': 'uint256'}], 'payable': false, 'type': 'function'}]
+
+/**
+ * A controller that polls for token exchange
+ * rates based on a user's current token list
+ */
+class DetectTokensController {
+ /**
+ * Creates a DetectTokensController
+ *
+ * @param {Object} [config] - Options to configure controller
+ */
+ constructor ({ interval = DEFAULT_INTERVAL, preferences, network, keyringMemStore } = {}) {
+ this.preferences = preferences
+ this.interval = interval
+ this.network = network
+ this.keyringMemStore = keyringMemStore
+ }
+
+ /**
+ * For each token in eth-contract-metada, find check selectedAddress balance.
+ *
+ */
+ async detectNewTokens () {
+ if (!this.isActive) { return }
+ if (this._network.store.getState().provider.type !== MAINNET) { return }
+ this.web3.setProvider(this._network._provider)
+ for (const contractAddress in contracts) {
+ if (contracts[contractAddress].erc20 && !(this.tokenAddresses.includes(contractAddress.toLowerCase()))) {
+ this.detectTokenBalance(contractAddress)
+ }
+ }
+ }
+
+ /**
+ * Find if selectedAddress has tokens with contract in contractAddress.
+ *
+ * @param {string} contractAddress Hex address of the token contract to explore.
+ * @returns {boolean} If balance is detected, token is added.
+ *
+ */
+ async detectTokenBalance (contractAddress) {
+ const ethContract = this.web3.eth.contract(ERC20_ABI).at(contractAddress)
+ ethContract.balanceOf(this.selectedAddress, (error, result) => {
+ if (!error) {
+ if (!result.isZero()) {
+ this._preferences.addToken(contractAddress, contracts[contractAddress].symbol, contracts[contractAddress].decimals)
+ }
+ } else {
+ warn(`MetaMask - DetectTokensController balance fetch failed for ${contractAddress}.`, error)
+ }
+ })
+ }
+
+ /**
+ * Restart token detection polling period and call detectNewTokens
+ * in case of address change or user session initialization.
+ *
+ */
+ restartTokenDetection () {
+ if (!(this.isActive && this.selectedAddress)) { return }
+ this.detectNewTokens()
+ this.interval = DEFAULT_INTERVAL
+ }
+
+ /**
+ * @type {Number}
+ */
+ set interval (interval) {
+ this._handle && clearInterval(this._handle)
+ if (!interval) { return }
+ this._handle = setInterval(() => { this.detectNewTokens() }, interval)
+ }
+
+ /**
+ * In setter when selectedAddress is changed, detectNewTokens and restart polling
+ * @type {Object}
+ */
+ set preferences (preferences) {
+ if (!preferences) { return }
+ this._preferences = preferences
+ preferences.store.subscribe(({ tokens }) => { this.tokenAddresses = tokens.map((obj) => { return obj.address }) })
+ preferences.store.subscribe(({ selectedAddress }) => {
+ if (this.selectedAddress !== selectedAddress) {
+ this.selectedAddress = selectedAddress
+ this.restartTokenDetection()
+ }
+ })
+ }
+
+ /**
+ * @type {Object}
+ */
+ set network (network) {
+ if (!network) { return }
+ this._network = network
+ this.web3 = new Web3(network._provider)
+ }
+
+ /**
+ * In setter when isUnlocked is updated to true, detectNewTokens and restart polling
+ * @type {Object}
+ */
+ set keyringMemStore (keyringMemStore) {
+ if (!keyringMemStore) { return }
+ this._keyringMemStore = keyringMemStore
+ this._keyringMemStore.subscribe(({ isUnlocked }) => {
+ if (this.isUnlocked !== isUnlocked) {
+ this.isUnlocked = isUnlocked
+ if (isUnlocked) { this.restartTokenDetection() }
+ }
+ })
+ }
+
+ /**
+ * Internal isActive state
+ * @type {Object}
+ */
+ get isActive () {
+ return this.isOpen && this.isUnlocked
+ }
+}
+
+module.exports = DetectTokensController
diff --git a/app/scripts/controllers/network/enums.js b/app/scripts/controllers/network/enums.js
index 9da7f309c..3190eb37c 100644
--- a/app/scripts/controllers/network/enums.js
+++ b/app/scripts/controllers/network/enums.js
@@ -4,6 +4,7 @@ const KOVAN = 'kovan'
const MAINNET = 'mainnet'
const LOCALHOST = 'localhost'
+const MAINNET_CODE = 1
const ROPSTEN_CODE = 3
const RINKEYBY_CODE = 4
const KOVAN_CODE = 42
@@ -13,13 +14,13 @@ const RINKEBY_DISPLAY_NAME = 'Rinkeby'
const KOVAN_DISPLAY_NAME = 'Kovan'
const MAINNET_DISPLAY_NAME = 'Main Ethereum Network'
-
module.exports = {
ROPSTEN,
RINKEBY,
KOVAN,
MAINNET,
LOCALHOST,
+ MAINNET_CODE,
ROPSTEN_CODE,
RINKEYBY_CODE,
KOVAN_CODE,
diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js
index 5e0c63e7d..b6f7705b5 100644
--- a/app/scripts/controllers/network/network.js
+++ b/app/scripts/controllers/network/network.js
@@ -9,6 +9,7 @@ const extend = require('xtend')
const EthQuery = require('eth-query')
const createEventEmitterProxy = require('../../lib/events-proxy.js')
const log = require('loglevel')
+const urlUtil = require('url')
const {
ROPSTEN,
RINKEBY,
@@ -132,7 +133,7 @@ module.exports = class NetworkController extends EventEmitter {
} else if (type === LOCALHOST) {
this._configureStandardProvider({ rpcUrl: LOCALHOST_RPC_URL })
// url-based rpc endpoints
- } else if (type === 'rpc'){
+ } else if (type === 'rpc') {
this._configureStandardProvider({ rpcUrl: rpcTarget })
} else {
throw new Error(`NetworkController - _configureProvider - unknown type "${type}"`)
@@ -155,6 +156,8 @@ module.exports = class NetworkController extends EventEmitter {
}
_configureStandardProvider ({ rpcUrl }) {
+ // urlUtil handles malformed urls
+ rpcUrl = urlUtil.parse(rpcUrl).format()
const providerParams = extend(this._baseProviderParams, {
rpcUrl,
engineParams: {
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index f1bd66889..8a4a63bb6 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -127,6 +127,30 @@ class PreferencesController {
}
/**
+ * Removes an address from state
+ *
+ * @param {string} address A hex address
+ * @returns {string} the address that was removed
+ */
+ removeAddress (address) {
+ const identities = this.store.getState().identities
+ if (!identities[address]) {
+ throw new Error(`${address} can't be deleted cause it was not found`)
+ }
+ delete identities[address]
+ this.store.updateState({ identities })
+
+ // If the selected account is no longer valid,
+ // select an arbitrary other account:
+ if (address === this.getSelectedAddress()) {
+ const selected = Object.keys(identities)[0]
+ this.setSelectedAddress(selected)
+ }
+ return address
+ }
+
+
+ /**
* Adds addresses to the identities object without removing identities
*
* @param {string[]} addresses An array of hex addresses
@@ -152,9 +176,9 @@ class PreferencesController {
* @returns {Promise<string>} selectedAddress the selected address.
*/
syncAddresses (addresses) {
- let { identities, lostIdentities } = this.store.getState()
+ const { identities, lostIdentities } = this.store.getState()
- let newlyLost = {}
+ const newlyLost = {}
Object.keys(identities).forEach((identity) => {
if (!addresses.includes(identity)) {
newlyLost[identity] = identities[identity]
@@ -169,7 +193,7 @@ class PreferencesController {
if (this.diagnostics) this.diagnostics.reportOrphans(newlyLost)
// store lost accounts
- for (let key in newlyLost) {
+ for (const key in newlyLost) {
lostIdentities[key] = newlyLost[key]
}
}
diff --git a/app/scripts/controllers/recent-blocks.js b/app/scripts/controllers/recent-blocks.js
index 033ef1d7e..926268691 100644
--- a/app/scripts/controllers/recent-blocks.js
+++ b/app/scripts/controllers/recent-blocks.js
@@ -117,7 +117,7 @@ class RecentBlocksController {
*
* @returns {Promise<void>} Promises undefined
*/
- async backfill() {
+ async backfill () {
this.blockTracker.once('block', async (block) => {
const currentBlockNumber = Number.parseInt(block.number, 16)
const blocksToFetch = Math.min(currentBlockNumber, this.historyLength)
diff --git a/app/scripts/controllers/transactions/nonce-tracker.js b/app/scripts/controllers/transactions/nonce-tracker.js
index 35ca08d6c..06f336eaa 100644
--- a/app/scripts/controllers/transactions/nonce-tracker.js
+++ b/app/scripts/controllers/transactions/nonce-tracker.js
@@ -129,19 +129,6 @@ class NonceTracker {
return Number.isInteger(highest) ? highest + 1 : 0
}
- _reduceTxListToUniqueNonces (txList) {
- const reducedTxList = txList.reduce((reducedList, txMeta, index) => {
- if (!index) return [txMeta]
- const nonceMatches = txList.filter((txData) => {
- return txMeta.txParams.nonce === txData.txParams.nonce
- })
- if (nonceMatches.length > 1) return reducedList
- reducedList.push(txMeta)
- return reducedList
- }, [])
- return reducedTxList
- }
-
_getHighestNonce (txList) {
const nonces = txList.map((txMeta) => {
const nonce = txMeta.txParams.nonce
diff --git a/app/scripts/controllers/transactions/tx-gas-utils.js b/app/scripts/controllers/transactions/tx-gas-utils.js
index 36b5cdbc9..5cd0f5407 100644
--- a/app/scripts/controllers/transactions/tx-gas-utils.js
+++ b/app/scripts/controllers/transactions/tx-gas-utils.js
@@ -30,14 +30,10 @@ class TxGasUtil {
try {
estimatedGasHex = await this.estimateTxGas(txMeta, block.gasLimit)
} catch (err) {
- const simulationFailed = (
- err.message.includes('Transaction execution error.') ||
- err.message.includes('gas required exceeds allowance or always failing transaction')
- )
- if (simulationFailed) {
- txMeta.simulationFails = true
- return txMeta
+ txMeta.simulationFails = {
+ reason: err.message,
}
+ return txMeta
}
this.setTxGas(txMeta, block.gasLimit, estimatedGasHex)
return txMeta
@@ -126,4 +122,4 @@ class TxGasUtil {
}
}
-module.exports = TxGasUtil \ No newline at end of file
+module.exports = TxGasUtil
diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js
index 0aae4774b..28a18ca2e 100644
--- a/app/scripts/controllers/transactions/tx-state-manager.js
+++ b/app/scripts/controllers/transactions/tx-state-manager.js
@@ -288,6 +288,7 @@ class TransactionStateManager extends EventEmitter {
*/
setTxStatusRejected (txId) {
this._setTxStatus(txId, 'rejected')
+ this._removeTx(txId)
}
/**
@@ -422,6 +423,11 @@ class TransactionStateManager extends EventEmitter {
_saveTxList (transactions) {
this.store.updateState({ transactions })
}
+
+ _removeTx (txId) {
+ const transactionList = this.getFullTxList()
+ this._saveTxList(transactionList.filter((txMeta) => txMeta.id !== txId))
+ }
}
module.exports = TransactionStateManager
diff --git a/app/scripts/lib/cleanErrorStack.js b/app/scripts/lib/cleanErrorStack.js
index fe1bfb0ce..8adf55db7 100644
--- a/app/scripts/lib/cleanErrorStack.js
+++ b/app/scripts/lib/cleanErrorStack.js
@@ -3,7 +3,7 @@
* @param {Error} err - error
* @returns {Error} Error with clean stack trace.
*/
-function cleanErrorStack(err){
+function cleanErrorStack (err) {
var name = err.name
name = (name === undefined) ? 'Error' : String(name)
diff --git a/app/scripts/lib/contracts/registrar.js b/app/scripts/lib/contracts/registrar.js
new file mode 100644
index 000000000..99ca24458
--- /dev/null
+++ b/app/scripts/lib/contracts/registrar.js
@@ -0,0 +1 @@
+module.exports = [{'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'resolver', 'outputs': [{'name': '', 'type': 'address'}], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'owner', 'outputs': [{'name': '', 'type': 'address'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'label', 'type': 'bytes32'}, {'name': 'owner', 'type': 'address'}], 'name': 'setSubnodeOwner', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'ttl', 'type': 'uint64'}], 'name': 'setTTL', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'ttl', 'outputs': [{'name': '', 'type': 'uint64'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'resolver', 'type': 'address'}], 'name': 'setResolver', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'owner', 'type': 'address'}], 'name': 'setOwner', 'outputs': [], 'payable': false, 'type': 'function'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'owner', 'type': 'address'}], 'name': 'Transfer', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': true, 'name': 'label', 'type': 'bytes32'}, {'indexed': false, 'name': 'owner', 'type': 'address'}], 'name': 'NewOwner', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'resolver', 'type': 'address'}], 'name': 'NewResolver', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'ttl', 'type': 'uint64'}], 'name': 'NewTTL', 'type': 'event'}]
diff --git a/app/scripts/lib/contracts/resolver.js b/app/scripts/lib/contracts/resolver.js
new file mode 100644
index 000000000..1bf3f90ce
--- /dev/null
+++ b/app/scripts/lib/contracts/resolver.js
@@ -0,0 +1,2 @@
+module.exports =
+[{'constant': true, 'inputs': [{'name': 'interfaceID', 'type': 'bytes4'}], 'name': 'supportsInterface', 'outputs': [{'name': '', 'type': 'bool'}], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'contentTypes', 'type': 'uint256'}], 'name': 'ABI', 'outputs': [{'name': 'contentType', 'type': 'uint256'}, {'name': 'data', 'type': 'bytes'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'x', 'type': 'bytes32'}, {'name': 'y', 'type': 'bytes32'}], 'name': 'setPubkey', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'content', 'outputs': [{'name': 'ret', 'type': 'bytes32'}], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'addr', 'outputs': [{'name': 'ret', 'type': 'address'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'contentType', 'type': 'uint256'}, {'name': 'data', 'type': 'bytes'}], 'name': 'setABI', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'name', 'outputs': [{'name': 'ret', 'type': 'string'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'name', 'type': 'string'}], 'name': 'setName', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'hash', 'type': 'bytes32'}], 'name': 'setContent', 'outputs': [], 'payable': false, 'type': 'function'}, {'constant': true, 'inputs': [{'name': 'node', 'type': 'bytes32'}], 'name': 'pubkey', 'outputs': [{'name': 'x', 'type': 'bytes32'}, {'name': 'y', 'type': 'bytes32'}], 'payable': false, 'type': 'function'}, {'constant': false, 'inputs': [{'name': 'node', 'type': 'bytes32'}, {'name': 'addr', 'type': 'address'}], 'name': 'setAddr', 'outputs': [], 'payable': false, 'type': 'function'}, {'inputs': [{'name': 'ensAddr', 'type': 'address'}], 'payable': false, 'type': 'constructor'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'a', 'type': 'address'}], 'name': 'AddrChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'hash', 'type': 'bytes32'}], 'name': 'ContentChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'name', 'type': 'string'}], 'name': 'NameChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': true, 'name': 'contentType', 'type': 'uint256'}], 'name': 'ABIChanged', 'type': 'event'}, {'anonymous': false, 'inputs': [{'indexed': true, 'name': 'node', 'type': 'bytes32'}, {'indexed': false, 'name': 'x', 'type': 'bytes32'}, {'indexed': false, 'name': 'y', 'type': 'bytes32'}], 'name': 'PubkeyChanged', 'type': 'event'}]
diff --git a/app/scripts/lib/createErrorMiddleware.js b/app/scripts/lib/createErrorMiddleware.js
index c70beddfd..7f6a4bd73 100644
--- a/app/scripts/lib/createErrorMiddleware.js
+++ b/app/scripts/lib/createErrorMiddleware.js
@@ -64,4 +64,4 @@ function createErrorMiddleware ({ override = true } = {}) {
}
}
-module.exports = createErrorMiddleware \ No newline at end of file
+module.exports = createErrorMiddleware
diff --git a/app/scripts/lib/createStreamSink.js b/app/scripts/lib/createStreamSink.js
index cf9416fea..b93dbc089 100644
--- a/app/scripts/lib/createStreamSink.js
+++ b/app/scripts/lib/createStreamSink.js
@@ -4,7 +4,7 @@ const promiseToCallback = require('promise-to-callback')
module.exports = createStreamSink
-function createStreamSink(asyncWriteFn, _opts) {
+function createStreamSink (asyncWriteFn, _opts) {
return new AsyncWritableStream(asyncWriteFn, _opts)
}
diff --git a/app/scripts/lib/diagnostics-reporter.js b/app/scripts/lib/diagnostics-reporter.js
index aa4ca6e26..569eb3268 100644
--- a/app/scripts/lib/diagnostics-reporter.js
+++ b/app/scripts/lib/diagnostics-reporter.js
@@ -5,7 +5,7 @@ class DiagnosticsReporter {
this.version = version
}
- async reportOrphans(orphans) {
+ async reportOrphans (orphans) {
try {
return await this.submit({
accounts: Object.keys(orphans),
@@ -19,7 +19,7 @@ class DiagnosticsReporter {
}
}
- async reportMultipleKeyrings(rawKeyrings) {
+ async reportMultipleKeyrings (rawKeyrings) {
try {
const keyrings = await Promise.all(rawKeyrings.map(async (keyring, index) => {
return {
@@ -55,7 +55,7 @@ class DiagnosticsReporter {
}
-function postData(data) {
+function postData (data) {
const uri = 'https://diagnostics.metamask.io/v1/orphanedAccounts'
return fetch(uri, {
body: JSON.stringify(data), // must match 'Content-Type' header
diff --git a/app/scripts/lib/extractEthjsErrorMessage.js b/app/scripts/lib/extractEthjsErrorMessage.js
index 0f100756f..4891075c3 100644
--- a/app/scripts/lib/extractEthjsErrorMessage.js
+++ b/app/scripts/lib/extractEthjsErrorMessage.js
@@ -10,13 +10,13 @@ module.exports = extractEthjsErrorMessage
*
* @param {string} errorMessage The error message to parse
* @returns {string} Returns an error message, either the same as was passed, or the ending message portion of an isEthjsRpcError
- *
+ *
* @example
* // returns 'Transaction Failed: replacement transaction underpriced'
* extractEthjsErrorMessage(`Error: [ethjs-rpc] rpc error with payload {"id":3947817945380,"jsonrpc":"2.0","params":["0xf8eb8208708477359400830398539406012c8cf97bead5deae237070f9587f8e7a266d80b8843d7d3f5a0000000000000000000000000000000000000000000000000000000000081d1a000000000000000000000000000000000000000000000000001ff973cafa800000000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000000000000003f48025a04c32a9b630e0d9e7ff361562d850c86b7a884908135956a7e4a336fa0300d19ca06830776423f25218e8d19b267161db526e66895567147015b1f3fc47aef9a3c7"],"method":"eth_sendRawTransaction"} Error: replacement transaction underpriced`)
*
*/
-function extractEthjsErrorMessage(errorMessage) {
+function extractEthjsErrorMessage (errorMessage) {
const isEthjsRpcError = errorMessage.includes(ethJsRpcSlug)
if (isEthjsRpcError) {
const payloadAndError = errorMessage.slice(ethJsRpcSlug.length)
diff --git a/app/scripts/lib/get-first-preferred-lang-code.js b/app/scripts/lib/get-first-preferred-lang-code.js
index 41a886d74..170d508c1 100644
--- a/app/scripts/lib/get-first-preferred-lang-code.js
+++ b/app/scripts/lib/get-first-preferred-lang-code.js
@@ -28,7 +28,7 @@ async function getFirstPreferredLangCode () {
// safeguard for Brave Browser until they implement chrome.i18n.getAcceptLanguages
// https://github.com/MetaMask/metamask-extension/issues/4270
- if (!userPreferredLocaleCodes){
+ if (!userPreferredLocaleCodes) {
userPreferredLocaleCodes = []
}
diff --git a/app/scripts/lib/getObjStructure.js b/app/scripts/lib/getObjStructure.js
index 52250d3fb..9c92879fb 100644
--- a/app/scripts/lib/getObjStructure.js
+++ b/app/scripts/lib/getObjStructure.js
@@ -18,12 +18,12 @@ module.exports = getObjStructure
* Creates an object that represents the structure of the given object. It replaces all values with the result of their
* type.
*
- * @param {object} obj The object for which a 'structure' will be returned. Usually a plain object and not a class.
+ * @param {object} obj The object for which a 'structure' will be returned. Usually a plain object and not a class.
* @returns {object} The "mapped" version of a deep clone of the passed object, with each non-object property value
* replaced with the javascript type of that value.
*
*/
-function getObjStructure(obj) {
+function getObjStructure (obj) {
const structure = clone(obj)
return deepMap(structure, (value) => {
return value === null ? 'null' : typeof value
@@ -38,7 +38,7 @@ function getObjStructure(obj) {
* @param {Function} visit The modifier to apply to each non-object property value
* @returns {object} The modified object
*/
-function deepMap(target = {}, visit) {
+function deepMap (target = {}, visit) {
Object.entries(target).forEach(([key, value]) => {
if (typeof value === 'object' && value !== null) {
target[key] = deepMap(value, visit)
diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js
index 4e65f0a23..6ef511453 100644
--- a/app/scripts/lib/inpage-provider.js
+++ b/app/scripts/lib/inpage-provider.js
@@ -54,6 +54,11 @@ function MetamaskInpageProvider (connectionStream) {
// also remap ids inbound and outbound
MetamaskInpageProvider.prototype.sendAsync = function (payload, cb) {
const self = this
+
+ if (payload.method === 'eth_signTypedData') {
+ console.warn('MetaMask: This experimental version of eth_signTypedData will be deprecated in the next release in favor of the standard as defined in EIP-712. See https://git.io/fNzPl for more information on the new standard.')
+ }
+
self.rpcEngine.handle(payload, cb)
}
diff --git a/app/scripts/lib/ipfsContent.js b/app/scripts/lib/ipfsContent.js
new file mode 100644
index 000000000..5222151ea
--- /dev/null
+++ b/app/scripts/lib/ipfsContent.js
@@ -0,0 +1,44 @@
+const extension = require('extensionizer')
+const resolver = require('./resolver.js')
+
+module.exports = function (provider) {
+ function ipfsContent (details) {
+ const name = details.url.substring(7, details.url.length - 1)
+ let clearTime = null
+ extension.tabs.getSelected(null, tab => {
+ extension.tabs.update(tab.id, { url: 'loading.html' })
+
+ clearTime = setTimeout(() => {
+ return extension.tabs.update(tab.id, { url: '404.html' })
+ }, 60000)
+
+ resolver.resolve(name, provider).then(ipfsHash => {
+ clearTimeout(clearTime)
+ let url = 'https://ipfs.infura.io/ipfs/' + ipfsHash
+ return fetch(url, { method: 'HEAD' }).then(response => response.status).then(statusCode => {
+ if (statusCode !== 200) return extension.tabs.update(tab.id, { url: '404.html' })
+ extension.tabs.update(tab.id, { url: url })
+ })
+ .catch(err => {
+ url = 'https://ipfs.infura.io/ipfs/' + ipfsHash
+ extension.tabs.update(tab.id, {url: url})
+ return err
+ })
+ })
+ .catch(err => {
+ clearTimeout(clearTime)
+ const url = err === 'unsupport' ? 'unsupport' : 'error'
+ extension.tabs.update(tab.id, {url: `${url}.html?name=${name}`})
+ })
+ })
+ return { cancel: true }
+ }
+
+ extension.webRequest.onBeforeRequest.addListener(ipfsContent, {urls: ['*://*.eth/', '*://*.test/']})
+
+ return {
+ remove () {
+ extension.webRequest.onBeforeRequest.removeListener(ipfsContent)
+ },
+ }
+}
diff --git a/app/scripts/lib/local-store.js b/app/scripts/lib/local-store.js
index 139ff86bd..fbcba09cd 100644
--- a/app/scripts/lib/local-store.js
+++ b/app/scripts/lib/local-store.js
@@ -8,7 +8,7 @@ module.exports = class ExtensionStore {
/**
* @constructor
*/
- constructor() {
+ constructor () {
this.isSupported = !!(extension.storage.local)
if (!this.isSupported) {
log.error('Storage local API not available.')
@@ -19,7 +19,7 @@ module.exports = class ExtensionStore {
* Returns all of the keys currently saved
* @return {Promise<*>}
*/
- async get() {
+ async get () {
if (!this.isSupported) return undefined
const result = await this._get()
// extension.storage.local always returns an obj
@@ -36,7 +36,7 @@ module.exports = class ExtensionStore {
* @param {object} state - The state to set
* @return {Promise<void>}
*/
- async set(state) {
+ async set (state) {
return this._set(state)
}
@@ -45,7 +45,7 @@ module.exports = class ExtensionStore {
* @private
* @return {object} the key-value map from local storage
*/
- _get() {
+ _get () {
const local = extension.storage.local
return new Promise((resolve, reject) => {
local.get(null, (/** @type {any} */ result) => {
@@ -65,7 +65,7 @@ module.exports = class ExtensionStore {
* @return {Promise<void>}
* @private
*/
- _set(obj) {
+ _set (obj) {
const local = extension.storage.local
return new Promise((resolve, reject) => {
local.set(obj, () => {
@@ -85,6 +85,6 @@ module.exports = class ExtensionStore {
* @param {object} obj - The object to check
* @returns {boolean}
*/
-function isEmpty(obj) {
+function isEmpty (obj) {
return Object.keys(obj).length === 0
}
diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js
index 5dfb42078..969a9459a 100644
--- a/app/scripts/lib/notification-manager.js
+++ b/app/scripts/lib/notification-manager.js
@@ -26,13 +26,15 @@ class NotificationManager {
// bring focus to existing chrome popup
extension.windows.update(popup.id, { focused: true })
} else {
+ const cb = (currentPopup) => { this._popupId = currentPopup.id }
// create new notification popup
- extension.windows.create({
+ const creation = extension.windows.create({
url: 'notification.html',
type: 'popup',
width,
height,
- })
+ }, cb)
+ creation && creation.then && creation.then(cb)
}
})
}
@@ -84,7 +86,7 @@ class NotificationManager {
}
/**
- * Given an array of windows, returns the first that has a 'popup' type, or null if no such window exists.
+ * Given an array of windows, returns the 'popup' that has been opened by MetaMask, or null if no such window exists.
*
* @private
* @param {array} windows An array of objects containing data about the open MetaMask extension windows.
@@ -93,7 +95,7 @@ class NotificationManager {
_getPopupIn (windows) {
return windows ? windows.find((win) => {
// Returns notification popup
- return (win && win.type === 'popup')
+ return (win && win.type === 'popup' && win.id === this._popupId)
}) : null
}
diff --git a/app/scripts/lib/port-stream.js b/app/scripts/lib/port-stream.js
index 5c4224fd9..fd65d94f3 100644
--- a/app/scripts/lib/port-stream.js
+++ b/app/scripts/lib/port-stream.js
@@ -58,7 +58,7 @@ PortDuplexStream.prototype._read = noop
/**
* Called internally when data should be written to
* this writable stream.
- *
+ *
* @private
* @param {*} msg Arbitrary object to write
* @param {string} encoding Encoding to use when writing payload
diff --git a/app/scripts/lib/reportFailedTxToSentry.js b/app/scripts/lib/reportFailedTxToSentry.js
index e09f4f1f8..df5661e59 100644
--- a/app/scripts/lib/reportFailedTxToSentry.js
+++ b/app/scripts/lib/reportFailedTxToSentry.js
@@ -7,7 +7,7 @@ module.exports = reportFailedTxToSentry
// for sending to sentry
//
-function reportFailedTxToSentry({ raven, txMeta }) {
+function reportFailedTxToSentry ({ raven, txMeta }) {
const errorMessage = 'Transaction Failed: ' + extractEthjsErrorMessage(txMeta.err.message)
raven.captureMessage(errorMessage, {
// "extra" key is required by Sentry
diff --git a/app/scripts/lib/resolver.js b/app/scripts/lib/resolver.js
new file mode 100644
index 000000000..ff0fed161
--- /dev/null
+++ b/app/scripts/lib/resolver.js
@@ -0,0 +1,71 @@
+const namehash = require('eth-ens-namehash')
+const multihash = require('multihashes')
+const HttpProvider = require('ethjs-provider-http')
+const Eth = require('ethjs-query')
+const EthContract = require('ethjs-contract')
+const registrarAbi = require('./contracts/registrar')
+const resolverAbi = require('./contracts/resolver')
+
+function ens (name, provider) {
+ const eth = new Eth(new HttpProvider(getProvider(provider.type)))
+ const hash = namehash.hash(name)
+ const contract = new EthContract(eth)
+ const Registrar = contract(registrarAbi).at(getRegistrar(provider.type))
+ return new Promise((resolve, reject) => {
+ if (provider.type === 'mainnet' || provider.type === 'ropsten') {
+ Registrar.resolver(hash).then((address) => {
+ if (address === '0x0000000000000000000000000000000000000000') {
+ reject(null)
+ } else {
+ const Resolver = contract(resolverAbi).at(address['0'])
+ return Resolver.content(hash)
+ }
+ }).then((contentHash) => {
+ if (contentHash['0'] === '0x0000000000000000000000000000000000000000000000000000000000000000') reject(null)
+ if (contentHash.ret !== '0x') {
+ const hex = contentHash['0'].substring(2)
+ const buf = multihash.fromHexString(hex)
+ resolve(multihash.toB58String(multihash.encode(buf, 'sha2-256')))
+ } else {
+ reject(null)
+ }
+ })
+ } else {
+ return reject('unsupport')
+ }
+ })
+}
+
+function getProvider (type) {
+ switch (type) {
+ case 'mainnet':
+ return 'https://mainnet.infura.io/'
+ case 'ropsten':
+ return 'https://ropsten.infura.io/'
+ default:
+ return 'http://localhost:8545/'
+ }
+}
+
+function getRegistrar (type) {
+ switch (type) {
+ case 'mainnet':
+ return '0x314159265dd8dbb310642f98f50c066173c1259b'
+ case 'ropsten':
+ return '0x112234455c3a32fd11230c42e7bccd4a84e02010'
+ default:
+ return '0x0000000000000000000000000000000000000000'
+ }
+}
+
+module.exports.resolve = function (name, provider) {
+ const path = name.split('.')
+ const topLevelDomain = path[path.length - 1]
+ if (topLevelDomain === 'eth' || topLevelDomain === 'test') {
+ return ens(name, provider)
+ } else {
+ return new Promise((resolve, reject) => {
+ reject(null)
+ })
+ }
+}
diff --git a/app/scripts/lib/setupMetamaskMeshMetrics.js b/app/scripts/lib/setupMetamaskMeshMetrics.js
index 02690a948..fd3b93fc4 100644
--- a/app/scripts/lib/setupMetamaskMeshMetrics.js
+++ b/app/scripts/lib/setupMetamaskMeshMetrics.js
@@ -4,7 +4,7 @@ module.exports = setupMetamaskMeshMetrics
/**
* Injects an iframe into the current document for testing
*/
-function setupMetamaskMeshMetrics() {
+function setupMetamaskMeshMetrics () {
const testingContainer = document.createElement('iframe')
testingContainer.src = 'https://metamask.github.io/mesh-testing/'
console.log('Injecting MetaMask Mesh testing client')
diff --git a/app/scripts/lib/setupRaven.js b/app/scripts/lib/setupRaven.js
index 77aefb00a..e657e278f 100644
--- a/app/scripts/lib/setupRaven.js
+++ b/app/scripts/lib/setupRaven.js
@@ -7,9 +7,11 @@ const DEV = 'https://f59f3dd640d2429d9d0e2445a87ea8e1@sentry.io/273496'
module.exports = setupRaven
// Setup raven / sentry remote error reporting
-function setupRaven(opts) {
- const { release } = opts
+function setupRaven (opts) {
+ const { releaseVersion } = opts
let ravenTarget
+ // detect brave
+ const isBrave = Boolean(window.chrome.ipcRenderer)
if (METAMASK_DEBUG) {
console.log('Setting up Sentry Remote Error Reporting: DEV')
@@ -20,9 +22,11 @@ function setupRaven(opts) {
}
const client = Raven.config(ravenTarget, {
- release,
- transport: function(opts) {
+ releaseVersion,
+ transport: function (opts) {
+ opts.data.extra.isBrave = isBrave
const report = opts.data
+
try {
// handle error-like non-error exceptions
rewriteErrorLikeExceptions(report)
@@ -42,7 +46,7 @@ function setupRaven(opts) {
return Raven
}
-function rewriteErrorLikeExceptions(report) {
+function rewriteErrorLikeExceptions (report) {
// handle errors that lost their error-ness in serialization (e.g. dnode)
rewriteErrorMessages(report, (errorMessage) => {
if (!errorMessage.includes('Non-Error exception captured with keys:')) return errorMessage
@@ -51,7 +55,7 @@ function rewriteErrorLikeExceptions(report) {
})
}
-function simplifyErrorMessages(report) {
+function simplifyErrorMessages (report) {
rewriteErrorMessages(report, (errorMessage) => {
// simplify ethjs error messages
errorMessage = extractEthjsErrorMessage(errorMessage)
@@ -64,7 +68,7 @@ function simplifyErrorMessages(report) {
})
}
-function rewriteErrorMessages(report, rewriteFn) {
+function rewriteErrorMessages (report, rewriteFn) {
// rewrite top level message
if (report.message) report.message = rewriteFn(report.message)
// rewrite each exception message
@@ -75,7 +79,7 @@ function rewriteErrorMessages(report, rewriteFn) {
}
}
-function rewriteReportUrls(report) {
+function rewriteReportUrls (report) {
// update request url
report.request.url = toMetamaskUrl(report.request.url)
// update exception stack trace
@@ -88,7 +92,7 @@ function rewriteReportUrls(report) {
}
}
-function toMetamaskUrl(origUrl) {
+function toMetamaskUrl (origUrl) {
const filePath = origUrl.split(location.origin)[1]
if (!filePath) return origUrl
const metamaskUrl = `metamask${filePath}`
diff --git a/app/scripts/lib/util.js b/app/scripts/lib/util.js
index 431d1e59c..51e9036cc 100644
--- a/app/scripts/lib/util.js
+++ b/app/scripts/lib/util.js
@@ -28,7 +28,7 @@ function getStack () {
*
*/
const getEnvironmentType = (url = window.location.href) => {
- if (url.match(/popup.html(?:\?.+)*$/)) {
+ if (url.match(/popup.html(?:#.*)*$/)) {
return ENVIRONMENT_TYPE_POPUP
} else if (url.match(/home.html(?:\?.+)*$/) || url.match(/home.html(?:#.*)*$/)) {
return ENVIRONMENT_TYPE_FULLSCREEN
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index d5627a0d1..e843ec660 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -35,6 +35,7 @@ const TypedMessageManager = require('./lib/typed-message-manager')
const TransactionController = require('./controllers/transactions')
const BalancesController = require('./controllers/computed-balances')
const TokenRatesController = require('./controllers/token-rates')
+const DetectTokensController = require('./controllers/detect-tokens')
const ConfigManager = require('./lib/config-manager')
const nodeify = require('./lib/nodeify')
const accountImporter = require('./account-import-strategies')
@@ -47,6 +48,7 @@ const percentile = require('percentile')
const seedPhraseVerifier = require('./lib/seed-phrase-verifier')
const cleanErrorStack = require('./lib/cleanErrorStack')
const log = require('loglevel')
+const TrezorKeyring = require('eth-trezor-keyring')
module.exports = class MetamaskController extends EventEmitter {
@@ -125,7 +127,9 @@ module.exports = class MetamaskController extends EventEmitter {
})
// key mgmt
+ const additionalKeyrings = [TrezorKeyring]
this.keyringController = new KeyringController({
+ keyringTypes: additionalKeyrings,
initState: initState.KeyringController,
getNetwork: this.networkController.getNetworkState.bind(this.networkController),
encryptor: opts.encryptor || undefined,
@@ -145,6 +149,13 @@ module.exports = class MetamaskController extends EventEmitter {
this.accountTracker.syncWithAddresses(addresses)
})
+ // detect tokens controller
+ this.detectTokensController = new DetectTokensController({
+ preferences: this.preferencesController,
+ network: this.networkController,
+ keyringMemStore: this.keyringController.memStore,
+ })
+
// address book controller
this.addressBookController = new AddressBookController({
initState: initState.AddressBookController,
@@ -165,6 +176,13 @@ module.exports = class MetamaskController extends EventEmitter {
})
this.txController.on('newUnapprovedTx', opts.showUnapprovedTx.bind(opts))
+ this.txController.on(`tx:status-update`, (txId, status) => {
+ if (status === 'confirmed' || status === 'failed') {
+ const txMeta = this.txController.txStateManager.getTx(txId)
+ this.platform.showTransactionNotification(txMeta)
+ }
+ })
+
// computed balances (accounting for pending transactions)
this.balancesController = new BalancesController({
accountTracker: this.accountTracker,
@@ -339,6 +357,7 @@ module.exports = class MetamaskController extends EventEmitter {
markAccountsFound: this.markAccountsFound.bind(this),
markPasswordForgotten: this.markPasswordForgotten.bind(this),
unMarkPasswordForgotten: this.unMarkPasswordForgotten.bind(this),
+ getGasPrice: (cb) => cb(null, this.getGasPrice()),
// coinbase
buyEth: this.buyEth.bind(this),
@@ -351,8 +370,17 @@ module.exports = class MetamaskController extends EventEmitter {
verifySeedPhrase: nodeify(this.verifySeedPhrase, this),
clearSeedWordCache: this.clearSeedWordCache.bind(this),
resetAccount: nodeify(this.resetAccount, this),
+ removeAccount: nodeify(this.removeAccount, this),
importAccountWithStrategy: nodeify(this.importAccountWithStrategy, this),
+ // hardware wallets
+ connectHardware: nodeify(this.connectHardware, this),
+ forgetDevice: nodeify(this.forgetDevice, this),
+ checkHardwareStatus: nodeify(this.checkHardwareStatus, this),
+
+ // TREZOR
+ unlockTrezorAccount: nodeify(this.unlockTrezorAccount, this),
+
// vault management
submitPassword: nodeify(this.submitPassword, this),
@@ -406,7 +434,6 @@ module.exports = class MetamaskController extends EventEmitter {
}
-
//=============================================================================
// VAULT / KEYRING RELATED METHODS
//=============================================================================
@@ -510,6 +537,127 @@ module.exports = class MetamaskController extends EventEmitter {
}
//
+ // Hardware
+ //
+
+ /**
+ * Fetch account list from a trezor device.
+ *
+ * @returns [] accounts
+ */
+ async connectHardware (deviceName, page) {
+
+ switch (deviceName) {
+ case 'trezor':
+ const keyringController = this.keyringController
+ const oldAccounts = await keyringController.getAccounts()
+ let keyring = await keyringController.getKeyringsByType(
+ 'Trezor Hardware'
+ )[0]
+ if (!keyring) {
+ keyring = await this.keyringController.addNewKeyring('Trezor Hardware')
+ }
+ let accounts = []
+
+ switch (page) {
+ case -1:
+ accounts = await keyring.getPreviousPage()
+ break
+ case 1:
+ accounts = await keyring.getNextPage()
+ break
+ default:
+ accounts = await keyring.getFirstPage()
+ }
+
+ // Merge with existing accounts
+ // and make sure addresses are not repeated
+ const accountsToTrack = [...new Set(oldAccounts.concat(accounts.map(a => a.address.toLowerCase())))]
+ this.accountTracker.syncWithAddresses(accountsToTrack)
+ return accounts
+
+ default:
+ throw new Error('MetamaskController:connectHardware - Unknown device')
+ }
+ }
+
+ /**
+ * Check if the device is unlocked
+ *
+ * @returns {Promise<boolean>}
+ */
+ async checkHardwareStatus (deviceName) {
+
+ switch (deviceName) {
+ case 'trezor':
+ const keyringController = this.keyringController
+ const keyring = await keyringController.getKeyringsByType(
+ 'Trezor Hardware'
+ )[0]
+ if (!keyring) {
+ return false
+ }
+ return keyring.isUnlocked()
+ default:
+ throw new Error('MetamaskController:checkHardwareStatus - Unknown device')
+ }
+ }
+
+ /**
+ * Clear
+ *
+ * @returns {Promise<boolean>}
+ */
+ async forgetDevice (deviceName) {
+
+ switch (deviceName) {
+ case 'trezor':
+ const keyringController = this.keyringController
+ const keyring = await keyringController.getKeyringsByType(
+ 'Trezor Hardware'
+ )[0]
+ if (!keyring) {
+ throw new Error('MetamaskController:forgetDevice - Trezor Hardware keyring not found')
+ }
+ keyring.forgetDevice()
+ return true
+ default:
+ throw new Error('MetamaskController:forgetDevice - Unknown device')
+ }
+ }
+
+ /**
+ * Imports an account from a trezor device.
+ *
+ * @returns {} keyState
+ */
+ async unlockTrezorAccount (index) {
+ const keyringController = this.keyringController
+ const keyring = await keyringController.getKeyringsByType(
+ 'Trezor Hardware'
+ )[0]
+ if (!keyring) {
+ throw new Error('MetamaskController - No Trezor Hardware Keyring found')
+ }
+
+ keyring.setAccountToUnlock(index)
+ const oldAccounts = await keyringController.getAccounts()
+ const keyState = await keyringController.addNewAccount(keyring)
+ const newAccounts = await keyringController.getAccounts()
+ this.preferencesController.setAddresses(newAccounts)
+ newAccounts.forEach(address => {
+ if (!oldAccounts.includes(address)) {
+ this.preferencesController.setAccountLabel(address, `TREZOR #${parseInt(index, 10) + 1}`)
+ this.preferencesController.setSelectedAddress(address)
+ }
+ })
+
+ const { identities } = this.preferencesController.store.getState()
+ return { ...keyState, identities }
+ }
+
+
+ //
// Account Management
//
@@ -622,6 +770,23 @@ module.exports = class MetamaskController extends EventEmitter {
}
/**
+ * Removes an account from state / storage.
+ *
+ * @param {string[]} address A hex address
+ *
+ */
+ async removeAccount (address) {
+ // Remove account from the preferences controller
+ this.preferencesController.removeAddress(address)
+ // Remove account from the account tracker controller
+ this.accountTracker.removeAccount(address)
+ // Remove account from the keyring
+ await this.keyringController.removeAccount(address)
+ return address
+ }
+
+
+ /**
* Imports an account with the specified import strategy.
* These are defined in app/scripts/account-import-strategies
* Each strategy represents a different way of serializing an Ethereum key pair.
@@ -963,7 +1128,7 @@ module.exports = class MetamaskController extends EventEmitter {
* Allows a user to begin the seed phrase recovery process.
* @param {Function} cb - A callback function called when complete.
*/
- markPasswordForgotten(cb) {
+ markPasswordForgotten (cb) {
this.configManager.setPasswordForgotten(true)
this.sendUpdate()
cb()
@@ -973,7 +1138,7 @@ module.exports = class MetamaskController extends EventEmitter {
* Allows a user to end the seed phrase recovery process.
* @param {Function} cb - A callback function called when complete.
*/
- unMarkPasswordForgotten(cb) {
+ unMarkPasswordForgotten (cb) {
this.configManager.setPasswordForgotten(false)
this.sendUpdate()
cb()
@@ -1269,10 +1434,12 @@ module.exports = class MetamaskController extends EventEmitter {
set isClientOpen (open) {
this._isClientOpen = open
this.isClientOpenAndUnlocked = this.getState().isUnlocked && open
+ this.detectTokensController.isOpen = open
}
/**
- * A method for activating the retrieval of price data, which should only be fetched when the UI is visible.
+ * A method for activating the retrieval of price data and auto detect tokens,
+ * which should only be fetched when the UI is visible.
* @private
* @param {boolean} active - True if price data should be getting fetched.
*/
diff --git a/app/scripts/migrations/013.js b/app/scripts/migrations/013.js
index 15a9b28d4..fb7131f8e 100644
--- a/app/scripts/migrations/013.js
+++ b/app/scripts/migrations/013.js
@@ -28,7 +28,7 @@ module.exports = {
function transformState (state) {
const newState = state
const { config } = newState
- if ( config && config.provider ) {
+ if (config && config.provider) {
if (config.provider.type === 'testnet') {
newState.config.provider.type = 'ropsten'
}
diff --git a/app/scripts/migrations/023.js b/app/scripts/migrations/023.js
index 151496b06..18493a789 100644
--- a/app/scripts/migrations/023.js
+++ b/app/scripts/migrations/023.js
@@ -35,10 +35,10 @@ function transformState (state) {
if (transactions.length <= 40) return newState
- let reverseTxList = transactions.reverse()
+ const reverseTxList = transactions.reverse()
let stripping = true
while (reverseTxList.length > 40 && stripping) {
- let txIndex = reverseTxList.findIndex((txMeta) => {
+ const txIndex = reverseTxList.findIndex((txMeta) => {
return (txMeta.status === 'failed' ||
txMeta.status === 'rejected' ||
txMeta.status === 'confirmed' ||
diff --git a/app/scripts/migrations/027.js b/app/scripts/migrations/027.js
new file mode 100644
index 000000000..d6ebef580
--- /dev/null
+++ b/app/scripts/migrations/027.js
@@ -0,0 +1,35 @@
+// next version number
+const version = 27
+
+/*
+
+normalizes txParams on unconfirmed txs
+
+*/
+const clone = require('clone')
+
+module.exports = {
+ version,
+
+ migrate: async function (originalVersionedData) {
+ const versionedData = clone(originalVersionedData)
+ versionedData.meta.version = version
+ const state = versionedData.data
+ const newState = transformState(state)
+ versionedData.data = newState
+ return versionedData
+ },
+}
+
+function transformState (state) {
+ const newState = state
+
+ if (newState.TransactionController) {
+ if (newState.TransactionController.transactions) {
+ const transactions = newState.TransactionController.transactions
+ newState.TransactionController.transactions = transactions.filter((txMeta) => txMeta.status !== 'rejected')
+ }
+ }
+
+ return newState
+}
diff --git a/app/scripts/migrations/index.js b/app/scripts/migrations/index.js
index 04d90bfff..bd0005221 100644
--- a/app/scripts/migrations/index.js
+++ b/app/scripts/migrations/index.js
@@ -37,4 +37,5 @@ module.exports = [
require('./024'),
require('./025'),
require('./026'),
+ require('./027'),
]
diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js
index f5cc255d1..0803164e8 100644
--- a/app/scripts/platforms/extension.js
+++ b/app/scripts/platforms/extension.js
@@ -1,4 +1,5 @@
const extension = require('extensionizer')
+const explorerLink = require('etherscan-link').createExplorerLink
class ExtensionPlatform {
@@ -13,12 +14,21 @@ class ExtensionPlatform {
extension.tabs.create({ url })
}
+ closeCurrentWindow () {
+ return extension.windows.getCurrent((windowDetails) => {
+ return extension.windows.remove(windowDetails.id)
+ })
+ }
+
getVersion () {
return extension.runtime.getManifest().version
}
- openExtensionInBrowser () {
- const extensionURL = extension.runtime.getURL('home.html')
+ openExtensionInBrowser (route = null) {
+ let extensionURL = extension.runtime.getURL('home.html')
+ if (route) {
+ extensionURL += `#${route}`
+ }
this.openWindow({ url: extensionURL })
}
@@ -31,6 +41,59 @@ class ExtensionPlatform {
cb(e)
}
}
+
+ showTransactionNotification (txMeta) {
+
+ const status = txMeta.status
+ if (status === 'confirmed') {
+ this._showConfirmedTransaction(txMeta)
+ } else if (status === 'failed') {
+ this._showFailedTransaction(txMeta)
+ }
+ }
+
+ _showConfirmedTransaction (txMeta) {
+
+ this._subscribeToNotificationClicked()
+
+ const url = explorerLink(txMeta.hash, parseInt(txMeta.metamaskNetworkId))
+ const nonce = parseInt(txMeta.txParams.nonce, 16)
+
+ const title = 'Confirmed transaction'
+ const message = `Transaction ${nonce} confirmed! View on EtherScan`
+ this._showNotification(title, message, url)
+ }
+
+ _showFailedTransaction (txMeta) {
+
+ const nonce = parseInt(txMeta.txParams.nonce, 16)
+ const title = 'Failed transaction'
+ const message = `Transaction ${nonce} failed! ${txMeta.err.message}`
+ this._showNotification(title, message)
+ }
+
+ _showNotification (title, message, url) {
+ extension.notifications.create(
+ url,
+ {
+ 'type': 'basic',
+ 'title': title,
+ 'iconUrl': extension.extension.getURL('../../images/icon-64.png'),
+ 'message': message,
+ })
+ }
+
+ _subscribeToNotificationClicked () {
+ if (!extension.notifications.onClicked.hasListener(this._viewOnEtherScan)) {
+ extension.notifications.onClicked.addListener(this._viewOnEtherScan)
+ }
+ }
+
+ _viewOnEtherScan (txId) {
+ if (txId.startsWith('http://')) {
+ global.metamaskController.platform.openWindow({ url: txId })
+ }
+ }
}
module.exports = ExtensionPlatform
diff --git a/app/scripts/popup-core.js b/app/scripts/popup-core.js
index 6325b8a8d..db885ec93 100644
--- a/app/scripts/popup-core.js
+++ b/app/scripts/popup-core.js
@@ -12,7 +12,7 @@ module.exports = initializePopup
/**
* Asynchronously initializes the MetaMask popup UI
*
- * @param {{ container: Element, connectionStream: * }} config Popup configuration object
+ * @param {{ container: Element, connectionStream: * }} config Popup configuration object
* @param {Function} cb Called when initialization is complete
*/
function initializePopup ({ container, connectionStream }, cb) {
diff --git a/app/scripts/ui.js b/app/scripts/ui.js
index bdab29c1e..da100f928 100644
--- a/app/scripts/ui.js
+++ b/app/scripts/ui.js
@@ -14,7 +14,7 @@ const log = require('loglevel')
start().catch(log.error)
-async function start() {
+async function start () {
// create platform global
global.platform = new ExtensionPlatform()
@@ -64,7 +64,6 @@ async function start() {
css = betaUIState ? NewMetaMaskUiCss() : OldMetaMaskUiCss()
deleteInjectedCss = injectCss(css)
}
- if (state.appState.shouldClose) notificationManager.closePopup()
})
})
diff --git a/app/unsupport.html b/app/unsupport.html
new file mode 100644
index 000000000..6f514eb17
--- /dev/null
+++ b/app/unsupport.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>MetaMask</title>
+ </head>
+ <style>
+ *{
+ padding: 0;
+ margin: 0;
+ box-sizing: border-box;
+ }
+ img{
+ display: block;
+ }
+ html, body{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ height: 100%;
+ }
+ @keyframes logoAmin{
+ from {transform: scale(1);}
+ 50%{transform: scale(1.1);}
+ to {transform: scale(1);}
+ }
+ .unsupport{
+ width: 80%;
+ height: auto;
+ overflow: hidden;
+ padding: 10px;
+ }
+ .unsupport > img{
+ margin: 0 auto 31px auto;
+ width: 136px;
+ height: auto;
+ animation: logoAmin 1s infinite linear;
+ }
+ .unsupport > h1{
+ text-align: center;
+ font-family: Gotham;
+ font-size: 18px;
+ font-weight: 500;
+ font-style: normal;
+ font-stretch: normal;
+ line-height: normal;
+ letter-spacing: 1.3px;
+ color: #33559f;
+ }
+
+ </style>
+ <body>
+ <div class="unsupport">
+ <img src="./images/cancel.png" alt="">
+ <h1>ENS resolver only support on Ethereum mainnet</h1>
+ </div>
+ </body>
+</html> \ No newline at end of file