You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
966 B
31 lines
966 B
7 years ago
|
/* eslint no-console: 0 */ // --> OFF
|
||
|
|
||
|
import * as walletController from '../methods/walletController'
|
||
|
|
||
|
export default function (walletUnlocker, event, msg, data) {
|
||
|
switch (msg) {
|
||
|
case 'genSeed':
|
||
|
walletController.genSeed(walletUnlocker)
|
||
|
.then(data => {
|
||
|
console.log('data yo: ', data)
|
||
|
event.sender.send('receiveSeed', data)
|
||
|
})
|
||
|
.catch(error => {
|
||
|
console.log('genSeed error: ', error)
|
||
|
event.sender.send('receiveSeedError', error)
|
||
|
})
|
||
|
break
|
||
|
case 'unlockWallet':
|
||
|
walletController.unlockWallet(walletUnlocker, data)
|
||
|
.then(data => event.sender.send('walletUnlocked'))
|
||
|
.catch(error => event.sender.send('unlockWalletError'))
|
||
|
break
|
||
|
case 'initWallet':
|
||
|
walletController.initWallet(walletUnlocker, data)
|
||
|
.then(data => event.sender.send('successfullyCreatedWallet'))
|
||
|
.catch(error => console.log('initWallet error: ', error))
|
||
|
break
|
||
|
default:
|
||
|
}
|
||
|
}
|