diff --git a/app/manifest.json b/app/manifest.json index 84cfc873e4..523d3da301 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,6 +1,6 @@ { "name": "MyEtherWallet CX", - "version": "3.6.4", + "version": "3.6.5", "manifest_version": 2, "description": "MyEtherWallet Chrome Extension", "homepage_url": "https://www.myetherwallet.com/", diff --git a/app/package.json b/app/package.json index ea36edf768..37f8275201 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "MyEtherWallet", - "version": "3.6.4", + "version": "3.6.5", "description": "An NPM dist of MyEtherWallet. For easier downloading & updating via CLI.", "author": "MyEtherWallet", "license": "ISC", diff --git a/chrome-extension/js/etherwallet-master.js b/chrome-extension/js/etherwallet-master.js index 217f6f966a..2ece13964c 100644 --- a/chrome-extension/js/etherwallet-master.js +++ b/chrome-extension/js/etherwallet-master.js @@ -121,7 +121,7 @@ module.exports=[{ },{}],6:[function(require,module,exports){ 'use strict'; -var ajaxReq = function () {}; +var ajaxReq = function ajaxReq() {}; ajaxReq.http = null; ajaxReq.postSerializer = null; ajaxReq.getETHvalue = null; @@ -131,7 +131,7 @@ module.exports = ajaxReq; },{}],7:[function(require,module,exports){ 'use strict'; -var bity = function () {}; +var bity = function bity() {}; bity.SERVERURL = "https://bity.myetherapi.com"; bity.decimals = 6; bity.ethExplorer = 'https://etherscan.io/tx/[[txHash]]'; @@ -202,7 +202,7 @@ module.exports = bity; },{}],8:[function(require,module,exports){ 'use strict'; -var addWalletCtrl = function ($scope, $sce) { +var addWalletCtrl = function addWalletCtrl($scope, $sce) { $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showBtnAddWallet = $scope.showAddWallet = $scope.requireFPass = $scope.requirePPass = $scope.showPassTxt = false; $scope.nickNames = []; $scope.filePassword = $scope.fileContent = ""; @@ -405,7 +405,7 @@ module.exports = addWalletCtrl; },{}],9:[function(require,module,exports){ 'use strict'; -var cxDecryptWalletCtrl = function ($scope, $sce, walletService) { +var cxDecryptWalletCtrl = function cxDecryptWalletCtrl($scope, $sce, walletService) { $scope.allWallets = []; $scope.selectedWallet = $scope.password = ""; $scope.setAllWallets = function () { @@ -456,7 +456,7 @@ module.exports = cxDecryptWalletCtrl; },{}],10:[function(require,module,exports){ 'use strict'; -var mainPopCtrl = function ($scope, $sce) { +var mainPopCtrl = function mainPopCtrl($scope, $sce) { $scope.allWallets = []; $scope.allWatchOnly = []; $scope.setAllWallets = function () { @@ -492,7 +492,7 @@ module.exports = mainPopCtrl; },{}],11:[function(require,module,exports){ 'use strict'; -var myWalletsCtrl = function ($scope, $sce, walletService) { +var myWalletsCtrl = function myWalletsCtrl($scope, $sce, walletService) { $scope.editModal = new Modal(document.getElementById('editWallet')); $scope.viewModal = new Modal(document.getElementById('viewWalletDetails')); $scope.removeModal = new Modal(document.getElementById('removeWallet')); @@ -651,7 +651,7 @@ module.exports = myWalletsCtrl; },{}],12:[function(require,module,exports){ 'use strict'; -var quickSendCtrl = function ($scope, $sce) { +var quickSendCtrl = function quickSendCtrl($scope, $sce) { $scope.allWallets = []; $scope.selectedWallet = ""; $scope.showConfirm = false; @@ -750,7 +750,7 @@ module.exports = quickSendCtrl; },{}],13:[function(require,module,exports){ 'use strict'; -var bulkGenCtrl = function ($scope) { +var bulkGenCtrl = function bulkGenCtrl($scope) { $scope.showWallets = false; $scope.genWallets = function () { if ($scope.amount == '' || $scope.amount != parseInt($scope.amount, 10)) alert(globalFuncs.errorMsgs[0]);else { @@ -782,7 +782,7 @@ module.exports = bulkGenCtrl; },{}],14:[function(require,module,exports){ 'use strict'; -var contractsCtrl = function ($scope, $sce, walletService) { +var contractsCtrl = function contractsCtrl($scope, $sce, walletService) { $scope.ajaxReq = ajaxReq; walletService.wallet = null; $scope.visibility = "interactView"; @@ -947,13 +947,14 @@ var contractsCtrl = function ($scope, $sce, walletService) { if (!$scope.Validator.isValidAddress($scope.contract.address)) throw globalFuncs.errorMsgs[5];else if (!$scope.Validator.isJSON($scope.contract.abi)) throw globalFuncs.errorMsgs[26]; $scope.contract.functions = []; var tAbi = JSON.parse($scope.contract.abi); - for (var i in tAbi) if (tAbi[i].type == "function") { - tAbi[i].inputs.map(function (i) { - i.value = ''; - }); - $scope.contract.functions.push(tAbi[i]); - } - $scope.showReadWrite = true; + for (var i in tAbi) { + if (tAbi[i].type == "function") { + tAbi[i].inputs.map(function (i) { + i.value = ''; + }); + $scope.contract.functions.push(tAbi[i]); + } + }$scope.showReadWrite = true; } catch (e) { $scope.notifier.danger(e); } @@ -974,7 +975,7 @@ module.exports = contractsCtrl; (function (Buffer){ 'use strict'; -var decryptWalletCtrl = function ($scope, $sce, walletService) { +var decryptWalletCtrl = function decryptWalletCtrl($scope, $sce, walletService) { $scope.walletType = ""; $scope.requireFPass = $scope.requirePPass = $scope.showFDecrypt = $scope.showPDecrypt = $scope.showAOnly = $scope.showParityDecrypt = false; $scope.filePassword = ""; @@ -1001,7 +1002,9 @@ var decryptWalletCtrl = function ($scope, $sce, walletService) { $scope.HDWallet.dPath = $scope.HDWallet.defaultDPath; $scope.mnemonicModel = new Modal(document.getElementById('mnemonicModel')); - $scope.onHDDPathChange = function (password = '') { + $scope.onHDDPathChange = function () { + var password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + $scope.HDWallet.numWallets = 0; if ($scope.walletType == 'pastemnemonic') { $scope.HDWallet.hdk = hd.HDKey.fromMasterSeed(hd.bip39.mnemonicToSeed($scope.manualmnemonic.trim(), password)); @@ -1031,7 +1034,7 @@ var decryptWalletCtrl = function ($scope, $sce, walletService) { $scope.showFDecrypt = $scope.filePassword.length >= 0; }; $scope.onPrivKeyChange = function () { - const manualprivkey = fixPkey($scope.manualprivkey); + var manualprivkey = fixPkey($scope.manualprivkey); $scope.requirePPass = manualprivkey.length == 128 || manualprivkey.length == 132; $scope.showPDecrypt = manualprivkey.length == 64; @@ -1117,10 +1120,10 @@ var decryptWalletCtrl = function ($scope, $sce, walletService) { $scope.wallet = { type: "addressOnly", address: $scope.addressOnly, - getAddressString: function () { + getAddressString: function getAddressString() { return this.address; }, - getChecksumAddressString: function () { + getChecksumAddressString: function getChecksumAddressString() { return ethUtil.toChecksumAddress(this.getAddressString()); }, setBalance: tempWallet.setBalance, @@ -1201,7 +1204,7 @@ module.exports = decryptWalletCtrl; },{"buffer":159}],16:[function(require,module,exports){ 'use strict'; -var footerCtrl = function ($scope, globalService) { +var footerCtrl = function footerCtrl($scope, globalService) { $scope.footerModal = new Modal(document.getElementById('disclaimerModal')); $scope.ethBlockNumber = "loading"; $scope.etcBlockNumber = "loading"; @@ -1222,7 +1225,7 @@ module.exports = footerCtrl; },{}],17:[function(require,module,exports){ 'use strict'; -var offlineTxCtrl = function ($scope, $sce, walletService) { +var offlineTxCtrl = function offlineTxCtrl($scope, $sce, walletService) { $scope.ajaxReq = ajaxReq; walletService.wallet = null; walletService.password = ''; @@ -1309,7 +1312,9 @@ var offlineTxCtrl = function ($scope, $sce, walletService) { $scope.dropdownEnabled = true; } }, true); - $scope.setSendMode = function (index, tokenSymbol = '') { + $scope.setSendMode = function (index) { + var tokenSymbol = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + $scope.tokenTx.id = index; if (index == 'ether') { $scope.unitReadable = ajaxReq.type; @@ -1390,7 +1395,7 @@ module.exports = offlineTxCtrl; },{}],18:[function(require,module,exports){ 'use strict'; -var sendTxCtrl = function ($scope, $sce, walletService) { +var sendTxCtrl = function sendTxCtrl($scope, $sce, walletService) { $scope.ajaxReq = ajaxReq; $scope.unitReadable = ajaxReq.type; $scope.sendTxModal = new Modal(document.getElementById('sendTransaction')); @@ -1419,7 +1424,10 @@ var sendTxCtrl = function ($scope, $sce, walletService) { tokenSymbol: globalFuncs.urlGet('tokenSymbol') == null ? false : globalFuncs.urlGet('tokenSymbol'), readOnly: globalFuncs.urlGet('readOnly') == null ? false : true }; - $scope.setSendMode = function (sendMode, tokenId = '', tokenSymbol = '') { + $scope.setSendMode = function (sendMode) { + var tokenId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + var tokenSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + $scope.tx.sendMode = sendMode; $scope.unitReadable = ''; if (sendMode == 'ether') { @@ -1446,7 +1454,7 @@ var sendTxCtrl = function ($scope, $sce, walletService) { } if ($scope.tx.sendMode != 'token') $scope.tokenTx.id = -1; }; - var applyScope = function () { + var applyScope = function applyScope() { if (!$scope.$$phase) $scope.$apply(); }; globalFuncs.urlGet('sendMode') == null ? $scope.setSendMode('ether') : $scope.setSendMode(globalFuncs.urlGet('sendMode')); @@ -1462,7 +1470,7 @@ var sendTxCtrl = function ($scope, $sce, walletService) { $scope.wallet.setBalance(applyScope); $scope.wallet.setTokens(); if ($scope.parentTxConfig) { - var setTxObj = function () { + var setTxObj = function setTxObj() { $scope.tx.to = $scope.parentTxConfig.to; $scope.tx.value = $scope.parentTxConfig.value; $scope.tx.sendMode = $scope.parentTxConfig.sendMode ? $scope.parentTxConfig.sendMode : 'ether'; @@ -1598,7 +1606,7 @@ module.exports = sendTxCtrl; (function (Buffer){ 'use strict'; -var signMsgCtrl = function ($scope, $sce, walletService) { +var signMsgCtrl = function signMsgCtrl($scope, $sce, walletService) { walletService.wallet = null; $scope.visibility = "signView"; $scope.$watch(function () { @@ -1657,7 +1665,7 @@ module.exports = signMsgCtrl; },{"buffer":159}],20:[function(require,module,exports){ 'use strict'; -var swapCtrl = function ($scope, $sce, walletService) { +var swapCtrl = function swapCtrl($scope, $sce, walletService) { var lStorageKey = "swapOrder"; $scope.ajaxReq = ajaxReq; $scope.Validator = Validator; @@ -1670,7 +1678,7 @@ var swapCtrl = function ($scope, $sce, walletService) { }, 30000); $scope.priceTicker = { ETHBTC: 1, ETHREP: 1, BTCREP: 1, BTCETH: 1, REPBTC: 1, REPETH: 1 }; $scope.availableCoins = ["ETH", "BTC", "REP"]; - var initValues = function () { + var initValues = function initValues() { $scope.showStage1 = true; $scope.showStage2 = $scope.showStage3Eth = $scope.showStage3Btc = false; $scope.orderResult = null; @@ -1694,7 +1702,7 @@ var swapCtrl = function ($scope, $sce, walletService) { greaterThanMax: 2, noErrors: 3 }; - var verify = function () { + var verify = function verify() { if (!$scope.bity.priceLoaded) return errors.priceNotLoaded;else if ($scope.swapOrder.toVal < bity.min || $scope.swapOrder.fromVal < bity.min) return errors.lessThanMin;else if ($scope.swapOrder.toCoin == "BTC" && $scope.swapOrder.toVal > bity.max || $scope.swapOrder.fromCoin == "BTC" && $scope.swapOrder.fromVal > bity.max) return errors.greaterThanMax;else if ($scope.swapOrder.toCoin == "ETH" && $scope.swapOrder.toVal * $scope.bity.curRate['ETHBTC'] > bity.max || $scope.swapOrder.fromCoin == "ETH" && $scope.swapOrder.fromVal * $scope.bity.curRate['ETHBTC'] > bity.max) return errors.greaterThanMax;else if ($scope.swapOrder.toCoin == "REP" && $scope.swapOrder.toVal * $scope.bity.curRate['REPBTC'] > bity.max || $scope.swapOrder.fromCoin == "REP" && $scope.swapOrder.fromVal * $scope.bity.curRate['REPBTC'] > bity.max) return errors.greaterThanMax; return errors.noErrors; }; @@ -1706,11 +1714,12 @@ var swapCtrl = function ($scope, $sce, walletService) { }; $scope.setOrderCoin = function (isFrom, coin) { if (isFrom) $scope.swapOrder.fromCoin = coin;else $scope.swapOrder.toCoin = coin; - if ($scope.swapOrder.fromCoin == $scope.swapOrder.toCoin) for (var i in $scope.availableCoins) if ($scope.availableCoins[i] != $scope.swapOrder.fromCoin) { - $scope.swapOrder.toCoin = $scope.availableCoins[i]; - break; - } - $scope.swapOrder.swapRate = $scope.bity.curRate[$scope.swapOrder.fromCoin + $scope.swapOrder.toCoin]; + if ($scope.swapOrder.fromCoin == $scope.swapOrder.toCoin) for (var i in $scope.availableCoins) { + if ($scope.availableCoins[i] != $scope.swapOrder.fromCoin) { + $scope.swapOrder.toCoin = $scope.availableCoins[i]; + break; + } + }$scope.swapOrder.swapRate = $scope.bity.curRate[$scope.swapOrder.fromCoin + $scope.swapOrder.toCoin]; $scope.swapOrder.swapPair = $scope.swapOrder.fromCoin + "/" + $scope.swapOrder.toCoin; $scope.updateEstimate(isFrom); $scope.dropdownFrom = $scope.dropdownTo = false; @@ -1730,27 +1739,27 @@ var swapCtrl = function ($scope, $sce, walletService) { $scope.notifier.danger(e); } }; - var getProgressBarArr = function (index, len) { + var getProgressBarArr = function getProgressBarArr(index, len) { var tempArr = []; for (var i = 0; i < len; i++) { if (i < index) tempArr.push('progress-true');else if (i == index) tempArr.push('progress-active');else tempArr.push(''); } return tempArr; }; - var isStorageOrderExists = function () { + var isStorageOrderExists = function isStorageOrderExists() { var order = localStorage.getItem(lStorageKey); return order && $scope.Validator.isJSON(order); }; - var setOrderFromStorage = function () { + var setOrderFromStorage = function setOrderFromStorage() { var order = JSON.parse(localStorage.getItem(lStorageKey)); $scope.orderResult = order; $scope.swapOrder = order.swapOrder; processOrder(); }; - var saveOrderToStorage = function (order) { + var saveOrderToStorage = function saveOrderToStorage(order) { localStorage.setItem(lStorageKey, JSON.stringify(order)); }; - var processOrder = function () { + var processOrder = function processOrder() { var orderResult = $scope.orderResult; orderResult.progress = { status: "OPEN", @@ -1863,7 +1872,7 @@ module.exports = swapCtrl; },{}],21:[function(require,module,exports){ 'use strict'; -var tabsCtrl = function ($scope, globalService, $translate, $sce) { +var tabsCtrl = function tabsCtrl($scope, globalService, $translate, $sce) { $scope.gService = globalService; $scope.tabNames = $scope.gService.tabs; $scope.curLang = 'English'; @@ -1899,9 +1908,11 @@ var tabsCtrl = function ($scope, globalService, $translate, $sce) { $scope.dropdownNode = false; Token.popTokens = $scope.curNode.tokenList; ajaxReq['key'] = key; - for (var attrname in $scope.curNode.lib) ajaxReq[attrname] = $scope.curNode.lib[attrname]; - for (var attrname in $scope.curNode) if (attrname != 'name' && attrname != 'tokenList' && attrname != 'lib') ajaxReq[attrname] = $scope.curNode[attrname]; - localStorage.setItem('curNode', JSON.stringify({ + for (var attrname in $scope.curNode.lib) { + ajaxReq[attrname] = $scope.curNode.lib[attrname]; + }for (var attrname in $scope.curNode) { + if (attrname != 'name' && attrname != 'tokenList' && attrname != 'lib') ajaxReq[attrname] = $scope.curNode[attrname]; + }localStorage.setItem('curNode', JSON.stringify({ key: key })); ajaxReq.getCurrentBlock(function (data) { @@ -1949,7 +1960,9 @@ var tabsCtrl = function ($scope, globalService, $translate, $sce) { var localNodes = localStorage.getItem('localNodes'); if (localNodes) { localNodes = JSON.parse(localNodes); - for (var i = 0; i < localNodes.length; i++) $scope.addCustomNodeToList(localNodes[i]); + for (var i = 0; i < localNodes.length; i++) { + $scope.addCustomNodeToList(localNodes[i]); + } } }; $scope.getCustomNodesFromStorage(); @@ -2017,8 +2030,11 @@ var tabsCtrl = function ($scope, globalService, $translate, $sce) { }; $scope.setErrorMsgLanguage = function () { - for (var i = 0; i < globalFuncs.errorMsgs.length; i++) $scope.setLanguageVal('ERROR_' + i, 'errorMsgs', i); - for (var i = 0; i < globalFuncs.successMsgs.length; i++) $scope.setLanguageVal('SUCCESS_' + (i + 1), 'successMsgs', i); + for (var i = 0; i < globalFuncs.errorMsgs.length; i++) { + $scope.setLanguageVal('ERROR_' + i, 'errorMsgs', i); + }for (var i = 0; i < globalFuncs.successMsgs.length; i++) { + $scope.setLanguageVal('SUCCESS_' + (i + 1), 'successMsgs', i); + } }; $scope.setGethErrMsgLanguage = function () { @@ -2106,7 +2122,7 @@ module.exports = tabsCtrl; },{}],22:[function(require,module,exports){ 'use strict'; -var viewCtrl = function ($scope, globalService, $sce) { +var viewCtrl = function viewCtrl($scope, globalService, $sce) { $scope.globalService = globalService; $scope.notifier = uiFuncs.notifier; $scope.notifier.sce = $sce; @@ -2117,7 +2133,7 @@ module.exports = viewCtrl; },{}],23:[function(require,module,exports){ 'use strict'; -var viewWalletCtrl = function ($scope, walletService) { +var viewWalletCtrl = function viewWalletCtrl($scope, walletService) { $scope.usdBalance = "loading"; $scope.eurBalance = "loading"; $scope.btcBalance = "loading"; @@ -2176,7 +2192,7 @@ module.exports = viewWalletCtrl; },{}],24:[function(require,module,exports){ 'use strict'; -var walletBalanceCtrl = function ($scope, $sce) { +var walletBalanceCtrl = function walletBalanceCtrl($scope, $sce) { $scope.ajaxReq = ajaxReq; $scope.localToken = { contractAdd: "", @@ -2228,7 +2244,7 @@ module.exports = walletBalanceCtrl; },{}],25:[function(require,module,exports){ 'use strict'; -var walletGenCtrl = function ($scope) { +var walletGenCtrl = function walletGenCtrl($scope) { $scope.password = ""; $scope.wallet = null; $scope.showWallet = false; @@ -2284,7 +2300,7 @@ module.exports = walletGenCtrl; },{}],26:[function(require,module,exports){ 'use strict'; -var cxFuncs = function () {}; +var cxFuncs = function cxFuncs() {}; cxFuncs.storage = chrome.storage.sync; cxFuncs.getAllNickNames = function (callback) { var nickNames = []; @@ -2372,7 +2388,7 @@ module.exports = cxFuncs; },{}],27:[function(require,module,exports){ 'use strict'; -var QRCodeDrtv = function () { +var QRCodeDrtv = function QRCodeDrtv() { return function (scope, element, attrs) { var watchVar = attrs.watchVar; scope.$watch(watchVar, function () { @@ -2398,15 +2414,15 @@ module.exports = QRCodeDrtv; },{}],28:[function(require,module,exports){ 'use strict'; -var addressFieldDrtv = function ($compile) { +var addressFieldDrtv = function addressFieldDrtv($compile) { return { restrict: "E", - link: function (scope, element, attrs) { + link: function link(scope, element, attrs) { var varName = attrs.varName; var varArr = varName.split('.'); var readOnly = attrs.readOnly ? attrs.readOnly : false; var placeholder = attrs.placeholder; - var setValue = function (value) { + var setValue = function setValue(value) { var temp = scope; for (var i in varArr) { if (i == varArr.length - 1) temp[varArr[i]] = value;else { @@ -2473,7 +2489,7 @@ scope.$watch('addressDrtv.ensAddressField', function() { },{}],29:[function(require,module,exports){ 'use strict'; -var balanceDrtv = function () { +var balanceDrtv = function balanceDrtv() { return { restrict: "E", template: '