@onekeyfe/hwk-keystone-adapter 1.2.8-alpha.50 → 1.2.8-alpha.53
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 +19 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -4
- 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("/")
|
|
@@ -1883,7 +1887,18 @@ var KeystoneAdapter = class _KeystoneAdapter {
|
|
|
1883
1887
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
1884
1888
|
const pending = this._usbConnectTail.then(async () => {
|
|
1885
1889
|
_KeystoneAdapter._throwIfAborted(signal);
|
|
1886
|
-
|
|
1890
|
+
if (this._unsettledUsbOperations.size > 0) {
|
|
1891
|
+
return failure(
|
|
1892
|
+
HardwareErrorCode2.DeviceBusyInternal,
|
|
1893
|
+
"Keystone USB is still finishing an earlier request"
|
|
1894
|
+
);
|
|
1895
|
+
}
|
|
1896
|
+
const releaseConnect = this._retainUsbOperation("connect");
|
|
1897
|
+
try {
|
|
1898
|
+
return await this._connectUsbExclusive(connector, expected, searchTargetId, signal);
|
|
1899
|
+
} finally {
|
|
1900
|
+
releaseConnect();
|
|
1901
|
+
}
|
|
1887
1902
|
});
|
|
1888
1903
|
const settled = pending.finally(() => {
|
|
1889
1904
|
signal.removeEventListener("abort", onAbort);
|