Merge branch 'master' into i18n-helper

This commit is contained in:
kumavis 2018-04-02 10:47:24 -07:00 committed by GitHub
commit 6d5f1392a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
111 changed files with 2520 additions and 1212 deletions

View File

@ -98,6 +98,32 @@ jobs:
key: build-cache-{{ .Revision }} key: build-cache-{{ .Revision }}
paths: paths:
- dist - dist
- store_artifacts:
path: dist/mascara
destination: builds/mascara
- store_artifacts:
path: builds
destination: builds
- run:
name: build:announce
command: |
CIRCLE_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}"
SHORT_SHA1=$(echo $CIRCLE_SHA1 | cut -c 1-7)
BUILD_LINK_BASE="https://$CIRCLE_BUILD_NUM-42009758-gh.circle-artifacts.com/0/builds"
VERSION=$(node -p 'require("./dist/chrome/manifest.json").version')
MASCARA="$BUILD_LINK_BASE/mascara/home.html"
CHROME="$BUILD_LINK_BASE/metamask-chrome-$VERSION.zip"
FIREFOX="$BUILD_LINK_BASE/metamask-firefox-$VERSION.zip"
OPERA="$BUILD_LINK_BASE/metamask-opera-$VERSION.zip"
EDGE="$BUILD_LINK_BASE/metamask-edge-$VERSION.zip"
COMMENT_MAIN="Builds ready [$SHORT_SHA1]: [mascara][mascara], [chrome][chrome], [firefox][firefox], [edge][edge], [opera][opera]"
COMMENT_LINKS="[mascara]:$MASCARA\n[chrome]:$CHROME\n[firefox]:$FIREFOX\n[opera]:$OPERA\n[edge]:$EDGE\n"
COMMENT_BODY="$COMMENT_MAIN\n\n$COMMENT_LINKS"
JSON_PAYLOAD="{\"body\":\"$COMMENT_BODY\"}"
POST_COMMENT_URI="https://api.github.com/repos/metamask/metamask-extension/issues/$CIRCLE_PR_NUMBER/comments"
echo "Announcement:\n$COMMENT_BODY"
echo "Posting to $POST_COMMENT_URI"
curl -d "$JSON_PAYLOAD" -H "Authorization: token $GITHUB_COMMENT_TOKEN" $POST_COMMENT_URI
prep-scss: prep-scss:
docker: docker:
@ -141,6 +167,9 @@ jobs:
- run: - run:
name: Test name: Test
command: npm run test:e2e command: npm run test:e2e
- store_artifacts:
path: test-artifacts
destination: test-artifacts
test-unit: test-unit:
docker: docker:

2
.gitignore vendored
View File

@ -28,6 +28,8 @@ test/background.js
test/bundle.js test/bundle.js
test/test-bundle.js test/test-bundle.js
test-artifacts
#ignore css output and sourcemaps #ignore css output and sourcemaps
ui/app/css/output/ ui/app/css/output/

View File

@ -3,6 +3,8 @@
## Current Master ## Current Master
- Fix bug where the "Reset account" feature would not clear the network cache. - Fix bug where the "Reset account" feature would not clear the network cache.
- Increase maximum gas limit, to allow very gas heavy transactions, since block gas limits have been stable.
- Allow user to select language on settings page
## 4.4.0 Mon Mar 26 2018 ## 4.4.0 Mon Mar 26 2018

View File

