cosmjs-util/packages/faucet/src/hdpaths.ts
2020-01-30 07:36:44 +01:00

11 lines
354 B
TypeScript

import { Slip10RawIndex } from "@iov/crypto";
export function debugPath(path: readonly Slip10RawIndex[]): string {
return path.reduce((current, component): string => {
const componentString = component.isHardened()
? `${component.toNumber() - 2 ** 31}'`
: component.toString();
return current + "/" + componentString;
}, "m");
}