diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-08-10 23:56:56 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-08-10 23:56:56 +0800 |
commit | e905c9f055cf9a5efbfa67a5371f2224934c49ab (patch) | |
tree | b83fc79a2e084244c78b4a6901134def99bbbb65 | |
parent | 814c642d952b8271508b8b091d640084897aedd5 (diff) | |
download | tangerine-wallet-browser-e905c9f055cf9a5efbfa67a5371f2224934c49ab.tar tangerine-wallet-browser-e905c9f055cf9a5efbfa67a5371f2224934c49ab.tar.gz tangerine-wallet-browser-e905c9f055cf9a5efbfa67a5371f2224934c49ab.tar.bz2 tangerine-wallet-browser-e905c9f055cf9a5efbfa67a5371f2224934c49ab.tar.lz tangerine-wallet-browser-e905c9f055cf9a5efbfa67a5371f2224934c49ab.tar.xz tangerine-wallet-browser-e905c9f055cf9a5efbfa67a5371f2224934c49ab.tar.zst tangerine-wallet-browser-e905c9f055cf9a5efbfa67a5371f2224934c49ab.zip |
hide export private key for trezor accounts
-rw-r--r-- | package-lock.json | 60 | ||||
-rw-r--r-- | ui/app/components/modals/account-details-modal.js | 18 |
2 files changed, 46 insertions, 32 deletions
diff --git a/package-lock.json b/package-lock.json index db3e746c5..aa2c48b09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3589,6 +3589,7 @@ "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "dev": true, "requires": { "babel-runtime": "^6.26.0", "core-js": "^2.5.0", @@ -3598,7 +3599,8 @@ "regenerator-runtime": { "version": "0.10.5", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", - "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true } } }, @@ -8558,13 +8560,12 @@ "resolved": "https://registry.npmjs.org/eth-sig-util/-/eth-sig-util-1.4.2.tgz", "integrity": "sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=", "requires": { - "ethereumjs-abi": "git+https://github.com/ethereumjs/ethereumjs-abi.git#00ba8463a7f7a67fcad737ff9c2ebd95643427f7", "ethereumjs-util": "^5.1.1" }, "dependencies": { "ethereumjs-abi": { "version": "git+https://github.com/ethereumjs/ethereumjs-abi.git#00ba8463a7f7a67fcad737ff9c2ebd95643427f7", - "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git", + "from": "git+https://github.com/ethereumjs/ethereumjs-abi.git#00ba8463a7f7a67fcad737ff9c2ebd95643427f7", "requires": { "bn.js": "^4.10.0", "ethereumjs-util": "^5.0.0" @@ -8839,6 +8840,28 @@ "safe-buffer": "^5.1.1", "secp256k1": "^3.0.1" } + }, + "trezor-connect": { + "version": "5.0.29", + "resolved": "https://registry.npmjs.org/trezor-connect/-/trezor-connect-5.0.29.tgz", + "integrity": "sha512-+TLoriQf5oEwFWiV2LDe68OVk9YfucHyoV01ehK2X9p0WmyFMsgWt/Y5M01nDXHASEl4WMKUD5t3+UHDorDrYQ==", + "requires": { + "babel-runtime": "^6.26.0", + "events": "^1.1.1", + "whatwg-fetch": "^2.0.4" + }, + "dependencies": { + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" + } + } + }, + "whatwg-fetch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" } } }, @@ -30237,24 +30260,6 @@ "resolved": "https://registry.npmjs.org/treeify/-/treeify-1.1.0.tgz", "integrity": "sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==" }, - "trezor-connect": { - "version": "5.0.28", - "resolved": "https://registry.npmjs.org/trezor-connect/-/trezor-connect-5.0.28.tgz", - "integrity": "sha512-v+4dJ6mnHXXy7rMco6+MZ9RZZHyk59QgJzhH1OP4t8Xr2zhbMfkTA9S2y7ItknWTX1Y4njBshKTgxjXW9xYt+A==", - "requires": { - "babel-polyfill": "^6.26.0", - "babel-runtime": "^6.26.0", - "events": "^1.1.1", - "whatwg-fetch": "^2.0.4" - }, - "dependencies": { - "whatwg-fetch": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", - "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" - } - } - }, "trim": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", @@ -30425,7 +30430,6 @@ "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, "requires": { "is-typedarray": "^1.0.0" } @@ -31430,7 +31434,6 @@ "resolved": "https://registry.npmjs.org/web3/-/web3-0.20.3.tgz", "integrity": "sha1-yqRDc9yIFayHZ73ba6cwc5ZMqos=", "requires": { - "bignumber.js": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", "crypto-js": "^3.1.4", "utf8": "^2.1.1", "xhr2": "*", @@ -31439,7 +31442,7 @@ "dependencies": { "bignumber.js": { "version": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934", - "from": "git+https://github.com/frozeman/bignumber.js-nolookahead.git" + "from": "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934" } } }, @@ -31938,8 +31941,7 @@ "dev": true, "requires": { "underscore": "1.8.3", - "web3-core-helpers": "1.0.0-beta.34", - "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2" + "web3-core-helpers": "1.0.0-beta.34" }, "dependencies": { "underscore": { @@ -31950,8 +31952,7 @@ }, "websocket": { "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", - "from": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible", - "dev": true, + "from": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2", "requires": { "debug": "^2.2.0", "nan": "^2.3.3", @@ -33292,8 +33293,7 @@ "yaeti": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", - "dev": true + "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" }, "yallist": { "version": "2.1.2", diff --git a/ui/app/components/modals/account-details-modal.js b/ui/app/components/modals/account-details-modal.js index 5607cf051..049c75eee 100644 --- a/ui/app/components/modals/account-details-modal.js +++ b/ui/app/components/modals/account-details-modal.js @@ -14,6 +14,7 @@ function mapStateToProps (state) { return { network: state.metamask.network, selectedIdentity: getSelectedIdentity(state), + keyrings: state.metamask.keyrings, } } @@ -50,9 +51,20 @@ AccountDetailsModal.prototype.render = function () { network, showExportPrivateKeyModal, setAccountLabel, + keyrings, } = this.props const { name, address } = selectedIdentity + const keyring = keyrings.find((kr) => { + return kr.accounts.includes(address) + }) + + let exportPrivateKeyFeatureEnabled = true + if (keyring.type === 'Trezor Hardware') { + exportPrivateKeyFeatureEnabled = false + } + + return h(AccountModalContainer, {}, [ h(EditableLabel, { className: 'account-modal__name', @@ -73,9 +85,11 @@ AccountDetailsModal.prototype.render = function () { }, this.context.t('etherscanView')), // Holding on redesign for Export Private Key functionality - h('button.btn-primary.account-modal__button', { + // This feature is disabled for TREZOR accounts + + exportPrivateKeyFeatureEnabled ? h('button.btn-primary.account-modal__button', { onClick: () => showExportPrivateKeyModal(), - }, this.context.t('exportPrivateKey')), + }, this.context.t('exportPrivateKey')) : null, ]) } |