1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.keyFromPath = void 0;
|
4 | const hdkdEcdsa_js_1 = require("./hdkdEcdsa.js");
|
5 | const hdkdEd25519_js_1 = require("./hdkdEd25519.js");
|
6 | const hdkdSr25519_js_1 = require("./hdkdSr25519.js");
|
7 | const generators = {
|
8 | ecdsa: hdkdEcdsa_js_1.keyHdkdEcdsa,
|
9 | ed25519: hdkdEd25519_js_1.keyHdkdEd25519,
|
10 |
|
11 | ethereum: hdkdEcdsa_js_1.keyHdkdEcdsa,
|
12 | sr25519: hdkdSr25519_js_1.keyHdkdSr25519
|
13 | };
|
14 | function keyFromPath(pair, path, type) {
|
15 | const keyHdkd = generators[type];
|
16 | let result = pair;
|
17 | for (const junction of path) {
|
18 | result = keyHdkd(result, junction);
|
19 | }
|
20 | return result;
|
21 | }
|
22 | exports.keyFromPath = keyFromPath;
|