@ -14,9 +14,15 @@
"address": { "address": {
"message": "Adresse" "message": "Adresse"
}, },
"addCustomToken": {
"message": "Eigenen Token hinzufügen"
},
"addToken": { "addToken": {
"message": "Token hinzufügen" "message": "Token hinzufügen"
}, },
"addTokens": {
"message": "Token hinzufügen"
},
"amount": { "amount": {
"message": "Betrag" "message": "Betrag"
}, },
@ -31,9 +37,15 @@
"message": "MetaMask", "message": "MetaMask",
"description": "Der Name der Erweiterung" "description": "Der Name der Erweiterung"
}, },
"approved": {
"message": "Genehmigt"
},
"attemptingConnect": { "attemptingConnect": {
"message": "Versuch mit der Blockchain zu verbinden." "message": "Versuch mit der Blockchain zu verbinden."
}, },
"attributions": {
"message": "Was wir verwenden"
},
"available": { "available": {
"message": "Verfügbar" "message": "Verfügbar"
}, },
@ -43,6 +55,9 @@
"balance": { "balance": {
"message": "Guthaben:" "message": "Guthaben:"
}, },
"balances": {
"message": "Deine Guthaben"
},
"balanceIsInsufficientGas": { "balanceIsInsufficientGas": {
"message": "Guthaben unzureichend für den aktuellen gesamten Gasbetrag" "message": "Guthaben unzureichend für den aktuellen gesamten Gasbetrag"
}, },
@ -69,7 +84,7 @@
"message": "Auf Coinbase kaufen" "message": "Auf Coinbase kaufen"
}, },
"buyCoinbaseExplainer": { "buyCoinbaseExplainer": {
"message": "Coinbase ist die weltweit bekannteste Möglichkeit bitcoin, ethereum und litecoin zu kaufen und verkaufen." "message": "Coinbase ist die weltweit bekannteste Art und Weise um bitcoin, ethereum und litecoin zu kaufen und verkaufen."
}, },
"ok": { "ok": {
"message": "Ok" "message": "Ok"
@ -105,7 +120,7 @@
"message": "Zu Coinbase fortfahren" "message": "Zu Coinbase fortfahren"
}, },
"contractDeployment": { "contractDeployment": {
"message": "Smart Contract ausführen" "message": "Smart Contract Ausführung"
}, },
"conversionProgress": { "conversionProgress": {
"message": "Umtausch in Arbeit" "message": "Umtausch in Arbeit"
@ -148,7 +163,7 @@
"description": "Börsentyp (Kryptowährungen)" "description": "Börsentyp (Kryptowährungen)"
}, },
"currentConversion": { "currentConversion": {
"message": "Aktueller Umtausch" "message": "Aktuelle Tauschwährung"
}, },
"currentNetwork": { "currentNetwork": {
"message": "Aktuelles Netzwerk" "message": "Aktuelles Netzwerk"
@ -185,7 +200,7 @@
"description": "Teilt dem Benutzer mit welchen Token er beim Einzahlen mit Shapeshift ausgewählt hat" "description": "Teilt dem Benutzer mit welchen Token er beim Einzahlen mit Shapeshift ausgewählt hat"
}, },
"depositEth": { "depositEth": {
"message": "Eth einzahlen" "message": "Eth kaufen"
}, },
"depositEther": { "depositEther": {
"message": "Ether einzahlen" "message": "Ether einzahlen"
@ -274,7 +289,7 @@
"message": "Folge uns auf Twitter" "message": "Folge uns auf Twitter"
}, },
"from": { "from": {
"message": "von" "message": "Von"
}, },
"fromToSame": { "fromToSame": {
"message": "Ziel- und Ursprungsadresse dürfen nicht identisch sein" "message": "Ziel- und Ursprungsadresse dürfen nicht identisch sein"
@ -347,14 +362,14 @@
"message": "Es erlaubt dir ether & Token zu halten und dient dir als Verbindung zu dezentralisierten Applikationen." "message": "Es erlaubt dir ether & Token zu halten und dient dir als Verbindung zu dezentralisierten Applikationen."
}, },
"import": { "import": {
"message": "Import", "message": "Importieren",
"description": "Button um den Account aus einer ausgewählten Datei zu importieren" "description": "Button um den Account aus einer ausgewählten Datei zu importieren"
}, },
"importAccount": { "importAccount": {
"message": "Account importieren" "message": "Account importieren"
}, },
"importAccountMsg": { "importAccountMsg": {
"message":" Importierte Accounts werden nicht mit der Seed Wörterfolge deines ursprünglichen MetaMask Accounts verknüpft. Erfahre mehr über importierte Accounts." "message":" Importierte Accounts werden nicht mit der Seed-Wörterfolge deines ursprünglichen MetaMask Accounts verknüpft. Erfahre mehr über importierte Accounts."
}, },
"importAnAccount": { "importAnAccount": {
"message": "Einen Account importieren" "message": "Einen Account importieren"
@ -369,7 +384,7 @@
"infoHelp": { "infoHelp": {
"message": "Info & Hilfe" "message": "Info & Hilfe"
}, },
"insufficientFunds": { "insufficientFunds": {
"message": "Nicht genügend Guthaben." "message": "Nicht genügend Guthaben."
}, },
"insufficientTokens": { "insufficientTokens": {
@ -441,10 +456,10 @@
"message": "Frei" "message": "Frei"
}, },
"loweCaseWords": { "loweCaseWords": {
"message": "Die Wörter der Seed Wörterfolgen sind alle kleingeschrieben" "message": "Die Wörter der Seed-Wörterfolgen sind alle kleingeschrieben"
}, },
"mainnet": { "mainnet": {
"message": "Ethereum Hauptnetzwerk (Main Net)" "message": "Ethereum Main Net"
}, },
"message": { "message": {
"message": "Nachricht" "message": "Nachricht"
@ -541,7 +556,7 @@
"description": "Für den Import eine Accounts mit Hilfe eines Private Keys" "description": "Für den Import eine Accounts mit Hilfe eines Private Keys"
}, },
"pasteSeed": { "pasteSeed": {
"message": "Füge deine Seed Wörterfolge hier ein!" "message": "Füge deine Seed-Wörterfolge hier ein!"
}, },
"personalAddressDetected": { "personalAddressDetected": {
"message": "Personalisierte Adresse identifiziert. Bitte füge die Token Contract Adresse ein." "message": "Personalisierte Adresse identifiziert. Bitte füge die Token Contract Adresse ein."
@ -557,7 +572,7 @@
"description": "Wähle diesen Dateityp um damit einen Account zu importieren" "description": "Wähle diesen Dateityp um damit einen Account zu importieren"
}, },
"privateKeyWarning": { "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": { "privateNetwork": {
"message": "Privates Netzwerk" "message": "Privates Netzwerk"
@ -566,7 +581,7 @@
"message": "QR Code anzeigen" "message": "QR Code anzeigen"
}, },
"readdToken": { "readdToken": {
"message": "Du kannst diesen Token zukünftig wieder hinzufügen indem du in den Menüpunkt \"Token hinzufügen\" in den Einstellungen deines Accounts gehst." "message": "Du kannst diesen Token immer erneut hinzufügen, indem du in den Menüpunkt \"Token hinzufügen\" in den Einstellungen deines Accounts gehst."
}, },
"readMore": { "readMore": {
"message": "Hier mehr erfahren." "message": "Hier mehr erfahren."
@ -590,7 +605,7 @@
"message": "Account zurücksetzten" "message": "Account zurücksetzten"
}, },
"restoreFromSeed": { "restoreFromSeed": {
"message": "Mit Hilfe der Seed Wörterfolge wiederherstellen." "message": "Mit Hilfe der Seed-Wörterfolge wiederherstellen."
}, },
"restoreVault": { "restoreVault": {
"message": "Vault wiederherstellen" "message": "Vault wiederherstellen"
@ -605,13 +620,13 @@
"message": "Wallet Seed" "message": "Wallet Seed"
}, },
"revealSeedWords": { "revealSeedWords": {
"message": "Seed Wörterfolge anzeigen" "message": "Seed-Wörterfolge anzeigen"
}, },
"revealSeedWordsWarning": { "revealSeedWordsWarning": {
"message": "Bitte niemals deine Seed Wörterfolge an einem öffentlichen Ort kenntlich machen. Mit diesen Wörtern können alle deine Accounts gestohlen werden." "message": "Bitte niemals deine Seed-Wörterfolge an einem öffentlichen Ort kenntlich machen. Mit diesen Wörtern können alle deine Accounts gestohlen werden."
}, },
"revert": { "revert": {
"message": "Zurück gehen" "message": "Rückgängig machen"
}, },
"rinkeby": { "rinkeby": {
"message": "Rinkeby Testnetzwerk" "message": "Rinkeby Testnetzwerk"
@ -623,7 +638,7 @@
"message": "Aktueller RPC" "message": "Aktueller RPC"
}, },
"connectingToMainnet": { "connectingToMainnet": {
"message": "Verbinde zum Ethereum Hauptnetzwerk (Main Net)" "message": "Verbinde zum Ethereum Main Net"
}, },
"connectingToRopsten": { "connectingToRopsten": {
"message": " Verbinde zum Ropsten Testnetzwerk" "message": " Verbinde zum Ropsten Testnetzwerk"
@ -649,7 +664,7 @@
"description": "Prozess des Exportieren eines Accounts" "description": "Prozess des Exportieren eines Accounts"
}, },
"saveSeedAsFile": { "saveSeedAsFile": {
"message": "Seed Wörterfolge als Datei speichern" "message": "Seed-Wörterfolge als Datei speichern"
}, },
"search": { "search": {
"message": "Suche" "message": "Suche"
@ -661,7 +676,7 @@
"message": "Neues Passwort (min. 8 Zeichen)" "message": "Neues Passwort (min. 8 Zeichen)"
}, },
"seedPhraseReq": { "seedPhraseReq": {
"message": "Seed Wörterfolgen bestehen aus 12 Wörtern" "message": "Seed-Wörterfolgen bestehen aus 12 Wörtern"
}, },
"select": { "select": {
"message": "Auswählen" "message": "Auswählen"
@ -685,7 +700,7 @@
"message": "Token senden" "message": "Token senden"
}, },
"onlySendToEtherAddress": { "onlySendToEtherAddress": {
"message": "ETH nur zu einer Ethereum Adresse senden." "message": "ETH unbedingt nur zu einer Ethereum Adresse senden."
}, },
"sendTokensAnywhere": { "sendTokensAnywhere": {
"message": "Token zu einer beliebigen Person mit einem Ethereumaccount senden" "message": "Token zu einer beliebigen Person mit einem Ethereumaccount senden"
@ -742,7 +757,7 @@
"message": "Einreichen" "message": "Einreichen"
}, },
"submitted": { "submitted": {
"message": "Eingereicht" "message": "Abgeschickt"
}, },
"supportCenter": { "supportCenter": {
"message": "Gehe zu unserem Support Center" "message": "Gehe zu unserem Support Center"
@ -782,7 +797,7 @@
"message": "Tokensymbol" "message": "Tokensymbol"
}, },
"tokenWarning1": { "tokenWarning1": {
"message": "Behalte die Token die du mit deinem MetaMask Account gekauft hast im Auge. Wenn du Token mit einem anderen Account gekauft hast, werden diese hier nicht angezeigt." "message": "Behalte die Token die du mit deinem MetaMask Account gekauft hast im Blick. Wenn du Token mit einem anderen Account gekauft hast, werden diese hier nicht angezeigt."
}, },
"total": { "total": {
"message": "Gesamt" "message": "Gesamt"
@ -853,7 +868,7 @@
"message": " Account einsehen" "message": " Account einsehen"
}, },
"visitWebSite": { "visitWebSite": {
"message": "Gehe zu unsere Webseite" "message": "Gehe zu unserer Webseite"
}, },
"warning": { "warning": {
"message": "Warnung" "message": "Warnung"

View File

@ -299,7 +299,7 @@
"message": "De gaslimiet moet minstens 21000 zijn" "message": "De gaslimiet moet minstens 21000 zijn"
}, },
"generatingSeed": { "generatingSeed": {
"message": "Zaad produceren ..." "message": "Back-up woorden produceren ..."
}, },
"gasPrice": { "gasPrice": {
"message": "Gasprijs (GWEI)" "message": "Gasprijs (GWEI)"
@ -432,7 +432,7 @@
"message": "Los" "message": "Los"
}, },
"loweCaseWords": { "loweCaseWords": {
"message": "zaadwoorden hebben alleen kleine letters" "message": "back-up woorden hebben alleen kleine letters"
}, },
"mainnet": { "mainnet": {
"message": "belangrijkste ethereum-netwerk" "message": "belangrijkste ethereum-netwerk"
@ -532,7 +532,7 @@
"description": "Voor het importeren van een account vanaf een privésleutel" "description": "Voor het importeren van een account vanaf een privésleutel"
}, },
"pasteSeed": { "pasteSeed": {
"message": "Plak je zaadzin hier!" "message": "Plak je back-up woorden hier!"
}, },
"personalAddressDetected": { "personalAddressDetected": {
"message": "Persoonlijk adres gedetecteerd. Voer het tokencontractadres in." "message": "Persoonlijk adres gedetecteerd. Voer het tokencontractadres in."
@ -581,7 +581,7 @@
"message": "Account opnieuw instellen" "message": "Account opnieuw instellen"
}, },
"restoreFromSeed": { "restoreFromSeed": {
"message": "Herstel van zaaduitdrukking" "message": "Herstel vanuit back-up woorden"
}, },
"required": { "required": {
"message": "Verplicht" "message": "Verplicht"
@ -590,10 +590,10 @@
"message": "Probeer hier opnieuw met een hogere gasprijs" "message": "Probeer hier opnieuw met een hogere gasprijs"
}, },
"revealSeedWords": { "revealSeedWords": {
"message": "Onthul zaadwoorden" "message": "Onthul back-up woorden"
}, },
"revealSeedWordsWarning": { "revealSeedWordsWarning": {
"message": "Herstel je zaadwoorden niet op een openbare plaats! Deze woorden kunnen worden gebruikt om al uw accounts te stelen." "message": "Zorg dat je back-up woorden niet op een openbare plaats bekijkt! Deze woorden kunnen worden gebruikt om al uw accounts opnieuw te genereren (en dus uw account te stelen)."
}, },
"revert": { "revert": {
"message": "terugkeren" "message": "terugkeren"
@ -616,7 +616,7 @@
"description": "Account export proces" "description": "Account export proces"
}, },
"saveSeedAsFile": { "saveSeedAsFile": {
"message": "Bewaar zaadwoorden als bestand" "message": "Bewaar back-up woorden als bestand"
}, },
"search": { "search": {
"message": "Zoeken" "message": "Zoeken"
@ -625,7 +625,7 @@
"message": "Voer hier je geheime twaalfwoordfrase in om je kluis te herstellen." "message": "Voer hier je geheime twaalfwoordfrase in om je kluis te herstellen."
}, },
"seedPhraseReq": { "seedPhraseReq": {
"message": "zaadzinnen zijn 12 woorden lang" "message": "Back-up woorden zijn 12 woorden lang"
}, },
"select": { "select": {
"message": "kiezen" "message": "kiezen"

View File

@ -3,13 +3,13 @@
"message": "Принять" "message": "Принять"
}, },
"account": { "account": {
"message": "Аккаунт" "message": "Счет"
}, },
"accountDetails": { "accountDetails": {
"message": "Детали Аккаунта" "message": "Детали счета"
}, },
"accountName": { "accountName": {
"message": "Имя Пользователя" "message": "Название счета"
}, },
"address": { "address": {
"message": "Адрес" "message": "Адрес"
@ -21,13 +21,13 @@
"message": "Добавить токен" "message": "Добавить токен"
}, },
"addTokens": { "addTokens": {
"message": "Добавить Токены" "message": "Добавить токены"
}, },
"amount": { "amount": {
"message": "Количество" "message": "Сумма"
}, },
"amountPlusGas": { "amountPlusGas": {
"message": "Количество + газ" "message": "Сумма + газ"
}, },
"appDescription": { "appDescription": {
"message": "Расширение браузера для Ethereum", "message": "Расширение браузера для Ethereum",
@ -37,11 +37,14 @@
"message": "MetaMask", "message": "MetaMask",
"description": "The name of the application" "description": "The name of the application"
}, },
"approved": {
"message": "Одобрена"
},
"attemptingConnect": { "attemptingConnect": {
"message": "Попытка подключиться к блокчейн сети." "message": "Попытка подключиться к блокчейн сети."
}, },
"attributions": { "attributions": {
"message": "Опознания" "message": "Атрибуция"
}, },
"available": { "available": {
"message": "Доступный" "message": "Доступный"
@ -53,13 +56,13 @@
"message": "Баланс:" "message": "Баланс:"
}, },
"balances": { "balances": {
"message": "Ваши балансы" "message": "Ваш баланс"
}, },
"balanceIsInsufficientGas": { "balanceIsInsufficientGas": {
"message": "Недостаточный баланс для текущего объема газа" "message": "Недостаточный баланс для текущего объема газа"
}, },
"beta": { "beta": {
"message": "БЕТА" "message": "BETA"
}, },
"betweenMinAndMax": { "betweenMinAndMax": {
"message": "должно быть больше или равно $1 и меньше или равно $2.", "message": "должно быть больше или равно $1 и меньше или равно $2.",
@ -69,10 +72,10 @@
"message": "Использовать Blockies Identicon" "message": "Использовать Blockies Identicon"
}, },
"borrowDharma": { "borrowDharma": {
"message": "Заимствовать с Dharma (бета)" "message": "Взять в долг на Dharma (Beta)"
}, },
"builtInCalifornia": { "builtInCalifornia": {
"message": "MetaMask спроектирован и построен в Калифорнии." "message": "MetaMask спроектирован и разработан в Калифорнии."
}, },
"buy": { "buy": {
"message": "Купить" "message": "Купить"
@ -81,7 +84,10 @@
"message": "Купить на Coinbase" "message": "Купить на Coinbase"
}, },
"buyCoinbaseExplainer": { "buyCoinbaseExplainer": {
"message": "Coinbase - самый популярный в мире способ купить и продать биткойн, ethereum и litecoin." "message": "Биржа Coinbase это наиболее популярный способ купить или продать bitcoin, ethereum и litecoin."
},
"ok": {
"message": "ОК"
}, },
"cancel": { "cancel": {
"message": "Отмена" "message": "Отмена"
@ -95,14 +101,17 @@
"confirm": { "confirm": {
"message": "Подтвердить" "message": "Подтвердить"
}, },
"confirmed": {
"message": "Подтверждена"
},
"confirmContract": { "confirmContract": {
"message": "Подтвердить Контракт" "message": "Подтвердить контракт"
}, },
"confirmPassword": { "confirmPassword": {
"message": "Подтвердите Пароль" "message": "Подтвердите пароль"
}, },
"confirmTransaction": { "confirmTransaction": {
"message": "Подтвердить Транзакцию" "message": "Подтвердить транзакцию"
}, },
"continue": { "continue": {
"message": "Продолжить" "message": "Продолжить"
@ -114,7 +123,7 @@
"message": "Развертывание контракта" "message": "Развертывание контракта"
}, },
"conversionProgress": { "conversionProgress": {
"message": "Выполняется конверсия" "message": "Выполняется конвертация"
}, },
"copiedButton": { "copiedButton": {
"message": "Скопировано" "message": "Скопировано"
@ -126,7 +135,7 @@
"message": "Скопировано!" "message": "Скопировано!"
}, },
"copiedSafe": { "copiedSafe": {
"message": "Я скопировал его где-то в безопасности" "message": "Я скопировал это в безопасное место"
}, },
"copy": { "copy": {
"message": "Скопировать" "message": "Скопировать"
@ -138,29 +147,32 @@
"message": " Скопировать " "message": " Скопировать "
}, },
"copyPrivateKey": { "copyPrivateKey": {
"message": "Это ваш личный ключ (нажмите, чтобы скопировать)" "message": "Это ваш закрытый ключ (нажмите, чтобы скопировать)"
}, },
"create": { "create": {
"message": "Создать" "message": "Создать"
}, },
"createAccount": { "createAccount": {
"message": "Регистрация" "message": "Создать счет"
}, },
"createDen": { "createDen": {
"message": "Создать" "message": "Создать"
}, },
"crypto": { "crypto": {
"message": "Крипто", "message": "Криптовалюта",
"description": "Exchange type (cryptocurrencies)" "description": "Exchange type (cryptocurrencies)"
}, },
"currentConversion": { "currentConversion": {
"message": "Текущая конверсия" "message": "Текущая конвертация"
}, },
"currentNetwork": { "currentNetwork": {
"message": "Текущая сеть" "message": "Текущая сеть"
}, },
"customGas": { "customGas": {
"message": "Настроить Газ" "message": "Настроить газ"
},
"customToken": {
"message": "Пользовательский токен"
}, },
"customize": { "customize": {
"message": "Настроить" "message": "Настроить"
@ -169,112 +181,114 @@
"message": "Пользовательский RPC" "message": "Пользовательский RPC"
}, },
"decimalsMustZerotoTen": { "decimalsMustZerotoTen": {
"message": "Десятичные числа должны быть не менее 0, и не более 36." "message": "Количество десятичных разрядов должно быть минимум 0 и максимум 36."
}, },
"decimal": { "decimal": {
"message": "Десятичные значения точности" "message": "Количество десятичных разрядов"
}, },
"defaultNetwork": { "defaultNetwork": {
"message": "Сеть по умолчанию для транзакций Ether - это Main Net." "message": "Основная сеть Ethereum это сеть по умолчанию для Ether транзакций."
}, },
"denExplainer": { "denExplainer": {
"message": "Ваш DEN - это ваше зашифрованное паролем хранилище в MetaMask." "message": "DEN это зашифрованное паролем хранилище внутри MetaMask."
}, },
"deposit": { "deposit": {
"message": "Депозит" "message": "Пополнить"
}, },
"depositBTC": { "depositBTC": {
"message": "Депозит BTC по адресу:" "message": "Отправьте ваш BTC на адрес ниже:"
}, },
"depositCoin": { "depositCoin": {
"message": "Депозит $1 по указанному ниже адресу", "message": "Отправьте ваш $1 на адрес ниже",
"description": "Tells the user what coin they have selected to deposit with shapeshift" "description": "Tells the user what coin they have selected to deposit with shapeshift"
}, },
"depositEth": { "depositEth": {
"message": "Депозит Eth" "message": "Пополнить Eth"
}, },
"depositEther": { "depositEther": {
"message": "Депозит Эфир" "message": "Пополнить Ether"
}, },
"depositFiat": { "depositFiat": {
"message": "Депозит с деньгами" "message": "Пополнить деньгами"
}, },
"depositFromAccount": { "depositFromAccount": {
"message": "Депозит с другого счета" "message": "Пополнить с другого счета"
}, },
"depositShapeShift": { "depositShapeShift": {
"message": "Депозит с ShapeShift" "message": "Пополнить через ShapeShift"
}, },
"depositShapeShiftExplainer": { "depositShapeShiftExplainer": {
"message": "Если у вас есть другие крипторесурсы, вы можете торговать и вносить Эфир непосредственно в кошелек MetaMask. Нет необходимости в аккаунте." "message": "Если у вас есть другие криптовалюты, вы можете торговать и пополнять Ether напрямую в ваш MetaMask кошелек. Нет необходимости в счете."
}, },
"details": { "details": {
"message": "Детали" "message": "Детали"
}, },
"directDeposit": { "directDeposit": {
"message": "Прямой Депозит" "message": "Прямое пополнение"
}, },
"directDepositEther": { "directDepositEther": {
"message": "Прямой Депозит Эфира" "message": "Прямое пополнение Ether"
}, },
"directDepositEtherExplainer": { "directDepositEtherExplainer": {
"message": "Если у вас уже есть Эфир, самый быстрый способ получить Эфир в вашем новом кошельке это прямым депозитом." "message": "Если у вас уже есть Ether, то самый быстрый способ получить Ether в ваш новый кошелек это прямое пополнение."
}, },
"done": { "done": {
"message": "Готово" "message": "Готово"
}, },
"downloadStateLogs": { "downloadStateLogs": {
"message": "Загрузить логи статус" "message": "Скачать журнал состояния"
"dropped": {
"message": "Отброшена"
}, },
"edit": { "edit": {
"message": "Редактировать" "message": "Редактировать"
}, },
"editAccountName": { "editAccountName": {
"message": "Изменить Имя Аккаунта" "message": "Редактировать название счета"
}, },
"emailUs": { "emailUs": {
"message": "Свяжитесь с нами по электронной почте!" "message": "Свяжитесь с нами по электронной почте!"
}, },
"encryptNewDen": { "encryptNewDen": {
"message": "Шифруйте новый DEN" "message": "Зашифровать ваш новый DEN"
}, },
"enterPassword": { "enterPassword": {
"message": "Введите пароль" "message": "Введите пароль"
}, },
"enterPasswordConfirm": { "enterPasswordConfirm": {
"message": "Введите свой пароль для подтверждения" "message": "Введите ваш пароль для подтверждения"
}, },
"etherscanView": { "etherscanView": {
"message": "Просмотреть аккаунт на Etherscan" "message": "Просмотреть счет на Etherscan"
}, },
"exchangeRate": { "exchangeRate": {
"message": "Обменный Курс" "message": "Обменный курс"
}, },
"exportPrivateKey": { "exportPrivateKey": {
"message": "Экспорт закрытого ключа" "message": "Экспортировать закрытый ключ"
}, },
"exportPrivateKeyWarning": { "exportPrivateKeyWarning": {
"message": "Экспорт секретных ключей на свой страх и риск." "message": "Вы экспортируете закрытые ключи на свой страх и риск."
}, },
"failed": { "failed": {
"message": "Не смогли" "message": "Неудачна"
}, },
"fiat": { "fiat": {
"message": "Бумажные деньги", "message": "Валюта",
"description": "Exchange type" "description": "Exchange type"
}, },
"fileImportFail": { "fileImportFail": {
"message": "Ошибка импорта файлов? Кликните сюда!", "message": "Не работает импорт файла? Нажмите тут!",
"description": "Helps user import their account from a JSON file" "description": "Helps user import their account from a JSON file"
}, },
"followTwitter": { "followTwitter": {
"message": "Следуйте за нами на Twitter" "message": "Читайте нас в Twitter"
}, },
"from": { "from": {
"message": "Из" "message": "Отправитель"
}, },
"fromToSame": { "fromToSame": {
"message": "От и до адреса не могут быть одинаковым" "message": "Адрес отправителя и получателя не могут быть одинаковыми"
}, },
"fromShapeShift": { "fromShapeShift": {
"message": "Из ShapeShift" "message": "Из ShapeShift"
@ -284,37 +298,37 @@
"description": "Short indication of gas cost" "description": "Short indication of gas cost"
}, },
"gasFee": { "gasFee": {
"message": "Плата за Газ" "message": "Комиссия за газ"
}, },
"gasLimit": { "gasLimit": {
"message": "Газовый Предел" "message": "Лимит газа"
}, },
"gasLimitCalculation": { "gasLimitCalculation": {
"message": "Мы рассчитываем предполагаемый предел газа на основе коэффициентов успешности сети." "message": "Мы расчитываем предлагаемый лимит газа на основании успешных ставок в сети."
}, },
"gasLimitRequired": { "gasLimitRequired": {
"message": "Требуется ограничение на Газ" "message": "Установите лимит газа"
}, },
"gasLimitTooLow": { "gasLimitTooLow": {
"message": "Предел газа должен быть не менее 21000" "message": "Лимит газа должен быть как минимум 21000"
}, },
"generatingSeed": { "generatingSeed": {
"message": "Создание Семян ..." "message": "Генерируем фразу..."
}, },
"gasPrice": { "gasPrice": {
"message": "Цена на Газ (GWEI)" "message": "Цена за газ (GWEI)"
}, },
"gasPriceCalculation": { "gasPriceCalculation": {
"message": "Мы вычисляем предлагаемые цены на газ на основе коэффициентов успеха сети." "message": "Мы расчитываем предлагаемые цены за газ на основании успешных ставок в сети."
}, },
"gasPriceRequired": { "gasPriceRequired": {
"message": "Требуется цена на Газ" "message": "Установите стоимость газа"
}, },
"getEther": { "getEther": {
"message": "Получить Эфир" "message": "Получить Ether"
}, },
"getEtherFromFaucet": { "getEtherFromFaucet": {
"message": "Получите Эфир из крана $1", "message": "Получить Ether из крана для $1",
"description": "Displays network name for Ether faucet" "description": "Displays network name for Ether faucet"
}, },
"greaterThanMin": { "greaterThanMin": {
@ -322,14 +336,14 @@
"description": "helper for inputting hex as decimal input" "description": "helper for inputting hex as decimal input"
}, },
"here": { "here": {
"message": "здесь", "message": "тут",
"description": "as in -click here- for more information (goes with troubleTokenBalances)" "description": "as in -click here- for more information (goes with troubleTokenBalances)"
}, },
"hereList": { "hereList": {
"message": "Вот список !!!!" "message": "Вот список!!!!"
}, },
"hide": { "hide": {
"message": "Спрятать" "message": "Скрыть"
}, },
"hideToken": { "hideToken": {
"message": "Скрыть токен" "message": "Скрыть токен"
@ -338,33 +352,33 @@
"message": "Скрыть токен?" "message": "Скрыть токен?"
}, },
"howToDeposit": { "howToDeposit": {
"message": "Как бы вы хотели поместить Эфир?" "message": "Как бы вы хотели пополнить Ether?"
}, },
"holdEther": { "holdEther": {
"message": "Это позволяет вам использовать эфир и токены и служит мостом для децентрализованных приложений." "message": "Позволяет вам хранить ether и токены и служит в качестве моста в децентрализированные приложения."
}, },
"import": { "import": {
"message": "Импортировать", "message": "Импортировать",
"description": "Button to import an account from a selected file" "description": "Button to import an account from a selected file"
}, },
"importAccount": { "importAccount": {
"message": "Импорт Аккаунта" "message": "Импортировать счет"
}, },
"importAccountMsg": { "importAccountMsg": {
"message": " Импортированные аккаунты не будут связаны с вашей первоначально созданным аккаунтом MetaMask. Подробнее о импортированных аккаунтах " "message":" Импортированные счета не будут ассоциированы с вашей ключевой фразой, созданной MetaMask. Узнать больше про импорт счетов "
}, },
"importAnAccount": { "importAnAccount": {
"message": "Импортировать аккаунт" "message": "Импортировать аккаунт"
}, },
"importDen": { "importDen": {
"message": "Импорт существующих DEN" "message": "Импортировать существующий DEN"
}, },
"imported": { "imported": {
"message": "Импортирован", "message": "Импортирован",
"description": "status showing that an account has been fully loaded into the keyring" "description": "status showing that an account has been fully loaded into the keyring"
}, },
"infoHelp": { "infoHelp": {
"message": "Информация и Помощь" "message": "Информация и помощь"
}, },
"insufficientFunds": { "insufficientFunds": {
"message": "Недостаточно средств." "message": "Недостаточно средств."
@ -373,35 +387,44 @@
"message": "Недостаточно токенов." "message": "Недостаточно токенов."
}, },
"invalidAddress": { "invalidAddress": {
"message": "Недействительный адрес" "message": "Неверный адрес"
}, },
"invalidAddressRecipient": { "invalidAddressRecipient": {
"message": "Недопустимый адрес получателя." "message": "Неверный адрес получателя"
}, },
"invalidGasParams": { "invalidGasParams": {
"message": "Недопустимые параметры Газа" "message": "Неверные параметры газа"
}, },
"invalidInput": { "invalidInput": {
"message": "Неправильный ввод." "message": "Неверный ввод."
}, },
"invalidRequest": { "invalidRequest": {
"message": "Неверный Запрос" "message": "Неверный запрос"
}, },
"invalidRPC": { "invalidRPC": {
"message": "Недопустимый URI RPC" "message": "Неверный RPC URI"
}, },
"jsonFail": { "jsonFail": {
"message": "Что-то пошло не так. Убедитесь, что ваш файл JSON правильно отформатирован." "message": "Что-то пошло не так. Убедитесь, что ваш JSON файл правильно отформатирован."
}, },
"jsonFile": { "jsonFile": {
"message": "Файл JSON", "message": "JSON файл",
"description": "format for importing an account" "description": "format for importing an account"
}, },
"keepTrackTokens": {
"message": "Следите за купленными вами токенами с помощью аккаунта MetaMask."
},
"kovan": { "kovan": {
"message": "Kovan тестовая сеть" "message": "Тестовая сеть Kovan"
}, },
"knowledgeDataBase": { "knowledgeDataBase": {
"message": "Посетите нашу базу знаний" "message": "Посмотрите нашу Базу Знаний"
},
"max": {
"message": "Максимум"
},
"learnMore": {
"message": "Узнать больше."
}, },
"lessThanMax": { "lessThanMax": {
"message": "должно быть меньше или равно $1.", "message": "должно быть меньше или равно $1.",
@ -410,29 +433,32 @@
"likeToAddTokens": { "likeToAddTokens": {
"message": "Вы хотите добавить эти токены?" "message": "Вы хотите добавить эти токены?"
}, },
"links": {
"message": "Ссылки"
},
"limit": { "limit": {
"message": "Предел" "message": "Лимит"
}, },
"loading": { "loading": {
"message": "Загрузка..." "message": "Загрузка..."
}, },
"loadingTokens": { "loadingTokens": {
"message": "Загрузка токенов ..." "message": "Загрузка токенов..."
}, },
"localhost": { "localhost": {
"message": "Локальный адрес 8545" "message": "Localhost 8545"
}, },
"login": { "login": {
"message": "Авторизоваться" "message": "Вход"
}, },
"logout": { "logout": {
"message": "Выйти" "message": "Выход"
}, },
"loose": { "loose": {
"message": "Рыхлый" "message": "Несвязанный"
}, },
"loweCaseWords": { "loweCaseWords": {
"message": "семенные слова имеют только символы нижнего регистра" "message": "ключевая фраза может содержать только символы нижнего регистра"
}, },
"mainnet": { "mainnet": {
"message": "Основная сеть Ethereum" "message": "Основная сеть Ethereum"
@ -441,19 +467,19 @@
"message": "Сообщение" "message": "Сообщение"
}, },
"metamaskDescription": { "metamaskDescription": {
"message": "MetaMask - это безопасное хранилище для Ethereum." "message": "MetaMask безопасный кошелек для Ethereum."
}, },
"min": { "min": {
"message": "Минимум" "message": "Минимум"
}, },
"myAccounts": { "myAccounts": {
"message": "Мои Аккаунты" "message": "Мои счета"
}, },
"mustSelectOne": { "mustSelectOne": {
"message": "Необходимо выбрать не менее 1 токена." "message": "Необходимо выбрать как минимум 1 токен."
}, },
"needEtherInWallet": { "needEtherInWallet": {
"message": "Чтобы взаимодействовать с децентрализованными приложениями с помощью MetaMask, вам понадобится Эфир в вашем кошельке." "message": "Для взаимодействия с децентрализованными приложениями с помощью MetaMask нужен Ether в вашем кошельке."
}, },
"needImportFile": { "needImportFile": {
"message": "Вы должны выбрать файл для импорта.", "message": "Вы должны выбрать файл для импорта.",
@ -464,60 +490,60 @@
"description": "Password and file needed to import an account" "description": "Password and file needed to import an account"
}, },
"negativeETH": { "negativeETH": {
"message": "Невозможно отправить отрицательные количества ETH." "message": "Невозможно отправить отрицательную сумму ETH."
}, },
"networks": { "networks": {
"message": "Сети" "message": "Сети"
}, },
"newAccount": { "newAccount": {
"message": "Новый Аккаунт" "message": "Новый счет"
}, },
"newAccountNumberName": { "newAccountNumberName": {
"message": "Аккаунт $1", "message": "Счет $1",
"description": "Default name of next account to be created on create account screen" "description": "Default name of next account to be created on create account screen"
}, },
"newContract": { "newContract": {
"message": "Новый Контракт" "message": "Новый контракт"
}, },
"newPassword": { "newPassword": {
"message": "Новый пароль (мин. 8 символов)" "message": "Новый пароль (мин. 8 символов)"
}, },
"newRecipient": { "newRecipient": {
"message": "Новый Получатель" "message": "Новый получатель"
}, },
"newRPC": { "newRPC": {
"message": "Новый URL-адрес RPC" "message": "Новый RPC URL"
}, },
"next": { "next": {
"message": "Далее" "message": "Далее"
}, },
"noAddressForName": { "noAddressForName": {
"message": "Для этого имени не задан адрес." "message": "Дла этого названия не установлен адрес."
}, },
"noDeposits": { "noDeposits": {
"message": "Не было получено никаких депозитов" "message": "Пополнения не получены"
}, },
"noTransactionHistory": { "noTransactionHistory": {
"message": "Нет истории транзакций." "message": "Нет истории транзакций."
}, },
"noTransactions": { "noTransactions": {
"message": "Нет Транзакций" "message": "Нет транзакций"
}, },
"notStarted": { "notStarted": {
"message": "Не Начался" "message": "Не запущен"
}, },
"oldUI": { "oldUI": {
"message": "Старый Интерфейс" "message": "Старая версия интерфейса"
}, },
"oldUIMessage": { "oldUIMessage": {
"message": "Вы вернулись к старому интерфейсу. Вы можете вернуться к новому с помощью опции в раскрывающемся меню в правом верхнем углу." "message": "Вы вернулись к старой версии интерфейса пользователя. Вы можете переключиться на новую с помощью опции выпадающего меню в правом верхнем углу."
}, },
"or": { "or": {
"message": "или", "message": "или",
"description": "choice between creating or importing a new account" "description": "choice between creating or importing a new account"
}, },
"passwordCorrect": { "passwordCorrect": {
"message": "Убедитесь, что ваш пароль правильный." "message": "Убедитесь, что ваш пароль верный."
}, },
"passwordMismatch": { "passwordMismatch": {
"message": "пароли не совпадают", "message": "пароли не совпадают",
@ -528,27 +554,30 @@
"description": "in password creation process, the password is not long enough to be secure" "description": "in password creation process, the password is not long enough to be secure"
}, },
"pastePrivateKey": { "pastePrivateKey": {
"message": "Вставьте свою личную строку:", "message": "Вставьте ваш закрытый ключ тут:",
"description": "For importing an account from a private key" "description": "For importing an account from a private key"
}, },
"pasteSeed": { "pasteSeed": {
"message": "Вставьте здесь свою семенную фразу!" "message": "Вставьте вашу ключевую фразу!"
}, },
"personalAddressDetected": { "personalAddressDetected": {
"message": "Персональный адрес обнаружен. Введите адрес контракта токена." "message": "Обнаружен персональный адрес. Введите адрес контракта токена."
}, },
"pleaseReviewTransaction": { "pleaseReviewTransaction": {
"message": "Проверьте транзакцию." "message": "Проверьте транзакцию."
}, },
"popularTokens": {
"message": "Популярные токены"
},
"privacyMsg": { "privacyMsg": {
"message": "Политика Конфиденциальности" "message": "Политика конфиденциальности"
}, },
"privateKey": { "privateKey": {
"message": "Закрытый ключ", "message": "Закрытый ключ",
"description": "select this type of file to use to import an account" "description": "select this type of file to use to import an account"
}, },
"privateKeyWarning": { "privateKeyWarning": {
"message": "Предупреждение: никогда не раскрывайте этот ключ. Любой, у кого есть ваши личные ключи, может украсть любые активы, хранящиеся в вашем аккаунте." "message": "Предупреждение: Никогда не раскрывайте этот ключ. Любой, у кого есть ваши закрытые ключи, может украсть любые активы, хранящиеся на счету."
}, },
"privateNetwork": { "privateNetwork": {
"message": "Частная сеть" "message": "Частная сеть"
@ -557,126 +586,165 @@
"message": "Показать QR-код" "message": "Показать QR-код"
}, },
"readdToken": { "readdToken": {
"message": "Вы можете добавить этот токен в будущем, перейдя в “Добавить токен” в меню параметров вашего аккаунта." "message": "Вы можете в будущем добавить обратно этот токен, выбрав пункт меню “Добавить токен”."
}, },
"readMore": { "readMore": {
"message": "Подробнее читайте здесь." "message": "Узнать больше тут."
}, },
"readMore2": { "readMore2": {
"message": "Прочитайте больше." "message": "Узнать больше."
}, },
"receive": { "receive": {
"message": "Получить" "message": "Получить"
}, },
"recipientAddress": { "recipientAddress": {
"message": "Адрес Получателя" "message": "Адрес получателя"
}, },
"refundAddress": { "refundAddress": {
"message": "Ваш Адрес Возврата" "message": "Ваш адрес для возврата средств"
}, },
"rejected": { "rejected": {
"message": "Отклонено" "message": "Отклонена"
}, },
"resetAccount": { "resetAccount": {
"message": "Сбросить аккаунт" "message": "Сбросить аккаунт"
}, },
"restoreFromSeed": { "restoreFromSeed": {
"message": "Восстановить от семенной фразы" "message": "Восстановить из ключевой фразы"
},
"restoreVault": {
"message": "Восстановить кошелек"
}, },
"required": { "required": {
"message": "Необходимо" "message": "Обязательное поле"
}, },
"retryWithMoreGas": { "retryWithMoreGas": {
"message": "Повторите попытку с более высокой ценой на газ здесь" "message": "Повторите попытку с большей ценой за газRetry with a higher gas price here"
},
"walletSeed": {
"message": "Ключевая фраза кошелька"
}, },
"revealSeedWords": { "revealSeedWords": {
"message": "Раскрыть семенные слова" "message": "Показать ключевую фразу"
}, },
"revealSeedWordsWarning": { "revealSeedWordsWarning": {
"message": "Не восстанавливайте семенные слова в общественном месте! Эти слова могут использоваться для кражи всех ваших аккаунтах." "message": "Не восстанавливайте ключевую фразу в общественном месте! Она может быть использована для кражи всех ваших счетов."
}, },
"revert": { "revert": {
"message": "Откат" "message": "Восстановить"
}, },
"rinkeby": { "rinkeby": {
"message": "Rinkeby тестовая сеть" "message": "Тестовая сеть Rinkeby"
}, },
"ropsten": { "ropsten": {
"message": "Ropsten тестовая сеть" "message": "Тестовая сеть Ropsten"
},
"currentRpc": {
"message": "Current RPC"
},
"connectingToMainnet": {
"message": "Соединение с основной сетью Ethereum"
},
"connectingToRopsten": {
"message": "Соединение с тестовой сетью Ropsten"
},
"connectingToKovan": {
"message": "Соединение с тестовой сетью Kovan"
},
"connectingToRinkeby": {
"message": "Соединение с тестовой сетью Rinkeby"
},
"connectingToUnknown": {
"message": "Соединение с неизвестной сетью"
}, },
"sampleAccountName": { "sampleAccountName": {
"message": "Например, Мой новый аккаунт", "message": "Например, Мой новый счет",
"description": "Help user understand concept of adding a human-readable name to their account" "description": "Help user understand concept of adding a human-readable name to their account"
}, },
"save": { "save": {
"message": "Сохранить" "message": "Сохранить"
}, },
"saveAsFile": { "saveAsFile": {
"message": "Сохранить как Файл", "message": "Сохранить в виде файла",
"description": "Account export process" "description": "Account export process"
}, },
"saveSeedAsFile": { "saveSeedAsFile": {
"message": "Сохранить Семенные Слова Как Файл" "message": "Сохранить ключевую фразу в виде файла"
}, },
"search": { "search": {
"message": "Поиск" "message": "Поиск"
}, },
"secretPhrase": { "secretPhrase": {
"message": "Введите свою секретную двенадцатисловную фразу здесь, чтобы восстановить хранилище." "message": "Введите вашу ключевую фразу из 12 слов, чтобы восстановить кошелек."
},
"newPassword8Chars": {
"message": "Новый пароль (мин. 8 символов)"
}, },
"seedPhraseReq": { "seedPhraseReq": {
"message": "семенные фразы длиной 12 слов" "message": "ключевые фразы имеют длину 12 слов"
}, },
"select": { "select": {
"message": "Выбрать" "message": "Выбрать"
}, },
"selectCurrency": { "selectCurrency": {
"message": "Выберите Валюту" "message": "Выберите валюту"
}, },
"selectService": { "selectService": {
"message": "Выберите Сервис" "message": "Выберите сервис"
}, },
"selectType": { "selectType": {
"message": "Выберите Тип" "message": "Выберите тип"
}, },
"send": { "send": {
"message": "Послать" "message": "Отправить"
}, },
"sendETH": { "sendETH": {
"message": "Отправить ETH" "message": "Отправить ETH"
}, },
"sendTokens": { "sendTokens": {
"message": "Отправить Токены" "message": "Отправить токены"
},
"onlySendToEtherAddress": {
"message": "Отправляйте ETH только на Ethereum адреса."
},
"searchTokens": {
"message": "Поиск токенов"
}, },
"sendTokensAnywhere": { "sendTokensAnywhere": {
"message": "Отправить Токены кому-либо с аккаунтом Ethereum" "message": "Отправить токены любому, у кого есть счет Ethereum"
}, },
"settings": { "settings": {
"message": "Настройки" "message": "Настройки"
}, },
"info": {
"message": "Информация"
},
"shapeshiftBuy": { "shapeshiftBuy": {
"message": "Купить с помощью Shapeshift" "message": "Купить через Shapeshift"
}, },
"showPrivateKeys": { "showPrivateKeys": {
"message": "Показать приватные ключи" "message": "Показать закрытые ключи"
}, },
"showQRCode": { "showQRCode": {
"message": "Показать QR-код" "message": "Показать QR-код"
}, },
"sign": { "sign": {
"message": "Знак" "message": "Подпись"
},
"signed": {
"message": "Подписана"
}, },
"signMessage": { "signMessage": {
"message": "Нодписать сообщение" "message": "Подписать сообщение"
}, },
"signNotice": { "signNotice": {
"message": "Подписание этого сообщения может иметь \nопасные побочные эффекты. Только подписывайте сообщения \nс сайтов, которым вы полностью доверяете своим аккаунтом. Этот опасный метод будет удален в будущей версии." "message": "Подпись этого сообщения может иметь \nопасные побочные эффекты. Подписывайте только сообщения \nс сайтов, которым вы полностью доверяете свой аккаунт. Этот опасный метод будет удален в будущей версии."
}, },
"sigRequest": { "sigRequest": {
"message": "Запрос на подпись" "message": "Запрос подписи"
}, },
"sigRequested": { "sigRequested": {
"message": "Подпись Запрошена" "message": "Подпись запрошена"
}, },
"spaceBetween": { "spaceBetween": {
"message": "между словами может быть только пробел" "message": "между словами может быть только пробел"
@ -685,53 +753,59 @@
"message": "Статус" "message": "Статус"
}, },
"stateLogs": { "stateLogs": {
"message": "Логи Статуса" "message": "Журнал состояния"
}, },
"stateLogsDescription": { "stateLogsDescription": {
"message": "Логи статуса содержат ваши общедоступные адреса и отправленные транзакции." "message": "Журнал состояния содержит ваши публичные адреса счетов и совершенные транзакции."
},
"stateLogError": {
"message": "Ошибка при получении журнала состояния."
}, },
"submit": { "submit": {
"message": "Отправить" "message": "Отправить"
}, },
"submitted": {
"message": "Отправлена"
},
"supportCenter": { "supportCenter": {
"message": "Посетите наш Центр поддержки" "message": ерейти в наш Центр поддержки"
}, },
"symbolBetweenZeroTen": { "symbolBetweenZeroTen": {
"message": "Символ должен быть от 0 до 10 символов." "message": "Символ должен быть от 0 до 10 символов."
}, },
"takesTooLong": { "takesTooLong": {
"message": "Занимает слишком долго?" "message": "Слишком долго?"
}, },
"terms": { "terms": {
"message": "Условия Эксплуатации" "message": "Условия пользования"
}, },
"testFaucet": { "testFaucet": {
"message": "Тестовый Кран" "message": "Тестовый кран"
}, },
"to": { "to": {
"message": "К" "message": "Получатель: "
}, },
"toETHviaShapeShift": { "toETHviaShapeShift": {
"message": "$1 в ETH через ShapeShift", "message": "$1 в ETH через ShapeShift",
"description": "system will fill in deposit type in start of message" "description": "system will fill in deposit type in start of message"
}, },
"tokenAddress": { "tokenAddress": {
"message": "Адрес Токена" "message": "Адрес токена"
}, },
"tokenAlreadyAdded": { "tokenAlreadyAdded": {
"message": "Токен уже добавлен." "message": "Токен уже был добавлен."
}, },
"tokenBalance": { "tokenBalance": {
"message": "Баланс Вашых Tокенов:" "message": "Баланс ваших токенов:"
}, },
"tokenSelection": { "tokenSelection": {
"message": "Поиск токенов или выбор из нашего списка популярных токенов." "message": "Поищите токен или выберите из нашего списка популярных токенов."
}, },
"tokenSymbol": { "tokenSymbol": {
"message": "Символ Токена" "message": "Символ токена"
}, },
"tokenWarning1": { "tokenWarning1": {
"message": "Следите за токенами, которые вы купили с помощью аккаунта MetaMask. Если вы купили токены, используя другой аккаунт, эти токены здесь не появятся." "message": "Отслеживаются токены, купленные на счет в MetaMask. Если вы купили токены, используя другой счет, такие токены не будут тут отображены."
}, },
"total": { "total": {
"message": "Всего" "message": "Всего"
@ -740,35 +814,38 @@
"message": "транзакции" "message": "транзакции"
}, },
"transactionMemo": { "transactionMemo": {
"message": "Транзакционная записка (необязательно)" "message": "Транзакционные данные (необязательный)"
}, },
"transactionNumber": { "transactionNumber": {
"message": "Номер Транзакции" "message": "Номер транзакции"
}, },
"transfers": { "transfers": {
"message": "Переводы" "message": "Переводы"
}, },
"troubleTokenBalances": { "troubleTokenBalances": {
"message": "У нас были проблемы с загрузкой ваших токенов. Вы можете просмотреть их ", "message": "Возникли проблемы при загрузке балансов токенов. Вы можете посмотреть их ",
"description": "Followed by a link (here) to view token balances" "description": "Followed by a link (here) to view token balances"
}, },
"twelveWords": { "twelveWords": {
"message": "Эти 12 слов - единственный способ восстановить ваши учетные записи MetaMask.\nСохраните их где-нибудь в безопасности и в тайне." "message": "Эти 12 слов являются единственной возможностью восстановить ваши счета в MetaMask.\nСохраните из в надежном секретном месте."
}, },
"typePassword": { "typePassword": {
"message": "Введите Пароль" "message": "Введите пароль"
}, },
"uiWelcome": { "uiWelcome": {
"message": "Добро пожаловать в новый интерфейс (бета-версия)" "message": "Новый интерфейс (Beta)"
}, },
"uiWelcomeMessage": { "uiWelcomeMessage": {
"message": "Теперь вы используете новый интерфейс Metamask. Осмотритесь, попробуйте новые функции, такие как отправку токенов, и сообщите нам, есть ли у вас какие-либо проблемы." "message": "Теперь вы используете новый интерфейс пользователя MetaMask. Осмотритесь, попробуйте новые функции, например, отправить токены и, если возникнут проблемы, сообщите нам."
},
"unapproved": {
"message": "Не одобрена"
}, },
"unavailable": { "unavailable": {
"message": "Недоступен" "message": "Недоступный"
}, },
"unknown": { "unknown": {
"message": "Неизвестный" "message": "Неизвестно"
}, },
"unknownNetwork": { "unknownNetwork": {
"message": "Неизвестная частная сеть" "message": "Неизвестная частная сеть"
@ -777,7 +854,7 @@
"message": "Неизвестный идентификатор сети" "message": "Неизвестный идентификатор сети"
}, },
"uriErrorMsg": { "uriErrorMsg": {
"message": "Для URI требуется соответствующий префикс HTTP / HTTPS." "message": "Для URI требуется соответствующий префикс HTTP/HTTPS."
}, },
"usaOnly": { "usaOnly": {
"message": "Только США", "message": "Только США",
@ -787,19 +864,19 @@
"message": "Используется различными клиентами" "message": "Используется различными клиентами"
}, },
"useOldUI": { "useOldUI": {
"message": "Использовать старый интерфейс" "message": "Использовать старый интерфейс пользователя"
}, },
"validFileImport": { "validFileImport": {
"message": "Вы должны выбрать действительный файл для импорта." "message": "Вам нужно выбрать правильный файл для импорта."
}, },
"vaultCreated": { "vaultCreated": {
"message": "Создано хранилище" "message": "Кошелек был создан"
}, },
"viewAccount": { "viewAccount": {
"message": "Посмотреть аккаунт" "message": "Посмотреть счет"
}, },
"visitWebSite": { "visitWebSite": {
"message": осетите наш сайт" "message": ерейти на наш сайт"
}, },
"warning": { "warning": {
"message": "Предупреждение" "message": "Предупреждение"
@ -811,7 +888,7 @@
"message": "Что это?" "message": "Что это?"
}, },
"yourSigRequested": { "yourSigRequested": {
"message": "Ваша подпись запрашивается" "message": "Запрашивается ваша подпись"
}, },
"youSign": { "youSign": {
"message": "Вы подписываете" "message": "Вы подписываете"

View File

@ -3,10 +3,10 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
<title>MetaMask Plugin</title> <title>MetaMask</title>
</head> </head>
<body> <body>
<div id="app-content"></div> <div id="app-content"></div>
<script src="./scripts/popup.js" type="text/javascript" charset="utf-8"></script> <script src="./ui.js" type="text/javascript" charset="utf-8"></script>
</body> </body>
</html> </html>

View File

@ -27,8 +27,8 @@
"default_locale": "en", "default_locale": "en",
"background": { "background": {
"scripts": [ "scripts": [
"scripts/chromereload.js", "chromereload.js",
"scripts/background.js" "background.js"
], ],
"persistent": true "persistent": true
}, },
@ -48,7 +48,7 @@
"https://*/*" "https://*/*"
], ],
"js": [ "js": [
"scripts/contentscript.js" "contentscript.js"
], ],
"run_at": "document_start", "run_at": "document_start",
"all_frames": true "all_frames": true
@ -62,11 +62,11 @@
"https://*.infura.io/" "https://*.infura.io/"
], ],
"web_accessible_resources": [ "web_accessible_resources": [
"scripts/inpage.js" "inpage.js"
], ],
"externally_connectable": { "externally_connectable": {
"matches": [ "matches": [
"https://metamask.io/*" "https://metamask.io/*"
] ]
} }
} }

View File

@ -11,6 +11,6 @@
</head> </head>
<body class="notification" style="height:600px;"> <body class="notification" style="height:600px;">
<div id="app-content"></div> <div id="app-content"></div>
<script src="./scripts/popup.js" type="text/javascript" charset="utf-8"></script> <script src="./ui.js" type="text/javascript" charset="utf-8"></script>
</body> </body>
</html> </html>

View File

@ -3,10 +3,10 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
<title>MetaMask Plugin</title> <title>MetaMask</title>
</head> </head>
<body style="width:357px; height:600px;"> <body style="width:357px; height:600px;">
<div id="app-content"></div> <div id="app-content"></div>
<script src="./scripts/popup.js" type="text/javascript" charset="utf-8"></script> <script src="./ui.js" type="text/javascript" charset="utf-8"></script>
</body> </body>
</html> </html>

View File

@ -7,8 +7,8 @@ const ObjectMultiplex = require('obj-multiplex')
const extension = require('extensionizer') const extension = require('extensionizer')
const PortStream = require('./lib/port-stream.js') const PortStream = require('./lib/port-stream.js')
const inpageContent = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'scripts', 'inpage.js')).toString() const inpageContent = fs.readFileSync(path.join(__dirname, '..', '..', 'dist', 'chrome', 'inpage.js')).toString()
const inpageSuffix = '//# sourceURL=' + extension.extension.getURL('scripts/inpage.js') + '\n' const inpageSuffix = '//# sourceURL=' + extension.extension.getURL('inpage.js') + '\n'
const inpageBundle = inpageContent + inpageSuffix const inpageBundle = inpageContent + inpageSuffix
// Eventually this streaming injection could be replaced with: // Eventually this streaming injection could be replaced with:
@ -96,7 +96,7 @@ function logStreamDisconnectWarning (remoteLabel, err) {
} }
function shouldInjectWeb3 () { function shouldInjectWeb3 () {
return doctypeCheck() && suffixCheck() return doctypeCheck() && suffixCheck()
&& documentElementCheck() && !blacklistedDomainCheck() && documentElementCheck() && !blacklistedDomainCheck()
} }

View File

@ -52,7 +52,7 @@ class CurrencyController {
this.setConversionDate(Number(parsedResponse.timestamp)) this.setConversionDate(Number(parsedResponse.timestamp))
}).catch((err) => { }).catch((err) => {
if (err) { if (err) {
console.warn('MetaMask - Failed to query currency conversion.') console.warn(`MetaMask - Failed to query currency conversion:`, currentCurrency, err)
this.setConversionRate(0) this.setConversionRate(0)
this.setConversionDate('N/A') this.setConversionDate('N/A')
} }

View File

@ -161,9 +161,11 @@ module.exports = class TransactionController extends EventEmitter {
this.emit(`${txMeta.id}:unapproved`, txMeta) this.emit(`${txMeta.id}:unapproved`, txMeta)
} }
async newUnapprovedTransaction (txParams) { async newUnapprovedTransaction (txParams, opts = {}) {
log.debug(`MetaMaskController newUnapprovedTransaction ${JSON.stringify(txParams)}`) log.debug(`MetaMaskController newUnapprovedTransaction ${JSON.stringify(txParams)}`)
const initialTxMeta = await this.addUnapprovedTransaction(txParams) const initialTxMeta = await this.addUnapprovedTransaction(txParams)
initialTxMeta.origin = opts.origin
this.txStateManager.updateTx(initialTxMeta, '#newUnapprovedTransaction - adding the origin')
// listen for tx completion (success, fail) // listen for tx completion (success, fail)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.txStateManager.once(`${initialTxMeta.id}:finished`, (finishedTxMeta) => { this.txStateManager.once(`${initialTxMeta.id}:finished`, (finishedTxMeta) => {
@ -250,7 +252,7 @@ module.exports = class TransactionController extends EventEmitter {
// wait for a nonce // wait for a nonce
nonceLock = await this.nonceTracker.getNonceLock(fromAddress) nonceLock = await this.nonceTracker.getNonceLock(fromAddress)
// add nonce to txParams // add nonce to txParams
// if txMeta has lastGasPrice then it is a retry at same nonce with higher // if txMeta has lastGasPrice then it is a retry at same nonce with higher
// gas price transaction and their for the nonce should not be calculated // gas price transaction and their for the nonce should not be calculated
const nonce = txMeta.lastGasPrice ? txMeta.txParams.nonce : nonceLock.nextNonce const nonce = txMeta.lastGasPrice ? txMeta.txParams.nonce : nonceLock.nextNonce
txMeta.txParams.nonce = ethUtil.addHexPrefix(nonce.toString(16)) txMeta.txParams.nonce = ethUtil.addHexPrefix(nonce.toString(16))
@ -273,12 +275,14 @@ module.exports = class TransactionController extends EventEmitter {
async signTransaction (txId) { async signTransaction (txId) {
const txMeta = this.txStateManager.getTx(txId) const txMeta = this.txStateManager.getTx(txId)
const txParams = txMeta.txParams
const fromAddress = txParams.from
// add network/chain id // add network/chain id
txParams.chainId = ethUtil.addHexPrefix(this.getChainId().toString(16)) const chainId = this.getChainId()
const txParams = Object.assign({}, txMeta.txParams, { chainId })
// sign tx
const fromAddress = txParams.from
const ethTx = new Transaction(txParams) const ethTx = new Transaction(txParams)
await this.signEthTx(ethTx, fromAddress) await this.signEthTx(ethTx, fromAddress)
// set state to signed
this.txStateManager.setTxStatusSigned(txMeta.id) this.txStateManager.setTxStatusSigned(txMeta.id)
const rawTx = ethUtil.bufferToHex(ethTx.serialize()) const rawTx = ethUtil.bufferToHex(ethTx.serialize())
return rawTx return rawTx

View File

@ -31,14 +31,13 @@ class NonceTracker {
const networkNonceResult = await this._getNetworkNextNonce(address) const networkNonceResult = await this._getNetworkNextNonce(address)
const highestLocallyConfirmed = this._getHighestLocallyConfirmed(address) const highestLocallyConfirmed = this._getHighestLocallyConfirmed(address)
const nextNetworkNonce = networkNonceResult.nonce const nextNetworkNonce = networkNonceResult.nonce
const highestLocalNonce = highestLocallyConfirmed const highestSuggested = Math.max(nextNetworkNonce, highestLocallyConfirmed)
const highestSuggested = Math.max(nextNetworkNonce, highestLocalNonce)
const pendingTxs = this.getPendingTransactions(address) const pendingTxs = this.getPendingTransactions(address)
const localNonceResult = this._getHighestContinuousFrom(pendingTxs, highestSuggested) || 0 const localNonceResult = this._getHighestContinuousFrom(pendingTxs, highestSuggested) || 0
nonceDetails.params = { nonceDetails.params = {
highestLocalNonce, highestLocallyConfirmed,
highestSuggested, highestSuggested,
nextNetworkNonce, nextNetworkNonce,
} }

View File

@ -23,10 +23,20 @@ function setupRaven(opts) {
release, release,
transport: function(opts) { transport: function(opts) {
const report = opts.data const report = opts.data
// simplify ethjs error messages // simplify certain complex error messages
report.exception.values.forEach(item => { report.exception.values.forEach(item => {
item.value = extractEthjsErrorMessage(item.value) let errorMessage = item.value
// simplify ethjs error messages
errorMessage = extractEthjsErrorMessage(errorMessage)
// simplify 'Transaction Failed: known transaction'
if (errorMessage.indexOf('Transaction Failed: known transaction') === 0) {
// cut the hash from the error message
errorMessage = 'Transaction Failed: known transaction'
}
// finalize
item.value = errorMessage
}) })
// modify report urls // modify report urls
rewriteReportUrls(report) rewriteReportUrls(report)
// make request normally // make request normally

View File

@ -106,12 +106,9 @@ module.exports = class TransactionStateManager extends EventEmitter {
} }
updateTx (txMeta, note) { updateTx (txMeta, note) {
// validate txParams
if (txMeta.txParams) { if (txMeta.txParams) {
Object.keys(txMeta.txParams).forEach((key) => { this.validateTxParams(txMeta.txParams)
const value = txMeta.txParams[key]
if (typeof value !== 'string') console.error(`${key}: ${value} in txParams is not a string`)
if (!ethUtil.isHexPrefixed(value)) console.error('is not hex prefixed, anything on txParams must be hex prefixed')
})
} }
// create txMeta snapshot for history // create txMeta snapshot for history
@ -139,6 +136,15 @@ module.exports = class TransactionStateManager extends EventEmitter {
this.updateTx(txMeta, `txStateManager#updateTxParams`) this.updateTx(txMeta, `txStateManager#updateTxParams`)
} }
// validates txParams members by type
validateTxParams(txParams) {
Object.keys(txParams).forEach((key) => {
const value = txParams[key]
if (typeof value !== 'string') throw new Error(`${key}: ${value} in txParams is not a string`)
if (!ethUtil.isHexPrefixed(value)) throw new Error('is not hex prefixed, everything on txParams must be hex prefixed')
})
}
/* /*
Takes an object of fields to search for eg: Takes an object of fields to search for eg:
let thingsToLookFor = { let thingsToLookFor = {

View File

@ -57,7 +57,6 @@ module.exports = class MetamaskController extends EventEmitter {
this.defaultMaxListeners = 20 this.defaultMaxListeners = 20
this.sendUpdate = debounce(this.privateSendUpdate.bind(this), 200) this.sendUpdate = debounce(this.privateSendUpdate.bind(this), 200)
this.opts = opts this.opts = opts
const initState = opts.initState || {} const initState = opts.initState || {}
this.recordFirstTimeInfo(initState) this.recordFirstTimeInfo(initState)
@ -242,6 +241,11 @@ module.exports = class MetamaskController extends EventEmitter {
static: { static: {
eth_syncing: false, eth_syncing: false,
web3_clientVersion: `MetaMask/v${version}`, web3_clientVersion: `MetaMask/v${version}`,
eth_sendTransaction: (payload, next, end) => {
const origin = payload.origin
const txParams = payload.params[0]
nodeify(this.txController.newUnapprovedTransaction, this.txController)(txParams, { origin }, end)
},
}, },
// account mgmt // account mgmt
getAccounts: (cb) => { getAccounts: (cb) => {
@ -256,7 +260,6 @@ module.exports = class MetamaskController extends EventEmitter {
cb(null, result) cb(null, result)
}, },
// tx signing // tx signing
processTransaction: nodeify(async (txParams) => await this.txController.newUnapprovedTransaction(txParams), this),
// old style msg signing // old style msg signing
processMessage: this.newUnsignedMessage.bind(this), processMessage: this.newUnsignedMessage.bind(this),
// personal_sign msg signing // personal_sign msg signing

File diff suppressed because one or more lines are too long

View File

@ -1,37 +1,48 @@
var watchify = require('watchify') const watchify = require('watchify')
var browserify = require('browserify') const browserify = require('browserify')
var disc = require('disc') const disc = require('disc')
var gulp = require('gulp') const gulp = require('gulp')
var source = require('vinyl-source-stream') const source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer') const buffer = require('vinyl-buffer')
var gutil = require('gulp-util') const gutil = require('gulp-util')
var watch = require('gulp-watch') const watch = require('gulp-watch')
var sourcemaps = require('gulp-sourcemaps') const sourcemaps = require('gulp-sourcemaps')
var jsoneditor = require('gulp-json-editor') const jsoneditor = require('gulp-json-editor')
var zip = require('gulp-zip') const zip = require('gulp-zip')
var assign = require('lodash.assign') const assign = require('lodash.assign')
var livereload = require('gulp-livereload') const livereload = require('gulp-livereload')
var del = require('del') const del = require('del')
var eslint = require('gulp-eslint') const eslint = require('gulp-eslint')
var fs = require('fs') const fs = require('fs')
var path = require('path') const path = require('path')
var manifest = require('./app/manifest.json') const manifest = require('./app/manifest.json')
var gulpif = require('gulp-if') const replace = require('gulp-replace')
var replace = require('gulp-replace') const mkdirp = require('mkdirp')
var mkdirp = require('mkdirp') const asyncEach = require('async/each')
var asyncEach = require('async/each') const exec = require('child_process').exec
var exec = require('child_process').exec const sass = require('gulp-sass')
var sass = require('gulp-sass') const autoprefixer = require('gulp-autoprefixer')
var autoprefixer = require('gulp-autoprefixer') const gulpStylelint = require('gulp-stylelint')
var gulpStylelint = require('gulp-stylelint') const stylefmt = require('gulp-stylefmt')
var stylefmt = require('gulp-stylefmt') const uglify = require('gulp-uglify-es').default
var uglify = require('gulp-uglify-es').default const babel = require('gulp-babel')
var babel = require('gulp-babel') const debug = require('gulp-debug')
const pify = require('pify')
const endOfStream = pify(require('end-of-stream'))
var disableDebugTools = gutil.env.disableDebugTools const browserPlatforms = [
var debug = gutil.env.debug 'firefox',
'chrome',
'edge',
'opera',
]
const commonPlatforms = [
// browser webapp
'mascara',
// browser extensions
...browserPlatforms
]
// browser reload // browser reload
@ -41,65 +52,98 @@ gulp.task('dev:reload', function() {
}) })
}) })
// copy universal
// copy static const copyTaskNames = []
const copyDevTaskNames = []
gulp.task('copy:locales', copyTask({ createCopyTasks('locales', {
source: './app/_locales/', source: './app/_locales/',
destinations: [ destinations: commonPlatforms.map(platform => `./dist/${platform}/_locales`),
'./dist/firefox/_locales', })
'./dist/chrome/_locales', createCopyTasks('images', {
'./dist/edge/_locales',
'./dist/opera/_locales',
]
}))
gulp.task('copy:images', copyTask({
source: './app/images/', source: './app/images/',
destinations: [ destinations: commonPlatforms.map(platform => `./dist/${platform}/images`),
'./dist/firefox/images', })
'./dist/chrome/images', createCopyTasks('contractImages', {
'./dist/edge/images',
'./dist/opera/images',
],
}))
gulp.task('copy:contractImages', copyTask({
source: './node_modules/eth-contract-metadata/images/', source: './node_modules/eth-contract-metadata/images/',
destinations: [ destinations: commonPlatforms.map(platform => `./dist/${platform}/images/contract`),
'./dist/firefox/images/contract', })
'./dist/chrome/images/contract', createCopyTasks('fonts', {
'./dist/edge/images/contract',
'./dist/opera/images/contract',
],
}))
gulp.task('copy:fonts', copyTask({
source: './app/fonts/', source: './app/fonts/',
destinations: [ destinations: commonPlatforms.map(platform => `./dist/${platform}/fonts`),
'./dist/firefox/fonts', })
'./dist/chrome/fonts', createCopyTasks('reload', {
'./dist/edge/fonts', devOnly: true,
'./dist/opera/fonts',
],
}))
gulp.task('copy:reload', copyTask({
source: './app/scripts/', source: './app/scripts/',
destinations: [
'./dist/firefox/scripts',
'./dist/chrome/scripts',
'./dist/edge/scripts',
'./dist/opera/scripts',
],
pattern: '/chromereload.js', pattern: '/chromereload.js',
})) destinations: commonPlatforms.map(platform => `./dist/${platform}`),
gulp.task('copy:root', copyTask({ })
createCopyTasks('html', {
source: './app/', source: './app/',
destinations: [ pattern: '/*.html',
'./dist/firefox', destinations: commonPlatforms.map(platform => `./dist/${platform}`),
'./dist/chrome', })
'./dist/edge',
'./dist/opera', // copy extension
],
pattern: '/*', createCopyTasks('manifest', {
})) source: './app/',
pattern: '/*.json',
destinations: browserPlatforms.map(platform => `./dist/${platform}`),
})
// copy mascara
createCopyTasks('html:mascara', {
source: './mascara/',
pattern: 'proxy/index.html',
destinations: [`./dist/mascara/`],
})
function createCopyTasks(label, opts) {
if (!opts.devOnly) {
const copyTaskName = `copy:${label}`
copyTask(copyTaskName, opts)
copyTaskNames.push(copyTaskName)
}
const copyDevTaskName = `dev:copy:${label}`
copyTask(copyDevTaskName, Object.assign({ devMode: true }, opts))
copyDevTaskNames.push(copyDevTaskName)
}
function copyTask(taskName, opts){
const source = opts.source
const destination = opts.destination
const destinations = opts.destinations || [destination]
const pattern = opts.pattern || '/**/*'
const devMode = opts.devMode
return gulp.task(taskName, function () {
if (devMode) {
watch(source + pattern, (event) => {
livereload.changed(event.path)
performCopy()
})
}
return performCopy()
})
function performCopy() {
// stream from source
let stream = gulp.src(source + pattern, { base: source })
// copy to destinations
destinations.forEach(function(destination) {
stream = stream.pipe(gulp.dest(destination))
})
return stream
}
}
// manifest tinkering
gulp.task('manifest:chrome', function() { gulp.task('manifest:chrome', function() {
return gulp.src('./dist/chrome/manifest.json') return gulp.src('./dist/chrome/manifest.json')
@ -134,46 +178,32 @@ gulp.task('manifest:production', function() {
],{base: './dist/'}) ],{base: './dist/'})
// Exclude chromereload script in production: // Exclude chromereload script in production:
.pipe(gulpif(!debug,jsoneditor(function(json) { .pipe(jsoneditor(function(json) {
json.background.scripts = json.background.scripts.filter((script) => { json.background.scripts = json.background.scripts.filter((script) => {
return !script.includes('chromereload') return !script.includes('chromereload')
}) })
return json return json
}))) }))
.pipe(gulp.dest('./dist/', { overwrite: true })) .pipe(gulp.dest('./dist/', { overwrite: true }))
}) })
const staticFiles = [ gulp.task('copy',
'locales', gulp.series(
'images', gulp.parallel(...copyTaskNames),
'fonts', 'manifest:production',
'root' 'manifest:chrome',
] 'manifest:opera'
)
)
var copyStrings = staticFiles.map(staticFile => `copy:${staticFile}`) gulp.task('dev:copy',
copyStrings.push('copy:contractImages') gulp.series(
gulp.parallel(...copyDevTaskNames),
if (debug) { 'manifest:chrome',
copyStrings.push('copy:reload') 'manifest:opera'
} )
)
gulp.task('copy', gulp.series(gulp.parallel(...copyStrings), 'manifest:production', 'manifest:chrome', 'manifest:opera'))
gulp.task('copy:watch', function(){
gulp.watch(['./app/{_locales,images}/*', './app/scripts/chromereload.js', './app/*.{html,json}'], gulp.series('copy'))
})
// record deps
gulp.task('deps', function (cb) {
exec('npm ls', (err, stdoutOutput, stderrOutput) => {
if (err) return cb(err)
const browsers = ['firefox','chrome','edge','opera']
asyncEach(browsers, (target, done) => {
fs.writeFile(`./dist/${target}/deps.txt`, stdoutOutput, done)
}, cb)
})
})
// lint js // lint js
@ -196,41 +226,49 @@ gulp.task('lint:fix', function () {
.pipe(eslint.failAfterError()) .pipe(eslint.failAfterError())
}); });
/*
gulp.task('default', ['lint'], function () {
// This will only run if the lint task is successful...
});
*/
// build js
const jsFiles = [
'inpage',
'contentscript',
'background',
'popup',
]
// scss compilation and autoprefixing tasks // scss compilation and autoprefixing tasks
gulp.task('build:scss', function () { gulp.task('build:scss', createScssBuildTask({
return gulp.src('ui/app/css/index.scss') src: 'ui/app/css/index.scss',
.pipe(sourcemaps.init()) dest: 'ui/app/css/output',
.pipe(sass().on('error', sass.logError)) devMode: false,
.pipe(sourcemaps.write()) }))
.pipe(autoprefixer())
.pipe(gulp.dest('ui/app/css/output')) gulp.task('dev:scss', createScssBuildTask({
}) src: 'ui/app/css/index.scss',
gulp.task('watch:scss', function() { dest: 'ui/app/css/output',
gulp.watch(['ui/app/css/**/*.scss'], gulp.series(['build:scss'])) devMode: true,
}) pattern: 'ui/app/css/**/*.scss',
}))
function createScssBuildTask({ src, dest, devMode, pattern }) {
return function () {
if (devMode) {
watch(pattern, async (event) => {
const stream = buildScss()
await endOfStream(stream)
livereload.changed(event.path)
})
}
return buildScss()
}
function buildScss() {
return gulp.src(src)
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(autoprefixer())
.pipe(gulp.dest(dest))
}
}
gulp.task('lint-scss', function() { gulp.task('lint-scss', function() {
return gulp return gulp
.src('ui/app/css/itcss/**/*.scss') .src('ui/app/css/itcss/**/*.scss')
.pipe(gulpStylelint({ .pipe(gulpStylelint({
reporters: [ reporters: [
{formatter: 'string', console: true} { formatter: 'string', console: true }
], ],
fix: true, fix: true,
})); }));
@ -242,46 +280,84 @@ gulp.task('fmt-scss', function () {
.pipe(gulp.dest('ui/app/css/itcss')); .pipe(gulp.dest('ui/app/css/itcss'));
}); });
// build js
const buildJsFiles = [
'inpage',
'contentscript',
'background',
'ui',
]
// bundle tasks // bundle tasks
createTasksForBuildJsExtension({ buildJsFiles, taskPrefix: 'dev:extension:js', devMode: true })
createTasksForBuildJsExtension({ buildJsFiles, taskPrefix: 'build:extension:js' })
createTasksForBuildJsMascara({ taskPrefix: 'build:mascara:js' })
createTasksForBuildJsMascara({ taskPrefix: 'dev:mascara:js', devMode: true })
var jsDevStrings = jsFiles.map(jsFile => `dev:js:${jsFile}`) function createTasksForBuildJsExtension({ buildJsFiles, taskPrefix, devMode, bundleTaskOpts = {} }) {
var jsBuildStrings = jsFiles.map(jsFile => `build:js:${jsFile}`) // inpage must be built before all other scripts:
const rootDir = './app/scripts'
const nonInpageFiles = buildJsFiles.filter(file => file !== 'inpage')
const buildPhase1 = ['inpage']
const buildPhase2 = nonInpageFiles
const destinations = browserPlatforms.map(platform => `./dist/${platform}`)
bundleTaskOpts = Object.assign({
buildSourceMaps: true,
sourceMapDir: devMode ? './' : '../sourcemaps',
minifyBuild: !devMode,
buildWithFullPaths: devMode,
watch: devMode,
devMode,
}, bundleTaskOpts)
createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1, buildPhase2 })
}
jsFiles.forEach((jsFile) => { function createTasksForBuildJsMascara({ taskPrefix, devMode, bundleTaskOpts = {} }) {
gulp.task(`dev:js:${jsFile}`, bundleTask({ // inpage must be built before all other scripts:
watch: true, const rootDir = './mascara/src/'
label: jsFile, const buildPhase1 = ['ui', 'proxy', 'background', 'metamascara']
filename: `${jsFile}.js`, const destinations = ['./dist/mascara']
isBuild: false bundleTaskOpts = Object.assign({
})) buildSourceMaps: true,
gulp.task(`build:js:${jsFile}`, bundleTask({ sourceMapDir: './',
watch: false, minifyBuild: !devMode,
label: jsFile, buildWithFullPaths: devMode,
filename: `${jsFile}.js`, watch: devMode,
isBuild: true devMode,
})) }, bundleTaskOpts)
}) createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1 })
}
// inpage must be built before all other scripts: function createTasksForBuildJs({ rootDir, taskPrefix, bundleTaskOpts, destinations, buildPhase1 = [], buildPhase2 = [] }) {
const firstDevString = jsDevStrings.shift() // bundle task for each file
gulp.task('dev:js', gulp.series(firstDevString, gulp.parallel(...jsDevStrings))) const jsFiles = [].concat(buildPhase1, buildPhase2)
jsFiles.forEach((jsFile) => {
gulp.task(`${taskPrefix}:${jsFile}`, bundleTask(Object.assign({
label: jsFile,
filename: `${jsFile}.js`,
filepath: `${rootDir}/${jsFile}.js`,
destinations,
}, bundleTaskOpts)))
})
// compose into larger task
const subtasks = []
subtasks.push(gulp.parallel(buildPhase1.map(file => `${taskPrefix}:${file}`)))
if (buildPhase2.length) subtasks.push(gulp.parallel(buildPhase2.map(file => `${taskPrefix}:${file}`)))
// inpage must be built before all other scripts: gulp.task(taskPrefix, gulp.series(subtasks))
const firstBuildString = jsBuildStrings.shift() }
gulp.task('build:js', gulp.series(firstBuildString, gulp.parallel(...jsBuildStrings)))
// disc bundle analyzer tasks // disc bundle analyzer tasks
jsFiles.forEach((jsFile) => { buildJsFiles.forEach((jsFile) => {
gulp.task(`disc:${jsFile}`, discTask({ label: jsFile, filename: `${jsFile}.js` })) gulp.task(`disc:${jsFile}`, discTask({ label: jsFile, filename: `${jsFile}.js` }))
}) })
gulp.task('disc', gulp.parallel(jsFiles.map(jsFile => `disc:${jsFile}`))) gulp.task('disc', gulp.parallel(buildJsFiles.map(jsFile => `disc:${jsFile}`)))
// clean dist // clean dist
gulp.task('clean', function clean() { gulp.task('clean', function clean() {
return del(['./dist/*']) return del(['./dist/*'])
}) })
@ -293,40 +369,95 @@ gulp.task('zip:edge', zipTask('edge'))
gulp.task('zip:opera', zipTask('opera')) gulp.task('zip:opera', zipTask('opera'))
gulp.task('zip', gulp.parallel('zip:chrome', 'zip:firefox', 'zip:edge', 'zip:opera')) gulp.task('zip', gulp.parallel('zip:chrome', 'zip:firefox', 'zip:edge', 'zip:opera'))
// set env var for production // set env for production
gulp.task('apply-prod-environment', function(done) { gulp.task('apply-prod-environment', function(done) {
process.env.NODE_ENV = 'production' process.env.NODE_ENV = 'production'
done() done()
}); });
// high level tasks // high level tasks
gulp.task('dev', gulp.series('build:scss', 'dev:js', 'copy', gulp.parallel('watch:scss', 'copy:watch', 'dev:reload'))) gulp.task('dev',
gulp.series(
'clean',
'dev:scss',
gulp.parallel(
'dev:extension:js',
'dev:mascara:js',
'dev:copy',
'dev:reload'
)
)
)
gulp.task('build', gulp.series('clean', 'build:scss', gulp.parallel('build:js', 'copy'))) gulp.task('dev:extension',
gulp.task('dist', gulp.series('apply-prod-environment', 'build', 'zip')) gulp.series(
'clean',
'dev:scss',
gulp.parallel(
'dev:extension:js',
'dev:copy',
'dev:reload'
)
)
)
gulp.task('dev:mascara',
gulp.series(
'clean',
'dev:scss',
gulp.parallel(
'dev:mascara:js',
'dev:copy',
'dev:reload'
)
)
)
gulp.task('build',
gulp.series(
'clean',
'build:scss',
gulp.parallel(
'build:extension:js',
'build:mascara:js',
'copy'
)
)
)
gulp.task('build:extension',
gulp.series(
'clean',
'build:scss',
gulp.parallel(
'build:extension:js',
'copy'
)
)
)
gulp.task('build:mascara',
gulp.series(
'clean',
'build:scss',
gulp.parallel(
'build:mascara:js',
'copy'
)
)
)
gulp.task('dist',
gulp.series(
'apply-prod-environment',
'build',
'zip'
)
)
// task generators // task generators
function copyTask(opts){
var source = opts.source
var destination = opts.destination
var destinations = opts.destinations || [ destination ]
var pattern = opts.pattern || '/**/*'
return performCopy
function performCopy(){
let stream = gulp.src(source + pattern, { base: source })
destinations.forEach(function(destination) {
stream = stream.pipe(gulp.dest(destination))
})
stream.pipe(gulpif(debug,livereload()))
return stream
}
}
function zipTask(target) { function zipTask(target) {
return () => { return () => {
return gulp.src(`dist/${target}/**`) return gulp.src(`dist/${target}/**`)
@ -337,10 +468,10 @@ function zipTask(target) {
function generateBundler(opts, performBundle) { function generateBundler(opts, performBundle) {
const browserifyOpts = assign({}, watchify.args, { const browserifyOpts = assign({}, watchify.args, {
entries: ['./app/scripts/'+opts.filename], entries: [opts.filepath],
plugin: 'browserify-derequire', plugin: 'browserify-derequire',
debug: true, debug: opts.buildSourceMaps,
fullPaths: debug, fullPaths: opts.buildWithFullPaths,
}) })
let bundler = browserify(browserifyOpts) let bundler = browserify(browserifyOpts)
@ -348,13 +479,21 @@ function generateBundler(opts, performBundle) {
if (opts.watch) { if (opts.watch) {
bundler = watchify(bundler) bundler = watchify(bundler)
// on any file update, re-runs the bundler // on any file update, re-runs the bundler
bundler.on('update', performBundle) bundler.on('update', async (ids) => {
const stream = performBundle()
await endOfStream(stream)
livereload.changed(`${ids}`)
})
} }
return bundler return bundler
} }
function discTask(opts) { function discTask(opts) {
opts = Object.assign({
buildWithFullPaths: true,
}, opts)
const bundler = generateBundler(opts, performBundle) const bundler = generateBundler(opts, performBundle)
// output build logs to terminal // output build logs to terminal
bundler.on('log', gutil.log) bundler.on('log', gutil.log)
@ -363,9 +502,9 @@ function discTask(opts) {
function performBundle(){ function performBundle(){
// start "disc" build // start "disc" build
let discDir = path.join(__dirname, 'disc') const discDir = path.join(__dirname, 'disc')
mkdirp.sync(discDir) mkdirp.sync(discDir)
let discPath = path.join(discDir, `${opts.label}.html`) const discPath = path.join(discDir, `${opts.label}.html`)
return ( return (
bundler.bundle() bundler.bundle()
@ -384,43 +523,58 @@ function bundleTask(opts) {
return performBundle return performBundle
function performBundle(){ function performBundle(){
return ( let buildStream = bundler.bundle()
bundler.bundle() // handle errors
buildStream.on('error', (err) => {
beep()
if (opts.watch) {
console.warn(err.stack)
} else {
throw err
}
})
// handle errors // process bundles
.on('error', (err) => { buildStream = buildStream
beep()
if (opts.watch) {
console.warn(err.stack)
} else {
throw err
}
})
// convert bundle stream to gulp vinyl stream // convert bundle stream to gulp vinyl stream
.pipe(source(opts.filename)) .pipe(source(opts.filename))
// inject variables into bundle // inject variables into bundle
.pipe(replace('\'GULP_METAMASK_DEBUG\'', debug)) .pipe(replace('\'GULP_METAMASK_DEBUG\'', opts.devMode))
// buffer file contents (?) // buffer file contents (?)
.pipe(buffer()) .pipe(buffer())
// sourcemaps
// loads map from browserify file
.pipe(sourcemaps.init({ loadMaps: true }))
// Minification
.pipe(gulpif(opts.isBuild, uglify({
mangle: { reserved: [ 'MetamaskInpageProvider' ] },
})))
// writes .map file
.pipe(sourcemaps.write(debug ? './' : '../../sourcemaps'))
// write completed bundles
.pipe(gulp.dest('./dist/firefox/scripts'))
.pipe(gulp.dest('./dist/chrome/scripts'))
.pipe(gulp.dest('./dist/edge/scripts'))
.pipe(gulp.dest('./dist/opera/scripts'))
// finally, trigger live reload
.pipe(gulpif(debug, livereload()))
)
// Initialize Source Maps
if (opts.buildSourceMaps) {
buildStream = buildStream
// loads map from browserify file
.pipe(sourcemaps.init({ loadMaps: true }))
}
// Minification
if (opts.minifyBuild) {
buildStream = buildStream
.pipe(uglify({
mangle: {
reserved: [ 'MetamaskInpageProvider' ]
},
}))
}
// Finalize Source Maps (writes .map file)
if (opts.buildSourceMaps) {
buildStream = buildStream
.pipe(sourcemaps.write(opts.sourceMapDir))
}
// write completed bundles
opts.destinations.forEach((dest) => {
buildStream = buildStream.pipe(gulp.dest(dest))
})
return buildStream
} }
} }

View File

@ -17,4 +17,4 @@
Hello! I am the MetaMask iframe. Hello! I am the MetaMask iframe.
<script src="./proxy.js"></script> <script src="./proxy.js"></script>
</body> </body>
</html> </html>

View File

@ -1,7 +1,5 @@
const path = require('path') const path = require('path')
const express = require('express') const express = require('express')
const createBundle = require('./util').createBundle
const serveBundle = require('./util').serveBundle
const compression = require('compression') const compression = require('compression')
module.exports = createMetamascaraServer module.exports = createMetamascaraServer
@ -9,27 +7,14 @@ module.exports = createMetamascaraServer
function createMetamascaraServer () { function createMetamascaraServer () {
// start bundlers // setup server
const metamascaraBundle = createBundle(path.join(__dirname, '/../src/mascara.js'))
const proxyBundle = createBundle(path.join(__dirname, '/../src/proxy.js'))
const uiBundle = createBundle(path.join(__dirname, '/../src/ui.js'))
const backgroundBuild = createBundle(path.join(__dirname, '/../src/background.js'))
// serve bundles
const server = express() const server = express()
server.use(compression()) server.use(compression())
// ui window // serve assets
serveBundle(server, '/ui.js', uiBundle)
server.use(express.static(path.join(__dirname, '/../ui/'), { setHeaders: (res) => res.set('X-Frame-Options', 'DENY') })) server.use(express.static(path.join(__dirname, '/../ui/'), { setHeaders: (res) => res.set('X-Frame-Options', 'DENY') }))
server.use(express.static(path.join(__dirname, '/../../dist/chrome'))) server.use(express.static(path.join(__dirname, '/../../dist/mascara')))
// metamascara server.use(express.static(path.join(__dirname, '/../proxy')))
serveBundle(server, '/metamascara.js', metamascaraBundle)
// proxy
serveBundle(server, '/proxy/proxy.js', proxyBundle)
server.use('/proxy/', express.static(path.join(__dirname, '/../proxy')))
// background
serveBundle(server, '/background.js', backgroundBuild)
return server return server

View File

@ -30,15 +30,19 @@ global.addEventListener('activate', function (event) {
log.debug('inside:open') log.debug('inside:open')
// state persistence
// // state persistence
const dbController = new DbController({ const dbController = new DbController({
key: STORAGE_KEY, key: STORAGE_KEY,
}) })
loadStateFromPersistence()
.then((initState) => setupController(initState)) start().catch(log.error)
.then(() => log.debug('MetaMask initialization complete.'))
.catch((err) => console.error('WHILE SETTING UP:', err)) async function start() {
log.debug('MetaMask initializing...')
const initState = await loadStateFromPersistence()
await setupController(initState)
log.debug('MetaMask initialization complete.')
}
// //
// State and Persistence // State and Persistence

View File

@ -1,13 +1,13 @@
const createParentStream = require('iframe-stream').ParentStream const createParentStream = require('iframe-stream').ParentStream
const SWcontroller = require('client-sw-ready-event/lib/sw-client.js') const SwController = require('sw-controller')
const SwStream = require('sw-stream/lib/sw-stream.js') const SwStream = require('sw-stream/lib/sw-stream.js')
const intervalDelay = Math.floor(Math.random() * (30000 - 1000)) + 1000 const keepAliveDelay = Math.floor(Math.random() * (30000 - 1000)) + 1000
const background = new SWcontroller({ const background = new SwController({
fileName: '/background.js', fileName: './scripts/background.js',
letBeIdle: false, keepAlive: true,
wakeUpInterval: 30000, keepAliveInterval: 30000,
intervalDelay, keepAliveDelay,
}) })
const pageStream = createParentStream() const pageStream = createParentStream()

View File

@ -1,6 +1,6 @@
const injectCss = require('inject-css') const injectCss = require('inject-css')
const SWcontroller = require('client-sw-ready-event/lib/sw-client.js') const SwController = require('sw-controller')
const SwStream = require('sw-stream/lib/sw-stream.js') const SwStream = require('sw-stream')
const MetaMaskUiCss = require('../../ui/css') const MetaMaskUiCss = require('../../ui/css')
const MetamascaraPlatform = require('../../app/scripts/platforms/window') const MetamascaraPlatform = require('../../app/scripts/platforms/window')
const startPopup = require('../../app/scripts/popup-core') const startPopup = require('../../app/scripts/popup-core')
@ -8,27 +8,44 @@ const startPopup = require('../../app/scripts/popup-core')
// create platform global // create platform global
global.platform = new MetamascaraPlatform() global.platform = new MetamascaraPlatform()
var css = MetaMaskUiCss() var css = MetaMaskUiCss()
injectCss(css) injectCss(css)
const container = document.getElementById('app-content') const container = document.getElementById('app-content')
var name = 'popup' const name = 'popup'
window.METAMASK_UI_TYPE = name window.METAMASK_UI_TYPE = name
window.METAMASK_PLATFORM_TYPE = 'mascara' window.METAMASK_PLATFORM_TYPE = 'mascara'
const intervalDelay = Math.floor(Math.random() * (30000 - 1000)) + 1000 const keepAliveDelay = Math.floor(Math.random() * (30000 - 1000)) + 1000
const background = new SWcontroller({ const swController = new SwController({
fileName: '/background.js', fileName: './background.js',
letBeIdle: false, keepAlive: true,
intervalDelay, keepAliveDelay,
wakeUpInterval: 20000, keepAliveInterval: 20000,
}) })
swController.once('updatefound', windowReload)
swController.once('ready', async () => {
try {
swController.removeListener('updatefound', windowReload)
console.log('swController ready')
await timeout(1000)
console.log('connecting to app')
await connectApp()
console.log('app connected')
} catch (err) {
console.error(err)
}
})
console.log('starting service worker')
swController.startWorker()
// Setup listener for when the service worker is read // Setup listener for when the service worker is read
const connectApp = function (readSw) { function connectApp() {
const connectionStream = SwStream({ const connectionStream = SwStream({
serviceWorker: background.controller, serviceWorker: swController.getWorker(),
context: name, context: name,
}) })
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@ -43,19 +60,6 @@ const connectApp = function (readSw) {
}) })
}) })
} }
background.on('ready', async (sw) => {
try {
background.removeListener('updatefound', connectApp)
await timeout(1000)
await connectApp(sw)
console.log('hello from cb ready event!')
} catch (e) {
console.error(e)
}
})
background.on('updatefound', windowReload)
background.startWorker()
function windowReload () { function windowReload () {
if (window.METAMASK_SKIP_RELOAD) return if (window.METAMASK_SKIP_RELOAD) return

View File

@ -7,6 +7,6 @@
</head> </head>
<body> <body>
<div id="app-content"></div> <div id="app-content"></div>
<script src="./ui.js" type="text/javascript" charset="utf-8"></script> <script src="./scripts/ui.js" type="text/javascript" charset="utf-8"></script>
</body> </body>
</html> </html>

View File

@ -171,7 +171,7 @@ App.prototype.renderAppBar = function () {
h('img', { h('img', {
height: 24, height: 24,
width: 24, width: 24,
src: '/images/icon-128.png', src: './images/icon-128.png',
}), }),
h(NetworkIndicator, { h(NetworkIndicator, {

View File

@ -62,8 +62,8 @@ PendingTx.prototype.render = function () {
const gasBn = hexToBn(gas) const gasBn = hexToBn(gas)
// default to 8MM gas limit // default to 8MM gas limit
const gasLimit = new BN(parseInt(blockGasLimit) || '8000000') const gasLimit = new BN(parseInt(blockGasLimit) || '8000000')
const safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 19, 20) const safeGasLimitBN = this.bnMultiplyByFraction(gasLimit, 99, 100)
const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 18, 20) const saferGasLimitBN = this.bnMultiplyByFraction(gasLimit, 98, 100)
const safeGasLimit = safeGasLimitBN.toString(10) const safeGasLimit = safeGasLimitBN.toString(10)
// Gas Price // Gas Price
@ -311,7 +311,7 @@ PendingTx.prototype.render = function () {
style: { style: {
fontSize: '0.9em', fontSize: '0.9em',
}, },
}, 'Gas limit set dangerously high. Approving this transaction is likely to fail.') }, 'Gas limit set dangerously high. Approving this transaction is liable to fail.')
: null, : null,
]), ]),

View File

@ -31,6 +31,11 @@ function TransactionListItem () {
TransactionListItem.prototype.showRetryButton = function () { TransactionListItem.prototype.showRetryButton = function () {
const { transaction = {}, transactions } = this.props const { transaction = {}, transactions } = this.props
const { status, submittedTime, txParams } = transaction const { status, submittedTime, txParams } = transaction
if (!txParams) {
return false
}
const currentNonce = txParams.nonce const currentNonce = txParams.nonce
const currentNonceTxs = transactions.filter(tx => tx.txParams.nonce === currentNonce) const currentNonceTxs = transactions.filter(tx => tx.txParams.nonce === currentNonce)
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted') const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted')

529
package-lock.json generated
View File

@ -224,6 +224,15 @@
} }
} }
}, },
"@sinonjs/formatio": {
"version": "2.0.0",
"resolved": "http://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz",
"integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==",
"dev": true,
"requires": {
"samsam": "1.3.0"
}
},
"@types/node": { "@types/node": {
"version": "8.5.5", "version": "8.5.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.5.5.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-8.5.5.tgz",
@ -3116,11 +3125,6 @@
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz",
"integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk="
}, },
"client-sw-ready-event": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/client-sw-ready-event/-/client-sw-ready-event-3.4.0.tgz",
"integrity": "sha1-/0hkYXaQVed0hXDxrvECuGdbZtA="
},
"cliui": { "cliui": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
@ -5202,12 +5206,20 @@
"dev": true "dev": true
}, },
"eslint-plugin-mocha": { "eslint-plugin-mocha": {
"version": "4.11.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-4.11.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-5.0.0.tgz",
"integrity": "sha1-kRk6L1XiCl41l0BUoAidMBmO5Xg=", "integrity": "sha512-mpRWWsjxRco2bY4qE5DL8SmGoVF0Onb6DZrbgOjFoNo1YNN299K2voIozd8Kce3qC/neWNr2XF27E1ZDMl1yZg==",
"dev": true, "dev": true,
"requires": { "requires": {
"ramda": "0.24.1" "ramda": "0.25.0"
},
"dependencies": {
"ramda": {
"version": "0.25.0",
"resolved": "https://registry.npmjs.org/ramda/-/ramda-0.25.0.tgz",
"integrity": "sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ==",
"dev": true
}
} }
}, },
"eslint-plugin-react": { "eslint-plugin-react": {
@ -5735,7 +5747,7 @@
"ethereumjs-vm": "2.3.2", "ethereumjs-vm": "2.3.2",
"through2": "2.0.3", "through2": "2.0.3",
"treeify": "1.1.0", "treeify": "1.1.0",
"web3-provider-engine": "13.6.0" "web3-provider-engine": "13.8.0"
} }
}, },
"ethereum-common": { "ethereum-common": {
@ -6090,12 +6102,12 @@
} }
}, },
"ethjs-query": { "ethjs-query": {
"version": "0.3.2", "version": "0.3.4",
"resolved": "https://registry.npmjs.org/ethjs-query/-/ethjs-query-0.3.2.tgz", "resolved": "https://registry.npmjs.org/ethjs-query/-/ethjs-query-0.3.4.tgz",
"integrity": "sha1-9IikjOGZTNTHfsy3tSkCxvKc/YU=", "integrity": "sha512-RkeLtBwuXJkBIf/U+Az0GOT203UiBLmN7WA6WZIwSTbmhH2yNicggwaWKvN3TOtpErOsXnzYTZp82mElHdORUQ==",
"requires": { "requires": {
"ethjs-format": "0.2.4", "ethjs-format": "0.2.5",
"ethjs-rpc": "0.1.8" "ethjs-rpc": "0.1.9"
}, },
"dependencies": { "dependencies": {
"bn.js": { "bn.js": {
@ -6104,12 +6116,12 @@
"integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU="
}, },
"ethjs-format": { "ethjs-format": {
"version": "0.2.4", "version": "0.2.5",
"resolved": "https://registry.npmjs.org/ethjs-format/-/ethjs-format-0.2.4.tgz", "resolved": "https://registry.npmjs.org/ethjs-format/-/ethjs-format-0.2.5.tgz",
"integrity": "sha1-W7vESlrSTmirOTMS/5A5pztlv4E=", "integrity": "sha1-RPMKvuF7B01xYtLIhqv/0GWCiSU=",
"requires": { "requires": {
"bn.js": "4.11.6", "bn.js": "4.11.6",
"ethjs-schema": "0.1.9", "ethjs-schema": "0.2.0",
"ethjs-util": "0.1.3", "ethjs-util": "0.1.3",
"is-hex-prefixed": "1.0.0", "is-hex-prefixed": "1.0.0",
"number-to-bn": "1.7.0", "number-to-bn": "1.7.0",
@ -6117,9 +6129,14 @@
} }
}, },
"ethjs-rpc": { "ethjs-rpc": {
"version": "0.1.8", "version": "0.1.9",
"resolved": "https://registry.npmjs.org/ethjs-rpc/-/ethjs-rpc-0.1.8.tgz", "resolved": "https://registry.npmjs.org/ethjs-rpc/-/ethjs-rpc-0.1.9.tgz",
"integrity": "sha1-FnZ0DkHHIoGWpxGJ0z8VychbWZ0=" "integrity": "sha512-KJqT7cgTeCJQ2RY1AlVmTZVnKIUXMPg+niPN5VJKwRSzpjgfr3LTVHlGbkRCqZtOMDi0ogB2vHZaRQiZBXZTUg=="
},
"ethjs-schema": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/ethjs-schema/-/ethjs-schema-0.2.0.tgz",
"integrity": "sha1-B7RtT1W3kqhGyQp58zDTHREsyjg="
}, },
"ethjs-util": { "ethjs-util": {
"version": "0.1.3", "version": "0.1.3",
@ -8170,6 +8187,11 @@
"integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=",
"dev": true "dev": true
}, },
"get-own-enumerable-property-symbols": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz",
"integrity": "sha512-TtY/sbOemiMKPRUDDanGCSgBYe7Mf0vbRsWnBZ+9yghpZ1MvcpSpuZFjHdEeY/LZjZy0vdLjS77L6HosisFiug=="
},
"get-stdin": { "get-stdin": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-3.0.2.tgz", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-3.0.2.tgz",
@ -8606,6 +8628,52 @@
} }
} }
}, },
"gulp-debug": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/gulp-debug/-/gulp-debug-3.2.0.tgz",
"integrity": "sha512-2LZzP+ydczqz1rhqq/NYxvVvYTmOa0IgBl2B1sQTdkQgku9ayOUM/KHuGPjF4QA5aO1VcG+Sskw7iCcRUqHKkA==",
"requires": {
"chalk": "2.3.2",
"fancy-log": "1.3.2",
"plur": "2.1.2",
"stringify-object": "3.2.2",
"through2": "2.0.3",
"tildify": "1.2.0"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"requires": {
"color-convert": "1.9.1"
}
},
"chalk": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz",
"integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==",
"requires": {
"ansi-styles": "3.2.1",
"escape-string-regexp": "1.0.5",
"supports-color": "5.3.0"
}
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
},
"supports-color": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz",
"integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==",
"requires": {
"has-flag": "3.0.0"
}
}
}
},
"gulp-eslint": { "gulp-eslint": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/gulp-eslint/-/gulp-eslint-4.0.0.tgz", "resolved": "https://registry.npmjs.org/gulp-eslint/-/gulp-eslint-4.0.0.tgz",
@ -9182,7 +9250,7 @@
"dev": true, "dev": true,
"requires": { "requires": {
"anymatch": "1.3.2", "anymatch": "1.3.2",
"chokidar": "2.0.1", "chokidar": "2.0.3",
"glob-parent": "3.1.0", "glob-parent": "3.1.0",
"gulp-util": "3.0.8", "gulp-util": "3.0.8",
"object-assign": "4.1.1", "object-assign": "4.1.1",
@ -9206,9 +9274,9 @@
"dev": true "dev": true
}, },
"braces": { "braces": {
"version": "2.3.0", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/braces/-/braces-2.3.0.tgz", "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz",
"integrity": "sha512-P4O8UQRdGiMLWSizsApmXVQDBS6KCt7dSexgLKBmH5Hr1CZq7vsnscFh8oR1sP1ab1Zj0uCHCEzZeV6SfUf3rA==", "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"arr-flatten": "1.1.0", "arr-flatten": "1.1.0",
@ -9217,22 +9285,43 @@
"extend-shallow": "2.0.1", "extend-shallow": "2.0.1",
"fill-range": "4.0.0", "fill-range": "4.0.0",
"isobject": "3.0.1", "isobject": "3.0.1",
"kind-of": "6.0.2",
"repeat-element": "1.1.2", "repeat-element": "1.1.2",
"snapdragon": "0.8.1", "snapdragon": "0.8.1",
"snapdragon-node": "2.1.1", "snapdragon-node": "2.1.1",
"split-string": "3.1.0", "split-string": "3.1.0",
"to-regex": "3.0.1" "to-regex": "3.0.2"
},
"dependencies": {
"define-property": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
"integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
"dev": true,
"requires": {
"is-descriptor": "1.0.2"
}
},
"extend-shallow": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"dev": true,
"requires": {
"is-extendable": "0.1.1"
}
}
} }
}, },
"chokidar": { "chokidar": {
"version": "2.0.1", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.1.tgz", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz",
"integrity": "sha512-rv5iP8ENhpqvDWr677rAXcB+SMoPQ1urd4ch79+PhM4lQwbATdJUQK69t0lJIKNB+VXpqxt5V1gvqs59XEPKnw==", "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==",
"dev": true, "dev": true,
"requires": { "requires": {
"anymatch": "2.0.0", "anymatch": "2.0.0",
"async-each": "1.0.1", "async-each": "1.0.1",
"braces": "2.3.0", "braces": "2.3.1",
"fsevents": "1.1.3", "fsevents": "1.1.3",
"glob-parent": "3.1.0", "glob-parent": "3.1.0",
"inherits": "2.0.3", "inherits": "2.0.3",
@ -9241,7 +9330,7 @@
"normalize-path": "2.1.1", "normalize-path": "2.1.1",
"path-is-absolute": "1.0.1", "path-is-absolute": "1.0.1",
"readdirp": "2.1.0", "readdirp": "2.1.0",
"upath": "1.0.0" "upath": "1.0.4"
}, },
"dependencies": { "dependencies": {
"anymatch": { "anymatch": {
@ -9250,12 +9339,22 @@
"integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==",
"dev": true, "dev": true,
"requires": { "requires": {
"micromatch": "3.1.5", "micromatch": "3.1.10",
"normalize-path": "2.1.1" "normalize-path": "2.1.1"
} }
} }
} }
}, },
"define-property": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
"integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
"dev": true,
"requires": {
"is-descriptor": "1.0.2",
"isobject": "3.0.1"
}
},
"expand-brackets": { "expand-brackets": {
"version": "2.1.4", "version": "2.1.4",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
@ -9268,7 +9367,7 @@
"posix-character-classes": "0.1.1", "posix-character-classes": "0.1.1",
"regex-not": "1.0.0", "regex-not": "1.0.0",
"snapdragon": "0.8.1", "snapdragon": "0.8.1",
"to-regex": "3.0.1" "to-regex": "3.0.2"
}, },
"dependencies": { "dependencies": {
"define-property": { "define-property": {
@ -9279,6 +9378,53 @@
"requires": { "requires": {
"is-descriptor": "0.1.6" "is-descriptor": "0.1.6"
} }
},
"extend-shallow": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"dev": true,
"requires": {
"is-extendable": "0.1.1"
}
},
"is-descriptor": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
"integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
"dev": true,
"requires": {
"is-accessor-descriptor": "0.1.6",
"is-data-descriptor": "0.1.4",
"kind-of": "5.1.0"
}
},
"kind-of": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
"integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
"dev": true
}
}
},
"extend-shallow": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
"integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
"dev": true,
"requires": {
"assign-symbols": "1.0.0",
"is-extendable": "1.0.1"
},
"dependencies": {
"is-extendable": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
"integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
"dev": true,
"requires": {
"is-plain-object": "2.0.4"
}
} }
} }
}, },
@ -9295,7 +9441,27 @@
"fragment-cache": "0.2.1", "fragment-cache": "0.2.1",
"regex-not": "1.0.0", "regex-not": "1.0.0",
"snapdragon": "0.8.1", "snapdragon": "0.8.1",
"to-regex": "3.0.1" "to-regex": "3.0.2"
},
"dependencies": {
"define-property": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
"integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=",
"dev": true,
"requires": {
"is-descriptor": "1.0.2"
}
},
"extend-shallow": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"dev": true,
"requires": {
"is-extendable": "0.1.1"
}
}
} }
}, },
"fill-range": { "fill-range": {
@ -9308,6 +9474,17 @@
"is-number": "3.0.0", "is-number": "3.0.0",
"repeat-string": "1.6.1", "repeat-string": "1.6.1",
"to-regex-range": "2.1.1" "to-regex-range": "2.1.1"
},
"dependencies": {
"extend-shallow": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
"dev": true,
"requires": {
"is-extendable": "0.1.1"
}
}
} }
}, },
"glob-parent": { "glob-parent": {
@ -9371,25 +9548,6 @@
} }
} }
}, },
"is-descriptor": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
"integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
"dev": true,
"requires": {
"is-accessor-descriptor": "0.1.6",
"is-data-descriptor": "0.1.4",
"kind-of": "5.1.0"
},
"dependencies": {
"kind-of": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
"integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
"dev": true
}
}
},
"is-extglob": { "is-extglob": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@ -9438,24 +9596,48 @@
"dev": true "dev": true
}, },
"micromatch": { "micromatch": {
"version": "3.1.5", "version": "3.1.10",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.5.tgz", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
"integrity": "sha512-ykttrLPQrz1PUJcXjwsTUjGoPJ64StIGNE2lGVD1c9CuguJ+L7/navsE8IcDNndOoCMvYV0qc/exfVbMHkUhvA==", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
"dev": true, "dev": true,
"requires": { "requires": {
"arr-diff": "4.0.0", "arr-diff": "4.0.0",
"array-unique": "0.3.2", "array-unique": "0.3.2",
"braces": "2.3.0", "braces": "2.3.1",
"define-property": "1.0.0", "define-property": "2.0.2",
"extend-shallow": "2.0.1", "extend-shallow": "3.0.2",
"extglob": "2.0.4", "extglob": "2.0.4",
"fragment-cache": "0.2.1", "fragment-cache": "0.2.1",
"kind-of": "6.0.2", "kind-of": "6.0.2",
"nanomatch": "1.2.7", "nanomatch": "1.2.9",
"object.pick": "1.3.0", "object.pick": "1.3.0",
"regex-not": "1.0.0", "regex-not": "1.0.0",
"snapdragon": "0.8.1", "snapdragon": "0.8.1",
"to-regex": "3.0.1" "to-regex": "3.0.2"
}
},
"to-regex": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
"integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
"dev": true,
"requires": {
"define-property": "2.0.2",
"extend-shallow": "3.0.2",
"regex-not": "1.0.2",
"safe-regex": "1.1.0"
},
"dependencies": {
"regex-not": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
"integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
"dev": true,
"requires": {
"extend-shallow": "3.0.2",
"safe-regex": "1.1.0"
}
}
} }
} }
} }
@ -10352,8 +10534,7 @@
"irregular-plurals": { "irregular-plurals": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-1.4.0.tgz", "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-1.4.0.tgz",
"integrity": "sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y=", "integrity": "sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y="
"dev": true
}, },
"is-absolute": { "is-absolute": {
"version": "1.0.0", "version": "1.0.0",
@ -10581,23 +10762,25 @@
"integrity": "sha1-8mWrian0RQNO9q/xWo8AsA9VF5k=", "integrity": "sha1-8mWrian0RQNO9q/xWo8AsA9VF5k=",
"dev": true "dev": true
}, },
"is-obj": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8="
},
"is-odd": { "is-odd": {
"version": "1.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-odd/-/is-odd-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz",
"integrity": "sha1-O4qTLrAos3dcObsJ6RdnrM22kIg=", "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"is-number": "3.0.0" "is-number": "4.0.0"
}, },
"dependencies": { "dependencies": {
"is-number": { "is-number": {
"version": "3.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz",
"integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==",
"dev": true, "dev": true
"requires": {
"kind-of": "3.2.2"
}
} }
} }
}, },
@ -10673,8 +10856,7 @@
"is-regexp": { "is-regexp": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz",
"integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk="
"dev": true
}, },
"is-relative": { "is-relative": {
"version": "1.0.0", "version": "1.0.0",
@ -12459,9 +12641,9 @@
"integrity": "sha1-rgyqVhERSYxboTcj1vtjHSQAOTQ=" "integrity": "sha1-rgyqVhERSYxboTcj1vtjHSQAOTQ="
}, },
"lolex": { "lolex": {
"version": "2.3.1", "version": "2.3.2",
"resolved": "https://registry.npmjs.org/lolex/-/lolex-2.3.1.tgz", "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.3.2.tgz",
"integrity": "sha512-mQuW55GhduF3ppo+ZRUTz1PRjEh1hS5BbqU7d8D0ez2OKxHDod7StPPeAVKisZR5aLkHZjdGWSL42LSONUJsZw==", "integrity": "sha512-A5pN2tkFj7H0dGIAM6MFvHKMJcPnjZsOMvR7ujCjfgW5TbV6H9vb1PgxLtHvjqNZTHsUolz+6/WEO0N1xNx2ng==",
"dev": true "dev": true
}, },
"longest": { "longest": {
@ -13567,18 +13749,19 @@
"integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=" "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo="
}, },
"nanomatch": { "nanomatch": {
"version": "1.2.7", "version": "1.2.9",
"resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.7.tgz", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz",
"integrity": "sha512-/5ldsnyurvEw7wNpxLFgjVvBLMta43niEYOy0CJ4ntcYSbx6bugRUTQeFb4BR/WanEL1o3aQgHuVLHQaB6tOqg==", "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==",
"dev": true, "dev": true,
"requires": { "requires": {
"arr-diff": "4.0.0", "arr-diff": "4.0.0",
"array-unique": "0.3.2", "array-unique": "0.3.2",
"define-property": "1.0.0", "define-property": "2.0.2",
"extend-shallow": "2.0.1", "extend-shallow": "3.0.2",
"fragment-cache": "0.2.1", "fragment-cache": "0.2.1",
"is-odd": "1.0.0", "is-odd": "2.0.0",
"kind-of": "5.1.0", "is-windows": "1.0.2",
"kind-of": "6.0.2",
"object.pick": "1.3.0", "object.pick": "1.3.0",
"regex-not": "1.0.0", "regex-not": "1.0.0",
"snapdragon": "0.8.1", "snapdragon": "0.8.1",
@ -13597,10 +13780,45 @@
"integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
"dev": true "dev": true
}, },
"define-property": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
"integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
"dev": true,
"requires": {
"is-descriptor": "1.0.2",
"isobject": "3.0.1"
}
},
"extend-shallow": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
"integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=",
"dev": true,
"requires": {
"assign-symbols": "1.0.0",
"is-extendable": "1.0.1"
}
},
"is-extendable": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
"integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
"dev": true,
"requires": {
"is-plain-object": "2.0.4"
}
},
"isobject": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
"integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",
"dev": true
},
"kind-of": { "kind-of": {
"version": "5.1.0", "version": "6.0.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
"integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
"dev": true "dev": true
} }
} }
@ -13646,14 +13864,14 @@
"dev": true "dev": true
}, },
"nise": { "nise": {
"version": "1.2.0", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/nise/-/nise-1.2.0.tgz", "resolved": "https://registry.npmjs.org/nise/-/nise-1.3.2.tgz",
"integrity": "sha512-q9jXh3UNsMV28KeqI43ILz5+c3l+RiNW8mhurEwCKckuHQbL+hTJIKKTiUlCPKlgQ/OukFvSnKB/Jk3+sFbkGA==", "integrity": "sha512-KPKb+wvETBiwb4eTwtR/OsA2+iijXP+VnlSFYJo3EHjm2yjek1NWxHOUQat3i7xNLm1Bm18UA5j5Wor0yO2GtA==",
"dev": true, "dev": true,
"requires": { "requires": {
"formatio": "1.2.0", "@sinonjs/formatio": "2.0.0",
"just-extend": "1.1.27", "just-extend": "1.1.27",
"lolex": "1.6.0", "lolex": "2.3.2",
"path-to-regexp": "1.7.0", "path-to-regexp": "1.7.0",
"text-encoding": "0.6.4" "text-encoding": "0.6.4"
}, },
@ -13664,12 +13882,6 @@
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
"dev": true "dev": true
}, },
"lolex": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/lolex/-/lolex-1.6.0.tgz",
"integrity": "sha1-OpoCg0UqR9dDnnJzG54H1zhuSfY=",
"dev": true
},
"path-to-regexp": { "path-to-regexp": {
"version": "1.7.0", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz",
@ -16659,7 +16871,6 @@
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz", "resolved": "https://registry.npmjs.org/plur/-/plur-2.1.2.tgz",
"integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=", "integrity": "sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo=",
"dev": true,
"requires": { "requires": {
"irregular-plurals": "1.4.0" "irregular-plurals": "1.4.0"
} }
@ -18318,6 +18529,15 @@
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
}, },
"safe-regex": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
"integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=",
"dev": true,
"requires": {
"ret": "0.1.15"
}
},
"samsam": { "samsam": {
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz",
@ -18695,16 +18915,16 @@
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
}, },
"sinon": { "sinon": {
"version": "4.1.3", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/sinon/-/sinon-4.1.3.tgz", "resolved": "https://registry.npmjs.org/sinon/-/sinon-5.0.0.tgz",
"integrity": "sha512-c7u0ZuvBRX1eXuB4jN3BRCAOGiUTlM8SE3TxbJHrNiHUKL7wonujMOB6Fi1gQc00U91IscFORQHDga/eccqpbw==", "integrity": "sha512-dMX7ZB2E1iQ5DOEOePoNJQp03uyhdMfb+kLXlNPbquv2FwfezD+0GbbHSgCw4MFhpSSS9NMoYJfOPMjCMJtXWA==",
"dev": true, "dev": true,
"requires": { "requires": {
"diff": "3.3.1", "diff": "3.3.1",
"formatio": "1.2.0", "formatio": "1.2.0",
"lodash.get": "4.4.2", "lodash.get": "4.4.2",
"lolex": "2.3.1", "lolex": "2.3.2",
"nise": "1.2.0", "nise": "1.3.2",
"supports-color": "4.5.0", "supports-color": "4.5.0",
"type-detect": "4.0.5" "type-detect": "4.0.5"
}, },
@ -19086,9 +19306,9 @@
} }
}, },
"solc": { "solc": {
"version": "0.4.20", "version": "0.4.21",
"resolved": "https://registry.npmjs.org/solc/-/solc-0.4.20.tgz", "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.21.tgz",
"integrity": "sha512-LrP3Jp4FS3y8sduIR67y8Ss1riR3fggk5sMnx4OSCcU88Ro0e51+KVXyfH3NP6ghLo7COrLx/lGUaDDugCzdgA==", "integrity": "sha512-8lJmimVjOG9AJOQRWS2ph4rSctPMsPGZ4H360HLs5iI+euUlt7iAvUxSLeFZZzwk0kas4Qta7HmlMXNU3yYwhw==",
"requires": { "requires": {
"fs-extra": "0.30.0", "fs-extra": "0.30.0",
"memorystream": "0.3.1", "memorystream": "0.3.1",
@ -19711,6 +19931,16 @@
"safe-buffer": "5.1.1" "safe-buffer": "5.1.1"
} }
}, },
"stringify-object": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.2.2.tgz",
"integrity": "sha512-O696NF21oLiDy8PhpWu8AEqoZHw++QW6mUv0UvKZe8gWSdSvMXkiLufK7OmnP27Dro4GU5kb9U7JIO0mBuCRQg==",
"requires": {
"get-own-enumerable-property-symbols": "2.0.1",
"is-obj": "1.0.1",
"is-regexp": "1.0.0"
}
},
"stringstream": { "stringstream": {
"version": "0.0.5", "version": "0.0.5",
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
@ -20317,6 +20547,27 @@
"integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=", "integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=",
"dev": true "dev": true
}, },
"sw-controller": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sw-controller/-/sw-controller-1.0.3.tgz",
"integrity": "sha512-q+rS4v7kj1MPDxFRyl8GAICw/BbQzewd5HhVDNIPLnyvKtcpxi26fVXReUeUMRl4CRL/fX56PvKKqxtKhAaMpg==",
"requires": {
"babel-preset-es2015": "6.24.1",
"babel-runtime": "6.26.0",
"babelify": "7.3.0"
},
"dependencies": {
"babelify": {
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
"integrity": "sha1-qlau3nBn/XvVSWZu4W3ChQh+iOU=",
"requires": {
"babel-core": "6.26.0",
"object-assign": "4.1.1"
}
}
}
},
"sw-stream": { "sw-stream": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/sw-stream/-/sw-stream-2.0.2.tgz", "resolved": "https://registry.npmjs.org/sw-stream/-/sw-stream-2.0.2.tgz",
@ -20781,6 +21032,14 @@
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"tildify": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz",
"integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=",
"requires": {
"os-homedir": "1.0.2"
}
},
"time-stamp": { "time-stamp": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz",
@ -21228,12 +21487,6 @@
"integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ=", "integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ=",
"dev": true "dev": true
}, },
"underscore.string": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz",
"integrity": "sha1-ccCL9rQosRM/N+ePo6Icgvcymw0=",
"dev": true
},
"undertaker": { "undertaker": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.0.tgz", "resolved": "https://registry.npmjs.org/undertaker/-/undertaker-1.2.0.tgz",
@ -21394,22 +21647,10 @@
} }
}, },
"upath": { "upath": {
"version": "1.0.0", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/upath/-/upath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/upath/-/upath-1.0.4.tgz",
"integrity": "sha1-tHBrlGHKhHOt+JEz0jVonKF/NlY=", "integrity": "sha512-d4SJySNBXDaQp+DPrziv3xGS6w3d2Xt69FijJr86zMPBy23JEloMCEOUBBzuN7xCtjLCnmB9tI/z7SBCahHBOw==",
"dev": true, "dev": true
"requires": {
"lodash": "3.10.1",
"underscore.string": "2.3.3"
},
"dependencies": {
"lodash": {
"version": "3.10.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
"integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=",
"dev": true
}
}
}, },
"urix": { "urix": {
"version": "0.1.0", "version": "0.1.0",
@ -21697,9 +21938,9 @@
}, },
"dependencies": { "dependencies": {
"clone": { "clone": {
"version": "1.0.3", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
"integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
"dev": true "dev": true
}, },
"clone-stats": { "clone-stats": {
@ -21726,7 +21967,7 @@
"integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=",
"dev": true, "dev": true,
"requires": { "requires": {
"clone": "1.0.3", "clone": "1.0.4",
"clone-stats": "0.0.1", "clone-stats": "0.0.1",
"replace-ext": "0.0.1" "replace-ext": "0.0.1"
} }
@ -22068,9 +22309,9 @@
} }
}, },
"web3-provider-engine": { "web3-provider-engine": {
"version": "13.6.0", "version": "13.8.0",
"resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-13.6.0.tgz", "resolved": "https://registry.npmjs.org/web3-provider-engine/-/web3-provider-engine-13.8.0.tgz",
"integrity": "sha512-iCsAlAeLWHxgx6EXuBm5GNg5VBqKtzmnrhEOfJBv8Cetukush7yOvo4RPjDZIynKxg9jfAlMmWqCk6wLxA6coQ==", "integrity": "sha512-fZXhX5VWwWpoFfrfocslyg6P7cN3YWPG/ASaevNfeO80R+nzgoPUBXcWQekSGSsNDkeRTis4aMmpmofYf1TNtQ==",
"requires": { "requires": {
"async": "2.6.0", "async": "2.6.0",
"clone": "2.1.1", "clone": "2.1.1",
@ -22078,7 +22319,7 @@
"eth-sig-util": "1.4.2", "eth-sig-util": "1.4.2",
"ethereumjs-block": "1.7.0", "ethereumjs-block": "1.7.0",
"ethereumjs-tx": "1.3.3", "ethereumjs-tx": "1.3.3",
"ethereumjs-util": "5.1.4", "ethereumjs-util": "5.1.5",
"ethereumjs-vm": "2.3.2", "ethereumjs-vm": "2.3.2",
"fetch-ponyfill": "4.1.0", "fetch-ponyfill": "4.1.0",
"json-rpc-error": "2.0.0", "json-rpc-error": "2.0.0",
@ -22087,16 +22328,16 @@
"readable-stream": "2.3.3", "readable-stream": "2.3.3",
"request": "2.83.0", "request": "2.83.0",
"semaphore": "1.1.0", "semaphore": "1.1.0",
"solc": "0.4.20", "solc": "0.4.21",
"tape": "4.8.0", "tape": "4.8.0",
"xhr": "2.4.1", "xhr": "2.4.1",
"xtend": "4.0.1" "xtend": "4.0.1"
}, },
"dependencies": { "dependencies": {
"ethereumjs-util": { "ethereumjs-util": {
"version": "5.1.4", "version": "5.1.5",
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.1.4.tgz", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.1.5.tgz",
"integrity": "sha512-wbeTc5prEzIWFSQUcEsCAZbqubtJKy6yS+oZMY1cGG6GLYzLjm4YhC2RNrWIg8hRYnclWpnZmx2zkiufQkmd3w==", "integrity": "sha512-xPaSEATYJpMTCGowIt0oMZwFP4R1bxd6QsWgkcDvFL0JtXsr39p32WEcD14RscCjfP41YXZPCVWA4yAg0nrJmw==",
"requires": { "requires": {
"bn.js": "4.11.8", "bn.js": "4.11.8",
"create-hash": "1.1.3", "create-hash": "1.1.3",

View File

@ -4,14 +4,9 @@
"public": false, "public": false,
"private": true, "private": true,
"scripts": { "scripts": {
"start": "npm run dev", "start": "gulp dev:extension",
"dev": "gulp dev --debug", "mascara": "gulp dev:mascara & cross-env METAMASK_DEBUG=true node ./mascara/example/server",
"ui": "npm run test:flat:build:states && beefy development/ui-dev.js:bundle.js --live --open --index=./development/index.html --cwd ./", "dist": "gulp dist",
"mock": "beefy development/mock-dev.js:bundle.js --live --open --index=./development/index.html --cwd ./",
"watch": "mocha watch --recursive \"test/unit/**/*.js\"",
"mascara": "gulp build && cross-env METAMASK_DEBUG=true node ./mascara/example/server",
"dist": "npm run dist:clear && npm install && gulp dist",
"dist:clear": "rm -rf node_modules/eth-contract-metadata && rm -rf node_modules/eth-phishing-detect",
"test": "npm run test:unit && npm run test:integration && npm run lint", "test": "npm run test:unit && npm run test:integration && npm run lint",
"test:unit": "cross-env METAMASK_ENV=test mocha --exit --require babel-core/register --require test/helper.js --recursive \"test/unit/**/*.js\"", "test:unit": "cross-env METAMASK_ENV=test mocha --exit --require babel-core/register --require test/helper.js --recursive \"test/unit/**/*.js\"",
"test:single": "cross-env METAMASK_ENV=test mocha --require test/helper.js", "test:single": "cross-env METAMASK_ENV=test mocha --require test/helper.js",
@ -41,6 +36,9 @@
"sentry:upload:maps": "sentry-cli releases --org 'metamask' --project 'metamask' files $RELEASE upload-sourcemaps ./dist/sourcemaps/ --url-prefix 'sourcemaps' --rewrite", "sentry:upload:maps": "sentry-cli releases --org 'metamask' --project 'metamask' files $RELEASE upload-sourcemaps ./dist/sourcemaps/ --url-prefix 'sourcemaps' --rewrite",
"lint": "gulp lint", "lint": "gulp lint",
"lint:fix": "gulp lint:fix", "lint:fix": "gulp lint:fix",
"ui": "npm run test:flat:build:states && beefy development/ui-dev.js:bundle.js --live --open --index=./development/index.html --cwd ./",
"mock": "beefy development/mock-dev.js:bundle.js --live --open --index=./development/index.html --cwd ./",
"watch": "mocha watch --recursive \"test/unit/**/*.js\"",
"disc": "gulp disc --debug", "disc": "gulp disc --debug",
"announce": "node development/announcer.js", "announce": "node development/announcer.js",
"version:bump": "node development/run-version-bump.js", "version:bump": "node development/run-version-bump.js",
@ -78,7 +76,6 @@
"browserify-derequire": "^0.9.4", "browserify-derequire": "^0.9.4",
"browserify-unibabel": "^3.0.0", "browserify-unibabel": "^3.0.0",
"classnames": "^2.2.5", "classnames": "^2.2.5",
"client-sw-ready-event": "^3.3.0",
"clone": "^2.1.1", "clone": "^2.1.1",
"copy-to-clipboard": "^3.0.8", "copy-to-clipboard": "^3.0.8",
"debounce": "^1.0.0", "debounce": "^1.0.0",
@ -109,7 +106,7 @@
"ethjs": "^0.2.8", "ethjs": "^0.2.8",
"ethjs-contract": "^0.1.9", "ethjs-contract": "^0.1.9",
"ethjs-ens": "^2.0.0", "ethjs-ens": "^2.0.0",
"ethjs-query": "^0.3.1", "ethjs-query": "^0.3.4",
"express": "^4.15.5", "express": "^4.15.5",
"extension-link-enabler": "^1.0.0", "extension-link-enabler": "^1.0.0",
"extensionizer": "^1.0.0", "extensionizer": "^1.0.0",
@ -118,6 +115,7 @@
"fuse.js": "^3.2.0", "fuse.js": "^3.2.0",
"gulp": "github:gulpjs/gulp#4.0", "gulp": "github:gulpjs/gulp#4.0",
"gulp-autoprefixer": "^5.0.0", "gulp-autoprefixer": "^5.0.0",
"gulp-debug": "^3.2.0",
"gulp-eslint": "^4.0.0", "gulp-eslint": "^4.0.0",
"gulp-sass": "^3.1.0", "gulp-sass": "^3.1.0",
"hat": "0.0.3", "hat": "0.0.3",
@ -144,6 +142,7 @@
"obs-store": "^3.0.0", "obs-store": "^3.0.0",
"once": "^1.3.3", "once": "^1.3.3",
"percentile": "^1.2.0", "percentile": "^1.2.0",
"pify": "^3.0.0",
"ping-pong-stream": "^1.0.0", "ping-pong-stream": "^1.0.0",
"pojo-migrator": "^2.1.0", "pojo-migrator": "^2.1.0",
"polyfill-crypto.getrandomvalues": "^1.0.0", "polyfill-crypto.getrandomvalues": "^1.0.0",
@ -151,7 +150,6 @@
"promise-filter": "^1.1.0", "promise-filter": "^1.1.0",
"promise-to-callback": "^1.0.0", "promise-to-callback": "^1.0.0",
"pump": "^3.0.0", "pump": "^3.0.0",
"pify": "^3.0.0",
"pumpify": "^1.3.4", "pumpify": "^1.3.4",
"qrcode-npm": "0.0.3", "qrcode-npm": "0.0.3",
"ramda": "^0.24.1", "ramda": "^0.24.1",
@ -180,13 +178,14 @@
"semaphore": "^1.0.5", "semaphore": "^1.0.5",
"semver": "^5.4.1", "semver": "^5.4.1",
"shallow-copy": "0.0.1", "shallow-copy": "0.0.1",
"sw-stream": "^2.0.0", "sw-controller": "^1.0.3",
"sw-stream": "^2.0.2",
"textarea-caret": "^3.0.1", "textarea-caret": "^3.0.1",
"through2": "^2.0.3", "through2": "^2.0.3",
"valid-url": "^1.0.9", "valid-url": "^1.0.9",
"vreme": "^3.0.2", "vreme": "^3.0.2",
"web3": "^0.20.1", "web3": "^0.20.1",
"web3-provider-engine": "^13.5.6", "web3-provider-engine": "^13.8.0",
"web3-stream-provider": "^3.0.1", "web3-stream-provider": "^3.0.1",
"xtend": "^4.0.1" "xtend": "^4.0.1"
}, },
@ -222,7 +221,6 @@
"gulp": "github:gulpjs/gulp#6d71a658c61edb3090221579d8f97dbe086ba2ed", "gulp": "github:gulpjs/gulp#6d71a658c61edb3090221579d8f97dbe086ba2ed",
"gulp-babel": "^7.0.0", "gulp-babel": "^7.0.0",
"gulp-eslint": "^4.0.0", "gulp-eslint": "^4.0.0",
"gulp-if": "^2.0.2",
"gulp-json-editor": "^2.2.1", "gulp-json-editor": "^2.2.1",
"gulp-livereload": "^3.8.1", "gulp-livereload": "^3.8.1",
"gulp-replace": "^0.6.1", "gulp-replace": "^0.6.1",
@ -258,8 +256,8 @@
"react-addons-test-utils": "^15.5.1", "react-addons-test-utils": "^15.5.1",
"react-test-renderer": "^15.6.2", "react-test-renderer": "^15.6.2",
"react-testutils-additions": "^15.2.0", "react-testutils-additions": "^15.2.0",
"selenium-webdriver": "^3.5.0",
"redux-test-utils": "^0.2.2", "redux-test-utils": "^0.2.2",
"selenium-webdriver": "^3.5.0",
"sinon": "^5.0.0", "sinon": "^5.0.0",
"stylelint-config-standard": "^18.2.0", "stylelint-config-standard": "^18.2.0",
"tape": "^4.5.1", "tape": "^4.5.1",

View File

@ -1,5 +1,8 @@
const fs = require('fs')
const mkdirp = require('mkdirp')
const path = require('path') const path = require('path')
const assert = require('assert') const assert = require('assert')
const pify = require('pify')
const webdriver = require('selenium-webdriver') const webdriver = require('selenium-webdriver')
const By = webdriver.By const By = webdriver.By
const { delay, buildWebDriver } = require('./func') const { delay, buildWebDriver } = require('./func')
@ -14,12 +17,18 @@ describe('Metamask popup page', function () {
const extPath = path.resolve('dist/chrome') const extPath = path.resolve('dist/chrome')
driver = buildWebDriver(extPath) driver = buildWebDriver(extPath)
await driver.get('chrome://extensions-frame') await driver.get('chrome://extensions-frame')
const elems = await driver.findElements(By.className('extension-list-item-wrapper')) const elems = await driver.findElements(By.css('.extension-list-item-wrapper'))
const extensionId = await elems[1].getAttribute('id') const extensionId = await elems[1].getAttribute('id')
await driver.get(`chrome-extension://${extensionId}/popup.html`) await driver.get(`chrome-extension://${extensionId}/popup.html`)
await delay(500) await delay(500)
}) })
afterEach(async function () {
if (this.currentTest.state === 'failed') {
await verboseReportOnFailure(this.currentTest)
}
})
after(async function () { after(async function () {
await driver.quit() await driver.quit()
}) })
@ -33,36 +42,31 @@ describe('Metamask popup page', function () {
it('should match title', async () => { it('should match title', async () => {
const title = await driver.getTitle() const title = await driver.getTitle()
assert.equal(title, 'MetaMask Plugin', 'title matches MetaMask Plugin') assert.equal(title, 'MetaMask', 'title matches MetaMask')
}) })
it('should show privacy notice', async () => { it('should show privacy notice', async () => {
const privacy = await driver.findElement(By.className( const privacy = await driver.findElement(By.css('.terms-header')).getText()
'terms-header'
)).getText()
assert.equal(privacy, 'PRIVACY NOTICE', 'shows privacy notice') assert.equal(privacy, 'PRIVACY NOTICE', 'shows privacy notice')
driver.findElement(By.css( driver.findElement(By.css('button')).click()
'button' await delay(300)
)).click()
}) })
it('should show terms of use', async () => { it('should show terms of use', async () => {
await delay(300) await delay(300)
const terms = await driver.findElement(By.className( const terms = await driver.findElement(By.css('.terms-header')).getText()
'terms-header'
)).getText()
assert.equal(terms, 'TERMS OF USE', 'shows terms of use') assert.equal(terms, 'TERMS OF USE', 'shows terms of use')
await delay(300)
}) })
it('should be unable to continue without scolling throught the terms of use', async () => { it('should be unable to continue without scolling throught the terms of use', async () => {
const button = await driver.findElement(By.css( const button = await driver.findElement(By.css('button')).isEnabled()
'button'
)).isEnabled()
assert.equal(button, false, 'disabled continue button') assert.equal(button, false, 'disabled continue button')
const element = driver.findElement(By.linkText( const element = driver.findElement(By.linkText(
'Attributions' 'Attributions'
)) ))
await driver.executeScript('arguments[0].scrollIntoView(true)', element) await driver.executeScript('arguments[0].scrollIntoView(true)', element)
await delay(300)
}) })
it('should be able to continue when scrolled to the bottom of terms of use', async () => { it('should be able to continue when scrolled to the bottom of terms of use', async () => {
@ -71,10 +75,10 @@ describe('Metamask popup page', function () {
await delay(500) await delay(500)
assert.equal(buttonEnabled, true, 'enabled continue button') assert.equal(buttonEnabled, true, 'enabled continue button')
await button.click() await button.click()
await delay(300)
}) })
it('should accept password with length of eight', async () => { it('should accept password with length of eight', async () => {
await delay(300)
const passwordBox = await driver.findElement(By.id('password-box')) const passwordBox = await driver.findElement(By.id('password-box'))
const passwordBoxConfirm = await driver.findElement(By.id('password-box-confirm')) const passwordBoxConfirm = await driver.findElement(By.id('password-box-confirm'))
const button = driver.findElement(By.css('button')) const button = driver.findElement(By.css('button'))
@ -87,16 +91,16 @@ describe('Metamask popup page', function () {
it('should show value was created and seed phrase', async () => { it('should show value was created and seed phrase', async () => {
await delay(700) await delay(700)
this.seedPhase = await driver.findElement(By.className('twelve-word-phrase')).getText() this.seedPhase = await driver.findElement(By.css('.twelve-word-phrase')).getText()
const continueAfterSeedPhrase = await driver.findElement(By.css('button')) const continueAfterSeedPhrase = await driver.findElement(By.css('button'))
await continueAfterSeedPhrase.click() await continueAfterSeedPhrase.click()
await delay(300)
}) })
it('should show lock account', async () => { it('should show lock account', async () => {
await delay(300) await driver.findElement(By.css('.sandwich-expando')).click()
await driver.findElement(By.className('sandwich-expando')).click()
await delay(500) await delay(500)
await driver.findElement(By.xpath('//*[@id="app-content"]/div/div[3]/span/div/li[2]')).click() await driver.findElement(By.css('#app-content > div > div:nth-child(3) > span > div > li:nth-child(3)')).click()
}) })
it('should accept account password after lock', async () => { it('should accept account password after lock', async () => {
@ -106,17 +110,30 @@ describe('Metamask popup page', function () {
await delay(500) await delay(500)
}) })
it('should show QR code', async () => { it('should show QR code option', async () => {
await delay(300) await delay(300)
await driver.findElement(By.className('fa-ellipsis-h')).click() await driver.findElement(By.css('.fa-ellipsis-h')).click()
await driver.findElement(By.xpath('//*[@id="app-content"]/div/div[4]/div/div/div[1]/flex-column/div[1]/div/span/i/div/div/li[2]')).click() await driver.findElement(By.css('#app-content > div > div.app-primary.from-right > div > div > div:nth-child(1) > flex-column > div.name-label > div > span > i > div > div > li:nth-child(3)')).click()
await delay(300) await delay(300)
}) })
it('should show the account address', async () => { it('should show the account address', async () => {
this.accountAddress = await driver.findElement(By.className('ellip-address')).getText() this.accountAddress = await driver.findElement(By.css('.ellip-address')).getText()
await driver.findElement(By.className('fa-arrow-left')).click() await driver.findElement(By.css('.fa-arrow-left')).click()
await delay(500) await delay(500)
}) })
}) })
async function verboseReportOnFailure(test) {
const artifactDir = `./test-artifacts/${test.title}`
const filepathBase = `${artifactDir}/test-failure`
await pify(mkdirp)(artifactDir)
// capture screenshot
const screenshot = await driver.takeScreenshot()
await pify(fs.writeFile)(`${filepathBase}-screenshot.png`, screenshot, { encoding: 'base64' })
// capture dom source
const htmlSource = await driver.getPageSource()
await pify(fs.writeFile)(`${filepathBase}-dom.html`, htmlSource)
}
}) })

View File

@ -0,0 +1,61 @@
const reactTriggerChange = require('../../lib/react-trigger-change')
const {
timeout,
queryAsync,
findAsync,
} = require('../../lib/util')
QUnit.module('tx list items')
QUnit.test('renders list items successfully', (assert) => {
const done = assert.async()
runTxListItemsTest(assert).then(done).catch((err) => {
assert.notOk(err, `Error was thrown: ${err.stack}`)
done()
})
})
async function runTxListItemsTest(assert, done) {
console.log('*** start runTxListItemsTest')
const selectState = await queryAsync($, 'select')
selectState.val('tx list items')
reactTriggerChange(selectState[0])
const metamaskLogo = await queryAsync($, '.left-menu-wrapper')
assert.ok(metamaskLogo[0], 'metamask logo present')
metamaskLogo[0].click()
const txListItems = await queryAsync($, '.tx-list-item')
assert.equal(txListItems.length, 8, 'all tx list items are rendered')
const unapprovedTx = txListItems[0]
assert.equal($(unapprovedTx).hasClass('tx-list-pending-item-container'), true, 'unapprovedTx has the correct class')
const retryTx = txListItems[1]
const retryTxLink = await findAsync($(retryTx), '.tx-list-item-retry-link')
assert.equal(retryTxLink[0].textContent, 'Increase the gas price on your transaction', 'retryTx has expected link')
const approvedTx = txListItems[2]
const approvedTxRenderedStatus = await findAsync($(approvedTx), '.tx-list-status')
assert.equal(approvedTxRenderedStatus[0].textContent, 'Approved', 'approvedTx has correct label')
const unapprovedMsg = txListItems[3]
const unapprovedMsgDescription = await findAsync($(unapprovedMsg), '.tx-list-account')
assert.equal(unapprovedMsgDescription[0].textContent, 'Signature Request', 'unapprovedMsg has correct description')
const failedTx = txListItems[4]
const failedTxRenderedStatus = await findAsync($(failedTx), '.tx-list-status')
assert.equal(failedTxRenderedStatus[0].textContent, 'Failed', 'failedTx has correct label')
const shapeShiftTx = txListItems[5]
const shapeShiftTxStatus = await findAsync($(shapeShiftTx), '.flex-column div:eq(1)')
assert.equal(shapeShiftTxStatus[0].textContent, 'No deposits received', 'shapeShiftTx has correct status')
const confirmedTokenTx = txListItems[6]
const confirmedTokenTxAddress = await findAsync($(confirmedTokenTx), '.tx-list-account')
assert.equal(confirmedTokenTxAddress[0].textContent, '0xe7884118...81a9', 'confirmedTokenTx has correct address')
const rejectedTx = txListItems[7]
const rejectedTxRenderedStatus = await findAsync($(rejectedTx), '.tx-list-status')
assert.equal(rejectedTxRenderedStatus[0].textContent, 'Rejected', 'rejectedTx has correct label')
}

View File

@ -33,6 +33,42 @@ describe('Nonce Tracker', function () {
}) })
}) })
describe('sentry issue 476304902', function () {
beforeEach(function () {
const txGen = new MockTxGen()
pendingTxs = txGen.generate({ status: 'submitted' }, {
fromNonce: 3,
count: 29,
})
nonceTracker = generateNonceTrackerWith(pendingTxs, [], '0x3')
})
it('should return 9', async function () {
this.timeout(15000)
const nonceLock = await nonceTracker.getNonceLock('0x7d3517b0d011698406d6e0aed8453f0be2697926')
assert.equal(nonceLock.nextNonce, '32', `nonce should be 32 got ${nonceLock.nextNonce}`)
await nonceLock.releaseLock()
})
})
describe('issue 3670', function () {
beforeEach(function () {
const txGen = new MockTxGen()
pendingTxs = txGen.generate({ status: 'submitted' }, {
fromNonce: 6,
count: 3,
})
nonceTracker = generateNonceTrackerWith(pendingTxs, [], '0x6')
})
it('should return 9', async function () {
this.timeout(15000)
const nonceLock = await nonceTracker.getNonceLock('0x7d3517b0d011698406d6e0aed8453f0be2697926')
assert.equal(nonceLock.nextNonce, '9', `nonce should be 9 got ${nonceLock.nextNonce}`)
await nonceLock.releaseLock()
})
})
describe('with no previous txs', function () { describe('with no previous txs', function () {
beforeEach(function () { beforeEach(function () {
nonceTracker = generateNonceTrackerWith([], []) nonceTracker = generateNonceTrackerWith([], [])

View File

@ -1,7 +1,8 @@
const inherits = require('util').inherits const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../../metamask-connect') const PropTypes = require('prop-types')
const connect = require('react-redux').connect
import Select from 'react-select' import Select from 'react-select'
// Subviews // Subviews
@ -9,8 +10,13 @@ const JsonImportView = require('./json.js')
const PrivateKeyImportView = require('./private-key.js') const PrivateKeyImportView = require('./private-key.js')
AccountImportSubview.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(AccountImportSubview) module.exports = connect()(AccountImportSubview)
inherits(AccountImportSubview, Component) inherits(AccountImportSubview, Component)
function AccountImportSubview () { function AccountImportSubview () {
Component.call(this) Component.call(this)
@ -18,8 +24,8 @@ function AccountImportSubview () {
AccountImportSubview.prototype.getMenuItemTexts = function () { AccountImportSubview.prototype.getMenuItemTexts = function () {
return [ return [
this.props.t('privateKey'), this.context.t('privateKey'),
this.props.t('jsonFile'), this.context.t('jsonFile'),
] ]
} }
@ -32,7 +38,7 @@ AccountImportSubview.prototype.render = function () {
h('div.new-account-import-form', [ h('div.new-account-import-form', [
h('.new-account-import-disclaimer', [ h('.new-account-import-disclaimer', [
h('span', this.props.t('importAccountMsg')), h('span', this.context.t('importAccountMsg')),
h('span', { h('span', {
style: { style: {
cursor: 'pointer', cursor: 'pointer',
@ -43,12 +49,12 @@ AccountImportSubview.prototype.render = function () {
url: 'https://metamask.helpscoutdocs.com/article/17-what-are-loose-accounts', url: 'https://metamask.helpscoutdocs.com/article/17-what-are-loose-accounts',
}) })
}, },
}, this.props.t('here')), }, this.context.t('here')),
]), ]),
h('div.new-account-import-form__select-section', [ h('div.new-account-import-form__select-section', [
h('div.new-account-import-form__select-label', this.props.t('selectType')), h('div.new-account-import-form__select-label', this.context.t('selectType')),
h(Select, { h(Select, {
className: 'new-account-import-form__select', className: 'new-account-import-form__select',
@ -80,9 +86,9 @@ AccountImportSubview.prototype.renderImportView = function () {
const current = type || menuItems[0] const current = type || menuItems[0]
switch (current) { switch (current) {
case this.props.t('privateKey'): case this.context.t('privateKey'):
return h(PrivateKeyImportView) return h(PrivateKeyImportView)
case this.props.t('jsonFile'): case this.context.t('jsonFile'):
return h(JsonImportView) return h(JsonImportView)
default: default:
return h(JsonImportView) return h(JsonImportView)

View File

@ -1,7 +1,7 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types') const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const FileInput = require('react-simple-file-input').default const FileInput = require('react-simple-file-input').default
@ -24,11 +24,11 @@ class JsonImportSubview extends Component {
return ( return (
h('div.new-account-import-form__json', [ h('div.new-account-import-form__json', [
h('p', this.props.t('usedByClients')), h('p', this.context.t('usedByClients')),
h('a.warning', { h('a.warning', {
href: HELP_LINK, href: HELP_LINK,
target: '_blank', target: '_blank',
}, this.props.t('fileImportFail')), }, this.context.t('fileImportFail')),
h(FileInput, { h(FileInput, {
readAs: 'text', readAs: 'text',
@ -43,7 +43,7 @@ class JsonImportSubview extends Component {
h('input.new-account-import-form__input-password', { h('input.new-account-import-form__input-password', {
type: 'password', type: 'password',
placeholder: this.props.t('enterPassword'), placeholder: this.context.t('enterPassword'),
id: 'json-password-box', id: 'json-password-box',
onKeyPress: this.createKeyringOnEnter.bind(this), onKeyPress: this.createKeyringOnEnter.bind(this),
}), }),
@ -53,13 +53,13 @@ class JsonImportSubview extends Component {
h('button.btn-secondary.new-account-create-form__button', { h('button.btn-secondary.new-account-create-form__button', {
onClick: () => this.props.goHome(), onClick: () => this.props.goHome(),
}, [ }, [
this.props.t('cancel'), this.context.t('cancel'),
]), ]),
h('button.btn-primary.new-account-create-form__button', { h('button.btn-primary.new-account-create-form__button', {
onClick: () => this.createNewKeychain(), onClick: () => this.createNewKeychain(),
}, [ }, [
this.props.t('import'), this.context.t('import'),
]), ]),
]), ]),
@ -84,14 +84,14 @@ class JsonImportSubview extends Component {
const state = this.state const state = this.state
if (!state) { if (!state) {
const message = this.props.t('validFileImport') const message = this.context.t('validFileImport')
return this.props.displayWarning(message) return this.props.displayWarning(message)
} }
const { fileContents } = state const { fileContents } = state
if (!fileContents) { if (!fileContents) {
const message = this.props.t('needImportFile') const message = this.context.t('needImportFile')
return this.props.displayWarning(message) return this.props.displayWarning(message)
} }
@ -99,7 +99,7 @@ class JsonImportSubview extends Component {
const password = passwordInput.value const password = passwordInput.value
if (!password) { if (!password) {
const message = this.props.t('needImportPassword') const message = this.context.t('needImportPassword')
return this.props.displayWarning(message) return this.props.displayWarning(message)
} }
@ -112,7 +112,7 @@ JsonImportSubview.propTypes = {
goHome: PropTypes.func, goHome: PropTypes.func,
displayWarning: PropTypes.func, displayWarning: PropTypes.func,
importNewJsonAccount: PropTypes.func, importNewJsonAccount: PropTypes.func,
t: PropTypes.func, t: PropTypes.func,
} }
const mapStateToProps = state => { const mapStateToProps = state => {
@ -129,4 +129,9 @@ const mapDispatchToProps = dispatch => {
} }
} }
JsonImportSubview.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(JsonImportSubview) module.exports = connect(mapStateToProps, mapDispatchToProps)(JsonImportSubview)

View File

@ -1,11 +1,17 @@
const inherits = require('util').inherits const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../../metamask-connect') const PropTypes = require('prop-types')
const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
PrivateKeyImportView.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(PrivateKeyImportView) module.exports = connect(mapStateToProps, mapDispatchToProps)(PrivateKeyImportView)
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
error: state.appState.warning, error: state.appState.warning,
@ -33,7 +39,7 @@ PrivateKeyImportView.prototype.render = function () {
return ( return (
h('div.new-account-import-form__private-key', [ h('div.new-account-import-form__private-key', [
h('span.new-account-create-form__instruction', this.props.t('pastePrivateKey')), h('span.new-account-create-form__instruction', this.context.t('pastePrivateKey')),
h('div.new-account-import-form__private-key-password-container', [ h('div.new-account-import-form__private-key-password-container', [
@ -50,13 +56,13 @@ PrivateKeyImportView.prototype.render = function () {
h('button.btn-secondary--lg.new-account-create-form__button', { h('button.btn-secondary--lg.new-account-create-form__button', {
onClick: () => goHome(), onClick: () => goHome(),
}, [ }, [
this.props.t('cancel'), this.context.t('cancel'),
]), ]),
h('button.btn-primary--lg.new-account-create-form__button', { h('button.btn-primary--lg.new-account-create-form__button', {
onClick: () => this.createNewKeychain(), onClick: () => this.createNewKeychain(),
}, [ }, [
this.props.t('import'), this.context.t('import'),
]), ]),
]), ]),

View File

@ -1,10 +1,16 @@
const inherits = require('util').inherits const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../../metamask-connect') const PropTypes = require('prop-types')
const connect = require('react-redux').connect
SeedImportSubview.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps)(SeedImportSubview) module.exports = connect(mapStateToProps)(SeedImportSubview)
function mapStateToProps (state) { function mapStateToProps (state) {
return {} return {}
} }
@ -20,10 +26,10 @@ SeedImportSubview.prototype.render = function () {
style: { style: {
}, },
}, [ }, [
this.props.t('pasteSeed'), this.context.t('pasteSeed'),
h('textarea'), h('textarea'),
h('br'), h('br'),
h('button', this.props.t('submit')), h('button', this.context.t('submit')),
]) ])
) )
} }

View File

@ -1,11 +1,11 @@
const { Component } = require('react') const { Component } = require('react')
const PropTypes = require('prop-types') const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
class NewAccountCreateForm extends Component { class NewAccountCreateForm extends Component {
constructor (props) { constructor (props, context) {
super(props) super(props)
const { numberOfExistingAccounts = 0 } = props const { numberOfExistingAccounts = 0 } = props
@ -13,7 +13,7 @@ class NewAccountCreateForm extends Component {
this.state = { this.state = {
newAccountName: '', newAccountName: '',
defaultAccountName: this.props.t('newAccountNumberName', [newAccountNumber]), defaultAccountName: context.t('newAccountNumberName', [newAccountNumber]),
} }
} }
@ -24,7 +24,7 @@ class NewAccountCreateForm extends Component {
return h('div.new-account-create-form', [ return h('div.new-account-create-form', [
h('div.new-account-create-form__input-label', {}, [ h('div.new-account-create-form__input-label', {}, [
this.props.t('accountName'), this.context.t('accountName'),
]), ]),
h('div.new-account-create-form__input-wrapper', {}, [ h('div.new-account-create-form__input-wrapper', {}, [
@ -40,13 +40,13 @@ class NewAccountCreateForm extends Component {
h('button.btn-secondary--lg.new-account-create-form__button', { h('button.btn-secondary--lg.new-account-create-form__button', {
onClick: () => this.props.goHome(), onClick: () => this.props.goHome(),
}, [ }, [
this.props.t('cancel'), this.context.t('cancel'),
]), ]),
h('button.btn-primary--lg.new-account-create-form__button', { h('button.btn-primary--lg.new-account-create-form__button', {
onClick: () => this.props.createAccount(newAccountName || defaultAccountName), onClick: () => this.props.createAccount(newAccountName || defaultAccountName),
}, [ }, [
this.props.t('create'), this.context.t('create'),
]), ]),
]), ]),
@ -97,4 +97,9 @@ const mapDispatchToProps = dispatch => {
} }
} }
NewAccountCreateForm.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(NewAccountCreateForm) module.exports = connect(mapStateToProps, mapDispatchToProps)(NewAccountCreateForm)

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const PropTypes = require('prop-types')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const { getCurrentViewContext } = require('../../selectors') const { getCurrentViewContext } = require('../../selectors')
const classnames = require('classnames') const classnames = require('classnames')
@ -36,8 +37,13 @@ function AccountDetailsModal (props) {
} }
} }
AccountDetailsModal.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDetailsModal) module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDetailsModal)
AccountDetailsModal.prototype.render = function () { AccountDetailsModal.prototype.render = function () {
const { displayedForm, displayForm } = this.props const { displayedForm, displayForm } = this.props
@ -45,7 +51,7 @@ AccountDetailsModal.prototype.render = function () {
h('div.new-account__header', [ h('div.new-account__header', [
h('div.new-account__title', this.props.t('newAccount')), h('div.new-account__title', this.context.t('newAccount')),
h('div.new-account__tabs', [ h('div.new-account__tabs', [
@ -55,7 +61,7 @@ AccountDetailsModal.prototype.render = function () {
'new-account__tabs__unselected cursor-pointer': displayedForm !== 'CREATE', 'new-account__tabs__unselected cursor-pointer': displayedForm !== 'CREATE',
}), }),
onClick: () => displayForm('CREATE'), onClick: () => displayForm('CREATE'),
}, this.props.t('createDen')), }, this.context.t('createDen')),
h('div.new-account__tabs__tab', { h('div.new-account__tabs__tab', {
className: classnames('new-account__tabs__tab', { className: classnames('new-account__tabs__tab', {
@ -63,7 +69,7 @@ AccountDetailsModal.prototype.render = function () {
'new-account__tabs__unselected cursor-pointer': displayedForm !== 'IMPORT', 'new-account__tabs__unselected cursor-pointer': displayedForm !== 'IMPORT',
}), }),
onClick: () => displayForm('IMPORT'), onClick: () => displayForm('IMPORT'),
}, this.props.t('import')), }, this.context.t('import')),
]), ]),

View File

@ -2,7 +2,8 @@ const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const classnames = require('classnames') const classnames = require('classnames')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('./metamask-connect') const PropTypes = require('prop-types')
const connect = require('react-redux').connect
const R = require('ramda') const R = require('ramda')
const Fuse = require('fuse.js') const Fuse = require('fuse.js')
const contractMap = require('eth-contract-metadata') const contractMap = require('eth-contract-metadata')
@ -29,8 +30,13 @@ const { tokenInfoGetter } = require('./token-util')
const emptyAddr = '0x0000000000000000000000000000000000000000' const emptyAddr = '0x0000000000000000000000000000000000000000'
AddTokenScreen.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(AddTokenScreen) module.exports = connect(mapStateToProps, mapDispatchToProps)(AddTokenScreen)
function mapStateToProps (state) { function mapStateToProps (state) {
const { identities, tokens } = state.metamask const { identities, tokens } = state.metamask
return { return {
@ -139,7 +145,7 @@ AddTokenScreen.prototype.validate = function () {
if (customAddress) { if (customAddress) {
const validAddress = ethUtil.isValidAddress(customAddress) const validAddress = ethUtil.isValidAddress(customAddress)
if (!validAddress) { if (!validAddress) {
errors.customAddress = this.props.t('invalidAddress') errors.customAddress = this.context.t('invalidAddress')
} }
const validDecimals = customDecimals !== null const validDecimals = customDecimals !== null
@ -147,23 +153,23 @@ AddTokenScreen.prototype.validate = function () {
&& customDecimals >= 0 && customDecimals >= 0
&& customDecimals < 36 && customDecimals < 36
if (!validDecimals) { if (!validDecimals) {
errors.customDecimals = this.props.t('decimalsMustZerotoTen') errors.customDecimals = this.context.t('decimalsMustZerotoTen')
} }
const symbolLen = customSymbol.trim().length const symbolLen = customSymbol.trim().length
const validSymbol = symbolLen > 0 && symbolLen < 10 const validSymbol = symbolLen > 0 && symbolLen < 10
if (!validSymbol) { if (!validSymbol) {
errors.customSymbol = this.props.t('symbolBetweenZeroTen') errors.customSymbol = this.context.t('symbolBetweenZeroTen')
} }
const ownAddress = identitiesList.includes(standardAddress) const ownAddress = identitiesList.includes(standardAddress)
if (ownAddress) { if (ownAddress) {
errors.customAddress = this.props.t('personalAddressDetected') errors.customAddress = this.context.t('personalAddressDetected')
} }
const tokenAlreadyAdded = this.checkExistingAddresses(customAddress) const tokenAlreadyAdded = this.checkExistingAddresses(customAddress)
if (tokenAlreadyAdded) { if (tokenAlreadyAdded) {
errors.customAddress = this.props.t('tokenAlreadyAdded') errors.customAddress = this.context.t('tokenAlreadyAdded')
} }
} else if ( } else if (
Object.entries(selectedTokens) Object.entries(selectedTokens)
@ -171,7 +177,7 @@ AddTokenScreen.prototype.validate = function () {
isEmpty && !isSelected isEmpty && !isSelected
), true) ), true)
) { ) {
errors.tokenSelector = this.props.t('mustSelectOne') errors.tokenSelector = this.context.t('mustSelectOne')
} }
return { return {
@ -201,7 +207,7 @@ AddTokenScreen.prototype.renderCustomForm = function () {
'add-token__add-custom-field--error': errors.customAddress, 'add-token__add-custom-field--error': errors.customAddress,
}), }),
}, [ }, [
h('div.add-token__add-custom-label', this.props.t('tokenAddress')), h('div.add-token__add-custom-label', this.context.t('tokenAddress')),
h('input.add-token__add-custom-input', { h('input.add-token__add-custom-input', {
type: 'text', type: 'text',
onChange: this.tokenAddressDidChange, onChange: this.tokenAddressDidChange,
@ -214,7 +220,7 @@ AddTokenScreen.prototype.renderCustomForm = function () {
'add-token__add-custom-field--error': errors.customSymbol, 'add-token__add-custom-field--error': errors.customSymbol,
}), }),
}, [ }, [
h('div.add-token__add-custom-label', this.props.t('tokenSymbol')), h('div.add-token__add-custom-label', this.context.t('tokenSymbol')),
h('input.add-token__add-custom-input', { h('input.add-token__add-custom-input', {
type: 'text', type: 'text',
onChange: this.tokenSymbolDidChange, onChange: this.tokenSymbolDidChange,
@ -228,7 +234,7 @@ AddTokenScreen.prototype.renderCustomForm = function () {
'add-token__add-custom-field--error': errors.customDecimals, 'add-token__add-custom-field--error': errors.customDecimals,
}), }),
}, [ }, [
h('div.add-token__add-custom-label', this.props.t('decimal')), h('div.add-token__add-custom-label', this.context.t('decimal')),
h('input.add-token__add-custom-input', { h('input.add-token__add-custom-input', {
type: 'number', type: 'number',
onChange: this.tokenDecimalsDidChange, onChange: this.tokenDecimalsDidChange,
@ -250,7 +256,7 @@ AddTokenScreen.prototype.renderTokenList = function () {
const results = [...addressSearchResult, ...fuseSearchResult] const results = [...addressSearchResult, ...fuseSearchResult]
return h('div', [ return h('div', [
results.length > 0 && h('div.add-token__token-icons-title', this.props.t('popularTokens')), results.length > 0 && h('div.add-token__token-icons-title', this.context.t('popularTokens')),
h('div.add-token__token-icons-container', Array(6).fill(undefined) h('div.add-token__token-icons-container', Array(6).fill(undefined)
.map((_, i) => { .map((_, i) => {
const { logo, symbol, name, address } = results[i] || {} const { logo, symbol, name, address } = results[i] || {}
@ -305,10 +311,10 @@ AddTokenScreen.prototype.renderConfirmation = function () {
h('div.add-token', [ h('div.add-token', [
h('div.add-token__wrapper', [ h('div.add-token__wrapper', [
h('div.add-token__title-container.add-token__confirmation-title', [ h('div.add-token__title-container.add-token__confirmation-title', [
h('div.add-token__description', this.props.t('likeToAddTokens')), h('div.add-token__description', this.context.t('likeToAddTokens')),
]), ]),
h('div.add-token__content-container.add-token__confirmation-content', [ h('div.add-token__content-container.add-token__confirmation-content', [
h('div.add-token__description.add-token__confirmation-description', this.props.t('balances')), h('div.add-token__description.add-token__confirmation-description', this.context.t('balances')),
h('div.add-token__confirmation-token-list', h('div.add-token__confirmation-token-list',
Object.entries(tokens) Object.entries(tokens)
.map(([ address, token ]) => ( .map(([ address, token ]) => (
@ -327,10 +333,10 @@ AddTokenScreen.prototype.renderConfirmation = function () {
h('div.add-token__buttons', [ h('div.add-token__buttons', [
h('button.btn-secondary--lg.add-token__cancel-button', { h('button.btn-secondary--lg.add-token__cancel-button', {
onClick: () => this.setState({ isShowingConfirmation: false }), onClick: () => this.setState({ isShowingConfirmation: false }),
}, this.props.t('back')), }, this.context.t('back')),
h('button.btn-primary--lg', { h('button.btn-primary--lg', {
onClick: () => addTokens(tokens).then(goHome), onClick: () => addTokens(tokens).then(goHome),
}, this.props.t('addTokens')), }, this.context.t('addTokens')),
]), ]),
]) ])
) )
@ -350,14 +356,14 @@ AddTokenScreen.prototype.renderTabs = function () {
h('div.add-token__content-container', [ h('div.add-token__content-container', [
h('div.add-token__info-box', [ h('div.add-token__info-box', [
h('div.add-token__info-box__close'), h('div.add-token__info-box__close'),
h('div.add-token__info-box__title', this.props.t('whatsThis')), h('div.add-token__info-box__title', this.context.t('whatsThis')),
h('div.add-token__info-box__copy', this.props.t('keepTrackTokens')), h('div.add-token__info-box__copy', this.context.t('keepTrackTokens')),
h('div.add-token__info-box__copy--blue', this.props.t('learnMore')), h('div.add-token__info-box__copy--blue', this.context.t('learnMore')),
]), ]),
h('div.add-token__input-container', [ h('div.add-token__input-container', [
h('input.add-token__input', { h('input.add-token__input', {
type: 'text', type: 'text',
placeholder: this.props.t('searchTokens'), placeholder: this.context.t('searchTokens'),
onChange: e => this.setState({ searchQuery: e.target.value }), onChange: e => this.setState({ searchQuery: e.target.value }),
}), }),
h('div.add-token__search-input-error-message', errors.tokenSelector), h('div.add-token__search-input-error-message', errors.tokenSelector),
@ -381,9 +387,9 @@ AddTokenScreen.prototype.render = function () {
onClick: () => goHome(), onClick: () => goHome(),
}, [ }, [
h('i.fa.fa-angle-left.fa-lg'), h('i.fa.fa-angle-left.fa-lg'),
h('span', this.props.t('cancel')), h('span', this.context.t('cancel')),
]), ]),
h('div.add-token__header__title', this.props.t('addTokens')), h('div.add-token__header__title', this.context.t('addTokens')),
!isShowingConfirmation && h('div.add-token__header__tabs', [ !isShowingConfirmation && h('div.add-token__header__tabs', [
h('div.add-token__header__tabs__tab', { h('div.add-token__header__tabs__tab', {
@ -392,7 +398,7 @@ AddTokenScreen.prototype.render = function () {
'add-token__header__tabs__unselected cursor-pointer': displayedTab !== 'SEARCH', 'add-token__header__tabs__unselected cursor-pointer': displayedTab !== 'SEARCH',
}), }),
onClick: () => this.displayTab('SEARCH'), onClick: () => this.displayTab('SEARCH'),
}, this.props.t('search')), }, this.context.t('search')),
h('div.add-token__header__tabs__tab', { h('div.add-token__header__tabs__tab', {
className: classnames('add-token__header__tabs__tab', { className: classnames('add-token__header__tabs__tab', {
@ -400,7 +406,7 @@ AddTokenScreen.prototype.render = function () {
'add-token__header__tabs__unselected cursor-pointer': displayedTab !== 'CUSTOM_TOKEN', 'add-token__header__tabs__unselected cursor-pointer': displayedTab !== 'CUSTOM_TOKEN',
}), }),
onClick: () => this.displayTab('CUSTOM_TOKEN'), onClick: () => this.displayTab('CUSTOM_TOKEN'),
}, this.props.t('customToken')), }, this.context.t('customToken')),
]), ]),
]), ]),
@ -412,10 +418,10 @@ AddTokenScreen.prototype.render = function () {
!isShowingConfirmation && h('div.add-token__buttons', [ !isShowingConfirmation && h('div.add-token__buttons', [
h('button.btn-secondary--lg.add-token__cancel-button', { h('button.btn-secondary--lg.add-token__cancel-button', {
onClick: goHome, onClick: goHome,
}, this.props.t('cancel')), }, this.context.t('cancel')),
h('button.btn-primary--lg.add-token__confirm-button', { h('button.btn-primary--lg.add-token__confirm-button', {
onClick: this.onNext, onClick: this.onNext,
}, this.props.t('next')), }, this.context.t('next')),
]), ]),
]) ])
} }

View File

@ -1,7 +1,8 @@
const inherits = require('util').inherits const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const connect = require('./metamask-connect') const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const PropTypes = require('prop-types')
const actions = require('./actions') const actions = require('./actions')
const classnames = require('classnames') const classnames = require('classnames')
@ -45,8 +46,13 @@ const QrView = require('./components/qr-code')
// Global Modals // Global Modals
const Modal = require('./components/modals/index').Modal const Modal = require('./components/modals/index').Modal
App.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(App) module.exports = connect(mapStateToProps, mapDispatchToProps)(App)
inherits(App, Component) inherits(App, Component)
function App () { Component.call(this) } function App () { Component.call(this) }
@ -288,13 +294,13 @@ App.prototype.renderAppBar = function () {
h('img.metafox-icon', { h('img.metafox-icon', {
height: 42, height: 42,
width: 42, width: 42,
src: '/images/metamask-fox.svg', src: './images/metamask-fox.svg',
}), }),
// metamask name // metamask name
h('.flex-row', [ h('.flex-row', [
h('h1', this.props.t('appName')), h('h1', this.context.t('appName')),
h('div.beta-label', this.props.t('beta')), h('div.beta-label', this.context.t('beta')),
]), ]),
]), ]),
@ -556,15 +562,15 @@ App.prototype.getConnectingLabel = function () {
let name let name
if (providerName === 'mainnet') { if (providerName === 'mainnet') {
name = this.props.t('connectingToMainnet') name = this.context.t('connectingToMainnet')
} else if (providerName === 'ropsten') { } else if (providerName === 'ropsten') {
name = this.props.t('connectingToRopsten') name = this.context.t('connectingToRopsten')
} else if (providerName === 'kovan') { } else if (providerName === 'kovan') {
name = this.props.t('connectingToRopsten') name = this.context.t('connectingToRopsten')
} else if (providerName === 'rinkeby') { } else if (providerName === 'rinkeby') {
name = this.props.t('connectingToRinkeby') name = this.context.t('connectingToRinkeby')
} else { } else {
name = this.props.t('connectingToUnknown') name = this.context.t('connectingToUnknown')
} }
return name return name
@ -577,15 +583,15 @@ App.prototype.getNetworkName = function () {
let name let name
if (providerName === 'mainnet') { if (providerName === 'mainnet') {
name = this.props.t('mainnet') name = this.context.t('mainnet')
} else if (providerName === 'ropsten') { } else if (providerName === 'ropsten') {
name = this.props.t('ropsten') name = this.context.t('ropsten')
} else if (providerName === 'kovan') { } else if (providerName === 'kovan') {
name = this.props.t('kovan') name = this.context.t('kovan')
} else if (providerName === 'rinkeby') { } else if (providerName === 'rinkeby') {
name = this.props.t('rinkeby') name = this.context.t('rinkeby')
} else { } else {
name = this.props.t('unknownNetwork') name = this.context.t('unknownNetwork')
} }
return name return name

View File

@ -3,7 +3,7 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const actions = require('../actions') const actions = require('../actions')
const genAccountLink = require('etherscan-link').createAccountLink const genAccountLink = require('etherscan-link').createAccountLink
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const Dropdown = require('./dropdown').Dropdown const Dropdown = require('./dropdown').Dropdown
const DropdownMenuItem = require('./dropdown').DropdownMenuItem const DropdownMenuItem = require('./dropdown').DropdownMenuItem
const Identicon = require('./identicon') const Identicon = require('./identicon')
@ -79,7 +79,7 @@ class AccountDropdowns extends Component {
try { // Sometimes keyrings aren't loaded yet: try { // Sometimes keyrings aren't loaded yet:
const type = keyring.type const type = keyring.type
const isLoose = type !== 'HD Key Tree' const isLoose = type !== 'HD Key Tree'
return isLoose ? h('.keyring-label.allcaps', this.props.t('loose')) : null return isLoose ? h('.keyring-label.allcaps', this.context.t('loose')) : null
} catch (e) { return } } catch (e) { return }
} }
@ -129,7 +129,7 @@ class AccountDropdowns extends Component {
diameter: 32, diameter: 32,
}, },
), ),
h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, this.props.t('createAccount')), h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, this.context.t('createAccount')),
], ],
), ),
h( h(
@ -154,7 +154,7 @@ class AccountDropdowns extends Component {
fontSize: '24px', fontSize: '24px',
marginBottom: '5px', marginBottom: '5px',
}, },
}, this.props.t('importAccount')), }, this.context.t('importAccount')),
] ]
), ),
] ]
@ -192,7 +192,7 @@ class AccountDropdowns extends Component {
global.platform.openWindow({ url }) global.platform.openWindow({ url })
}, },
}, },
this.props.t('etherscanView'), this.context.t('etherscanView'),
), ),
h( h(
DropdownMenuItem, DropdownMenuItem,
@ -204,7 +204,7 @@ class AccountDropdowns extends Component {
actions.showQrView(selected, identity ? identity.name : '') actions.showQrView(selected, identity ? identity.name : '')
}, },
}, },
this.props.t('showQRCode'), this.context.t('showQRCode'),
), ),
h( h(
DropdownMenuItem, DropdownMenuItem,
@ -216,7 +216,7 @@ class AccountDropdowns extends Component {
copyToClipboard(checkSumAddress) copyToClipboard(checkSumAddress)
}, },
}, },
this.props.t('copyAddress'), this.context.t('copyAddress'),
), ),
h( h(
DropdownMenuItem, DropdownMenuItem,
@ -226,7 +226,7 @@ class AccountDropdowns extends Component {
actions.requestAccountExport() actions.requestAccountExport()
}, },
}, },
this.props.t('exportPrivateKey'), this.context.t('exportPrivateKey'),
), ),
] ]
) )
@ -316,6 +316,10 @@ const mapDispatchToProps = (dispatch) => {
} }
} }
AccountDropdowns.contextTypes = {
t: PropTypes.func,
}
module.exports = { module.exports = {
AccountDropdowns: connect(null, mapDispatchToProps)(AccountDropdowns), AccountDropdowns: connect(null, mapDispatchToProps)(AccountDropdowns),
} }

View File

@ -1,14 +1,20 @@
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const PropTypes = require('prop-types')
const inherits = require('util').inherits const inherits = require('util').inherits
const exportAsFile = require('../util').exportAsFile const exportAsFile = require('../util').exportAsFile
const copyToClipboard = require('copy-to-clipboard') const copyToClipboard = require('copy-to-clipboard')
const actions = require('../actions') const actions = require('../actions')
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
ExportAccountView.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps)(ExportAccountView) module.exports = connect(mapStateToProps)(ExportAccountView)
inherits(ExportAccountView, Component) inherits(ExportAccountView, Component)
function ExportAccountView () { function ExportAccountView () {
Component.call(this) Component.call(this)
@ -35,7 +41,7 @@ ExportAccountView.prototype.render = function () {
if (notExporting) return h('div') if (notExporting) return h('div')
if (exportRequested) { if (exportRequested) {
const warning = this.props.t('exportPrivateKeyWarning') const warning = this.context.t('exportPrivateKeyWarning')
return ( return (
h('div', { h('div', {
style: { style: {
@ -53,7 +59,7 @@ ExportAccountView.prototype.render = function () {
h('p.error', warning), h('p.error', warning),
h('input#exportAccount.sizing-input', { h('input#exportAccount.sizing-input', {
type: 'password', type: 'password',
placeholder: this.props.t('confirmPassword').toLowerCase(), placeholder: this.context.t('confirmPassword').toLowerCase(),
onKeyPress: this.onExportKeyPress.bind(this), onKeyPress: this.onExportKeyPress.bind(this),
style: { style: {
position: 'relative', position: 'relative',
@ -74,10 +80,10 @@ ExportAccountView.prototype.render = function () {
style: { style: {
marginRight: '10px', marginRight: '10px',
}, },
}, this.props.t('submit')), }, this.context.t('submit')),
h('button', { h('button', {
onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)), onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)),
}, this.props.t('cancel')), }, this.context.t('cancel')),
]), ]),
(this.props.warning) && ( (this.props.warning) && (
h('span.error', { h('span.error', {
@ -98,7 +104,7 @@ ExportAccountView.prototype.render = function () {
margin: '0 20px', margin: '0 20px',
}, },
}, [ }, [
h('label', this.props.t('copyPrivateKey') + ':'), h('label', this.context.t('copyPrivateKey') + ':'),
h('p.error.cursor-pointer', { h('p.error.cursor-pointer', {
style: { style: {
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
@ -112,13 +118,13 @@ ExportAccountView.prototype.render = function () {
}, plainKey), }, plainKey),
h('button', { h('button', {
onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)), onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)),
}, this.props.t('done')), }, this.context.t('done')),
h('button', { h('button', {
style: { style: {
marginLeft: '10px', marginLeft: '10px',
}, },
onClick: () => exportAsFile(`MetaMask ${nickname} Private Key`, plainKey), onClick: () => exportAsFile(`MetaMask ${nickname} Private Key`, plainKey),
}, this.props.t('saveAsFile')), }, this.context.t('saveAsFile')),
]) ])
} }
} }

View File

@ -1,14 +1,20 @@
const inherits = require('util').inherits const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const connect = require('../../metamask-connect') const PropTypes = require('prop-types')
const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const actions = require('../../actions') const actions = require('../../actions')
const { Menu, Item, Divider, CloseArea } = require('../dropdowns/components/menu') const { Menu, Item, Divider, CloseArea } = require('../dropdowns/components/menu')
const Identicon = require('../identicon') const Identicon = require('../identicon')
const { formatBalance } = require('../../util') const { formatBalance } = require('../../util')
AccountMenu.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountMenu) module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountMenu)
inherits(AccountMenu, Component) inherits(AccountMenu, Component)
function AccountMenu () { Component.call(this) } function AccountMenu () { Component.call(this) }
@ -70,10 +76,10 @@ AccountMenu.prototype.render = function () {
h(Item, { h(Item, {
className: 'account-menu__header', className: 'account-menu__header',
}, [ }, [
this.props.t('myAccounts'), this.context.t('myAccounts'),
h('button.account-menu__logout-button', { h('button.account-menu__logout-button', {
onClick: lockMetamask, onClick: lockMetamask,
}, this.props.t('logout')), }, this.context.t('logout')),
]), ]),
h(Divider), h(Divider),
h('div.account-menu__accounts', this.renderAccounts()), h('div.account-menu__accounts', this.renderAccounts()),
@ -81,23 +87,23 @@ AccountMenu.prototype.render = function () {
h(Item, { h(Item, {
onClick: () => showNewAccountPage('CREATE'), onClick: () => showNewAccountPage('CREATE'),
icon: h('img.account-menu__item-icon', { src: 'images/plus-btn-white.svg' }), icon: h('img.account-menu__item-icon', { src: 'images/plus-btn-white.svg' }),
text: this.props.t('createAccount'), text: this.context.t('createAccount'),
}), }),
h(Item, { h(Item, {
onClick: () => showNewAccountPage('IMPORT'), onClick: () => showNewAccountPage('IMPORT'),
icon: h('img.account-menu__item-icon', { src: 'images/import-account.svg' }), icon: h('img.account-menu__item-icon', { src: 'images/import-account.svg' }),
text: this.props.t('importAccount'), text: this.context.t('importAccount'),
}), }),
h(Divider), h(Divider),
h(Item, { h(Item, {
onClick: showInfoPage, onClick: showInfoPage,
icon: h('img', { src: 'images/mm-info-icon.svg' }), icon: h('img', { src: 'images/mm-info-icon.svg' }),
text: this.props.t('infoHelp'), text: this.context.t('infoHelp'),
}), }),
h(Item, { h(Item, {
onClick: showConfigPage, onClick: showConfigPage,
icon: h('img.account-menu__item-icon', { src: 'images/settings.svg' }), icon: h('img.account-menu__item-icon', { src: 'images/settings.svg' }),
text: this.props.t('settings'), text: this.context.t('settings'),
}), }),
]) ])
} }
@ -155,6 +161,6 @@ AccountMenu.prototype.indicateIfLoose = function (keyring) {
try { // Sometimes keyrings aren't loaded yet: try { // Sometimes keyrings aren't loaded yet:
const type = keyring.type const type = keyring.type
const isLoose = type !== 'HD Key Tree' const isLoose = type !== 'HD Key Tree'
return isLoose ? h('.keyring-label.allcaps', this.props.t('imported')) : null return isLoose ? h('.keyring-label.allcaps', this.context.t('imported')) : null
} catch (e) { return } } catch (e) { return }
} }

View File

@ -1,5 +1,5 @@
const Component = require('react').Component const Component = require('react').Component
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const TokenBalance = require('./token-balance') const TokenBalance = require('./token-balance')

View File

@ -1,13 +1,19 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
const BN = ethUtil.BN const BN = ethUtil.BN
const extend = require('xtend') const extend = require('xtend')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
BnAsDecimalInput.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(BnAsDecimalInput) module.exports = connect()(BnAsDecimalInput)
inherits(BnAsDecimalInput, Component) inherits(BnAsDecimalInput, Component)
function BnAsDecimalInput () { function BnAsDecimalInput () {
this.state = { invalid: null } this.state = { invalid: null }
@ -137,13 +143,13 @@ BnAsDecimalInput.prototype.constructWarning = function () {
let message = name ? name + ' ' : '' let message = name ? name + ' ' : ''
if (min && max) { if (min && max) {
message += this.props.t('betweenMinAndMax', [`${newMin} ${suffix}`, `${newMax} ${suffix}`]) message += this.context.t('betweenMinAndMax', [`${newMin} ${suffix}`, `${newMax} ${suffix}`])
} else if (min) { } else if (min) {
message += this.props.t('greaterThanMin', [`${newMin} ${suffix}`]) message += this.context.t('greaterThanMin', [`${newMin} ${suffix}`])
} else if (max) { } else if (max) {
message += this.props.t('lessThanMax', [`${newMax} ${suffix}`]) message += this.context.t('lessThanMax', [`${newMax} ${suffix}`])
} else { } else {
message += this.props.t('invalidInput') message += this.context.t('invalidInput')
} }
return message return message

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const actions = require('../actions') const actions = require('../actions')
const CoinbaseForm = require('./coinbase-form') const CoinbaseForm = require('./coinbase-form')
const ShapeshiftForm = require('./shapeshift-form') const ShapeshiftForm = require('./shapeshift-form')
@ -10,8 +11,13 @@ const AccountPanel = require('./account-panel')
const RadioList = require('./custom-radio-list') const RadioList = require('./custom-radio-list')
const networkNames = require('../../../app/scripts/config.js').networkNames const networkNames = require('../../../app/scripts/config.js').networkNames
BuyButtonSubview.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps)(BuyButtonSubview) module.exports = connect(mapStateToProps)(BuyButtonSubview)
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
identity: state.appState.identity, identity: state.appState.identity,
@ -76,7 +82,7 @@ BuyButtonSubview.prototype.headerSubview = function () {
paddingTop: '4px', paddingTop: '4px',
paddingBottom: '4px', paddingBottom: '4px',
}, },
}, this.props.t('depositEth')), }, this.context.t('depositEth')),
]), ]),
// loading indication // loading indication
@ -118,7 +124,7 @@ BuyButtonSubview.prototype.headerSubview = function () {
paddingTop: '4px', paddingTop: '4px',
paddingBottom: '4px', paddingBottom: '4px',
}, },
}, this.props.t('selectService')), }, this.context.t('selectService')),
]), ]),
]) ])
@ -143,7 +149,7 @@ BuyButtonSubview.prototype.primarySubview = function () {
case '4': case '4':
case '42': case '42':
const networkName = networkNames[network] const networkName = networkNames[network]
const label = `${networkName} ${this.props.t('testFaucet')}` const label = `${networkName} ${this.context.t('testFaucet')}`
return ( return (
h('div.flex-column', { h('div.flex-column', {
style: { style: {
@ -164,14 +170,14 @@ BuyButtonSubview.prototype.primarySubview = function () {
style: { style: {
marginTop: '15px', marginTop: '15px',
}, },
}, this.props.t('borrowDharma')) }, this.context.t('borrowDharma'))
) : null, ) : null,
]) ])
) )
default: default:
return ( return (
h('h2.error', this.props.t('unknownNetworkId')) h('h2.error', this.context.t('unknownNetworkId'))
) )
} }
@ -203,8 +209,8 @@ BuyButtonSubview.prototype.mainnetSubview = function () {
'ShapeShift', 'ShapeShift',
], ],
subtext: { subtext: {
'Coinbase': `${this.props.t('crypto')}/${this.props.t('fiat')} (${this.props.t('usaOnly')})`, 'Coinbase': `${this.context.t('crypto')}/${this.context.t('fiat')} (${this.context.t('usaOnly')})`,
'ShapeShift': this.props.t('crypto'), 'ShapeShift': this.context.t('crypto'),
}, },
onClick: this.radioHandler.bind(this), onClick: this.radioHandler.bind(this),
}), }),

