Lambda function for generating a seed phrase using Bip39
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
bip39 package requried
npm install bip39
function generateMnemonic() {
let mnemonic;
let attempt = 0;
do {
attempt = attempt + 1;
mnemonic = bip39.generateMnemonic();
console.log(`${attempt} attempt trying menomic`, mnemonic);
} while (bip39.validateMnemonic(mnemonic) === false);
return mnemonic;
}