|
|
@ -423,7 +423,6 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
//=============================================================================
|
|
|
|
// VAULT / KEYRING RELATED METHODS
|
|
|
|
// VAULT / KEYRING RELATED METHODS
|
|
|
|
//=============================================================================
|
|
|
|
//=============================================================================
|
|
|
@ -537,6 +536,8 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
async connectHardware (deviceName, page) { |
|
|
|
async connectHardware (deviceName, page) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (deviceName) { |
|
|
|
|
|
|
|
case 'trezor': |
|
|
|
const keyringController = this.keyringController |
|
|
|
const keyringController = this.keyringController |
|
|
|
const keyring = await keyringController.getKeyringsByType( |
|
|
|
const keyring = await keyringController.getKeyringsByType( |
|
|
|
'Trezor Hardware' |
|
|
|
'Trezor Hardware' |
|
|
@ -546,10 +547,12 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const accounts = await keyring.getPage(page) |
|
|
|
const accounts = await keyring.getPage(page) |
|
|
|
|
|
|
|
|
|
|
|
this.accountTracker.syncWithAddresses(accounts.map(a => a.address)) |
|
|
|
this.accountTracker.syncWithAddresses(accounts.map(a => a.address)) |
|
|
|
|
|
|
|
|
|
|
|
return accounts |
|
|
|
return accounts |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
throw new Error('MetamaskController - Unknown device') |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -1037,7 +1040,7 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
* Allows a user to begin the seed phrase recovery process. |
|
|
|
* Allows a user to begin the seed phrase recovery process. |
|
|
|
* @param {Function} cb - A callback function called when complete. |
|
|
|
* @param {Function} cb - A callback function called when complete. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
markPasswordForgotten(cb) { |
|
|
|
markPasswordForgotten (cb) { |
|
|
|
this.configManager.setPasswordForgotten(true) |
|
|
|
this.configManager.setPasswordForgotten(true) |
|
|
|
this.sendUpdate() |
|
|
|
this.sendUpdate() |
|
|
|
cb() |
|
|
|
cb() |
|
|
@ -1047,7 +1050,7 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
* Allows a user to end the seed phrase recovery process. |
|
|
|
* Allows a user to end the seed phrase recovery process. |
|
|
|
* @param {Function} cb - A callback function called when complete. |
|
|
|
* @param {Function} cb - A callback function called when complete. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
unMarkPasswordForgotten(cb) { |
|
|
|
unMarkPasswordForgotten (cb) { |
|
|
|
this.configManager.setPasswordForgotten(false) |
|
|
|
this.configManager.setPasswordForgotten(false) |
|
|
|
this.sendUpdate() |
|
|
|
this.sendUpdate() |
|
|
|
cb() |
|
|
|
cb() |
|
|
|