View File

@ -1,11 +1,17 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const actions = require('../actions') const actions = require('../actions')
CoinbaseForm.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps)(CoinbaseForm) module.exports = connect(mapStateToProps)(CoinbaseForm)
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
warning: state.appState.warning, warning: state.appState.warning,
@ -37,11 +43,11 @@ CoinbaseForm.prototype.render = function () {
}, [ }, [
h('button.btn-green', { h('button.btn-green', {
onClick: this.toCoinbase.bind(this), onClick: this.toCoinbase.bind(this),
}, this.props.t('continueToCoinbase')), }, this.context.t('continueToCoinbase')),
h('button.btn-red', { h('button.btn-red', {
onClick: () => props.dispatch(actions.goHome()), onClick: () => props.dispatch(actions.goHome()),
}, this.props.t('cancel')), }, this.context.t('cancel')),
]), ]),
]) ])
} }

View File

@ -1,13 +1,19 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const copyToClipboard = require('copy-to-clipboard') const copyToClipboard = require('copy-to-clipboard')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const Tooltip = require('./tooltip') const Tooltip = require('./tooltip')
CopyButton.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(CopyButton) module.exports = connect()(CopyButton)
inherits(CopyButton, Component) inherits(CopyButton, Component)
function CopyButton () { function CopyButton () {
Component.call(this) Component.call(this)
@ -23,7 +29,7 @@ CopyButton.prototype.render = function () {
const value = props.value const value = props.value
const copied = state.copied const copied = state.copied
const message = copied ? this.props.t('copiedButton') : props.title || this.props.t('copyButton') const message = copied ? this.context.t('copiedButton') : props.title || this.context.t('copyButton')
return h('.copy-button', { return h('.copy-button', {
style: { style: {

View File

@ -1,13 +1,19 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const Tooltip = require('./tooltip') const Tooltip = require('./tooltip')
const copyToClipboard = require('copy-to-clipboard') const copyToClipboard = require('copy-to-clipboard')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
Copyable.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(Copyable) module.exports = connect()(Copyable)
inherits(Copyable, Component) inherits(Copyable, Component)
function Copyable () { function Copyable () {
Component.call(this) Component.call(this)
@ -23,7 +29,7 @@ Copyable.prototype.render = function () {
const { copied } = state const { copied } = state
return h(Tooltip, { return h(Tooltip, {
title: copied ? this.props.t('copiedExclamation') : this.props.t('copy'), title: copied ? this.context.t('copiedExclamation') : this.context.t('copy'),
position: 'bottom', position: 'bottom',
}, h('span', { }, h('span', {
style: { style: {

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const GasModalCard = require('./gas-modal-card') const GasModalCard = require('./gas-modal-card')
@ -64,6 +65,7 @@ function mapDispatchToProps (dispatch) {
updateGasLimit: newGasLimit => dispatch(actions.updateGasLimit(newGasLimit)), updateGasLimit: newGasLimit => dispatch(actions.updateGasLimit(newGasLimit)),
updateGasTotal: newGasTotal => dispatch(actions.updateGasTotal(newGasTotal)), updateGasTotal: newGasTotal => dispatch(actions.updateGasTotal(newGasTotal)),
updateSendAmount: newAmount => dispatch(actions.updateSendAmount(newAmount)), updateSendAmount: newAmount => dispatch(actions.updateSendAmount(newAmount)),
updateSendErrors: error => dispatch(actions.updateSendErrors(error)),
} }
} }
@ -94,8 +96,13 @@ function CustomizeGasModal (props) {
this.state = getOriginalState(props) this.state = getOriginalState(props)
} }
CustomizeGasModal.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(CustomizeGasModal) module.exports = connect(mapStateToProps, mapDispatchToProps)(CustomizeGasModal)
CustomizeGasModal.prototype.save = function (gasPrice, gasLimit, gasTotal) { CustomizeGasModal.prototype.save = function (gasPrice, gasLimit, gasTotal) {
const { const {
updateGasPrice, updateGasPrice,
@ -106,6 +113,7 @@ CustomizeGasModal.prototype.save = function (gasPrice, gasLimit, gasTotal) {
selectedToken, selectedToken,
balance, balance,
updateSendAmount, updateSendAmount,
updateSendErrors,
} = this.props } = this.props
if (maxModeOn && !selectedToken) { if (maxModeOn && !selectedToken) {
@ -120,6 +128,7 @@ CustomizeGasModal.prototype.save = function (gasPrice, gasLimit, gasTotal) {
updateGasPrice(ethUtil.addHexPrefix(gasPrice)) updateGasPrice(ethUtil.addHexPrefix(gasPrice))
updateGasLimit(ethUtil.addHexPrefix(gasLimit)) updateGasLimit(ethUtil.addHexPrefix(gasLimit))
updateGasTotal(ethUtil.addHexPrefix(gasTotal)) updateGasTotal(ethUtil.addHexPrefix(gasTotal))
updateSendErrors({ insufficientFunds: false })
hideModal() hideModal()
} }
@ -149,7 +158,7 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) {
}) })
if (!balanceIsSufficient) { if (!balanceIsSufficient) {
error = this.props.t('balanceIsInsufficientGas') error = this.context.t('balanceIsInsufficientGas')
} }
const gasLimitTooLow = gasLimit && conversionGreaterThan( const gasLimitTooLow = gasLimit && conversionGreaterThan(
@ -165,7 +174,7 @@ CustomizeGasModal.prototype.validate = function ({ gasTotal, gasLimit }) {
) )
if (gasLimitTooLow) { if (gasLimitTooLow) {
error = this.props.t('gasLimitTooLow') error = this.context.t('gasLimitTooLow')
} }
this.setState({ error }) this.setState({ error })
@ -258,7 +267,7 @@ CustomizeGasModal.prototype.render = function () {
}, [ }, [
h('div.send-v2__customize-gas__header', {}, [ h('div.send-v2__customize-gas__header', {}, [
h('div.send-v2__customize-gas__title', this.props.t('customGas')), h('div.send-v2__customize-gas__title', this.context.t('customGas')),
h('div.send-v2__customize-gas__close', { h('div.send-v2__customize-gas__close', {
onClick: hideModal, onClick: hideModal,
@ -274,8 +283,8 @@ CustomizeGasModal.prototype.render = function () {
// max: 1000, // max: 1000,
step: multiplyCurrencies(MIN_GAS_PRICE_GWEI, 10), step: multiplyCurrencies(MIN_GAS_PRICE_GWEI, 10),
onChange: value => this.convertAndSetGasPrice(value), onChange: value => this.convertAndSetGasPrice(value),
title: this.props.t('gasPrice'), title: this.context.t('gasPrice'),
copy: this.props.t('gasPriceCalculation'), copy: this.context.t('gasPriceCalculation'),
}), }),
h(GasModalCard, { h(GasModalCard, {
@ -284,8 +293,8 @@ CustomizeGasModal.prototype.render = function () {
// max: 100000, // max: 100000,
step: 1, step: 1,
onChange: value => this.convertAndSetGasLimit(value), onChange: value => this.convertAndSetGasLimit(value),
title: this.props.t('gasLimit'), title: this.context.t('gasLimit'),
copy: this.props.t('gasLimitCalculation'), copy: this.context.t('gasLimitCalculation'),
}), }),
]), ]),
@ -298,7 +307,7 @@ CustomizeGasModal.prototype.render = function () {
h('div.send-v2__customize-gas__revert', { h('div.send-v2__customize-gas__revert', {
onClick: () => this.revert(), onClick: () => this.revert(),
}, [this.props.t('revert')]), }, [this.context.t('revert')]),
h('div.send-v2__customize-gas__buttons', [ h('div.send-v2__customize-gas__buttons', [
h('button.btn-secondary.send-v2__customize-gas__cancel', { h('button.btn-secondary.send-v2__customize-gas__cancel', {
@ -306,12 +315,12 @@ CustomizeGasModal.prototype.render = function () {
style: { style: {
marginRight: '10px', marginRight: '10px',
}, },
}, [this.props.t('cancel')]), }, [this.context.t('cancel')]),
h('button.btn-primary.send-v2__customize-gas__save', { h('button.btn-primary.send-v2__customize-gas__save', {
onClick: () => !error && this.save(newGasPrice, gasLimit, gasTotal), onClick: () => !error && this.save(newGasPrice, gasLimit, gasTotal),
className: error && 'btn-primary--disabled', className: error && 'btn-primary--disabled',
}, [this.props.t('save')]), }, [this.context.t('save')]),
]), ]),
]), ]),

View File

@ -3,7 +3,7 @@ const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const actions = require('../../../actions') const actions = require('../../../actions')
const genAccountLink = require('../../../../lib/account-link.js') const genAccountLink = require('../../../../lib/account-link.js')
const connect = require('../../../metamask-connect') const connect = require('react-redux').connect
const Dropdown = require('./dropdown').Dropdown const Dropdown = require('./dropdown').Dropdown
const DropdownMenuItem = require('./dropdown').DropdownMenuItem const DropdownMenuItem = require('./dropdown').DropdownMenuItem
const Identicon = require('../../identicon') const Identicon = require('../../identicon')
@ -130,7 +130,7 @@ class AccountDropdowns extends Component {
actions.showEditAccountModal(identity) actions.showEditAccountModal(identity)
}, },
}, [ }, [
this.props.t('edit'), this.context.t('edit'),
]), ]),
]), ]),
@ -144,7 +144,7 @@ class AccountDropdowns extends Component {
try { // Sometimes keyrings aren't loaded yet: try { // Sometimes keyrings aren't loaded yet:
const type = keyring.type const type = keyring.type
const isLoose = type !== 'HD Key Tree' const isLoose = type !== 'HD Key Tree'
return isLoose ? h('.keyring-label.allcaps', this.props.t('loose')) : null return isLoose ? h('.keyring-label.allcaps', this.context.t('loose')) : null
} catch (e) { return } } catch (e) { return }
} }
@ -202,7 +202,7 @@ class AccountDropdowns extends Component {
fontSize: '16px', fontSize: '16px',
lineHeight: '23px', lineHeight: '23px',
}, },
}, this.props.t('createAccount')), }, this.context.t('createAccount')),
], ],
), ),
h( h(
@ -236,7 +236,7 @@ class AccountDropdowns extends Component {
fontSize: '16px', fontSize: '16px',
lineHeight: '23px', lineHeight: '23px',
}, },
}, this.props.t('importAccount')), }, this.context.t('importAccount')),
] ]
), ),
] ]
@ -287,7 +287,7 @@ class AccountDropdowns extends Component {
menuItemStyles, menuItemStyles,
), ),
}, },
this.props.t('accountDetails'), this.context.t('accountDetails'),
), ),
h( h(
DropdownMenuItem, DropdownMenuItem,
@ -303,7 +303,7 @@ class AccountDropdowns extends Component {
menuItemStyles, menuItemStyles,
), ),
}, },
this.props.t('etherscanView'), this.context.t('etherscanView'),
), ),
h( h(
DropdownMenuItem, DropdownMenuItem,
@ -319,7 +319,7 @@ class AccountDropdowns extends Component {
menuItemStyles, menuItemStyles,
), ),
}, },
this.props.t('copyAddress'), this.context.t('copyAddress'),
), ),
h( h(
DropdownMenuItem, DropdownMenuItem,
@ -331,7 +331,7 @@ class AccountDropdowns extends Component {
menuItemStyles, menuItemStyles,
), ),
}, },
this.props.t('exportPrivateKey'), this.context.t('exportPrivateKey'),
), ),
h( h(
DropdownMenuItem, DropdownMenuItem,
@ -346,7 +346,7 @@ class AccountDropdowns extends Component {
menuItemStyles, menuItemStyles,
), ),
}, },
this.props.t('addToken'), this.context.t('addToken'),
), ),
] ]
@ -464,4 +464,9 @@ function mapStateToProps (state) {
} }
} }
AccountDropdowns.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDropdowns) module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDropdowns)

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const Dropdown = require('./components/dropdown').Dropdown const Dropdown = require('./components/dropdown').Dropdown
const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem const DropdownMenuItem = require('./components/dropdown').DropdownMenuItem
@ -54,8 +55,13 @@ function NetworkDropdown () {
Component.call(this) Component.call(this)
} }
NetworkDropdown.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(NetworkDropdown) module.exports = connect(mapStateToProps, mapDispatchToProps)(NetworkDropdown)
// TODO: specify default props and proptypes // TODO: specify default props and proptypes
NetworkDropdown.prototype.render = function () { NetworkDropdown.prototype.render = function () {
const props = this.props const props = this.props
@ -94,13 +100,13 @@ NetworkDropdown.prototype.render = function () {
}, [ }, [
h('div.network-dropdown-header', {}, [ h('div.network-dropdown-header', {}, [
h('div.network-dropdown-title', {}, this.props.t('networks')), h('div.network-dropdown-title', {}, this.context.t('networks')),
h('div.network-dropdown-divider'), h('div.network-dropdown-divider'),
h('div.network-dropdown-content', h('div.network-dropdown-content',
{}, {},
this.props.t('defaultNetwork') this.context.t('defaultNetwork')
), ),
]), ]),
@ -122,7 +128,7 @@ NetworkDropdown.prototype.render = function () {
style: { style: {
color: providerType === 'mainnet' ? '#ffffff' : '#9b9b9b', color: providerType === 'mainnet' ? '#ffffff' : '#9b9b9b',
}, },
}, this.props.t('mainnet')), }, this.context.t('mainnet')),
] ]
), ),
@ -144,7 +150,7 @@ NetworkDropdown.prototype.render = function () {
style: { style: {
color: providerType === 'ropsten' ? '#ffffff' : '#9b9b9b', color: providerType === 'ropsten' ? '#ffffff' : '#9b9b9b',
}, },
}, this.props.t('ropsten')), }, this.context.t('ropsten')),
] ]
), ),
@ -166,7 +172,7 @@ NetworkDropdown.prototype.render = function () {
style: { style: {
color: providerType === 'kovan' ? '#ffffff' : '#9b9b9b', color: providerType === 'kovan' ? '#ffffff' : '#9b9b9b',
}, },
}, this.props.t('kovan')), }, this.context.t('kovan')),
] ]
), ),
@ -188,7 +194,7 @@ NetworkDropdown.prototype.render = function () {
style: { style: {
color: providerType === 'rinkeby' ? '#ffffff' : '#9b9b9b', color: providerType === 'rinkeby' ? '#ffffff' : '#9b9b9b',
}, },
}, this.props.t('rinkeby')), }, this.context.t('rinkeby')),
] ]
), ),
@ -210,7 +216,7 @@ NetworkDropdown.prototype.render = function () {
style: { style: {
color: activeNetwork === 'http://localhost:8545' ? '#ffffff' : '#9b9b9b', color: activeNetwork === 'http://localhost:8545' ? '#ffffff' : '#9b9b9b',
}, },
}, this.props.t('localhost')), }, this.context.t('localhost')),
] ]
), ),
@ -234,7 +240,7 @@ NetworkDropdown.prototype.render = function () {
style: { style: {
color: activeNetwork === 'custom' ? '#ffffff' : '#9b9b9b', color: activeNetwork === 'custom' ? '#ffffff' : '#9b9b9b',
}, },
}, this.props.t('customRPC')), }, this.context.t('customRPC')),
] ]
), ),
@ -249,15 +255,15 @@ NetworkDropdown.prototype.getNetworkName = function () {
let name let name
if (providerName === 'mainnet') { if (providerName === 'mainnet') {
name = this.props.t('mainnet') name = this.context.t('mainnet')
} else if (providerName === 'ropsten') { } else if (providerName === 'ropsten') {
name = this.props.t('ropsten') name = this.context.t('ropsten')
} else if (providerName === 'kovan') { } else if (providerName === 'kovan') {
name = this.props.t('kovan') name = this.context.t('kovan')
} else if (providerName === 'rinkeby') { } else if (providerName === 'rinkeby') {
name = this.props.t('rinkeby') name = this.context.t('rinkeby')
} else { } else {
name = this.props.t('unknownNetwork') name = this.context.t('unknownNetwork')
} }
return name return name

View File

@ -1,12 +1,18 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
TokenMenuDropdown.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(null, mapDispatchToProps)(TokenMenuDropdown) module.exports = connect(null, mapDispatchToProps)(TokenMenuDropdown)
function mapDispatchToProps (dispatch) { function mapDispatchToProps (dispatch) {
return { return {
showHideTokenConfirmationModal: (token) => { showHideTokenConfirmationModal: (token) => {
@ -44,7 +50,7 @@ TokenMenuDropdown.prototype.render = function () {
showHideTokenConfirmationModal(this.props.token) showHideTokenConfirmationModal(this.props.token)
this.props.onClose() this.props.onClose()
}, },
}, this.props.t('hideToken')), }, this.context.t('hideToken')),
]), ]),
]), ]),

