Merge pull request #169 from poanetwork/mm-4.16.0

(Upgrade) get upstream from MM 4.16.0
This commit is contained in:
Victor Baranov 2018-10-26 14:48:54 +03:00 committed by GitHub
commit 1953a00e7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
276 changed files with 14061 additions and 2728 deletions

View File

@ -3,6 +3,7 @@ dist/**
builds/**
test-builds/**
docs/**
coverage/
development/bundle.js
development/states.js
@ -19,5 +20,4 @@ mascara/test/jquery-3.1.0.min.js
test/integration/bundle.js
test/integration/jquery-3.1.0.min.js
test/integration/helpers.js
test/integration/lib/first-time.js
test/integration/lib/send-new-ui.js
test/integration/lib/first-time.js

View File

@ -64,9 +64,6 @@
- Remove rejected transactions from transaction history
- Add Trezor Support
- Allow to remove accounts (Imported and Hardware Wallets)
- [#4840](https://github.com/MetaMask/metamask-extension/pull/4840): Now shows notifications when transactions are completed.
- [#4855](https://github.com/MetaMask/metamask-extension/pull/4855): network.js: convert rpc protocol to lower case.
## Current Develop Branch
## 4.8.0 Thur Jun 14 2018

View File

@ -372,7 +372,7 @@
"message": "Import účtu"
},
"importAccountMsg": {
"message":"Importované účty nebudou spojeny s vaší původní Nifty Walletovou klíčovou frází. Zjistěte více o importovaných účtech "
"message": "Importované účty nebudou spojeny s vaší původní Nifty Walletovou klíčovou frází. Zjistěte více o importovaných účtech "
},
"importAnAccount": {
"message": "Import účtu"
@ -736,7 +736,7 @@
"message": "Nastavení"
},
"info": {
"message": "Informace"
"message": "Informace"
},
"shapeshiftBuy": {
"message": "Nakoupit na ShapeShift"

View File

@ -68,13 +68,13 @@
"message": "Muss größer oder gleich $1 und kleiner oder gleich $2 sein.",
"description": "Helfer für die Eingabe von hex als dezimal"
},
"blockiesIdenticon": {
"blockiesIdenticon": {
"message": "Blockies Identicon verwenden"
},
"borrowDharma": {
"message": "Mit Dharma ausleihen (Beta)"
},
"builtInCalifornia": {
"builtInCalifornia": {
"message": "Nifty Wallet wurde in Kalifornien entwickelt und gebaut."
},
"buy": {
@ -86,13 +86,13 @@
"buyCoinbaseExplainer": {
"message": "Coinbase ist die weltweit bekannteste Art und Weise um Bitcoin, Ethereum und Litecoin zu kaufen und verkaufen."
},
"ok": {
"ok": {
"message": "Ok"
},
"cancel": {
"message": "Abbrechen"
},
"classicInterface": {
"classicInterface": {
"message": "Klassische Oberfläche verwenden"
},
"clickCopy": {
@ -101,7 +101,7 @@
"confirm": {
"message": "Bestätigen"
},
"confirmed": {
"confirmed": {
"message": "Bestätigt"
},
"confirmContract": {
@ -369,7 +369,7 @@
"message": "Account importieren"
},
"importAccountMsg": {
"message":" Importierte Accounts werden nicht mit der Seed-Wörterfolge deines ursprünglichen Nifty Wallet Accounts verknüpft. Erfahre mehr über importierte Accounts."
"message": " Importierte Accounts werden nicht mit der Seed-Wörterfolge deines ursprünglichen Nifty Wallet Accounts verknüpft. Erfahre mehr über importierte Accounts."
},
"importAnAccount": {
"message": "Einen Account importieren"
@ -715,7 +715,7 @@
"message": "Einstellungen"
},
"info": {
"message": "Info"
"message": "Info"
},
"shapeshiftBuy": {
"message": "Mit Shapeshift kaufen"

View File

@ -3,7 +3,7 @@
"message": "Accept"
},
"accessingYourCamera": {
"message": "Accesing your camera..."
"message": "Accessing your camera..."
},
"account": {
"message": "Account"
@ -14,6 +14,9 @@
"accountName": {
"message": "Account Name"
},
"accountOptions": {
"message": "Account Options"
},
"accountSelectionRequired": {
"message": "You need to select an account!"
},
@ -61,6 +64,12 @@
"attemptingConnect": {
"message": "Attempting to connect to blockchain."
},
"attemptToCancel": {
"message": "Attempt to Cancel?"
},
"attemptToCancelDescription": {
"message": "Submitting this attempt does not guarantee your original transaction will be cancelled. If the cancellation attempt is successful, you will be charged the transaction fee above."
},
"attributions": {
"message": "Attributions"
},
@ -93,7 +102,7 @@
"message": "Borrow With Dharma (Beta)"
},
"browserNotSupported": {
"message": "Your Browser is not supported..."
"message": "Your Browser is not supported..."
},
"builtInCalifornia": {
"message": "Nifty Wallet is designed and built in California."
@ -116,16 +125,28 @@
"cancel": {
"message": "Cancel"
},
"cancelAttempt": {
"message": "Cancel Attempt"
},
"cancellationGasFee": {
"message": "Cancellation Gas Fee"
},
"cancelN": {
"message": "Cancel all $1 transactions"
},
"classicInterface": {
"message": "Use classic interface"
},
"clickCopy": {
"message": "Click to Copy"
},
"clickToAdd": {
"message": "Click on $1 to add them to your account"
},
"close": {
"message": "Close"
},
"chromeRequiredForHardwareWallets":{
"chromeRequiredForHardwareWallets": {
"message": "You need to use MetaMask on Google Chrome in order to connect to your Hardware Wallet."
},
"confirm": {
@ -152,6 +173,21 @@
"connecting": {
"message": "Connecting..."
},
"connectingToKovan": {
"message": "Connecting to Kovan Test Network"
},
"connectingToMainnet": {
"message": "Connecting to Main Ethereum Network"
},
"connectingToRopsten": {
"message": "Connecting to Ropsten Test Network"
},
"connectingToRinkeby": {
"message": "Connecting to Rinkeby Test Network"
},
"connectingToUnknown": {
"message": "Connecting to Unknown Network"
},
"connectToLedger": {
"message": "Connect to Ledger"
},
@ -185,9 +221,6 @@
"copy": {
"message": "Copy"
},
"copyContractAddress": {
"message": "Copy Contract Address"
},
"copyAddress": {
"message": "Copy address to clipboard"
},
@ -222,6 +255,9 @@
"currentNetwork": {
"message": "Current Network"
},
"currentRpc": {
"message": "Current RPC"
},
"customGas": {
"message": "Customize Gas"
},
@ -328,14 +364,8 @@
"enterPasswordContinue": {
"message": "Enter password to continue"
},
"parameters": {
"message": "Parameters"
},
"passwordNotLongEnough": {
"message": "Password not long enough"
},
"passwordsDontMatch": {
"message": "Passwords Don't Match"
"eth": {
"message": "ETH"
},
"etherscanView": {
"message": "View account on Etherscan"
@ -343,6 +373,9 @@
"exchangeRate": {
"message": "Exchange Rate"
},
"expandView": {
"message": "Expand View"
},
"exportPrivateKey": {
"message": "Export Private Key"
},
@ -353,7 +386,7 @@
"message": "Failed"
},
"fiat": {
"message": "FIAT",
"message": "Fiat",
"description": "Exchange type"
},
"fileImportFail": {
@ -397,6 +430,9 @@
"gasLimitTooLow": {
"message": "Gas limit must be at least 21000"
},
"gasUsed": {
"message": "Gas Used"
},
"generatingSeed": {
"message": "Generating Seed..."
},
@ -477,7 +513,7 @@
"message": "Import Account"
},
"importAccountMsg": {
"message":" Imported accounts will not be associated with your originally created Nifty Wallet account seedphrase. Learn more about imported accounts "
"message": " Imported accounts will not be associated with your originally created Nifty Wallet account seedphrase. Learn more about imported accounts "
},
"importAnAccount": {
"message": "Import an account"
@ -492,6 +528,9 @@
"importUsingSeed": {
"message": "Import using account seed phrase"
},
"info": {
"message": "Info"
},
"infoHelp": {
"message": "Info & Help"
},
@ -520,7 +559,7 @@
"message": "Invalid Request"
},
"invalidRPC": {
"message": "Invalid RPC URI"
"message": "Invalid RPC URL"
},
"invalidSeedPhrase": {
"message": "Invalid seed phrase"
@ -605,6 +644,9 @@
"min": {
"message": "Minimum"
},
"missingYourTokens": {
"message": "Don't see your tokens?"
},
"myAccounts": {
"message": "My Accounts"
},
@ -644,6 +686,9 @@
"newPassword": {
"message": "New Password (min 8 chars)"
},
"newPassword8Chars": {
"message": "New Password (min 8 chars)"
},
"newRecipient": {
"message": "New Recipient"
},
@ -659,7 +704,7 @@
"noDeposits": {
"message": "No deposits received"
},
"noConversionRateAvailable":{
"noConversionRateAvailable": {
"message": "No Conversion Rate Available"
},
"noTransactionHistory": {
@ -686,6 +731,13 @@
"oldUIMessage": {
"message": "You have returned to the old UI. You can switch back to the New UI through the option in the top right dropdown menu."
},
"onlySendToEtherAddress": {
"message": "Only send ETH to an Ethereum address."
},
"onlySendTokensToAccountAddress": {
"message": "Only send $1 to an Ethereum account address.",
"description": "displays token symbol"
},
"openInTab": {
"message": "Open in tab"
},
@ -693,19 +745,34 @@
"message": "or",
"description": "choice between creating or importing a new account"
},
"orderOneHere": {
"message": "Order a Trezor or Ledger and keep your funds in cold storage"
},
"origin": {
"message": "Origin"
},
"outgoing": {
"message": "Outgoing"
},
"parameters": {
"message": "Parameters"
},
"password": {
"message": "Password"
},
"passwordCorrect": {
"message": "Please make sure your password is correct."
},
"passwordsDontMatch": {
"message": "Passwords Don't Match"
},
"passwordMismatch": {
"message": "passwords don't match",
"description": "in password creation process, the two new password fields did not match"
},
"passwordNotLongEnough": {
"message": "Password not long enough"
},
"passwordShort": {
"message": "password not long enough",
"description": "in password creation process, the password is not long enough to be secure"
@ -732,6 +799,12 @@
"prev": {
"message": "Prev"
},
"primaryCurrencySetting": {
"message": "Primary Currency"
},
"primaryCurrencySettingDescription": {
"message": "Select ETH to prioritize displaying values in ETH. Select Fiat to prioritize displaying values in your selected currency."
},
"privacyMsg": {
"message": "Privacy Policy"
},
@ -740,7 +813,7 @@
"description": "select this type of file to use to import an account"
},
"privateKeyWarning": {
"message": "Warning: Never disclose this key. Anyone with your private keys can take steal any assets held in your account."
"message": "Warning: Never disclose this key. Anyone with your private keys can steal any assets held in your account."
},
"privateNetwork": {
"message": "Private Network"
@ -769,6 +842,18 @@
"refundAddress": {
"message": "Your Refund Address"
},
"reject": {
"message": "Reject"
},
"rejectAll": {
"message": "Reject All"
},
"rejectTxsN": {
"message": "Reject $1 transactions"
},
"rejectTxsDescription": {
"message": "You are about to batch reject $1 transactions."
},
"rejected": {
"message": "Rejected"
},
@ -796,9 +881,6 @@
"retryWithMoreGas": {
"message": "Retry with a higher gas price here"
},
"walletSeed": {
"message": "Wallet Seed"
},
"restore": {
"message": "Restore"
},
@ -872,15 +954,6 @@
"save": {
"message": "Save"
},
"speedUp": {
"message": "speed up"
},
"speedUpTitle": {
"message": "Speed Up Transaction"
},
"speedUpSubtitle": {
"message": "Increase your gas price to attempt to overwrite and speed up your transaction"
},
"saveAsCsvFile": {
"message": "Save as CSV File"
},
@ -891,6 +964,12 @@
"saveSeedAsFile": {
"message": "Save Seed Words As File"
},
"scanInstructions": {
"message": "Place the QR code in front of your camera"
},
"scanQrCode": {
"message": "Scan QR Code"
},
"search": {
"message": "Search"
},
@ -900,15 +979,6 @@
"secretPhrase": {
"message": "Enter your secret twelve word phrase here to restore your vault."
},
"showHexData": {
"message": "Show Hex Data"
},
"showHexDataDescription": {
"message": "Select this to show the hex data field on the send screen"
},
"newPassword8Chars": {
"message": "New Password (min 8 chars)"
},
"seedPhraseReq": {
"message": "Seed phrases are 12 words long"
},
@ -945,19 +1015,6 @@
"separateEachWord": {
"message": "Separate each word with a single space"
},
"onlySendToEtherAddress": {
"message": "Only send ETH to an Ethereum address."
},
"onlySendTokensToAccountAddress": {
"message": "Only send $1 to an Ethereum account address.",
"description": "displays token symbol"
},
"orderOneHere": {
"message": "Order a Trezor or Ledger and keep your funds in cold storage"
},
"outgoing": {
"message": "Outgoing"
},
"searchTokens": {
"message": "Search Tokens"
},
@ -982,33 +1039,6 @@
"settings": {
"message": "Settings"
},
"step1HardwareWallet": {
"message": "1. Connect Hardware Wallet"
},
"step1HardwareWalletMsg": {
"message": "Connect your hardware wallet directly to your computer."
},
"step2HardwareWallet": {
"message": "2. Select an Account"
},
"step2HardwareWalletMsg": {
"message": "Select the account you want to view. You can only choose one at a time."
},
"step3HardwareWallet": {
"message": "3. Start using dApps and more!"
},
"step3HardwareWalletMsg": {
"message": "Use your hardware account like you would with any Ethereum account. Log in to dApps, send Eth, buy and store ERC20 tokens and Non-Fungible tokens like CryptoKitties."
},
"info": {
"message": "Info"
},
"scanInstructions": {
"message": "Place the QR code in front of your camera"
},
"scanQrCode": {
"message": "Scan QR Code"
},
"shapeshiftBuy": {
"message": "Buy with Shapeshift"
},
@ -1018,6 +1048,12 @@
"showQRCode": {
"message": "Show QR Code"
},
"showHexData": {
"message": "Show Hex Data"
},
"showHexDataDescription": {
"message": "Select this to show the hex data field on the send screen"
},
"sign": {
"message": "Sign"
},
@ -1042,6 +1078,15 @@
"spaceBetween": {
"message": "there can only be a space between words"
},
"speedUp": {
"message": "speed up"
},
"speedUpTitle": {
"message": "Speed Up Transaction"
},
"speedUpSubtitle": {
"message": "Increase your gas price to attempt to overwrite and speed up your transaction"
},
"status": {
"message": "Status"
},
@ -1054,6 +1099,24 @@
"stateLogError": {
"message": "Error in retrieving state logs."
},
"step1HardwareWallet": {
"message": "1. Connect Hardware Wallet"
},
"step1HardwareWalletMsg": {
"message": "Connect your hardware wallet directly to your computer."
},
"step2HardwareWallet": {
"message": "2. Select an Account"
},
"step2HardwareWalletMsg": {
"message": "Select the account you want to view. You can only choose one at a time."
},
"step3HardwareWallet": {
"message": "3. Start using dApps and more!"
},
"step3HardwareWalletMsg": {
"message": "Use your hardware account like you would with any Ethereum account. Log in to dApps, send Eth, buy and store ERC20 tokens and Non-Fungible tokens like CryptoKitties."
},
"submit": {
"message": "Submit"
},
@ -1115,6 +1178,9 @@
"transactionCreated": {
"message": "Transaction created with a value of $1 on $2."
},
"transactionWithNonce": {
"message": "Transaction $1"
},
"transactionDropped": {
"message": "Transaction dropped on $2."
},
@ -1142,6 +1208,9 @@
"transfer": {
"message": "Transfer"
},
"transferFrom": {
"message": "Transfer From"
},
"transfers": {
"message": "Transfers"
},
@ -1159,7 +1228,7 @@
"message": "These 12 words are the only way to restore your Nifty Wallet accounts.\nSave them somewhere safe and secret."
},
"typePassword": {
"message": "Type Your Password"
"message": "Type your MetaMask password"
},
"uiWelcome": {
"message": "Welcome to the New UI (Beta)"
@ -1195,7 +1264,7 @@
"message": "Ooops! Something went wrong...."
},
"unknownCameraError": {
"message": "There was an error while trying to access you camera. Please try again..."
"message": "There was an error while trying to access your camera. Please try again..."
},
"unlock": {
"message": "Unlock"
@ -1234,6 +1303,9 @@
"visitWebSite": {
"message": "Visit our web site"
},
"walletSeed": {
"message": "Wallet Seed"
},
"warning": {
"message": "Warning"
},
@ -1246,6 +1318,9 @@
"whatsThis": {
"message": "What's this?"
},
"yesLetsTry": {
"message": "Yes, let's try"
},
"youNeedToAllowCameraAccess": {
"message": "You need to allow camera access to use this feature."
},

View File

@ -159,7 +159,7 @@
"message": " Copiar "
},
"copyPrivateKey": {
"message": "Ésta es tu llave privada (haz click para copiar)"
"message": "Ésta es tu clave privada (haz click para copiar)"
},
"copyToClipboard": {
"message": "Copiar al portapapeles"
@ -281,10 +281,10 @@
"message": "Tipo de cambio"
},
"exportPrivateKey": {
"message": "Exportar llave privada"
"message": "Exportar clave privada"
},
"exportPrivateKeyWarning": {
"message": "Exportar llaves privadas bajo TU PROPIO riesgo"
"message": "Exportar claves privadas bajo TU PROPIO riesgo"
},
"failed": {
"message": "Fallo"
@ -582,8 +582,8 @@
"description": "En el proceso de creación de contraseña, esta no es lo suficientemente larga para ser segura"
},
"pastePrivateKey": {
"message": "Pega tu llave privada aqui",
"description": "Para importar una cuenta desde una llave privada"
"message": "Pega tu clave privada aqui",
"description": "Para importar una cuenta desde una clave privada"
},
"pasteSeed": {
"message": "¡Pega tu frase semilla aquí!"
@ -598,7 +598,7 @@
"message": "Política de privacidad"
},
"privateKey": {
"message": "Llave privada",
"message": "Clave privada",
"description": "Selecciona este tupo de archivo para importar una cuenta"
},
"privateKeyWarning": {
@ -718,7 +718,7 @@
"message": "Comprar con ShapeShift"
},
"showPrivateKeys": {
"message": "Mostrar llaves privadas"
"message": "Mostrar claves privadas"
},
"showQRCode": {
"message": "Mostrar codigo QR"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,12 +4,14 @@
{ "code": "en", "name": "English" },
{ "code": "es", "name": "Spanish" },
{ "code": "fr", "name": "French" },
{ "code": "ht", "name": "Haitian Creole" },
{ "code": "hn", "name": "Hindi" },
{ "code": "it", "name": "Italian" },
{ "code": "ja", "name": "Japanese" },
{ "code": "ko", "name": "Korean" },
{ "code": "nl", "name": "Dutch" },
{ "code": "ph", "name": "Tagalog" },
{ "code": "pl", "name": "Polish" },
{ "code": "pt", "name": "Portuguese" },
{ "code": "ru", "name": "Russian" },
{ "code": "sl", "name": "Slovenian" },

View File

@ -2,6 +2,9 @@
"accept": {
"message": "Accetta"
},
"accessingYourCamera": {
"message": "Accesso alla fotocamera..."
},
"account": {
"message": "Account"
},
@ -11,6 +14,15 @@
"accountName": {
"message": "Nome Account"
},
"accountOptions": {
"message": "Account Options"
},
"accountSelectionRequired": {
"message": "Devi selezionare un account!"
},
"activityLog": {
"message": "log attività"
},
"address": {
"message": "Indirizzo"
},
@ -23,6 +35,12 @@
"addTokens": {
"message": "Aggiungi più token"
},
"addSuggestedTokens": {
"message": "Aggiungi Token Suggeriti"
},
"addAcquiredTokens": {
"message": "Aggiungi i token che hai acquistato usando MetaMask"
},
"amount": {
"message": "Importo"
},
@ -37,9 +55,21 @@
"message": "Nifty Wallet",
"description": "Il nome dell'applicazione"
},
"approve": {
"message": "Approva"
},
"approved": {
"message": "Approvato"
},
"attemptingConnect": {
"message": "Tentativo di connessione alla blockchain."
},
"attemptToCancel": {
"message": "Tentativo di Annullamento?"
},
"attemptToCancelDescription": {
"message": "Tentare di annullare non garantisce che la transazione verrà annullata. Se annullata, è comunque richiesto pagare alla rete la commissione sulla transazione."
},
"attributions": {
"message": "Attribuzioni"
},
@ -71,8 +101,11 @@
"borrowDharma": {
"message": "Prendi in presisito con Dharma (Beta)"
},
"browserNotSupported": {
"message": "Il tuo Browser non è supportato..."
},
"builtInCalifornia": {
"message": "Nifty Wallet è progettato e costruito in California."
"message": "Nifty Wallet è progettato e realizzato in California."
},
"buy": {
"message": "Compra"
@ -83,8 +116,23 @@
"buyCoinbaseExplainer": {
"message": "Coinbase è il servizio più popolare al mondo per comprare e vendere Bitcoin, Ethereum e Litecoin."
},
"bytes": {
"message": "Bytes"
},
"ok": {
"message": "Ok"
},
"cancel": {
"message": "Cancella"
"message": "Annulla"
},
"cancelAttempt": {
"message": "Tentativo di Annullamento"
},
"cancellationGasFee": {
"message": "Commissione di Annullamento in Gas"
},
"cancelN": {
"message": "Cancel all $1 transactions"
},
"classicInterface": {
"message": "Usa l'interfaccia classica"
@ -92,9 +140,18 @@
"clickCopy": {
"message": "Clicca per Copiare"
},
"close": {
"message": "Chiudi"
},
"chromeRequiredForHardwareWallets": {
"message": "Devi usare MetaMask con Google Chrome per connettere il tuo Portafoglio Hardware"
},
"confirm": {
"message": "Conferma"
},
"confirmed": {
"message": "Confermata"
},
"confirmContract": {
"message": "Conferma Contratto"
},
@ -104,6 +161,36 @@
"confirmTransaction": {
"message": "Conferma Transazione"
},
"connectHardwareWallet": {
"message": "Connetti Portafoglio Hardware"
},
"connect": {
"message": "Connetti"
},
"connecting": {
"message": "Connessione..."
},
"connectingToKovan": {
"message": "Connessione alla Rete di test Kovan"
},
"connectingToMainnet": {
"message": "Connessione alla Rete Ethereum Principale"
},
"connectingToRopsten": {
"message": "Connessione alla Rete di test Ropsten"
},
"connectingToRinkeby": {
"message": "Connessione alla Rete di test Rinkeby"
},
"connectingToUnknown": {
"message": "Connessione ad una Rete Sconosciuta"
},
"connectToLedger": {
"message": "Connettersi al Ledger"
},
"connectToTrezor": {
"message": "Connettersi al Trezor"
},
"continue": {
"message": "Continua"
},
@ -126,11 +213,14 @@
"message": "Copiato!"
},
"copiedSafe": {
"message": "Le ho copiate in un posto sicuro"
"message": "Le ho copiate in un posto sicuro"
},
"copy": {
"message": "Copia"
},
"copyAddress": {
"message": "Copia l'indirizzo"
},
"copyToClipboard": {
"message": "Copia negli appunti"
},
@ -156,12 +246,21 @@
"currentConversion": {
"message": "Cambio Corrente"
},
"currentLanguage": {
"message": "Lingua Corrente"
},
"currentNetwork": {
"message": "Rete Corrente"
},
"currentRpc": {
"message": "RPC Corrente"
},
"customGas": {
"message": "Personalizza Gas"
},
"customToken": {
"message": "Token Personalizzato"
},
"customize": {
"message": "Personalizza"
},
@ -169,11 +268,11 @@
"message": "RPC Personalizzata"
},
"decimalsMustZerotoTen": {
"message": "Il numero di decimali deve essere almeno 0, e non oltre 36."
"message": "Il numero di decimali deve essere almeno 0, e non oltre 36."
},
"decimal": {
"message": "Precisione Decimali"
},
},
"defaultNetwork": {
"message": "La rete predefinita per transazioni in Ether è la Rete Ethereum Principale."
},
@ -218,38 +317,59 @@
"message": "Deposita Direttamente Ether"
},
"directDepositEtherExplainer": {
"message": "Se possiedi già degli Ether, questa è la via più veloce per aggiungere Ether al tuo portafoglio con un deposito diretto."
"message": "Se possiedi già degli Ether, questa è la via più veloce per aggiungere Ether al tuo portafoglio con un deposito diretto."
},
"done": {
"message": "Finito"
},
"downloadGoogleChrome": {
"message": "Scarica Google Chrome"
},
"downloadStateLogs": {
"message": "Scarica i log di Stato"
},
"dontHaveAHardwareWallet": {
"message": "Non hai un portafoglio hardware?"
},
"dropped": {
"message": "Abbandonata"
},
"edit": {
"message": "Modifica"
},
"editAccountName": {
"message": "Modifica Nome Account"
},
"editingTransaction": {
"message": "Modifica la transazione"
},
"emailUs": {
"message": "Mandaci una mail!"
},
"encryptNewDen": {
"message": "Cripta il tuo nuovo DEN"
},
"ensNameNotFound": {
"message": "Nome ENS non trovato"
},
"enterPassword": {
"message": "Inserisci password"
},
"enterPasswordConfirm": {
"message": "Inserisci la tua password per confermare"
},
"enterPasswordContinue": {
"message": "Inserisci la tua password per continuare"
},
"etherscanView": {
"message": "Vedi account su Etherscan"
},
"exchangeRate": {
"message": "Tasso di cambio"
},
"expandView": {
"message": "Expand View"
},
"exportPrivateKey": {
"message": "Esporta Chiave Privata"
},
@ -257,7 +377,7 @@
"message": "Esporta chiave privata a tuo rischio."
},
"failed": {
"message": "Fallito"
"message": "Fallita"
},
"fiat": {
"message": "FIAT",
@ -270,6 +390,9 @@
"followTwitter": {
"message": "Seguici su Twitter"
},
"forgetDevice": {
"message": "Dimentica questo dispositivo"
},
"from": {
"message": "Da"
},
@ -279,6 +402,9 @@
"fromShapeShift": {
"message": "Da ShapeShift"
},
"functionType": {
"message": "Tipo della Funzione"
},
"gas": {
"message": "Gas",
"description": "Piccola indicazione del costo del gas"
@ -310,6 +436,9 @@
"gasPriceRequired": {
"message": "Prezzo Gas Richiesto"
},
"generatingTransaction": {
"message": "Generando la transazione"
},
"getEther": {
"message": "Ottieni Ether"
},
@ -317,10 +446,28 @@
"message": "Ottieni Get Ether da un faucet per $1",
"description": "Visualizza il nome della rete per il faucet Ether"
},
"getHelp": {
"message": "Aiuto."
},
"greaterThanMin": {
"message": "deve essere maggiore o uguale a $1.",
"description": "aiuto per inserire un input esadecimale come decimale"
},
"hardware": {
"message": "hardware"
},
"hardwareWalletConnected": {
"message": "Portafoglio hardware connesso"
},
"hardwareWallets": {
"message": "Connetti portafoglio hardware"
},
"hardwareWalletsMsg": {
"message": "Selezione un portafoglio hardware che vuoi utilizzare con MetaMask"
},
"havingTroubleConnecting": {
"message": "Problemi di connessione?"
},
"here": {
"message": "qui",
"description": "per intendere -clicca qui- per maggiori informazioni (va con troubleTokenBalances)"
@ -328,6 +475,9 @@
"hereList": {
"message": "Questa è una lista!!!!"
},
"hexData": {
"message": "Dati Hex"
},
"hide": {
"message": "Nascondi"
},
@ -337,11 +487,14 @@
"hideTokenPrompt": {
"message": "Nascondi Token?"
},
"history": {
"message": "Storico"
},
"howToDeposit": {
"message": "Come vuoi depositare Ether?"
},
"holdEther": {
"message": "Ti permette di tenere ether & token, e serve da ponte per le applicazioni decentralizzate."
"message": "Ti permette di tenere ether & token, e serve da ponte per le applicazioni decentralizzate."
},
"import": {
"message": "Importa",
@ -351,7 +504,7 @@
"message": "Importa Account"
},
"importAccountMsg": {
"message":" Gli account importati non saranno associati alla frase seed originariamente creata con Nifty Wallet. Impara di più sugli account importati "
"message": " Gli account importati non saranno associati alla frase seed originariamente creata con Nifty Wallet. Impara di più sugli account importati "
},
"importAnAccount": {
"message": "Importa un account"
@ -363,9 +516,18 @@
"message": "Importato",
"description": "stato che conferma che un account è stato totalmente caricato nel portachiavi"
},
"importUsingSeed": {
"message": "Importa account con frase seed"
},
"info": {
"message": "Informazioni"
},
"infoHelp": {
"message": "Informazioni & Aiuto"
},
"initialTransactionConfirmed": {
"message": "La transazione iniziale è stata confermata dalla rete. Clicca OK per tornare indietro."
},
"insufficientFunds": {
"message": "Fondi non sufficienti."
},
@ -390,19 +552,34 @@
"invalidRPC": {
"message": "URI RPC invalido"
},
"invalidSeedPhrase": {
"message": "Frase seed non valida"
},
"jsonFail": {
"message": "Qualcosa è andato storto. Assicurati che il file JSON sia formattato correttamente."
"message": "Qualcosa è andato storto. Assicurati che il file JSON sia formattato correttamente."
},
"jsonFile": {
"message": "File JSON",
"description": "formato per importare un account"
},
"keepTrackTokens": {
"message": "Tieni traccia dei tokens che hai acquistato con il tuo account MetaMask."
},
"kovan": {
"message": "Rete di test Kovan"
},
"knowledgeDataBase": {
"message": "Visita la nostra Knowledge Base"
},
"max": {
"message": "Massimo"
},
"learnMore": {
"message": "Scopri di più"
},
"ledgerAccountRestriction": {
"message": "E' necessario utilizzare l'ultimo account prima di poterne aggiungere uno nuovo."
},
"lessThanMax": {
"message": "deve essere minore o uguale a $1.",
"description": "aiuto per inserire un input esadecimale come decimale"
@ -410,6 +587,9 @@
"likeToAddTokens": {
"message": "Vorresti aggiungere questi token?"
},
"links": {
"message": "Collegamenti"
},
"limit": {
"message": "Limite"
},
@ -437,17 +617,26 @@
"mainnet": {
"message": "Rete Ethereum Principale"
},
"menu": {
"message": "Menu"
},
"message": {
"message": "Messaggio"
},
"metamaskDescription": {
"message": "Nifty Wallet è una cassaforte sicura per identità su Ethereum."
},
"metamaskSeedWords": {
"message": "Parole Seed di MetaMask"
},
"metamaskVersion": {
"message": "versione di MetaMask"
},
"min": {
"message": "Minimo"
},
"myAccounts": {
"message": "Account Miei"
"message": "Miei Account"
},
"mustSelectOne": {
"message": "Devi selezionare almeno un token."
@ -469,6 +658,9 @@
"networks": {
"message": "Reti"
},
"nevermind": {
"message": "Non importa"
},
"newAccount": {
"message": "Nuovo Account"
},
@ -482,6 +674,9 @@
"newPassword": {
"message": "Nuova Password (minimo 8 caratteri)"
},
"newPassword8Chars": {
"message": "Nuova Password (minimo 8 caratteri)"
},
"newRecipient": {
"message": "Nuovo Destinatario"
},
@ -489,7 +684,7 @@
"message": "Nuovo URL RPC"
},
"next": {
"message": "Prossimo"
"message": "Avanti"
},
"noAddressForName": {
"message": "Nessun indirizzo è stato impostato per questo nome."
@ -497,32 +692,75 @@
"noDeposits": {
"message": "Nessun deposito ricevuto"
},
"noConversionRateAvailable": {
"message": "Tasso di Conversione non Disponibile"
},
"noTransactionHistory": {
"message": "Nessuna cronologia delle transazioni."
},
"noTransactions": {
"message": "Nessuna Transazione"
},
"notFound": {
"message": "Non Trovata"
},
"notStarted": {
"message": "Non Iniziato"
},
"noWebcamFoundTitle": {
"message": "Webcam non trovata"
},
"noWebcamFound": {
"message": "La webcam del tuo computer non è stata trovata. Per favore riprovaci."
},
"oldUI": {
"message": "Vecchia interfaccia"
},
"oldUIMessage": {
"message": "Sei ritornato alla vecchia interfaccia. Puoi ritornare alla nuova interfaccia tramite l'opzione nel menu a discesa in alto a destra."
},
"onlySendToEtherAddress": {
"message": "Invia ETH solamente ad un account Ethereum."
},
"onlySendTokensToAccountAddress": {
"message": "Invia solamente $1 ad un account Ethereum.",
"description": "mostra il simbolo del token"
},
"openInTab": {
"message": "Apri in una scheda"
},
"or": {
"message": "o",
"description": "scelta tra creare o importare un nuovo account"
},
"orderOneHere": {
"message": "Compra un Trezor o un Ledger e tieni i tuoi soldi al sicuro"
},
"origin": {
"message": "Origine"
},
"outgoing": {
"message": "In Uscita"
},
"parameters": {
"message": "Parametri"
},
"password": {
"message": "Password"
},
"passwordCorrect": {
"message": "Assicurati che la password sia corretta."
},
"passwordsDontMatch": {
"message": "Le Password Non Corrispondonos"
},
"passwordMismatch": {
"message": "le password non corrispondono",
"description": "nella creazione della password, le due password all'interno dei campi non corrispondono"
},
"passwordNotLongEnough": {
"message": "Password non abbastanza lunga"
},
"passwordShort": {
"message": "password non sufficientemente lunga",
"description": "nella creazione della password, la password non è lunga abbastanza"
@ -534,12 +772,21 @@
"pasteSeed": {
"message": "Incolla la tua frase seed qui!"
},
"pending": {
"message": "in corso"
},
"personalAddressDetected": {
"message": "Rilevato indirizzo personale. Inserisci l'indirizzo del contratto del token."
},
"pleaseReviewTransaction": {
"message": "Ricontrolla la tua transazione."
},
"popularTokens": {
"message": "Tokens Popolari"
},
"prev": {
"message": "Precedente"
},
"privacyMsg": {
"message": "Politica sulla Privacy"
},
@ -556,8 +803,11 @@
"qrCode": {
"message": "Mostra Codice QR"
},
"queue": {
"message": "Coda"
},
"readdToken": {
"message": "Puoi aggiungere nuovamente questo token in futuro andando in “Aggiungi token” nel menu delle opzioni del tuo account."
"message": "Puoi aggiungere nuovamente questo token in futuro andando in “Aggiungi token” nel menu delle opzioni del tuo account."
},
"readMore": {
"message": "Leggi di più qui."
@ -574,30 +824,78 @@
"refundAddress": {
"message": "Indirizzo di Rimborso"
},
"reject": {
"message": "Reject"
},
"rejectAll": {
"message": "Reject All"
},
"rejectTxsN": {
"message": "Reject $1 transactions"
},
"rejectTxsDescription": {
"message": "You are about to batch reject $1 transactions."
},
"rejected": {
"message": "Respinta"
},
"reset": {
"message": "Reset"
},
"resetAccount": {
"message": "Resetta Account"
},
"resetAccountDescription": {
"message": "Resettare il tuo account cancellerà lo storico delle transazioni."
},
"restoreFromSeed": {
"message": "Ripristina da una frase seed"
},
"restoreVault": {
"message": "Ripristina Cassaforte"
},
"restoreAccountWithSeed": {
"message": "Ripristina Account con la Frase Seed"
},
"required": {
"message": "Richiesto"
},
"retryWithMoreGas": {
"message": "Riprova con un prezzo del Gas maggiore qui"
},
"restore": {
"message": "Ripristina"
},
"revealSeedWords": {
"message": "Rivela Frase Seed"
},
"revealSeedWordsTitle": {
"message": "Frase Seed"
},
"revealSeedWordsDescription": {
"message": "Se cambierai browser o computer, ti servirà questa frase seed per accedere ai tuoi account. Salvala in un posto sicuro e segreto."
},
"revealSeedWordsWarningTitle": {
"message": "NON CONDIVIDERE questa frase con nessuno!"
},
"revealSeedWordsWarning": {
"message": "Non ripristinare la tua frase seed in pubblico!. Queste parole possono essere usate per rubare il tuo account."
},
"revert": {
"message": "Annulla"
},
"remove": {
"message": "rimuovi"
},
"removeAccount": {
"message": "Rimuovi account"
},
"removeAccountDescription": {
"message": "Questo account sarà rimosso dal tuo portafoglio. Per favore assicurati che hai la frase seed originale o la chiave privata per questo account importato prima di continuare. Puoi nuovamente importare o creare un account dal menù a tendina. "
},
"readyToConnect": {
"message": "Pronto a Connetterti?"
},
"rinkeby": {
"message": "Rete di test Rinkeby"
},
@ -607,6 +905,9 @@
"ropsten": {
"message": "Rete di test Ropsten"
},
"rpc": {
"message": "RPC Personalizzata"
},
"sampleAccountName": {
"message": "Es: Il mio nuovo account",
"description": "Aiuta l'utente a capire il concetto di aggiungere un nome leggibile al loro account"
@ -614,6 +915,9 @@
"save": {
"message": "Salva"
},
"saveAsCsvFile": {
"message": "Salva Come File CSV"
},
"saveAsFile": {
"message": "Salva come File",
"description": "Processo per esportare un account"
@ -621,9 +925,18 @@
"saveSeedAsFile": {
"message": "Salva la Frase Seed come File"
},
"scanInstructions": {
"message": "Posizione il codice QR davanti alla fotocamera"
},
"scanQrCode": {
"message": "Scansiona Codice QR"
},
"search": {
"message": "Cerca"
},
"searchResults": {
"message": "Risultati Ricerca"
},
"secretPhrase": {
"message": "Inserisci la tua frase segreta di dodici parole per ripristinare la cassaforte."
},
@ -636,6 +949,9 @@
"selectCurrency": {
"message": "Seleziona Moneta"
},
"selectLocale": {
"message": "Selezione Lingua"
},
"selectService": {
"message": "Seleziona Servizio"
},
@ -651,6 +967,33 @@
"sendTokens": {
"message": "Invia Tokens"
},
"sentEther": {
"message": "ether inviati"
},
"sentTokens": {
"message": "tokens inviati"
},
"separateEachWord": {
"message": "Separa ogni parola con un solo spazio"
},
"searchTokens": {
"message": "Cerca Tokens"
},
"selectAnAddress": {
"message": "Seleziona un Indirizzo"
},
"selectAnAccount": {
"message": "Seleziona un Account"
},
"selectAnAccountHelp": {
"message": "Selezione l'account da visualizzare in MetaMask"
},
"selectHdPath": {
"message": "Seleziona Percorso HD"
},
"selectPathHelp": {
"message": "Se non vedi il tuo account Ledger esistente di seguito, prova a cambiare il percorso in \"Legacy (MEW / MyCrypto)\""
},
"sendTokensAnywhere": {
"message": "Invia Tokens a chiunque abbia un account Ethereum"
},
@ -666,14 +1009,26 @@
"showQRCode": {
"message": "Mostra Codie QR"
},
"showHexData": {
"message": "Mostra Dati Hex"
},
"showHexDataDescription": {
"message": "Seleziona per mostrare il campo dei dati hex nella schermata di invio"
},
"sign": {
"message": "Firma"
},
"signatureRequest": {
"message": "Firma Richiesta"
},
"signed": {
"message": "Firmata"
},
"signMessage": {
"message": "Firma Messaggio"
},
"signNotice": {
"message": "Firmare questo messaggio può avere effetti collaterali pericolosi. \nFirma messaggi da siti di cui ti fidi totalmente. \nQuesto metodo pericoloso sarà rimosso in versioni future."
"message": "Firmare questo messaggio può avere effetti collaterali pericolosi. \nFirma messaggi da siti di cui ti fidi totalmente. \nQuesto metodo pericoloso sarà rimosso in versioni future."
},
"sigRequest": {
"message": "Firma Richiesta"
@ -684,6 +1039,15 @@
"spaceBetween": {
"message": "ci può essere solo uno spazio tra le parole"
},
"speedUp": {
"message": "velocizza"
},
"speedUpTitle": {
"message": "Velocizza Transazione"
},
"speedUpSubtitle": {
"message": "Aumenta il prezzo del gas per tentare di sovrascrivere e velocizzare la transazione"
},
"status": {
"message": "Stato"
},
@ -693,9 +1057,33 @@
"stateLogsDescription": {
"message": "I log di stato contengono i tuoi indirizzi pubblici e le transazioni effettuate."
},
"stateLogError": {
"message": "Errore nel recupero dei log di stato."
},
"step1HardwareWallet": {
"message": "1. Connetti Portafoglio Hardware"
},
"step1HardwareWalletMsg": {
"message": "Connetti il tuo portafoglio hardware al tuo computer."
},
"step2HardwareWallet": {
"message": "2. Seleziona un Account"
},
"step2HardwareWalletMsg": {
"message": "Selezione l'account che vuoi vedere. Puoi selezionarne solo uno alla volta."
},
"step3HardwareWallet": {
"message": "3. Inizia a usare dApps e molto altro ancora!"
},
"step3HardwareWalletMsg": {
"message": "Usa il tuo account hardware come utilizzeresti qualsiasi account Ethereum. Accedi alle dApps, invia Eth, compra e conserva token ERC20 e token non fungibili come CryptoKitties"
},
"submit": {
"message": "Invia"
},
"submitted": {
"message": "Inviata"
},
"supportCenter": {
"message": "Visita il nostro Centro di Supporto"
},
@ -718,6 +1106,9 @@
"message": "$1 a ETH via ShapeShift",
"description": "il sistema riempirà il tipo di deposito all'inizio del messaggio"
},
"token": {
"message": "Token"
},
"tokenAddress": {
"message": "Indirizzo Token"
},
@ -739,23 +1130,62 @@
"total": {
"message": "Totale"
},
"transaction": {
"message": "transazione"
},
"transactionConfirmed": {
"message": "Transazione confermata il $2."
},
"transactionCreated": {
"message": "Transazione di valore $1 creata il $2."
},
"transactionWithNonce": {
"message": "Transazione $1"
},
"transactionDropped": {
"message": "Transazione abbandonata il $2."
},
"transactionSubmitted": {
"message": "Transazione inviata il $2."
},
"transactionUpdated": {
"message": "Transazione aggiornata il $2."
},
"transactionUpdatedGas": {
"message": "Transazione aggiornata con un prezzo del gas di $1 il $2."
},
"transactions": {
"message": "transazioni"
},
"transactionError": {
"message": "Errore Transazione. Eccceziona generata nel codice del contratto."
},
"transactionMemo": {
"message": "Promemoria Transazione (opzionale)"
},
"transactionNumber": {
"message": "Numero Transazione"
},
"transfer": {
"message": "Trasferisci"
},
"transferFrom": {
"message": "Transfer From"
},
"transfers": {
"message": "Trasferimenti"
},
"trezorHardwareWallet": {
"message": "TREZOR Portafoglio Hardware"
},
"troubleTokenBalances": {
"message": "Abbiamo avuto un problema a caricare il bilancio dei tuoi token. Puoi vederlo ",
"description": "Seguito da un link (qui) per vedere il bilancio dei token"
},
"twelveWords": {
"tryAgain": {
"message": "Prova di nuovo"
},
"twelveWords": {
"message": "Queste 12 parole sono l'unico modo per ripristinare i tuoi account Nifty Wallet. \nSalvale in un posto sicuro e segreto."
},
"typePassword": {
@ -765,20 +1195,47 @@
"message": "Benvenuto alla nuova interfaccia (Beta)"
},
"uiWelcomeMessage": {
"message": "Stai utilizzanto la nuova interfaccia di Nifty Wallet. Guarda in giro, prova nuove funzionalità come inviare token, e facci sapere se hai dei problemi."
"message": "Stai utilizzanto la nuova interfaccia di Nifty Wallet. Guarda in giro, prova nuove funzionalità come inviare token, e facci sapere se hai dei problemi."
},
"unapproved": {
"message": "Non approvata"
},
"unavailable": {
"message": "Non Disponibile"
},
"units": {
"message": "unità"
},
"unknown": {
"message": "Sconosciuto"
},
"unknownFunction": {
"message": "Funzione Sconosciuta"
},
"unknownNetwork": {
"message": "Rete Privata Sconosciuta"
},
"unknownNetworkId": {
"message": "ID rete sconosciuto"
},
"unknownQrCode": {
"message": "Errore: Non siamo riusciti a identificare il codice QR"
},
"unknownCameraErrorTitle": {
"message": "Ooops! Qualcosa è andato storto...."
},
"unknownCameraError": {
"message": "C'è stato un errore nel tentativo di accedere alla fotocamera. Per favore prova di nuovo..."
},
"unlock": {
"message": "Sblocca"
},
"unlockMessage": {
"message": "Il web decentralizzato ti attende"
},
"updatedWithDate": {
"message": "Aggiornata $1"
},
"uriErrorMsg": {
"message": "Gli URI richiedono un prefisso HTTP/HTTPS."
},
@ -801,22 +1258,40 @@
"viewAccount": {
"message": "Vedi Account"
},
"viewOnEtherscan": {
"message": "Vedi su Etherscan"
},
"visitWebSite": {
"message": "Visita il nostro sito web"
},
},
"walletSeed": {
"message": "Seed del Portafoglio"
},
"warning": {
"message": "Attenzione"
},
"welcomeBack": {
"message": "Bentornato!"
},
"welcomeBeta": {
"message": "Benvenuto nella Beta di Nifty Wallet"
},
"whatsThis": {
"message": "Cos'è questo?"
},
"yesLetsTry": {
"message": "Si, proviamo"
},
"youNeedToAllowCameraAccess": {
"message": "Devi consentire l'accesso alla fotocamera per usare questa funzionalità."
},
"yourSigRequested": {
"message": "E' richiesta la tua firma"
},
"youSign": {
"message": "Ti stai connettendo"
},
"yourPrivateSeedPhrase": {
"message": "La tua frase seed privata"
}
}

View File

@ -122,9 +122,6 @@
"copy": {
"message": "コピー"
},
"copyContractAddress": {
"message": "コントラクトアドレスをコピー"
},
"copyToClipboard": {
"message": "クリップボードへコピー"
},
@ -318,7 +315,7 @@
"message": "アカウントのインポート"
},
"importAccountMsg": {
"message":"追加したアカウントはMetaMaskのアカウントパスフレーズとは関連付けられません。インポートしたアカウントについての詳細は"
"message": "追加したアカウントはMetaMaskのアカウントパスフレーズとは関連付けられません。インポートしたアカウントについての詳細は"
},
"importAnAccount": {
"message": "アカウントをインポート"

File diff suppressed because it is too large Load Diff

View File

@ -351,7 +351,7 @@
"message": "Account importeren"
},
"importAccountMsg": {
"message":" Geïmporteerde accounts worden niet gekoppeld aan de seedphrase van uw oorspronkelijk gemaakte Nifty Wallet-account. Meer informatie over geïmporteerde accounts"
"message": " Geïmporteerde accounts worden niet gekoppeld aan de seedphrase van uw oorspronkelijk gemaakte Nifty Wallet-account. Meer informatie over geïmporteerde accounts"
},
"importAnAccount": {
"message": "Importeer een account"

File diff suppressed because it is too large Load Diff

View File

@ -351,7 +351,7 @@
"message": "Importar Conta"
},
"importAccountMsg": {
"message":"Contas importadas não irão ser associadas com a frase seed da conta criada originalmente pelo Nifty Wallet. Saiba mais sobre contas importadas."
"message": "Contas importadas não irão ser associadas com a frase seed da conta criada originalmente pelo Nifty Wallet. Saiba mais sobre contas importadas."
},
"importAnAccount": {
"message": "Importar uma conta"

View File

@ -366,7 +366,7 @@
"message": "Импортировать счет"
},
"importAccountMsg": {
"message":" Импортированные счета не будут ассоциированы с вашей ключевой фразой, созданной Nifty Wallet. Узнать больше про импорт счетов "
"message": " Импортированные счета не будут ассоциированы с вашей ключевой фразой, созданной Nifty Wallet. Узнать больше про импорт счетов "
},
"importAnAccount": {
"message": "Импортировать аккаунт"

View File

@ -351,7 +351,7 @@
"message": "Uvozi račun"
},
"importAccountMsg": {
"message":" Uvoženi računi ne bodo povezani s prvotnim seedphaseom. Preberite več o uvoženih računih "
"message": " Uvoženi računi ne bodo povezani s prvotnim seedphaseom. Preberite več o uvoženih računih "
},
"importAnAccount": {
"message": "Uvozi račun"

View File

@ -351,7 +351,7 @@
"message": "นำเข้าบัญชี"
},
"importAccountMsg": {
"message":"บัญชีที่นำเข้าจะไม่ถูกรวมกับบัญชีที่สร้างด้วยคำเเริ่มต้นบนเมต้ามาร์สในตอนแรก เรียนรู้เพิ่มเติมเกี่ยวกับบัญชีที่นำเข้า"
"message": "บัญชีที่นำเข้าจะไม่ถูกรวมกับบัญชีที่สร้างด้วยคำเเริ่มต้นบนเมต้ามาร์สในตอนแรก เรียนรู้เพิ่มเติมเกี่ยวกับบัญชีที่นำเข้า"
},
"importAnAccount": {
"message": "นำเข้าบัญชี"

View File

@ -372,7 +372,7 @@
"message": "கணக்கை இறக்குமதி செய்க"
},
"importAccountMsg": {
"message":" இறக்குமதி செய்யப்பட்ட கணக்கு உங்கள் முதலில் உருவாக்கப்பட்ட மெட்டாமாஸ்க் கணக்கு விதை மூலம் தொடர்புடையதாக இருக்காது. இறக்குமதி செய்யப்பட்ட கணக்குகள் பற்றி மேலும் அறிக "
"message": " இறக்குமதி செய்யப்பட்ட கணக்கு உங்கள் முதலில் உருவாக்கப்பட்ட மெட்டாமாஸ்க் கணக்கு விதை மூலம் தொடர்புடையதாக இருக்காது. இறக்குமதி செய்யப்பட்ட கணக்குகள் பற்றி மேலும் அறிக "
},
"importAnAccount": {
"message": "ஒரு கணக்கை இறக்குமதி செய்க"
@ -736,7 +736,7 @@
"message": "அமைப்புகள்"
},
"info": {
"message": "தகவல்"
"message": "தகவல்"
},
"shapeshiftBuy": {
"message": "Shapeshift உடன் வாங்கவும்"

File diff suppressed because it is too large Load Diff

View File

@ -387,7 +387,7 @@
"message": "导入账户"
},
"importAccountMsg": {
"message":" Imported accounts will not be associated with your originally created Nifty Wallet account seedphrase. Learn more about imported accounts "
"message": " Imported accounts will not be associated with your originally created Nifty Wallet account seedphrase. Learn more about imported accounts "
},
"importAnAccount": {
"message": "导入一个账户"
@ -511,7 +511,7 @@
"description": "User is important an account and needs to add a file to continue"
},
"needImportPassword": {
"message": "必须为已选择的文件输入密码。",
"message": "必须为已选择的文件输入密码。",
"description": "Password and file needed to import an account"
},
"negativeETH": {
@ -561,7 +561,7 @@
"message": "旧版界面"
},
"oldUIMessage": {
"message": "你已经切换到旧版界面。 你可以通过右上方下拉菜单中的选项切换回新的用户界面。"
"message": "你已经切换到旧版界面。 你可以通过右上方下拉菜单中的选项切换回新的用户界面。"
},
"or": {
"message": "或",
@ -605,7 +605,7 @@
"description": "select this type of file to use to import an account"
},
"privateKeyWarning": {
"message": "注意:永远不要公开这个私钥。任何拥有你的私钥的人都可以窃取你帐户中的任何资产。"
"message": "注意:永远不要公开这个私钥。任何拥有你的私钥的人都可以窃取你帐户中的任何资产。"
},
"privateNetwork": {
"message": "私有网络"
@ -614,7 +614,7 @@
"message": "显示二维码"
},
"readdToken": {
"message": "之后你还可以通过帐户选项菜单中的“添加代币”来添加此代币。"
"message": "之后你还可以通过帐户选项菜单中的“添加代币”来添加此代币。"
},
"readMore": {
"message": "了解更多。"
@ -772,7 +772,7 @@
"message": "设置"
},
"info": {
"message": "信息"
"message": "信息"
},
"shapeshiftBuy": {
"message": "使用 Shapeshift 购买"
@ -894,7 +894,7 @@
"message": "欢迎使用新版界面 Beta"
},
"uiWelcomeMessage": {
"message": "你现在正在使用新的 Nifty Wallet 界面。 尝试发送代币等新功能,有任何问题请告知我们。"
"message": "你现在正在使用新的 Nifty Wallet 界面。 尝试发送代币等新功能,有任何问题请告知我们。"
},
"unapproved": {
"message": "未批准"

View File

@ -372,7 +372,7 @@
"message": "導入帳戶"
},
"importAccountMsg": {
"message":" 匯入的帳戶與您原有 Nifty Wallet 帳戶的助憶詞並無關聯. 請查看與導入帳戶相關的資料 "
"message": " 匯入的帳戶與您原有 Nifty Wallet 帳戶的助憶詞並無關聯. 請查看與導入帳戶相關的資料 "
},
"importAnAccount": {
"message": "導入一個帳戶"

14
app/images/eth.svg Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 40 40" style="enable-background:new 0 0 40 40;" xml:space="preserve">
<style type="text/css">
.st0{fill:#38393A;}
</style>
<title>deposit-eth</title>
<desc>Created with Sketch.</desc>
<g id="deposit-eth" transform="translate(0.000000, 14.000000)">
<path id="Shape" class="st0" d="M19.9,16L7.5,8.7L19.9,26L32.3,8.7L19.9,16L19.9,16z M20.1-14L7.7,6.4l12.4,7.3l12.4-7.2L20.1-14z"
/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 670 B

13
app/images/expand.svg Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>expand</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Extension-(mobile-form-factor)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="expand" fill="#FFFFFF" fill-rule="nonzero">
<path d="M15.4802977,0.0647543729 C15.3777028,0.0227060788 15.2692212,0 15.1590578,0 L10.1134046,0 C9.64920448,0 9.27246238,0.376752715 9.27246238,0.840965882 C9.27246238,1.30602001 9.64920448,1.68193176 10.1134046,1.68193176 L13.1290233,1.68193176 L8.77993963,6.03113791 C8.45113123,6.35995557 8.45113123,6.89228697 8.77993963,7.22026366 C8.94392336,7.38509298 9.15920457,7.46666667 9.37448577,7.46666667 C9.58976698,7.46666667 9.80504818,7.38509298 9.96903191,7.22026366 L14.3181156,2.87105752 L14.3181156,5.88676117 C14.3181156,6.35181531 14.6948577,6.72772705 15.1590578,6.72772705 C15.6232579,6.72772705 16,6.35181531 16,5.88676117 L16,0.840965882 C16,0.731640317 15.9781355,0.623155718 15.9352475,0.519716915 C15.8494713,0.31452124 15.6863286,0.150532893 15.4802977,0.0647543729 Z" id="Fill-1" transform="translate(12.266667, 3.733333) rotate(-360.000000) translate(-12.266667, -3.733333) "></path>
<path d="M6.94696439,8.59808771 C6.84436944,8.55603941 6.73588789,8.53333333 6.62572446,8.53333333 L1.58007124,8.53333333 C1.11587115,8.53333333 0.739129042,8.91008605 0.739129042,9.37429922 C0.739129042,9.83935335 1.11587115,10.2152651 1.58007124,10.2152651 L4.59568999,10.2152651 L0.246606301,14.5644712 C-0.0822021004,14.8932889 -0.0822021004,15.4256203 0.246606301,15.753597 C0.410590031,15.9184263 0.625871235,16 0.841152439,16 C1.05643364,16 1.27171485,15.9184263 1.43569858,15.753597 L5.78478226,11.4043909 L5.78478226,14.4200945 C5.78478226,14.8851486 6.16152437,15.2610604 6.62572446,15.2610604 C7.08992456,15.2610604 7.46666667,14.8851486 7.46666667,14.4200945 L7.46666667,9.37429922 C7.46666667,9.26497365 7.44480217,9.15648905 7.40191412,9.05305025 C7.31613801,8.84785457 7.15299522,8.68386623 6.94696439,8.59808771 Z" id="Fill-1-Copy" transform="translate(3.733333, 12.266667) rotate(-180.000000) translate(-3.733333, -12.266667) "></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

16
app/images/hide.svg Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="12px" viewBox="0 0 16 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>hide</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Extension-(mobile-form-factor)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="hide" fill="#FFFFFF">
<polygon id="Fill-1" points="12.7924541 0.685525644 2.5021101 11.2520394 3.21020258 11.978038 13.4995465 1.41152421"></polygon>
<path d="M4.53087507,6.33167913 C4.53087507,4.36419221 6.08507807,2.76945986 8.00132835,2.76945986 C8.40338086,2.76945986 8.78243037,2.85366337 9.14147727,2.98202238 L10.0225923,2.07734807 C9.36950705,1.93153223 8.69641914,1.83808687 8.00132835,1.83808687 C4.64088944,1.83808687 1.68850383,3.6289518 0.000283333333,6.33167913 C0.757382218,7.54338819 1.77751546,8.55691095 2.96667077,9.32295752 L4.73890224,7.50334018 C4.61288579,7.1346931 4.53087507,6.74448171 4.53087507,6.33167913" id="Fill-2"></path>
<path d="M13.0194751,3.34029805 L11.2513649,5.16094226 C11.3770883,5.52958934 11.4589083,5.91980074 11.4589083,6.33157644 C11.4589083,8.30009024 9.90831963,9.89482259 7.99652557,9.89482259 C7.59441023,9.89482259 7.21724,9.81061908 6.85803026,9.68123319 L5.97896421,10.5859075 C6.63152857,10.7317233 7.30305122,10.8261956 7.99652557,10.8261956 C11.348152,10.8261956 14.2936719,9.03430378 15.9789642,6.33157644 C15.223626,5.11986738 14.2048672,4.10634463 13.0194751,3.34029805" id="Fill-4"></path>
<path d="M8.00102831,8.7499629 C9.30219826,8.7499629 10.3553358,7.66763972 10.3553358,6.33167913 C10.3553358,6.25774434 10.341334,6.18689017 10.3343331,6.11398225 L7.78900062,8.72839858 C7.86000989,8.73455982 7.92901891,8.7499629 8.00102831,8.7499629" id="Fill-7"></path>
<path d="M8.00102831,3.9139088 C6.69985837,3.9139088 5.64672082,4.99623198 5.64672082,6.33116569 C5.64672082,6.40612736 5.66072264,6.47698153 5.66772356,6.54886258 L8.213056,3.93547311 C8.14204673,3.92931188 8.07303772,3.9139088 8.00102831,3.9139088" id="Fill-9"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

17
app/images/info.svg Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>info</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Extension-(mobile-form-factor)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="info" fill="#FFFFFF">
<path d="M13.2142857,0.642857143 L13.2142857,0.5 L0.5,0.5 L0.5,13.2142857 L0.642857143,13.2142857 L0.642857143,0.642857143 L13.2142857,0.642857143 Z" id="Combined-Shape" stroke="#FFFFFF"></path>
<path d="M3.42857143,3.42857143 L3.42857143,14.8571429 L14.8571429,14.8571429 L14.8571429,3.42857143 L3.42857143,3.42857143 Z M2.28571429,2.28571429 L16,2.28571429 L16,16 L2.28571429,16 L2.28571429,2.28571429 Z" id="Rectangle-18-Copy" fill-rule="nonzero"></path>
<g id="Group-44" transform="translate(8.000000, 5.000000)">
<rect id="Rectangle-39" x="0" y="3" width="2" height="5" rx="1"></rect>
<rect id="Rectangle-39-Copy" x="0" y="0" width="2" height="2" rx="1"></rect>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1 +1,33 @@
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1916.3 516.8" width="2500" height="674"><style>.st0{fill:#333745}</style><g id="squares_1_"><path class="st0" d="M578.2 392.7V24.3h25.6v344.1h175.3v24.3H578.2zm327.5 5.1c-39.7 0-70.4-12.8-93.4-37.1-21.7-24.3-33.3-58.8-33.3-103.6 0-43.5 10.2-79.3 32-104.9 21.7-26.9 49.9-39.7 87-39.7 32 0 57.6 11.5 76.8 33.3 19.2 23 28.1 53.7 28.1 92.1v20.5H804.6c0 37.1 9 66.5 26.9 85.7 16.6 20.5 42.2 29.4 74.2 29.4 15.3 0 29.4-1.3 40.9-3.8 11.5-2.6 26.9-6.4 44.8-14.1v24.3c-15.3 6.4-29.4 11.5-42.2 14.1-14.3 2.6-28.9 3.9-43.5 3.8zM898 135.6c-26.9 0-47.3 9-64 25.6-15.3 17.9-25.6 42.2-28.1 75.5h168.9c0-32-6.4-56.3-20.5-74.2-12.8-18-32-26.9-56.3-26.9zm238-21.8c19.2 0 37.1 3.8 51.2 10.2 14.1 7.7 26.9 19.2 38.4 37.1h1.3c-1.3-21.7-1.3-42.2-1.3-62.7V0h24.3v392.7h-16.6l-6.4-42.2c-20.5 30.7-51.2 47.3-89.6 47.3s-66.5-11.5-87-35.8c-20.5-23-29.4-57.6-29.4-102.3 0-47.3 10.2-83.2 29.4-108.7 19.2-25.6 48.6-37.2 85.7-37.2zm0 21.8c-29.4 0-52.4 10.2-67.8 32-15.3 20.5-23 51.2-23 92.1 0 78 30.7 116.4 90.8 116.4 30.7 0 53.7-9 67.8-26.9 14.1-17.9 21.7-47.3 21.7-89.6v-3.8c0-42.2-7.7-72.9-21.7-90.8-12.8-20.5-35.8-29.4-67.8-29.4zm379.9-16.6v17.9l-56.3 3.8c15.3 19.2 23 39.7 23 61.4 0 26.9-9 47.3-26.9 64-17.9 16.6-40.9 24.3-70.4 24.3-12.8 0-21.7 0-25.6-1.3-10.2 5.1-17.9 11.5-23 17.9-5.1 7.7-7.7 14.1-7.7 23s3.8 15.3 10.2 19.2c6.4 3.8 17.9 6.4 33.3 6.4h47.3c29.4 0 52.4 6.4 67.8 17.9s24.3 29.4 24.3 53.7c0 29.4-11.5 51.2-34.5 66.5-23 15.3-56.3 23-99.8 23-34.5 0-61.4-6.4-80.6-20.5-19.2-12.8-28.1-32-28.1-55 0-19.2 6.4-34.5 17.9-47.3s28.1-20.5 47.3-25.6c-7.7-3.8-15.3-9-19.2-15.3-5-6.2-7.7-13.8-7.7-21.7 0-17.9 11.5-34.5 34.5-48.6-15.3-6.4-28.1-16.6-37.1-30.7-9-14.1-12.8-30.7-12.8-48.6 0-26.9 9-49.9 25.6-66.5 17.9-16.6 40.9-24.3 70.4-24.3 17.9 0 32 1.3 42.2 5.1h85.7v1.3h.2zm-222.6 319.8c0 37.1 28.1 56.3 84.4 56.3 71.6 0 107.5-23 107.5-69.1 0-16.6-5.1-28.1-16.6-35.8-11.5-7.7-29.4-11.5-55-11.5h-44.8c-49.9 1.2-75.5 20.4-75.5 60.1zm21.8-235.4c0 21.7 6.4 37.1 19.2 49.9 12.8 11.5 29.4 17.9 51.2 17.9 23 0 40.9-6.4 52.4-17.9 12.8-11.5 17.9-28.1 17.9-49.9 0-23-6.4-40.9-19.2-52.4-12.8-11.5-29.4-17.9-52.4-17.9-21.7 0-39.7 6.4-51.2 19.2-12.8 11.4-17.9 29.3-17.9 51.1z"/><path class="st0" d="M1640 397.8c-39.7 0-70.4-12.8-93.4-37.1-21.7-24.3-33.3-58.8-33.3-103.6 0-43.5 10.2-79.3 32-104.9 21.7-26.9 49.9-39.7 87-39.7 32 0 57.6 11.5 76.8 33.3 19.2 23 28.1 53.7 28.1 92.1v20.5h-197c0 37.1 9 66.5 26.9 85.7 16.6 20.5 42.2 29.4 74.2 29.4 15.3 0 29.4-1.3 40.9-3.8 11.5-2.6 26.9-6.4 44.8-14.1v24.3c-15.3 6.4-29.4 11.5-42.2 14.1-14.1 2.6-28.2 3.8-44.8 3.8zm-6.4-262.2c-26.9 0-47.3 9-64 25.6-15.3 17.9-25.6 42.2-28.1 75.5h168.9c0-32-6.4-56.3-20.5-74.2-12.8-18-32-26.9-56.3-26.9zm245.6-21.8c11.5 0 24.3 1.3 37.1 3.8l-5.1 24.3c-11.8-2.6-23.8-3.9-35.8-3.8-23 0-42.2 10.2-57.6 29.4-15.3 20.5-23 44.8-23 75.5v149.7h-25.6V119h21.7l2.6 49.9h1.3c11.5-20.5 23-34.5 35.8-42.2 15.4-9 30.7-12.9 48.6-12.9zM333.9 12.8h-183v245.6h245.6V76.7c.1-34.5-28.1-63.9-62.6-63.9zm-239.2 0H64c-34.5 0-64 28.1-64 64v30.7h94.7V12.8zM0 165h94.7v94.7H0V165zm301.9 245.6h30.7c34.5 0 64-28.1 64-64V316h-94.7v94.6zm-151-94.6h94.7v94.7h-94.7V316zM0 316v30.7c0 34.5 28.1 64 64 64h30.7V316H0z"/></g></svg>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 197.4 48.6" style="enable-background:new 0 0 197.4 48.6;" xml:space="preserve">
<style type="text/css">
.st0{fill:#1D2028;}
</style>
<title>Fichier 8</title>
<g>
<path class="st0" d="M34.1,0H15.5v25.1h25.1V6.5C40.6,2.9,37.7,0,34.1,0z"/>
<path class="st0" d="M9.7,0H6.5C2.9,0,0,2.9,0,6.5v3.2h9.7V0z"/>
<rect y="15.5" class="st0" width="9.7" height="9.7"/>
<path class="st0" d="M31,40.6h3.2c3.6,0,6.5-2.9,6.5-6.5V31H31V40.6z"/>
<rect x="15.5" y="31" class="st0" width="9.7" height="9.7"/>
<path class="st0" d="M0,31v3.2c0,3.6,2.9,6.5,6.5,6.5h3.2V31H0z"/>
<g>
<polygon class="st0" points="65.4,2.6 61.6,2.6 61.6,38.1 81.7,38.1 81.7,34.7 65.4,34.7 "/>
<path class="st0" d="M93.9,12c-7.4,0-12.6,5.5-12.6,13.4c0,0.3,0,0.6,0,0.9c0.1,3.4,1.6,6.6,4.1,9c2.4,2.2,5.5,3.5,8.8,3.5
c0.2,0,0.3,0,0.5,0c3.5,0,6.8-1.3,9.4-3.5l0.1-0.1l-1.7-2.8l-0.2,0.1c-2.1,1.9-4.7,3-7.5,3c-4.6,0-9.3-3-9.6-9.7h19.2v-0.2
c0,0,0.1-1.2,0.1-1.8C104.5,16.6,100.3,12,93.9,12z M85.3,22.6c0.8-4.5,4.1-7.4,8.4-7.4c3.2,0,6.7,1.9,7,7.4H85.3z"/>
<path class="st0" d="M126.5,15c0,0.4,0,0.9,0,1.3c-1.6-2.7-4.6-4.4-7.7-4.4c-0.1,0-0.2,0-0.3,0c-6.8,0-11.5,5.4-11.5,13.3
c0,8,4.5,13.4,11.2,13.4c5.3,0,7.7-3.2,8.5-4.6c0,0.4,0,0.8,0,1.1v2.8h3.6V2.6h-3.7V15H126.5z M118.7,35.3c-4.7,0-7.8-4-7.8-10
c0-5.8,3.3-9.9,7.9-9.9c3.9,0,7.8,3.1,7.8,9.9C126.6,32.7,122.5,35.3,118.7,35.3z"/>
<path class="st0" d="M152.2,15.5c0,0.1,0,0.2,0,0.2c-0.7-1.2-2.9-3.8-8.2-3.8c-6.7,0-11.1,5.1-11.1,12.9s4.6,13.1,11.4,13.1
c3.7,0,6.2-1.3,7.9-4c0,0.4,0,0.8,0,1.2v2.3c0,4.9-3.1,7.7-8.6,7.7c-2.3,0-4.7-0.6-6.8-1.7l-0.2-0.1l-1.4,3.1l0.2,0.1
c2.6,1.3,5.5,2,8.3,2c5.9,0,12.2-3,12.2-11.3V12.6h-3.7L152.2,15.5L152.2,15.5z M144.8,34.6c-4.9,0-8.1-3.8-8.1-9.7
c0-6,2.8-9.4,7.6-9.4c5.3,0,7.8,3.1,7.8,9.4C152.2,31.1,149.6,34.6,144.8,34.6z"/>
<path class="st0" d="M171,12c-7.4,0-12.5,5.5-12.5,13.3c0,0.3,0,0.6,0,0.9c0.1,3.4,1.6,6.6,4.1,9c2.4,2.2,5.5,3.5,8.8,3.5
c0.2,0,0.3,0,0.5,0c3.5,0,6.8-1.3,9.4-3.5l0.1-0.1l-1.8-2.8l-0.2,0.1c-2.1,1.9-4.7,3-7.5,3c-4.6,0-9.3-3-9.6-9.7h19.3v-0.2
c0,0,0.1-1.2,0.1-1.8C181.7,16.6,177.5,12,171,12z M162.5,22.6c0.8-4.5,4.1-7.4,8.4-7.4c3.2,0,6.7,1.9,7,7.4H162.5z"/>
<path class="st0" d="M197.3,12.5c-0.5-0.1-0.9-0.1-1.4-0.2c-3.5,0-6.4,2.2-7.9,5.9c0-0.3,0-0.7,0-1.1v-4.6h-3.7l0.1,25.3V38h3.8
V27.3c0-1.6,0.2-3.3,0.7-4.8c1.2-3.9,3.9-6.4,7.1-6.4c0.4,0,0.8,0,1.2,0.1h0.2v-3.7L197.3,12.5z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>open-etherscan</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Extension-(mobile-form-factor)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="open-etherscan" fill="#FFFFFF">
<path d="M3.00020312,0 C2.44821175,0 2.00021875,0.447993 2.00021875,0.999984375 C2.00021875,1.55197575 2.44821175,1.99996875 3.00020312,1.99996875 L12.5860533,1.99996875 L0.293245418,14.2927767 C-0.0977484727,14.6837706 -0.0977484727,15.3157607 0.293245418,15.7067546 C0.488242371,15.9017515 0.744238371,15.99975 1.00023437,15.99975 C1.25623037,15.99975 1.51222637,15.9017515 1.70722332,15.7067546 L14.0000312,3.41394666 L14.0000312,12.9997969 C14.0000312,13.5517883 14.4480242,13.9997813 15.0000156,13.9997813 C15.552007,13.9997813 16,13.5517883 16,12.9997969 L16,0 L3.00020312,0 Z"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -3,7 +3,7 @@
<html>
<head>
<title>Dangerous Website Warning</title>
<title>Ethereum Phishing Detection - MetMask</title>
<style>
body {
@ -24,10 +24,12 @@
a {
color: white;
cursor: pointer;
text-decoration: underline;
}
</style>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@ -45,7 +47,7 @@
ga('require', 'linker');
ga('linker:autoLink', ['metamask.io'], false, true);
</script>
<script src="phishing-detect.js"></script>
</head>
<body>
@ -55,8 +57,13 @@
<h3>ATTENTION</h3>
<p>MetaMask believes this domain could currently compromise your security and has prevented you from interacting with it.</p>
<p>This is because the site tested positive on the <a href="https://github.com/metamask/eth-phishing-detect">Ethereum Phishing Detector</a>. This includes outright malicious websites and legitimate websites that have been compromised by a malicious actor.</p>
<p id="esdbLink"></p>
<p>You can turn MetaMask off to interact with this site, but it is advised not to.</p>
<p>If you think this domain is incorrectly flagged or if a blocked legitimate website has resolved its security issues, <a href="https://github.com/metamask/eth-phishing-detect/issues/new">please file an issue</a>.</p>
<p>
If you think this domain is incorrectly flagged or if a blocked legitimate website has resolved its security issues,
<a href="https://github.com/metamask/eth-phishing-detect/issues/new">please file an issue</a>. If you believe this website
is safe and understand the risks involved, you can <a id="unsafe-continue">visit this unsafe website at your own risk</a>.
</p>
</div>
</body>

View File

@ -2,6 +2,9 @@
* @file The entry point for the web extension singleton process.
*/
// this needs to run before anything else
require('./lib/setupFetchDebugging')()
const urlUtil = require('url')
const endOfStream = require('end-of-stream')
const pump = require('pump')
@ -406,6 +409,7 @@ function setupController (initState, initLangCode) {
controller.txController.on('update:badge', updateBadge)
controller.messageManager.on('updateBadge', updateBadge)
controller.personalMessageManager.on('updateBadge', updateBadge)
controller.typedMessageManager.on('updateBadge', updateBadge)
/**
* Updates the Web Extension's "badge" number, on the little fox in the toolbar.
@ -467,10 +471,3 @@ function showWatchAssetUi () {
}
)
}
// On first install, open a window to MetaMask website to how-it-works.
extension.runtime.onInstalled.addListener(function (details) {
if ((details.reason === 'install') && (!METAMASK_DEBUG)) {
extension.tabs.create({url: 'https://metamask.io/#how-it-works'})
}
})

View File

@ -1,6 +1,7 @@
const fs = require('fs')
const path = require('path')
const pump = require('pump')
const querystring = require('querystring')
const LocalMessageDuplexStream = require('post-message-stream')
const PongStream = require('ping-pong-stream/pong')
const ObjectMultiplex = require('obj-multiplex')
@ -134,17 +135,22 @@ function doctypeCheck () {
}
/**
* Checks the current document extension
* Returns whether or not the extension (suffix) of the current document is prohibited
*
* @returns {boolean} {@code true} if the current extension is not prohibited
* This checks {@code window.location.pathname} against a set of file extensions
* that should not have web3 injected into them. This check is indifferent of query parameters
* in the location.
*
* @returns {boolean} whether or not the extension of the current document is prohibited
*/
function suffixCheck () {
var prohibitedTypes = ['xml', 'pdf']
var currentUrl = window.location.href
var currentRegex
const prohibitedTypes = [
/\.xml$/,
/\.pdf$/,
]
const currentUrl = window.location.pathname
for (let i = 0; i < prohibitedTypes.length; i++) {
currentRegex = new RegExp(`\\.${prohibitedTypes[i]}$`)
if (currentRegex.test(currentUrl)) {
if (prohibitedTypes[i].test(currentUrl)) {
return false
}
}
@ -199,5 +205,8 @@ function blacklistedDomainCheck () {
function redirectToPhishingWarning () {
console.log('Nifty Wallet - routing to Phishing Warning component')
const extensionURL = extension.runtime.getURL('phishing.html')
window.location.href = extensionURL
window.location.href = `${extensionURL}#${querystring.stringify({
hostname: window.location.hostname,
href: window.location.href,
})}`
}

View File

@ -29,6 +29,7 @@ class BlacklistController {
constructor (opts = {}) {
const initState = extend({
phishing: PHISHING_DETECTION_CONFIG,
whitelist: [],
}, opts.initState)
this.store = new ObservableStore(initState)
// phishing detector
@ -38,6 +39,21 @@ class BlacklistController {
this._phishingUpdateIntervalRef = null
}
/**
* Adds the given hostname to the runtime whitelist
* @param {string} hostname the hostname to whitelist
*/
whitelistDomain (hostname) {
if (!hostname) {
return
}
const { whitelist } = this.store.getState()
this.store.updateState({
whitelist: [...new Set([hostname, ...whitelist])],
})
}
/**
* Given a url, returns the result of checking if that url is in the store.phishing blacklist
*
@ -48,6 +64,12 @@ class BlacklistController {
*/
checkForPhishing (hostname) {
if (!hostname) return false
const { whitelist } = this.store.getState()
if (whitelist.some((e) => e === hostname)) {
return false
}
const { result } = this._phishingDetector.check(hostname)
return result
}

View File

@ -1,5 +1,6 @@
const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware')
const createBlockReEmitMiddleware = require('eth-json-rpc-middleware/block-reemit')
const createBlockReRefMiddleware = require('eth-json-rpc-middleware/block-ref')
const createRetryOnEmptyMiddleware = require('eth-json-rpc-middleware/retryOnEmpty')
const createBlockCacheMiddleware = require('eth-json-rpc-middleware/block-cache')
const createInflightMiddleware = require('eth-json-rpc-middleware/inflight-cache')
const createBlockTrackerInspectorMiddleware = require('eth-json-rpc-middleware/block-tracker-inspector')
@ -11,13 +12,14 @@ module.exports = createInfuraClient
function createInfuraClient ({ network }) {
const infuraMiddleware = createInfuraMiddleware({ network })
const blockProvider = providerFromMiddleware(infuraMiddleware)
const blockTracker = new BlockTracker({ provider: blockProvider })
const infuraProvider = providerFromMiddleware(infuraMiddleware)
const blockTracker = new BlockTracker({ provider: infuraProvider })
const networkMiddleware = mergeMiddleware([
createBlockCacheMiddleware({ blockTracker }),
createInflightMiddleware(),
createBlockReEmitMiddleware({ blockTracker, provider: blockProvider }),
createBlockReRefMiddleware({ blockTracker, provider: infuraProvider }),
createRetryOnEmptyMiddleware({ blockTracker, provider: infuraProvider }),
createBlockTrackerInspectorMiddleware({ blockTracker }),
infuraMiddleware,
])

View File

@ -1,6 +1,6 @@
const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware')
const createFetchMiddleware = require('eth-json-rpc-middleware/fetch')
const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-ref')
const createBlockRefRewriteMiddleware = require('eth-json-rpc-middleware/block-ref-rewrite')
const createBlockCacheMiddleware = require('eth-json-rpc-middleware/block-cache')
const createInflightMiddleware = require('eth-json-rpc-middleware/inflight-cache')
const createBlockTrackerInspectorMiddleware = require('eth-json-rpc-middleware/block-tracker-inspector')
@ -15,7 +15,7 @@ function createJsonRpcClient ({ rpcUrl }) {
const blockTracker = new BlockTracker({ provider: blockProvider })
const networkMiddleware = mergeMiddleware([
createBlockRefMiddleware({ blockTracker }),
createBlockRefRewriteMiddleware({ blockTracker }),
createBlockCacheMiddleware({ blockTracker }),
createInflightMiddleware(),
createBlockTrackerInspectorMiddleware({ blockTracker }),

View File

@ -1,6 +1,6 @@
const mergeMiddleware = require('json-rpc-engine/src/mergeMiddleware')
const createFetchMiddleware = require('eth-json-rpc-middleware/fetch')
const createBlockRefMiddleware = require('eth-json-rpc-middleware/block-ref')
const createBlockRefRewriteMiddleware = require('eth-json-rpc-middleware/block-ref-rewrite')
const createBlockTrackerInspectorMiddleware = require('eth-json-rpc-middleware/block-tracker-inspector')
const providerFromMiddleware = require('eth-json-rpc-middleware/providerFromMiddleware')
const BlockTracker = require('eth-block-tracker')
@ -13,7 +13,7 @@ function createLocalhostClient () {
const blockTracker = new BlockTracker({ provider: blockProvider, pollingInterval: 1000 })
const networkMiddleware = mergeMiddleware([
createBlockRefMiddleware({ blockTracker }),
createBlockRefRewriteMiddleware({ blockTracker }),
createBlockTrackerInspectorMiddleware({ blockTracker }),
fetchMiddleware,
])

View File

@ -38,6 +38,6 @@ function createPendingNonceMiddleware ({ getPendingNonce }) {
const address = req.params[0]
const blockRef = req.params[1]
if (blockRef !== 'pending') return next()
req.result = await getPendingNonce(address)
res.result = await getPendingNonce(address)
})
}

View File

@ -38,6 +38,9 @@ class PreferencesController {
lostIdentities: {},
seedWords: null,
forgottenPassword: false,
preferences: {
useETHAsPrimaryCurrency: true,
},
}, opts.initState)
this.diagnostics = opts.diagnostics
@ -376,11 +379,12 @@ class PreferencesController {
* Gets an updated rpc list from this.addToFrequentRpcList() and sets the `frequentRpcList` to this update list.
*
* @param {string} _url The the new rpc url to add to the updated list
* @param {bool} remove Remove selected url
* @returns {Promise<void>} Promise resolves with undefined
*
*/
updateFrequentRpcList (_url) {
return this.addToFrequentRpcList(_url)
updateFrequentRpcList (_url, remove = false) {
return this.addToFrequentRpcList(_url, remove)
.then((rpcList) => {
this.store.updateState({ frequentRpcList: rpcList })
return Promise.resolve()
@ -406,16 +410,17 @@ class PreferencesController {
* The returned list will have an unlimited length. The current list is modified and returned as a promise.
*
* @param {string} _url The rpc url to add to the frequentRpcList.
* @param {bool} remove Remove selected url
* @returns {Promise<array>} The updated frequentRpcList.
*
*/
addToFrequentRpcList (_url) {
addToFrequentRpcList (_url, remove = false) {
const rpcList = this.getFrequentRpcList()
const index = rpcList.findIndex((element) => { return element === _url })
if (index !== -1) {
rpcList.splice(index, 1)
}
if (_url !== 'http://localhost:8545') {
if (!remove && _url !== 'http://localhost:8545') {
rpcList.push(_url)
}
return Promise.resolve(rpcList)
@ -476,6 +481,33 @@ class PreferencesController {
getFeatureFlags () {
return this.store.getState().featureFlags
}
/**
* Updates the `preferences` property, which is an object. These are user-controlled features
* found in the settings page.
* @param {string} preference The preference to enable or disable.
* @param {boolean} value Indicates whether or not the preference should be enabled or disabled.
* @returns {Promise<object>} Promises a new object; the updated preferences object.
*/
setPreference (preference, value) {
const currentPreferences = this.getPreferences()
const updatedPreferences = {
...currentPreferences,
[preference]: value,
}
this.store.updateState({ preferences: updatedPreferences })
return Promise.resolve(updatedPreferences)
}
/**
* A getter for the `preferences` property
* @returns {object} A key-boolean map of user-selected preferences.
*/
getPreferences () {
return this.store.getState().preferences
}
//
// PRIVATE METHODS
//

View File

@ -18,7 +18,7 @@ const {
TRANSACTION_STATUS_APPROVED,
} = require('./enums')
const { hexToBn, bnToHex } = require('../../lib/util')
const { hexToBn, bnToHex, BnMultiplyByFraction } = require('../../lib/util')
/**
Transaction Controller is an aggregate of sub-controllers and trackers
@ -166,6 +166,10 @@ class TransactionController extends EventEmitter {
async addUnapprovedTransaction (txParams) {
// validate
const normalizedTxParams = txUtils.normalizeTxParams(txParams)
// Assert the from address is the selected address
if (normalizedTxParams.from !== this.getSelectedAddress()) {
throw new Error(`Transaction from address isn't valid for this account`)
}
txUtils.validateTxParams(normalizedTxParams)
// construct txMeta
let txMeta = this.txStateManager.generateTxMeta({
@ -244,7 +248,8 @@ class TransactionController extends EventEmitter {
const originalTxMeta = this.txStateManager.getTx(originalTxId)
const { txParams } = originalTxMeta
const { gasPrice: lastGasPrice, from, nonce } = txParams
const newGasPrice = customGasPrice || bnToHex(hexToBn(lastGasPrice).mul(1.1))
const newGasPrice = customGasPrice || bnToHex(BnMultiplyByFraction(hexToBn(lastGasPrice), 11, 10))
const newTxMeta = this.txStateManager.generateTxMeta({
txParams: {
from,
@ -361,7 +366,40 @@ class TransactionController extends EventEmitter {
this.txStateManager.setTxStatusSubmitted(txId)
}
confirmTransaction (txId) {
/**
* Sets the status of the transaction to confirmed and sets the status of nonce duplicates as
* dropped if the txParams have data it will fetch the txReceipt
* @param {number} txId - The tx's ID
* @returns {Promise<void>}
*/
async confirmTransaction (txId) {
// get the txReceipt before marking the transaction confirmed
// to ensure the receipt is gotten before the ui revives the tx
const txMeta = this.txStateManager.getTx(txId)
if (!txMeta) {
return
}
try {
const txReceipt = await this.query.getTransactionReceipt(txMeta.hash)
// It seems that sometimes the numerical values being returned from
// this.query.getTransactionReceipt are BN instances and not strings.
const gasUsed = typeof txReceipt.gasUsed !== 'string'
? txReceipt.gasUsed.toString(16)
: txReceipt.gasUsed
txMeta.txReceipt = {
...txReceipt,
gasUsed,
}
this.txStateManager.updateTx(txMeta, 'transactions#confirmTransaction - add txReceipt')
} catch (err) {
log.error(err)
}
this.txStateManager.setTxStatusConfirmed(txId)
this._markNonceDuplicatesDropped(txId)
}
@ -529,6 +567,7 @@ class TransactionController extends EventEmitter {
Updates the memStore in transaction controller
*/
_updateMemstore () {
this.pendingTxTracker.updatePendingTxs()
const unapprovedTxs = this.txStateManager.getUnapprovedTxList()
const selectedAddressTxList = this.txStateManager.getFilteredTxList({
from: this.getSelectedAddress(),

View File

@ -400,6 +400,11 @@ class TransactionStateManager extends EventEmitter {
*/
_setTxStatus (txId, status) {
const txMeta = this.getTx(txId)
if (!txMeta) {
return
}
txMeta.status = status
setTimeout(() => {
try {

View File

@ -5,10 +5,16 @@ const log = require('loglevel')
const LocalMessageDuplexStream = require('post-message-stream')
const setupDappAutoReload = require('./lib/auto-reload.js')
const MetamaskInpageProvider = require('metamask-inpage-provider')
restoreContextAfterImports()
log.setDefaultLevel(process.env.METAMASK_DEBUG ? 'debug' : 'warn')
console.warn('ATTENTION: In an effort to improve user privacy, MetaMask will ' +
'stop exposing user accounts to dapps by default beginning November 2nd, 2018. ' +
'Dapps should call provider.enable() in order to view and use accounts. Please see ' +
'https://bit.ly/2QQHXvF for complete information and up-to-date example code.')
//
// setup plugin communication
//
@ -21,6 +27,8 @@ var metamaskStream = new LocalMessageDuplexStream({
// compose the inpage provider
var inpageProvider = new MetamaskInpageProvider(metamaskStream)
// set a high max listener count to avoid unnecesary warnings
inpageProvider.setMaxListeners(100)
// Augment the provider with its enable method
inpageProvider.enable = function (options = {}) {
@ -39,7 +47,15 @@ inpageProvider.enable = function (options = {}) {
})
}
window.ethereum = inpageProvider
// Work around for web3@1.0 deleting the bound `sendAsync` but not the unbound
// `sendAsync` method on the prototype, causing `this` reference issues with drizzle
const proxiedInpageProvider = new Proxy(inpageProvider, {
// straight up lie that we deleted the property so that it doesnt
// throw an error in strict mode
deleteProperty: () => true,
})
window.ethereum = proxiedInpageProvider
//
// setup web3

View File

@ -2,18 +2,12 @@ module.exports = setupDappAutoReload
function setupDappAutoReload (web3, observable) {
// export web3 as a global, checking for usage
let hasBeenWarned = false
let reloadInProgress = false
let lastTimeUsed
let lastSeenNetwork
global.web3 = new Proxy(web3, {
get: (_web3, key) => {
// show warning once on web3 access
if (!hasBeenWarned && key !== 'currentProvider') {
console.warn('MetaMask: web3 will be deprecated in the near future in favor of the ethereumProvider \nhttps://github.com/MetaMask/faq/blob/master/detecting_metamask.md#web3-deprecation')
hasBeenWarned = true
}
// get the time of use
lastTimeUsed = Date.now()
// return value normally

View File

@ -31,7 +31,7 @@ function getBuyEthUrl ({ network, amount, address, exchange }) {
break
case '77':
url = 'https://faucet-sokol.herokuapp.com/'
url = 'https://faucet.poa.network/'
break
case '99': {

View File

@ -5,6 +5,8 @@ module.exports = function (provider) {
function ipfsContent (details) {
const name = details.url.substring(7, details.url.length - 1)
let clearTime = null
if (/^.+\.eth$/.test(name) === false) return
extension.tabs.query({active: true}, tab => {
extension.tabs.update(tab.id, { url: 'loading.html' })
@ -34,7 +36,7 @@ module.exports = function (provider) {
return { cancel: true }
}
extension.webRequest.onErrorOccurred.addListener(ipfsContent, {urls: ['*://*.eth/']})
extension.webRequest.onErrorOccurred.addListener(ipfsContent, {urls: ['*://*.eth/'], types: ['main_frame']})
return {
remove () {

View File

@ -272,6 +272,6 @@ function normalizeMsgData (data) {
return data
} else {
// data is unicode, convert to hex
return ethUtil.bufferToHex(new Buffer(data, 'utf8'))
return ethUtil.bufferToHex(Buffer.from(data, 'utf8'))
}
}

View File

@ -285,7 +285,7 @@ module.exports = class PersonalMessageManager extends EventEmitter {
log.debug(`Message was not hex encoded, interpreting as utf8.`)
}
return ethUtil.bufferToHex(new Buffer(data, 'utf8'))
return ethUtil.bufferToHex(Buffer.from(data, 'utf8'))
}
}

View File

@ -0,0 +1,34 @@
module.exports = setupFetchDebugging
//
// This is a utility to help resolve cases where `window.fetch` throws a
// `TypeError: Failed to Fetch` without any stack or context for the request
// https://github.com/getsentry/sentry-javascript/pull/1293
//
function setupFetchDebugging () {
if (!global.fetch) return
const originalFetch = global.fetch
global.fetch = wrappedFetch
async function wrappedFetch (...args) {
const initialStack = getCurrentStack()
try {
return await originalFetch.call(window, ...args)
} catch (err) {
console.warn('FetchDebugger - fetch encountered an Error', err)
console.warn('FetchDebugger - overriding stack to point of original call')
err.stack = initialStack
throw err
}
}
}
function getCurrentStack () {
try {
throw new Error('Fake error for generating stack trace')
} catch (err) {
return err.stack
}
}

View File

@ -15,6 +15,7 @@ const RpcEngine = require('json-rpc-engine')
const debounce = require('debounce')
const createEngineStream = require('json-rpc-middleware-stream/engineStream')
const createFilterMiddleware = require('eth-json-rpc-filters')
const createSubscriptionManager = require('eth-json-rpc-filters/subscriptionManager')
const createOriginMiddleware = require('./lib/createOriginMiddleware')
const createLoggerMiddleware = require('./lib/createLoggerMiddleware')
const createProviderMiddleware = require('./lib/createProviderMiddleware')
@ -128,6 +129,7 @@ module.exports = class MetamaskController extends EventEmitter {
provider: this.provider,
blockTracker: this.blockTracker,
})
// start and stop polling for balances based on activeControllerConnections
this.on('controllerConnectionChanged', (activeControllerConnections) => {
if (activeControllerConnections > 0) {
@ -137,6 +139,11 @@ module.exports = class MetamaskController extends EventEmitter {
}
})
// ensure accountTracker updates balances after network change
this.networkController.on('networkDidChange', () => {
this.accountTracker._updateAccounts()
})
// key mgmt
const additionalKeyrings = [TrezorKeyring, LedgerBridgeKeyring]
this.keyringController = new KeyringController({
@ -252,6 +259,7 @@ module.exports = class MetamaskController extends EventEmitter {
eth_syncing: false,
web3_clientVersion: `MetaMask/v${version}`,
},
version,
// account mgmt
getAccounts: async () => {
const isUnlocked = this.keyringController.memStore.getState().isUnlocked
@ -268,6 +276,7 @@ module.exports = class MetamaskController extends EventEmitter {
// msg signing
processEthSignMessage: this.newUnsignedMessage.bind(this),
processPersonalMessage: this.newUnsignedPersonalMessage.bind(this),
getPendingNonce: this.getPendingNonce.bind(this),
}
const providerProxy = this.networkController.initializeProvider(providerOpts)
return providerProxy
@ -376,6 +385,7 @@ module.exports = class MetamaskController extends EventEmitter {
// network management
setProviderType: nodeify(networkController.setProviderType, networkController),
setCustomRpc: nodeify(this.setCustomRpc, this),
delCustomRpc: nodeify(this.delCustomRpc, this),
// PreferencesController
setSelectedAddress: nodeify(preferencesController.setSelectedAddress, preferencesController),
@ -386,6 +396,10 @@ module.exports = class MetamaskController extends EventEmitter {
setCurrentAccountTab: nodeify(preferencesController.setCurrentAccountTab, preferencesController),
setAccountLabel: nodeify(preferencesController.setAccountLabel, preferencesController),
setFeatureFlag: nodeify(preferencesController.setFeatureFlag, preferencesController),
setPreference: nodeify(preferencesController.setPreference, preferencesController),
// BlacklistController
whitelistPhishingDomain: this.whitelistPhishingDomain.bind(this),
// AddressController
setAddressBook: nodeify(addressBookController.setAddressBook, addressBookController),
@ -552,6 +566,8 @@ module.exports = class MetamaskController extends EventEmitter {
}
await this.preferencesController.syncAddresses(accounts)
await this.balancesController.updateAllBalances()
await this.txController.pendingTxTracker.updatePendingTxs()
return this.keyringController.fullUpdate()
}
@ -1247,24 +1263,33 @@ module.exports = class MetamaskController extends EventEmitter {
setupProviderConnection (outStream, origin) {
// setup json rpc engine stack
const engine = new RpcEngine()
const provider = this.provider
const blockTracker = this.blockTracker
// create filter polyfill middleware
const filterMiddleware = createFilterMiddleware({
provider: this.provider,
blockTracker: this.blockTracker,
})
const filterMiddleware = createFilterMiddleware({ provider, blockTracker })
// create subscription polyfill middleware
const subscriptionManager = createSubscriptionManager({ provider, blockTracker })
subscriptionManager.events.on('notification', (message) => engine.emit('notification', message))
// metadata
engine.push(createOriginMiddleware({ origin }))
engine.push(createLoggerMiddleware({ origin }))
// filter and subscription polyfills
engine.push(filterMiddleware)
engine.push(subscriptionManager.middleware)
// watch asset
engine.push(this.preferencesController.requestWatchAsset.bind(this.preferencesController))
// sign typed data middleware
engine.push(this.createTypedDataMiddleware('eth_signTypedData', 'V1').bind(this))
engine.push(this.createTypedDataMiddleware('eth_signTypedData_v1', 'V1').bind(this))
engine.push(this.createTypedDataMiddleware('eth_signTypedData_v3', 'V3').bind(this))
engine.push(createProviderMiddleware({ provider: this.provider }))
engine.push(this.createTypedDataMiddleware('eth_signTypedData_v3', 'V3', true).bind(this))
// forward to metamask primary provider
engine.push(createProviderMiddleware({ provider }))
// setup connection
const providerStream = createEngineStream({ engine })
pump(
outStream,
providerStream,
@ -1368,11 +1393,24 @@ module.exports = class MetamaskController extends EventEmitter {
})
.map(number => number.div(GWEI_BN).toNumber())
const percentileNum = percentile(50, lowestPrices)
const percentileNum = percentile(65, lowestPrices)
const percentileNumBn = new BN(percentileNum)
return '0x' + percentileNumBn.mul(GWEI_BN).toString(16)
}
/**
* Returns the nonce that will be associated with a transaction once approved
* @param address {string} - The hex string address for the transaction
* @returns Promise<number>
*/
async getPendingNonce (address) {
const { nonceDetails, releaseLock} = await this.txController.nonceTracker.getNonceLock(address)
const pendingNonce = nonceDetails.params.highestSuggested
releaseLock()
return pendingNonce
}
//=============================================================================
// CONFIG
//=============================================================================
@ -1456,6 +1494,14 @@ module.exports = class MetamaskController extends EventEmitter {
return rpcTarget
}
/**
* A method for deleting a selected custom URL.
* @param {string} rpcTarget - A RPC URL to delete.
*/
async delCustomRpc (rpcTarget) {
await this.preferencesController.updateFrequentRpcList(rpcTarget, true)
}
/**
* Sets whether or not to use the blockie identicon format.
* @param {boolean} val - True for bockie, false for jazzicon.
@ -1528,13 +1574,13 @@ module.exports = class MetamaskController extends EventEmitter {
* @param {Function} - next
* @param {Function} - end
*/
createTypedDataMiddleware (methodName, version) {
createTypedDataMiddleware (methodName, version, reverse) {
return async (req, res, next, end) => {
const { method, params } = req
if (method === methodName) {
const promise = this.typedMessageManager.addUnapprovedMessageAsync({
data: params.length >= 1 && params[0],
from: params.length >= 2 && params[1],
data: reverse ? params[1] : params[0],
from: reverse ? params[0] : params[1],
}, req, version)
this.sendUpdate()
this.opts.showUnconfirmedMessage()
@ -1549,4 +1595,12 @@ module.exports = class MetamaskController extends EventEmitter {
}
}
}
/**
* Adds a domain to the {@link BlacklistController} whitelist
* @param {string} hostname the domain to whitelist
*/
whitelistPhishingDomain (hostname) {
return this.blacklistController.whitelistDomain(hostname)
}
}

View File

@ -0,0 +1,59 @@
window.onload = function () {
if (window.location.pathname === '/phishing.html') {
const {hostname} = parseHash()
document.getElementById('esdbLink').innerHTML = '<b>To read more about this scam, navigate to: <a href="https://etherscamdb.info/domain/' + hostname + '"> https://etherscamdb.info/domain/' + hostname + '</a></b>'
}
}
const querystring = require('querystring')
const dnode = require('dnode')
const { EventEmitter } = require('events')
const PortStream = require('extension-port-stream')
const extension = require('extensionizer')
const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex
const { getEnvironmentType } = require('./lib/util')
const ExtensionPlatform = require('./platforms/extension')
document.addEventListener('DOMContentLoaded', start)
function start () {
const windowType = getEnvironmentType(window.location.href)
global.platform = new ExtensionPlatform()
global.METAMASK_UI_TYPE = windowType
const extensionPort = extension.runtime.connect({ name: windowType })
const connectionStream = new PortStream(extensionPort)
const mx = setupMultiplex(connectionStream)
setupControllerConnection(mx.createStream('controller'), (err, metaMaskController) => {
if (err) {
return
}
const suspect = parseHash()
const unsafeContinue = () => {
window.location.href = suspect.href
}
const continueLink = document.getElementById('unsafe-continue')
continueLink.addEventListener('click', () => {
metaMaskController.whitelistPhishingDomain(suspect.hostname)
unsafeContinue()
})
})
}
function setupControllerConnection (connectionStream, cb) {
const eventEmitter = new EventEmitter()
const accountManagerDnode = dnode({
sendUpdate (state) {
eventEmitter.emit('update', state)
},
})
connectionStream.pipe(accountManagerDnode).pipe(connectionStream)
accountManagerDnode.once('remote', (accountManager) => cb(null, accountManager))
}
function parseHash () {
const hash = window.location.hash.substring(1)
return querystring.parse(hash)
}

View File

@ -14,21 +14,27 @@ async function start () {
const versionAlreadyExists = await checkIfVersionExists()
// abort if versions exists
if (versionAlreadyExists) {
console.log(`Version "${VERSION}" already exists on Sentry, aborting sourcemap upload.`)
return
console.log(`Version "${VERSION}" already exists on Sentry, skipping version creation`)
} else {
// create sentry release
console.log(`creating Sentry release for "${VERSION}"...`)
await exec(`sentry-cli releases --org 'poa-network' --project 'nifty-wallet' new ${VERSION}`)
console.log(`removing any existing files from Sentry release "${VERSION}"...`)
await exec(`sentry-cli releases --org 'poa-network' --project 'nifty-wallet' files ${VERSION} delete --all`)
}
// create sentry release
console.log(`creating Sentry release for "${VERSION}"...`)
await exec(`sentry-cli releases --org 'poa-network' --project 'nifty-wallet' new ${VERSION}`)
console.log(`removing any existing files from Sentry release "${VERSION}"...`)
await exec(`sentry-cli releases --org 'poa-network' --project 'nifty-wallet' files ${VERSION} delete --all`)
// upload sentry source and sourcemaps
console.log(`uploading source files Sentry release "${VERSION}"...`)
await exec(`for FILEPATH in ./dist/chrome/*.js; do [ -e $FILEPATH ] || continue; export FILE=\`basename $FILEPATH\` && echo uploading $FILE && sentry-cli releases --org 'poa-network' --project 'nifty-wallet' files ${VERSION} upload $FILEPATH metamask/$FILE; done;`)
console.log(`uploading sourcemaps Sentry release "${VERSION}"...`)
await exec(`sentry-cli releases --org 'poa-network' --project 'nifty-wallet' files ${VERSION} upload-sourcemaps ./dist/sourcemaps/ --url-prefix 'sourcemaps'`)
console.log('all done!')
// check if version has artifacts or not
const versionHasArtifacts = versionAlreadyExists && await checkIfVersionHasArtifacts()
if (!versionHasArtifacts) {
// upload sentry source and sourcemaps
console.log(`uploading source files Sentry release "${VERSION}"...`)
await exec(`for FILEPATH in ./dist/chrome/*.js; do [ -e $FILEPATH ] || continue; export FILE=\`basename $FILEPATH\` && echo uploading $FILE && sentry-cli releases --org 'poa-network' --project 'nifty-wallet' files ${VERSION} upload $FILEPATH metamask/$FILE; done;`)
console.log(`uploading sourcemaps Sentry release "${VERSION}"...`)
await exec(`sentry-cli releases --org 'poa-network' --project 'nifty-wallet' files ${VERSION} upload-sourcemaps ./dist/sourcemaps/ --url-prefix 'sourcemaps'`)
console.log('all done!')
} else {
console.log(`Version "${VERSION}" already has artifacts on Sentry, skipping sourcemap upload`)
}
}
async function checkIfAuthWorks () {
@ -45,6 +51,12 @@ async function checkIfVersionExists () {
return versionAlreadyExists
}
async function checkIfVersionHasArtifacts () {
const artifacts = await exec(`sentry-cli releases --org 'metamask' --project 'metamask' files ${VERSION} list`)
// When there's no artifacts, we get a response from the shell like this ['', '']
return artifacts[0] && artifacts[0].length > 0
}
async function doesNotFail (asyncFn) {
try {
await asyncFn()

View File

@ -108,7 +108,10 @@
"editingTransactionId": null
},
"currentLocale": "en",
"currentAccountTab": "tokens"
"currentAccountTab": "tokens",
"preferences": {
"useETHAsPrimaryCurrency": true
}
},
"appState": {
"menuOpen": false,

View File

@ -150,7 +150,10 @@
"maxModeOn": false,
"editingTransactionId": null
},
"currentLocale": "en"
"currentLocale": "en",
"preferences": {
"useETHAsPrimaryCurrency": true
}
},
"appState": {
"menuOpen": false,

View File

@ -108,7 +108,10 @@
"maxModeOn": false,
"editingTransactionId": null
},
"currentLocale": "en"
"currentLocale": "en",
"preferences": {
"useETHAsPrimaryCurrency": true
}
},
"appState": {
"menuOpen": false,

View File

@ -37,7 +37,10 @@
"shapeShiftTxList": [],
"lostAccounts": [],
"tokens": [],
"currentLocale": "en"
"currentLocale": "en",
"preferences": {
"useETHAsPrimaryCurrency": true
}
},
"appState": {
"menuOpen": false,

View File

@ -109,7 +109,10 @@
"maxModeOn": false,
"editingTransactionId": null
},
"currentLocale": "en"
"currentLocale": "en",
"preferences": {
"useETHAsPrimaryCurrency": true
}
},
"appState": {
"menuOpen": false,

View File

@ -102,7 +102,10 @@
"shapeShiftTxList": [{"depositAddress":"34vJ3AfmNcLiziA4VFgEVcQTwxVLD1qkke","depositType":"BTC","key":"shapeshift","response":{"status":"no_deposits","address":"34vJ3AfmNcLiziA4VFgEVcQTwxVLD1qkke"},"time":1522377459106}],
"lostAccounts": [],
"send": {},
"currentLocale": "en"
"currentLocale": "en",
"preferences": {
"useETHAsPrimaryCurrency": true
}
},
"appState": {
"menuOpen": false,

View File

@ -20,7 +20,7 @@ const specifiedLocale = process.argv[2]
if (specifiedLocale) {
console.log(`Verifying selected locale "${specifiedLocale}":\n\n`)
const locale = localeIndex.find(localeMeta => localeMeta.code === specifiedLocale)
verifyLocale({ locale })
verifyLocale(locale)
} else {
console.log('Verifying all locales:\n\n')
localeIndex.forEach(localeMeta => {
@ -30,11 +30,10 @@ if (specifiedLocale) {
}
function verifyLocale ({ localeMeta }) {
function verifyLocale (localeMeta) {
const localeCode = localeMeta.code
const localeName = localeMeta.name
let targetLocale, englishLocale
try {
const localeFilePath = path.join(process.cwd(), 'app', '_locales', localeCode, 'messages.json')
targetLocale = JSON.parse(fs.readFileSync(localeFilePath, 'utf8'))

View File

@ -21,7 +21,7 @@ The core functionality of MetaMask all lives in what we call [The MetaMask Contr
When calling `new MetaMask(opts)`, many platform-specific options are configured. The keys on `opts` are as follows:
- initState: The last emitted state, used for restoring persistent state between sessions.
- platform: The `platform` object defines a variety of platform-specific functions, including opening the confirmation view, and opening web sites.
- platform: The `platform` object defines a variety of platform-specific functions, including opening the confirmation view, and opening websites.
- encryptor - An object that provides access to the desired encryption methods.
##### Encryptor
@ -97,5 +97,5 @@ If streams seem new and confusing to you, that's ok, they can seem strange at fi
## Conclusion
I hope this has been helpful to you! If you have any other questionsm, or points you think need clarification in this guide, please [open an issue on our GitHub](https://github.com/MetaMask/metamask-plugin/issues/new)!
I hope this has been helpful to you! If you have any other questions, or points you think need clarification in this guide, please [open an issue on our GitHub](https://github.com/MetaMask/metamask-plugin/issues/new)!

View File

@ -11,5 +11,5 @@ To take a state dump, follow these steps:
3. In case it isn't already selected, click the "Console" tab in the new Developer Tools window.
4. In the console, type this command exactly: `logState()`. This should print a bunch of JSON text into your console.
5. Copy that printed JSON text
6. *Optional*: Annonymize that text if you'd like (you may change all instances of an account address to another valid account address, for example) We may automate the anonymization in the future.
6. *Optional*: Anonymize that text if you'd like (you may change all instances of an account address to another valid account address, for example) We may automate the anonymization in the future.
7. Send that JSON text to the developer, ideally pasting it in the issue regarding the bug.

View File

@ -8,7 +8,7 @@ The MetaMask browser extension supports new translations added in the form of ne
- Each supported language is represented by a folder in `app/_locales` whose name is that language's subtag (example: `app/_locales/es/`). (look up a language subtag using the [r12a "Find" tool](https://r12a.github.io/app-subtags/) or this [wikipedia list](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)).
- Inside that folder there should be a `messages.json`.
- An easy way to start your translation is to first **make a copy** of `app/_locales/en/messages.json` (the english translation), and then **translate the `message` key** for each in-app message.
- An easy way to start your translation is to first **make a copy** of `app/_locales/en/messages.json` (the English translation), and then **translate the `message` key** for each in-app message.
- **The `description` key** is just to add context for what the translation is about, it **does not need to be translated**.
- Add the language to the [locales index](https://github.com/MetaMask/metamask-extension/blob/master/app/_locales/index.json) `app/_locales/index.json`

View File

@ -233,11 +233,12 @@ function createScssBuildTask ({ src, dest, devMode, pattern }) {
await endOfStream(stream)
livereload.changed(event.path)
})
return buildScssWithSourceMaps()
}
return buildScss()
}
function buildScss () {
function buildScssWithSourceMaps () {
return gulp.src(src)
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
@ -245,6 +246,13 @@ function createScssBuildTask ({ src, dest, devMode, pattern }) {
.pipe(autoprefixer())
.pipe(gulp.dest(dest))
}
function buildScss () {
return gulp.src(src)
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer())
.pipe(gulp.dest(dest))
}
}
gulp.task('lint-scss', function () {
@ -271,6 +279,7 @@ const buildJsFiles = [
'contentscript',
'background',
'ui',
'phishing-detect',
]
// bundle tasks

View File

@ -17,6 +17,12 @@
font-family: Roboto;
}
@media screen and (min-height: 601px) {
.first-time-flow {
height: 100vh;
}
}
.alpha-warning__container {
display: flex;
justify-content: center;

227
package-lock.json generated
View File

@ -5189,7 +5189,7 @@
},
"chromedriver": {
"version": "2.36.0",
"resolved": "https://registry.npmjs.org/chromedriver/-/chromedriver-2.36.0.tgz",
"resolved": "http://registry.npmjs.org/chromedriver/-/chromedriver-2.36.0.tgz",
"integrity": "sha512-Lq2HrigCJ4RVdIdCmchenv1rVrejNSJ7EUCQojycQo12ww3FedQx4nb+GgTdqMhjbOMTqq5+ziaiZlrEN2z1gQ==",
"dev": true,
"requires": {
@ -7455,12 +7455,6 @@
"domelementtype": "1"
}
},
"dot-only-hunter": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/dot-only-hunter/-/dot-only-hunter-1.0.3.tgz",
"integrity": "sha1-9k0h7b5v8xFJlfEGGmGpNcMAIEs=",
"dev": true
},
"dotenv": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz",
@ -8326,11 +8320,46 @@
"integrity": "sha512-IuK5Iowfs6taluA/3Okmu6EfZcFMq6MQuyrUL1PrCoJstuuBr3TvVeSy3keDyxfbrjFB34nCo538I8G+qMtsbw==",
"requires": {
"cross-fetch": "^2.1.1",
"eth-json-rpc-middleware": "^1.5.0",
"json-rpc-engine": "^3.4.0",
"json-rpc-error": "^2.0.0",
"tape": "^4.8.0"
}
},
"eth-json-rpc-middleware": {
"version": "1.6.0",
"resolved": "http://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-1.6.0.tgz",
"integrity": "sha512-tDVCTlrUvdqHKqivYMjtFZsdD7TtpNLBCfKAcOpaVs7orBMS/A8HWro6dIzNtTZIR05FAbJ3bioFOnZpuCew9Q==",
"requires": {
"async": "^2.5.0",
"eth-query": "^2.1.2",
"eth-tx-summary": "^3.1.2",
"ethereumjs-block": "^1.6.0",
"ethereumjs-tx": "^1.3.3",
"ethereumjs-util": "^5.1.2",
"ethereumjs-vm": "^2.1.0",
"fetch-ponyfill": "^4.0.0",
"json-rpc-engine": "^3.6.0",
"json-rpc-error": "^2.0.0",
"json-stable-stringify": "^1.0.1",
"promise-to-callback": "^1.0.0",
"tape": "^4.6.3"
}
},
"ethereumjs-util": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz",
"integrity": "sha512-CJAKdI0wgMbQFLlLRtZKGcy/L6pzVRgelIZqRqNbuVFM3K9VEnyfbcvz0ncWMRNCe4kaHWjwRYQcYMucmwsnWA==",
"requires": {
"bn.js": "^4.11.0",
"create-hash": "^1.1.2",
"ethjs-util": "^0.1.3",
"keccak": "^1.0.2",
"rlp": "^2.0.0",
"safe-buffer": "^5.1.1",
"secp256k1": "^3.0.1"
}
},
"events": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz",
@ -8597,9 +8626,9 @@
}
},
"eth-json-rpc-middleware": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-2.6.0.tgz",
"integrity": "sha512-IziwA0IXzxCVgruvb0KzhypAdRNM6QBC6LOlXQrzr8ddo3in+PGzl9tMV79TGFoRoRfsysnjbvOKwMnQJADkIw==",
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/eth-json-rpc-middleware/-/eth-json-rpc-middleware-3.1.3.tgz",
"integrity": "sha512-glp/mCefhsqrgVOTTuYlHYiTL+9mMPfaZsuQv4vnRg3kqNigblS1nqARaMeVW9WOM8ssh9TqIFpuUr7JDgNmKQ==",
"dev": true,
"requires": {
"async": "^2.5.0",
@ -8628,6 +8657,7 @@
"integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=",
"dev": true,
"requires": {
"ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799",
"ethereumjs-util": "^5.1.1"
},
"dependencies": {
@ -8642,7 +8672,7 @@
}
},
"ethereumjs-abi": {
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#00ba8463a7f7a67fcad737ff9c2ebd95643427f7",
"version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#2863c40e0982acfc0b7163f0285d4c56427c7799",
"from": "git+https://github.com/ethereumjs/ethereumjs-abi.git",
"requires": {
"bn.js": "^4.10.0",
@ -10861,6 +10891,31 @@
"pend": "~1.2.0"
}
},
"fetch-mock": {
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/fetch-mock/-/fetch-mock-6.5.2.tgz",
"integrity": "sha512-EIvbpCLBTYyDLu4HJiqD7wC8psDwTUaPaWXNKZbhNO/peUYKiNp5PkZGKRJtnTxaPQu71ivqafvjpM7aL+MofQ==",
"dev": true,
"requires": {
"babel-polyfill": "^6.26.0",
"glob-to-regexp": "^0.4.0",
"path-to-regexp": "^2.2.1"
},
"dependencies": {
"glob-to-regexp": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.0.tgz",
"integrity": "sha512-fyPCII4vn9Gvjq2U/oDAfP433aiE64cyP/CJjRJcpVGjqqNdioUYn9+r0cSzT1XPwmGAHuTT7iv+rQT8u/YHKQ==",
"dev": true
},
"path-to-regexp": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.4.0.tgz",
"integrity": "sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w==",
"dev": true
}
}
},
"fetch-ponyfill": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz",
@ -17602,15 +17657,16 @@
}
},
"json-rpc-middleware-stream": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-rpc-middleware-stream/-/json-rpc-middleware-stream-1.0.1.tgz",
"integrity": "sha512-IR6cOO6B21NdLpiYblueB3O+g3UAYLIZd6ZgZfddVPl0z6vSECcpuiYnV5MmIMJY3D0fLYpJqOxYaEmLYQqTtA==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/json-rpc-middleware-stream/-/json-rpc-middleware-stream-2.1.0.tgz",
"integrity": "sha512-JxX+kbS9sDMHvnADFLlV/QtkgeIYVF/2R8UuxXaiZc7ntVEgi/lkzMGbGkDwdRg36rHnUIvCZk6zR/5Y3bAq1w==",
"requires": {
"end-of-stream": "^1.4.0",
"eth-block-tracker": "^2.1.2",
"ethjs-query": "^0.2.9",
"json-rpc-engine": "^3.0.1",
"readable-stream": "^2.3.3"
"json-rpc-engine": "^3.8.0",
"readable-stream": "^2.3.3",
"safe-event-emitter": "^1.0.1"
},
"dependencies": {
"async-eventemitter": {
@ -17620,11 +17676,6 @@
"async": "^2.4.0"
}
},
"bn.js": {
"version": "4.11.6",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz",
"integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU="
},
"eth-block-tracker": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-2.3.1.tgz",
@ -17665,6 +17716,22 @@
"is-hex-prefixed": "1.0.0",
"number-to-bn": "1.7.0",
"strip-hex-prefix": "1.0.0"
},
"dependencies": {
"bn.js": {
"version": "4.11.6",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz",
"integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU="
},
"ethjs-util": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.3.tgz",
"integrity": "sha1-39XqSkANxeQhqInK9H4IGtp4u1U=",
"requires": {
"is-hex-prefixed": "1.0.0",
"strip-hex-prefix": "1.0.0"
}
}
}
},
"ethjs-query": {
@ -17681,15 +17748,6 @@
"resolved": "https://registry.npmjs.org/ethjs-schema/-/ethjs-schema-0.1.5.tgz",
"integrity": "sha1-WXQOOzl3vNu5sRvDBoIB6Kzquw0="
},
"ethjs-util": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.3.tgz",
"integrity": "sha1-39XqSkANxeQhqInK9H4IGtp4u1U=",
"requires": {
"is-hex-prefixed": "1.0.0",
"strip-hex-prefix": "1.0.0"
}
},
"pify": {
"version": "2.3.0",
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
@ -20510,6 +20568,13 @@
"pump": "^1.0.2"
},
"dependencies": {
"async-eventemitter": {
"version": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c",
"from": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c",
"requires": {
"async": "^2.4.0"
}
},
"babelify": {
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/babelify/-/babelify-7.3.0.tgz",
@ -20519,50 +20584,6 @@
"object-assign": "^4.0.0"
}
},
"obs-store": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/obs-store/-/obs-store-2.4.1.tgz",
"integrity": "sha512-wpA8G4uSn8cnCKZ0pFTvqsamvy0Sm1hR2ot0Qonbfj5yBMwdAp/eD4vDI+U/ZCbV1hb2V5GapL8YKUdGCvahgg==",
"requires": {
"babel-preset-es2015": "^6.22.0",
"babelify": "^7.3.0",
"readable-stream": "^2.2.2",
"through2": "^2.0.3",
"xtend": "^4.0.1"
}
},
"pump": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz",
"integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==",
"requires": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
}
}
},
"metamask-inpage-provider": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/metamask-inpage-provider/-/metamask-inpage-provider-1.2.2.tgz",
"integrity": "sha512-/CZaGf+yN56+fcrNekBSwyxSFVtCrsesQ5S3n8d+0/7RkB6OgghMh9qanKgAKXfdKEYNvEBuLrsICdbgGhBekA==",
"requires": {
"json-rpc-engine": "^3.7.4",
"json-rpc-middleware-stream": "^2.0.0",
"loglevel": "^1.6.1",
"obj-multiplex": "^1.0.0",
"obs-store": "^3.0.0",
"pump": "^3.0.0",
"safe-event-emitter": "^1.0.1"
},
"dependencies": {
"async-eventemitter": {
"version": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c",
"from": "github:ahultgren/async-eventemitter#fa06e39e56786ba541c180061dbf2c0a5bbf951c",
"requires": {
"async": "^2.4.0"
}
},
"eth-block-tracker": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/eth-block-tracker/-/eth-block-tracker-2.3.1.tgz",
@ -20636,27 +20657,63 @@
"integrity": "sha1-WXQOOzl3vNu5sRvDBoIB6Kzquw0="
},
"json-rpc-middleware-stream": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/json-rpc-middleware-stream/-/json-rpc-middleware-stream-2.1.0.tgz",
"integrity": "sha512-JxX+kbS9sDMHvnADFLlV/QtkgeIYVF/2R8UuxXaiZc7ntVEgi/lkzMGbGkDwdRg36rHnUIvCZk6zR/5Y3bAq1w==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-rpc-middleware-stream/-/json-rpc-middleware-stream-1.0.1.tgz",
"integrity": "sha512-IR6cOO6B21NdLpiYblueB3O+g3UAYLIZd6ZgZfddVPl0z6vSECcpuiYnV5MmIMJY3D0fLYpJqOxYaEmLYQqTtA==",
"requires": {
"end-of-stream": "^1.4.0",
"eth-block-tracker": "^2.1.2",
"ethjs-query": "^0.2.9",
"json-rpc-engine": "^3.8.0",
"readable-stream": "^2.3.3",
"safe-event-emitter": "^1.0.1"
"json-rpc-engine": "^3.0.1",
"readable-stream": "^2.3.3"
}
},
"loglevel": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.1.tgz",
"integrity": "sha1-4PyVEztu8nbNyIh82vJKpvFW+Po="
"obs-store": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/obs-store/-/obs-store-2.4.1.tgz",
"integrity": "sha512-wpA8G4uSn8cnCKZ0pFTvqsamvy0Sm1hR2ot0Qonbfj5yBMwdAp/eD4vDI+U/ZCbV1hb2V5GapL8YKUdGCvahgg==",
"requires": {
"babel-preset-es2015": "^6.22.0",
"babelify": "^7.3.0",
"readable-stream": "^2.2.2",
"through2": "^2.0.3",
"xtend": "^4.0.1"
}
},
"pify": {
"version": "2.3.0",
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
},
"pump": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz",
"integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==",
"requires": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
}
}
},
"metamask-inpage-provider": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/metamask-inpage-provider/-/metamask-inpage-provider-1.2.2.tgz",
"integrity": "sha512-/CZaGf+yN56+fcrNekBSwyxSFVtCrsesQ5S3n8d+0/7RkB6OgghMh9qanKgAKXfdKEYNvEBuLrsICdbgGhBekA==",
"requires": {
"json-rpc-engine": "^3.7.4",
"json-rpc-middleware-stream": "^2.0.0",
"loglevel": "^1.6.1",
"obj-multiplex": "^1.0.0",
"obs-store": "^3.0.0",
"pump": "^3.0.0",
"safe-event-emitter": "^1.0.1"
},
"dependencies": {
"loglevel": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.6.1.tgz",
"integrity": "sha1-4PyVEztu8nbNyIh82vJKpvFW+Po="
}
}
},
@ -26007,7 +26064,7 @@
},
"pretty-hrtime": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",
"resolved": "http://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",
"integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE="
},
"printf": {

View File

@ -11,11 +11,12 @@
"publish-docs": "gh-pages -d docs/jsdocs",
"test": "npm run test:unit && npm run test:integration && npm run lint",
"watch:test:unit": "nodemon --exec \"npm run test:unit\" ./test ./app ./ui",
"test:unit": "cross-env METAMASK_ENV=test mocha --exit --require test/setup.js --recursive \"test/unit/**/*.js\" \"ui/app/**/*.test.js\" && dot-only-hunter",
"test:unit": "cross-env METAMASK_ENV=test mocha --exit --require test/setup.js --recursive \"test/unit/**/*.js\" \"ui/app/**/*.test.js\"",
"test:single": "cross-env METAMASK_ENV=test mocha --require test/helper.js",
"test:integration": "npm run test:integration:build && npm run test:flat && npm run test:mascara",
"test:integration:build": "gulp build:scss",
"test:e2e:chrome": "shell-parallel -s 'npm run ganache:start' -x 'sleep 3 && npm run test:e2e:run:chrome'",
"test:e2e:drizzle:beta": "SELENIUM_BROWSER=chrome test/e2e/beta/run-drizzle.sh",
"test:e2e:chrome:beta": "SELENIUM_BROWSER=chrome test/e2e/beta/run-all.sh",
"test:e2e:firefox": "shell-parallel -s 'npm run ganache:start' -x 'sleep 3 && npm run test:e2e:run:firefox'",
"test:e2e:firefox:beta": "SELENIUM_BROWSER=firefox test/e2e/beta/run-all.sh",
@ -41,6 +42,7 @@
"sentry:publish": "node ./development/sentry-publish.js",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"mozilla-lint": "addons-linter dist/firefox",
"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\"",
@ -99,7 +101,7 @@
"copy-to-clipboard": "^3.0.8",
"css-loader": "^0.28.11",
"currency-formatter": "^1.4.2",
"debounce": "^1.0.0",
"debounce": "1.1.0",
"debounce-stream": "^2.0.0",
"deep-extend": "^0.5.1",
"detect-node": "^2.0.3",
@ -110,7 +112,7 @@
"ensnare": "^1.0.0",
"eslint-plugin-react": "^7.4.0",
"eth-bin-to-ops": "^1.0.1",
"eth-block-tracker": "^4.0.1",
"eth-block-tracker": "^4.0.3",
"eth-contract-metadata": "github:MetaMask/eth-contract-metadata#master",
"eth-ens-namehash": "^2.0.8",
"eth-hd-keyring": "^2.0.0",
@ -156,7 +158,7 @@
"iframe-stream": "^3.0.0",
"inject-css": "^0.1.1",
"json-rpc-engine": "^3.8.0",
"json-rpc-middleware-stream": "^1.0.1",
"json-rpc-middleware-stream": "^2.1.0",
"jsonschema": "^1.2.4",
"lodash.debounce": "^4.0.8",
"lodash.memoize": "^4.1.2",
@ -164,7 +166,7 @@
"lodash.uniqby": "^4.7.0",
"loglevel": "^1.4.1",
"metamascara": "^2.0.0",
"metamask-inpage-provider": "^1.0.0",
"metamask-inpage-provider": "^1.2.2",
"mkdirp": "^0.5.1",
"multihashes": "^0.4.12",
"multiplex": "^6.7.0",
@ -230,6 +232,7 @@
"@storybook/addon-info": "^3.4.2",
"@storybook/addon-knobs": "^3.4.2",
"@storybook/react": "^3.4.2",
"addons-linter": "^1.3.4",
"babel-core": "^6.24.1",
"babel-eslint": "^8.0.0",
"babel-plugin-transform-async-to-generator": "^6.24.1",
@ -252,7 +255,6 @@
"css-loader": "^0.28.11",
"deep-freeze-strict": "^1.1.1",
"del": "^3.0.0",
"dot-only-hunter": "^1.0.3",
"envify": "^4.0.0",
"enzyme": "^3.4.4",
"enzyme-adapter-react-15": "^1.0.6",
@ -260,7 +262,8 @@
"eslint-plugin-json": "^1.2.0",
"eslint-plugin-mocha": "^5.0.0",
"eslint-plugin-react": "^7.4.0",
"eth-json-rpc-middleware": "^2.4.0",
"eth-json-rpc-middleware": "^3.1.3",
"fetch-mock": "^6.5.2",
"file-loader": "^1.1.11",
"fs-extra": "^6.0.1",
"fs-promise": "^2.0.3",

70
test/data/2-state.json Normal file
View File

@ -0,0 +1,70 @@
{ "isInitialized": true,
"provider": { "type": "rpc", "rpcTarget": "http://localhost:8545" },
"network": "loading",
"accounts": {
"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc": {
"address": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
"balance": "0x0"
},
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b": {
"address": "0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b",
"balance": "0x0"
}
},
"currentBlockGasLimit": "",
"unapprovedTxs": {},
"selectedAddressTxList": [],
"computedBalances": {},
"unapprovedMsgs": {},
"unapprovedMsgCount": 0,
"unapprovedPersonalMsgs": {},
"unapprovedPersonalMsgCount": 0,
"unapprovedTypedMessages": {},
"unapprovedTypedMessagesCount": 0,
"isUnlocked": true,
"keyringTypes": [ "Simple Key Pair", "HD Key Tree" ],
"keyrings":[
{ "type": "HD Key Tree",
"accounts": [
"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc"
]
},
{
"type": "Simple Key Pair",
"accounts": [
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b"
]
}
],
"frequentRpcList": [],
"currentAccountTab": "history",
"tokens": [],
"useBlockie": false,
"featureFlags": {},
"currentLocale": null,
"identities": {
"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc": {
"name": "Account 1",
"address": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc"
},
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b": {
"name": "Account 2",
"address": "0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b"
}
},
"lostIdentities": {},
"selectedAddress": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
"recentBlocks": [],
"addressBook": [],
"currentCurrency": "usd",
"conversionRate": 288.45,
"conversionDate": 1506444677,
"nextUnreadNotice": null,
"noActiveNotices": true,
"shapeShiftTxList": [],
"infuraNetworkStatus": {},
"lostAccounts": [],
"seedWords": "debris dizzy just program just float decrease vacant alarm reduce speak stadium",
"forgottenPassword": null
}

1251
test/data/mock-state.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,286 @@
const path = require('path')
const assert = require('assert')
const webdriver = require('selenium-webdriver')
const { By, until } = webdriver
const {
delay,
buildChromeWebDriver,
buildFirefoxWebdriver,
installWebExt,
getExtensionIdChrome,
getExtensionIdFirefox,
} = require('../func')
const {
checkBrowserForConsoleErrors,
closeAllWindowHandlesExcept,
findElement,
findElements,
loadExtension,
openNewPage,
verboseReportOnFailure,
waitUntilXWindowHandles,
} = require('./helpers')
describe('MetaMask', function () {
let extensionId
let driver
const tinyDelayMs = 200
const regularDelayMs = tinyDelayMs * 2
const largeDelayMs = regularDelayMs * 2
this.timeout(0)
this.bail(true)
before(async function () {
switch (process.env.SELENIUM_BROWSER) {
case 'chrome': {
const extPath = path.resolve('dist/chrome')
driver = buildChromeWebDriver(extPath)
extensionId = await getExtensionIdChrome(driver)
await driver.get(`chrome-extension://${extensionId}/popup.html`)
break
}
case 'firefox': {
const extPath = path.resolve('dist/firefox')
driver = buildFirefoxWebdriver()
await installWebExt(driver, extPath)
await delay(700)
extensionId = await getExtensionIdFirefox(driver)
await driver.get(`moz-extension://${extensionId}/popup.html`)
}
}
})
afterEach(async function () {
if (process.env.SELENIUM_BROWSER === 'chrome') {
const errors = await checkBrowserForConsoleErrors(driver)
if (errors.length) {
const errorReports = errors.map(err => err.message)
const errorMessage = `Errors found in browser console:\n${errorReports.join('\n')}`
console.error(new Error(errorMessage))
}
}
if (this.currentTest.state === 'failed') {
await verboseReportOnFailure(driver, this.currentTest)
}
})
after(async function () {
await driver.quit()
})
describe('New UI setup', async function () {
it('switches to first tab', async function () {
await delay(tinyDelayMs)
const [firstTab] = await driver.getAllWindowHandles()
await driver.switchTo().window(firstTab)
await delay(regularDelayMs)
})
it('selects the new UI option', async () => {
try {
const overlay = await findElement(driver, By.css('.full-flex-height'))
await driver.wait(until.stalenessOf(overlay))
} catch (e) {}
let button
try {
button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]"))
} catch (e) {
await loadExtension(driver, extensionId)
await delay(largeDelayMs)
button = await findElement(driver, By.xpath("//button[contains(text(), 'Try it now')]"))
}
await button.click()
await delay(regularDelayMs)
// Close all other tabs
const [tab0, tab1, tab2] = await driver.getAllWindowHandles()
await driver.switchTo().window(tab0)
await delay(tinyDelayMs)
let selectedUrl = await driver.getCurrentUrl()
await delay(tinyDelayMs)
if (tab0 && selectedUrl.match(/popup.html/)) {
await closeAllWindowHandlesExcept(driver, tab0)
} else if (tab1) {
await driver.switchTo().window(tab1)
selectedUrl = await driver.getCurrentUrl()
await delay(tinyDelayMs)
if (selectedUrl.match(/popup.html/)) {
await closeAllWindowHandlesExcept(driver, tab1)
} else if (tab2) {
await driver.switchTo().window(tab2)
selectedUrl = await driver.getCurrentUrl()
selectedUrl.match(/popup.html/) && await closeAllWindowHandlesExcept(driver, tab2)
}
} else {
throw new Error('popup.html not found')
}
await delay(regularDelayMs)
const [appTab] = await driver.getAllWindowHandles()
await driver.switchTo().window(appTab)
await delay(tinyDelayMs)
await loadExtension(driver, extensionId)
await delay(regularDelayMs)
const continueBtn = await findElement(driver, By.css('.welcome-screen__button'))
await continueBtn.click()
await delay(regularDelayMs)
})
})
describe('Going through the first time flow', () => {
it('accepts a secure password', async () => {
const passwordBox = await findElement(driver, By.css('.create-password #create-password'))
const passwordBoxConfirm = await findElement(driver, By.css('.create-password #confirm-password'))
const button = await findElement(driver, By.css('.create-password button'))
await passwordBox.sendKeys('correct horse battery staple')
await passwordBoxConfirm.sendKeys('correct horse battery staple')
await button.click()
await delay(regularDelayMs)
})
it('clicks through the unique image screen', async () => {
const nextScreen = await findElement(driver, By.css('.unique-image button'))
await nextScreen.click()
await delay(regularDelayMs)
})
it('clicks through the ToS', async () => {
// terms of use
const canClickThrough = await driver.findElement(By.css('.tou button')).isEnabled()
assert.equal(canClickThrough, false, 'disabled continue button')
const bottomOfTos = await findElement(driver, By.linkText('Attributions'))
await driver.executeScript('arguments[0].scrollIntoView(true)', bottomOfTos)
await delay(regularDelayMs)
const acceptTos = await findElement(driver, By.css('.tou button'))
driver.wait(until.elementIsEnabled(acceptTos))
await acceptTos.click()
await delay(regularDelayMs)
})
it('clicks through the privacy notice', async () => {
// privacy notice
const nextScreen = await findElement(driver, By.css('.tou button'))
await nextScreen.click()
await delay(regularDelayMs)
})
it('clicks through the phishing notice', async () => {
// phishing notice
const noticeElement = await driver.findElement(By.css('.markdown'))
await driver.executeScript('arguments[0].scrollTop = arguments[0].scrollHeight', noticeElement)
await delay(regularDelayMs)
const nextScreen = await findElement(driver, By.css('.tou button'))
await nextScreen.click()
await delay(regularDelayMs)
})
let seedPhrase
it('reveals the seed phrase', async () => {
const byRevealButton = By.css('.backup-phrase__secret-blocker .backup-phrase__reveal-button')
await driver.wait(until.elementLocated(byRevealButton, 10000))
const revealSeedPhraseButton = await findElement(driver, byRevealButton, 10000)
await revealSeedPhraseButton.click()
await delay(regularDelayMs)
seedPhrase = await driver.findElement(By.css('.backup-phrase__secret-words')).getText()
assert.equal(seedPhrase.split(' ').length, 12)
await delay(regularDelayMs)
const nextScreen = await findElement(driver, By.css('.backup-phrase button'))
await nextScreen.click()
await delay(regularDelayMs)
})
async function clickWordAndWait (word) {
const xpathClass = 'backup-phrase__confirm-seed-option backup-phrase__confirm-seed-option--unselected'
const xpath = `//button[@class='${xpathClass}' and contains(text(), '${word}')]`
const word0 = await findElement(driver, By.xpath(xpath), 10000)
await word0.click()
await delay(tinyDelayMs)
}
async function retypeSeedPhrase (words, wasReloaded, count = 0) {
try {
if (wasReloaded) {
const byRevealButton = By.css('.backup-phrase__secret-blocker .backup-phrase__reveal-button')
await driver.wait(until.elementLocated(byRevealButton, 10000))
const revealSeedPhraseButton = await findElement(driver, byRevealButton, 10000)
await revealSeedPhraseButton.click()
await delay(regularDelayMs)
const nextScreen = await findElement(driver, By.css('.backup-phrase button'))
await nextScreen.click()
await delay(regularDelayMs)
}
for (let i = 0; i < 12; i++) {
await clickWordAndWait(words[i])
}
} catch (e) {
if (count > 2) {
throw e
} else {
await loadExtension(driver, extensionId)
await retypeSeedPhrase(words, true, count + 1)
}
}
}
it('can retype the seed phrase', async () => {
const words = seedPhrase.split(' ')
await retypeSeedPhrase(words)
const confirm = await findElement(driver, By.xpath(`//button[contains(text(), 'Confirm')]`))
await confirm.click()
await delay(regularDelayMs)
})
it('clicks through the deposit modal', async () => {
const byBuyModal = By.css('span .modal')
const buyModal = await driver.wait(until.elementLocated(byBuyModal))
const closeModal = await findElement(driver, By.css('.page-container__header-close'))
await closeModal.click()
await driver.wait(until.stalenessOf(buyModal))
await delay(regularDelayMs)
})
it('switches to localhost', async () => {
const networkDropdown = await findElement(driver, By.css('.network-name'))
await networkDropdown.click()
await delay(regularDelayMs)
const [localhost] = await findElements(driver, By.xpath(`//span[contains(text(), 'Localhost')]`))
await localhost.click()
await delay(largeDelayMs * 2)
})
})
describe('Drizzle', () => {
it('should be able to detect our eth address', async () => {
await openNewPage(driver, 'http://127.0.0.1:3000/')
await delay(regularDelayMs)
await waitUntilXWindowHandles(driver, 2)
const windowHandles = await driver.getAllWindowHandles()
const dapp = windowHandles[1]
await driver.switchTo().window(dapp)
await delay(regularDelayMs)
const addressElement = await findElement(driver, By.css(`.pure-u-1-1 h4`))
const addressText = await addressElement.getText()
assert(addressText.match(/^0x[a-fA-F0-9]{40}$/))
})
})
})

View File

@ -286,7 +286,7 @@ describe('Using MetaMask with an existing account', function () {
await delay(regularDelayMs)
const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]'))
const inputAmount = await findElement(driver, By.css('.currency-display__input'))
const inputAmount = await findElement(driver, By.css('.unit-input__input'))
await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')
await inputAmount.sendKeys('1')

View File

@ -126,10 +126,7 @@ async function assertElementNotPresent (webdriver, driver, by) {
try {
dataTab = await findElement(driver, by, 4000)
} catch (err) {
console.log(err)
assert(err instanceof webdriver.error.NoSuchElementError || err instanceof webdriver.error.TimeoutError)
}
if (dataTab) {
assert(false, 'Data tab should not be present')
}
assert.ok(!dataTab, 'Found element that should not be present')
}

View File

@ -271,6 +271,17 @@ describe('MetaMask', function () {
await driver.wait(until.stalenessOf(accountModal))
await delay(regularDelayMs)
})
it('show account details dropdown menu', async () => {
const {width, height} = await driver.manage().window().getSize()
driver.manage().window().setSize(320, 480)
await driver.findElement(By.css('div.menu-bar__open-in-browser')).click()
const options = await driver.findElements(By.css('div.menu.account-details-dropdown div.menu__item'))
assert.equal(options.length, 3) // HD Wallet type does not have to show the Remove Account option
await delay(regularDelayMs)
driver.manage().window().setSize(width, height)
})
})
describe('Log out an log back in', () => {
@ -372,7 +383,7 @@ describe('MetaMask', function () {
await delay(regularDelayMs)
const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]'))
const inputAmount = await findElement(driver, By.css('.currency-display__input'))
const inputAmount = await findElement(driver, By.css('.unit-input__input'))
await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')
await inputAmount.sendKeys('1')
@ -651,7 +662,7 @@ describe('MetaMask', function () {
})
it('clicks on the Add Token button', async () => {
const addToken = await driver.findElement(By.css('.wallet-view__add-token-button'))
const addToken = await driver.findElement(By.xpath(`//div[contains(text(), 'Add Token')]`))
await addToken.click()
await delay(regularDelayMs)
})
@ -691,7 +702,7 @@ describe('MetaMask', function () {
await delay(regularDelayMs)
const inputAddress = await findElement(driver, By.css('input[placeholder="Recipient Address"]'))
const inputAmount = await findElement(driver, By.css('.currency-display__input'))
const inputAmount = await findElement(driver, By.css('.unit-input__input'))
await inputAddress.sendKeys('0x2f318C334780961FB129D2a6c30D0763d9a5C970')
await inputAmount.sendKeys('50')
@ -823,8 +834,8 @@ describe('MetaMask', function () {
await save.click()
await driver.wait(until.stalenessOf(gasModal))
const gasFeeInputs = await findElements(driver, By.css('.confirm-detail-row__eth'))
assert.equal(await gasFeeInputs[0].getText(), '0.0006')
const gasFeeInputs = await findElements(driver, By.css('.confirm-detail-row__primary'))
assert.equal(await gasFeeInputs[0].getText(), '0.0006')
})
it('submits the transaction', async function () {
@ -946,8 +957,8 @@ describe('MetaMask', function () {
await save.click()
await driver.wait(until.stalenessOf(gasModal))
const gasFeeInputs = await findElements(driver, By.css('.confirm-detail-row__eth'))
assert.equal(await gasFeeInputs[0].getText(), '0.0006')
const gasFeeInputs = await findElements(driver, By.css('.confirm-detail-row__primary'))
assert.equal(await gasFeeInputs[0].getText(), '0.0006')
})
it('submits the transaction', async function () {
@ -991,7 +1002,7 @@ describe('MetaMask', function () {
describe('Add existing token using search', () => {
it('clicks on the Add Token button', async () => {
const addToken = await findElement(driver, By.xpath(`//button[contains(text(), 'Add Token')]`))
const addToken = await findElement(driver, By.xpath(`//div[contains(text(), 'Add Token')]`))
await addToken.click()
await delay(regularDelayMs)
})
@ -1030,7 +1041,7 @@ describe('MetaMask', function () {
]
customRpcUrls.forEach(customRpcUrl => {
it('creates custom RPC: ' + customRpcUrl, async () => {
it(`creates custom RPC: ${customRpcUrl}`, async () => {
const networkDropdown = await findElement(driver, By.css('.network-name'))
await networkDropdown.click()
await delay(regularDelayMs)
@ -1059,25 +1070,15 @@ describe('MetaMask', function () {
await delay(largeDelayMs * 2)
})
it('finds 3 recent RPCs in history', async () => {
it('finds all recent RPCs in history', async () => {
const networkDropdown = await findElement(driver, By.css('.network-name'))
await networkDropdown.click()
await delay(regularDelayMs)
// oldest selected RPC is not found
await assertElementNotPresent(webdriver, driver, By.xpath(`//span[contains(text(), '${customRpcUrls[0]}')]`))
// only recent 3 are found and in correct order (most recent at the top)
const customRpcs = await findElements(driver, By.xpath(`//span[contains(text(), 'https://mainnet.infura.io/')]`))
assert.equal(customRpcs.length, 3)
for (let i = 0; i < customRpcs.length; i++) {
const linkText = await customRpcs[i].getText()
const rpcUrl = customRpcUrls[customRpcUrls.length - i - 1]
assert.notEqual(linkText.indexOf(rpcUrl), -1)
}
assert.equal(customRpcs.length, customRpcUrls.length)
})
})
})

View File

@ -6,5 +6,5 @@ set -o pipefail
export PATH="$PATH:./node_modules/.bin"
shell-parallel -s 'npm run ganache:start -- -b 2' -x 'sleep 5 && static-server test/e2e/beta/contract-test/ --port 8080' -x 'sleep 5 && mocha test/e2e/beta/metamask-beta-ui.spec'
shell-parallel -s 'npm run ganache:start -- -d -b 2' -x 'sleep 5 && static-server test/e2e/beta/contract-test/ --port 8080' -x 'sleep 5 && mocha test/e2e/beta/from-import-beta-ui.spec'
shell-parallel -s 'npm run ganache:start -- -b 2' -x 'sleep 5 && static-server test/e2e/beta/contract-test --port 8080' -x 'sleep 5 && mocha test/e2e/beta/metamask-beta-ui.spec'
shell-parallel -s 'npm run ganache:start -- -d -b 2' -x 'sleep 5 && mocha test/e2e/beta/from-import-beta-ui.spec'

20
test/e2e/beta/run-drizzle.sh Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
export PATH="$PATH:./node_modules/.bin"
npm run ganache:start -- -b 2 >> /dev/null 2>&1 &
sleep 5
cd test/e2e/beta/
rm -rf drizzle-test
mkdir drizzle-test && cd drizzle-test
npm install truffle
truffle unbox drizzle
echo "Deploying contracts for Drizzle test..."
truffle compile && truffle migrate
BROWSER=none npm start >> /dev/null 2>&1 &
cd ../../../../
mocha test/e2e/beta/drizzle.spec

View File

@ -440,7 +440,7 @@ describe('Metamask popup page', async function () {
it('navigates to token factory', async function () {
await setProvider(NETWORKS.LOCALHOST)
await driver.get('https://tokenfactory.surge.sh/')
await driver.get('http://thetokenfactory.com/#/factory')
})
it('navigates to create token contract link', async function () {
@ -550,7 +550,7 @@ describe('Metamask popup page', async function () {
await delay(2000)
const allHandles = await driver.getAllWindowHandles()
console.log('allHandles.length ' + allHandles.length)
assert.equal(allHandles.length, 3, 'etherscan wasn\'t opened')
assert.equal(allHandles.length, 2, 'etherscan wasn\'t opened')
await switchToLastPage()
const title = await waitUntilCurrentUrl()
@ -574,7 +574,7 @@ describe('Metamask popup page', async function () {
await delay(2000)
const allHandles = await driver.getAllWindowHandles()
console.log('allHandles.length ' + allHandles.length)
assert.equal(allHandles.length, 4, 'etherscan wasn\'t opened')
assert.equal(allHandles.length, 3, 'etherscan wasn\'t opened')
await switchToLastPage()
const title = await waitUntilCurrentUrl()

View File

@ -40,7 +40,7 @@ async function customizeGas (assert, price, limit, ethFee, usdFee) {
const sendGasField = await queryAsync($, '.send-v2__gas-fee-display')
assert.equal(
(await findAsync(sendGasField, '.currency-display__input-wrapper > input')).val(),
(await findAsync(sendGasField, '.currency-display-component'))[0].textContent,
ethFee,
'send gas field should show customized gas total'
)
@ -94,12 +94,12 @@ async function runSendFlowTest (assert, done) {
sendToDropdownList.children()[2].click()
const sendToAccountAddress = sendToFieldInput.val()
assert.equal(sendToAccountAddress, '0x2f8d4a878cfa04a6e60d46362f5644deab66572d', 'send to dropdown selects the correct address')
assert.equal(sendToAccountAddress, '0x2f8D4a878cFA04A6E60D46362f5644DeAb66572D', 'send to dropdown selects the correct address')
const sendAmountField = await queryAsync($, '.send-v2__form-row:eq(2)')
sendAmountField.find('.currency-display')[0].click()
sendAmountField.find('.unit-input')[0].click()
const sendAmountFieldInput = await findAsync(sendAmountField, '.currency-display__input')
const sendAmountFieldInput = await findAsync(sendAmountField, '.unit-input__input')
sendAmountFieldInput.val('5.1')
reactTriggerChange(sendAmountField.find('input')[0])
@ -112,9 +112,9 @@ async function runSendFlowTest (assert, done) {
errorMessage = $('.send-v2__error')
assert.equal(errorMessage.length, 0, 'send should stop rendering amount error message after amount is corrected')
await customizeGas(assert, 0, 21000, '0', '$0.00 USD')
await customizeGas(assert, 1, 21000, '0.000021', '$0.03 USD')
await customizeGas(assert, 500, 60000, '0.03', '$36.03 USD')
await customizeGas(assert, 0, 21000, '0 ETH', '$0.00 USD')
await customizeGas(assert, 1, 21000, '0.000021 ETH', '$0.03 USD')
await customizeGas(assert, 500, 60000, '0.03 ETH', '$36.03 USD')
const sendButton = await queryAsync($, 'button.btn-primary.btn--large.page-container__footer-button')
assert.equal(sendButton[0].textContent, 'Next', 'next button rendered')
@ -130,11 +130,11 @@ async function runSendFlowTest (assert, done) {
const confirmToName = (await queryAsync($, '.sender-to-recipient__name')).last()
assert.equal(confirmToName[0].textContent, 'Send Account 3', 'confirm screen should show correct to name')
const confirmScreenRowFiats = await queryAsync($, '.confirm-detail-row__fiat')
const confirmScreenRowFiats = await queryAsync($, '.confirm-detail-row__secondary')
const confirmScreenGas = confirmScreenRowFiats[0]
assert.equal(confirmScreenGas.textContent, '$3.60', 'confirm screen should show correct gas')
const confirmScreenTotal = confirmScreenRowFiats[1]
assert.equal(confirmScreenTotal.textContent, '$2,405.36', 'confirm screen should show correct total')
assert.equal(confirmScreenTotal.textContent, '$2,405.37', 'confirm screen should show correct total')
const confirmScreenBackButton = await queryAsync($, '.confirm-page-container-header__back-button')
confirmScreenBackButton[0].click()
@ -150,9 +150,9 @@ async function runSendFlowTest (assert, done) {
sendToFieldInputInEdit.val('0xd85a4b6a394794842887b8284293d69163007bbb')
const sendAmountFieldInEdit = await queryAsync($, '.send-v2__form-row:eq(2)')
sendAmountFieldInEdit.find('.currency-display')[0].click()
sendAmountFieldInEdit.find('.unit-input')[0].click()
const sendAmountFieldInputInEdit = sendAmountFieldInEdit.find('.currency-display__input')
const sendAmountFieldInputInEdit = sendAmountFieldInEdit.find('.unit-input__input')
sendAmountFieldInputInEdit.val('1.0')
reactTriggerChange(sendAmountFieldInputInEdit[0])

View File

@ -32,9 +32,9 @@ async function runTxListItemsTest (assert, done) {
const txListItems = await queryAsync($, '.transaction-list-item')
assert.equal(txListItems.length, 8, 'all tx list items are rendered')
const retryTxGrid = await findAsync($(txListItems[1]), '.transaction-list-item__grid')
const retryTxGrid = await findAsync($(txListItems[2]), '.transaction-list-item__grid')
retryTxGrid[0].click()
const retryTxDetails = await findAsync($(txListItems[1]), '.transaction-list-item-details')
const retryTxDetails = await findAsync($, '.transaction-list-item-details')
const headerButtons = await findAsync($(retryTxDetails[0]), '.transaction-list-item-details__header-button')
assert.equal(headerButtons[0].textContent, 'speed up')
@ -42,7 +42,7 @@ async function runTxListItemsTest (assert, done) {
const approvedTxRenderedStatus = await findAsync($(approvedTx), '.transaction-list-item__status')
assert.equal(approvedTxRenderedStatus[0].textContent, 'pending', 'approvedTx has correct label')
const unapprovedMsg = txListItems[3]
const unapprovedMsg = txListItems[0]
const unapprovedMsgDescription = await findAsync($(unapprovedMsg), '.transaction-list-item__action')
assert.equal(unapprovedMsgDescription[0].textContent, 'Signature Request', 'unapprovedMsg has correct description')

View File

@ -1,5 +1,5 @@
var mockHex = '0xabcdef0123456789'
var mockKey = new Buffer(32)
var mockKey = Buffer.alloc(32)
let cacheVal
module.exports = {

View File

@ -0,0 +1,42 @@
const { shallow, mount } = require('enzyme')
import { BrowserRouter } from 'react-router-dom'
import { shape } from 'prop-types'
module.exports = {
shallowWithStore,
mountWithStore,
mountWithRouter,
}
function shallowWithStore (component, store) {
const context = {
store,
}
return shallow(component, {context})
}
function mountWithStore (component, store) {
const context = {
store,
}
return mount(component, {context})
}
function mountWithRouter (node) {
// Instantiate router context
const router = {
history: new BrowserRouter().history,
route: {
location: {},
match: {},
},
}
const createContext = () => ({
context: { router, t: () => {} },
childContextTypes: { router: shape({}), t: () => {} },
})
return mount(node, createContext())
}

View File

@ -1,20 +0,0 @@
const { shallow, mount } = require('enzyme')
module.exports = {
shallowWithStore,
mountWithStore,
}
function shallowWithStore (component, store) {
const context = {
store,
}
return shallow(component, {context})
}
function mountWithStore (component, store) {
const context = {
store,
}
return mount(component, {context})
}

View File

@ -34,7 +34,7 @@ describe('', function () {
it('returns POA Sokol faucet for network 77', function () {
const ropstenUrl = getBuyEthUrl(sokol)
assert.equal(ropstenUrl, 'https://faucet-sokol.herokuapp.com/')
assert.equal(ropstenUrl, 'https://faucet.poa.network/')
})
it('returns metamask ropsten faucet for network 3', function () {

View File

@ -0,0 +1,33 @@
const assert = require('assert')
const cleanErrorStack = require('../../../app/scripts/lib/cleanErrorStack')
describe('Clean Error Stack', () => {
const testMessage = 'Test Message'
const testError = new Error(testMessage)
const undefinedErrorName = new Error(testMessage)
const blankErrorName = new Error(testMessage)
const blankMsgError = new Error()
beforeEach(() => {
undefinedErrorName.name = undefined
blankErrorName.name = ''
})
it('tests error with message', () => {
assert.equal(cleanErrorStack(testError), 'Error: Test Message')
})
it('tests error with undefined name', () => {
assert.equal(cleanErrorStack(undefinedErrorName).toString(), 'Error: Test Message')
})
it('tests error with blank name', () => {
assert.equal(cleanErrorStack(blankErrorName).toString(), 'Test Message')
})
it('tests error with blank message', () => {
assert.equal(cleanErrorStack(blankMsgError), 'Error')
})
})

View File

@ -8,6 +8,16 @@ describe('blacklist controller', function () {
blacklistController = new BlacklistController()
})
describe('whitelistDomain', function () {
it('should add hostname to the runtime whitelist', function () {
blacklistController.whitelistDomain('foo.com')
assert.deepEqual(blacklistController.store.getState().whitelist, ['foo.com'])
blacklistController.whitelistDomain('bar.com')
assert.deepEqual(blacklistController.store.getState().whitelist, ['bar.com', 'foo.com'])
})
})
describe('checkForPhishing', function () {
it('should not flag whitelisted values', function () {
const result = blacklistController.checkForPhishing('www.metamask.io')
@ -37,5 +47,10 @@ describe('blacklist controller', function () {
const result = blacklistController.checkForPhishing('zero-faucet.metamask.io')
assert.equal(result, false)
})
it('should not flag whitelisted domain', function () {
blacklistController.whitelistDomain('metamask.com')
const result = blacklistController.checkForPhishing('metamask.com')
assert.equal(result, false)
})
})
})

View File

@ -116,7 +116,7 @@ describe('MetaMaskController', function () {
}
const gasPrice = metamaskController.getGasPrice()
assert.equal(gasPrice, '0x3b9aca00', 'accurately estimates 50th percentile accepted gas price')
assert.equal(gasPrice, '0x174876e800', 'accurately estimates 65th percentile accepted gas price')
metamaskController.recentBlocksController = realRecentBlocksController
})

View File

@ -158,9 +158,19 @@ describe('Transaction Controller', function () {
})
describe('#addUnapprovedTransaction', function () {
const selectedAddress = '0x1678a085c290ebd122dc42cba69373b5953b831d'
let getSelectedAddress
beforeEach(function () {
getSelectedAddress = sinon.stub(txController, 'getSelectedAddress').returns(selectedAddress)
})
afterEach(function () {
getSelectedAddress.restore()
})
it('should add an unapproved transaction and return a valid txMeta', function (done) {
txController.addUnapprovedTransaction({ from: '0x1678a085c290ebd122dc42cba69373b5953b831d' })
txController.addUnapprovedTransaction({ from: selectedAddress })
.then((txMeta) => {
assert(('id' in txMeta), 'should have a id')
assert(('time' in txMeta), 'should have a time stamp')
@ -180,25 +190,37 @@ describe('Transaction Controller', function () {
assert(txMetaFromEmit, 'txMeta is falsey')
done()
})
txController.addUnapprovedTransaction({ from: '0x1678a085c290ebd122dc42cba69373b5953b831d' })
txController.addUnapprovedTransaction({ from: selectedAddress })
.catch(done)
})
it('should fail if recipient is public', function (done) {
txController.networkStore = new ObservableStore(1)
txController.addUnapprovedTransaction({ from: '0x1678a085c290ebd122dc42cba69373b5953b831d', to: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2' })
txController.addUnapprovedTransaction({ from: selectedAddress, to: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2' })
.catch((err) => {
if (err.message === 'Recipient is a public account') done()
else done(err)
})
})
it('should fail if the from address isn\'t the selected address', function (done) {
txController.addUnapprovedTransaction({from: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2'})
.then(function () {
assert.fail('transaction should not have been added')
done()
})
.catch(function () {
assert.ok('pass')
done()
})
})
it('should not fail if recipient is public but not on mainnet', function (done) {
txController.once('newUnapprovedTx', (txMetaFromEmit) => {
assert(txMetaFromEmit, 'txMeta is falsey')
done()
})
txController.addUnapprovedTransaction({ from: '0x1678a085c290ebd122dc42cba69373b5953b831d', to: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2' })
txController.addUnapprovedTransaction({ from: selectedAddress, to: '0x0d1d4e623D10F9FBA5Db95830F7d3839406C6AF2' })
.catch(done)
})
})

View File

@ -1,45 +0,0 @@
const assert = require('assert')
const h = require('react-hyperscript')
const { createMockStore } = require('redux-test-utils')
const { shallowWithStore } = require('../../lib/shallow-with-store')
const BalanceComponent = require('../../../ui/app/components/balance-component')
const mockState = {
metamask: {
accounts: { abc: {} },
network: 1,
selectedAddress: 'abc',
},
}
describe('BalanceComponent', function () {
let balanceComponent
let store
let component
beforeEach(function () {
store = createMockStore(mockState)
component = shallowWithStore(h(BalanceComponent), store)
balanceComponent = component.dive()
})
it('shows token balance and convert to fiat value based on conversion rate', function () {
const formattedBalance = '1.23 ETH'
const tokenBalance = balanceComponent.instance().getTokenBalance(formattedBalance, false)
const fiatDisplayNumber = balanceComponent.instance().getFiatDisplayNumber(formattedBalance, 2)
assert.equal('1.23 ETH', tokenBalance)
assert.equal(2.46, fiatDisplayNumber)
})
it('shows only the token balance when conversion rate is not available', function () {
const formattedBalance = '1.23 ETH'
const tokenBalance = balanceComponent.instance().getTokenBalance(formattedBalance, false)
const fiatDisplayNumber = balanceComponent.instance().getFiatDisplayNumber(formattedBalance, 0)
assert.equal('1.23 ETH', tokenBalance)
assert.equal('N/A', fiatDisplayNumber)
})
})

View File

@ -4,7 +4,7 @@ var BinaryRenderer = require('../../../old-ui/app/components/binary-renderer')
describe('BinaryRenderer', function () {
let binaryRenderer
const message = 'Hello, world!'
const buffer = new Buffer(message, 'utf8')
const buffer = Buffer.from(message, 'utf8')
const hex = buffer.toString('hex')
beforeEach(function () {

View File

@ -67,7 +67,7 @@
- Estimating gas limit for simple ether sends now faster & cheaper, by avoiding VM usage on recipients with no code.
- Add an extra px to address for Firefox clipping.
- Fix Firefox scrollbar.
- Open metamask popup for transaction confirmation before gas estimation finishes and add a loading screen over transaction confirmation.
- Open MetaMask popup for transaction confirmation before gas estimation finishes and add a loading screen over transaction confirmation.
- Fix bug that prevented eth_signTypedData from signing bytes.
- Further improve gas price estimation.
@ -330,7 +330,7 @@ rollback to 3.10.0 due to bug
## 3.7.7 2017-6-8
- Fix bug where metamask would show old data after computer being asleep or disconnected from the internet.
- Fix bug where MetaMask would show old data after computer being asleep or disconnected from the internet.
## 3.7.6 2017-6-5

View File

@ -6,7 +6,7 @@ const path = require('path')
const Dropdown = require(path.join(__dirname, '..', '..', '..', '..', 'ui', 'app', 'components', 'dropdowns', 'index.js')).Dropdown
const { createMockStore } = require('redux-test-utils')
const { mountWithStore } = require('../../../lib/shallow-with-store')
const { mountWithStore } = require('../../../lib/render-helpers')
const mockState = {
metamask: {

View File

@ -1,7 +1,7 @@
const assert = require('assert')
const { createMockStore } = require('redux-test-utils')
const h = require('react-hyperscript')
const { shallowWithStore } = require('../../lib/shallow-with-store')
const { shallowWithStore } = require('../../lib/render-helpers')
const AddTokenScreen = require('../../../old-ui/app/components/add-token')
describe('Add Token Screen', function () {

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
import React from 'react'
import assert from 'assert'
import thunk from 'redux-thunk'
import configureMockStore from 'redux-mock-store'
import { mount } from 'enzyme'
import IdenticonComponent from '../../../../../ui/app/components/identicon'
describe('Identicon Component', () => {
const state = {
metamask: {
useBlockie: false,
},
}
const middlewares = [thunk]
const mockStore = configureMockStore(middlewares)
const store = mockStore(state)
it('renders default eth_logo identicon with no props', () => {
const wrapper = mount(<IdenticonComponent store={store}/>)
assert.equal(wrapper.find('img.balance-icon').prop('src'), './images/eth_logo.svg')
})
it('renders custom image and add className props', () => {
const wrapper = mount(<IdenticonComponent store={store} className={'test-image'} image={'test-image'} />)
assert.equal(wrapper.find('img.test-image').prop('className'), 'test-image identicon')
assert.equal(wrapper.find('img.test-image').prop('src'), 'test-image')
})
it('renders div with address prop', () => {
const wrapper = mount(<IdenticonComponent store={store} className={'test-address'} address={'0xTest'} />)
assert.equal(wrapper.find('div.test-address').prop('className'), 'test-address identicon')
})
})

View File

@ -0,0 +1,69 @@
import React from 'react'
import assert from 'assert'
import thunk from 'redux-thunk'
import { Provider } from 'react-redux'
import configureMockStore from 'redux-mock-store'
import { mount } from 'enzyme'
import TokenCell from '../../../../../ui/app/components/token-cell'
import Identicon from '../../../../../ui/app/components/identicon'
describe('Token Cell', () => {
let wrapper
const state = {
metamask: {
network: 'test',
currentCurrency: 'usd',
selectedTokenAddress: '0xToken',
selectedAddress: '0xAddress',
contractExchangeRates: {
'0xAnotherToken': 0.015,
},
conversionRate: 7.00,
},
appState: {
sidebar: {
isOpen: true,
},
},
}
const middlewares = [thunk]
const mockStore = configureMockStore(middlewares)
const store = mockStore(state)
beforeEach(() => {
wrapper = mount(
<Provider store={store}>
<TokenCell
address={'0xAnotherToken'}
symbol={'TEST'}
string={'5.000'}
network={22}
currentCurrency={'usd'}
image={'./test-image'}
/>
</Provider>
)
})
it('renders Identicon with props from token cell', () => {
assert.equal(wrapper.find(Identicon).prop('address'), '0xAnotherToken')
assert.equal(wrapper.find(Identicon).prop('network'), 'test')
assert.equal(wrapper.find(Identicon).prop('image'), './test-image')
})
it('renders token balance', () => {
assert.equal(wrapper.find('.token-list-item__token-balance').text(), '5.000')
})
it('renders token symbol', () => {
assert.equal(wrapper.find('.token-list-item__token-symbol').text(), 'TEST')
})
it('renders converted fiat amount', () => {
assert.equal(wrapper.find('.token-list-item__fiat-amount').text(), '0.52 USD')
})
})

View File

@ -0,0 +1,175 @@
const assert = require('assert')
const selectors = require('../../../../ui/app/selectors')
const mockState = require('../../../data/mock-state.json')
const Eth = require('ethjs')
const { createTestProviderTools } = require('../../../stub/provider')
const provider = createTestProviderTools({ scaffold: {}}).provider
describe('Selectors', function () {
describe('#getSelectedAddress', function () {
let state
beforeEach(function () {
state = {
metamask: {
accounts: {
'0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc': {
'balance': '0x0',
'address': '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc',
},
},
},
}
})
it('returns first account if selectedAddress is undefined', function () {
assert.equal(selectors.getSelectedAddress(state), '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
})
it('returns selectedAddress', function () {
assert.equal(selectors.getSelectedAddress(mockState), '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
})
})
it('returns selected identity', function () {
const identity = selectors.getSelectedIdentity(mockState)
assert.equal(identity.address, '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
assert.equal(identity.name, 'Test Account')
})
it('returns selected account', function () {
const account = selectors.getSelectedAccount(mockState)
assert.equal(account.balance, '0x0')
assert.equal(account.address, '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
})
it('returns selected token from first token list', function () {
const token = selectors.getSelectedToken(mockState)
assert.equal(token.address, '0x108cf70c7d384c552f42c07c41c0e1e46d77ea0d')
assert.equal(token.symbol, 'TEST')
assert.equal(token.decimals, '0')
})
describe('#getSelectedTokenExchangeRate', function () {
it('returns token exchange rate for first token', function () {
const tokenRate = selectors.getSelectedTokenExchangeRate(mockState)
assert.equal(tokenRate, '0.00039345803819379796')
})
})
describe('#getTokenExchangeRate', function () {
let missingTokenRate
beforeEach(function () {
missingTokenRate = {
metamask: {
'contractExchangeRates': {},
},
}
})
it('returns 0 token exchange rate for a token not in state', function () {
const tokenRate = selectors.getTokenExchangeRate(missingTokenRate, '0xd8f6a2ffb0fc5952d16c9768b71cfd35b6399aa5')
assert.equal(tokenRate, 0)
})
it('returns token exchange rate for specified token in state', function () {
const tokenRate = selectors.getTokenExchangeRate(mockState, '0xd8f6a2ffb0fc5952d16c9768b71cfd35b6399aa5')
assert.equal(tokenRate, 0.00008189274407698049)
})
})
it('returns conversionRate from state', function () {
assert.equal(selectors.conversionRateSelector(mockState), 556.12)
})
it('returns address book from state', function () {
const addressBook = selectors.getAddressBook(mockState)
assert.equal(addressBook[0].address, '0xc42edfcc21ed14dda456aa0756c153f7985d8813')
assert.equal(addressBook[0].name, '')
})
it('returns accounts with balance, address, and name from identity and accounts in state', function () {
const accountsWithSendEther = selectors.accountsWithSendEtherInfoSelector(mockState)
assert.equal(accountsWithSendEther.length, 2)
assert.equal(accountsWithSendEther[0].balance, '0x0')
assert.equal(accountsWithSendEther[0].address, '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
assert.equal(accountsWithSendEther[0].name, 'Test Account')
})
it('returns selected account with balance, address, and name from accountsWithSendEtherInfoSelector', function () {
const currentAccountwithSendEther = selectors.getCurrentAccountWithSendEtherInfo(mockState)
assert.equal(currentAccountwithSendEther.balance, '0x0')
assert.equal(currentAccountwithSendEther.address, '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
assert.equal(currentAccountwithSendEther.name, 'Test Account')
})
describe('#transactionSelector', function () {
it('returns transactions from state', function () {
selectors.transactionsSelector(mockState)
})
})
it('#getGasIsLoading', () => {
const gasIsLoading = selectors.getGasIsLoading(mockState)
assert.equal(gasIsLoading, false)
})
describe('Send From', () => {
it('#getSendFrom', () => {
const sendFrom = selectors.getSendFrom(mockState)
assert.equal(sendFrom, '0xc42edfcc21ed14dda456aa0756c153f7985d8813')
})
it('#getForceGasMin', () => {
const forceGasMin = selectors.getForceGasMin(mockState)
assert.equal(forceGasMin, null)
})
it('#getSendAmount', () => {
const sendAmount = selectors.getSendAmount(mockState)
assert.equal(sendAmount, '1bc16d674ec80000')
})
it('#getSendMaxModeState', () => {
const sendMaxModeState = selectors.getSendMaxModeState(mockState)
assert.equal(sendMaxModeState, false)
})
})
it('#getCurrentCurrency', () => {
const currentCurrency = selectors.getCurrentCurrency(mockState)
assert.equal(currentCurrency, 'usd')
})
it('#getSelectedTokenToFiatRate', () => {
const selectedTokenToFiatRate = selectors.getSelectedTokenToFiatRate(mockState)
assert.equal(selectedTokenToFiatRate, '0.21880988420033493')
})
describe('#getSelectedTokenContract', () => {
beforeEach(() => {
global.eth = new Eth(provider)
})
it('', () => {
const selectedTokenContract = selectors.getSelectedTokenContract(mockState)
assert(selectedTokenContract.abi)
})
})
it('#getCurrentViewContext', () => {
const currentViewContext = selectors.getCurrentViewContext(mockState)
assert.equal(currentViewContext, '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
})
it('#getTotalUnapprovedCount', () => {
const totalUnapprovedCount = selectors.getTotalUnapprovedCount(mockState)
assert.equal(totalUnapprovedCount, 1)
})
})

View File

@ -168,6 +168,7 @@ var actions = {
updateTransaction,
updateAndApproveTx,
cancelTx: cancelTx,
cancelTxs,
completedTx: completedTx,
txError: txError,
nextTx: nextTx,
@ -242,6 +243,7 @@ var actions = {
removeSuggestedTokens,
UPDATE_TOKENS: 'UPDATE_TOKENS',
setRpcTarget: setRpcTarget,
delRpcTarget: delRpcTarget,
setProviderType: setProviderType,
SET_HARDWARE_WALLET_DEFAULT_HD_PATH: 'SET_HARDWARE_WALLET_DEFAULT_HD_PATH',
setHardwareWalletDefaultHdPath,
@ -308,6 +310,12 @@ var actions = {
updateFeatureFlags,
UPDATE_FEATURE_FLAGS: 'UPDATE_FEATURE_FLAGS',
// Preferences
setPreference,
updatePreferences,
UPDATE_PREFERENCES: 'UPDATE_PREFERENCES',
setUseETHAsPrimaryCurrencyPreference,
setMouseUserState,
SET_MOUSE_USER_STATE: 'SET_MOUSE_USER_STATE',
@ -952,6 +960,7 @@ function updateGasData ({
selectedToken,
to,
value,
data,
}) {
return (dispatch) => {
dispatch(actions.gasLoadingStarted())
@ -972,6 +981,7 @@ function updateGasData ({
to,
value,
estimateGasPrice,
data,
}),
])
})
@ -1330,6 +1340,47 @@ function cancelTx (txData) {
}
}
/**
* Cancels all of the given transactions
* @param {Array<object>} txDataList a list of tx data objects
* @return {function(*): Promise<void>}
*/
function cancelTxs (txDataList) {
return async (dispatch, getState) => {
dispatch(actions.showLoadingIndication())
const txIds = txDataList.map(({id}) => id)
const cancellations = txIds.map((id) => new Promise((resolve, reject) => {
background.cancelTransaction(id, (err) => {
if (err) {
return reject(err)
}
resolve()
})
}))
await Promise.all(cancellations)
const newState = await updateMetamaskStateFromBackground()
dispatch(actions.updateMetamaskState(newState))
dispatch(actions.clearSend())
txIds.forEach((id) => {
dispatch(actions.completedTx(id))
})
dispatch(actions.hideLoadingIndication())
if (global.METAMASK_UI_TYPE === ENVIRONMENT_TYPE_NOTIFICATION) {
return global.platform.closeCurrentWindow()
}
}
}
/**
* @deprecated
* @param {Array<object>} txsData
* @return {Function}
*/
function cancelAllTx (txsData) {
return (dispatch) => {
txsData.forEach((txData, i) => {
@ -1857,7 +1908,7 @@ function setProviderType (type) {
background.setProviderType(type, (err, result) => {
if (err) {
log.error(err)
return dispatch(self.displayWarning('Had a problem changing networks!'))
return dispatch(actions.displayWarning('Had a problem changing networks!'))
}
dispatch(actions.updateProviderType(type))
dispatch(actions.setSelectedToken())
@ -1895,7 +1946,20 @@ function setRpcTarget (newRpc) {
background.setCustomRpc(newRpc, (err, result) => {
if (err) {
log.error(err)
return dispatch(self.displayWarning('Had a problem changing networks!'))
return dispatch(actions.displayWarning('Had a problem changing networks!'))
}
dispatch(actions.setSelectedToken())
})
}
}
function delRpcTarget (oldRpc) {
return (dispatch) => {
log.debug(`background.delRpcTarget: ${oldRpc}`)
background.delCustomRpc(oldRpc, (err, result) => {
if (err) {
log.error(err)
return dispatch(self.displayWarning('Had a problem removing network!'))
}
dispatch(actions.displayWarning(''))
dispatch(actions.setSelectedToken())
@ -2309,6 +2373,36 @@ function updateFeatureFlags (updatedFeatureFlags) {
}
}
function setPreference (preference, value) {
return dispatch => {
dispatch(actions.showLoadingIndication())
return new Promise((resolve, reject) => {
background.setPreference(preference, value, (err, updatedPreferences) => {
dispatch(actions.hideLoadingIndication())
if (err) {
dispatch(actions.displayWarning(err.message))
return reject(err)
}
dispatch(actions.updatePreferences(updatedPreferences))
resolve(updatedPreferences)
})
})
}
}
function updatePreferences (value) {
return {
type: actions.UPDATE_PREFERENCES,
value,
}
}
function setUseETHAsPrimaryCurrencyPreference (value) {
return setPreference('useETHAsPrimaryCurrency', value)
}
function setNetworkNonce (networkNonce) {
return {
type: actions.SET_NETWORK_NONCE,
@ -2320,6 +2414,10 @@ function updateNetworkNonce (address) {
return (dispatch) => {
return new Promise((resolve, reject) => {
global.ethQuery.getTransactionCount(address, (err, data) => {
if (err) {
dispatch(actions.displayWarning(err.message))
return reject(err)
}
dispatch(setNetworkNonce(data))
resolve(data)
})
@ -2407,7 +2505,7 @@ function setUseBlockie (val) {
function updateCurrentLocale (key) {
return (dispatch) => {
dispatch(actions.showLoadingIndication())
fetchLocale(key)
return fetchLocale(key)
.then((localeMessages) => {
log.debug(`background.setCurrentLocale`)
background.setCurrentLocale(key, (err) => {

View File

@ -8,11 +8,11 @@ const h = require('react-hyperscript')
const actions = require('../../actions')
const { Menu, Item, Divider, CloseArea } = require('../dropdowns/components/menu')
const Identicon = require('../identicon')
const { formatBalance } = require('../../util')
const { ENVIRONMENT_TYPE_POPUP } = require('../../../../app/scripts/lib/enums')
const { getEnvironmentType } = require('../../../../app/scripts/lib/util')
const Tooltip = require('../tooltip')
import UserPreferencedCurrencyDisplay from '../user-preferenced-currency-display'
import { PRIMARY } from '../../constants/common'
const {
SETTINGS_ROUTE,
@ -163,7 +163,6 @@ AccountMenu.prototype.renderAccounts = function () {
const isSelected = identity.address === selectedAddress
const balanceValue = accounts[address] ? accounts[address].balance : ''
const formattedBalance = balanceValue ? formatBalance(balanceValue, 6) : '...'
const simpleAddress = identity.address.substring(2).toLowerCase()
const keyring = keyrings.find((kr) => {
@ -189,7 +188,11 @@ AccountMenu.prototype.renderAccounts = function () {
h('div.account-menu__account-info', [
h('div.account-menu__name', identity.name || ''),
h('div.account-menu__balance', formattedBalance),
h(UserPreferencedCurrencyDisplay, {
className: 'account-menu__balance',
value: balanceValue,
type: PRIMARY,
}),
]),
this.renderKeyringType(keyring),

View File

@ -0,0 +1,34 @@
import PropTypes from 'prop-types'
import React, {PureComponent} from 'react'
export default class AddTokenButton extends PureComponent {
static contextTypes = {
t: PropTypes.func.isRequired,
}
static defaultProps = {
onClick: () => {},
}
static propTypes = {
onClick: PropTypes.func,
}
render () {
const { t } = this.context
const { onClick } = this.props
return (
<div className="add-token-button">
<h1 className="add-token-button__help-header">{t('missingYourTokens')}</h1>
<p className="add-token-button__help-desc">{t('clickToAdd', [t('addToken')])}</p>
<div
className="add-token-button__button"
onClick={onClick}
>
{t('addToken')}
</div>
</div>
)
}
}

View File

@ -0,0 +1 @@
export { default } from './add-token-button.component'

View File

@ -0,0 +1,26 @@
.add-token-button {
display: flex;
flex-direction: column;
color: lighten($scorpion, 25%);
width: 185px;
margin: 36px auto;
text-align: center;
&__help-header {
font-weight: bold;
font-size: 1rem;
}
&__help-desc {
font-size: 0.75rem;
margin-top: 1rem;
}
&__button {
font-size: 0.75rem;
margin: 1rem;
text-transform: uppercase;
color: $curious-blue;
cursor: pointer;
}
}

View File

@ -4,10 +4,11 @@ const h = require('react-hyperscript')
const inherits = require('util').inherits
const TokenBalance = require('./token-balance')
const Identicon = require('./identicon')
import CurrencyDisplay from './currency-display'
import UserPreferencedCurrencyDisplay from './user-preferenced-currency-display'
import { PRIMARY, SECONDARY } from '../constants/common'
const { getAssetImages, conversionRateSelector, getCurrentCurrency} = require('../selectors')
const { formatBalance, generateBalanceObject } = require('../util')
const { formatBalance } = require('../util')
module.exports = connect(mapStateToProps)(BalanceComponent)
@ -65,7 +66,7 @@ BalanceComponent.prototype.renderTokenBalance = function () {
BalanceComponent.prototype.renderBalance = function () {
const props = this.props
const { shorten, account } = props
const { account } = props
const balanceValue = account && account.balance
const needsParse = 'needsParse' in props ? props.needsParse : true
const formattedBalance = balanceValue ? formatBalance(balanceValue, 6, needsParse) : '...'
@ -80,25 +81,20 @@ BalanceComponent.prototype.renderBalance = function () {
}
return h('div.flex-column.balance-display', {}, [
h('div.token-amount', {
style: {},
}, this.getTokenBalance(formattedBalance, shorten)),
showFiat && h(CurrencyDisplay, {
h('div.token-amount', {}, h(UserPreferencedCurrencyDisplay, {
value: balanceValue,
type: PRIMARY,
ethNumberOfDecimals: 3,
})),
showFiat && h(UserPreferencedCurrencyDisplay, {
value: balanceValue,
type: SECONDARY,
ethNumberOfDecimals: 3,
}),
])
}
BalanceComponent.prototype.getTokenBalance = function (formattedBalance, shorten) {
const balanceObj = generateBalanceObject(formattedBalance, shorten ? 1 : 3)
const balanceValue = shorten ? balanceObj.shortBalance : balanceObj.balance
const label = balanceObj.label
return `${balanceValue} ${label}`
}
BalanceComponent.prototype.getFiatDisplayNumber = function (formattedBalance, conversionRate) {
if (formattedBalance === 'None') return formattedBalance
if (conversionRate === 0) return 'N/A'

View File

@ -1,16 +1,19 @@
import React from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import UserPreferencedCurrencyDisplay from '../../user-preferenced-currency-display'
import { PRIMARY, SECONDARY } from '../../../constants/common'
const ConfirmDetailRow = props => {
const {
label,
fiatText,
ethText,
primaryText,
secondaryText,
onHeaderClick,
fiatTextColor,
primaryValueTextColor,
headerText,
headerTextClassName,
value,
} = props
return (
@ -25,28 +28,57 @@ const ConfirmDetailRow = props => {
>
{ headerText }
</div>
<div
className="confirm-detail-row__fiat"
style={{ color: fiatTextColor }}
>
{ fiatText }
</div>
<div className="confirm-detail-row__eth">
{ ethText }
</div>
{
primaryText
? (
<div
className="confirm-detail-row__primary"
style={{ color: primaryValueTextColor }}
>
{ primaryText }
</div>
) : (
<UserPreferencedCurrencyDisplay
className="confirm-detail-row__primary"
type={PRIMARY}
value={value}
showEthLogo
ethLogoHeight="18"
style={{ color: primaryValueTextColor }}
hideLabel
/>
)
}
{
secondaryText
? (
<div className="confirm-detail-row__secondary">
{ secondaryText }
</div>
) : (
<UserPreferencedCurrencyDisplay
className="confirm-detail-row__secondary"
type={SECONDARY}
value={value}
showEthLogo
hideLabel
/>
)
}
</div>
</div>
)
}
ConfirmDetailRow.propTypes = {
label: PropTypes.string,
fiatText: PropTypes.string,
ethText: PropTypes.string,
fiatTextColor: PropTypes.string,
onHeaderClick: PropTypes.func,
headerText: PropTypes.string,
headerTextClassName: PropTypes.string,
label: PropTypes.string,
onHeaderClick: PropTypes.func,
primaryValueTextColor: PropTypes.string,
primaryText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
secondaryText: PropTypes.string,
value: PropTypes.string,
}
export default ConfirmDetailRow

View File

@ -18,18 +18,14 @@
min-width: 0;
}
&__fiat {
&__primary {
font-size: 1.5rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
justify-content: flex-end;
}
&__eth {
&__secondary {
color: $oslo-gray;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
justify-content: flex-end;
}
&__header-text {

View File

@ -12,17 +12,19 @@ describe('Confirm Detail Row Component', function () {
let wrapper
beforeEach(() => {
wrapper = shallow(<ConfirmDetailRow
errorType={'mockErrorType'}
label={'mockLabel'}
showError={false}
fiatText = {'mockFiatText'}
ethText = {'mockEthText'}
fiatTextColor= {'mockColor'}
onHeaderClick= {propsMethodSpies.onHeaderClick}
headerText = {'mockHeaderText'}
headerTextClassName = {'mockHeaderClass'}
/>)
wrapper = shallow(
<ConfirmDetailRow
errorType={'mockErrorType'}
label={'mockLabel'}
showError={false}
primaryText = {'mockFiatText'}
secondaryText = {'mockEthText'}
primaryValueTextColor= {'mockColor'}
onHeaderClick= {propsMethodSpies.onHeaderClick}
headerText = {'mockHeaderText'}
headerTextClassName = {'mockHeaderClass'}
/>
)
})
describe('render', () => {
@ -38,16 +40,16 @@ describe('Confirm Detail Row Component', function () {
assert.equal(wrapper.find('.confirm-detail-row__details > .confirm-detail-row__header-text').childAt(0).text(), 'mockHeaderText')
})
it('should render the fiatText as a child of the confirm-detail-row__fiat', () => {
assert.equal(wrapper.find('.confirm-detail-row__details > .confirm-detail-row__fiat').childAt(0).text(), 'mockFiatText')
it('should render the primaryText as a child of the confirm-detail-row__primary', () => {
assert.equal(wrapper.find('.confirm-detail-row__details > .confirm-detail-row__primary').childAt(0).text(), 'mockFiatText')
})
it('should render the ethText as a child of the confirm-detail-row__eth', () => {
assert.equal(wrapper.find('.confirm-detail-row__details > .confirm-detail-row__eth').childAt(0).text(), 'mockEthText')
it('should render the ethText as a child of the confirm-detail-row__secondary', () => {
assert.equal(wrapper.find('.confirm-detail-row__details > .confirm-detail-row__secondary').childAt(0).text(), 'mockEthText')
})
it('should set the fiatTextColor on confirm-detail-row__fiat', () => {
assert.equal(wrapper.find('.confirm-detail-row__fiat').props().style.color, 'mockColor')
it('should set the fiatTextColor on confirm-detail-row__primary', () => {
assert.equal(wrapper.find('.confirm-detail-row__primary').props().style.color, 'mockColor')
})
it('should assure the confirm-detail-row__header-text classname is correct', () => {
@ -58,7 +60,5 @@ describe('Confirm Detail Row Component', function () {
wrapper.find('.confirm-detail-row__header-text').props().onClick()
assert.equal(assert.equal(propsMethodSpies.onHeaderClick.callCount, 1))
})
})
})

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