@onekeyfe/hwk-adapter-core 1.2.11-alpha.1 → 1.2.11-alpha.3
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 +32 -57
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -27
- 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) {
|
|
@@ -847,28 +846,6 @@ var TypedEventEmitter = class {
|
|
|
847
846
|
}
|
|
848
847
|
};
|
|
849
848
|
|
|
850
|
-
// src/types/electronBle.ts
|
|
851
|
-
var isSerializedError = (value) => typeof value === "object" && value !== null && !(value instanceof Error) && typeof value.message === "string";
|
|
852
|
-
var restoreHostError = ({ message, code, params }) => isHardwareErrorCode(code) ? createHwkError({ code, message, ...params ? { params } : {} }) : new Error(message);
|
|
853
|
-
function rehydrateElectronBleErrors(bridge) {
|
|
854
|
-
const wrapped = Object.create(bridge);
|
|
855
|
-
for (const key of Object.keys(bridge)) {
|
|
856
|
-
if (typeof bridge[key] === "function") {
|
|
857
|
-
Object.defineProperty(wrapped, key, {
|
|
858
|
-
value: (...args) => {
|
|
859
|
-
const method = bridge[key];
|
|
860
|
-
const result = method.apply(bridge, args);
|
|
861
|
-
if (typeof result?.then !== "function") return result;
|
|
862
|
-
return Promise.resolve(result).catch((error) => {
|
|
863
|
-
throw isSerializedError(error) ? restoreHostError(error) : error;
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
return wrapped;
|
|
870
|
-
}
|
|
871
|
-
|
|
872
849
|
// src/utils/requestSaveDeviceBinding.ts
|
|
873
850
|
function emitDeviceBindingStatus(emitter, selectionRequestId, status) {
|
|
874
851
|
emitter.emit(UI_REQUEST.DEVICE_BINDING_STATUS, {
|
|
@@ -1782,7 +1759,6 @@ export {
|
|
|
1782
1759
|
hexToBytes,
|
|
1783
1760
|
isAllNetworkMethodName,
|
|
1784
1761
|
isConnectionLost,
|
|
1785
|
-
isHardwareErrorCode,
|
|
1786
1762
|
isHardwareOperationId,
|
|
1787
1763
|
isHwkRecoveryHint,
|
|
1788
1764
|
isKnownNonTargetHardwareVendor,
|
|
@@ -1796,7 +1772,6 @@ export {
|
|
|
1796
1772
|
pickConnectionContext,
|
|
1797
1773
|
prepareSolanaOffchainMessageV1,
|
|
1798
1774
|
rehydrateConnectorError,
|
|
1799
|
-
rehydrateElectronBleErrors,
|
|
1800
1775
|
requestBleDeviceSelection,
|
|
1801
1776
|
requestSaveDeviceBinding,
|
|
1802
1777
|
resolveHardwareOperationTarget,
|