View File

@ -1,4 +1,5 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const extend = require('xtend') const extend = require('xtend')
@ -8,11 +9,16 @@ const ENS = require('ethjs-ens')
const networkMap = require('ethjs-ens/lib/network-map.json') const networkMap = require('ethjs-ens/lib/network-map.json')
const ensRE = /.+\..+$/ const ensRE = /.+\..+$/
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const ToAutoComplete = require('./send/to-autocomplete') const ToAutoComplete = require('./send/to-autocomplete')
EnsInput.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(EnsInput) module.exports = connect()(EnsInput)
inherits(EnsInput, Component) inherits(EnsInput, Component)
function EnsInput () { function EnsInput () {
Component.call(this) Component.call(this)
@ -70,13 +76,13 @@ EnsInput.prototype.lookupEnsName = function (recipient) {
log.info(`ENS attempting to resolve name: ${recipient}`) log.info(`ENS attempting to resolve name: ${recipient}`)
this.ens.lookup(recipient.trim()) this.ens.lookup(recipient.trim())
.then((address) => { .then((address) => {
if (address === ZERO_ADDRESS) throw new Error(this.props.t('noAddressForName')) if (address === ZERO_ADDRESS) throw new Error(this.context.t('noAddressForName'))
if (address !== ensResolution) { if (address !== ensResolution) {
this.setState({ this.setState({
loadingEns: false, loadingEns: false,
ensResolution: address, ensResolution: address,
nickname: recipient.trim(), nickname: recipient.trim(),
hoverText: address + '\n' + this.props.t('clickCopy'), hoverText: address + '\n' + this.context.t('clickCopy'),
ensFailure: false, ensFailure: false,
}) })
} }

View File

@ -1,13 +1,19 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
const BN = ethUtil.BN const BN = ethUtil.BN
const extend = require('xtend') const extend = require('xtend')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
HexAsDecimalInput.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(HexAsDecimalInput) module.exports = connect()(HexAsDecimalInput)
inherits(HexAsDecimalInput, Component) inherits(HexAsDecimalInput, Component)
function HexAsDecimalInput () { function HexAsDecimalInput () {
this.state = { invalid: null } this.state = { invalid: null }
@ -127,13 +133,13 @@ HexAsDecimalInput.prototype.constructWarning = function () {
let message = name ? name + ' ' : '' let message = name ? name + ' ' : ''
if (min && max) { if (min && max) {
message += this.props.t('betweenMinAndMax', [min, max]) message += this.context.t('betweenMinAndMax', [min, max])
} else if (min) { } else if (min) {
message += this.props.t('greaterThanMin', [min]) message += this.context.t('greaterThanMin', [min])
} else if (max) { } else if (max) {
message += this.props.t('lessThanMax', [max]) message += this.context.t('lessThanMax', [max])
} else { } else {
message += this.props.t('invalidInput') message += this.context.t('invalidInput')
} }
return message return message

View File

@ -1,7 +1,7 @@
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const isNode = require('detect-node') const isNode = require('detect-node')
const findDOMNode = require('react-dom').findDOMNode const findDOMNode = require('react-dom').findDOMNode
const jazzicon = require('jazzicon') const jazzicon = require('jazzicon')
@ -47,7 +47,7 @@ IdenticonComponent.prototype.render = function () {
) )
: ( : (
h('img.balance-icon', { h('img.balance-icon', {
src: '../images/eth_logo.svg', src: './images/eth_logo.svg',
style: { style: {
height: diameter, height: diameter,
width: diameter, width: diameter,
@ -105,9 +105,8 @@ IdenticonComponent.prototype.componentDidUpdate = function () {
function _generateBlockie (container, address, diameter) { function _generateBlockie (container, address, diameter) {
const img = new Image() const img = new Image()
img.src = toDataUrl(address) img.src = toDataUrl(address)
const dia = !diameter || diameter < 50 ? 50 : diameter img.height = diameter
img.height = dia * 1.25 img.width = diameter
img.width = dia * 1.25
container.appendChild(img) container.appendChild(img)
} }

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const AccountModalContainer = require('./account-modal-container') const AccountModalContainer = require('./account-modal-container')
const { getSelectedIdentity } = require('../../selectors') const { getSelectedIdentity } = require('../../selectors')
@ -33,8 +34,13 @@ function AccountDetailsModal () {
Component.call(this) Component.call(this)
} }
AccountDetailsModal.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDetailsModal) module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountDetailsModal)
// Not yet pixel perfect todos: // Not yet pixel perfect todos:
// fonts of qr-header // fonts of qr-header
@ -64,12 +70,12 @@ AccountDetailsModal.prototype.render = function () {
h('button.btn-primary.account-modal__button', { h('button.btn-primary.account-modal__button', {
onClick: () => global.platform.openWindow({ url: genAccountLink(address, network) }), onClick: () => global.platform.openWindow({ url: genAccountLink(address, network) }),
}, this.props.t('etherscanView')), }, this.context.t('etherscanView')),
// Holding on redesign for Export Private Key functionality // Holding on redesign for Export Private Key functionality
h('button.btn-primary.account-modal__button', { h('button.btn-primary.account-modal__button', {
onClick: () => showExportPrivateKeyModal(), onClick: () => showExportPrivateKeyModal(),
}, this.props.t('exportPrivateKey')), }, this.context.t('exportPrivateKey')),
]) ])
} }

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const { getSelectedIdentity } = require('../../selectors') const { getSelectedIdentity } = require('../../selectors')
const Identicon = require('../identicon') const Identicon = require('../identicon')
@ -25,8 +26,13 @@ function AccountModalContainer () {
Component.call(this) Component.call(this)
} }
AccountModalContainer.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountModalContainer) module.exports = connect(mapStateToProps, mapDispatchToProps)(AccountModalContainer)
AccountModalContainer.prototype.render = function () { AccountModalContainer.prototype.render = function () {
const { const {
selectedIdentity, selectedIdentity,
@ -59,7 +65,7 @@ AccountModalContainer.prototype.render = function () {
h('i.fa.fa-angle-left.fa-lg'), h('i.fa.fa-angle-left.fa-lg'),
h('span.account-modal-back__text', ' ' + this.props.t('back')), h('span.account-modal-back__text', ' ' + this.context.t('back')),
]), ]),

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const networkNames = require('../../../../app/scripts/config.js').networkNames const networkNames = require('../../../../app/scripts/config.js').networkNames
@ -32,8 +33,13 @@ function BuyOptions () {
Component.call(this) Component.call(this)
} }
BuyOptions.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(BuyOptions) module.exports = connect(mapStateToProps, mapDispatchToProps)(BuyOptions)
BuyOptions.prototype.renderModalContentOption = function (title, header, onClick) { BuyOptions.prototype.renderModalContentOption = function (title, header, onClick) {
return h('div.buy-modal-content-option', { return h('div.buy-modal-content-option', {
onClick, onClick,
@ -56,15 +62,15 @@ BuyOptions.prototype.render = function () {
}, [ }, [
h('div.buy-modal-content-title', { h('div.buy-modal-content-title', {
style: {}, style: {},
}, this.props.t('transfers')), }, this.context.t('transfers')),
h('div', {}, this.props.t('howToDeposit')), h('div', {}, this.context.t('howToDeposit')),
]), ]),
h('div.buy-modal-content-options.flex-column.flex-center', {}, [ h('div.buy-modal-content-options.flex-column.flex-center', {}, [
isTestNetwork isTestNetwork
? this.renderModalContentOption(networkName, this.props.t('testFaucet'), () => toFaucet(network)) ? this.renderModalContentOption(networkName, this.context.t('testFaucet'), () => toFaucet(network))
: this.renderModalContentOption('Coinbase', this.props.t('depositFiat'), () => toCoinbase(address)), : this.renderModalContentOption('Coinbase', this.context.t('depositFiat'), () => toCoinbase(address)),
// h('div.buy-modal-content-option', {}, [ // h('div.buy-modal-content-option', {}, [
// h('div.buy-modal-content-option-title', {}, 'Shapeshift'), // h('div.buy-modal-content-option-title', {}, 'Shapeshift'),
@ -72,8 +78,8 @@ BuyOptions.prototype.render = function () {
// ]),, // ]),,
this.renderModalContentOption( this.renderModalContentOption(
this.props.t('directDeposit'), this.context.t('directDeposit'),
this.props.t('depositFromAccount'), this.context.t('depositFromAccount'),
() => this.goToAccountDetailsModal() () => this.goToAccountDetailsModal()
), ),
@ -84,7 +90,7 @@ BuyOptions.prototype.render = function () {
background: 'white', background: 'white',
}, },
onClick: () => { this.props.hideModal() }, onClick: () => { this.props.hideModal() },
}, h('div.buy-modal-content-footer#buy-modal-content-footer-text', {}, this.props.t('cancel'))), }, h('div.buy-modal-content-footer#buy-modal-content-footer-text', {}, this.context.t('cancel'))),
]), ]),
]) ])
} }

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const networkNames = require('../../../../app/scripts/config.js').networkNames const networkNames = require('../../../../app/scripts/config.js').networkNames
const ShapeshiftForm = require('../shapeshift-form') const ShapeshiftForm = require('../shapeshift-form')
@ -40,27 +41,32 @@ function mapDispatchToProps (dispatch) {
} }
inherits(DepositEtherModal, Component) inherits(DepositEtherModal, Component)
function DepositEtherModal (props) { function DepositEtherModal (props, context) {
Component.call(this) Component.call(this)
// need to set after i18n locale has loaded // need to set after i18n locale has loaded
DIRECT_DEPOSIT_ROW_TITLE = props.t('directDepositEther') DIRECT_DEPOSIT_ROW_TITLE = context.t('directDepositEther')
DIRECT_DEPOSIT_ROW_TEXT = props.t('directDepositEtherExplainer') DIRECT_DEPOSIT_ROW_TEXT = context.t('directDepositEtherExplainer')
COINBASE_ROW_TITLE = props.t('buyCoinbase') COINBASE_ROW_TITLE = context.t('buyCoinbase')
COINBASE_ROW_TEXT = props.t('buyCoinbaseExplainer') COINBASE_ROW_TEXT = context.t('buyCoinbaseExplainer')
SHAPESHIFT_ROW_TITLE = props.t('depositShapeShift') SHAPESHIFT_ROW_TITLE = context.t('depositShapeShift')
SHAPESHIFT_ROW_TEXT = props.t('depositShapeShiftExplainer') SHAPESHIFT_ROW_TEXT = context.t('depositShapeShiftExplainer')
FAUCET_ROW_TITLE = props.t('testFaucet') FAUCET_ROW_TITLE = context.t('testFaucet')
this.state = { this.state = {
buyingWithShapeshift: false, buyingWithShapeshift: false,
} }
} }
DepositEtherModal.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(DepositEtherModal) module.exports = connect(mapStateToProps, mapDispatchToProps)(DepositEtherModal)
DepositEtherModal.prototype.facuetRowText = function (networkName) { DepositEtherModal.prototype.facuetRowText = function (networkName) {
return this.props.t('getEtherFromFaucet', [networkName]) return this.context.t('getEtherFromFaucet', [networkName])
} }
DepositEtherModal.prototype.renderRow = function ({ DepositEtherModal.prototype.renderRow = function ({
@ -122,10 +128,10 @@ DepositEtherModal.prototype.render = function () {
h('div.page-container__header', [ h('div.page-container__header', [
h('div.page-container__title', [this.props.t('depositEther')]), h('div.page-container__title', [this.context.t('depositEther')]),
h('div.page-container__subtitle', [ h('div.page-container__subtitle', [
this.props.t('needEtherInWallet'), this.context.t('needEtherInWallet'),
]), ]),
h('div.page-container__header-close', { h('div.page-container__header-close', {
@ -144,11 +150,11 @@ DepositEtherModal.prototype.render = function () {
this.renderRow({ this.renderRow({
logo: h('img.deposit-ether-modal__logo', { logo: h('img.deposit-ether-modal__logo', {
src: '../../../images/deposit-eth.svg', src: './images/deposit-eth.svg',
}), }),
title: DIRECT_DEPOSIT_ROW_TITLE, title: DIRECT_DEPOSIT_ROW_TITLE,
text: DIRECT_DEPOSIT_ROW_TEXT, text: DIRECT_DEPOSIT_ROW_TEXT,
buttonLabel: this.props.t('viewAccount'), buttonLabel: this.context.t('viewAccount'),
onButtonClick: () => this.goToAccountDetailsModal(), onButtonClick: () => this.goToAccountDetailsModal(),
hide: buyingWithShapeshift, hide: buyingWithShapeshift,
}), }),
@ -157,7 +163,7 @@ DepositEtherModal.prototype.render = function () {
logo: h('i.fa.fa-tint.fa-2x'), logo: h('i.fa.fa-tint.fa-2x'),
title: FAUCET_ROW_TITLE, title: FAUCET_ROW_TITLE,
text: this.facuetRowText(networkName), text: this.facuetRowText(networkName),
buttonLabel: this.props.t('getEther'), buttonLabel: this.context.t('getEther'),
onButtonClick: () => toFaucet(network), onButtonClick: () => toFaucet(network),
hide: !isTestNetwork || buyingWithShapeshift, hide: !isTestNetwork || buyingWithShapeshift,
}), }),
@ -165,13 +171,13 @@ DepositEtherModal.prototype.render = function () {
this.renderRow({ this.renderRow({
logo: h('div.deposit-ether-modal__logo', { logo: h('div.deposit-ether-modal__logo', {
style: { style: {
backgroundImage: 'url(\'../../../images/coinbase logo.png\')', backgroundImage: 'url(\'./images/coinbase logo.png\')',
height: '40px', height: '40px',
}, },
}), }),
title: COINBASE_ROW_TITLE, title: COINBASE_ROW_TITLE,
text: COINBASE_ROW_TEXT, text: COINBASE_ROW_TEXT,
buttonLabel: this.props.t('continueToCoinbase'), buttonLabel: this.context.t('continueToCoinbase'),
onButtonClick: () => toCoinbase(address), onButtonClick: () => toCoinbase(address),
hide: isTestNetwork || buyingWithShapeshift, hide: isTestNetwork || buyingWithShapeshift,
}), }),
@ -179,12 +185,12 @@ DepositEtherModal.prototype.render = function () {
this.renderRow({ this.renderRow({
logo: h('div.deposit-ether-modal__logo', { logo: h('div.deposit-ether-modal__logo', {
style: { style: {
backgroundImage: 'url(\'../../../images/shapeshift logo.png\')', backgroundImage: 'url(\'./images/shapeshift logo.png\')',
}, },
}), }),
title: SHAPESHIFT_ROW_TITLE, title: SHAPESHIFT_ROW_TITLE,
text: SHAPESHIFT_ROW_TEXT, text: SHAPESHIFT_ROW_TEXT,
buttonLabel: this.props.t('shapeshiftBuy'), buttonLabel: this.context.t('shapeshiftBuy'),
onButtonClick: () => this.setState({ buyingWithShapeshift: true }), onButtonClick: () => this.setState({ buyingWithShapeshift: true }),
hide: isTestNetwork, hide: isTestNetwork,
hideButton: buyingWithShapeshift, hideButton: buyingWithShapeshift,

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const { getSelectedAccount } = require('../../selectors') const { getSelectedAccount } = require('../../selectors')
@ -32,8 +33,13 @@ function EditAccountNameModal (props) {
} }
} }
EditAccountNameModal.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(EditAccountNameModal) module.exports = connect(mapStateToProps, mapDispatchToProps)(EditAccountNameModal)
EditAccountNameModal.prototype.render = function () { EditAccountNameModal.prototype.render = function () {
const { hideModal, saveAccountLabel, identity } = this.props const { hideModal, saveAccountLabel, identity } = this.props
@ -50,7 +56,7 @@ EditAccountNameModal.prototype.render = function () {
]), ]),
h('div.edit-account-name-modal-title', { h('div.edit-account-name-modal-title', {
}, [this.props.t('editAccountName')]), }, [this.context.t('editAccountName')]),
h('input.edit-account-name-modal-input', { h('input.edit-account-name-modal-input', {
placeholder: identity.name, placeholder: identity.name,
@ -69,7 +75,7 @@ EditAccountNameModal.prototype.render = function () {
}, },
disabled: this.state.inputText.length === 0, disabled: this.state.inputText.length === 0,
}, [ }, [
this.props.t('save'), this.context.t('save'),
]), ]),
]), ]),

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
const actions = require('../../actions') const actions = require('../../actions')
const AccountModalContainer = require('./account-modal-container') const AccountModalContainer = require('./account-modal-container')
@ -37,8 +38,13 @@ function ExportPrivateKeyModal () {
} }
} }
ExportPrivateKeyModal.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(ExportPrivateKeyModal) module.exports = connect(mapStateToProps, mapDispatchToProps)(ExportPrivateKeyModal)
ExportPrivateKeyModal.prototype.exportAccountAndGetPrivateKey = function (password, address) { ExportPrivateKeyModal.prototype.exportAccountAndGetPrivateKey = function (password, address) {
const { exportAccount } = this.props const { exportAccount } = this.props
@ -48,8 +54,8 @@ ExportPrivateKeyModal.prototype.exportAccountAndGetPrivateKey = function (passwo
ExportPrivateKeyModal.prototype.renderPasswordLabel = function (privateKey) { ExportPrivateKeyModal.prototype.renderPasswordLabel = function (privateKey) {
return h('span.private-key-password-label', privateKey return h('span.private-key-password-label', privateKey
? this.props.t('copyPrivateKey') ? this.context.t('copyPrivateKey')
: this.props.t('typePassword') : this.context.t('typePassword')
) )
} }
@ -86,8 +92,8 @@ ExportPrivateKeyModal.prototype.renderButtons = function (privateKey, password,
), ),
(privateKey (privateKey
? this.renderButton('btn-primary--lg export-private-key__button', () => hideModal(), this.props.t('done')) ? this.renderButton('btn-primary--lg export-private-key__button', () => hideModal(), this.context.t('done'))
: this.renderButton('btn-primary--lg export-private-key__button', () => this.exportAccountAndGetPrivateKey(this.state.password, address), this.props.t('confirm')) : this.renderButton('btn-primary--lg export-private-key__button', () => this.exportAccountAndGetPrivateKey(this.state.password, address), this.context.t('confirm'))
), ),
]) ])
@ -120,7 +126,7 @@ ExportPrivateKeyModal.prototype.render = function () {
h('div.account-modal-divider'), h('div.account-modal-divider'),
h('span.modal-body-title', this.props.t('showPrivateKeys')), h('span.modal-body-title', this.context.t('showPrivateKeys')),
h('div.private-key-password', {}, [ h('div.private-key-password', {}, [
this.renderPasswordLabel(privateKey), this.renderPasswordLabel(privateKey),
@ -130,7 +136,7 @@ ExportPrivateKeyModal.prototype.render = function () {
!warning ? null : h('span.private-key-password-error', warning), !warning ? null : h('span.private-key-password-error', warning),
]), ]),
h('div.private-key-password-warning', this.props.t('privateKeyWarning')), h('div.private-key-password-warning', this.context.t('privateKeyWarning')),
this.renderButtons(privateKey, this.state.password, address, hideModal), this.renderButtons(privateKey, this.state.password, address, hideModal),

View File

@ -1,7 +1,8 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const Identicon = require('../identicon') const Identicon = require('../identicon')
@ -31,8 +32,13 @@ function HideTokenConfirmationModal () {
this.state = {} this.state = {}
} }
HideTokenConfirmationModal.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(HideTokenConfirmationModal) module.exports = connect(mapStateToProps, mapDispatchToProps)(HideTokenConfirmationModal)
HideTokenConfirmationModal.prototype.render = function () { HideTokenConfirmationModal.prototype.render = function () {
const { token, network, hideToken, hideModal } = this.props const { token, network, hideToken, hideModal } = this.props
const { symbol, address } = token const { symbol, address } = token
@ -41,7 +47,7 @@ HideTokenConfirmationModal.prototype.render = function () {
h('div.hide-token-confirmation__container', { h('div.hide-token-confirmation__container', {
}, [ }, [
h('div.hide-token-confirmation__title', {}, [ h('div.hide-token-confirmation__title', {}, [
this.props.t('hideTokenPrompt'), this.context.t('hideTokenPrompt'),
]), ]),
h(Identicon, { h(Identicon, {
@ -54,19 +60,19 @@ HideTokenConfirmationModal.prototype.render = function () {
h('div.hide-token-confirmation__symbol', {}, symbol), h('div.hide-token-confirmation__symbol', {}, symbol),
h('div.hide-token-confirmation__copy', {}, [ h('div.hide-token-confirmation__copy', {}, [
this.props.t('readdToken'), this.context.t('readdToken'),
]), ]),
h('div.hide-token-confirmation__buttons', {}, [ h('div.hide-token-confirmation__buttons', {}, [
h('button.btn-cancel.hide-token-confirmation__button.allcaps', { h('button.btn-cancel.hide-token-confirmation__button.allcaps', {
onClick: () => hideModal(), onClick: () => hideModal(),
}, [ }, [
this.props.t('cancel'), this.context.t('cancel'),
]), ]),
h('button.btn-clear.hide-token-confirmation__button.allcaps', { h('button.btn-clear.hide-token-confirmation__button.allcaps', {
onClick: () => hideToken(address), onClick: () => hideToken(address),
}, [ }, [
this.props.t('hide'), this.context.t('hide'),
]), ]),
]), ]),
]), ]),

View File

@ -1,7 +1,7 @@
const { Component } = require('react') const { Component } = require('react')
const PropTypes = require('prop-types') const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
class NewAccountModal extends Component { class NewAccountModal extends Component {
@ -11,7 +11,7 @@ class NewAccountModal extends Component {
const newAccountNumber = numberOfExistingAccounts + 1 const newAccountNumber = numberOfExistingAccounts + 1
this.state = { this.state = {
newAccountName: `${props.t('account')} ${newAccountNumber}`, newAccountName: `${this.context.t('account')} ${newAccountNumber}`,
} }
} }
@ -22,7 +22,7 @@ class NewAccountModal extends Component {
h('div.new-account-modal-wrapper', { h('div.new-account-modal-wrapper', {
}, [ }, [
h('div.new-account-modal-header', {}, [ h('div.new-account-modal-header', {}, [
this.props.t('newAccount'), this.context.t('newAccount'),
]), ]),
h('div.modal-close-x', { h('div.modal-close-x', {
@ -30,19 +30,19 @@ class NewAccountModal extends Component {
}), }),
h('div.new-account-modal-content', {}, [ h('div.new-account-modal-content', {}, [
this.props.t('accountName'), this.context.t('accountName'),
]), ]),
h('div.new-account-input-wrapper', {}, [ h('div.new-account-input-wrapper', {}, [
h('input.new-account-input', { h('input.new-account-input', {
value: this.state.newAccountName, value: this.state.newAccountName,
placeholder: this.props.t('sampleAccountName'), placeholder: this.context.t('sampleAccountName'),
onChange: event => this.setState({ newAccountName: event.target.value }), onChange: event => this.setState({ newAccountName: event.target.value }),
}, []), }, []),
]), ]),
h('div.new-account-modal-content.after-input', {}, [ h('div.new-account-modal-content.after-input', {}, [
this.props.t('or'), this.context.t('or'),
]), ]),
h('div.new-account-modal-content.after-input.pointer', { h('div.new-account-modal-content.after-input.pointer', {
@ -50,13 +50,13 @@ class NewAccountModal extends Component {
this.props.hideModal() this.props.hideModal()
this.props.showImportPage() this.props.showImportPage()
}, },
}, this.props.t('importAnAccount')), }, this.context.t('importAnAccount')),
h('div.new-account-modal-content.button.allcaps', {}, [ h('div.new-account-modal-content.button.allcaps', {}, [
h('button.btn-clear', { h('button.btn-clear', {
onClick: () => this.props.createAccount(newAccountName), onClick: () => this.props.createAccount(newAccountName),
}, [ }, [
this.props.t('save'), this.context.t('save'),
]), ]),
]), ]),
]), ]),
@ -104,4 +104,9 @@ const mapDispatchToProps = dispatch => {
} }
} }
NewAccountModal.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(NewAccountModal) module.exports = connect(mapStateToProps, mapDispatchToProps)(NewAccountModal)

View File

@ -1,7 +1,7 @@
const { Component } = require('react') const { Component } = require('react')
const PropTypes = require('prop-types') const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
class NotificationModal extends Component { class NotificationModal extends Component {
@ -22,12 +22,12 @@ class NotificationModal extends Component {
}, [ }, [
h('div.notification-modal__header', {}, [ h('div.notification-modal__header', {}, [
this.props.t(header), this.context.t(header),
]), ]),
h('div.notification-modal__message-wrapper', {}, [ h('div.notification-modal__message-wrapper', {}, [
h('div.notification-modal__message', {}, [ h('div.notification-modal__message', {}, [
this.props.t(message), this.context.t(message),
]), ]),
]), ]),
@ -73,4 +73,9 @@ const mapDispatchToProps = dispatch => {
} }
} }
NotificationModal.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(null, mapDispatchToProps)(NotificationModal) module.exports = connect(null, mapDispatchToProps)(NotificationModal)

View File

@ -1,7 +1,7 @@
const { Component } = require('react') const { Component } = require('react')
const PropTypes = require('prop-types') const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../../actions') const actions = require('../../../actions')
const NotifcationModal = require('../notification-modal') const NotifcationModal = require('../notification-modal')

View File

@ -1,7 +1,7 @@
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const QrView = require('../qr-code') const QrView = require('../qr-code')
const AccountModalContainer = require('./account-modal-container') const AccountModalContainer = require('./account-modal-container')

View File

@ -1,7 +1,7 @@
const { Component } = require('react') const { Component } = require('react')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const PropTypes = require('prop-types') const PropTypes = require('prop-types')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const NetworkDropdownIcon = require('./dropdowns/components/network-dropdown-icon') const NetworkDropdownIcon = require('./dropdowns/components/network-dropdown-icon')
const networkToColorHash = { const networkToColorHash = {
@ -30,7 +30,7 @@ class NetworkDisplay extends Component {
const { provider: { type } } = this.props const { provider: { type } } = this.props
return h('.network-display__container', [ return h('.network-display__container', [
this.renderNetworkIcon(), this.renderNetworkIcon(),
h('.network-name', this.props.t(type)), h('.network-name', this.context.t(type)),
]) ])
} }
} }
@ -48,4 +48,9 @@ const mapStateToProps = ({ metamask: { network, provider } }) => {
} }
} }
NetworkDisplay.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps)(NetworkDisplay) module.exports = connect(mapStateToProps)(NetworkDisplay)

View File

@ -1,12 +1,18 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const classnames = require('classnames') const classnames = require('classnames')
const inherits = require('util').inherits const inherits = require('util').inherits
const NetworkDropdownIcon = require('./dropdowns/components/network-dropdown-icon') const NetworkDropdownIcon = require('./dropdowns/components/network-dropdown-icon')
Network.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(Network) module.exports = connect()(Network)
inherits(Network, Component) inherits(Network, Component)
function Network () { function Network () {
@ -15,6 +21,7 @@ function Network () {
Network.prototype.render = function () { Network.prototype.render = function () {
const props = this.props const props = this.props
const context = this.context
const networkNumber = props.network const networkNumber = props.network
let providerName let providerName
try { try {
@ -34,7 +41,7 @@ Network.prototype.render = function () {
onClick: (event) => this.props.onClick(event), onClick: (event) => this.props.onClick(event),
}, [ }, [
h('img', { h('img', {
title: props.t('attemptingConnect'), title: context.t('attemptingConnect'),
style: { style: {
width: '27px', width: '27px',
}, },
@ -42,22 +49,22 @@ Network.prototype.render = function () {
}), }),
]) ])
} else if (providerName === 'mainnet') { } else if (providerName === 'mainnet') {
hoverText = props.t('mainnet') hoverText = context.t('mainnet')
iconName = 'ethereum-network' iconName = 'ethereum-network'
} else if (providerName === 'ropsten') { } else if (providerName === 'ropsten') {
hoverText = props.t('ropsten') hoverText = context.t('ropsten')
iconName = 'ropsten-test-network' iconName = 'ropsten-test-network'
} else if (parseInt(networkNumber) === 3) { } else if (parseInt(networkNumber) === 3) {
hoverText = props.t('ropsten') hoverText = context.t('ropsten')
iconName = 'ropsten-test-network' iconName = 'ropsten-test-network'
} else if (providerName === 'kovan') { } else if (providerName === 'kovan') {
hoverText = props.t('kovan') hoverText = context.t('kovan')
iconName = 'kovan-test-network' iconName = 'kovan-test-network'
} else if (providerName === 'rinkeby') { } else if (providerName === 'rinkeby') {
hoverText = props.t('rinkeby') hoverText = context.t('rinkeby')
iconName = 'rinkeby-test-network' iconName = 'rinkeby-test-network'
} else { } else {
hoverText = props.t('unknownNetwork') hoverText = context.t('unknownNetwork')
iconName = 'unknown-private-network' iconName = 'unknown-private-network'
} }
@ -85,7 +92,7 @@ Network.prototype.render = function () {
backgroundColor: '#038789', // $blue-lagoon backgroundColor: '#038789', // $blue-lagoon
nonSelectBackgroundColor: '#15afb2', nonSelectBackgroundColor: '#15afb2',
}), }),
h('.network-name', props.t('mainnet')), h('.network-name', context.t('mainnet')),
h('i.fa.fa-chevron-down.fa-lg.network-caret'), h('i.fa.fa-chevron-down.fa-lg.network-caret'),
]) ])
case 'ropsten-test-network': case 'ropsten-test-network':
@ -94,7 +101,7 @@ Network.prototype.render = function () {
backgroundColor: '#e91550', // $crimson backgroundColor: '#e91550', // $crimson
nonSelectBackgroundColor: '#ec2c50', nonSelectBackgroundColor: '#ec2c50',
}), }),
h('.network-name', props.t('ropsten')), h('.network-name', context.t('ropsten')),
h('i.fa.fa-chevron-down.fa-lg.network-caret'), h('i.fa.fa-chevron-down.fa-lg.network-caret'),
]) ])
case 'kovan-test-network': case 'kovan-test-network':
@ -103,7 +110,7 @@ Network.prototype.render = function () {
backgroundColor: '#690496', // $purple backgroundColor: '#690496', // $purple
nonSelectBackgroundColor: '#b039f3', nonSelectBackgroundColor: '#b039f3',
}), }),
h('.network-name', props.t('kovan')), h('.network-name', context.t('kovan')),
h('i.fa.fa-chevron-down.fa-lg.network-caret'), h('i.fa.fa-chevron-down.fa-lg.network-caret'),
]) ])
case 'rinkeby-test-network': case 'rinkeby-test-network':
@ -112,7 +119,7 @@ Network.prototype.render = function () {
backgroundColor: '#ebb33f', // $tulip-tree backgroundColor: '#ebb33f', // $tulip-tree
nonSelectBackgroundColor: '#ecb23e', nonSelectBackgroundColor: '#ecb23e',
}), }),
h('.network-name', props.t('rinkeby')), h('.network-name', context.t('rinkeby')),
h('i.fa.fa-chevron-down.fa-lg.network-caret'), h('i.fa.fa-chevron-down.fa-lg.network-caret'),
]) ])
default: default:
@ -124,7 +131,7 @@ Network.prototype.render = function () {
}, },
}), }),
h('.network-name', props.t('privateNetwork')), h('.network-name', context.t('privateNetwork')),
h('i.fa.fa-chevron-down.fa-lg.network-caret'), h('i.fa.fa-chevron-down.fa-lg.network-caret'),
]) ])
} }

