* @param {number} index - Index of the account
* @returns {Promise<Account>}
*/
-onmessage = async (event) => {
+onmessage = (event) => {
let result = null
const { type, seed, index } = event.data
switch (type) {
case 'bip44': {
- result = await ckdBip44(seed, index)
+ result = ckdBip44(seed, index).then(postMessage)
break
}
case 'blake2b': {
- result = await ckdBlake2b(seed, index)
+ result = ckdBlake2b(seed, index).then(postMessage)
break
}
case 'ledger': {
- result = await ckdLedger(seed, index)
+ result = ckdLedger(seed, index).then(postMessage)
break
}
}
- postMessage(result)
}
/**