@onekeyfe/hwk-keystone-adapter 1.2.8-alpha.52 → 1.2.8-alpha.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -487,11 +487,15 @@ function isBip32Path(path) {
|
|
|
487
487
|
function splitAccountPath(path) {
|
|
488
488
|
const normalized = normalizePath(path);
|
|
489
489
|
const segments = normalized.slice(2).split("/");
|
|
490
|
-
|
|
490
|
+
let accountLength = 0;
|
|
491
|
+
segments.forEach((segment, index) => {
|
|
492
|
+
if (segment.endsWith("'")) accountLength = index + 1;
|
|
493
|
+
});
|
|
494
|
+
if (segments.length <= 3 || accountLength === 0 || accountLength === segments.length) {
|
|
491
495
|
return { accountPath: normalized, relativeDerivePath: "" };
|
|
492
496
|
}
|
|
493
|
-
const accountSegments = segments.slice(0,
|
|
494
|
-
const relativeSegments = segments.slice(
|
|
497
|
+
const accountSegments = segments.slice(0, accountLength);
|
|
498
|
+
const relativeSegments = segments.slice(accountLength);
|
|
495
499
|
return {
|
|
496
500
|
accountPath: `m/${accountSegments.join("/")}`,
|
|
497
501
|
relativeDerivePath: relativeSegments.join("/")
|