UNPKG

1.08 kBTypeScriptView Raw
1/**
2 * @prettier
3 */
4/**
5 * BitGoJS includes some custom hand-rolled bip32 derivation logic in `bitcoin.ts`, which sadly
6 * has numerous bugs.
7 *
8 * One of the effects is that the methods accept invalid bip32 paths:
9 * - the `m` prefix is ignored ('m/0' === '0')
10 * - path components that cannot be parsed as base-10 numbers are mapped to `0` ('0/x' === '0/0')
11 * - path components with trailing characters after numerals are accepted, trailing characters
12 * are ignored ('1x' === '1')
13 *
14 * This probably does not cover everything but it should cover most bugs encountered in our code.
15 *
16 * This method attempts to convert a "legacy path", which may be invalid, to a standard bip32 path:
17 * meaning the result should be equivalent to the input path when passed to either our custom
18 * derivation log or when passed to a standard bip32 library.
19 *
20 * @param path - legacy path
21 * @return string - somewhat sanitized path that can be passed to standard bip32 libraries
22 */
23export declare function sanitizeLegacyPath(path: string): string;
24//# sourceMappingURL=bip32path.d.ts.map
\No newline at end of file