mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-27 16:18:00 +00:00
12 lines
430 B
JavaScript
12 lines
430 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.createSeedDeriveFn = createSeedDeriveFn;
|
|
function createSeedDeriveFn(fromSeed, derive) {
|
|
return (keypair, { chainCode, isHard }) => {
|
|
if (!isHard) {
|
|
throw new Error('A soft key was found in the path and is not supported');
|
|
}
|
|
return fromSeed(derive(keypair.secretKey.subarray(0, 32), chainCode));
|
|
};
|
|
}
|