mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 09:08:03 +00:00
chore: update to version 14.0.11 and align website URLs
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { keyHdkdEcdsa } from './hdkdEcdsa.js';
|
||||
import { keyHdkdEd25519 } from './hdkdEd25519.js';
|
||||
import { keyHdkdSr25519 } from './hdkdSr25519.js';
|
||||
const generators = {
|
||||
ecdsa: keyHdkdEcdsa,
|
||||
ed25519: keyHdkdEd25519,
|
||||
// FIXME This is Substrate-compatible, not Ethereum-compatible
|
||||
ethereum: keyHdkdEcdsa,
|
||||
sr25519: keyHdkdSr25519
|
||||
};
|
||||
export function keyFromPath(pair, path, type) {
|
||||
const keyHdkd = generators[type];
|
||||
let result = pair;
|
||||
for (const junction of path) {
|
||||
result = keyHdkd(result, junction);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user