mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 07:57:59 +00:00
9 lines
311 B
JavaScript
9 lines
311 B
JavaScript
export 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));
|
|
};
|
|
}
|