diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-11-04 06:40:23 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-11-04 06:40:23 +0800 |
commit | 2afc06287dfd1a87bd247234c9a04b92a8394cac (patch) | |
tree | 246d62342150415b391582486405bc728a7a0419 /app/scripts/keyring-controller.js | |
parent | e0246975a7a40a72cc68fb3dbe5782c9c219fea2 (diff) | |
download | tangerine-wallet-browser-2afc06287dfd1a87bd247234c9a04b92a8394cac.tar tangerine-wallet-browser-2afc06287dfd1a87bd247234c9a04b92a8394cac.tar.gz tangerine-wallet-browser-2afc06287dfd1a87bd247234c9a04b92a8394cac.tar.bz2 tangerine-wallet-browser-2afc06287dfd1a87bd247234c9a04b92a8394cac.tar.lz tangerine-wallet-browser-2afc06287dfd1a87bd247234c9a04b92a8394cac.tar.xz tangerine-wallet-browser-2afc06287dfd1a87bd247234c9a04b92a8394cac.tar.zst tangerine-wallet-browser-2afc06287dfd1a87bd247234c9a04b92a8394cac.zip |
Implement private key exporting.
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r-- | app/scripts/keyring-controller.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 505414c88..aa303c43c 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -353,7 +353,6 @@ module.exports = class KeyringController extends EventEmitter { gasMultiplier: configManager.getGasMultiplier() || 1, } - console.log('addUnconfirmedTransaction:', txData) // keep the onTxDoneCb around for after approval/denial (requires user interaction) // This onTxDoneCb fires completion to the Dapp's write operation. @@ -525,7 +524,13 @@ module.exports = class KeyringController extends EventEmitter { } exportAccount(address, cb) { - cb(null, '0xPrivateKey') + try { + const keyring = this.getKeyringForAccount(address) + const privateKey = keyring.exportAccount(normalize(address)) + cb(null, privateKey) + } catch (e) { + cb(e) + } } getNetwork(err) { |