1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const bip39_1 = require("ethereum-cryptography/bip39");
|
4 | const hdkey_1 = require("ethereum-cryptography/hdkey");
|
5 | function 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 | }
|
11 | exports.deriveKeyFromMnemonicAndPath = deriveKeyFromMnemonicAndPath;
|
12 |
|
\ | No newline at end of file |