From 2afc06287dfd1a87bd247234c9a04b92a8394cac Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 3 Nov 2016 15:40:23 -0700 Subject: Implement private key exporting. --- app/scripts/keyring-controller.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/scripts/keyring-controller.js') 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) { -- cgit v1.2.3