Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw new Error(`invalid seed: ${seed}`);
}
if (typeof seed === 'string') {
try {
seed = Seed.decode(seed).seed;
} catch (e) {
throw new Error(`could not decode seed: ${seed}`);
}
}
const keyPair = generateAccountFromSeed(seed);
if (!Buffer.isBuffer(message)) {
message = Buffer.from(message);
}
return Buffer.from(NaclWrapper.sign(message, keyPair.sk));
}