mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
parent
ab31eb6a17
commit
d7f384485d
@ -337,7 +337,7 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
// KeyringController
|
// KeyringController
|
||||||
setLocked: nodeify(keyringController.setLocked, keyringController),
|
setLocked: nodeify(keyringController.setLocked, keyringController),
|
||||||
createNewVaultAndKeychain: this.createNewVaultAndKeychain.bind(this),
|
createNewVaultAndKeychain: this.createNewVaultAndKeychain.bind(this),
|
||||||
createNewVaultAndRestore: nodeify(keyringController.createNewVaultAndRestore, keyringController),
|
createNewVaultAndRestore: this.createNewVaultAndRestore.bind(this),
|
||||||
addNewKeyring: nodeify(keyringController.addNewKeyring, keyringController),
|
addNewKeyring: nodeify(keyringController.addNewKeyring, keyringController),
|
||||||
saveAccountLabel: nodeify(keyringController.saveAccountLabel, keyringController),
|
saveAccountLabel: nodeify(keyringController.saveAccountLabel, keyringController),
|
||||||
exportAccount: nodeify(keyringController.exportAccount, keyringController),
|
exportAccount: nodeify(keyringController.exportAccount, keyringController),
|
||||||
@ -461,14 +461,28 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
createNewVaultAndKeychain (password, cb) {
|
createNewVaultAndKeychain (password, cb) {
|
||||||
this.keyringController.createNewVaultAndKeychain(password)
|
this.keyringController.createNewVaultAndKeychain(password)
|
||||||
.then((vault) => {
|
.then((vault) => {
|
||||||
const { identities } = vault
|
this.selectFirstIdentity(vault)
|
||||||
const address = Object.keys(identities)[0]
|
|
||||||
this.preferencesController.setSelectedAddress(address)
|
this.preferencesController.setSelectedAddress(address)
|
||||||
cb(null, vault)
|
cb(null, vault)
|
||||||
})
|
})
|
||||||
.catch(reason => cb(reason))
|
.catch(reason => cb(reason))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createNewVaultAndRestore (password, seed, cb) {
|
||||||
|
this.keyringController.createNewVaultAndRestore(password, seed)
|
||||||
|
.then((vault) => {
|
||||||
|
this.selectFirstIdentity(vault)
|
||||||
|
cb(null, vault)
|
||||||
|
})
|
||||||
|
.catch(reason => cb(reason))
|
||||||
|
}
|
||||||
|
|
||||||
|
selectFirstIdentity (vault) {
|
||||||
|
const { identities } = vault
|
||||||
|
const address = Object.keys(identities)[0]
|
||||||
|
this.preferencesController.setSelectedAddress(address)
|
||||||
|
}
|
||||||
|
|
||||||
submitPassword (password, cb) {
|
submitPassword (password, cb) {
|
||||||
return this.keyringController.submitPassword(password)
|
return this.keyringController.submitPassword(password)
|
||||||
.then((newState) => { cb(null, newState) })
|
.then((newState) => { cb(null, newState) })
|
||||||
|
Loading…
Reference in New Issue
Block a user