@xuxinlai2002/pns-js
Version:
A NPM package in Typescript for .Play Name Service
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