View File

@ -1,13 +1,19 @@
const inherits = require('util').inherits const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const ReactMarkdown = require('react-markdown') const ReactMarkdown = require('react-markdown')
const linker = require('extension-link-enabler') const linker = require('extension-link-enabler')
const findDOMNode = require('react-dom').findDOMNode const findDOMNode = require('react-dom').findDOMNode
const connect = require('../metamask-connect') const connect = require('react-redux').connect
Notice.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(Notice) module.exports = connect()(Notice)
inherits(Notice, Component) inherits(Notice, Component)
function Notice () { function Notice () {
Component.call(this) Component.call(this)
@ -111,7 +117,7 @@ Notice.prototype.render = function () {
style: { style: {
marginTop: '18px', marginTop: '18px',
}, },
}, this.props.t('accept')), }, this.context.t('accept')),
]) ])
) )
} }

View File

@ -1,12 +1,18 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const AccountPanel = require('./account-panel') const AccountPanel = require('./account-panel')
PendingMsgDetails.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(PendingMsgDetails) module.exports = connect()(PendingMsgDetails)
inherits(PendingMsgDetails, Component) inherits(PendingMsgDetails, Component)
function PendingMsgDetails () { function PendingMsgDetails () {
Component.call(this) Component.call(this)
@ -40,7 +46,7 @@ PendingMsgDetails.prototype.render = function () {
// message data // message data
h('.tx-data.flex-column.flex-justify-center.flex-grow.select-none', [ h('.tx-data.flex-column.flex-justify-center.flex-grow.select-none', [
h('.flex-column.flex-space-between', [ h('.flex-column.flex-space-between', [
h('label.font-small.allcaps', this.props.t('message')), h('label.font-small.allcaps', this.context.t('message')),
h('span.font-small', msgParams.data), h('span.font-small', msgParams.data),
]), ]),
]), ]),

View File

@ -1,11 +1,17 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const PendingTxDetails = require('./pending-msg-details') const PendingTxDetails = require('./pending-msg-details')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
PendingMsg.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(PendingMsg) module.exports = connect()(PendingMsg)
inherits(PendingMsg, Component) inherits(PendingMsg, Component)
function PendingMsg () { function PendingMsg () {
Component.call(this) Component.call(this)
@ -30,14 +36,14 @@ PendingMsg.prototype.render = function () {
fontWeight: 'bold', fontWeight: 'bold',
textAlign: 'center', textAlign: 'center',
}, },
}, this.props.t('signMessage')), }, this.context.t('signMessage')),
h('.error', { h('.error', {
style: { style: {
margin: '10px', margin: '10px',
}, },
}, [ }, [
this.props.t('signNotice'), this.context.t('signNotice'),
h('a', { h('a', {
href: 'https://medium.com/metamask/the-new-secure-way-to-sign-data-in-your-browser-6af9dd2a1527', href: 'https://medium.com/metamask/the-new-secure-way-to-sign-data-in-your-browser-6af9dd2a1527',
style: { color: 'rgb(247, 134, 28)' }, style: { color: 'rgb(247, 134, 28)' },
@ -46,7 +52,7 @@ PendingMsg.prototype.render = function () {
const url = 'https://medium.com/metamask/the-new-secure-way-to-sign-data-in-your-browser-6af9dd2a1527' const url = 'https://medium.com/metamask/the-new-secure-way-to-sign-data-in-your-browser-6af9dd2a1527'
global.platform.openWindow({ url }) global.platform.openWindow({ url })
}, },
}, this.props.t('readMore')), }, this.context.t('readMore')),
]), ]),
// message details // message details
@ -56,10 +62,10 @@ PendingMsg.prototype.render = function () {
h('.flex-row.flex-space-around', [ h('.flex-row.flex-space-around', [
h('button', { h('button', {
onClick: state.cancelMessage, onClick: state.cancelMessage,
}, this.props.t('cancel')), }, this.context.t('cancel')),
h('button', { h('button', {
onClick: state.signMessage, onClick: state.signMessage,
}, this.props.t('sign')), }, this.context.t('sign')),
]), ]),
]) ])

