UNPKG

@metamask/snaps-simulation

Version:

A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment

29 lines 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getGetMnemonicSeedImplementation = void 0; const key_tree_1 = require("@metamask/key-tree"); const constants_1 = require("../../constants.cjs"); /** * Get the implementation of the `getMnemonicSeed` method. * * @param defaultSecretRecoveryPhrase - The default secret recovery phrase to * use. * @returns The implementation of the `getMnemonicSeed` method. */ function getGetMnemonicSeedImplementation(defaultSecretRecoveryPhrase = constants_1.DEFAULT_SRP) { return async (source) => { if (!source) { return (0, key_tree_1.mnemonicToSeed)(defaultSecretRecoveryPhrase); } switch (source) { case 'default': return (0, key_tree_1.mnemonicToSeed)(defaultSecretRecoveryPhrase); case 'alternative': return (0, key_tree_1.mnemonicToSeed)(constants_1.DEFAULT_ALTERNATIVE_SRP); default: throw new Error(`Entropy source with ID "${source}" not found.`); } }; } exports.getGetMnemonicSeedImplementation = getGetMnemonicSeedImplementation; //# sourceMappingURL=get-mnemonic-seed.cjs.map