@onekeyfe/hwk-adapter-core 1.2.11-alpha.5 → 1.2.11-alpha.8
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/{chunk-MVP46CIZ.js → chunk-P7RDL34T.js} +3 -3
- package/dist/{chunk-MVP46CIZ.js.map → chunk-P7RDL34T.js.map} +1 -1
- package/dist/{chunk-EJIHCWWH.js → chunk-UFNTICCX.js} +2 -9
- package/dist/chunk-UFNTICCX.js.map +1 -0
- package/dist/{chunk-VKP46GTC.mjs → chunk-V2OHL2JS.mjs} +1 -8
- package/dist/chunk-V2OHL2JS.mjs.map +1 -0
- package/dist/{chunk-5AIX6YY5.mjs → chunk-Z574MVAT.mjs} +2 -2
- package/dist/{errors-Cl6Q5lqG.d.mts → errors-DednD9bG.d.mts} +8 -10
- package/dist/{errors-Cl6Q5lqG.d.ts → errors-DednD9bG.d.ts} +8 -10
- package/dist/errors.d.mts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +2 -2
- package/dist/errors.mjs +1 -1
- package/dist/index.d.mts +3 -9
- package/dist/index.d.ts +3 -9
- package/dist/index.js +33 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -48
- package/dist/index.mjs.map +1 -1
- package/dist/ui-events.js +3 -3
- package/dist/ui-events.mjs +2 -2
- package/package.json +2 -2
- package/dist/chunk-EJIHCWWH.js.map +0 -1
- package/dist/chunk-VKP46GTC.mjs.map +0 -1
- /package/dist/{chunk-5AIX6YY5.mjs.map → chunk-Z574MVAT.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -10,17 +10,16 @@ import {
|
|
|
10
10
|
UI_REQUEST_TIMEOUT_TAG,
|
|
11
11
|
UI_RESPONSE,
|
|
12
12
|
UiRequestRegistry
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Z574MVAT.mjs";
|
|
14
14
|
import {
|
|
15
15
|
HardwareErrorCode,
|
|
16
16
|
ORPHAN_ELIGIBLE_ERROR_CODES,
|
|
17
17
|
createHwkError,
|
|
18
18
|
defaultOriginForCode,
|
|
19
19
|
defaultRecoveryForCode,
|
|
20
|
-
isHardwareErrorCode,
|
|
21
20
|
isHwkRecoveryHint,
|
|
22
21
|
operationMayHaveCompletedParams
|
|
23
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-V2OHL2JS.mjs";
|
|
24
23
|
|
|
25
24
|
// src/types/response.ts
|
|
26
25
|
function success(payload) {
|
|
@@ -674,9 +673,7 @@ function createCombinedConnector(connectors) {
|
|
|
674
673
|
});
|
|
675
674
|
perConnector.sort((a, b) => a.index - b.index);
|
|
676
675
|
for (const [id, owner] of deviceOwner) {
|
|
677
|
-
if (
|
|
678
|
-
deviceOwner.delete(id);
|
|
679
|
-
}
|
|
676
|
+
if (onTransport(owner, options.transportType)) deviceOwner.delete(id);
|
|
680
677
|
}
|
|
681
678
|
const merged = [];
|
|
682
679
|
perConnector.forEach(({ index, devices }) => {
|
|
@@ -849,46 +846,6 @@ var TypedEventEmitter = class {
|
|
|
849
846
|
}
|
|
850
847
|
};
|
|
851
848
|
|
|
852
|
-
// src/types/electronBle.ts
|
|
853
|
-
var isSerializedError = (value) => typeof value === "object" && value !== null && !(value instanceof Error) && typeof value.message === "string";
|
|
854
|
-
var restoreHostError = ({ message, code, params }) => isHardwareErrorCode(code) ? createHwkError({ code, message, ...params ? { params } : {} }) : new Error(message);
|
|
855
|
-
function rehydrateElectronBleErrors(bridge) {
|
|
856
|
-
const wrapped = Object.create(bridge);
|
|
857
|
-
const invoke = (method, args) => {
|
|
858
|
-
const result = method.apply(bridge, args);
|
|
859
|
-
if (typeof result?.then !== "function") return result;
|
|
860
|
-
return Promise.resolve(result).catch((error) => {
|
|
861
|
-
throw isSerializedError(error) ? restoreHostError(error) : error;
|
|
862
|
-
});
|
|
863
|
-
};
|
|
864
|
-
const descriptors = /* @__PURE__ */ new Map();
|
|
865
|
-
for (let source = bridge; source && source !== Object.prototype; source = Object.getPrototypeOf(source)) {
|
|
866
|
-
for (const key of Reflect.ownKeys(source)) {
|
|
867
|
-
const descriptor = Object.getOwnPropertyDescriptor(source, key);
|
|
868
|
-
if (key !== "constructor" && descriptor && !descriptors.has(key))
|
|
869
|
-
descriptors.set(key, descriptor);
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
for (const [key, descriptor] of descriptors) {
|
|
873
|
-
if (typeof descriptor.value === "function") {
|
|
874
|
-
Object.defineProperty(wrapped, key, {
|
|
875
|
-
value: (...args) => invoke(bridge[key], args)
|
|
876
|
-
});
|
|
877
|
-
} else if (descriptor.get || descriptor.set) {
|
|
878
|
-
Object.defineProperty(wrapped, key, {
|
|
879
|
-
get: descriptor.get ? () => {
|
|
880
|
-
const value = Reflect.get(bridge, key, bridge);
|
|
881
|
-
return typeof value === "function" ? (...args) => invoke(value, args) : value;
|
|
882
|
-
} : void 0,
|
|
883
|
-
set: descriptor.set ? (value) => {
|
|
884
|
-
Reflect.set(bridge, key, value, bridge);
|
|
885
|
-
} : void 0
|
|
886
|
-
});
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
return wrapped;
|
|
890
|
-
}
|
|
891
|
-
|
|
892
849
|
// src/utils/requestSaveDeviceBinding.ts
|
|
893
850
|
function emitDeviceBindingStatus(emitter, selectionRequestId, status) {
|
|
894
851
|
emitter.emit(UI_REQUEST.DEVICE_BINDING_STATUS, {
|
|
@@ -1802,7 +1759,6 @@ export {
|
|
|
1802
1759
|
hexToBytes,
|
|
1803
1760
|
isAllNetworkMethodName,
|
|
1804
1761
|
isConnectionLost,
|
|
1805
|
-
isHardwareErrorCode,
|
|
1806
1762
|
isHardwareOperationId,
|
|
1807
1763
|
isHwkRecoveryHint,
|
|
1808
1764
|
isKnownNonTargetHardwareVendor,
|
|
@@ -1816,7 +1772,6 @@ export {
|
|
|
1816
1772
|
pickConnectionContext,
|
|
1817
1773
|
prepareSolanaOffchainMessageV1,
|
|
1818
1774
|
rehydrateConnectorError,
|
|
1819
|
-
rehydrateElectronBleErrors,
|
|
1820
1775
|
requestBleDeviceSelection,
|
|
1821
1776
|
requestSaveDeviceBinding,
|
|
1822
1777
|
resolveHardwareOperationTarget,
|