View File

@ -1,5 +1,5 @@
const { Component } = require('react') const { Component } = require('react')
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const PropTypes = require('prop-types') const PropTypes = require('prop-types')
const actions = require('../../actions') const actions = require('../../actions')
@ -32,7 +32,7 @@ class ConfirmDeployContract extends Component {
if (valid && this.verifyGasParams()) { if (valid && this.verifyGasParams()) {
this.props.sendTransaction(txMeta, event) this.props.sendTransaction(txMeta, event)
} else { } else {
this.props.displayWarning(this.props.t('invalidGasParams')) this.props.displayWarning(this.context.t('invalidGasParams'))
this.setState({ submitting: false }) this.setState({ submitting: false })
} }
} }
@ -177,7 +177,7 @@ class ConfirmDeployContract extends Component {
return ( return (
h('section.flex-row.flex-center.confirm-screen-row', [ h('section.flex-row.flex-center.confirm-screen-row', [
h('span.confirm-screen-label.confirm-screen-section-column', [ this.props.t('gasFee') ]), h('span.confirm-screen-label.confirm-screen-section-column', [ this.context.t('gasFee') ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', `${fiatGas} ${currentCurrency.toUpperCase()}`), h('div.confirm-screen-row-info', `${fiatGas} ${currentCurrency.toUpperCase()}`),
@ -216,8 +216,8 @@ class ConfirmDeployContract extends Component {
return ( return (
h('section.flex-row.flex-center.confirm-screen-row.confirm-screen-total-box ', [ h('section.flex-row.flex-center.confirm-screen-row.confirm-screen-total-box ', [
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('span.confirm-screen-label', [ this.props.t('total') + ' ' ]), h('span.confirm-screen-label', [ this.context.t('total') + ' ' ]),
h('div.confirm-screen-total-box__subtitle', [ this.props.t('amountPlusGas') ]), h('div.confirm-screen-total-box__subtitle', [ this.context.t('amountPlusGas') ]),
]), ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
@ -247,11 +247,11 @@ class ConfirmDeployContract extends Component {
h('.page-container__header-row', [ h('.page-container__header-row', [
h('span.page-container__back-button', { h('span.page-container__back-button', {
onClick: () => backToAccountDetail(selectedAddress), onClick: () => backToAccountDetail(selectedAddress),
}, this.props.t('back')), }, this.context.t('back')),
window.METAMASK_UI_TYPE === 'notification' && h(NetworkDisplay), window.METAMASK_UI_TYPE === 'notification' && h(NetworkDisplay),
]), ]),
h('.page-container__title', this.props.t('confirmContract')), h('.page-container__title', this.context.t('confirmContract')),
h('.page-container__subtitle', this.props.t('pleaseReviewTransaction')), h('.page-container__subtitle', this.context.t('pleaseReviewTransaction')),
]), ]),
// Main Send token Card // Main Send token Card
h('.page-container__content', [ h('.page-container__content', [
@ -274,7 +274,7 @@ class ConfirmDeployContract extends Component {
h('div.confirm-screen-rows', [ h('div.confirm-screen-rows', [
h('section.flex-row.flex-center.confirm-screen-row', [ h('section.flex-row.flex-center.confirm-screen-row', [
h('span.confirm-screen-label.confirm-screen-section-column', [ this.props.t('from') ]), h('span.confirm-screen-label.confirm-screen-section-column', [ this.context.t('from') ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', fromName), h('div.confirm-screen-row-info', fromName),
h('div.confirm-screen-row-detail', `...${fromAddress.slice(fromAddress.length - 4)}`), h('div.confirm-screen-row-detail', `...${fromAddress.slice(fromAddress.length - 4)}`),
@ -282,9 +282,9 @@ class ConfirmDeployContract extends Component {
]), ]),
h('section.flex-row.flex-center.confirm-screen-row', [ h('section.flex-row.flex-center.confirm-screen-row', [
h('span.confirm-screen-label.confirm-screen-section-column', [ this.props.t('to') ]), h('span.confirm-screen-label.confirm-screen-section-column', [ this.context.t('to') ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', this.props.t('newContract')), h('div.confirm-screen-row-info', this.context.t('newContract')),
]), ]),
]), ]),
@ -302,12 +302,12 @@ class ConfirmDeployContract extends Component {
// Cancel Button // Cancel Button
h('button.btn-cancel.page-container__footer-button.allcaps', { h('button.btn-cancel.page-container__footer-button.allcaps', {
onClick: event => this.cancel(event, txMeta), onClick: event => this.cancel(event, txMeta),
}, this.props.t('cancel')), }, this.context.t('cancel')),
// Accept Button // Accept Button
h('button.btn-confirm.page-container__footer-button.allcaps', { h('button.btn-confirm.page-container__footer-button.allcaps', {
onClick: event => this.onSubmit(event), onClick: event => this.onSubmit(event),
}, this.props.t('confirm')), }, this.context.t('confirm')),
]), ]),
]), ]),
]) ])
@ -351,4 +351,8 @@ const mapDispatchToProps = dispatch => {
} }
} }
module.exports = connect(mapStateToProps, mapDispatchToProps)(ConfirmDeployContract) ConfirmDeployContract.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(ConfirmDeployContract)

View File

@ -1,5 +1,6 @@
const Component = require('react').Component const Component = require('react').Component
const connect = require('../../metamask-connect') const PropTypes = require('prop-types')
const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const actions = require('../../actions') const actions = require('../../actions')
@ -7,19 +8,29 @@ const clone = require('clone')
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
const BN = ethUtil.BN const BN = ethUtil.BN
const hexToBn = require('../../../../app/scripts/lib/hex-to-bn') const hexToBn = require('../../../../app/scripts/lib/hex-to-bn')
const classnames = require('classnames')
const { const {
conversionUtil, conversionUtil,
addCurrencies, addCurrencies,
multiplyCurrencies, multiplyCurrencies,
} = require('../../conversion-util') } = require('../../conversion-util')
const {
getGasTotal,
isBalanceSufficient,
} = require('../send/send-utils')
const GasFeeDisplay = require('../send/gas-fee-display-v2') const GasFeeDisplay = require('../send/gas-fee-display-v2')
const SenderToRecipient = require('../sender-to-recipient') const SenderToRecipient = require('../sender-to-recipient')
const NetworkDisplay = require('../network-display') const NetworkDisplay = require('../network-display')
const { MIN_GAS_PRICE_HEX } = require('../send/send-constants') const { MIN_GAS_PRICE_HEX } = require('../send/send-constants')
ConfirmSendEther.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(ConfirmSendEther) module.exports = connect(mapStateToProps, mapDispatchToProps)(ConfirmSendEther)
function mapStateToProps (state) { function mapStateToProps (state) {
const { const {
conversionRate, conversionRate,
@ -29,12 +40,14 @@ function mapStateToProps (state) {
} = state.metamask } = state.metamask
const accounts = state.metamask.accounts const accounts = state.metamask.accounts
const selectedAddress = state.metamask.selectedAddress || Object.keys(accounts)[0] const selectedAddress = state.metamask.selectedAddress || Object.keys(accounts)[0]
const { balance } = accounts[selectedAddress]
return { return {
conversionRate, conversionRate,
identities, identities,
selectedAddress, selectedAddress,
currentCurrency, currentCurrency,
send, send,
balance,
} }
} }
@ -85,6 +98,7 @@ function mapDispatchToProps (dispatch) {
})) }))
dispatch(actions.showModal({ name: 'CUSTOMIZE_GAS' })) dispatch(actions.showModal({ name: 'CUSTOMIZE_GAS' }))
}, },
updateSendErrors: error => dispatch(actions.updateSendErrors(error)),
} }
} }
@ -95,6 +109,18 @@ function ConfirmSendEther () {
this.onSubmit = this.onSubmit.bind(this) this.onSubmit = this.onSubmit.bind(this)
} }
ConfirmSendEther.prototype.componentWillMount = function () {
const { updateSendErrors } = this.props
const txMeta = this.gatherTxMeta()
const balanceIsSufficient = this.isBalanceSufficient(txMeta)
updateSendErrors({
insufficientFunds: balanceIsSufficient
? false
: this.context.t('insufficientFunds'),
})
}
ConfirmSendEther.prototype.getAmount = function () { ConfirmSendEther.prototype.getAmount = function () {
const { conversionRate, currentCurrency } = this.props const { conversionRate, currentCurrency } = this.props
const txMeta = this.gatherTxMeta() const txMeta = this.gatherTxMeta()
@ -196,7 +222,7 @@ ConfirmSendEther.prototype.getData = function () {
}, },
to: { to: {
address: txParams.to, address: txParams.to,
name: identities[txParams.to] ? identities[txParams.to].name : this.props.t('newRecipient'), name: identities[txParams.to] ? identities[txParams.to].name : this.context.t('newRecipient'),
}, },
memo: txParams.memo || '', memo: txParams.memo || '',
gasFeeInFIAT, gasFeeInFIAT,
@ -217,7 +243,12 @@ ConfirmSendEther.prototype.render = function () {
conversionRate, conversionRate,
currentCurrency: convertedCurrency, currentCurrency: convertedCurrency,
showCustomizeGasModal, showCustomizeGasModal,
send: { gasTotal, gasLimit: sendGasLimit, gasPrice: sendGasPrice }, send: {
gasTotal,
gasLimit: sendGasLimit,
gasPrice: sendGasPrice,
errors,
},
} = this.props } = this.props
const txMeta = this.gatherTxMeta() const txMeta = this.gatherTxMeta()
const txParams = txMeta.txParams || {} const txParams = txMeta.txParams || {}
@ -297,7 +328,7 @@ ConfirmSendEther.prototype.render = function () {
h('div.confirm-screen-rows', [ h('div.confirm-screen-rows', [
h('section.flex-row.flex-center.confirm-screen-row', [ h('section.flex-row.flex-center.confirm-screen-row', [
h('span.confirm-screen-label.confirm-screen-section-column', [ this.props.t('from') ]), h('span.confirm-screen-label.confirm-screen-section-column', [ this.context.t('from') ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', fromName), h('div.confirm-screen-row-info', fromName),
h('div.confirm-screen-row-detail', `...${fromAddress.slice(fromAddress.length - 4)}`), h('div.confirm-screen-row-detail', `...${fromAddress.slice(fromAddress.length - 4)}`),
@ -305,7 +336,7 @@ ConfirmSendEther.prototype.render = function () {
]), ]),
h('section.flex-row.flex-center.confirm-screen-row', [ h('section.flex-row.flex-center.confirm-screen-row', [
h('span.confirm-screen-label.confirm-screen-section-column', [ this.props.t('to') ]), h('span.confirm-screen-label.confirm-screen-section-column', [ this.context.t('to') ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', toName), h('div.confirm-screen-row-info', toName),
h('div.confirm-screen-row-detail', `...${toAddress.slice(toAddress.length - 4)}`), h('div.confirm-screen-row-detail', `...${toAddress.slice(toAddress.length - 4)}`),
@ -313,7 +344,7 @@ ConfirmSendEther.prototype.render = function () {
]), ]),
h('section.flex-row.flex-center.confirm-screen-row', [ h('section.flex-row.flex-center.confirm-screen-row', [
h('span.confirm-screen-label.confirm-screen-section-column', [ this.props.t('gasFee') ]), h('span.confirm-screen-label.confirm-screen-section-column', [ this.context.t('gasFee') ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h(GasFeeDisplay, { h(GasFeeDisplay, {
gasTotal: gasTotal || gasFeeInHex, gasTotal: gasTotal || gasFeeInHex,
@ -325,15 +356,22 @@ ConfirmSendEther.prototype.render = function () {
]), ]),
h('section.flex-row.flex-center.confirm-screen-row.confirm-screen-total-box ', [ h('section.flex-row.flex-center.confirm-screen-row.confirm-screen-total-box ', [
h('div.confirm-screen-section-column', [ h('div', {
h('span.confirm-screen-label', [ this.props.t('total') + ' ' ]), className: classnames({
h('div.confirm-screen-total-box__subtitle', [ this.props.t('amountPlusGas') ]), 'confirm-screen-section-column--with-error': errors['insufficientFunds'],
'confirm-screen-section-column': !errors['insufficientFunds'],
}),
}, [
h('span.confirm-screen-label', [ this.context.t('total') + ' ' ]),
h('div.confirm-screen-total-box__subtitle', [ this.context.t('amountPlusGas') ]),
]), ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', `${totalInFIAT} ${currentCurrency.toUpperCase()}`), h('div.confirm-screen-row-info', `${totalInFIAT} ${currentCurrency.toUpperCase()}`),
h('div.confirm-screen-row-detail', `${totalInETH} ETH`), h('div.confirm-screen-row-detail', `${totalInETH} ETH`),
]), ]),
this.renderErrorMessage('insufficientFunds'),
]), ]),
]), ]),
@ -428,26 +466,38 @@ ConfirmSendEther.prototype.render = function () {
clearSend() clearSend()
this.cancel(event, txMeta) this.cancel(event, txMeta)
}, },
}, this.props.t('cancel')), }, this.context.t('cancel')),
// Accept Button // Accept Button
h('button.btn-confirm.page-container__footer-button.allcaps', [this.props.t('confirm')]), h('button.btn-confirm.page-container__footer-button.allcaps', [this.context.t('confirm')]),
]), ]),
]), ]),
]) ])
) )
} }
ConfirmSendEther.prototype.renderErrorMessage = function (message) {
const { send: { errors } } = this.props
return errors[message]
? h('div.confirm-screen-error', [ errors[message] ])
: null
}
ConfirmSendEther.prototype.onSubmit = function (event) { ConfirmSendEther.prototype.onSubmit = function (event) {
event.preventDefault() event.preventDefault()
const { updateSendErrors } = this.props
const txMeta = this.gatherTxMeta() const txMeta = this.gatherTxMeta()
const valid = this.checkValidity() const valid = this.checkValidity()
const balanceIsSufficient = this.isBalanceSufficient(txMeta)
this.setState({ valid, submitting: true }) this.setState({ valid, submitting: true })
if (valid && this.verifyGasParams()) { if (valid && this.verifyGasParams() && balanceIsSufficient) {
this.props.sendTransaction(txMeta, event) this.props.sendTransaction(txMeta, event)
} else if (!balanceIsSufficient) {
updateSendErrors({ insufficientFunds: this.context.t('insufficientFunds') })
} else { } else {
this.props.dispatch(actions.displayWarning(this.props.t('invalidGasParams'))) updateSendErrors({ invalidGasParams: this.context.t('invalidGasParams') })
this.setState({ submitting: false }) this.setState({ submitting: false })
} }
} }
@ -459,6 +509,28 @@ ConfirmSendEther.prototype.cancel = function (event, txMeta) {
cancelTransaction(txMeta) cancelTransaction(txMeta)
} }
ConfirmSendEther.prototype.isBalanceSufficient = function (txMeta) {
const {
balance,
conversionRate,
} = this.props
const {
txParams: {
gas,
gasPrice,
value: amount,
},
} = txMeta
const gasTotal = getGasTotal(gas, gasPrice)
return isBalanceSufficient({
amount,
gasTotal,
balance,
conversionRate,
})
}
ConfirmSendEther.prototype.checkValidity = function () { ConfirmSendEther.prototype.checkValidity = function () {
const form = this.getFormEl() const form = this.getFormEl()
const valid = form.checkValidity() const valid = form.checkValidity()

View File

@ -1,5 +1,6 @@
const Component = require('react').Component const Component = require('react').Component
const connect = require('../../metamask-connect') const PropTypes = require('prop-types')
const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const tokenAbi = require('human-standard-token-abi') const tokenAbi = require('human-standard-token-abi')
@ -16,9 +17,14 @@ const {
multiplyCurrencies, multiplyCurrencies,
addCurrencies, addCurrencies,
} = require('../../conversion-util') } = require('../../conversion-util')
const {
getGasTotal,
isBalanceSufficient,
} = require('../send/send-utils')
const { const {
calcTokenAmount, calcTokenAmount,
} = require('../../token-util') } = require('../../token-util')
const classnames = require('classnames')
const { MIN_GAS_PRICE_HEX } = require('../send/send-constants') const { MIN_GAS_PRICE_HEX } = require('../send/send-constants')
@ -28,8 +34,13 @@ const {
getSelectedTokenContract, getSelectedTokenContract,
} = require('../../selectors') } = require('../../selectors')
ConfirmSendToken.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(ConfirmSendToken) module.exports = connect(mapStateToProps, mapDispatchToProps)(ConfirmSendToken)
function mapStateToProps (state, ownProps) { function mapStateToProps (state, ownProps) {
const { token: { symbol }, txData } = ownProps const { token: { symbol }, txData } = ownProps
const { txParams } = txData || {} const { txParams } = txData || {}
@ -40,9 +51,10 @@ function mapStateToProps (state, ownProps) {
identities, identities,
currentCurrency, currentCurrency,
} = state.metamask } = state.metamask
const accounts = state.metamask.accounts
const selectedAddress = getSelectedAddress(state) const selectedAddress = getSelectedAddress(state)
const tokenExchangeRate = getTokenExchangeRate(state, symbol) const tokenExchangeRate = getTokenExchangeRate(state, symbol)
const { balance } = accounts[selectedAddress]
return { return {
conversionRate, conversionRate,
identities, identities,
@ -52,6 +64,7 @@ function mapStateToProps (state, ownProps) {
currentCurrency: currentCurrency.toUpperCase(), currentCurrency: currentCurrency.toUpperCase(),
send: state.metamask.send, send: state.metamask.send,
tokenContract: getSelectedTokenContract(state), tokenContract: getSelectedTokenContract(state),
balance,
} }
} }
@ -123,6 +136,7 @@ function mapDispatchToProps (dispatch, ownProps) {
})) }))
dispatch(actions.showModal({ name: 'CUSTOMIZE_GAS' })) dispatch(actions.showModal({ name: 'CUSTOMIZE_GAS' }))
}, },
updateSendErrors: error => dispatch(actions.updateSendErrors(error)),
} }
} }
@ -134,12 +148,20 @@ function ConfirmSendToken () {
} }
ConfirmSendToken.prototype.componentWillMount = function () { ConfirmSendToken.prototype.componentWillMount = function () {
const { tokenContract, selectedAddress } = this.props const { tokenContract, selectedAddress, updateSendErrors} = this.props
const txMeta = this.gatherTxMeta()
const balanceIsSufficient = this.isBalanceSufficient(txMeta)
tokenContract && tokenContract tokenContract && tokenContract
.balanceOf(selectedAddress) .balanceOf(selectedAddress)
.then(usersToken => { .then(usersToken => {
}) })
this.props.updateTokenExchangeRate() this.props.updateTokenExchangeRate()
updateSendErrors({
insufficientFunds: balanceIsSufficient
? false
: this.context.t('insufficientFunds'),
})
} }
ConfirmSendToken.prototype.getAmount = function () { ConfirmSendToken.prototype.getAmount = function () {
@ -168,7 +190,7 @@ ConfirmSendToken.prototype.getAmount = function () {
? +(sendTokenAmount * tokenExchangeRate * conversionRate).toFixed(2) ? +(sendTokenAmount * tokenExchangeRate * conversionRate).toFixed(2)
: null, : null,
token: typeof value === 'undefined' token: typeof value === 'undefined'
? this.props.t('unknown') ? this.context.t('unknown')
: +sendTokenAmount.toFixed(decimals), : +sendTokenAmount.toFixed(decimals),
} }
@ -240,7 +262,7 @@ ConfirmSendToken.prototype.getData = function () {
}, },
to: { to: {
address: value, address: value,
name: identities[value] ? identities[value].name : this.props.t('newRecipient'), name: identities[value] ? identities[value].name : this.context.t('newRecipient'),
}, },
memo: txParams.memo || '', memo: txParams.memo || '',
} }
@ -286,7 +308,7 @@ ConfirmSendToken.prototype.renderGasFee = function () {
return ( return (
h('section.flex-row.flex-center.confirm-screen-row', [ h('section.flex-row.flex-center.confirm-screen-row', [
h('span.confirm-screen-label.confirm-screen-section-column', [ this.props.t('gasFee') ]), h('span.confirm-screen-label.confirm-screen-section-column', [ this.context.t('gasFee') ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h(GasFeeDisplay, { h(GasFeeDisplay, {
gasTotal: gasTotal || gasFeeInHex, gasTotal: gasTotal || gasFeeInHex,
@ -300,7 +322,7 @@ ConfirmSendToken.prototype.renderGasFee = function () {
} }
ConfirmSendToken.prototype.renderTotalPlusGas = function () { ConfirmSendToken.prototype.renderTotalPlusGas = function () {
const { token: { symbol }, currentCurrency } = this.props const { token: { symbol }, currentCurrency, send: { errors } } = this.props
const { fiat: fiatAmount, token: tokenAmount } = this.getAmount() const { fiat: fiatAmount, token: tokenAmount } = this.getAmount()
const { fiat: fiatGas, token: tokenGas } = this.getGasFee() const { fiat: fiatGas, token: tokenGas } = this.getGasFee()
@ -308,8 +330,8 @@ ConfirmSendToken.prototype.renderTotalPlusGas = function () {
? ( ? (
h('section.flex-row.flex-center.confirm-screen-row.confirm-screen-total-box ', [ h('section.flex-row.flex-center.confirm-screen-row.confirm-screen-total-box ', [
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('span.confirm-screen-label', [ this.props.t('total') + ' ' ]), h('span.confirm-screen-label', [ this.context.t('total') + ' ' ]),
h('div.confirm-screen-total-box__subtitle', [ this.props.t('amountPlusGas') ]), h('div.confirm-screen-total-box__subtitle', [ this.context.t('amountPlusGas') ]),
]), ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
@ -320,19 +342,34 @@ ConfirmSendToken.prototype.renderTotalPlusGas = function () {
) )
: ( : (
h('section.flex-row.flex-center.confirm-screen-row.confirm-screen-total-box ', [ h('section.flex-row.flex-center.confirm-screen-row.confirm-screen-total-box ', [
h('div.confirm-screen-section-column', [ h('div', {
h('span.confirm-screen-label', [ this.props.t('total') + ' ' ]), className: classnames({
h('div.confirm-screen-total-box__subtitle', [ this.props.t('amountPlusGas') ]), 'confirm-screen-section-column--with-error': errors['insufficientFunds'],
'confirm-screen-section-column': !errors['insufficientFunds'],
}),
}, [
h('span.confirm-screen-label', [ this.context.t('total') + ' ' ]),
h('div.confirm-screen-total-box__subtitle', [ this.context.t('amountPlusGas') ]),
]), ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', `${tokenAmount} ${symbol}`), h('div.confirm-screen-row-info', `${tokenAmount} ${symbol}`),
h('div.confirm-screen-row-detail', `+ ${fiatGas} ${currentCurrency} ${this.props.t('gas')}`), h('div.confirm-screen-row-detail', `+ ${fiatGas} ${currentCurrency} ${this.context.t('gas')}`),
]), ]),
this.renderErrorMessage('insufficientFunds'),
]) ])
) )
} }
ConfirmSendToken.prototype.renderErrorMessage = function (message) {
const { send: { errors } } = this.props
return errors[message]
? h('div.confirm-screen-error', [ errors[message] ])
: null
}
ConfirmSendToken.prototype.render = function () { ConfirmSendToken.prototype.render = function () {
const { editTransaction } = this.props const { editTransaction } = this.props
const txMeta = this.gatherTxMeta() const txMeta = this.gatherTxMeta()
@ -350,10 +387,10 @@ ConfirmSendToken.prototype.render = function () {
this.inputs = [] this.inputs = []
const isTxReprice = Boolean(txMeta.lastGasPrice) const isTxReprice = Boolean(txMeta.lastGasPrice)
const title = isTxReprice ? this.props.t('reprice_title') : this.props.t('confirm') const title = isTxReprice ? this.context.t('reprice_title') : this.context.t('confirm')
const subtitle = isTxReprice const subtitle = isTxReprice
? this.props.t('reprice_subtitle') ? this.context.t('reprice_subtitle')
: this.props.t('pleaseReviewTransaction') : this.context.t('pleaseReviewTransaction')
return ( return (
h('div.confirm-screen-container.confirm-send-token', [ h('div.confirm-screen-container.confirm-send-token', [
@ -362,7 +399,7 @@ ConfirmSendToken.prototype.render = function () {
h('div.page-container__header', [ h('div.page-container__header', [
!txMeta.lastGasPrice && h('button.confirm-screen-back-button', { !txMeta.lastGasPrice && h('button.confirm-screen-back-button', {
onClick: () => editTransaction(txMeta), onClick: () => editTransaction(txMeta),
}, this.props.t('edit')), }, this.context.t('edit')),
h('div.page-container__title', title), h('div.page-container__title', title),
h('div.page-container__subtitle', subtitle), h('div.page-container__subtitle', subtitle),
]), ]),
@ -406,7 +443,7 @@ ConfirmSendToken.prototype.render = function () {
h('div.confirm-screen-rows', [ h('div.confirm-screen-rows', [
h('section.flex-row.flex-center.confirm-screen-row', [ h('section.flex-row.flex-center.confirm-screen-row', [
h('span.confirm-screen-label.confirm-screen-section-column', [ this.props.t('from') ]), h('span.confirm-screen-label.confirm-screen-section-column', [ this.context.t('from') ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', fromName), h('div.confirm-screen-row-info', fromName),
h('div.confirm-screen-row-detail', `...${fromAddress.slice(fromAddress.length - 4)}`), h('div.confirm-screen-row-detail', `...${fromAddress.slice(fromAddress.length - 4)}`),
@ -414,7 +451,7 @@ ConfirmSendToken.prototype.render = function () {
]), ]),
toAddress && h('section.flex-row.flex-center.confirm-screen-row', [ toAddress && h('section.flex-row.flex-center.confirm-screen-row', [
h('span.confirm-screen-label.confirm-screen-section-column', [ this.props.t('to') ]), h('span.confirm-screen-label.confirm-screen-section-column', [ this.context.t('to') ]),
h('div.confirm-screen-section-column', [ h('div.confirm-screen-section-column', [
h('div.confirm-screen-row-info', toName), h('div.confirm-screen-row-info', toName),
h('div.confirm-screen-row-detail', `...${toAddress.slice(toAddress.length - 4)}`), h('div.confirm-screen-row-detail', `...${toAddress.slice(toAddress.length - 4)}`),
@ -436,10 +473,10 @@ ConfirmSendToken.prototype.render = function () {
// Cancel Button // Cancel Button
h('button.btn-cancel.page-container__footer-button.allcaps', { h('button.btn-cancel.page-container__footer-button.allcaps', {
onClick: (event) => this.cancel(event, txMeta), onClick: (event) => this.cancel(event, txMeta),
}, this.props.t('cancel')), }, this.context.t('cancel')),
// Accept Button // Accept Button
h('button.btn-confirm.page-container__footer-button.allcaps', [this.props.t('confirm')]), h('button.btn-confirm.page-container__footer-button.allcaps', [this.context.t('confirm')]),
]), ]),
]), ]),
]), ]),
@ -449,18 +486,44 @@ ConfirmSendToken.prototype.render = function () {
ConfirmSendToken.prototype.onSubmit = function (event) { ConfirmSendToken.prototype.onSubmit = function (event) {
event.preventDefault() event.preventDefault()
const { updateSendErrors } = this.props
const txMeta = this.gatherTxMeta() const txMeta = this.gatherTxMeta()
const valid = this.checkValidity() const valid = this.checkValidity()
const balanceIsSufficient = this.isBalanceSufficient(txMeta)
this.setState({ valid, submitting: true }) this.setState({ valid, submitting: true })
if (valid && this.verifyGasParams()) { if (valid && this.verifyGasParams() && balanceIsSufficient) {
this.props.sendTransaction(txMeta, event) this.props.sendTransaction(txMeta, event)
} else if (!balanceIsSufficient) {
updateSendErrors({ insufficientFunds: this.context.t('insufficientFunds') })
} else { } else {
this.props.dispatch(actions.displayWarning(this.props.t('invalidGasParams'))) updateSendErrors({ invalidGasParams: this.context.t('invalidGasParams') })
this.setState({ submitting: false }) this.setState({ submitting: false })
} }
} }
ConfirmSendToken.prototype.isBalanceSufficient = function (txMeta) {
const {
balance,
conversionRate,
} = this.props
const {
txParams: {
gas,
gasPrice,
},
} = txMeta
const gasTotal = getGasTotal(gas, gasPrice)
return isBalanceSufficient({
amount: '0',
gasTotal,
balance,
conversionRate,
})
}
ConfirmSendToken.prototype.cancel = function (event, txMeta) { ConfirmSendToken.prototype.cancel = function (event, txMeta) {
event.preventDefault() event.preventDefault()
const { cancelTransaction } = this.props const { cancelTransaction } = this.props

View File

@ -1,5 +1,5 @@
const Component = require('react').Component const Component = require('react').Component
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const clone = require('clone') const clone = require('clone')
const abi = require('human-standard-token-abi') const abi = require('human-standard-token-abi')

View File

@ -2,7 +2,7 @@ const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const qrCode = require('qrcode-npm').qrcode const qrCode = require('qrcode-npm').qrcode
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const isHexPrefixed = require('ethereumjs-util').isHexPrefixed const isHexPrefixed = require('ethereumjs-util').isHexPrefixed
const ReadOnlyInput = require('./readonly-input') const ReadOnlyInput = require('./readonly-input')

View File

@ -1,7 +1,7 @@
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const Identicon = require('../identicon') const Identicon = require('../identicon')
const CurrencyDisplay = require('./currency-display') const CurrencyDisplay = require('./currency-display')
const { conversionRateSelector, getCurrentCurrency } = require('../../selectors') const { conversionRateSelector, getCurrentCurrency } = require('../../selectors')

View File

@ -1,11 +1,17 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const CurrencyDisplay = require('./currency-display') const CurrencyDisplay = require('./currency-display')
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
GasFeeDisplay.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(GasFeeDisplay) module.exports = connect()(GasFeeDisplay)
inherits(GasFeeDisplay, Component) inherits(GasFeeDisplay, Component)
function GasFeeDisplay () { function GasFeeDisplay () {
Component.call(this) Component.call(this)
@ -33,8 +39,8 @@ GasFeeDisplay.prototype.render = function () {
readOnly: true, readOnly: true,
}) })
: gasLoadingError : gasLoadingError
? h('div.currency-display.currency-display--message', this.props.t('setGasPrice')) ? h('div.currency-display.currency-display--message', this.context.t('setGasPrice'))
: h('div.currency-display', this.props.t('loading')), : h('div.currency-display', this.context.t('loading')),
h('button.sliders-icon-container', { h('button.sliders-icon-container', {
onClick, onClick,

View File

@ -1,11 +1,17 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const InputNumber = require('../input-number.js') const InputNumber = require('../input-number.js')
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
GasTooltip.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(GasTooltip) module.exports = connect()(GasTooltip)
inherits(GasTooltip, Component) inherits(GasTooltip, Component)
function GasTooltip () { function GasTooltip () {
Component.call(this) Component.call(this)
@ -82,7 +88,7 @@ GasTooltip.prototype.render = function () {
'marginTop': '81px', 'marginTop': '81px',
}, },
}, [ }, [
h('span.gas-tooltip-label', {}, [this.props.t('gasLimit')]), h('span.gas-tooltip-label', {}, [this.context.t('gasLimit')]),
h('i.fa.fa-info-circle'), h('i.fa.fa-info-circle'),
]), ]),
h(InputNumber, { h(InputNumber, {

View File

@ -2,6 +2,7 @@ const {
addCurrencies, addCurrencies,
conversionUtil, conversionUtil,
conversionGTE, conversionGTE,
multiplyCurrencies,
} = require('../../conversion-util') } = require('../../conversion-util')
const { const {
calcTokenAmount, calcTokenAmount,
@ -31,7 +32,7 @@ function isBalanceSufficient ({
{ {
value: totalAmount, value: totalAmount,
fromNumericBase: 'hex', fromNumericBase: 'hex',
conversionRate: amountConversionRate, conversionRate: amountConversionRate || conversionRate,
fromCurrency: primaryCurrency, fromCurrency: primaryCurrency,
}, },
) )
@ -62,7 +63,16 @@ function isTokenBalanceSufficient ({
return tokenBalanceIsSufficient return tokenBalanceIsSufficient
} }
function getGasTotal (gasLimit, gasPrice) {
return multiplyCurrencies(gasLimit, gasPrice, {
toNumericBase: 'hex',
multiplicandBase: 16,
multiplierBase: 16,
})
}
module.exports = { module.exports = {
getGasTotal,
isBalanceSufficient, isBalanceSufficient,
isTokenBalanceSufficient, isTokenBalanceSufficient,
} }

View File

@ -1,4 +1,4 @@
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
const actions = require('../../actions') const actions = require('../../actions')
const abi = require('ethereumjs-abi') const abi = require('ethereumjs-abi')
const SendEther = require('../../send-v2') const SendEther = require('../../send-v2')

View File

@ -1,11 +1,17 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const AccountListItem = require('./account-list-item') const AccountListItem = require('./account-list-item')
const connect = require('../../metamask-connect') const connect = require('react-redux').connect
ToAutoComplete.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(ToAutoComplete) module.exports = connect()(ToAutoComplete)
inherits(ToAutoComplete, Component) inherits(ToAutoComplete, Component)
function ToAutoComplete () { function ToAutoComplete () {
Component.call(this) Component.call(this)
@ -93,7 +99,7 @@ ToAutoComplete.prototype.render = function () {
return h('div.send-v2__to-autocomplete', {}, [ return h('div.send-v2__to-autocomplete', {}, [
h('input.send-v2__to-autocomplete__input', { h('input.send-v2__to-autocomplete__input', {
placeholder: this.props.t('recipientAddress'), placeholder: this.context.t('recipientAddress'),
className: inError ? `send-v2__error-border` : '', className: inError ? `send-v2__error-border` : '',
value: to, value: to,
onChange: event => onChange(event.target.value), onChange: event => onChange(event.target.value),

View File

@ -1,6 +1,6 @@
const { Component } = require('react') const { Component } = require('react')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const PropTypes = require('prop-types') const PropTypes = require('prop-types')
const Identicon = require('./identicon') const Identicon = require('./identicon')
@ -21,7 +21,7 @@ class SenderToRecipient extends Component {
this.renderRecipientIcon(), this.renderRecipientIcon(),
h( h(
'.sender-to-recipient__name.sender-to-recipient__recipient-name', '.sender-to-recipient__name.sender-to-recipient__recipient-name',
recipientName || this.props.t('newContract') recipientName || this.context.t('newContract')
), ),
]) ])
) )
@ -46,7 +46,7 @@ class SenderToRecipient extends Component {
h('img', { h('img', {
height: 15, height: 15,
width: 15, width: 15,
src: '/images/arrow-right.svg', src: './images/arrow-right.svg',
}), }),
]), ]),
]), ]),
@ -64,4 +64,9 @@ SenderToRecipient.propTypes = {
t: PropTypes.func, t: PropTypes.func,
} }
SenderToRecipient.contextTypes = {
t: PropTypes.func,
}
module.exports = connect()(SenderToRecipient) module.exports = connect()(SenderToRecipient)

View File

@ -1,7 +1,8 @@
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const PropTypes = require('prop-types')
const Component = require('react').Component const Component = require('react').Component
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const classnames = require('classnames') const classnames = require('classnames')
const { qrcode } = require('qrcode-npm') const { qrcode } = require('qrcode-npm')
const { shapeShiftSubview, pairUpdate, buyWithShapeShift } = require('../actions') const { shapeShiftSubview, pairUpdate, buyWithShapeShift } = require('../actions')
@ -32,8 +33,13 @@ function mapDispatchToProps (dispatch) {
} }
} }
ShapeshiftForm.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(ShapeshiftForm) module.exports = connect(mapStateToProps, mapDispatchToProps)(ShapeshiftForm)
inherits(ShapeshiftForm, Component) inherits(ShapeshiftForm, Component)
function ShapeshiftForm () { function ShapeshiftForm () {
Component.call(this) Component.call(this)
@ -93,7 +99,7 @@ ShapeshiftForm.prototype.onBuyWithShapeShift = function () {
})) }))
.catch(() => this.setState({ .catch(() => this.setState({
showQrCode: false, showQrCode: false,
errorMessage: this.props.t('invalidRequest'), errorMessage: this.context.t('invalidRequest'),
isLoading: false, isLoading: false,
})) }))
} }
@ -125,10 +131,10 @@ ShapeshiftForm.prototype.renderMarketInfo = function () {
return h('div.shapeshift-form__metadata', {}, [ return h('div.shapeshift-form__metadata', {}, [
this.renderMetadata(this.props.t('status'), limit ? this.props.t('available') : this.props.t('unavailable')), this.renderMetadata(this.context.t('status'), limit ? this.context.t('available') : this.context.t('unavailable')),
this.renderMetadata(this.props.t('limit'), limit), this.renderMetadata(this.context.t('limit'), limit),
this.renderMetadata(this.props.t('exchangeRate'), rate), this.renderMetadata(this.context.t('exchangeRate'), rate),
this.renderMetadata(this.props.t('min'), minimum), this.renderMetadata(this.context.t('min'), minimum),
]) ])
} }
@ -142,7 +148,7 @@ ShapeshiftForm.prototype.renderQrCode = function () {
return h('div.shapeshift-form', {}, [ return h('div.shapeshift-form', {}, [
h('div.shapeshift-form__deposit-instruction', [ h('div.shapeshift-form__deposit-instruction', [
this.props.t('depositCoin', [depositCoin.toUpperCase()]), this.context.t('depositCoin', [depositCoin.toUpperCase()]),
]), ]),
h('div', depositAddress), h('div', depositAddress),
@ -179,7 +185,7 @@ ShapeshiftForm.prototype.render = function () {
h('div.shapeshift-form__selector', [ h('div.shapeshift-form__selector', [
h('div.shapeshift-form__selector-label', this.props.t('deposit')), h('div.shapeshift-form__selector-label', this.context.t('deposit')),
h(SimpleDropdown, { h(SimpleDropdown, {
selectedOption: this.state.depositCoin, selectedOption: this.state.depositCoin,
@ -199,7 +205,7 @@ ShapeshiftForm.prototype.render = function () {
h('div.shapeshift-form__selector', [ h('div.shapeshift-form__selector', [
h('div.shapeshift-form__selector-label', [ h('div.shapeshift-form__selector-label', [
this.props.t('receive'), this.context.t('receive'),
]), ]),
h('div.shapeshift-form__selector-input', ['ETH']), h('div.shapeshift-form__selector-input', ['ETH']),
@ -217,7 +223,7 @@ ShapeshiftForm.prototype.render = function () {
}, [ }, [
h('div.shapeshift-form__address-input-label', [ h('div.shapeshift-form__address-input-label', [
this.props.t('refundAddress'), this.context.t('refundAddress'),
]), ]),
h('input.shapeshift-form__address-input', { h('input.shapeshift-form__address-input', {
@ -239,7 +245,7 @@ ShapeshiftForm.prototype.render = function () {
className: btnClass, className: btnClass,
disabled: !token, disabled: !token,
onClick: () => this.onBuyWithShapeShift(), onClick: () => this.onBuyWithShapeShift(),
}, [this.props.t('buy')]), }, [this.context.t('buy')]),
]) ])
} }

View File

@ -1,7 +1,8 @@
const inherits = require('util').inherits const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const vreme = new (require('vreme'))() const vreme = new (require('vreme'))()
const explorerLink = require('etherscan-link').createExplorerLink const explorerLink = require('etherscan-link').createExplorerLink
const actions = require('../actions') const actions = require('../actions')
@ -12,8 +13,13 @@ const EthBalance = require('./eth-balance')
const Tooltip = require('./tooltip') const Tooltip = require('./tooltip')
ShiftListItem.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps)(ShiftListItem) module.exports = connect(mapStateToProps)(ShiftListItem)
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
selectedAddress: state.metamask.selectedAddress, selectedAddress: state.metamask.selectedAddress,
@ -75,7 +81,7 @@ ShiftListItem.prototype.renderUtilComponents = function () {
value: this.props.depositAddress, value: this.props.depositAddress,
}), }),
h(Tooltip, { h(Tooltip, {
title: this.props.t('qrCode'), title: this.context.t('qrCode'),
}, [ }, [
h('i.fa.fa-qrcode.pointer.pop-hover', { h('i.fa.fa-qrcode.pointer.pop-hover', {
onClick: () => props.dispatch(actions.reshowQrCode(props.depositAddress, props.depositType)), onClick: () => props.dispatch(actions.reshowQrCode(props.depositAddress, props.depositType)),
@ -135,8 +141,8 @@ ShiftListItem.prototype.renderInfo = function () {
color: '#ABA9AA', color: '#ABA9AA',
width: '100%', width: '100%',
}, },
}, this.props.t('toETHviaShapeShift', [props.depositType])), }, this.context.t('toETHviaShapeShift', [props.depositType])),
h('div', this.props.t('noDeposits')), h('div', this.context.t('noDeposits')),
h('div', { h('div', {
style: { style: {
fontSize: 'x-small', fontSize: 'x-small',
@ -158,8 +164,8 @@ ShiftListItem.prototype.renderInfo = function () {
color: '#ABA9AA', color: '#ABA9AA',
width: '100%', width: '100%',
}, },
}, this.props.t('toETHviaShapeShift', [props.depositType])), }, this.context.t('toETHviaShapeShift', [props.depositType])),
h('div', this.props.t('conversionProgress')), h('div', this.context.t('conversionProgress')),
h('div', { h('div', {
style: { style: {
fontSize: 'x-small', fontSize: 'x-small',
@ -184,7 +190,7 @@ ShiftListItem.prototype.renderInfo = function () {
color: '#ABA9AA', color: '#ABA9AA',
width: '100%', width: '100%',
}, },
}, this.props.t('fromShapeShift')), }, this.context.t('fromShapeShift')),
h('div', formatDate(props.time)), h('div', formatDate(props.time)),
h('div', { h('div', {
style: { style: {
@ -196,7 +202,7 @@ ShiftListItem.prototype.renderInfo = function () {
]) ])
case 'failed': case 'failed':
return h('span.error', '(' + this.props.t('failed') + ')') return h('span.error', '(' + this.context.t('failed') + ')')
default: default:
return '' return ''
} }

View File

@ -1,8 +1,9 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const Identicon = require('./identicon') const Identicon = require('./identicon')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
const classnames = require('classnames') const classnames = require('classnames')
@ -37,8 +38,13 @@ function mapDispatchToProps (dispatch) {
} }
} }
SignatureRequest.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(SignatureRequest) module.exports = connect(mapStateToProps, mapDispatchToProps)(SignatureRequest)
inherits(SignatureRequest, Component) inherits(SignatureRequest, Component)
function SignatureRequest (props) { function SignatureRequest (props) {
Component.call(this) Component.call(this)
@ -54,7 +60,7 @@ SignatureRequest.prototype.renderHeader = function () {
h('div.request-signature__header-background'), h('div.request-signature__header-background'),
h('div.request-signature__header__text', this.props.t('sigRequest')), h('div.request-signature__header__text', this.context.t('sigRequest')),
h('div.request-signature__header__tip-container', [ h('div.request-signature__header__tip-container', [
h('div.request-signature__header__tip'), h('div.request-signature__header__tip'),
@ -75,7 +81,7 @@ SignatureRequest.prototype.renderAccountDropdown = function () {
return h('div.request-signature__account', [ return h('div.request-signature__account', [
h('div.request-signature__account-text', [this.props.t('account') + ':']), h('div.request-signature__account-text', [this.context.t('account') + ':']),
h(AccountDropdownMini, { h(AccountDropdownMini, {
selectedAccount, selectedAccount,
@ -102,7 +108,7 @@ SignatureRequest.prototype.renderBalance = function () {
return h('div.request-signature__balance', [ return h('div.request-signature__balance', [
h('div.request-signature__balance-text', [this.props.t('balance')]), h('div.request-signature__balance-text', [this.context.t('balance')]),
h('div.request-signature__balance-value', `${balanceInEther} ETH`), h('div.request-signature__balance-value', `${balanceInEther} ETH`),
@ -136,7 +142,7 @@ SignatureRequest.prototype.renderRequestInfo = function () {
return h('div.request-signature__request-info', [ return h('div.request-signature__request-info', [
h('div.request-signature__headline', [ h('div.request-signature__headline', [
this.props.t('yourSigRequested'), this.context.t('yourSigRequested'),
]), ]),
]) ])
@ -154,18 +160,18 @@ SignatureRequest.prototype.msgHexToText = function (hex) {
SignatureRequest.prototype.renderBody = function () { SignatureRequest.prototype.renderBody = function () {
let rows let rows
let notice = this.props.t('youSign') + ':' let notice = this.context.t('youSign') + ':'
const { txData } = this.props const { txData } = this.props
const { type, msgParams: { data } } = txData const { type, msgParams: { data } } = txData
if (type === 'personal_sign') { if (type === 'personal_sign') {
rows = [{ name: this.props.t('message'), value: this.msgHexToText(data) }] rows = [{ name: this.context.t('message'), value: this.msgHexToText(data) }]
} else if (type === 'eth_signTypedData') { } else if (type === 'eth_signTypedData') {
rows = data rows = data
} else if (type === 'eth_sign') { } else if (type === 'eth_sign') {
rows = [{ name: this.props.t('message'), value: data }] rows = [{ name: this.context.t('message'), value: data }]
notice = this.props.t('signNotice') notice = this.context.t('signNotice')
} }
return h('div.request-signature__body', {}, [ return h('div.request-signature__body', {}, [
@ -224,10 +230,10 @@ SignatureRequest.prototype.renderFooter = function () {
return h('div.request-signature__footer', [ return h('div.request-signature__footer', [
h('button.btn-secondary--lg.request-signature__footer__cancel-button', { h('button.btn-secondary--lg.request-signature__footer__cancel-button', {
onClick: cancel, onClick: cancel,
}, this.props.t('cancel')), }, this.context.t('cancel')),
h('button.btn-primary--lg', { h('button.btn-primary--lg', {
onClick: sign, onClick: sign,
}, this.props.t('sign')), }, this.context.t('sign')),
]) ])
} }

View File

@ -2,7 +2,7 @@ const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const TokenTracker = require('eth-token-tracker') const TokenTracker = require('eth-token-tracker')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const selectors = require('../selectors') const selectors = require('../selectors')
function mapStateToProps (state) { function mapStateToProps (state) {

View File

@ -1,7 +1,7 @@
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const Identicon = require('./identicon') const Identicon = require('./identicon')
const prefixForNetwork = require('../../lib/etherscan-prefix-for-network') const prefixForNetwork = require('../../lib/etherscan-prefix-for-network')
const selectors = require('../selectors') const selectors = require('../selectors')

View File

@ -1,9 +1,10 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const TokenTracker = require('eth-token-tracker') const TokenTracker = require('eth-token-tracker')
const TokenCell = require('./token-cell.js') const TokenCell = require('./token-cell.js')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const selectors = require('../selectors') const selectors = require('../selectors')
function mapStateToProps (state) { function mapStateToProps (state) {
@ -24,8 +25,13 @@ for (const address in contracts) {
} }
} }
TokenList.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps)(TokenList) module.exports = connect(mapStateToProps)(TokenList)
inherits(TokenList, Component) inherits(TokenList, Component)
function TokenList () { function TokenList () {
this.state = { this.state = {
@ -42,7 +48,7 @@ TokenList.prototype.render = function () {
const { tokens, isLoading, error } = state const { tokens, isLoading, error } = state
if (isLoading) { if (isLoading) {
return this.message(this.props.t('loadingTokens')) return this.message(this.context.t('loadingTokens'))
} }
if (error) { if (error) {
@ -52,7 +58,7 @@ TokenList.prototype.render = function () {
padding: '80px', padding: '80px',
}, },
}, [ }, [
this.props.t('troubleTokenBalances'), this.context.t('troubleTokenBalances'),
h('span.hotFix', { h('span.hotFix', {
style: { style: {
color: 'rgba(247, 134, 28, 1)', color: 'rgba(247, 134, 28, 1)',
@ -63,7 +69,7 @@ TokenList.prototype.render = function () {
url: `https://ethplorer.io/address/${userAddress}`, url: `https://ethplorer.io/address/${userAddress}`,
}) })
}, },
}, this.props.t('here')), }, this.context.t('here')),
]) ])
} }

View File

@ -1,6 +1,7 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('../metamask-connect') const connect = require('react-redux').connect
const inherits = require('util').inherits const inherits = require('util').inherits
const classnames = require('classnames') const classnames = require('classnames')
const abi = require('human-standard-token-abi') const abi = require('human-standard-token-abi')
@ -15,8 +16,13 @@ const { calcTokenAmount } = require('../token-util')
const { getCurrentCurrency } = require('../selectors') const { getCurrentCurrency } = require('../selectors')
TxListItem.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(TxListItem) module.exports = connect(mapStateToProps, mapDispatchToProps)(TxListItem)
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
tokens: state.metamask.tokens, tokens: state.metamask.tokens,
@ -62,20 +68,24 @@ TxListItem.prototype.getAddressText = function () {
const { const {
address, address,
txParams = {}, txParams = {},
isMsg,
} = this.props } = this.props
const decodedData = txParams.data && abiDecoder.decodeMethod(txParams.data) const decodedData = txParams.data && abiDecoder.decodeMethod(txParams.data)
const { name: txDataName, params = [] } = decodedData || {} const { name: txDataName, params = [] } = decodedData || {}
const { value } = params[0] || {} const { value } = params[0] || {}
switch (txDataName) { let addressText
case 'transfer': if (txDataName === 'transfer' || address) {
return `${value.slice(0, 10)}...${value.slice(-4)}` const addressToRender = txDataName === 'transfer' ? value : address
default: addressText = `${addressToRender.slice(0, 10)}...${addressToRender.slice(-4)}`
return address } else if (isMsg) {
? `${address.slice(0, 10)}...${address.slice(-4)}` addressText = this.context.t('sigRequest')
: this.props.t('contractDeployment') } else {
addressText = this.context.t('contractDeployment')
} }
return addressText
} }
TxListItem.prototype.getSendEtherTotal = function () { TxListItem.prototype.getSendEtherTotal = function () {
@ -185,6 +195,9 @@ TxListItem.prototype.showRetryButton = function () {
transactionId, transactionId,
txParams, txParams,
} = this.props } = this.props
if (!txParams) {
return false
}
const currentNonce = txParams.nonce const currentNonce = txParams.nonce
const currentNonceTxs = selectedAddressTxList.filter(tx => tx.txParams.nonce === currentNonce) const currentNonceTxs = selectedAddressTxList.filter(tx => tx.txParams.nonce === currentNonce)
const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted') const currentNonceSubmittedTxs = currentNonceTxs.filter(tx => tx.status === 'submitted')
@ -306,21 +319,21 @@ TxListItem.prototype.txStatusIndicator = function () {
let name let name
if (transactionStatus === 'unapproved') { if (transactionStatus === 'unapproved') {
name = this.props.t('unapproved') name = this.context.t('unapproved')
} else if (transactionStatus === 'rejected') { } else if (transactionStatus === 'rejected') {
name = this.props.t('rejected') name = this.context.t('rejected')
} else if (transactionStatus === 'approved') { } else if (transactionStatus === 'approved') {
name = this.props.t('approved') name = this.context.t('approved')
} else if (transactionStatus === 'signed') { } else if (transactionStatus === 'signed') {
name = this.props.t('signed') name = this.context.t('signed')
} else if (transactionStatus === 'submitted') { } else if (transactionStatus === 'submitted') {
name = this.props.t('submitted') name = this.context.t('submitted')
} else if (transactionStatus === 'confirmed') { } else if (transactionStatus === 'confirmed') {
name = this.props.t('confirmed') name = this.context.t('confirmed')
} else if (transactionStatus === 'failed') { } else if (transactionStatus === 'failed') {
name = this.props.t('failed') name = this.context.t('failed')
} else if (transactionStatus === 'dropped') { } else if (transactionStatus === 'dropped') {
name = this.props.t('dropped') name = this.context.t('dropped')
} }
return name return name
} }

View File

@ -1,5 +1,6 @@
const Component = require('react').Component const Component = require('react').Component
const connect = require('../metamask-connect') const PropTypes = require('prop-types')
const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const prefixForNetwork = require('../../lib/etherscan-prefix-for-network') const prefixForNetwork = require('../../lib/etherscan-prefix-for-network')
@ -11,8 +12,13 @@ const { showConfTxPage } = require('../actions')
const classnames = require('classnames') const classnames = require('classnames')
const { tokenInfoGetter } = require('../token-util') const { tokenInfoGetter } = require('../token-util')
TxList.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(TxList) module.exports = connect(mapStateToProps, mapDispatchToProps)(TxList)
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
txsToRender: selectors.transactionsSelector(state), txsToRender: selectors.transactionsSelector(state),
@ -39,7 +45,7 @@ TxList.prototype.render = function () {
return h('div.flex-column', [ return h('div.flex-column', [
h('div.flex-row.tx-list-header-wrapper', [ h('div.flex-row.tx-list-header-wrapper', [
h('div.flex-row.tx-list-header', [ h('div.flex-row.tx-list-header', [
h('div', this.props.t('transactions')), h('div', this.context.t('transactions')),
]), ]),
]), ]),
h('div.flex-column.tx-list-container', {}, [ h('div.flex-column.tx-list-container', {}, [
@ -56,7 +62,7 @@ TxList.prototype.renderTransaction = function () {
: [h( : [h(
'div.tx-list-item.tx-list-item--empty', 'div.tx-list-item.tx-list-item--empty',
{ key: 'tx-list-none' }, { key: 'tx-list-none' },
[ this.props.t('noTransactions') ], [ this.context.t('noTransactions') ],
)] )]
} }
@ -71,9 +77,9 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
const props = { const props = {
dateString: formatDate(transaction.time), dateString: formatDate(transaction.time),
address: transaction.txParams.to, address: transaction.txParams && transaction.txParams.to,
transactionStatus: transaction.status, transactionStatus: transaction.status,
transactionAmount: transaction.txParams.value, transactionAmount: transaction.txParams && transaction.txParams.value,
transactionId: transaction.id, transactionId: transaction.id,
transactionHash: transaction.hash, transactionHash: transaction.hash,
transactionNetworkId: transaction.metamaskNetworkId, transactionNetworkId: transaction.metamaskNetworkId,
@ -95,6 +101,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
const opts = { const opts = {
key: transactionId || transactionHash, key: transactionId || transactionHash,
txParams: transaction.txParams, txParams: transaction.txParams,
isMsg: Boolean(transaction.msgParams),
transactionStatus, transactionStatus,
transactionId, transactionId,
dateString, dateString,
@ -110,7 +117,7 @@ TxList.prototype.renderTransactionListItem = function (transaction, conversionRa
if (isUnapproved) { if (isUnapproved) {
opts.onClick = () => showConfTxPage({ id: transactionId }) opts.onClick = () => showConfTxPage({ id: transactionId })
opts.transactionStatus = this.props.t('notStarted') opts.transactionStatus = this.context.t('notStarted')
} else if (transactionHash) { } else if (transactionHash) {
opts.onClick = () => this.view(transactionHash, transactionNetworkId) opts.onClick = () => this.view(transactionHash, transactionNetworkId)
} }

View File

@ -1,5 +1,6 @@
const Component = require('react').Component const Component = require('react').Component
const connect = require('../metamask-connect') const PropTypes = require('prop-types')
const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const ethUtil = require('ethereumjs-util') const ethUtil = require('ethereumjs-util')
const inherits = require('util').inherits const inherits = require('util').inherits
@ -10,8 +11,13 @@ const BalanceComponent = require('./balance-component')
const TxList = require('./tx-list') const TxList = require('./tx-list')
const Identicon = require('./identicon') const Identicon = require('./identicon')
TxView.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(TxView) module.exports = connect(mapStateToProps, mapDispatchToProps)(TxView)
function mapStateToProps (state) { function mapStateToProps (state) {
const sidebarOpen = state.appState.sidebarOpen const sidebarOpen = state.appState.sidebarOpen
const isMascara = state.appState.isMascara const isMascara = state.appState.isMascara
@ -72,21 +78,21 @@ TxView.prototype.renderButtons = function () {
onClick: () => showModal({ onClick: () => showModal({
name: 'DEPOSIT_ETHER', name: 'DEPOSIT_ETHER',
}), }),
}, this.props.t('deposit')), }, this.context.t('deposit')),
h('button.btn-primary.hero-balance-button', { h('button.btn-primary.hero-balance-button', {
style: { style: {
marginLeft: '0.8em', marginLeft: '0.8em',
}, },
onClick: showSendPage, onClick: showSendPage,
}, this.props.t('send')), }, this.context.t('send')),
]) ])
) )
: ( : (
h('div.flex-row.flex-center.hero-balance-buttons', [ h('div.flex-row.flex-center.hero-balance-buttons', [
h('button.btn-primary.hero-balance-button', { h('button.btn-primary.hero-balance-button', {
onClick: showSendTokenPage, onClick: showSendTokenPage,
}, this.props.t('send')), }, this.context.t('send')),
]) ])
) )
} }

View File

@ -1,5 +1,6 @@
const Component = require('react').Component const Component = require('react').Component
const connect = require('../metamask-connect') const PropTypes = require('prop-types')
const connect = require('react-redux').connect
const h = require('react-hyperscript') const h = require('react-hyperscript')
const inherits = require('util').inherits const inherits = require('util').inherits
const classnames = require('classnames') const classnames = require('classnames')
@ -12,8 +13,13 @@ const BalanceComponent = require('./balance-component')
const TokenList = require('./token-list') const TokenList = require('./token-list')
const selectors = require('../selectors') const selectors = require('../selectors')
WalletView.contextTypes = {
t: PropTypes.func,
}
module.exports = connect(mapStateToProps, mapDispatchToProps)(WalletView) module.exports = connect(mapStateToProps, mapDispatchToProps)(WalletView)
function mapStateToProps (state) { function mapStateToProps (state) {
return { return {
@ -116,7 +122,7 @@ WalletView.prototype.render = function () {
onClick: hideSidebar, onClick: hideSidebar,
}), }),
h('div.wallet-view__keyring-label.allcaps', isLoose ? this.props.t('imported') : ''), h('div.wallet-view__keyring-label.allcaps', isLoose ? this.context.t('imported') : ''),
h('div.flex-column.flex-center.wallet-view__name-container', { h('div.flex-column.flex-center.wallet-view__name-container', {
style: { margin: '0 auto' }, style: { margin: '0 auto' },
@ -133,13 +139,13 @@ WalletView.prototype.render = function () {
selectedIdentity.name, selectedIdentity.name,
]), ]),
h('button.btn-clear.wallet-view__details-button.allcaps', this.props.t('details')), h('button.btn-clear.wallet-view__details-button.allcaps', this.context.t('details')),
]), ]),
]), ]),
h(Tooltip, { h(Tooltip, {
position: 'bottom', position: 'bottom',
title: this.state.hasCopied ? this.props.t('copiedExclamation') : this.props.t('copyToClipboard'), title: this.state.hasCopied ? this.context.t('copiedExclamation') : this.context.t('copyToClipboard'),
wrapperClassName: 'wallet-view__tooltip', wrapperClassName: 'wallet-view__tooltip',
}, [ }, [
h('button.wallet-view__address', { h('button.wallet-view__address', {
@ -172,7 +178,7 @@ WalletView.prototype.render = function () {
showAddTokenPage() showAddTokenPage()
hideSidebar() hideSidebar()
}, },
}, this.props.t('addToken')), }, this.context.t('addToken')),
]) ])
} }

View File

@ -1,7 +1,7 @@
const inherits = require('util').inherits const inherits = require('util').inherits
const Component = require('react').Component const Component = require('react').Component
const h = require('react-hyperscript') const h = require('react-hyperscript')
const connect = require('./metamask-connect') const connect = require('react-redux').connect
const actions = require('./actions') const actions = require('./actions')
const txHelper = require('../lib/tx-helper') const txHelper = require('../lib/tx-helper')

View File

@ -266,6 +266,7 @@ section .confirm-screen-account-number,
.confirm-screen-total-box { .confirm-screen-total-box {
background-color: $wild-sand; background-color: $wild-sand;
position: relative;
.confirm-screen-label { .confirm-screen-label {
line-height: 21px; line-height: 21px;
@ -287,6 +288,30 @@ section .confirm-screen-account-number,
} }
} }
.confirm-screen-error {
font-size: 12px;
line-height: 12px;
color: #f00;
position: absolute;
right: 12px;
width: 80px;
text-align: right;
}
.confirm-screen-row.confirm-screen-total-box {
.confirm-screen-section-column--with-error {
flex: 0.6;
}
}
@media screen and (max-width: 379px) {
.confirm-screen-row.confirm-screen-total-box {
.confirm-screen-section-column--with-error {
flex: 0.4;
}
}
}
.confirm-screen-confirm-button { .confirm-screen-confirm-button {
height: 50px; height: 50px;
border-radius: 4px; border-radius: 4px;

View File

@ -1,4 +1,4 @@
@import url('/fonts/Font_Awesome/font-awesome.min.css'); @import url('./fonts/Font_Awesome/font-awesome.min.css');
@font-face { @font-face {
font-family: 'Roboto'; font-family: 'Roboto';
@ -338,8 +338,8 @@
@font-face { @font-face {
font-family: 'Montserrat Regular'; font-family: 'Montserrat Regular';
src: url('/fonts/Montserrat/Montserrat-Regular.woff') format('woff'); src: url('./fonts/Montserrat/Montserrat-Regular.woff') format('woff');
src: url('/fonts/Montserrat/Montserrat-Regular.ttf') format('truetype'); src: url('./fonts/Montserrat/Montserrat-Regular.ttf') format('truetype');
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
font-size: 'small'; font-size: 'small';
@ -347,59 +347,59 @@
@font-face { @font-face {
font-family: 'Montserrat Bold'; font-family: 'Montserrat Bold';
src: url('/fonts/Montserrat/Montserrat-Bold.woff') format('woff'); src: url('./fonts/Montserrat/Montserrat-Bold.woff') format('woff');
src: url('/fonts/Montserrat/Montserrat-Bold.ttf') format('truetype'); src: url('./fonts/Montserrat/Montserrat-Bold.ttf') format('truetype');
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: 'Montserrat Light'; font-family: 'Montserrat Light';
src: url('/fonts/Montserrat/Montserrat-Light.woff') format('woff'); src: url('./fonts/Montserrat/Montserrat-Light.woff') format('woff');
src: url('/fonts/Montserrat/Montserrat-Light.ttf') format('truetype'); src: url('./fonts/Montserrat/Montserrat-Light.ttf') format('truetype');
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: 'Montserrat UltraLight'; font-family: 'Montserrat UltraLight';
src: url('/fonts/Montserrat/Montserrat-UltraLight.woff') format('woff'); src: url('./fonts/Montserrat/Montserrat-UltraLight.woff') format('woff');
src: url('/fonts/Montserrat/Montserrat-UltraLight.ttf') format('truetype'); src: url('./fonts/Montserrat/Montserrat-UltraLight.ttf') format('truetype');
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: 'DIN OT'; font-family: 'DIN OT';
src: url('/fonts/DIN_OT/DINOT-2.otf') format('opentype'); src: url('./fonts/DIN_OT/DINOT-2.otf') format('opentype');
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: 'DIN OT Light'; font-family: 'DIN OT Light';
src: url('/fonts/DIN_OT/DINOT-2.otf') format('opentype'); src: url('./fonts/DIN_OT/DINOT-2.otf') format('opentype');
font-weight: 200; font-weight: 200;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: 'DIN NEXT'; font-family: 'DIN NEXT';
src: url('/fonts/DIN Next/DIN Next W01 Regular.otf') format('opentype'); src: url('./fonts/DIN Next/DIN Next W01 Regular.otf') format('opentype');
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: 'DIN NEXT Light'; font-family: 'DIN NEXT Light';
src: url('/fonts/DIN Next/DIN Next W10 Light.otf') format('opentype'); src: url('./fonts/DIN Next/DIN Next W10 Light.otf') format('opentype');
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: 'Lato'; font-family: 'Lato';
src: url('/fonts/Lato/Lato-Regular.ttf') format('truetype'); src: url('./fonts/Lato/Lato-Regular.ttf') format('truetype');
font-weight: 400; font-weight: 400;
font-style: normal; font-style: normal;
} }

Some files were not shown because too many files have changed in this diff Show More