Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then((result) => {
if (!result || result.event !== 'connect') {
this._onConnectReject();
throw new Error(`Message event is not valid: ${result.event}`);
}
this._onConnectResolve();
const publicKeyTo = result.payload;
const { publicKey, privateKey } = keyPair(seedUtils.generateNewSeed(SEED_LENGTH));
return this._storageExporter.export(
privateKey,
publicKeyTo
).then((data) => {
return this._provider.send(JSON.stringify({
event: 'data',
payload: {
publicKey,
data
}
}), { event: 'data' });
});
}).then((result) => {
if (result.payload === 'ok') {