UNPKG

593 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const bip39_1 = require("ethereum-cryptography/bip39");
4const hdkey_1 = require("ethereum-cryptography/hdkey");
5function deriveKeyFromMnemonicAndPath(mnemonic, hdPath) {
6 const seed = bip39_1.mnemonicToSeedSync(mnemonic);
7 const masterKey = hdkey_1.HDKey.fromMasterSeed(seed);
8 const derived = masterKey.derive(hdPath);
9 return derived.privateKey === null ? undefined : derived.privateKey;
10}
11exports.deriveKeyFromMnemonicAndPath = deriveKeyFromMnemonicAndPath;
12//# sourceMappingURL=keys-derivation.js.map
\No newline at end of file