aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2018-09-28 14:45:16 +0800
committerGitHub <noreply@github.com>2018-09-28 14:45:16 +0800
commit59ab595b5ea6a4e24f2048d2ed43c1181bb5aa3e (patch)
tree36a9c0701cd80942c48e97cab0c4190d134980c8 /app
parentcb0af67f743d242afa3bdb518847f77d3c2cc260 (diff)
parentbd489d358383b7556af323db78f30013459febf6 (diff)
downloadtangerine-wallet-browser-59ab595b5ea6a4e24f2048d2ed43c1181bb5aa3e.tar
tangerine-wallet-browser-59ab595b5ea6a4e24f2048d2ed43c1181bb5aa3e.tar.gz
tangerine-wallet-browser-59ab595b5ea6a4e24f2048d2ed43c1181bb5aa3e.tar.bz2
tangerine-wallet-browser-59ab595b5ea6a4e24f2048d2ed43c1181bb5aa3e.tar.lz
tangerine-wallet-browser-59ab595b5ea6a4e24f2048d2ed43c1181bb5aa3e.tar.xz
tangerine-wallet-browser-59ab595b5ea6a4e24f2048d2ed43c1181bb5aa3e.tar.zst
tangerine-wallet-browser-59ab595b5ea6a4e24f2048d2ed43c1181bb5aa3e.zip
Merge branch 'develop' into account-tracker-network-change
Diffstat (limited to 'app')
-rw-r--r--app/_locales/cs/messages.json2
-rw-r--r--app/_locales/de/messages.json6
-rw-r--r--app/_locales/en/messages.json94
-rw-r--r--app/_locales/es/messages.json2
-rw-r--r--app/_locales/fr/messages.json2
-rw-r--r--app/_locales/ko/messages.json822
-rw-r--r--app/_locales/ru/messages.json2
-rw-r--r--app/_locales/tml/messages.json2
-rw-r--r--app/_locales/tr/messages.json2
-rw-r--r--app/_locales/zh_CN/messages.json9
-rw-r--r--app/images/arrow-popout.svg3
-rw-r--r--app/images/ledger-logo.svg34
-rw-r--r--app/manifest.json5
-rw-r--r--app/phishing.html7
-rw-r--r--app/scripts/background.js21
-rw-r--r--app/scripts/contentscript.js2
-rw-r--r--app/scripts/controllers/network/createMetamaskMiddleware.js2
-rw-r--r--app/scripts/controllers/preferences.js138
-rw-r--r--app/scripts/controllers/transactions/enums.js12
-rw-r--r--app/scripts/controllers/transactions/index.js50
-rw-r--r--app/scripts/controllers/transactions/tx-state-manager.js1
-rw-r--r--app/scripts/inpage.js25
-rw-r--r--app/scripts/lib/account-tracker.js21
-rw-r--r--app/scripts/lib/auto-reload.js6
-rw-r--r--app/scripts/lib/config-manager.js254
-rw-r--r--app/scripts/lib/ipfsContent.js4
-rw-r--r--app/scripts/lib/typed-message-manager.js74
-rw-r--r--app/scripts/metamask-controller.js232
-rw-r--r--app/scripts/migrations/_multi-keyring.js50
-rw-r--r--app/scripts/notice-controller.js2
-rw-r--r--app/scripts/phishing-detect.js5
31 files changed, 1330 insertions, 561 deletions
diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json
index 6a4ebc8a5..55344f3e1 100644
--- a/app/_locales/cs/messages.json
+++ b/app/_locales/cs/messages.json
@@ -796,7 +796,7 @@
"message": "Testovací faucet"
},
"to": {
- "message": "Komu: "
+ "message": "Komu"
},
"toETHviaShapeShift": {
"message": "$1 na ETH přes ShapeShift",
diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json
index c06a99250..352d5ad7d 100644
--- a/app/_locales/de/messages.json
+++ b/app/_locales/de/messages.json
@@ -384,7 +384,7 @@
"infoHelp": {
"message": "Info & Hilfe"
},
- "insufficientFunds": {
+ "insufficientFunds": {
"message": "Nicht genügend Guthaben."
},
"insufficientTokens": {
@@ -572,7 +572,7 @@
"description": "Wähle diesen Dateityp um damit einen Account zu importieren"
},
"privateKeyWarning": {
- "message": "Warnung: Niemals jemanden deinen Private Key mitteilen. Jeder der im Besitz deines Private Keys ist, kann jegliches Guthaben deines Accounts stehlen."
+ "message": "Warnung: Niemals jemanden deinen Private Key mitteilen. Jeder der im Besitz deines Private Keys ist, kann jegliches Guthaben deines Accounts stehlen."
},
"privateNetwork": {
"message": "Privates Netzwerk"
@@ -775,7 +775,7 @@
"message": "Testfaucet"
},
"to": {
- "message": "An:"
+ "message": "An"
},
"toETHviaShapeShift": {
"message": "$1 an ETH via ShapeShift",
diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json
index a25a2bd59..f6cf7cf69 100644
--- a/app/_locales/en/messages.json
+++ b/app/_locales/en/messages.json
@@ -17,6 +17,9 @@
"accountSelectionRequired": {
"message": "You need to select an account!"
},
+ "activityLog": {
+ "message": "activity log"
+ },
"address": {
"message": "Address"
},
@@ -29,6 +32,9 @@
"addTokens": {
"message": "Add Tokens"
},
+ "addSuggestedTokens": {
+ "message": "Add Suggested Tokens"
+ },
"addAcquiredTokens": {
"message": "Add the tokens you've acquired using MetaMask"
},
@@ -55,6 +61,12 @@
"attemptingConnect": {
"message": "Attempting to connect to blockchain."
},
+ "attemptToCancel": {
+ "message": "Attempt to Cancel?"
+ },
+ "attemptToCancelDescription": {
+ "message": "Attempting to cancel does not guarantee your original transaction will be cancelled. If cancelled, you are still required to pay a transaction fee to the network."
+ },
"attributions": {
"message": "Attributions"
},
@@ -110,6 +122,12 @@
"cancel": {
"message": "Cancel"
},
+ "cancelAttempt": {
+ "message": "Cancel Attempt"
+ },
+ "cancellationGasFee": {
+ "message": "Cancellation Gas Fee"
+ },
"classicInterface": {
"message": "Use classic interface"
},
@@ -210,6 +228,9 @@
"currentConversion": {
"message": "Current Conversion"
},
+ "currentLanguage": {
+ "message": "Current Language"
+ },
"currentNetwork": {
"message": "Current Network"
},
@@ -451,6 +472,9 @@
"hideTokenPrompt": {
"message": "Hide Token?"
},
+ "history": {
+ "message": "History"
+ },
"howToDeposit": {
"message": "How would you like to deposit Ether?"
},
@@ -587,6 +611,9 @@
"metamaskSeedWords": {
"message": "MetaMask Seed Words"
},
+ "metamaskVersion": {
+ "message": "MetaMask Version"
+ },
"min": {
"message": "Minimum"
},
@@ -651,7 +678,7 @@
"message": "No transaction history."
},
"noTransactions": {
- "message": "No Transactions"
+ "message": "You have no transactions"
},
"notFound": {
"message": "Not Found"
@@ -702,6 +729,9 @@
"pasteSeed": {
"message": "Paste your seed phrase here!"
},
+ "pending": {
+ "message": "pending"
+ },
"personalAddressDetected": {
"message": "Personal address detected. Input the token contract address."
},
@@ -730,6 +760,9 @@
"qrCode": {
"message": "Show QR Code"
},
+ "queue": {
+ "message": "Queue"
+ },
"readdToken": {
"message": "You can add this token back in the future by going go to “Add token” in your accounts options menu."
},
@@ -845,6 +878,9 @@
"save": {
"message": "Save"
},
+ "speedUp": {
+ "message": "speed up"
+ },
"speedUpTitle": {
"message": "Speed Up Transaction"
},
@@ -870,6 +906,12 @@
"secretPhrase": {
"message": "Enter your secret twelve word phrase here to restore your vault."
},
+ "showHexData": {
+ "message": "Show Hex Data"
+ },
+ "showHexDataDescription": {
+ "message": "Select this to show the hex data field on the send screen"
+ },
"newPassword8Chars": {
"message": "New Password (min 8 chars)"
},
@@ -882,6 +924,9 @@
"selectCurrency": {
"message": "Select Currency"
},
+ "selectLocale": {
+ "message": "Select Locale"
+ },
"selectService": {
"message": "Select Service"
},
@@ -897,6 +942,12 @@
"sendTokens": {
"message": "Send Tokens"
},
+ "sentEther": {
+ "message": "sent ether"
+ },
+ "sentTokens": {
+ "message": "sent tokens"
+ },
"separateEachWord": {
"message": "Separate each word with a single space"
},
@@ -910,6 +961,9 @@
"orderOneHere": {
"message": "Order a Trezor or Ledger and keep your funds in cold storage"
},
+ "outgoing": {
+ "message": "Outgoing"
+ },
"searchTokens": {
"message": "Search Tokens"
},
@@ -973,6 +1027,9 @@
"sign": {
"message": "Sign"
},
+ "signatureRequest": {
+ "message": "Signature Request"
+ },
"signed": {
"message": "Signed"
},
@@ -1025,7 +1082,7 @@
"message": "Test Faucet"
},
"to": {
- "message": "To: "
+ "message": "To"
},
"toETHviaShapeShift": {
"message": "$1 to ETH via ShapeShift",
@@ -1055,6 +1112,30 @@
"total": {
"message": "Total"
},
+ "transaction": {
+ "message": "transaction"
+ },
+ "transactionConfirmed": {
+ "message": "Transaction confirmed on $2."
+ },
+ "transactionCreated": {
+ "message": "Transaction created with a value of $1 on $2."
+ },
+ "transactionWithNonce": {
+ "message": "Transaction $1"
+ },
+ "transactionDropped": {
+ "message": "Transaction dropped on $2."
+ },
+ "transactionSubmitted": {
+ "message": "Transaction submitted on $2."
+ },
+ "transactionUpdated": {
+ "message": "Transaction updated on $2."
+ },
+ "transactionUpdatedGas": {
+ "message": "Transaction updated with a gas price of $1 on $2."
+ },
"transactions": {
"message": "transactions"
},
@@ -1101,6 +1182,9 @@
"unavailable": {
"message": "Unavailable"
},
+ "units": {
+ "message": "units"
+ },
"unknown": {
"message": "Unknown"
},
@@ -1128,6 +1212,9 @@
"unlockMessage": {
"message": "The decentralized web awaits"
},
+ "updatedWithDate": {
+ "message": "Updated $1"
+ },
"uriErrorMsg": {
"message": "URIs require the appropriate HTTP/HTTPS prefix."
},
@@ -1168,6 +1255,9 @@
"whatsThis": {
"message": "What's this?"
},
+ "yesLetsTry": {
+ "message": "Yes, let's try"
+ },
"youNeedToAllowCameraAccess": {
"message": "You need to allow camera access to use this feature."
},
diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json
index ed7f8f681..3e43a7b43 100644
--- a/app/_locales/es/messages.json
+++ b/app/_locales/es/messages.json
@@ -772,7 +772,7 @@
"message": "Probar Faucet"
},
"to": {
- "message": "Para:"
+ "message": "Para"
},
"toETHviaShapeShift": {
"message": "$1 a ETH via ShapeShift",
diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json
index 1463e2b5f..6f850d89b 100644
--- a/app/_locales/fr/messages.json
+++ b/app/_locales/fr/messages.json
@@ -490,7 +490,7 @@
"message": "Sélectionner un service"
},
"send": {
- "message": "Envoyé"
+ "message": "Envoyer"
},
"sendTokens": {
"message": "Envoyer des jetons"
diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json
index d3801c4f5..30d032357 100644
--- a/app/_locales/ko/messages.json
+++ b/app/_locales/ko/messages.json
@@ -3,86 +3,125 @@
"message": "수락"
},
"account": {
- "message": "계좌"
+ "message": "계정"
},
"accountDetails": {
- "message": "계좌 상세보기"
+ "message": "계정 상세보기"
},
"accountName": {
- "message": "계좌 이름"
+ "message": "계정 이름"
},
"address": {
"message": "주소"
},
+ "addCustomToken": {
+ "message": "사용자 정의 토큰 추가"
+ },
"addToken": {
"message": "토큰 추가"
},
+ "addTokens": {
+ "message": "토큰 추가"
+ },
+ "addAcquiredTokens": {
+ "message": "메타마스크를 통해 획득한 토큰 추가"
+ },
"amount": {
- "message": "금액"
+ "message": "수량"
},
"amountPlusGas": {
- "message": "금액 + 가스"
+ "message": "수량 + 가스"
},
"appDescription": {
"message": "이더리움 브라우저 확장 프로그램",
- "description": "어플리케이션 내용"
+ "description": "어플리케이션 설명"
},
"appName": {
"message": "메타마스크",
"description": "어플리케이션 이름"
},
+ "approved": {
+ "message": "수락"
+ },
"attemptingConnect": {
- "message": "블록체인에 접속 시도 중입니다."
+ "message": "블록체인에 접속을 시도하는 중입니다."
+ },
+ "attributions": {
+ "message": "속성"
},
"available": {
- "message": "사용 가능한"
+ "message": "사용 가능"
},
"back": {
- "message": "뒤로"
+ "message": "돌아가기"
},
"balance": {
- "message": "잔액:"
+ "message": "잔액"
+ },
+ "balances": {
+ "message": "토큰 잔액"
},
"balanceIsInsufficientGas": {
- "message": "가스가 충분하지 않습니다."
+ "message": "현재 가스 총합에 대해 잔액이 부족합니다"
},
"beta": {
- "message": "베타"
+ "message": "BETA"
},
"betweenMinAndMax": {
"message": "$1 이상 $2 이하여야 합니다.",
- "description": "helper for inputting hex as decimal input"
+ "description": "10진수 입력으로 hex값 입력을 도와줍니다"
+ },
+ "blockiesIdenticon": {
+ "message": "Blockies 아이덴티콘 사용"
},
"borrowDharma": {
- "message": "Dharma에서 빌리기(베타)"
+ "message": "Dharma에서 대여하기(Beta)"
+ },
+ "builtInCalifornia": {
+ "message": "메타마스크는 캘리포니아에서 디자인되고 만들어졌습니다."
},
"buy": {
"message": "구매"
},
"buyCoinbase": {
- "message": "코인베이스에서 구매"
+ "message": "코인베이스에서 구매하기"
},
"buyCoinbaseExplainer": {
- "message": "코인베이스에서 비트코인, 이더리움, 라이트코인을 구매하실 수 있습니다."
+ "message": "코인베이스는 비트코인, 이더리움, 라이트코인을 거래할 수 있는 유명한 거래소입니다."
+ },
+ "ok": {
+ "message": "확인"
},
"cancel": {
"message": "취소"
},
+ "classicInterface": {
+ "message": "예전 인터페이스"
+ },
"clickCopy": {
"message": "클릭하여 복사"
},
+ "close": {
+ "message": "닫기"
+ },
"confirm": {
"message": "승인"
},
+ "confirmed": {
+ "message": "승인됨"
+ },
"confirmContract": {
"message": "컨트랙트 승인"
},
"confirmPassword": {
- "message": "패스워드 승인"
+ "message": "비밀번호 확인"
},
"confirmTransaction": {
"message": "트랜잭션 승인"
},
+ "continue": {
+ "message": "계속"
+ },
"continueToCoinbase": {
"message": "코인베이스로 계속하기"
},
@@ -90,72 +129,93 @@
"message": "컨트랙트 배포"
},
"conversionProgress": {
- "message": "변환중.."
+ "message": "변환 진행중"
},
"copiedButton": {
- "message": "복사되었습니다."
+ "message": "복사됨"
},
"copiedClipboard": {
- "message": "클립보드에 복사되었습니다."
+ "message": "클립보드에 복사되었습니다"
},
"copiedExclamation": {
- "message": "복사되었습니다."
+ "message": "복사됨!"
+ },
+ "copiedSafe": {
+ "message": "안전한 곳에 복사하였습니다"
},
"copy": {
- "message": "복사하기"
+ "message": "복사"
+ },
+ "copyContractAddress": {
+ "message": "컨트랙트 주소 복사"
},
"copyToClipboard": {
- "message": "클립보드에 복사"
+ "message": "클립보드로 복사"
},
"copyButton": {
"message": " 복사 "
},
"copyPrivateKey": {
- "message": "비밀 키 (클릭하여 복사)"
+ "message": "비밀 키입니다 (클릭하여 복사)"
},
"create": {
"message": "생성"
},
"createAccount": {
- "message": "계좌 생성"
+ "message": "계정 생성"
},
"createDen": {
"message": "생성"
},
"crypto": {
"message": "암호화폐",
- "description": "Exchange type (cryptocurrencies)"
+ "description": "거래 유형 (암호화폐)"
+ },
+ "currentConversion": {
+ "message": "선택된 단위"
+ },
+ "currentNetwork": {
+ "message": "현재 네트워크"
},
"customGas": {
"message": "가스 설정"
},
+ "customToken": {
+ "message": "사용자 정의 토큰"
+ },
"customize": {
- "message": "커스터마이즈"
+ "message": "맞춤화 하기"
},
"customRPC": {
- "message": "커스텀 RPC"
+ "message": "사용자 정의 RPC"
+ },
+ "decimalsMustZerotoTen": {
+ "message": "소수점은 0 이상이고 36 이하여야 합니다."
+ },
+ "decimal": {
+ "message": "소수점 정확도"
},
"defaultNetwork": {
"message": "이더리움 트랜잭션의 기본 네트워크는 메인넷입니다."
},
"denExplainer": {
- "message": "DEN은 비밀번호가 암호화 된 MetaMask의 스토리지입니다."
+ "message": "DEN은 비밀번호로 암호화 된 메타마스크의 저장소입니다."
},
"deposit": {
"message": "입금"
},
"depositBTC": {
- "message": "아래 주소로 BTC를 입급해주세요."
+ "message": "다음 주소로 BTC를 입급해주세요."
},
"depositCoin": {
- "message": "아래 주소로 $1를 입금해주세요.",
- "description": "Tells the user what coin they have selected to deposit with shapeshift"
+ "message": "다음 주소로 $1 만큼 입금해주세요.",
+ "description": "사용자에게 shapeshift에서 어떤 코인을 선택해 입금했는지 알려줍니다"
},
"depositEth": {
- "message": "이더 입금"
+ "message": "이더 입금하기"
},
"depositEther": {
- "message": "이더 입금"
+ "message": "이더리움 입금하기"
},
"depositFiat": {
"message": "현금으로 입금하기"
@@ -167,10 +227,10 @@
"message": "ShapeShift를 통해 입금하기"
},
"depositShapeShiftExplainer": {
- "message": "다른 암호화폐를 가지고 있으면, 계좌 생성 필요없이, 거래를 하거나 메타마스크 지갑을 통해 이더를 입금할 수 있습니다."
+ "message": "다른 암호화폐를 가지고 있으면, 계정을 생성할 필요없이 메타마스크 지갑에 이더리움을 바로 거래하거나 입금할 수 있습니다."
},
"details": {
- "message": "상세"
+ "message": "세부사항"
},
"directDeposit": {
"message": "즉시 입금"
@@ -179,70 +239,103 @@
"message": "이더 즉시 입금"
},
"directDepositEtherExplainer": {
- "message": "이더를 이미 보유하고 있다면, 직접 입금을 통해 이더를 즉시 입금하실 수 있습니다."
+ "message": "약간의 이더를 이미 보유하고 있다면, 새로 만든 지갑에 직접 입금하여 이더를 보유할 수 있습니다."
},
"done": {
"message": "완료"
},
+ "downloadStateLogs": {
+ "message": "상태 로그 다운로드"
+ },
+ "dropped": {
+ "message": "중단됨"
+ },
"edit": {
"message": "수정"
},
"editAccountName": {
- "message": "계좌명 수정"
+ "message": "계정 이름 수정"
+ },
+ "editingTransaction": {
+ "message": "트랜젝션을 변경합니다"
+ },
+ "emailUs": {
+ "message": "저자에게 메일 보내기!"
},
"encryptNewDen": {
- "message": "새 DEN 암호화"
+ "message": "새로운 DEN을 암호화"
},
"enterPassword": {
- "message": "패스워드를 입력해주세요."
+ "message": "비밀번호를 입력해주세요"
+ },
+ "enterPasswordConfirm": {
+ "message": "비밀번호를 다시 입력해 주세요"
+ },
+ "enterPasswordContinue": {
+ "message": "계속하기 위해 비밀번호 입력"
+ },
+ "passwordNotLongEnough": {
+ "message": "비밀번호가 충분히 길지 않습니다"
+ },
+ "passwordsDontMatch": {
+ "message": "비밀번호가 맞지 않습니다"
},
"etherscanView": {
- "message": "이더스캔에서 계좌보기"
+ "message": "이더스캔에서 계정보기"
},
"exchangeRate": {
"message": "환율"
},
"exportPrivateKey": {
- "message": "비밀키 내보내기"
+ "message": "개인키 내보내기"
},
"exportPrivateKeyWarning": {
- "message": "Export private keys at your own risk."
+ "message": "개인키 내보내기는 위험을 감수해야 합니다."
},
"failed": {
"message": "실패"
},
"fiat": {
"message": "FIAT",
- "description": "Exchange type"
+ "description": "거래 형식"
},
"fileImportFail": {
- "message": "파일을 가져올 수 없나요? 여기를 클릭해주세요!",
- "description": "Helps user import their account from a JSON file"
+ "message": "파일을 가져올 수 없나요? 이곳을 클릭해주세요!",
+ "description": "JSON 파일로부터 계정 가져오기를 도와줍니다"
+ },
+ "followTwitter": {
+ "message": "트위터에서 팔로우하세요"
},
"from": {
- "message": "보내는 사람"
+ "message": "보내는 이"
+ },
+ "fromToSame": {
+ "message": "보내고 받는 주소는 동일할 수 없습니다"
},
"fromShapeShift": {
"message": "ShapeShift로 부터"
},
"gas": {
"message": "가스",
- "description": "Short indication of gas cost"
+ "description": "가스 가격의 줄임"
},
"gasFee": {
"message": "가스 수수료"
},
"gasLimit": {
- "message": "가스 리밋"
+ "message": "가스 한도"
},
"gasLimitCalculation": {
- "message": "네트워크 성공률을 기반으로 적합한 가스 리밋을 계산합니다."
+ "message": "네트워크 성공률을 기반으로 적합한 가스 한도를 계산합니다."
},
"gasLimitRequired": {
- "message": "가스 리밋이 필요합니다."
+ "message": "가스 한도가 필요합니다."
},
"gasLimitTooLow": {
- "message": "가스 리밋은 21000 이상이여야 합니다."
+ "message": "가스 한도는 최소 21000 이상이여야 합니다."
+ },
+ "generatingSeed": {
+ "message": "시드 생성중..."
},
"gasPrice": {
"message": "가스 가격 (GWEI)"
@@ -253,21 +346,27 @@
"gasPriceRequired": {
"message": "가스 가격이 필요합니다."
},
+ "generatingTransaction": {
+ "message": "트랜잭션 생성중"
+ },
"getEther": {
"message": "이더 얻기"
},
"getEtherFromFaucet": {
- "message": "faucet에서 $1에 달하는 이더를 얻으세요.",
- "description": "Displays network name for Ether faucet"
+ "message": "파우셋에서 $1에 달하는 이더를 얻으세요.",
+ "description": "이더 파우셋에 대한 네트워크 이름을 표시합니다"
},
"greaterThanMin": {
"message": "$1 이상이어야 합니다.",
- "description": "helper for inputting hex as decimal input"
+ "description": "10진수 입력으로 hex값 입력을 도와줍니다"
},
"here": {
"message": "여기",
"description": "as in -click here- for more information (goes with troubleTokenBalances)"
},
+ "hereList": {
+ "message": "리스트가 있습니다!!!!"
+ },
"hide": {
"message": "숨기기"
},
@@ -280,51 +379,96 @@
"howToDeposit": {
"message": "어떤 방법으로 이더를 입금하시겠습니까?"
},
+ "holdEther": {
+ "message": "It allows you to hold ether & tokens, and serves as your bridge to decentralized applications."
+ },
"import": {
- "message": "파일에서 가져오기",
- "description": "Button to import an account from a selected file"
+ "message": "가져오기",
+ "description": "선택된 파일로부터 계정 가져오기 버튼"
},
"importAccount": {
- "message": "계좌 가져오기"
+ "message": "계정 가져오기"
+ },
+ "importAccountMsg": {
+ "message": " 가져온 계정은 메타마스크에서 원래 생성된 계정의 시드구문과 연관성이 없습니다. 가져온 계정에 대해 더 배우기 "
},
"importAnAccount": {
- "message": "계좌 가져오기"
+ "message": "계정 가져오기"
},
"importDen": {
- "message": "기존 DEN 가져오기"
+ "message": "기존의 DEN 가져오기"
},
"imported": {
- "message": "가져오기 완료",
- "description": "status showing that an account has been fully loaded into the keyring"
+ "message": "가져온 계정",
+ "description": "이 상태는 해당 계정이 keyring으로 완전히 적재된 상태임을 표시합니다"
+ },
+ "importUsingSeed": {
+ "message": "계정 시드 구문으로 가져오기"
},
"infoHelp": {
"message": "정보 및 도움말"
},
+ "initialTransactionConfirmed": {
+ "message": "초기 트랜잭션이 네트워크를 통해 확정되었습니다. 확인을 누르고 이전으로 돌아갑니다."
+ },
+ "insufficientFunds": {
+ "message": "충분하지 않은 자금."
+ },
+ "insufficientTokens": {
+ "message": "충분하지 않은 토큰."
+ },
"invalidAddress": {
- "message": "유효하지 않은 주소"
+ "message": "올바르지 않은 주소"
+ },
+ "invalidAddressRecipient": {
+ "message": "수신 주소가 올바르지 않습니다"
},
"invalidGasParams": {
- "message": "유효하지 않은 가스 입력값"
+ "message": "올바르지 않은 가스 입력값"
},
"invalidInput": {
- "message": "유효하지 않은 입력값"
+ "message": "올바르지 않은 입력값"
},
"invalidRequest": {
"message": "유효하지 않은 요청"
},
+ "invalidRPC": {
+ "message": "올바르지 않은 RPC URI"
+ },
+ "jsonFail": {
+ "message": "이상이 있습니다. JSON 파일이 올바른 파일인지 확인해주세요."
+ },
"jsonFile": {
"message": "JSON 파일",
- "description": "format for importing an account"
+ "description": "계정을 가져오기 위한 형식"
+ },
+ "keepTrackTokens": {
+ "message": "메타마스크 계정을 통해 구입한 토큰 기록을 추적 및 보관합니다."
},
"kovan": {
"message": "Kovan 테스트넷"
},
+ "knowledgeDataBase": {
+ "message": "지식 베이스 방문"
+ },
+ "max": {
+ "message": "최대"
+ },
+ "learnMore": {
+ "message": "더 배우기."
+ },
"lessThanMax": {
"message": "$1 이하여야합니다.",
- "description": "helper for inputting hex as decimal input"
+ "description": "10진수 입력으로 hex값 입력을 도와줍니다"
+ },
+ "likeToAddTokens": {
+ "message": "토큰을 추가하시겠습니까?"
+ },
+ "links": {
+ "message": "링크"
},
"limit": {
- "message": "리밋"
+ "message": "한도"
},
"loading": {
"message": "로딩중..."
@@ -335,11 +479,17 @@
"localhost": {
"message": "로컬호스트 8545"
},
+ "login": {
+ "message": "로그인"
+ },
"logout": {
"message": "로그아웃"
},
"loose": {
- "message": "외부 비밀키"
+ "message": "느슨함"
+ },
+ "loweCaseWords": {
+ "message": "시드 단어는 소문자만 가능합니다"
},
"mainnet": {
"message": "이더리움 메인넷"
@@ -347,94 +497,127 @@
"message": {
"message": "메시지"
},
+ "metamaskDescription": {
+ "message": "메타마스크는 이더리움을 위한 안전한 신분 저장소입니다."
+ },
+ "metamaskSeedWords": {
+ "message": "메타마스크 시드 단어"
+ },
"min": {
"message": "최소"
},
"myAccounts": {
- "message": "내 계좌"
+ "message": "내 계정"
+ },
+ "mustSelectOne": {
+ "message": "적어도 하나의 토큰을 선택하세요."
},
"needEtherInWallet": {
- "message": "dApp을 이용하기 위해서는 지갑에 이더가 있어야 합니다."
+ "message": "메타마스크를 통한 dApp을 이용하기 위해서는 지갑에 이더가 있어야 합니다."
},
"needImportFile": {
"message": "가져올 파일을 선택해주세요.",
- "description": "User is important an account and needs to add a file to continue"
+ "description": "사용자는 계정을 가져오기 위해서 파일을 추가후 계속 진행해야 합니다"
},
"needImportPassword": {
- "message": "선택 된 파일에 패스워드를 입력해주세요.",
- "description": "Password and file needed to import an account"
+ "message": "선택 된 파일에 대한 비밀번호를 입력해주세요.",
+ "description": "계정을 가져오기 위해서 비밀번호와 파일이 필요합니다."
+ },
+ "negativeETH": {
+ "message": "음수값의 이더를 보낼 수 없습니다."
},
"networks": {
"message": "네트워크"
},
+ "nevermind": {
+ "message": "상관안함"
+ },
"newAccount": {
- "message": "새 계좌"
+ "message": "새 계정"
},
"newAccountNumberName": {
- "message": "새 계좌 $1",
- "description": "Default name of next account to be created on create account screen"
+ "message": "새 계정 $1",
+ "description": "계정 생성시 볼 수 있는 새 계정의 기본 이름"
},
"newContract": {
"message": "새 컨트랙트"
},
"newPassword": {
- "message": "새 패스워드 (최소 8자 이상)"
+ "message": "새 비밀번호 (최소 8자 이상)"
},
"newRecipient": {
"message": "받는 사람"
},
+ "newRPC": {
+ "message": "새로운 RPC URL"
+ },
"next": {
"message": "다음"
},
"noAddressForName": {
- "message": "이 이름에는 주소가 설정되어 있지 않습니다."
+ "message": "이 이름에 대해 주소가 설정되어 있지 않습니다."
},
"noDeposits": {
- "message": "입금이 없습니다."
+ "message": "입금 내역이 없습니다."
},
"noTransactionHistory": {
"message": "트랜잭션 기록이 없습니다."
},
"noTransactions": {
- "message": "트랜잭션이 없습니다."
+ "message": "트랜잭션이 없습니다"
},
"notStarted": {
- "message": "시작되지 않음."
+ "message": "시작 안됨"
},
"oldUI": {
- "message": "구버전의 UI"
+ "message": "구버전 UI"
},
"oldUIMessage": {
- "message": "구버전 UI로 변경하셨습니다. 우 상단 드랍다운 메뉴에서 새 UI로 변경하실 수 있습니다."
+ "message": "구버전 UI로 변경하셨습니다. 우 상단 드롭다운 메뉴에서 새 UI로 변경하실 수 있습니다."
},
"or": {
"message": "또는",
- "description": "choice between creating or importing a new account"
+ "description": "새 계정을 만들거나 가져오기중에 선택하기"
+ },
+ "password": {
+ "message": "비밀번호"
+ },
+ "passwordCorrect": {
+ "message": "비밀번호가 맞는지 확인해주세요."
},
"passwordMismatch": {
- "message": "패스워드가 일치하지 않습니다.",
- "description": "in password creation process, the two new password fields did not match"
+ "message": "비밀번호가 일치하지 않습니다.",
+ "description": "비밀번호를 생성하는 과정에서 두개의 새 비밀번호 입력란이 일치하지 않습니다"
},
"passwordShort": {
- "message": "패스워드가 너무 짧습니다.",
- "description": "in password creation process, the password is not long enough to be secure"
+ "message": "비밀번호가 짧습니다.",
+ "description": "비밀번호를 생성하는 과정에서 비밀번호가 짧으면 안전하지 않습니다"
},
"pastePrivateKey": {
- "message": "비밀키를 입력해주세요.",
- "description": "For importing an account from a private key"
+ "message": "개인키를 입력해주세요:",
+ "description": "개인키로부터 계정을 가져오는 것입니다"
},
"pasteSeed": {
- "message": "시드 문장들을 붙여넣어주세요."
+ "message": "시드 구문을 이곳에 붙여넣어주세요!"
+ },
+ "personalAddressDetected": {
+ "message": "개인 주소가 탐지됨. 토큰 컨트랙트 주소를 입력하세요."
},
"pleaseReviewTransaction": {
"message": "트랜잭션을 검토해주세요."
},
+ "popularTokens": {
+ "message": "인기있는 토큰"
+ },
+ "privacyMsg": {
+ "message": "개인정보 보호 정책"
+ },
"privateKey": {
- "message": "비밀키",
- "description": "select this type of file to use to import an account"
+ "message": "개인키",
+ "description": "이 형식의 파일을 선택하여 계정을 가져올 수 있습니다"
},
"privateKeyWarning": {
- "message": " 절대 이 키를 노출하지 마십시오. 비밀키가 노출되면 누구나 당신의 계좌에서 자산을 빼갈 수 있습니다."
+ "message": " 절대 이 키를 노출하지 마십시오. 개인키가 노출되면 누구나 당신의 계정에서 자산을 빼갈 수 있습니다."
},
"privateNetwork": {
"message": "프라이빗 네트워크"
@@ -446,28 +629,64 @@
"message": "옵션 메뉴에서 “토큰 추가”를 눌러서 추후에 다시 이 토큰을 추가하실 수 있습니다."
},
"readMore": {
- "message": "더 읽기."
+ "message": "여기서 더 보기."
+ },
+ "readMore2": {
+ "message": "더 보기."
},
"receive": {
"message": "받기"
},
"recipientAddress": {
- "message": "받는 사람 주소"
+ "message": "받는 주소"
},
"refundAddress": {
"message": "환불받을 주소"
},
"rejected": {
- "message": "거부되었음."
+ "message": "거부됨"
+ },
+ "reset": {
+ "message": "초기화"
+ },
+ "resetAccount": {
+ "message": "계정 초기화"
+ },
+ "resetAccountDescription": {
+ "message": "계정을 초기화 하는 경우에 트랜잭션 기록이 삭제됩니다."
+ },
+ "restoreFromSeed": {
+ "message": "계정을 복구하시겠습니까?"
+ },
+ "restoreVault": {
+ "message": "저장소 복구"
},
"required": {
- "message": "필요함."
+ "message": "필요함"
},
"retryWithMoreGas": {
- "message": "더 높은 가스 가격으로 다시 시도해주세요."
+ "message": "더 높은 가스 가격으로 다시 시도해주세요"
+ },
+ "walletSeed": {
+ "message": "지갑 시드값"
+ },
+ "revealSeedWords": {
+ "message": "시드 단어 보이기"
+ },
+ "revealSeedWordsTitle": {
+ "message": "시드 단어"
+ },
+ "revealSeedWordsDescription": {
+ "message": "브라우저를 바꾸거나 컴퓨터를 옮기는 경우 이 시드 구문이 필요하며 이를 통해 계정에 접근할 수 있습니다. 시드 구문을 안전한 곳에 보관하세요."
+ },
+ "revealSeedWordsWarningTitle": {
+ "message": "이 구문을 다른사람과 절대로 공유하지 마세요!"
+ },
+ "revealSeedWordsWarning": {
+ "message": "이 단어모음은 당신의 모든 계정을 훔치는데 사용할 수 있습니다."
},
"revert": {
- "message": "취소"
+ "message": "되돌림"
},
"rinkeby": {
"message": "Rinkeby 테스트넷"
@@ -475,46 +694,122 @@
"ropsten": {
"message": "Ropsten 테스트넷"
},
+ "rpc": {
+ "message": "사용자 정의 RPC"
+ },
+ "currentRpc": {
+ "message": "현재 RPC"
+ },
+ "connectingToMainnet": {
+ "message": "이더리움 메인넷 접속중"
+ },
+ "connectingToRopsten": {
+ "message": "Ropsten 테스트넷 접속중"
+ },
+ "connectingToKovan": {
+ "message": "Kovan 테스트넷 접속중"
+ },
+ "connectingToRinkeby": {
+ "message": "Rinkeby 테스트넷 접속중"
+ },
+ "connectingToUnknown": {
+ "message": "알려지지 않은 네트워크 접속중"
+ },
"sampleAccountName": {
- "message": "예) 나의 새 계좌",
- "description": "Help user understand concept of adding a human-readable name to their account"
+ "message": "예) 나의 새 계정",
+ "description": "각 계정에 대해서 구별하기 쉬운 이름을 지정하여 사용자가 쉽게 이해할 수 있게 합니다"
},
"save": {
"message": "저장"
},
+ "speedUpTitle": {
+ "message": "트랜잭션 속도 향상하기"
+ },
+ "speedUpSubtitle": {
+ "message": "트랜잭션 가스 가격을 늘려서 해당 트랙잭션에 덮어쓰기 하여 속도를 빠르게 합니다"
+ },
+ "saveAsCsvFile": {
+ "message": "CSV 파일로 저장"
+ },
"saveAsFile": {
"message": "파일로 저장",
- "description": "Account export process"
+ "description": "계정 내보내기 절차"
+ },
+ "saveSeedAsFile": {
+ "message": "시드 단어를 파일로 저장하기"
+ },
+ "search": {
+ "message": "검색"
+ },
+ "searchResults": {
+ "message": "검색 결과"
+ },
+ "secretPhrase": {
+ "message": "12개 단어로 구성된 비밀 구문을 입력하여 저장소를 복구하세요."
+ },
+ "newPassword8Chars": {
+ "message": "새 비밀번호 (최소 8문자)"
+ },
+ "seedPhraseReq": {
+ "message": "시드 구문은 12개의 단어입니다"
+ },
+ "select": {
+ "message": "선택"
+ },
+ "selectCurrency": {
+ "message": "통화 선택"
},
"selectService": {
"message": "서비스 선택"
},
+ "selectType": {
+ "message": "형식 선택"
+ },
"send": {
"message": "전송"
},
+ "sendETH": {
+ "message": "ETH 보내기"
+ },
"sendTokens": {
"message": "토큰 전송"
},
+ "onlySendToEtherAddress": {
+ "message": "이더리움 주소로 ETH만 송금하세요."
+ },
+ "onlySendTokensToAccountAddress": {
+ "message": "이더리움계정 주소로 $1 만 보내기.",
+ "description": "토큰 심볼 보이기"
+ },
+ "searchTokens": {
+ "message": "토큰 검색"
+ },
"sendTokensAnywhere": {
- "message": "이더 계좌로 토큰 전송"
+ "message": "이더 계정로 토큰 전송"
},
"settings": {
"message": "설정"
},
+ "info": {
+ "message": "정보"
+ },
"shapeshiftBuy": {
"message": "Shapeshift를 통해서 구매하기"
},
"showPrivateKeys": {
- "message": "비밀키 보기"
+ "message": "개인키 보기"
},
"showQRCode": {
- "message": "QR코드 보기"
+ "message": "QR 코드 보기"
},
"sign": {
"message": "서명"
},
+ "signed": {
+ "message": "서명됨"
+ },
"signMessage": {
- "message": "서명 메시지"
+ "message": "메시지 서명"
},
"signNotice": {
"message": "이 메시지에 대한 서명은 위험할 수 있습니다.\n 완전히 신뢰할 수 있는 사이트에서만 서명해주세요.\n 안전을 위해 추후의 버전에서는 삭제될 기능입니다. "
@@ -523,33 +818,81 @@
"message": "서명 요청"
},
"sigRequested": {
- "message": "서명이 요청되었습니다."
+ "message": "서명이 요청됨"
+ },
+ "spaceBetween": {
+ "message": "단어 사이에는 공백만 올 수 있습니다"
},
"status": {
"message": "상태"
},
+ "stateLogs": {
+ "message": "상태 로그"
+ },
+ "stateLogsDescription": {
+ "message": "상태 로그에는 공개 계정 주소와 송신 트랜잭션 정보가 들어있습니다."
+ },
+ "stateLogError": {
+ "message": "상태 로그 받기 실패."
+ },
"submit": {
"message": "제출"
},
+ "submitted": {
+ "message": "제출됨"
+ },
+ "supportCenter": {
+ "message": "지원 센터에 방문하기"
+ },
+ "symbolBetweenZeroTen": {
+ "message": "심볼은 0에서 10개 사이의 문자여야 합니다."
+ },
"takesTooLong": {
"message": "너무 오래걸리나요?"
},
+ "terms": {
+ "message": "사용 지침"
+ },
"testFaucet": {
- "message": "Faucet 테스트"
+ "message": "파우셋 테스트"
},
"to": {
- "message": "대상"
+ "message": "받는이: "
},
"toETHviaShapeShift": {
"message": "ShapeShift를 통해 $1를 ETH로 바꾸기",
- "description": "system will fill in deposit type in start of message"
+ "description": "시스템이 시작할 때에 입금 유형을 입력해줍니다"
+ },
+ "token": {
+ "message": "토큰"
+ },
+ "tokenAddress": {
+ "message": "토큰 주소"
+ },
+ "tokenAlreadyAdded": {
+ "message": "토큰이 이미 추가되어있습니다."
},
"tokenBalance": {
- "message": "현재 토큰 잔액: "
+ "message": "현재 토큰 잔액:"
+ },
+ "tokenSelection": {
+ "message": "토큰을 검색하거나 유명한 토큰 리스트에서 선택하시기 바랍니다."
+ },
+ "tokenSymbol": {
+ "message": "토큰 기호"
+ },
+ "tokenWarning1": {
+ "message": "메타마스크 계좌를 통해 구입한 토큰을 추적합니다. 다른 계정으로 토큰을 구입한 경우 이곳에 나타나지 않습니다."
},
"total": {
"message": "합계"
},
+ "transactions": {
+ "message": "트랜잭션"
+ },
+ "transactionError": {
+ "message": "트랜잭션 오류. 컨트랙트 코드에서 예외 발생(Exception thrown)."
+ },
"transactionMemo": {
"message": "트랜잭션 메모 (선택사항)"
},
@@ -560,23 +903,29 @@
"message": "전송"
},
"troubleTokenBalances": {
- "message": "토큰 잔액을 가져오는데에 문제가 생겼습니다. (여기)서 상세내용을 볼 수 있습니다.",
- "description": "Followed by a link (here) to view token balances"
+ "message": "토큰 잔액을 가져오는데에 문제가 생겼습니다. 링크에서 상세내용을 볼 수 있습니다.",
+ "description": "토큰 잔액을 보려면 (here) 링크를 따라가세요"
+ },
+ "twelveWords": {
+ "message": "12개의 단어는 메타마스크 계정을 복구하기 위한 유일한 방법입니다.\n안전한 장소에 보관하시기 바랍니다."
},
"typePassword": {
- "message": "패스워드를 입력하세요."
+ "message": "비밀번호를 입력하세요"
},
"uiWelcome": {
- "message": "새 UI에 오신 것을 환영합니다. (베타)"
+ "message": "새로운 UI에 오신 것을 환영합니다. (Beta)"
},
"uiWelcomeMessage": {
- "message": "새 메타마스크 UI를 사용하고 계십니다. 토큰 전송과 같은 새 기능들을 사용해보시면서 문제가 있다면 알려주세요."
+ "message": "새로운 메타마스크 UI를 사용하고 계십니다. 토큰 전송과 같은 새 기능들을 사용해보시면서 문제가 있다면 알려주세요."
+ },
+ "unapproved": {
+ "message": "허가안됨"
},
"unavailable": {
- "message": "유효하지 않은"
+ "message": "유효하지 않음"
},
"unknown": {
- "message": "알려지지 않은"
+ "message": "알려지지 않음"
},
"unknownNetwork": {
"message": "알려지지 않은 프라이빗 네트워크"
@@ -584,19 +933,46 @@
"unknownNetworkId": {
"message": "알려지지 않은 네트워크 ID"
},
+ "unlockMessage": {
+ "message": "우리가 기다리던 분권형 웹입니다"
+ },
+ "uriErrorMsg": {
+ "message": "URI는 HTTP/HTTPS로 시작해야 합니다."
+ },
"usaOnly": {
"message": "USA 거주자 한정",
- "description": "Using this exchange is limited to people inside the USA"
+ "description": "해당 거래소는 USA거주자에 한해서만 사용가능합니다"
},
"usedByClients": {
- "message": "다양한 클라이언트에서 사용되고 있습니다."
+ "message": "다양한 클라이언트에서 사용되고 있습니다"
+ },
+ "useOldUI": {
+ "message": "예전 UI 사용"
+ },
+ "validFileImport": {
+ "message": "가져오기 위해 유효한 파일을 선택해야 합니다."
+ },
+ "vaultCreated": {
+ "message": "저장소가 생성됨"
},
"viewAccount": {
- "message": "계좌 보기"
+ "message": "계정 보기"
+ },
+ "viewOnEtherscan": {
+ "message": "이터스캔에서 보기"
+ },
+ "visitWebSite": {
+ "message": "웹사이트 방문"
},
"warning": {
"message": "경고"
},
+ "welcomeBack": {
+ "message": "환영합니다!"
+ },
+ "welcomeBeta": {
+ "message": "메타마스크 Beta에 오신 것을 환영합니다"
+ },
"whatsThis": {
"message": "이것은 무엇인가요?"
},
@@ -604,6 +980,204 @@
"message": "서명이 요청되고 있습니다."
},
"youSign": {
- "message": "서명 중입니다."
+ "message": "서명 중입니다"
+ },
+ "yourPrivateSeedPhrase": {
+ "message": "개인 시드 구문"
+ },
+ "accessingYourCamera": {
+ "message": "카메라 접근중..."
+ },
+ "accountSelectionRequired": {
+ "message": "계정을 선택하셔야 합니다!"
+ },
+ "approve": {
+ "message": "수락"
+ },
+ "browserNotSupported": {
+ "message": "브라우저가 지원하지 않습니다..."
+ },
+ "bytes": {
+ "message": "바이트"
+ },
+ "chromeRequiredForHardwareWallets": {
+ "message": "하드웨어 지갑을 연결하기 위해서는 구글 크롬에서 메타마스크를 사용하셔야 합니다."
+ },
+ "connectHardwareWallet": {
+ "message": "하드웨어 지갑 연결"
+ },
+ "connect": {
+ "message": "연결"
+ },
+ "connecting": {
+ "message": "연결중..."
+ },
+ "connectToLedger": {
+ "message": "Ledger 연결"
+ },
+ "connectToTrezor": {
+ "message": "Trezor 연결"
+ },
+ "copyAddress": {
+ "message": "클립보드로 주소 복사"
+ },
+ "downloadGoogleChrome": {
+ "message": "구글 크롬 다운로드"
+ },
+ "dontHaveAHardwareWallet": {
+ "message": "하드웨어 지갑이 없나요?"
+ },
+ "ensNameNotFound": {
+ "message": "ENS 이름을 찾을 수 없습니다"
+ },
+ "parameters": {
+ "message": "매개변수"
+ },
+ "forgetDevice": {
+ "message": "장치 연결 해제"
+ },
+ "functionType": {
+ "message": "함수 유형"
+ },
+ "getHelp": {
+ "message": "도움말"
+ },
+ "hardware": {
+ "message": "하드웨어"
+ },
+ "hardwareWalletConnected": {
+ "message": "하드웨어 지갑이 연결됨"
+ },
+ "hardwareWallets": {
+ "message": "하드웨어 지갑 연결"
+ },
+ "hardwareWalletsMsg": {
+ "message": "메타마스크에서 사용할 하드웨어 지갑을 선택해주세요"
+ },
+ "havingTroubleConnecting": {
+ "message": "연결에 문제가 있나요?"
+ },
+ "hexData": {
+ "message": "Hex 데이터"
+ },
+ "invalidSeedPhrase": {
+ "message": "잘못된 시드 구문"
+ },
+ "ledgerAccountRestriction": {
+ "message": "새 계정을 추가하려면 최소 마지막 계정을 사용해야 합니다."
+ },
+ "menu": {
+ "message": "메뉴"
+ },
+ "noConversionRateAvailable": {
+ "message": "변환 비율을 찾을 수 없습니다"
+ },
+ "notFound": {
+ "message": "찾을 수 없음"
+ },
+ "noWebcamFoundTitle": {
+ "message": "웹캠이 없습니다"
+ },
+ "noWebcamFound": {
+ "message": "컴퓨터의 웹캠을 찾을 수 없습니다. 다시 시도해보세요."
+ },
+ "openInTab": {
+ "message": "탭으로 열기"
+ },
+ "origin": {
+ "message": "Origin"
+ },
+ "prev": {
+ "message": "이전"
+ },
+ "restoreAccountWithSeed": {
+ "message": "시드 구문으로 계정 복구하기"
+ },
+ "restore": {
+ "message": "복구"
+ },
+ "remove": {
+ "message": "제거"
+ },
+ "removeAccount": {
+ "message": "계정 제거"
+ },
+ "removeAccountDescription": {
+ "message": "이 계정한 지갑에서 삭제될 것입니다. 지우기 전에 이 계정에 대한 개인 키 혹은 시드 구문을 가지고 있는지 확인하세요. 계정 드랍다운 메뉴를 통해서 계정을 가져오거나 생성할 수 있습니다."
+ },
+ "readyToConnect": {
+ "message": "접속 준비되었나요?"
+ },
+ "separateEachWord": {
+ "message": "각 단어는 공백 한칸으로 분리합니다"
+ },
+ "orderOneHere": {
+ "message": "Trezor 혹은 Ledger를 구입하고 자금을 콜드 스토리지에 저장합니다"
+ },
+ "selectAnAddress": {
+ "message": "주소 선택"
+ },
+ "selectAnAccount": {
+ "message": "계정 선택"
+ },
+ "selectAnAccountHelp": {
+ "message": "메타마스크에서 보기위한 계정 선택"
+ },
+ "selectHdPath": {
+ "message": "HD 경로 지정"
+ },
+ "selectPathHelp": {
+ "message": "하단에서 Ledger지갑 계정을 찾지 못하겠으면 \"Legacy (MEW / MyCrypto)\" 경로로 바꿔보세요"
+ },
+ "step1HardwareWallet": {
+ "message": "1. 하드웨어 지갑 연결"
+ },
+ "step1HardwareWalletMsg": {
+ "message": "하드웨어 지갑을 컴퓨터에 연결해주세요."
+ },
+ "step2HardwareWallet": {
+ "message": "2. 계정 선택"
+ },
+ "step2HardwareWalletMsg": {
+ "message": "보고 싶은 계정을 선택합니다. 한번에 하나의 계정만 선택할 수 있습니다."
+ },
+ "step3HardwareWallet": {
+ "message": "3. dApps을 사용하거나 다른 것을 합니다!"
+ },
+ "step3HardwareWalletMsg": {
+ "message": "다른 이더리움 계정을 사용하듯 하드웨어 계정을 사용합니다. dApps을 로그인하거나, 이더를 보내거나, ERC20토큰 혹은 대체가능하지 않은 토큰 (예를 들어 CryptoKitties)을 사거나 저장하거나 합니다."
+ },
+ "scanInstructions": {
+ "message": "QR 코드를 카메라 앞에 가져다 놓아주세요"
+ },
+ "scanQrCode": {
+ "message": "QR 코드 스캔"
+ },
+ "transfer": {
+ "message": "전송"
+ },
+ "trezorHardwareWallet": {
+ "message": "TREZOR 하드웨어 지갑"
+ },
+ "tryAgain": {
+ "message": "다시 시도하세요"
+ },
+ "unknownFunction": {
+ "message": "알 수 없는 함수"
+ },
+ "unknownQrCode": {
+ "message": "오류: QR 코드를 확인할 수 없습니다"
+ },
+ "unknownCameraErrorTitle": {
+ "message": "이런! 뭔가 잘못되었습니다...."
+ },
+ "unknownCameraError": {
+ "message": "카메라를 접근하는 중 오류가 발생했습니다. 다시 시도해 주세요..."
+ },
+ "unlock": {
+ "message": "잠금 해제"
+ },
+ "youNeedToAllowCameraAccess": {
+ "message": "이 기능을 사용하려면 카메라 접근을 허용해야 합니다."
}
}
diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json
index bb722735d..6344e1beb 100644
--- a/app/_locales/ru/messages.json
+++ b/app/_locales/ru/messages.json
@@ -784,7 +784,7 @@
"message": "Тестовый кран"
},
"to": {
- "message": "Получатель: "
+ "message": "Получатель"
},
"toETHviaShapeShift": {
"message": "$1 в ETH через ShapeShift",
diff --git a/app/_locales/tml/messages.json b/app/_locales/tml/messages.json
index fcc418bac..4f733458e 100644
--- a/app/_locales/tml/messages.json
+++ b/app/_locales/tml/messages.json
@@ -796,7 +796,7 @@
"message": "சோதனை குழாய்"
},
"to": {
- "message": "பெறுநர்: "
+ "message": "பெறுநர்"
},
"toETHviaShapeShift": {
"message": "$ 1 முதல் ETH வரை வடிவம்",
diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json
index 08ba6cde8..8be695108 100644
--- a/app/_locales/tr/messages.json
+++ b/app/_locales/tr/messages.json
@@ -796,7 +796,7 @@
"message": "Test Musluğu"
},
"to": {
- "message": "Kime: "
+ "message": "Kime"
},
"toETHviaShapeShift": {
"message": "ShapeShift üstünden $1'dan ETH'e",
diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json
index a39bba9da..8ce0671a4 100644
--- a/app/_locales/zh_CN/messages.json
+++ b/app/_locales/zh_CN/messages.json
@@ -23,6 +23,9 @@
"addTokens": {
"message": "添加代币"
},
+ "addAcquiredTokens": {
+ "message": "在Metamask上添加已用的代币"
+ },
"amount": {
"message": "数量"
},
@@ -116,6 +119,9 @@
"confirmTransaction": {
"message": "确认交易"
},
+ "connectHardwareWallet": {
+ "message": "链接硬件钱包"
+ },
"continue": {
"message": "继续"
},
@@ -714,6 +720,9 @@
"search": {
"message": "搜索"
},
+ "searchResults": {
+ "message": "搜索结果"
+ },
"secretPhrase": {
"message": "输入12位助记词以恢复金库."
},
diff --git a/app/images/arrow-popout.svg b/app/images/arrow-popout.svg
new file mode 100644
index 000000000..7e25f7cd2
--- /dev/null
+++ b/app/images/arrow-popout.svg
@@ -0,0 +1,3 @@
+<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M8.67589 0.641872C8.65169 0.642635 8.62756 0.644749 8.6036 0.648202H4.79279C4.55863 0.644896 4.34082 0.767704 4.22278 0.969601C4.10473 1.1715 4.10473 1.4212 4.22278 1.6231C4.34082 1.825 4.55863 1.9478 4.79279 1.9445H7.12113L0.437932 8.61587C0.268309 8.77843 0.19998 9.01984 0.259298 9.24697C0.318616 9.47411 0.496311 9.65149 0.723852 9.71071C0.951393 9.76992 1.19322 9.70171 1.35608 9.53239L8.03927 2.86102V5.18524C8.03596 5.41898 8.15899 5.6364 8.36124 5.75424C8.56349 5.87208 8.81364 5.87208 9.0159 5.75424C9.21815 5.6364 9.34118 5.41898 9.33787 5.18524V1.37863C9.36404 1.18976 9.30558 0.998955 9.17804 0.857009C9.0505 0.715062 8.86682 0.636369 8.67589 0.641872Z" fill="#359BDD"/>
+</svg>
diff --git a/app/images/ledger-logo.svg b/app/images/ledger-logo.svg
index 21b99d0e5..5ca90e16e 100644
--- a/app/images/ledger-logo.svg
+++ b/app/images/ledger-logo.svg
@@ -1 +1,33 @@
-<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1916.3 516.8" width="2500" height="674"><style>.st0{fill:#333745}</style><g id="squares_1_"><path class="st0" d="M578.2 392.7V24.3h25.6v344.1h175.3v24.3H578.2zm327.5 5.1c-39.7 0-70.4-12.8-93.4-37.1-21.7-24.3-33.3-58.8-33.3-103.6 0-43.5 10.2-79.3 32-104.9 21.7-26.9 49.9-39.7 87-39.7 32 0 57.6 11.5 76.8 33.3 19.2 23 28.1 53.7 28.1 92.1v20.5H804.6c0 37.1 9 66.5 26.9 85.7 16.6 20.5 42.2 29.4 74.2 29.4 15.3 0 29.4-1.3 40.9-3.8 11.5-2.6 26.9-6.4 44.8-14.1v24.3c-15.3 6.4-29.4 11.5-42.2 14.1-14.3 2.6-28.9 3.9-43.5 3.8zM898 135.6c-26.9 0-47.3 9-64 25.6-15.3 17.9-25.6 42.2-28.1 75.5h168.9c0-32-6.4-56.3-20.5-74.2-12.8-18-32-26.9-56.3-26.9zm238-21.8c19.2 0 37.1 3.8 51.2 10.2 14.1 7.7 26.9 19.2 38.4 37.1h1.3c-1.3-21.7-1.3-42.2-1.3-62.7V0h24.3v392.7h-16.6l-6.4-42.2c-20.5 30.7-51.2 47.3-89.6 47.3s-66.5-11.5-87-35.8c-20.5-23-29.4-57.6-29.4-102.3 0-47.3 10.2-83.2 29.4-108.7 19.2-25.6 48.6-37.2 85.7-37.2zm0 21.8c-29.4 0-52.4 10.2-67.8 32-15.3 20.5-23 51.2-23 92.1 0 78 30.7 116.4 90.8 116.4 30.7 0 53.7-9 67.8-26.9 14.1-17.9 21.7-47.3 21.7-89.6v-3.8c0-42.2-7.7-72.9-21.7-90.8-12.8-20.5-35.8-29.4-67.8-29.4zm379.9-16.6v17.9l-56.3 3.8c15.3 19.2 23 39.7 23 61.4 0 26.9-9 47.3-26.9 64-17.9 16.6-40.9 24.3-70.4 24.3-12.8 0-21.7 0-25.6-1.3-10.2 5.1-17.9 11.5-23 17.9-5.1 7.7-7.7 14.1-7.7 23s3.8 15.3 10.2 19.2c6.4 3.8 17.9 6.4 33.3 6.4h47.3c29.4 0 52.4 6.4 67.8 17.9s24.3 29.4 24.3 53.7c0 29.4-11.5 51.2-34.5 66.5-23 15.3-56.3 23-99.8 23-34.5 0-61.4-6.4-80.6-20.5-19.2-12.8-28.1-32-28.1-55 0-19.2 6.4-34.5 17.9-47.3s28.1-20.5 47.3-25.6c-7.7-3.8-15.3-9-19.2-15.3-5-6.2-7.7-13.8-7.7-21.7 0-17.9 11.5-34.5 34.5-48.6-15.3-6.4-28.1-16.6-37.1-30.7-9-14.1-12.8-30.7-12.8-48.6 0-26.9 9-49.9 25.6-66.5 17.9-16.6 40.9-24.3 70.4-24.3 17.9 0 32 1.3 42.2 5.1h85.7v1.3h.2zm-222.6 319.8c0 37.1 28.1 56.3 84.4 56.3 71.6 0 107.5-23 107.5-69.1 0-16.6-5.1-28.1-16.6-35.8-11.5-7.7-29.4-11.5-55-11.5h-44.8c-49.9 1.2-75.5 20.4-75.5 60.1zm21.8-235.4c0 21.7 6.4 37.1 19.2 49.9 12.8 11.5 29.4 17.9 51.2 17.9 23 0 40.9-6.4 52.4-17.9 12.8-11.5 17.9-28.1 17.9-49.9 0-23-6.4-40.9-19.2-52.4-12.8-11.5-29.4-17.9-52.4-17.9-21.7 0-39.7 6.4-51.2 19.2-12.8 11.4-17.9 29.3-17.9 51.1z"/><path class="st0" d="M1640 397.8c-39.7 0-70.4-12.8-93.4-37.1-21.7-24.3-33.3-58.8-33.3-103.6 0-43.5 10.2-79.3 32-104.9 21.7-26.9 49.9-39.7 87-39.7 32 0 57.6 11.5 76.8 33.3 19.2 23 28.1 53.7 28.1 92.1v20.5h-197c0 37.1 9 66.5 26.9 85.7 16.6 20.5 42.2 29.4 74.2 29.4 15.3 0 29.4-1.3 40.9-3.8 11.5-2.6 26.9-6.4 44.8-14.1v24.3c-15.3 6.4-29.4 11.5-42.2 14.1-14.1 2.6-28.2 3.8-44.8 3.8zm-6.4-262.2c-26.9 0-47.3 9-64 25.6-15.3 17.9-25.6 42.2-28.1 75.5h168.9c0-32-6.4-56.3-20.5-74.2-12.8-18-32-26.9-56.3-26.9zm245.6-21.8c11.5 0 24.3 1.3 37.1 3.8l-5.1 24.3c-11.8-2.6-23.8-3.9-35.8-3.8-23 0-42.2 10.2-57.6 29.4-15.3 20.5-23 44.8-23 75.5v149.7h-25.6V119h21.7l2.6 49.9h1.3c11.5-20.5 23-34.5 35.8-42.2 15.4-9 30.7-12.9 48.6-12.9zM333.9 12.8h-183v245.6h245.6V76.7c.1-34.5-28.1-63.9-62.6-63.9zm-239.2 0H64c-34.5 0-64 28.1-64 64v30.7h94.7V12.8zM0 165h94.7v94.7H0V165zm301.9 245.6h30.7c34.5 0 64-28.1 64-64V316h-94.7v94.6zm-151-94.6h94.7v94.7h-94.7V316zM0 316v30.7c0 34.5 28.1 64 64 64h30.7V316H0z"/></g></svg> \ No newline at end of file
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 197.4 48.6" style="enable-background:new 0 0 197.4 48.6;" xml:space="preserve">
+<style type="text/css">
+ .st0{fill:#1D2028;}
+</style>
+<title>Fichier 8</title>
+<g>
+ <path class="st0" d="M34.1,0H15.5v25.1h25.1V6.5C40.6,2.9,37.7,0,34.1,0z"/>
+ <path class="st0" d="M9.7,0H6.5C2.9,0,0,2.9,0,6.5v3.2h9.7V0z"/>
+ <rect y="15.5" class="st0" width="9.7" height="9.7"/>
+ <path class="st0" d="M31,40.6h3.2c3.6,0,6.5-2.9,6.5-6.5V31H31V40.6z"/>
+ <rect x="15.5" y="31" class="st0" width="9.7" height="9.7"/>
+ <path class="st0" d="M0,31v3.2c0,3.6,2.9,6.5,6.5,6.5h3.2V31H0z"/>
+ <g>
+ <polygon class="st0" points="65.4,2.6 61.6,2.6 61.6,38.1 81.7,38.1 81.7,34.7 65.4,34.7 "/>
+ <path class="st0" d="M93.9,12c-7.4,0-12.6,5.5-12.6,13.4c0,0.3,0,0.6,0,0.9c0.1,3.4,1.6,6.6,4.1,9c2.4,2.2,5.5,3.5,8.8,3.5
+ c0.2,0,0.3,0,0.5,0c3.5,0,6.8-1.3,9.4-3.5l0.1-0.1l-1.7-2.8l-0.2,0.1c-2.1,1.9-4.7,3-7.5,3c-4.6,0-9.3-3-9.6-9.7h19.2v-0.2
+ c0,0,0.1-1.2,0.1-1.8C104.5,16.6,100.3,12,93.9,12z M85.3,22.6c0.8-4.5,4.1-7.4,8.4-7.4c3.2,0,6.7,1.9,7,7.4H85.3z"/>
+ <path class="st0" d="M126.5,15c0,0.4,0,0.9,0,1.3c-1.6-2.7-4.6-4.4-7.7-4.4c-0.1,0-0.2,0-0.3,0c-6.8,0-11.5,5.4-11.5,13.3
+ c0,8,4.5,13.4,11.2,13.4c5.3,0,7.7-3.2,8.5-4.6c0,0.4,0,0.8,0,1.1v2.8h3.6V2.6h-3.7V15H126.5z M118.7,35.3c-4.7,0-7.8-4-7.8-10
+ c0-5.8,3.3-9.9,7.9-9.9c3.9,0,7.8,3.1,7.8,9.9C126.6,32.7,122.5,35.3,118.7,35.3z"/>
+ <path class="st0" d="M152.2,15.5c0,0.1,0,0.2,0,0.2c-0.7-1.2-2.9-3.8-8.2-3.8c-6.7,0-11.1,5.1-11.1,12.9s4.6,13.1,11.4,13.1
+ c3.7,0,6.2-1.3,7.9-4c0,0.4,0,0.8,0,1.2v2.3c0,4.9-3.1,7.7-8.6,7.7c-2.3,0-4.7-0.6-6.8-1.7l-0.2-0.1l-1.4,3.1l0.2,0.1
+ c2.6,1.3,5.5,2,8.3,2c5.9,0,12.2-3,12.2-11.3V12.6h-3.7L152.2,15.5L152.2,15.5z M144.8,34.6c-4.9,0-8.1-3.8-8.1-9.7
+ c0-6,2.8-9.4,7.6-9.4c5.3,0,7.8,3.1,7.8,9.4C152.2,31.1,149.6,34.6,144.8,34.6z"/>
+ <path class="st0" d="M171,12c-7.4,0-12.5,5.5-12.5,13.3c0,0.3,0,0.6,0,0.9c0.1,3.4,1.6,6.6,4.1,9c2.4,2.2,5.5,3.5,8.8,3.5
+ c0.2,0,0.3,0,0.5,0c3.5,0,6.8-1.3,9.4-3.5l0.1-0.1l-1.8-2.8l-0.2,0.1c-2.1,1.9-4.7,3-7.5,3c-4.6,0-9.3-3-9.6-9.7h19.3v-0.2
+ c0,0,0.1-1.2,0.1-1.8C181.7,16.6,177.5,12,171,12z M162.5,22.6c0.8-4.5,4.1-7.4,8.4-7.4c3.2,0,6.7,1.9,7,7.4H162.5z"/>
+ <path class="st0" d="M197.3,12.5c-0.5-0.1-0.9-0.1-1.4-0.2c-3.5,0-6.4,2.2-7.9,5.9c0-0.3,0-0.7,0-1.1v-4.6h-3.7l0.1,25.3V38h3.8
+ V27.3c0-1.6,0.2-3.3,0.7-4.8c1.2-3.9,3.9-6.4,7.1-6.4c0.4,0,0.8,0,1.2,0.1h0.2v-3.7L197.3,12.5z"/>
+ </g>
+</g>
+</svg>
diff --git a/app/manifest.json b/app/manifest.json
index 086d5ba00..7c554f1ac 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appName__",
- "version": "4.9.3",
+ "version": "4.12.0",
"manifest_version": 2,
"author": "https://metamask.io",
"description": "__MSG_appDescription__",
@@ -63,7 +63,6 @@
"activeTab",
"webRequest",
"*://*.eth/",
- "*://*.test/",
"notifications"
],
"web_accessible_resources": [
@@ -78,4 +77,4 @@
"*"
]
}
-}
+} \ No newline at end of file
diff --git a/app/phishing.html b/app/phishing.html
index e20c9ac9c..eabb363b3 100644
--- a/app/phishing.html
+++ b/app/phishing.html
@@ -25,9 +25,9 @@
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),
@@ -43,9 +43,9 @@
ga('create', 'UA-68598031-1', 'auto' {'allowLinker':true});
ga('send', 'pageview');
ga('require', 'linker');
- ga('linker:autoLink', ['harrydenley.com', 'metamask.io'], false, true);
+ ga('linker:autoLink', ['metamask.io'], false, true);
</script>
-
+ <script src="phishing-detect.js"></script>
</head>
<body>
@@ -55,6 +55,7 @@
<h3>ATTENTION</h3>
<p>MetaMask believes this domain could currently compromise your security 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>. This includes outright malicious websites and legitimate websites that have been compromised by a malicious actor.</p>
+ <p id="esdbLink"></p>
<p>You can turn MetaMask off to interact with this site, but it is advised not to.</p>
<p>If you think this domain is incorrectly flagged or if a blocked legitimate website has resolved its security issues, <a href="https://github.com/metamask/eth-phishing-detect/issues/new">please file an issue</a>.</p>
diff --git a/app/scripts/background.js b/app/scripts/background.js
index d4d87e0d5..ae450352e 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -256,6 +256,7 @@ function setupController (initState, initLangCode) {
showUnconfirmedMessage: triggerUi,
unlockAccountMessage: triggerUi,
showUnapprovedTx: triggerUi,
+ showWatchAssetUi: showWatchAssetUi,
// initial state
initState,
// initial locale code
@@ -405,6 +406,7 @@ function setupController (initState, initLangCode) {
controller.txController.on('update:badge', updateBadge)
controller.messageManager.on('updateBadge', updateBadge)
controller.personalMessageManager.on('updateBadge', updateBadge)
+ controller.typedMessageManager.on('updateBadge', updateBadge)
/**
* Updates the Web Extension's "badge" number, on the little fox in the toolbar.
@@ -443,9 +445,28 @@ function triggerUi () {
})
}
+/**
+ * Opens the browser popup for user confirmation of watchAsset
+ * then it waits until user interact with the UI
+ */
+function showWatchAssetUi () {
+ triggerUi()
+ return new Promise(
+ (resolve) => {
+ var interval = setInterval(() => {
+ if (!notificationIsOpen) {
+ clearInterval(interval)
+ resolve()
+ }
+ }, 1000)
+ }
+ )
+}
+
// On first install, open a window to MetaMask website to how-it-works.
extension.runtime.onInstalled.addListener(function (details) {
if ((details.reason === 'install') && (!METAMASK_DEBUG)) {
extension.tabs.create({url: 'https://metamask.io/#how-it-works'})
}
})
+
diff --git a/app/scripts/contentscript.js b/app/scripts/contentscript.js
index 6eee1987a..2cbfb811e 100644
--- a/app/scripts/contentscript.js
+++ b/app/scripts/contentscript.js
@@ -199,5 +199,5 @@ function blacklistedDomainCheck () {
function redirectToPhishingWarning () {
console.log('MetaMask - routing to Phishing Warning component')
const extensionURL = extension.runtime.getURL('phishing.html')
- window.location.href = extensionURL
+ window.location.href = extensionURL + '#' + window.location.hostname
}
diff --git a/app/scripts/controllers/network/createMetamaskMiddleware.js b/app/scripts/controllers/network/createMetamaskMiddleware.js
index 8b17829b7..9e6a45888 100644
--- a/app/scripts/controllers/network/createMetamaskMiddleware.js
+++ b/app/scripts/controllers/network/createMetamaskMiddleware.js
@@ -38,6 +38,6 @@ function createPendingNonceMiddleware ({ getPendingNonce }) {
const address = req.params[0]
const blockRef = req.params[1]
if (blockRef !== 'pending') return next()
- req.result = await getPendingNonce(address)
+ res.result = await getPendingNonce(address)
})
}
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 707fd7de9..928ebdf1f 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -1,5 +1,6 @@
const ObservableStore = require('obs-store')
const normalizeAddress = require('eth-sig-util').normalize
+const { isValidAddress } = require('ethereumjs-util')
const extend = require('xtend')
@@ -14,6 +15,7 @@ class PreferencesController {
* @property {string} store.currentAccountTab Indicates the selected tab in the ui
* @property {array} store.tokens The tokens the user wants display in their token lists
* @property {object} store.accountTokens The tokens stored per account and then per network type
+ * @property {object} store.assetImages Contains assets objects related to assets added
* @property {boolean} store.useBlockie The users preference for blockie identicons within the UI
* @property {object} store.featureFlags A key-boolean map, where keys refer to features and booleans to whether the
* user wishes to see that feature
@@ -26,22 +28,43 @@ class PreferencesController {
frequentRpcList: [],
currentAccountTab: 'history',
accountTokens: {},
+ assetImages: {},
tokens: [],
+ suggestedTokens: {},
useBlockie: false,
featureFlags: {},
currentLocale: opts.initLangCode,
identities: {},
lostIdentities: {},
+ seedWords: null,
+ forgottenPassword: false,
}, opts.initState)
this.diagnostics = opts.diagnostics
this.network = opts.network
this.store = new ObservableStore(initState)
+ this.showWatchAssetUi = opts.showWatchAssetUi
this._subscribeProviderType()
}
// PUBLIC METHODS
/**
+ * Sets the {@code forgottenPassword} state property
+ * @param {boolean} forgottenPassword whether or not the user has forgotten their password
+ */
+ setPasswordForgotten (forgottenPassword) {
+ this.store.updateState({ forgottenPassword })
+ }
+
+ /**
+ * Sets the {@code seedWords} seed words
+ * @param {string|null} seedWords the seed words
+ */
+ setSeedWords (seedWords) {
+ this.store.updateState({ seedWords })
+ }
+
+ /**
* Setter for the `useBlockie` property
*
* @param {boolean} val Whether or not the user prefers blockie indicators
@@ -51,6 +74,53 @@ class PreferencesController {
this.store.updateState({ useBlockie: val })
}
+ getSuggestedTokens () {
+ return this.store.getState().suggestedTokens
+ }
+
+ getAssetImages () {
+ return this.store.getState().assetImages
+ }
+
+ addSuggestedERC20Asset (tokenOpts) {
+ this._validateERC20AssetParams(tokenOpts)
+ const suggested = this.getSuggestedTokens()
+ const { rawAddress, symbol, decimals, image } = tokenOpts
+ const address = normalizeAddress(rawAddress)
+ const newEntry = { address, symbol, decimals, image }
+ suggested[address] = newEntry
+ this.store.updateState({ suggestedTokens: suggested })
+ }
+
+ /**
+ * RPC engine middleware for requesting new asset added
+ *
+ * @param req
+ * @param res
+ * @param {Function} - next
+ * @param {Function} - end
+ */
+ async requestWatchAsset (req, res, next, end) {
+ if (req.method === 'metamask_watchAsset') {
+ const { type, options } = req.params
+ switch (type) {
+ case 'ERC20':
+ const result = await this._handleWatchAssetERC20(options)
+ if (result instanceof Error) {
+ end(result)
+ } else {
+ res.result = result
+ end()
+ }
+ break
+ default:
+ end(new Error(`Asset of type ${type} not supported`))
+ }
+ } else {
+ next()
+ }
+ }
+
/**
* Getter for the `useBlockie` property
*
@@ -186,6 +256,13 @@ class PreferencesController {
return selected
}
+ removeSuggestedTokens () {
+ return new Promise((resolve, reject) => {
+ this.store.updateState({ suggestedTokens: {} })
+ resolve({})
+ })
+ }
+
/**
* Setter for the `selectedAddress` property
*
@@ -232,11 +309,11 @@ class PreferencesController {
* @returns {Promise<array>} Promises the new array of AddedToken objects.
*
*/
- async addToken (rawAddress, symbol, decimals) {
+ async addToken (rawAddress, symbol, decimals, image) {
const address = normalizeAddress(rawAddress)
const newEntry = { address, symbol, decimals }
-
const tokens = this.store.getState().tokens
+ const assetImages = this.getAssetImages()
const previousEntry = tokens.find((token, index) => {
return token.address === address
})
@@ -247,7 +324,8 @@ class PreferencesController {
} else {
tokens.push(newEntry)
}
- this._updateAccountTokens(tokens)
+ assetImages[address] = image
+ this._updateAccountTokens(tokens, assetImages)
return Promise.resolve(tokens)
}
@@ -260,8 +338,10 @@ class PreferencesController {
*/
removeToken (rawAddress) {
const tokens = this.store.getState().tokens
+ const assetImages = this.getAssetImages()
const updatedTokens = tokens.filter(token => token.address !== rawAddress)
- this._updateAccountTokens(updatedTokens)
+ delete assetImages[rawAddress]
+ this._updateAccountTokens(updatedTokens, assetImages)
return Promise.resolve(updatedTokens)
}
@@ -322,7 +402,7 @@ class PreferencesController {
/**
* Returns an updated rpcList based on the passed url and the current list.
- * The returned list will have a max length of 2. If the _url currently exists it the list, it will be moved to the
+ * The returned list will have a max length of 3. If the _url currently exists it the list, it will be moved to the
* end of the list. The current list is modified and returned as a promise.
*
* @param {string} _url The rpc url to add to the frequentRpcList.
@@ -338,7 +418,7 @@ class PreferencesController {
if (_url !== 'http://localhost:8545') {
rpcList.push(_url)
}
- if (rpcList.length > 2) {
+ if (rpcList.length > 3) {
rpcList.shift()
}
return Promise.resolve(rpcList)
@@ -387,6 +467,7 @@ class PreferencesController {
//
// PRIVATE METHODS
//
+
/**
* Subscription to network provider type.
*
@@ -405,10 +486,10 @@ class PreferencesController {
* @param {array} tokens Array of tokens to be updated.
*
*/
- _updateAccountTokens (tokens) {
+ _updateAccountTokens (tokens, assetImages) {
const { accountTokens, providerType, selectedAddress } = this._getTokenRelatedStates()
accountTokens[selectedAddress][providerType] = tokens
- this.store.updateState({ accountTokens, tokens })
+ this.store.updateState({ accountTokens, tokens, assetImages })
}
/**
@@ -438,6 +519,47 @@ class PreferencesController {
const tokens = accountTokens[selectedAddress][providerType]
return { tokens, accountTokens, providerType, selectedAddress }
}
+
+ /**
+ * Handle the suggestion of an ERC20 asset through `watchAsset`
+ * *
+ * @param {Promise} promise Promise according to addition of ERC20 token
+ *
+ */
+ async _handleWatchAssetERC20 (options) {
+ const { address, symbol, decimals, image } = options
+ const rawAddress = address
+ try {
+ this._validateERC20AssetParams({ rawAddress, symbol, decimals })
+ } catch (err) {
+ return err
+ }
+ const tokenOpts = { rawAddress, decimals, symbol, image }
+ this.addSuggestedERC20Asset(tokenOpts)
+ return this.showWatchAssetUi().then(() => {
+ const tokenAddresses = this.getTokens().filter(token => token.address === normalizeAddress(rawAddress))
+ return tokenAddresses.length > 0
+ })
+ }
+
+ /**
+ * Validates that the passed options for suggested token have all required properties.
+ *
+ * @param {Object} opts The options object to validate
+ * @throws {string} Throw a custom error indicating that address, symbol and/or decimals
+ * doesn't fulfill requirements
+ *
+ */
+ _validateERC20AssetParams (opts) {
+ const { rawAddress, symbol, decimals } = opts
+ if (!rawAddress || !symbol || !decimals) throw new Error(`Cannot suggest token without address, symbol, and decimals`)
+ if (!(symbol.length < 6)) throw new Error(`Invalid symbol ${symbol} more than five characters`)
+ const numDecimals = parseInt(decimals, 10)
+ if (isNaN(numDecimals) || numDecimals > 36 || numDecimals < 0) {
+ throw new Error(`Invalid decimals ${decimals} must be at least 0, and not over 36`)
+ }
+ if (!isValidAddress(rawAddress)) throw new Error(`Invalid address ${rawAddress}`)
+ }
}
module.exports = PreferencesController
diff --git a/app/scripts/controllers/transactions/enums.js b/app/scripts/controllers/transactions/enums.js
new file mode 100644
index 000000000..be6f16e0d
--- /dev/null
+++ b/app/scripts/controllers/transactions/enums.js
@@ -0,0 +1,12 @@
+const TRANSACTION_TYPE_CANCEL = 'cancel'
+const TRANSACTION_TYPE_RETRY = 'retry'
+const TRANSACTION_TYPE_STANDARD = 'standard'
+
+const TRANSACTION_STATUS_APPROVED = 'approved'
+
+module.exports = {
+ TRANSACTION_TYPE_CANCEL,
+ TRANSACTION_TYPE_RETRY,
+ TRANSACTION_TYPE_STANDARD,
+ TRANSACTION_STATUS_APPROVED,
+}
diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js
index 5d7d6d6da..e2965ceb6 100644
--- a/app/scripts/controllers/transactions/index.js
+++ b/app/scripts/controllers/transactions/index.js
@@ -11,6 +11,14 @@ const txUtils = require('./lib/util')
const cleanErrorStack = require('../../lib/cleanErrorStack')
const log = require('loglevel')
const recipientBlacklistChecker = require('./lib/recipient-blacklist-checker')
+const {
+ TRANSACTION_TYPE_CANCEL,
+ TRANSACTION_TYPE_RETRY,
+ TRANSACTION_TYPE_STANDARD,
+ TRANSACTION_STATUS_APPROVED,
+} = require('./enums')
+
+const { hexToBn, bnToHex, BnMultiplyByFraction } = require('../../lib/util')
/**
Transaction Controller is an aggregate of sub-controllers and trackers
@@ -160,7 +168,10 @@ class TransactionController extends EventEmitter {
const normalizedTxParams = txUtils.normalizeTxParams(txParams)
txUtils.validateTxParams(normalizedTxParams)
// construct txMeta
- let txMeta = this.txStateManager.generateTxMeta({ txParams: normalizedTxParams })
+ let txMeta = this.txStateManager.generateTxMeta({
+ txParams: normalizedTxParams,
+ type: TRANSACTION_TYPE_STANDARD,
+ })
this.addTx(txMeta)
this.emit('newUnapprovedTx', txMeta)
@@ -214,6 +225,7 @@ class TransactionController extends EventEmitter {
txParams: originalTxMeta.txParams,
lastGasPrice,
loadingDefaults: false,
+ type: TRANSACTION_TYPE_RETRY,
})
this.addTx(txMeta)
this.emit('newUnapprovedTx', txMeta)
@@ -221,6 +233,40 @@ class TransactionController extends EventEmitter {
}
/**
+ * Creates a new approved transaction to attempt to cancel a previously submitted transaction. The
+ * new transaction contains the same nonce as the previous, is a basic ETH transfer of 0x value to
+ * the sender's address, and has a higher gasPrice than that of the previous transaction.
+ * @param {number} originalTxId - the id of the txMeta that you want to attempt to cancel
+ * @param {string=} customGasPrice - the hex value to use for the cancel transaction
+ * @returns {txMeta}
+ */
+ async createCancelTransaction (originalTxId, customGasPrice) {
+ const originalTxMeta = this.txStateManager.getTx(originalTxId)
+ const { txParams } = originalTxMeta
+ const { gasPrice: lastGasPrice, from, nonce } = txParams
+
+ const newGasPrice = customGasPrice || bnToHex(BnMultiplyByFraction(hexToBn(lastGasPrice), 11, 10))
+ const newTxMeta = this.txStateManager.generateTxMeta({
+ txParams: {
+ from,
+ to: from,
+ nonce,
+ gas: '0x5208',
+ value: '0x0',
+ gasPrice: newGasPrice,
+ },
+ lastGasPrice,
+ loadingDefaults: false,
+ status: TRANSACTION_STATUS_APPROVED,
+ type: TRANSACTION_TYPE_CANCEL,
+ })
+
+ this.addTx(newTxMeta)
+ await this.approveTransaction(newTxMeta.id)
+ return newTxMeta
+ }
+
+ /**
updates the txMeta in the txStateManager
@param txMeta {Object} - the updated txMeta
*/
@@ -393,7 +439,7 @@ class TransactionController extends EventEmitter {
})
this.txStateManager.getFilteredTxList({
- status: 'approved',
+ status: TRANSACTION_STATUS_APPROVED,
}).forEach((txMeta) => {
const txSignError = new Error('Transaction found as "approved" during boot - possibly stuck during signing')
this.txStateManager.setTxStatusFailed(txMeta.id, txSignError)
diff --git a/app/scripts/controllers/transactions/tx-state-manager.js b/app/scripts/controllers/transactions/tx-state-manager.js
index 28a18ca2e..daa6cc388 100644
--- a/app/scripts/controllers/transactions/tx-state-manager.js
+++ b/app/scripts/controllers/transactions/tx-state-manager.js
@@ -353,6 +353,7 @@ class TransactionStateManager extends EventEmitter {
const txMeta = this.getTx(txId)
txMeta.err = {
message: err.toString(),
+ rpc: err.value,
stack: err.stack,
}
this.updateTx(txMeta)
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index 1a170c617..d924be516 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -9,6 +9,11 @@ restoreContextAfterImports()
log.setDefaultLevel(process.env.METAMASK_DEBUG ? 'debug' : 'warn')
+console.warn('ATTENTION: In an effort to improve user privacy, MetaMask will ' +
+'stop exposing user accounts to dapps by default beginning November 2nd, 2018. ' +
+'Dapps should call provider.enable() in order to view and use accounts. Please see ' +
+'https://bit.ly/2QQHXvF for complete information and up-to-date example code.')
+
//
// setup plugin communication
//
@@ -22,6 +27,25 @@ var metamaskStream = new LocalMessageDuplexStream({
// compose the inpage provider
var inpageProvider = new MetamaskInpageProvider(metamaskStream)
+// Augment the provider with its enable method
+inpageProvider.enable = function (options = {}) {
+ return new Promise((resolve, reject) => {
+ if (options.mockRejection) {
+ reject('User rejected account access')
+ } else {
+ inpageProvider.sendAsync({ method: 'eth_accounts', params: [] }, (error, response) => {
+ if (error) {
+ reject(error)
+ } else {
+ resolve(response.result)
+ }
+ })
+ }
+ })
+}
+
+window.ethereum = inpageProvider
+
//
// setup web3
//
@@ -33,6 +57,7 @@ if (typeof window.web3 !== 'undefined') {
or MetaMask and another web3 extension. Please remove one
and try again.`)
}
+
var web3 = new Web3(inpageProvider)
web3.setProvider = function () {
log.debug('MetaMask - overrode web3.setProvider')
diff --git a/app/scripts/lib/account-tracker.js b/app/scripts/lib/account-tracker.js
index b7e2c7cbe..2e9340018 100644
--- a/app/scripts/lib/account-tracker.js
+++ b/app/scripts/lib/account-tracker.js
@@ -43,10 +43,27 @@ class AccountTracker {
this._provider = opts.provider
this._query = pify(new EthQuery(this._provider))
this._blockTracker = opts.blockTracker
- // subscribe to latest block
- this._blockTracker.on('latest', this._updateForBlock.bind(this))
// blockTracker.currentBlock may be null
this._currentBlockNumber = this._blockTracker.getCurrentBlock()
+ this._blockTracker.once('latest', blockNumber => {
+ this._currentBlockNumber = blockNumber
+ })
+ // bind function for easier listener syntax
+ this._updateForBlock = this._updateForBlock.bind(this)
+ }
+
+ start () {
+ // remove first to avoid double add
+ this._blockTracker.removeListener('latest', this._updateForBlock)
+ // add listener
+ this._blockTracker.addListener('latest', this._updateForBlock)
+ // fetch account balances
+ this._updateAccounts()
+ }
+
+ stop () {
+ // remove listener
+ this._blockTracker.removeListener('latest', this._updateForBlock)
}
/**
diff --git a/app/scripts/lib/auto-reload.js b/app/scripts/lib/auto-reload.js
index cce31c3d2..558391a06 100644
--- a/app/scripts/lib/auto-reload.js
+++ b/app/scripts/lib/auto-reload.js
@@ -2,18 +2,12 @@ module.exports = setupDappAutoReload
function setupDappAutoReload (web3, observable) {
// export web3 as a global, checking for usage
- let hasBeenWarned = false
let reloadInProgress = false
let lastTimeUsed
let lastSeenNetwork
global.web3 = new Proxy(web3, {
get: (_web3, key) => {
- // show warning once on web3 access
- if (!hasBeenWarned && key !== 'currentProvider') {
- console.warn('MetaMask: web3 will be deprecated in the near future in favor of the ethereumProvider \nhttps://github.com/MetaMask/faq/blob/master/detecting_metamask.md#web3-deprecation')
- hasBeenWarned = true
- }
// get the time of use
lastTimeUsed = Date.now()
// return value normally
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js
deleted file mode 100644
index 221746467..000000000
--- a/app/scripts/lib/config-manager.js
+++ /dev/null
@@ -1,254 +0,0 @@
-const ethUtil = require('ethereumjs-util')
-const normalize = require('eth-sig-util').normalize
-const {
- MAINNET_RPC_URL,
- ROPSTEN_RPC_URL,
- KOVAN_RPC_URL,
- RINKEBY_RPC_URL,
-} = require('../controllers/network/enums')
-
-/* The config-manager is a convenience object
- * wrapping a pojo-migrator.
- *
- * It exists mostly to allow the creation of
- * convenience methods to access and persist
- * particular portions of the state.
- */
-module.exports = ConfigManager
-function ConfigManager (opts) {
- // ConfigManager is observable and will emit updates
- this._subs = []
- this.store = opts.store
-}
-
-ConfigManager.prototype.setConfig = function (config) {
- var data = this.getData()
- data.config = config
- this.setData(data)
- this._emitUpdates(config)
-}
-
-ConfigManager.prototype.getConfig = function () {
- var data = this.getData()
- return data.config
-}
-
-ConfigManager.prototype.setData = function (data) {
- this.store.putState(data)
-}
-
-ConfigManager.prototype.getData = function () {
- return this.store.getState()
-}
-
-ConfigManager.prototype.setPasswordForgotten = function (passwordForgottenState) {
- const data = this.getData()
- data.forgottenPassword = passwordForgottenState
- this.setData(data)
-}
-
-ConfigManager.prototype.getPasswordForgotten = function (passwordForgottenState) {
- const data = this.getData()
- return data.forgottenPassword
-}
-
-ConfigManager.prototype.setWallet = function (wallet) {
- var data = this.getData()
- data.wallet = wallet
- this.setData(data)
-}
-
-ConfigManager.prototype.setVault = function (encryptedString) {
- var data = this.getData()
- data.vault = encryptedString
- this.setData(data)
-}
-
-ConfigManager.prototype.getVault = function () {
- var data = this.getData()
- return data.vault
-}
-
-ConfigManager.prototype.getKeychains = function () {
- return this.getData().keychains || []
-}
-
-ConfigManager.prototype.setKeychains = function (keychains) {
- var data = this.getData()
- data.keychains = keychains
- this.setData(data)
-}
-
-ConfigManager.prototype.getSelectedAccount = function () {
- var config = this.getConfig()
- return config.selectedAccount
-}
-
-ConfigManager.prototype.setSelectedAccount = function (address) {
- var config = this.getConfig()
- config.selectedAccount = ethUtil.addHexPrefix(address)
- this.setConfig(config)
-}
-
-ConfigManager.prototype.getWallet = function () {
- return this.getData().wallet
-}
-
-// Takes a boolean
-ConfigManager.prototype.setShowSeedWords = function (should) {
- var data = this.getData()
- data.showSeedWords = should
- this.setData(data)
-}
-
-
-ConfigManager.prototype.getShouldShowSeedWords = function () {
- var data = this.getData()
- return data.showSeedWords
-}
-
-ConfigManager.prototype.setSeedWords = function (words) {
- var data = this.getData()
- data.seedWords = words
- this.setData(data)
-}
-
-ConfigManager.prototype.getSeedWords = function () {
- var data = this.getData()
- return data.seedWords
-}
-ConfigManager.prototype.setRpcTarget = function (rpcUrl) {
- var config = this.getConfig()
- config.provider = {
- type: 'rpc',
- rpcTarget: rpcUrl,
- }
- this.setConfig(config)
-}
-
-ConfigManager.prototype.setProviderType = function (type) {
- var config = this.getConfig()
- config.provider = {
- type: type,
- }
- this.setConfig(config)
-}
-
-ConfigManager.prototype.useEtherscanProvider = function () {
- var config = this.getConfig()
- config.provider = {
- type: 'etherscan',
- }
- this.setConfig(config)
-}
-
-ConfigManager.prototype.getProvider = function () {
- var config = this.getConfig()
- return config.provider
-}
-
-ConfigManager.prototype.getCurrentRpcAddress = function () {
- var provider = this.getProvider()
- if (!provider) return null
- switch (provider.type) {
-
- case 'mainnet':
- return MAINNET_RPC_URL
-
- case 'ropsten':
- return ROPSTEN_RPC_URL
-
- case 'kovan':
- return KOVAN_RPC_URL
-
- case 'rinkeby':
- return RINKEBY_RPC_URL
-
- default:
- return provider && provider.rpcTarget ? provider.rpcTarget : RINKEBY_RPC_URL
- }
-}
-
-//
-// Tx
-//
-
-ConfigManager.prototype.getTxList = function () {
- var data = this.getData()
- if (data.transactions !== undefined) {
- return data.transactions
- } else {
- return []
- }
-}
-
-ConfigManager.prototype.setTxList = function (txList) {
- var data = this.getData()
- data.transactions = txList
- this.setData(data)
-}
-
-
-// wallet nickname methods
-
-ConfigManager.prototype.getWalletNicknames = function () {
- var data = this.getData()
- const nicknames = ('walletNicknames' in data) ? data.walletNicknames : {}
- return nicknames
-}
-
-ConfigManager.prototype.nicknameForWallet = function (account) {
- const address = normalize(account)
- const nicknames = this.getWalletNicknames()
- return nicknames[address]
-}
-
-ConfigManager.prototype.setNicknameForWallet = function (account, nickname) {
- const address = normalize(account)
- const nicknames = this.getWalletNicknames()
- nicknames[address] = nickname
- var data = this.getData()
- data.walletNicknames = nicknames
- this.setData(data)
-}
-
-// observable
-
-ConfigManager.prototype.getSalt = function () {
- var data = this.getData()
- return data.salt
-}
-
-ConfigManager.prototype.setSalt = function (salt) {
- var data = this.getData()
- data.salt = salt
- this.setData(data)
-}
-
-ConfigManager.prototype.subscribe = function (fn) {
- this._subs.push(fn)
- var unsubscribe = this.unsubscribe.bind(this, fn)
- return unsubscribe
-}
-
-ConfigManager.prototype.unsubscribe = function (fn) {
- var index = this._subs.indexOf(fn)
- if (index !== -1) this._subs.splice(index, 1)
-}
-
-ConfigManager.prototype._emitUpdates = function (state) {
- this._subs.forEach(function (handler) {
- handler(state)
- })
-}
-
-ConfigManager.prototype.setLostAccounts = function (lostAccounts) {
- var data = this.getData()
- data.lostAccounts = lostAccounts
- this.setData(data)
-}
-
-ConfigManager.prototype.getLostAccounts = function () {
- var data = this.getData()
- return data.lostAccounts || []
-}
diff --git a/app/scripts/lib/ipfsContent.js b/app/scripts/lib/ipfsContent.js
index 5db63f47d..62a808b90 100644
--- a/app/scripts/lib/ipfsContent.js
+++ b/app/scripts/lib/ipfsContent.js
@@ -5,6 +5,8 @@ module.exports = function (provider) {
function ipfsContent (details) {
const name = details.url.substring(7, details.url.length - 1)
let clearTime = null
+ if (/^.+\.eth$/.test(name) === false) return
+
extension.tabs.query({active: true}, tab => {
extension.tabs.update(tab.id, { url: 'loading.html' })
@@ -34,7 +36,7 @@ module.exports = function (provider) {
return { cancel: true }
}
- extension.webRequest.onErrorOccurred.addListener(ipfsContent, {urls: ['*://*.eth/', '*://*.test/']})
+ extension.webRequest.onErrorOccurred.addListener(ipfsContent, {urls: ['*://*.eth/']})
return {
remove () {
diff --git a/app/scripts/lib/typed-message-manager.js b/app/scripts/lib/typed-message-manager.js
index e5e1c94b3..b10145f3b 100644
--- a/app/scripts/lib/typed-message-manager.js
+++ b/app/scripts/lib/typed-message-manager.js
@@ -4,6 +4,7 @@ const createId = require('./random-id')
const assert = require('assert')
const sigUtil = require('eth-sig-util')
const log = require('loglevel')
+const jsonschema = require('jsonschema')
/**
* Represents, and contains data about, an 'eth_signTypedData' type signature request. These are created when a
@@ -17,7 +18,7 @@ const log = require('loglevel')
* @property {Object} msgParams.from The address that is making the signature request.
* @property {string} msgParams.data A hex string conversion of the raw buffer data of the signature request
* @property {number} time The epoch time at which the this message was created
- * @property {string} status Indicates whether the signature request is 'unapproved', 'approved', 'signed' or 'rejected'
+ * @property {string} status Indicates whether the signature request is 'unapproved', 'approved', 'signed', 'rejected', or 'errored'
* @property {string} type The json-prc signing method for which a signature request has been made. A 'Message' will
* always have a 'eth_signTypedData' type.
*
@@ -26,17 +27,10 @@ const log = require('loglevel')
module.exports = class TypedMessageManager extends EventEmitter {
/**
* Controller in charge of managing - storing, adding, removing, updating - TypedMessage.
- *
- * @typedef {Object} TypedMessage
- * @param {Object} opts @deprecated
- * @property {Object} memStore The observable store where TypedMessage are saved.
- * @property {Object} memStore.unapprovedTypedMessages A collection of all TypedMessages in the 'unapproved' state
- * @property {number} memStore.unapprovedTypedMessagesCount The count of all TypedMessages in this.memStore.unapprobedMsgs
- * @property {array} messages Holds all messages that have been created by this TypedMessage
- *
*/
- constructor (opts) {
+ constructor ({ networkController }) {
super()
+ this.networkController = networkController
this.memStore = new ObservableStore({
unapprovedTypedMessages: {},
unapprovedTypedMessagesCount: 0,
@@ -76,15 +70,17 @@ module.exports = class TypedMessageManager extends EventEmitter {
* @returns {promise} When the message has been signed or rejected
*
*/
- addUnapprovedMessageAsync (msgParams, req) {
+ addUnapprovedMessageAsync (msgParams, req, version) {
return new Promise((resolve, reject) => {
- const msgId = this.addUnapprovedMessage(msgParams, req)
+ const msgId = this.addUnapprovedMessage(msgParams, req, version)
this.once(`${msgId}:finished`, (data) => {
switch (data.status) {
case 'signed':
return resolve(data.rawSig)
case 'rejected':
return reject(new Error('MetaMask Message Signature: User denied message signature.'))
+ case 'errored':
+ return reject(new Error(`MetaMask Message Signature: ${data.error}`))
default:
return reject(new Error(`MetaMask Message Signature: Unknown problem: ${JSON.stringify(msgParams)}`))
}
@@ -102,7 +98,8 @@ module.exports = class TypedMessageManager extends EventEmitter {
* @returns {number} The id of the newly created TypedMessage.
*
*/
- addUnapprovedMessage (msgParams, req) {
+ addUnapprovedMessage (msgParams, req, version) {
+ msgParams.version = version
this.validateParams(msgParams)
// add origin from request
if (req) msgParams.origin = req.origin
@@ -132,14 +129,33 @@ module.exports = class TypedMessageManager extends EventEmitter {
*
*/
validateParams (params) {
- assert.equal(typeof params, 'object', 'Params should ben an object.')
- assert.ok('data' in params, 'Params must include a data field.')
- assert.ok('from' in params, 'Params must include a from field.')
- assert.ok(Array.isArray(params.data), 'Data should be an array.')
- assert.equal(typeof params.from, 'string', 'From field must be a string.')
- assert.doesNotThrow(() => {
- sigUtil.typedSignatureHash(params.data)
- }, 'Expected EIP712 typed data')
+ switch (params.version) {
+ case 'V1':
+ assert.equal(typeof params, 'object', 'Params should ben an object.')
+ assert.ok('data' in params, 'Params must include a data field.')
+ assert.ok('from' in params, 'Params must include a from field.')
+ assert.ok(Array.isArray(params.data), 'Data should be an array.')
+ assert.equal(typeof params.from, 'string', 'From field must be a string.')
+ assert.doesNotThrow(() => {
+ sigUtil.typedSignatureHash(params.data)
+ }, 'Expected EIP712 typed data')
+ break
+ case 'V3':
+ let data
+ assert.equal(typeof params, 'object', 'Params should be an object.')
+ assert.ok('data' in params, 'Params must include a data field.')
+ assert.ok('from' in params, 'Params must include a from field.')
+ assert.equal(typeof params.from, 'string', 'From field must be a string.')
+ assert.equal(typeof params.data, 'string', 'Data must be passed as a valid JSON string.')
+ assert.doesNotThrow(() => { data = JSON.parse(params.data) }, 'Data must be passed as a valid JSON string.')
+ const validation = jsonschema.validate(data, sigUtil.TYPED_MESSAGE_SCHEMA)
+ assert.ok(data.primaryType in data.types, `Primary type of "${data.primaryType}" has no type definition.`)
+ assert.equal(validation.errors.length, 0, 'Data must conform to EIP-712 schema. See https://git.io/fNtcx.')
+ const chainId = data.domain.chainId
+ const activeChainId = parseInt(this.networkController.getNetworkState())
+ chainId && assert.equal(chainId, activeChainId, `Provided chainId (${chainId}) must match the active chainId (${activeChainId})`)
+ break
+ }
}
/**
@@ -214,6 +230,7 @@ module.exports = class TypedMessageManager extends EventEmitter {
*/
prepMsgForSigning (msgParams) {
delete msgParams.metamaskId
+ delete msgParams.version
return Promise.resolve(msgParams)
}
@@ -227,6 +244,19 @@ module.exports = class TypedMessageManager extends EventEmitter {
this._setMsgStatus(msgId, 'rejected')
}
+ /**
+ * Sets a TypedMessage status to 'errored' via a call to this._setMsgStatus.
+ *
+ * @param {number} msgId The id of the TypedMessage to error
+ *
+ */
+ errorMessage (msgId, error) {
+ const msg = this.getMsg(msgId)
+ msg.error = error
+ this._updateMsg(msg)
+ this._setMsgStatus(msgId, 'errored')
+ }
+
//
// PRIVATE METHODS
//
@@ -250,7 +280,7 @@ module.exports = class TypedMessageManager extends EventEmitter {
msg.status = status
this._updateMsg(msg)
this.emit(`${msgId}:${status}`, msg)
- if (status === 'rejected' || status === 'signed') {
+ if (status === 'rejected' || status === 'signed' || status === 'errored') {
this.emit(`${msgId}:finished`, msg)
}
}
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 1e2df6368..4cf7567d4 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -36,7 +36,6 @@ 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')
const getBuyEthUrl = require('./lib/buy-eth-url')
@@ -50,6 +49,8 @@ const log = require('loglevel')
const TrezorKeyring = require('eth-trezor-keyring')
const LedgerBridgeKeyring = require('eth-ledger-bridge-keyring')
const EthQuery = require('eth-query')
+const ethUtil = require('ethereumjs-util')
+const sigUtil = require('eth-sig-util')
module.exports = class MetamaskController extends EventEmitter {
@@ -67,6 +68,10 @@ module.exports = class MetamaskController extends EventEmitter {
const initState = opts.initState || {}
this.recordFirstTimeInfo(initState)
+ // this keeps track of how many "controllerStream" connections are open
+ // the only thing that uses controller connections are open metamask UI instances
+ this.activeControllerConnections = 0
+
// platform-specific api
this.platform = opts.platform
@@ -79,15 +84,11 @@ module.exports = class MetamaskController extends EventEmitter {
// network store
this.networkController = new NetworkController(initState.NetworkController)
- // config manager
- this.configManager = new ConfigManager({
- store: this.store,
- })
-
// preferences controller
this.preferencesController = new PreferencesController({
initState: initState.PreferencesController,
initLangCode: opts.initLangCode,
+ showWatchAssetUi: opts.showWatchAssetUi,
network: this.networkController,
})
@@ -127,11 +128,21 @@ module.exports = class MetamaskController extends EventEmitter {
provider: this.provider,
blockTracker: this.blockTracker,
})
+
+ // start and stop polling for balances based on activeControllerConnections
+ this.on('controllerConnectionChanged', (activeControllerConnections) => {
+ if (activeControllerConnections > 0) {
+ this.accountTracker.start()
+ } else {
+ this.accountTracker.stop()
+ }
+ })
+
// ensure accountTracker updates balances after network change
this.networkController.on('networkDidChange', () => {
this.accountTracker._updateAccounts()
})
-
+
// key mgmt
const additionalKeyrings = [TrezorKeyring, LedgerBridgeKeyring]
this.keyringController = new KeyringController({
@@ -141,19 +152,7 @@ module.exports = class MetamaskController extends EventEmitter {
encryptor: opts.encryptor || undefined,
})
- // If only one account exists, make sure it is selected.
- this.keyringController.memStore.subscribe((state) => {
- const addresses = state.keyrings.reduce((res, keyring) => {
- return res.concat(keyring.accounts)
- }, [])
- if (addresses.length === 1) {
- const address = addresses[0]
- this.preferencesController.setSelectedAddress(address)
- }
- // ensure preferences + identities controller know about all addresses
- this.preferencesController.addAddresses(addresses)
- this.accountTracker.syncWithAddresses(addresses)
- })
+ this.keyringController.memStore.subscribe((s) => this._onKeyringControllerUpdate(s))
// detect tokens controller
this.detectTokensController = new DetectTokensController({
@@ -180,7 +179,7 @@ module.exports = class MetamaskController extends EventEmitter {
blockTracker: this.blockTracker,
getGasPrice: this.getGasPrice.bind(this),
})
- this.txController.on('newUnapprovedTx', opts.showUnapprovedTx.bind(opts))
+ this.txController.on('newUnapprovedTx', () => opts.showUnapprovedTx())
this.txController.on(`tx:status-update`, (txId, status) => {
if (status === 'confirmed' || status === 'failed') {
@@ -214,7 +213,7 @@ module.exports = class MetamaskController extends EventEmitter {
this.networkController.lookupNetwork()
this.messageManager = new MessageManager()
this.personalMessageManager = new PersonalMessageManager()
- this.typedMessageManager = new TypedMessageManager()
+ this.typedMessageManager = new TypedMessageManager({ networkController: this.networkController })
this.publicConfigStore = this.initPublicConfigStore()
this.store.updateStructure({
@@ -259,6 +258,7 @@ module.exports = class MetamaskController extends EventEmitter {
eth_syncing: false,
web3_clientVersion: `MetaMask/v${version}`,
},
+ version,
// account mgmt
getAccounts: async () => {
const isUnlocked = this.keyringController.memStore.getState().isUnlocked
@@ -275,7 +275,7 @@ module.exports = class MetamaskController extends EventEmitter {
// msg signing
processEthSignMessage: this.newUnsignedMessage.bind(this),
processPersonalMessage: this.newUnsignedPersonalMessage.bind(this),
- processTypedMessage: this.newUnsignedTypedMessage.bind(this),
+ getPendingNonce: this.getPendingNonce.bind(this),
}
const providerProxy = this.networkController.initializeProvider(providerOpts)
return providerProxy
@@ -317,18 +317,15 @@ module.exports = class MetamaskController extends EventEmitter {
* @returns {Object} status
*/
getState () {
- const wallet = this.configManager.getWallet()
const vault = this.keyringController.store.getState().vault
- const isInitialized = (!!wallet || !!vault)
+ const isInitialized = !!vault
return {
...{ isInitialized },
...this.memStore.getFlatState(),
- ...this.configManager.getConfig(),
...{
- lostAccounts: this.configManager.getLostAccounts(),
- seedWords: this.configManager.getSeedWords(),
- forgottenPassword: this.configManager.getPasswordForgotten(),
+ // TODO: Remove usages of lost accounts
+ lostAccounts: [],
},
}
}
@@ -390,6 +387,7 @@ module.exports = class MetamaskController extends EventEmitter {
setSelectedAddress: nodeify(preferencesController.setSelectedAddress, preferencesController),
addToken: nodeify(preferencesController.addToken, preferencesController),
removeToken: nodeify(preferencesController.removeToken, preferencesController),
+ removeSuggestedTokens: nodeify(preferencesController.removeSuggestedTokens, preferencesController),
setCurrentAccountTab: nodeify(preferencesController.setCurrentAccountTab, preferencesController),
setAccountLabel: nodeify(preferencesController.setAccountLabel, preferencesController),
setFeatureFlag: nodeify(preferencesController.setFeatureFlag, preferencesController),
@@ -409,6 +407,7 @@ module.exports = class MetamaskController extends EventEmitter {
updateTransaction: nodeify(txController.updateTransaction, txController),
updateAndApproveTransaction: nodeify(txController.updateAndApproveTransaction, txController),
retryTransaction: nodeify(this.retryTransaction, this),
+ createCancelTransaction: nodeify(this.createCancelTransaction, this),
getFilteredTxList: nodeify(txController.getFilteredTxList, txController),
isNonceTaken: nodeify(txController.isNonceTaken, txController),
estimateGas: nodeify(this.estimateGas, this),
@@ -728,7 +727,7 @@ module.exports = class MetamaskController extends EventEmitter {
this.verifySeedPhrase()
.then((seedWords) => {
- this.configManager.setSeedWords(seedWords)
+ this.preferencesController.setSeedWords(seedWords)
return cb(null, seedWords)
})
.catch((err) => {
@@ -777,7 +776,7 @@ module.exports = class MetamaskController extends EventEmitter {
* @param {function} cb Callback function called with the current address.
*/
clearSeedWordCache (cb) {
- this.configManager.setSeedWords(null)
+ this.preferencesController.setSeedWords(null)
cb(null, this.preferencesController.getSelectedAddress())
}
@@ -985,22 +984,31 @@ module.exports = class MetamaskController extends EventEmitter {
* @param {Object} msgParams - The params passed to eth_signTypedData.
* @returns {Object} Full state update.
*/
- signTypedMessage (msgParams) {
- log.info('MetaMaskController - signTypedMessage')
+ async signTypedMessage (msgParams) {
+ log.info('MetaMaskController - eth_signTypedData')
const msgId = msgParams.metamaskId
- // sets the status op the message to 'approved'
- // and removes the metamaskId for signing
- return this.typedMessageManager.approveMessage(msgParams)
- .then((cleanMsgParams) => {
- // signs the message
- return this.keyringController.signTypedMessage(cleanMsgParams)
- })
- .then((rawSig) => {
- // tells the listener that the message has been signed
- // and can be returned to the dapp
- this.typedMessageManager.setMsgStatusSigned(msgId, rawSig)
- return this.getState()
- })
+ const version = msgParams.version
+ try {
+ const cleanMsgParams = await this.typedMessageManager.approveMessage(msgParams)
+ const address = sigUtil.normalize(cleanMsgParams.from)
+ const keyring = await this.keyringController.getKeyringForAccount(address)
+ const wallet = keyring._getWalletForAccount(address)
+ const privKey = ethUtil.toBuffer(wallet.getPrivateKey())
+ let signature
+ switch (version) {
+ case 'V1':
+ signature = sigUtil.signTypedDataLegacy(privKey, { data: cleanMsgParams.data })
+ break
+ case 'V3':
+ signature = sigUtil.signTypedData(privKey, { data: JSON.parse(cleanMsgParams.data) })
+ break
+ }
+ this.typedMessageManager.setMsgStatusSigned(msgId, signature)
+ return this.getState()
+ } catch (error) {
+ log.info('MetaMaskController - eth_signTypedData failed.', error)
+ this.typedMessageManager.errorMessage(msgId, error)
+ }
}
/**
@@ -1038,36 +1046,17 @@ module.exports = class MetamaskController extends EventEmitter {
/**
* A legacy method used to record user confirmation that they understand
* that some of their accounts have been recovered but should be backed up.
+ * This function no longer does anything and will be removed.
*
* @deprecated
* @param {Function} cb - A callback function called with a full state update.
*/
markAccountsFound (cb) {
- this.configManager.setLostAccounts([])
- this.sendUpdate()
+ // TODO Remove me
cb(null, this.getState())
}
/**
- * A legacy method (probably dead code) that was used when we swapped out our
- * key management library that we depended on.
- *
- * Described in:
- * https://medium.com/metamask/metamask-3-migration-guide-914b79533cdd
- *
- * @deprecated
- * @param {} migratorOutput
- */
- restoreOldLostAccounts (migratorOutput) {
- const { lostAccounts } = migratorOutput
- if (lostAccounts) {
- this.configManager.setLostAccounts(lostAccounts.map(acct => acct.address))
- return this.importLostAccounts(migratorOutput)
- }
- return Promise.resolve(migratorOutput)
- }
-
- /**
* An account object
* @typedef Account
* @property string privateKey - The private key of the account.
@@ -1111,6 +1100,19 @@ module.exports = class MetamaskController extends EventEmitter {
return state
}
+ /**
+ * Allows a user to attempt to cancel a previously submitted transaction by creating a new
+ * transaction.
+ * @param {number} originalTxId - the id of the txMeta that you want to attempt to cancel
+ * @param {string=} customGasPrice - the hex value to use for the cancel transaction
+ * @returns {object} MetaMask state
+ */
+ async createCancelTransaction (originalTxId, customGasPrice, cb) {
+ await this.txController.createCancelTransaction(originalTxId, customGasPrice)
+ const state = await this.getState()
+ return state
+ }
+
estimateGas (estimateGasParams) {
return new Promise((resolve, reject) => {
return this.txController.txGasUtil.query.estimateGas(estimateGasParams, (err, res) => {
@@ -1132,7 +1134,7 @@ module.exports = class MetamaskController extends EventEmitter {
* @param {Function} cb - A callback function called when complete.
*/
markPasswordForgotten (cb) {
- this.configManager.setPasswordForgotten(true)
+ this.preferencesController.setPasswordForgotten(true)
this.sendUpdate()
cb()
}
@@ -1142,7 +1144,7 @@ module.exports = class MetamaskController extends EventEmitter {
* @param {Function} cb - A callback function called when complete.
*/
unMarkPasswordForgotten (cb) {
- this.configManager.setPasswordForgotten(false)
+ this.preferencesController.setPasswordForgotten(false)
this.sendUpdate()
cb()
}
@@ -1213,18 +1215,28 @@ module.exports = class MetamaskController extends EventEmitter {
setupControllerConnection (outStream) {
const api = this.getApi()
const dnode = Dnode(api)
+ // report new active controller connection
+ this.activeControllerConnections++
+ this.emit('controllerConnectionChanged', this.activeControllerConnections)
+ // connect dnode api to remote connection
pump(
outStream,
dnode,
outStream,
(err) => {
+ // report new active controller connection
+ this.activeControllerConnections--
+ this.emit('controllerConnectionChanged', this.activeControllerConnections)
+ // report any error
if (err) log.error(err)
}
)
dnode.on('remote', (remote) => {
// push updates to popup
- const sendUpdate = remote.sendUpdate.bind(remote)
+ const sendUpdate = (update) => remote.sendUpdate(update)
this.on('update', sendUpdate)
+ // remove update listener once the connection ends
+ dnode.on('end', () => this.removeListener('update', sendUpdate))
})
}
@@ -1246,6 +1258,10 @@ module.exports = class MetamaskController extends EventEmitter {
engine.push(createOriginMiddleware({ origin }))
engine.push(createLoggerMiddleware({ origin }))
engine.push(filterMiddleware)
+ engine.push(this.preferencesController.requestWatchAsset.bind(this.preferencesController))
+ engine.push(this.createTypedDataMiddleware('eth_signTypedData', 'V1').bind(this))
+ engine.push(this.createTypedDataMiddleware('eth_signTypedData_v1', 'V1').bind(this))
+ engine.push(this.createTypedDataMiddleware('eth_signTypedData_v3', 'V3', true).bind(this))
engine.push(createProviderMiddleware({ provider: this.provider }))
// setup connection
@@ -1273,16 +1289,46 @@ module.exports = class MetamaskController extends EventEmitter {
* @param {*} outStream - The stream to provide public config over.
*/
setupPublicConfig (outStream) {
+ const configStream = asStream(this.publicConfigStore)
pump(
- asStream(this.publicConfigStore),
+ configStream,
outStream,
(err) => {
+ configStream.destroy()
if (err) log.error(err)
}
)
}
/**
+ * Handle a KeyringController update
+ * @param {object} state the KC state
+ * @return {Promise<void>}
+ * @private
+ */
+ async _onKeyringControllerUpdate (state) {
+ const {isUnlocked, keyrings} = state
+ const addresses = keyrings.reduce((acc, {accounts}) => acc.concat(accounts), [])
+
+ if (!addresses.length) {
+ return
+ }
+
+ // Ensure preferences + identities controller know about all addresses
+ this.preferencesController.addAddresses(addresses)
+ this.accountTracker.syncWithAddresses(addresses)
+
+ const wasLocked = !isUnlocked
+ if (wasLocked) {
+ const oldSelectedAddress = this.preferencesController.getSelectedAddress()
+ if (!addresses.includes(oldSelectedAddress)) {
+ const address = addresses[0]
+ await this.preferencesController.setSelectedAddress(address)
+ }
+ }
+ }
+
+ /**
* A method for emitting the full MetaMask state to all registered listeners.
* @private
*/
@@ -1324,6 +1370,19 @@ module.exports = class MetamaskController extends EventEmitter {
return '0x' + percentileNumBn.mul(GWEI_BN).toString(16)
}
+ /**
+ * Returns the nonce that will be associated with a transaction once approved
+ * @param address {string} - The hex string address for the transaction
+ * @returns Promise<number>
+ */
+ async getPendingNonce (address) {
+ const { nonceDetails, releaseLock} = await this.txController.nonceTracker.getNonceLock(address)
+ const pendingNonce = nonceDetails.params.highestSuggested
+
+ releaseLock()
+ return pendingNonce
+ }
+
//=============================================================================
// CONFIG
//=============================================================================
@@ -1428,6 +1487,7 @@ module.exports = class MetamaskController extends EventEmitter {
}
}
+ // TODO: Replace isClientOpen methods with `controllerConnectionChanged` events.
/**
* A method for recording whether the MetaMask user interface is open or not.
* @private
@@ -1448,4 +1508,34 @@ module.exports = class MetamaskController extends EventEmitter {
set isClientOpenAndUnlocked (active) {
this.tokenRatesController.isActive = active
}
+
+ /**
+ * Creates RPC engine middleware for processing eth_signTypedData requests
+ *
+ * @param {Object} req - request object
+ * @param {Object} res - response object
+ * @param {Function} - next
+ * @param {Function} - end
+ */
+ createTypedDataMiddleware (methodName, version, reverse) {
+ return async (req, res, next, end) => {
+ const { method, params } = req
+ if (method === methodName) {
+ const promise = this.typedMessageManager.addUnapprovedMessageAsync({
+ data: reverse ? params[1] : params[0],
+ from: reverse ? params[0] : params[1],
+ }, req, version)
+ this.sendUpdate()
+ this.opts.showUnconfirmedMessage()
+ try {
+ res.result = await promise
+ end()
+ } catch (error) {
+ end(error)
+ }
+ } else {
+ next()
+ }
+ }
+ }
}
diff --git a/app/scripts/migrations/_multi-keyring.js b/app/scripts/migrations/_multi-keyring.js
deleted file mode 100644
index 7a4578ea7..000000000
--- a/app/scripts/migrations/_multi-keyring.js
+++ /dev/null
@@ -1,50 +0,0 @@
-const version = 5
-
-/*
-
-This is an incomplete migration bc it requires post-decrypted data
-which we dont have access to at the time of this writing.
-
-*/
-
-const ObservableStore = require('obs-store')
-const ConfigManager = require('../../app/scripts/lib/config-manager')
-const IdentityStoreMigrator = require('../../app/scripts/lib/idStore-migrator')
-const KeyringController = require('eth-keyring-controller')
-
-const password = 'obviously not correct'
-
-module.exports = {
- version,
-
- migrate: function (versionedData) {
- versionedData.meta.version = version
-
- const store = new ObservableStore(versionedData.data)
- const configManager = new ConfigManager({ store })
- const idStoreMigrator = new IdentityStoreMigrator({ configManager })
- const keyringController = new KeyringController({
- configManager: configManager,
- })
-
- // attempt to migrate to multiVault
- return idStoreMigrator.migratedVaultForPassword(password)
- .then((result) => {
- // skip if nothing to migrate
- if (!result) return Promise.resolve(versionedData)
- delete versionedData.data.wallet
- // create new keyrings
- const privKeys = result.lostAccounts.map(acct => acct.privateKey)
- return Promise.all([
- keyringController.restoreKeyring(result.serialized),
- keyringController.restoreKeyring({ type: 'Simple Key Pair', data: privKeys }),
- ]).then(() => {
- return keyringController.persistAllKeyrings(password)
- }).then(() => {
- // copy result on to state object
- versionedData.data = store.get()
- return Promise.resolve(versionedData)
- })
- })
- },
-}
diff --git a/app/scripts/notice-controller.js b/app/scripts/notice-controller.js
index 2def4371e..ce686d9d1 100644
--- a/app/scripts/notice-controller.js
+++ b/app/scripts/notice-controller.js
@@ -7,7 +7,7 @@ const uniqBy = require('lodash.uniqby')
module.exports = class NoticeController extends EventEmitter {
- constructor (opts) {
+ constructor (opts = {}) {
super()
this.noticePoller = null
this.firstVersion = opts.firstVersion
diff --git a/app/scripts/phishing-detect.js b/app/scripts/phishing-detect.js
new file mode 100644
index 000000000..4168b6618
--- /dev/null
+++ b/app/scripts/phishing-detect.js
@@ -0,0 +1,5 @@
+window.onload = function() {
+ if (window.location.pathname === '/phishing.html') {
+ document.getElementById('esdbLink').innerHTML = '<b>To read more about this scam, navigate to: <a href="https://etherscamdb.info/domain/' + window.location.hash.substring(1) + '"> https://etherscamdb.info/domain/' + window.location.hash.substring(1) + '</a></b>'
+ }
+}