if (!(data.seed instanceof ArrayBuffer)) {
throw new TypeError('Invalid wallet seed')
}
- if (['load', 'verify'].includes(action)) {
+ if (['load', 'verify'].includes(action)) {
seed = data.seed.slice()
}
new Uint8Array(data.seed).fill(0)
- delete data.seed
+ delete data.seed
}
// Mnemonic phrase to load
if ('encrypted' in data) {
if (action === 'unlock') {
if (!(data.encrypted instanceof ArrayBuffer)) {
- throw new TypeError('Invalid wallet encrypted secrets')
+ throw new TypeError('Invalid wallet encrypted secrets')
}
encrypted = data.encrypted.slice()
}
new Uint8Array(data.encrypted as ArrayBuffer).fill(0)
delete data.encrypted
- }
+ }
// Index for child account to derive or sign
if ((action === 'derive' || action === 'sign') && typeof data.index !== 'number') {
}
new Uint8Array(data.message as ArrayBuffer).fill(0)
delete data.message
- }
+ }
// Vault configuration
if (action === 'config') {