@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/index.mjs CHANGED
@@ -10,17 +10,16 @@ import {
10
10
  UI_REQUEST_TIMEOUT_TAG,
11
11
  UI_RESPONSE,
12
12
  UiRequestRegistry
13
- } from "./chunk-5AIX6YY5.mjs";
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-VKP46GTC.mjs";
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,