opstack-kit-chains
Version:
Support your OP-Stack network with 'opstack-kit'
13 lines • 452 B
JavaScript
import { HDKey } from '@scure/bip32';
import { mnemonicToSeedSync } from '@scure/bip39';
import { hdKeyToAccount, } from './hdKeyToAccount.js';
/**
* @description Creates an Account from a mnemonic phrase.
*
* @returns A HD Account.
*/
export function mnemonicToAccount(mnemonic, opts = {}) {
const seed = mnemonicToSeedSync(mnemonic);
return hdKeyToAccount(HDKey.fromMasterSeed(seed), opts);
}
//# sourceMappingURL=mnemonicToAccount.js.map