@onekeyfe/hwk-adapter-core 1.1.28 → 1.1.29-alpha.1

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.js CHANGED
@@ -1,125 +1,19 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- CHAIN_FINGERPRINT_PATHS: () => CHAIN_FINGERPRINT_PATHS,
24
- DEVICE: () => DEVICE,
25
- DEVICE_EVENT: () => DEVICE_EVENT,
26
- DeviceJobQueue: () => DeviceJobQueue,
27
- EConnectorInteraction: () => EConnectorInteraction,
28
- HardwareErrorCode: () => HardwareErrorCode,
29
- ORPHAN_ELIGIBLE_ERROR_CODES: () => ORPHAN_ELIGIBLE_ERROR_CODES,
30
- SDK: () => SDK,
31
- TypedEventEmitter: () => TypedEventEmitter,
32
- UI_EVENT: () => UI_EVENT,
33
- UI_REQUEST: () => UI_REQUEST,
34
- UI_REQUEST_CANCELLED_TAG: () => UI_REQUEST_CANCELLED_TAG,
35
- UI_REQUEST_DEFAULT_TIMEOUT_MS: () => UI_REQUEST_DEFAULT_TIMEOUT_MS,
36
- UI_REQUEST_PREEMPTED_TAG: () => UI_REQUEST_PREEMPTED_TAG,
37
- UI_REQUEST_TIMEOUT_TAG: () => UI_REQUEST_TIMEOUT_TAG,
38
- UI_RESPONSE: () => UI_RESPONSE,
39
- UiRequestRegistry: () => UiRequestRegistry,
40
- batchCall: () => batchCall,
41
- bytesToHex: () => bytesToHex2,
42
- compareSemver: () => compareSemver,
43
- createBridgedConnector: () => createBridgedConnector,
44
- createHwkError: () => createHwkError,
45
- deriveDeviceFingerprint: () => deriveDeviceFingerprint,
46
- enrichErrorMessage: () => enrichErrorMessage,
47
- ensure0x: () => ensure0x,
48
- failure: () => failure,
49
- hexToBytes: () => hexToBytes,
50
- padHex64: () => padHex64,
51
- rehydrateConnectorError: () => rehydrateConnectorError,
52
- serializeConnectorError: () => serializeConnectorError,
53
- stripHex: () => stripHex,
54
- success: () => success
55
- });
56
- module.exports = __toCommonJS(index_exports);
57
-
58
- // src/types/errors.ts
59
- var HardwareErrorCode = /* @__PURE__ */ ((HardwareErrorCode2) => {
60
- HardwareErrorCode2[HardwareErrorCode2["UnknownError"] = 1e4] = "UnknownError";
61
- HardwareErrorCode2[HardwareErrorCode2["UserRejected"] = 10001] = "UserRejected";
62
- HardwareErrorCode2[HardwareErrorCode2["InvalidParams"] = 10002] = "InvalidParams";
63
- HardwareErrorCode2[HardwareErrorCode2["OperationTimeout"] = 10003] = "OperationTimeout";
64
- HardwareErrorCode2[HardwareErrorCode2["MethodNotSupported"] = 10004] = "MethodNotSupported";
65
- HardwareErrorCode2[HardwareErrorCode2["UserAborted"] = 10005] = "UserAborted";
66
- HardwareErrorCode2[HardwareErrorCode2["DeviceNotFound"] = 10100] = "DeviceNotFound";
67
- HardwareErrorCode2[HardwareErrorCode2["DeviceDisconnected"] = 10101] = "DeviceDisconnected";
68
- HardwareErrorCode2[HardwareErrorCode2["DeviceBusy"] = 10102] = "DeviceBusy";
69
- HardwareErrorCode2[HardwareErrorCode2["DeviceLocked"] = 10103] = "DeviceLocked";
70
- HardwareErrorCode2[HardwareErrorCode2["DeviceNotInitialized"] = 10104] = "DeviceNotInitialized";
71
- HardwareErrorCode2[HardwareErrorCode2["DeviceInBootloader"] = 10105] = "DeviceInBootloader";
72
- HardwareErrorCode2[HardwareErrorCode2["DeviceMismatch"] = 10106] = "DeviceMismatch";
73
- HardwareErrorCode2[HardwareErrorCode2["DeviceAppStuck"] = 10107] = "DeviceAppStuck";
74
- HardwareErrorCode2[HardwareErrorCode2["ChainNotSupported"] = 10108] = "ChainNotSupported";
75
- HardwareErrorCode2[HardwareErrorCode2["DeviceOneDeviceOnly"] = 10109] = "DeviceOneDeviceOnly";
76
- HardwareErrorCode2[HardwareErrorCode2["FirmwareTooOld"] = 10200] = "FirmwareTooOld";
77
- HardwareErrorCode2[HardwareErrorCode2["FirmwareUpdateRequired"] = 10201] = "FirmwareUpdateRequired";
78
- HardwareErrorCode2[HardwareErrorCode2["TransportError"] = 10300] = "TransportError";
79
- HardwareErrorCode2[HardwareErrorCode2["BridgeNotFound"] = 10301] = "BridgeNotFound";
80
- HardwareErrorCode2[HardwareErrorCode2["TransportNotAvailable"] = 10302] = "TransportNotAvailable";
81
- HardwareErrorCode2[HardwareErrorCode2["DevicePermissionDenied"] = 10303] = "DevicePermissionDenied";
82
- HardwareErrorCode2[HardwareErrorCode2["BlePairingTimeout"] = 10304] = "BlePairingTimeout";
83
- HardwareErrorCode2[HardwareErrorCode2["NetworkError"] = 10305] = "NetworkError";
84
- HardwareErrorCode2[HardwareErrorCode2["PinInvalid"] = 10400] = "PinInvalid";
85
- HardwareErrorCode2[HardwareErrorCode2["PinCancelled"] = 10401] = "PinCancelled";
86
- HardwareErrorCode2[HardwareErrorCode2["PassphraseRejected"] = 10402] = "PassphraseRejected";
87
- HardwareErrorCode2[HardwareErrorCode2["AppNotInstalled"] = 10500] = "AppNotInstalled";
88
- HardwareErrorCode2[HardwareErrorCode2["WrongApp"] = 10501] = "WrongApp";
89
- HardwareErrorCode2[HardwareErrorCode2["AppTooOld"] = 10502] = "AppTooOld";
90
- HardwareErrorCode2[HardwareErrorCode2["DeviceOutOfMemory"] = 10503] = "DeviceOutOfMemory";
91
- HardwareErrorCode2[HardwareErrorCode2["EvmBlindSigningRequired"] = 11e3] = "EvmBlindSigningRequired";
92
- HardwareErrorCode2[HardwareErrorCode2["EvmClearSignPluginMissing"] = 11001] = "EvmClearSignPluginMissing";
93
- HardwareErrorCode2[HardwareErrorCode2["EvmDataTooLarge"] = 11002] = "EvmDataTooLarge";
94
- HardwareErrorCode2[HardwareErrorCode2["EvmTxTypeNotSupported"] = 11003] = "EvmTxTypeNotSupported";
95
- HardwareErrorCode2[HardwareErrorCode2["SolanaBlindSigningRequired"] = 11100] = "SolanaBlindSigningRequired";
96
- HardwareErrorCode2[HardwareErrorCode2["TronCustomContractRequired"] = 11200] = "TronCustomContractRequired";
97
- HardwareErrorCode2[HardwareErrorCode2["TronDataSigningRequired"] = 11201] = "TronDataSigningRequired";
98
- HardwareErrorCode2[HardwareErrorCode2["TronSignByHashRequired"] = 11202] = "TronSignByHashRequired";
99
- HardwareErrorCode2[HardwareErrorCode2["BtcWalletPolicyHmacMismatch"] = 11300] = "BtcWalletPolicyHmacMismatch";
100
- HardwareErrorCode2[HardwareErrorCode2["BtcUnexpectedState"] = 11301] = "BtcUnexpectedState";
101
- return HardwareErrorCode2;
102
- })(HardwareErrorCode || {});
103
- var ORPHAN_ELIGIBLE_ERROR_CODES = [
104
- 10005 /* UserAborted */,
105
- 10001 /* UserRejected */,
106
- 10100 /* DeviceNotFound */,
107
- 10101 /* DeviceDisconnected */,
108
- 10106 /* DeviceMismatch */,
109
- 10107 /* DeviceAppStuck */,
110
- 10109 /* DeviceOneDeviceOnly */,
111
- 10300 /* TransportError */,
112
- 10303 /* DevicePermissionDenied */,
113
- 10304 /* BlePairingTimeout */
114
- ];
115
- function createHwkError(payload) {
116
- return Object.assign(new Error(payload.message), {
117
- code: payload.code,
118
- ...payload._tag !== void 0 && { _tag: payload._tag },
119
- ...payload.appName !== void 0 && { appName: payload.appName },
120
- ...payload.params !== void 0 && { params: payload.params }
121
- });
122
- }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+
4
+
5
+
6
+ var _chunkQD4EQWQAjs = require('./chunk-QD4EQWQA.js');
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+ var _chunkLYVS67EXjs = require('./chunk-LYVS67EX.js');
123
17
 
124
18
  // src/types/response.ts
125
19
  function success(payload) {
@@ -133,8 +27,8 @@ function failure(code, error, params) {
133
27
  }
134
28
 
135
29
  // src/types/fingerprint.ts
136
- var import_sha256 = require("@noble/hashes/sha256");
137
- var import_utils = require("@noble/hashes/utils");
30
+ var _sha256 = require('@noble/hashes/sha256');
31
+ var _utils = require('@noble/hashes/utils');
138
32
  var CHAIN_FINGERPRINT_PATHS = {
139
33
  evm: "m/44'/60'/0'/0/0",
140
34
  // BTC: account-level path (3 levels), mainnet cointype 0.
@@ -144,7 +38,7 @@ var CHAIN_FINGERPRINT_PATHS = {
144
38
  tron: "m/44'/195'/0'/0/0"
145
39
  };
146
40
  function deriveDeviceFingerprint(value) {
147
- return (0, import_utils.bytesToHex)((0, import_sha256.sha256)((0, import_utils.utf8ToBytes)(value))).slice(0, 16);
41
+ return _utils.bytesToHex.call(void 0, _sha256.sha256.call(void 0, _utils.utf8ToBytes.call(void 0, value))).slice(0, 16);
148
42
  }
149
43
 
150
44
  // src/events/device.ts
@@ -152,43 +46,19 @@ var DEVICE_EVENT = "DEVICE_EVENT";
152
46
  var DEVICE = {
153
47
  CONNECT: "device-connect",
154
48
  DISCONNECT: "device-disconnect",
155
- CHANGED: "device-changed"
156
- };
157
-
158
- // src/events/ui-request.ts
159
- var UI_EVENT = "UI_EVENT";
160
- var UI_REQUEST = {
161
- REQUEST_PIN: "ui-request-pin",
162
- REQUEST_PASSPHRASE: "ui-request-passphrase",
163
- REQUEST_PASSPHRASE_ON_DEVICE: "ui-request-passphrase-on-device",
164
- REQUEST_BUTTON: "ui-request-button",
165
- REQUEST_QR_DISPLAY: "ui-request-qr-display",
166
- REQUEST_QR_SCAN: "ui-request-qr-scan",
167
- REQUEST_DEVICE_PERMISSION: "ui-request-device-permission",
168
- REQUEST_SELECT_DEVICE: "ui-request-select-device",
169
- REQUEST_DEVICE_CONNECT: "ui-request-device-connect",
170
- // Ledger BTC App: account index >= 100 requires display=true. Adapter asks
171
- // the user once per session before promoting the call.
172
- REQUEST_BTC_HIGH_INDEX_CONFIRM: "ui-request-btc-high-index-confirm",
173
- // Required app is not installed; with autoInstallApp on, ask the user
174
- // whether to install it before retrying the operation.
175
- REQUEST_INSTALL_APP: "ui-request-install-app",
176
- CLOSE_UI_WINDOW: "ui-close",
177
- DEVICE_PROGRESS: "ui-device_progress",
178
- FIRMWARE_PROGRESS: "ui-firmware-progress",
179
- FIRMWARE_TIP: "ui-firmware-tip"
180
- };
181
- var UI_RESPONSE = {
182
- RECEIVE_PIN: "receive-pin",
183
- RECEIVE_PASSPHRASE: "receive-passphrase",
184
- RECEIVE_PASSPHRASE_ON_DEVICE: "receive-passphrase-on-device",
185
- RECEIVE_QR_RESPONSE: "receive-qr-response",
186
- RECEIVE_SELECT_DEVICE: "receive-select-device",
187
- RECEIVE_DEVICE_CONNECT: "receive-device-connect",
188
- RECEIVE_DEVICE_PERMISSION: "receive-device-permission",
189
- RECEIVE_BTC_HIGH_INDEX_CONFIRM: "receive-btc-high-index-confirm",
190
- RECEIVE_INSTALL_APP: "receive-install-app",
191
- CANCEL: "cancel"
49
+ CHANGED: "device-changed",
50
+ FEATURES: "features",
51
+ /**
52
+ * Trezor-only. Emitted after a successful THP handshake that minted or
53
+ * refreshed pairing credentials. The host should persist `credentials`
54
+ * keyed by `deviceId` and feed them back into the connector on the next
55
+ * connect to skip the CodeEntry/QrCode/NFC pairing UX.
56
+ *
57
+ * The `TREZOR_` prefix mirrors `UI_REQUEST.REQUEST_TREZOR_THP_PAIRING` —
58
+ * vendor-specific events live in the shared event taxonomy but are named
59
+ * so hosts can ignore them when they don't drive Trezor hardware.
60
+ */
61
+ TREZOR_THP_CREDENTIALS_CHANGED: "device-trezor-thp-credentials-changed"
192
62
  };
193
63
 
194
64
  // src/events/sdk.ts
@@ -215,7 +85,7 @@ var DeviceJobQueue = class {
215
85
  */
216
86
  async enqueue(deviceId, job, options = {}) {
217
87
  if (options.rejectIfBusy && this._jobs.size > 0) {
218
- throw options.busyError ?? new Error("Device is busy");
88
+ throw _nullishCoalesce(options.busyError, () => ( new Error("Device is busy")));
219
89
  }
220
90
  const ac = new AbortController();
221
91
  const gen = this._generation;
@@ -231,7 +101,7 @@ var DeviceJobQueue = class {
231
101
  const next = prev.catch(() => {
232
102
  }).then(async () => {
233
103
  if (this._generation !== gen) {
234
- throw this._generationCancelReasons.get(gen) ?? new Error("Job cancelled: queue was cleared");
104
+ throw _nullishCoalesce(this._generationCancelReasons.get(gen), () => ( new Error("Job cancelled: queue was cleared")));
235
105
  }
236
106
  this._active = activeJob;
237
107
  try {
@@ -259,20 +129,20 @@ var DeviceJobQueue = class {
259
129
  forceCancelActive(deviceId, reason) {
260
130
  if (!this._active) return false;
261
131
  if (deviceId && this._active.deviceId !== deviceId) return false;
262
- this._active.abortController.abort(reason ?? new Error("Force cancelled for recovery"));
132
+ this._active.abortController.abort(_nullishCoalesce(reason, () => ( new Error("Force cancelled for recovery"))));
263
133
  return true;
264
134
  }
265
135
  /** Cancel the active job (alias for callers that previously needed multi-device cancel). */
266
136
  cancelAllActive(reason) {
267
137
  if (!this._active) return;
268
- this._active.abortController.abort(reason ?? new Error("Cancelled by cancelAllActive"));
138
+ this._active.abortController.abort(_nullishCoalesce(reason, () => ( new Error("Cancelled by cancelAllActive"))));
269
139
  }
270
140
  /** Cancel the active job and invalidate queued jobs that have not started. */
271
141
  cancelActiveAndPending(deviceId, reason) {
272
142
  if (deviceId && this._active && this._active.deviceId !== deviceId) {
273
143
  return false;
274
144
  }
275
- this.clear(reason ?? new Error("Cancelled by cancelActiveAndPending"));
145
+ this.clear(_nullishCoalesce(reason, () => ( new Error("Cancelled by cancelActiveAndPending"))));
276
146
  return true;
277
147
  }
278
148
  /** Get info about the currently active job, or null if idle. */
@@ -292,7 +162,7 @@ var DeviceJobQueue = class {
292
162
  clear(reason) {
293
163
  const cancelledGeneration = this._generation;
294
164
  this._generation++;
295
- const cancelReason = reason ?? new Error("Job cancelled: queue was cleared");
165
+ const cancelReason = _nullishCoalesce(reason, () => ( new Error("Job cancelled: queue was cleared")));
296
166
  this._generationCancelReasons.set(cancelledGeneration, cancelReason);
297
167
  for (const generation of this._generationCancelReasons.keys()) {
298
168
  if (generation < this._generation - 10) {
@@ -319,7 +189,7 @@ function createBridgedConnector(vendor, connectionType, bridge) {
319
189
  const handlerMap = /* @__PURE__ */ new Map();
320
190
  return {
321
191
  connectionType,
322
- searchDevices: () => bridge.searchDevices({ vendor }),
192
+ searchDevices: (options) => bridge.searchDevices({ vendor, options }),
323
193
  connect: (deviceId) => bridge.connect({ vendor, deviceId }),
324
194
  disconnect: (sessionId) => bridge.disconnect({ vendor, sessionId }),
325
195
  call: (sessionId, method, callParams) => bridge.call({ vendor, sessionId, method, callParams }),
@@ -341,13 +211,14 @@ function createBridgedConnector(vendor, connectionType, bridge) {
341
211
  },
342
212
  off: (event, handler) => {
343
213
  const inner = handlerMap.get(event);
344
- const bridgeHandler = inner?.get(handler);
214
+ const bridgeHandler = _optionalChain([inner, 'optionalAccess', _ => _.get, 'call', _2 => _2(handler)]);
345
215
  if (!bridgeHandler || !inner) return;
346
216
  bridge.offEvent({ vendor }, bridgeHandler);
347
217
  inner.delete(handler);
348
218
  if (inner.size === 0) handlerMap.delete(event);
349
219
  },
350
- reset: () => bridge.reset({ vendor })
220
+ reset: () => bridge.reset({ vendor }),
221
+ setKnownCredentials: bridge.setKnownCredentials ? (credentials) => bridge.setKnownCredentials({ vendor, credentials }) : void 0
351
222
  };
352
223
  }
353
224
  var SERIALIZED_ERROR_TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
@@ -388,7 +259,7 @@ function serializeConnectorError(err) {
388
259
  for (const key of Object.keys(params)) {
389
260
  try {
390
261
  JSON.stringify(params[key]);
391
- } catch {
262
+ } catch (e2) {
392
263
  delete params[key];
393
264
  }
394
265
  }
@@ -404,9 +275,226 @@ function rehydrateConnectorError(error) {
404
275
  return Object.assign(new Error(message), {
405
276
  ...code !== void 0 ? { code } : {},
406
277
  ...errorCode !== void 0 ? { errorCode } : {},
407
- ...params ?? {}
278
+ ..._nullishCoalesce(params, () => ( {}))
279
+ });
280
+ }
281
+ function isDeviceUnavailableError(error) {
282
+ const typed = error;
283
+ if (typed.code === 10100 /* DeviceNotFound */ || typed.code === 10101 /* DeviceDisconnected */) {
284
+ return true;
285
+ }
286
+ return false;
287
+ }
288
+ function combinedDeviceNotFoundError(message) {
289
+ return _chunkQD4EQWQAjs.createHwkError.call(void 0, {
290
+ code: 10100 /* DeviceNotFound */,
291
+ message
408
292
  });
409
293
  }
294
+ function combinedSessionNotFoundError(message) {
295
+ return _chunkQD4EQWQAjs.createHwkError.call(void 0, {
296
+ code: 10101 /* DeviceDisconnected */,
297
+ message
298
+ });
299
+ }
300
+ function createCombinedConnector(connectors) {
301
+ if (connectors.length === 0) {
302
+ throw new Error("createCombinedConnector: at least one connector is required");
303
+ }
304
+ const SEARCH_SETTLE_AFTER_FIRST_DEVICE_MS = 250;
305
+ const deviceOwner = /* @__PURE__ */ new Map();
306
+ const sessionOwner = /* @__PURE__ */ new Map();
307
+ const forwarders = /* @__PURE__ */ new Map();
308
+ const rank = (device) => device.connectionType === "ble" ? 1 : 0;
309
+ const sharedCredentials = [];
310
+ const credentialKey = (c) => _nullishCoalesce(c.credential, () => ( JSON.stringify(c)));
311
+ const mergeShared = (incoming) => {
312
+ let changed = false;
313
+ for (const cred of incoming) {
314
+ const key = credentialKey(cred);
315
+ if (!sharedCredentials.some((e) => credentialKey(e) === key)) {
316
+ sharedCredentials.push(cred);
317
+ changed = true;
318
+ }
319
+ }
320
+ return changed;
321
+ };
322
+ const broadcastCredentials = async () => {
323
+ await Promise.all(
324
+ connectors.map((child) => Promise.resolve(_optionalChain([child, 'access', _3 => _3.setKnownCredentials, 'optionalCall', _4 => _4(sharedCredentials)])))
325
+ );
326
+ };
327
+ for (const child of connectors) {
328
+ child.on("device-trezor-thp-credentials-changed", (data) => {
329
+ if (mergeShared(data.credentials)) void broadcastCredentials();
330
+ });
331
+ }
332
+ const searchDevices = async (options = {}) => {
333
+ const perConnector = [];
334
+ await new Promise((resolve) => {
335
+ let finished = false;
336
+ let remaining = connectors.length;
337
+ let settleTimer;
338
+ const finish = () => {
339
+ if (finished) return;
340
+ finished = true;
341
+ if (settleTimer) clearTimeout(settleTimer);
342
+ resolve();
343
+ };
344
+ connectors.forEach((child, index) => {
345
+ void child.searchDevices().then(
346
+ (devices) => devices.map((device) => ({
347
+ ...device,
348
+ connectionType: _nullishCoalesce(device.connectionType, () => ( child.connectionType))
349
+ }))
350
+ ).catch(
351
+ () => (
352
+ // A transport that can't scan (powered off, unauthorized, absent)
353
+ // must not fail the whole fused search.
354
+ []
355
+ )
356
+ ).then((devices) => {
357
+ remaining -= 1;
358
+ if (!finished) {
359
+ perConnector.push({ index, devices });
360
+ }
361
+ if (remaining === 0) {
362
+ finish();
363
+ return;
364
+ }
365
+ const hasUsbDevice = devices.some((device) => device.connectionType === "usb");
366
+ if (hasUsbDevice && !settleTimer && !options.waitForAll) {
367
+ settleTimer = setTimeout(finish, SEARCH_SETTLE_AFTER_FIRST_DEVICE_MS);
368
+ }
369
+ });
370
+ });
371
+ });
372
+ perConnector.sort((a, b) => a.index - b.index);
373
+ deviceOwner.clear();
374
+ const merged = [];
375
+ perConnector.forEach(({ index, devices }) => {
376
+ for (const device of devices) {
377
+ deviceOwner.set(device.connectId, connectors[index]);
378
+ merged.push(device);
379
+ }
380
+ });
381
+ return merged.sort((a, b) => rank(a) - rank(b));
382
+ };
383
+ const resolveOwner = async (deviceId) => {
384
+ if (deviceId && deviceOwner.has(deviceId)) {
385
+ return { owner: deviceOwner.get(deviceId), deviceId };
386
+ }
387
+ const devices = await searchDevices({ waitForAll: Boolean(deviceId) });
388
+ if (deviceId) {
389
+ const owner = deviceOwner.get(deviceId);
390
+ if (!owner)
391
+ throw combinedDeviceNotFoundError(`Combined connector: device not found: ${deviceId}`);
392
+ return { owner, deviceId };
393
+ }
394
+ const first = devices[0];
395
+ if (!first) throw combinedDeviceNotFoundError("Combined connector: no devices found");
396
+ return { owner: deviceOwner.get(first.connectId), deviceId: first.connectId };
397
+ };
398
+ const connectByExplicitId = async (deviceId) => {
399
+ const cachedOwner = deviceOwner.get(deviceId);
400
+ if (cachedOwner) {
401
+ return cachedOwner.connect(deviceId);
402
+ }
403
+ let lastError;
404
+ for (const child of connectors) {
405
+ try {
406
+ const session = await child.connect(deviceId);
407
+ deviceOwner.set(deviceId, child);
408
+ return session;
409
+ } catch (error) {
410
+ if (!isDeviceUnavailableError(error)) {
411
+ throw error;
412
+ }
413
+ lastError = error;
414
+ }
415
+ }
416
+ const message = lastError instanceof Error ? lastError.message : `Combined connector: device not found: ${deviceId}`;
417
+ throw _chunkQD4EQWQAjs.createHwkError.call(void 0, {
418
+ code: 10100 /* DeviceNotFound */,
419
+ message
420
+ });
421
+ };
422
+ return {
423
+ // Nominal value only — the per-device `connectionType` is authoritative
424
+ // for a fused connector.
425
+ connectionType: connectors[0].connectionType,
426
+ searchDevices: (options) => searchDevices({ waitForAll: _optionalChain([options, 'optionalAccess', _5 => _5.waitForAll]) }),
427
+ connect: async (deviceId) => {
428
+ const session = deviceId ? await connectByExplicitId(deviceId) : await (async () => {
429
+ const { owner: owner2, deviceId: resolved } = await resolveOwner();
430
+ return owner2.connect(resolved);
431
+ })();
432
+ const owner = deviceOwner.get(_nullishCoalesce(deviceId, () => ( session.deviceInfo.connectId)));
433
+ if (!owner) {
434
+ throw combinedSessionNotFoundError(
435
+ `Combined connector: owner not found for session: ${session.sessionId}`
436
+ );
437
+ }
438
+ sessionOwner.set(session.sessionId, owner);
439
+ return session;
440
+ },
441
+ disconnect: async (sessionId) => {
442
+ const owner = sessionOwner.get(sessionId);
443
+ if (!owner) return;
444
+ await owner.disconnect(sessionId);
445
+ sessionOwner.delete(sessionId);
446
+ },
447
+ call: async (sessionId, method, params) => {
448
+ const owner = sessionOwner.get(sessionId);
449
+ if (!owner) {
450
+ throw combinedSessionNotFoundError(`Combined connector: session not found: ${sessionId}`);
451
+ }
452
+ return owner.call(sessionId, method, params);
453
+ },
454
+ cancel: async (sessionId) => {
455
+ const owner = sessionOwner.get(sessionId);
456
+ if (!owner) return;
457
+ await owner.cancel(sessionId);
458
+ },
459
+ uiResponse: (response) => {
460
+ for (const child of connectors) child.uiResponse(response);
461
+ },
462
+ on: (event, handler) => {
463
+ const attached = connectors.map((child) => {
464
+ const forward = (data) => handler(data);
465
+ child.on(event, forward);
466
+ return { child, handler: forward };
467
+ });
468
+ let inner = forwarders.get(event);
469
+ if (!inner) {
470
+ inner = /* @__PURE__ */ new Map();
471
+ forwarders.set(event, inner);
472
+ }
473
+ inner.set(handler, attached);
474
+ },
475
+ off: (event, handler) => {
476
+ const inner = forwarders.get(event);
477
+ const attached = _optionalChain([inner, 'optionalAccess', _6 => _6.get, 'call', _7 => _7(handler)]);
478
+ if (!attached || !inner) return;
479
+ for (const { child, handler: forward } of attached) {
480
+ child.off(event, forward);
481
+ }
482
+ inner.delete(handler);
483
+ if (inner.size === 0) forwarders.delete(event);
484
+ },
485
+ reset: () => {
486
+ for (const child of connectors) child.reset();
487
+ deviceOwner.clear();
488
+ sessionOwner.clear();
489
+ forwarders.clear();
490
+ },
491
+ setKnownCredentials: connectors.some((c) => c.setKnownCredentials) ? async (credentials) => {
492
+ sharedCredentials.length = 0;
493
+ mergeShared(_nullishCoalesce(credentials, () => ( [])));
494
+ await broadcastCredentials();
495
+ } : void 0
496
+ };
497
+ }
410
498
 
411
499
  // src/utils/TypedEventEmitter.ts
412
500
  var TypedEventEmitter = class {
@@ -438,103 +526,9 @@ var TypedEventEmitter = class {
438
526
  removeAllListeners() {
439
527
  this._listeners.clear();
440
528
  }
441
- };
442
-
443
- // src/utils/UiRequestRegistry.ts
444
- var UI_REQUEST_DEFAULT_TIMEOUT_MS = 6e5;
445
- var RESPONSE_TO_REQUEST = {
446
- [UI_RESPONSE.RECEIVE_PIN]: UI_REQUEST.REQUEST_PIN,
447
- [UI_RESPONSE.RECEIVE_PASSPHRASE]: UI_REQUEST.REQUEST_PASSPHRASE,
448
- [UI_RESPONSE.RECEIVE_PASSPHRASE_ON_DEVICE]: UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE,
449
- [UI_RESPONSE.RECEIVE_SELECT_DEVICE]: UI_REQUEST.REQUEST_SELECT_DEVICE,
450
- [UI_RESPONSE.RECEIVE_DEVICE_CONNECT]: UI_REQUEST.REQUEST_DEVICE_CONNECT,
451
- [UI_RESPONSE.RECEIVE_DEVICE_PERMISSION]: UI_REQUEST.REQUEST_DEVICE_PERMISSION,
452
- [UI_RESPONSE.RECEIVE_BTC_HIGH_INDEX_CONFIRM]: UI_REQUEST.REQUEST_BTC_HIGH_INDEX_CONFIRM,
453
- [UI_RESPONSE.RECEIVE_INSTALL_APP]: UI_REQUEST.REQUEST_INSTALL_APP
454
- // RECEIVE_QR_RESPONSE maps to QR_DISPLAY or QR_SCAN — resolved dynamically below.
455
- };
456
- var UI_REQUEST_PREEMPTED_TAG = "UiRequestPreempted";
457
- var UI_REQUEST_CANCELLED_TAG = "UiRequestCancelled";
458
- var UI_REQUEST_TIMEOUT_TAG = "UiRequestTimeout";
459
- var UiRequestRegistry = class {
460
- constructor() {
461
- this.pending = /* @__PURE__ */ new Map();
462
- }
463
- wait(requestType, options) {
464
- const existing = this.pending.get(requestType);
465
- if (existing) {
466
- clearTimeout(existing.timer);
467
- this.pending.delete(requestType);
468
- existing.reject(
469
- Object.assign(new Error(`UI request '${requestType}' was superseded by a new request`), {
470
- _tag: UI_REQUEST_PREEMPTED_TAG
471
- })
472
- );
473
- }
474
- const timeoutMs = options?.timeoutMs ?? UI_REQUEST_DEFAULT_TIMEOUT_MS;
475
- return new Promise((resolve, reject) => {
476
- const timer = setTimeout(() => {
477
- if (this.pending.get(requestType)?.timer === timer) {
478
- this.pending.delete(requestType);
479
- reject(
480
- Object.assign(new Error(`UI request '${requestType}' timed out after ${timeoutMs}ms`), {
481
- _tag: UI_REQUEST_TIMEOUT_TAG
482
- })
483
- );
484
- }
485
- }, timeoutMs);
486
- this.pending.set(requestType, {
487
- resolve,
488
- reject,
489
- timer
490
- });
491
- });
492
- }
493
- resolve(responseType, payload) {
494
- let requestType = RESPONSE_TO_REQUEST[responseType];
495
- if (responseType === UI_RESPONSE.RECEIVE_QR_RESPONSE) {
496
- if (this.pending.has(UI_REQUEST.REQUEST_QR_DISPLAY)) {
497
- requestType = UI_REQUEST.REQUEST_QR_DISPLAY;
498
- } else if (this.pending.has(UI_REQUEST.REQUEST_QR_SCAN)) {
499
- requestType = UI_REQUEST.REQUEST_QR_SCAN;
500
- }
501
- }
502
- if (!requestType) return;
503
- const entry = this.pending.get(requestType);
504
- if (!entry) return;
505
- clearTimeout(entry.timer);
506
- this.pending.delete(requestType);
507
- entry.resolve(payload);
508
- }
509
- cancel(requestType) {
510
- if (requestType) {
511
- const entry = this.pending.get(requestType);
512
- if (!entry) return;
513
- clearTimeout(entry.timer);
514
- this.pending.delete(requestType);
515
- entry.reject(
516
- Object.assign(new Error(`UI request '${requestType}' was cancelled`), {
517
- _tag: UI_REQUEST_CANCELLED_TAG
518
- })
519
- );
520
- return;
521
- }
522
- for (const [type, entry] of this.pending) {
523
- clearTimeout(entry.timer);
524
- entry.reject(
525
- Object.assign(new Error(`UI request '${type}' was cancelled`), {
526
- _tag: UI_REQUEST_CANCELLED_TAG
527
- })
528
- );
529
- }
530
- this.pending.clear();
531
- }
532
- reset() {
533
- this.cancel();
534
- }
535
- hasPending(requestType) {
536
- if (requestType) return this.pending.has(requestType);
537
- return this.pending.size > 0;
529
+ /** Number of listeners registered for `event`. 0 if none. */
530
+ listenerCount(event) {
531
+ return _nullishCoalesce(_optionalChain([this, 'access', _8 => _8._listeners, 'access', _9 => _9.get, 'call', _10 => _10(event), 'optionalAccess', _11 => _11.size]), () => ( 0));
538
532
  }
539
533
  };
540
534
 
@@ -543,8 +537,8 @@ function compareSemver(a, b) {
543
537
  const pa = a.split(".").map(Number);
544
538
  const pb = b.split(".").map(Number);
545
539
  for (let i = 0; i < 3; i++) {
546
- const va = pa[i] ?? 0;
547
- const vb = pb[i] ?? 0;
540
+ const va = _nullishCoalesce(pa[i], () => ( 0));
541
+ const vb = _nullishCoalesce(pb[i], () => ( 0));
548
542
  if (va < vb) return -1;
549
543
  if (va > vb) return 1;
550
544
  }
@@ -552,7 +546,7 @@ function compareSemver(a, b) {
552
546
  }
553
547
 
554
548
  // src/utils/hex.ts
555
- var import_utils2 = require("@noble/hashes/utils");
549
+
556
550
  function ensure0x(hex) {
557
551
  return hex.startsWith("0x") ? hex : `0x${hex}`;
558
552
  }
@@ -563,70 +557,43 @@ function padHex64(hex) {
563
557
  return `0x${stripHex(hex).padStart(64, "0")}`;
564
558
  }
565
559
  function hexToBytes(hex) {
566
- return (0, import_utils2.hexToBytes)(stripHex(hex));
560
+ return _utils.hexToBytes.call(void 0, stripHex(hex));
567
561
  }
568
562
  function bytesToHex2(bytes) {
569
- return (0, import_utils2.bytesToHex)(bytes);
563
+ return _utils.bytesToHex.call(void 0, bytes);
570
564
  }
571
565
 
572
- // src/utils/errorMessages.ts
573
- function enrichErrorMessage(code, originalMessage) {
574
- switch (code) {
575
- case 10400 /* PinInvalid */:
576
- return `${originalMessage}. Please re-enter your PIN.`;
577
- case 10401 /* PinCancelled */:
578
- return `${originalMessage}. PIN entry was cancelled.`;
579
- case 10102 /* DeviceBusy */:
580
- return `${originalMessage}. The device is in use by another application. Close other wallet apps and try again.`;
581
- case 10101 /* DeviceDisconnected */:
582
- return `${originalMessage}. Please reconnect the device and try again.`;
583
- case 10103 /* DeviceLocked */:
584
- return `${originalMessage}. Please unlock your device and try again.`;
585
- case 10109 /* DeviceOneDeviceOnly */:
586
- return `${originalMessage}. Disconnect the extra device and try again.`;
587
- case 10001 /* UserRejected */:
588
- return `${originalMessage}. The request was rejected on the device.`;
589
- case 10501 /* WrongApp */:
590
- return `${originalMessage}. Please open the correct app on your device.`;
591
- case 10500 /* AppNotInstalled */:
592
- return `${originalMessage}. The required app is not installed on the device.`;
593
- case 10503 /* DeviceOutOfMemory */:
594
- return `${originalMessage}. Not enough free space on the device. Please uninstall some apps and try again.`;
595
- case 10302 /* TransportNotAvailable */:
596
- return `${originalMessage}. Ensure the device bridge/transport is available and running.`;
597
- case 10305 /* NetworkError */:
598
- return `${originalMessage}. Network error \u2014 check your internet connection and try again.`;
599
- case 10200 /* FirmwareTooOld */:
600
- return `${originalMessage}. Please update your device firmware.`;
601
- case 10104 /* DeviceNotInitialized */:
602
- return `${originalMessage}. The device may need to be set up first.`;
603
- case 10003 /* OperationTimeout */:
604
- return `${originalMessage}. The operation timed out. Please try again.`;
605
- case 11e3 /* EvmBlindSigningRequired */:
606
- return "Ledger: Blind signing not enabled in Ethereum app.";
607
- case 11001 /* EvmClearSignPluginMissing */:
608
- return "Ledger: Required plugin not installed (install via Ledger Live).";
609
- case 11002 /* EvmDataTooLarge */:
610
- return "Ledger: Transaction data too large for device memory.";
611
- case 11003 /* EvmTxTypeNotSupported */:
612
- return "Ledger: Transaction type not supported by current Ethereum app.";
613
- case 10502 /* AppTooOld */:
614
- return "Ledger: App out of date (update via Ledger Live).";
615
- case 11100 /* SolanaBlindSigningRequired */:
616
- return "Blind signing disabled in the Solana app.";
617
- case 11200 /* TronCustomContractRequired */:
618
- return "Custom Contracts setting disabled in the Tron app.";
619
- case 11201 /* TronDataSigningRequired */:
620
- return "Transactions Data setting disabled in the Tron app.";
621
- case 11202 /* TronSignByHashRequired */:
622
- return "Sign by Hash setting disabled in the Tron app.";
623
- case 11300 /* BtcWalletPolicyHmacMismatch */:
624
- return "Wallet policy not registered or HMAC mismatch.";
625
- case 11301 /* BtcUnexpectedState */:
626
- return "Signing aborted due to unexpected device state.";
627
- default:
628
- return originalMessage;
566
+ // src/utils/deviceIdentity.ts
567
+ var ONEKEY_BLE_SERVICE_UUID = "00000001-0000-1000-8000-00805f9b34fb";
568
+ var TREZOR_BLE_SERVICE_UUID = "8c000001-a59b-4d58-a9ad-073df69fa1b1";
569
+ var LEDGER_USB_VENDOR_ID = 11415;
570
+ var lower = (value) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _12 => _12.trim, 'call', _13 => _13(), 'access', _14 => _14.toLowerCase, 'call', _15 => _15()]), () => ( ""));
571
+ var hasServiceUuid = (input, uuid) => {
572
+ const expected = uuid.toLowerCase();
573
+ const values = [
574
+ ..._nullishCoalesce(input.serviceUUIDs, () => ( [])),
575
+ ..._nullishCoalesce(input.advertisedServiceUuids, () => ( [])),
576
+ ..._nullishCoalesce(input.serviceUuids, () => ( []))
577
+ ];
578
+ return values.some((value) => value.toLowerCase() === expected);
579
+ };
580
+ function detectHardwareVendorFromDescriptor(input) {
581
+ const manufacturerName = lower(input.manufacturerName);
582
+ const fwVendor = lower(input.fw_vendor);
583
+ if (hasServiceUuid(input, ONEKEY_BLE_SERVICE_UUID) || manufacturerName.includes("onekey") || fwVendor === "onekey" || input.onekey_version || input.onekey_device_type || input.onekey_serial) {
584
+ return "onekey";
585
+ }
586
+ if (hasServiceUuid(input, TREZOR_BLE_SERVICE_UUID) || manufacturerName.includes("trezor") || fwVendor === "trezor") {
587
+ return "trezor";
588
+ }
589
+ if (typeof input.vendor === "number" && input.vendor === LEDGER_USB_VENDOR_ID || input.vendorId === LEDGER_USB_VENDOR_ID || manufacturerName.includes("ledger")) {
590
+ return "ledger";
629
591
  }
592
+ return void 0;
593
+ }
594
+ function isKnownNonTargetHardwareVendor(input, targetVendor) {
595
+ const detectedVendor = detectHardwareVendorFromDescriptor(input);
596
+ return detectedVendor !== void 0 && detectedVendor !== targetVendor;
630
597
  }
631
598
 
632
599
  // src/utils/batchCall.ts
@@ -638,43 +605,161 @@ async function batchCall(params, callFn, onProgress) {
638
605
  return result;
639
606
  }
640
607
  results.push(result.payload);
641
- onProgress?.({ index: i, total: params.length });
608
+ _optionalChain([onProgress, 'optionalCall', _16 => _16({ index: i, total: params.length })]);
642
609
  }
643
610
  return { success: true, payload: results };
644
611
  }
645
- // Annotate the CommonJS export names for ESM import in node:
646
- 0 && (module.exports = {
647
- CHAIN_FINGERPRINT_PATHS,
648
- DEVICE,
649
- DEVICE_EVENT,
650
- DeviceJobQueue,
651
- EConnectorInteraction,
652
- HardwareErrorCode,
653
- ORPHAN_ELIGIBLE_ERROR_CODES,
654
- SDK,
655
- TypedEventEmitter,
656
- UI_EVENT,
657
- UI_REQUEST,
658
- UI_REQUEST_CANCELLED_TAG,
659
- UI_REQUEST_DEFAULT_TIMEOUT_MS,
660
- UI_REQUEST_PREEMPTED_TAG,
661
- UI_REQUEST_TIMEOUT_TAG,
662
- UI_RESPONSE,
663
- UiRequestRegistry,
664
- batchCall,
665
- bytesToHex,
666
- compareSemver,
667
- createBridgedConnector,
668
- createHwkError,
669
- deriveDeviceFingerprint,
670
- enrichErrorMessage,
671
- ensure0x,
672
- failure,
673
- hexToBytes,
674
- padHex64,
675
- rehydrateConnectorError,
676
- serializeConnectorError,
677
- stripHex,
678
- success
679
- });
612
+
613
+ // src/utils/methodCatalog.ts
614
+ var HARDWARE_METHOD_CATALOG = {
615
+ evmGetAddress: { chain: "evm", allNetwork: true },
616
+ evmSignTransaction: { chain: "evm", allNetwork: false },
617
+ evmSignMessage: { chain: "evm", allNetwork: false },
618
+ evmSignTypedData: { chain: "evm", allNetwork: false },
619
+ btcGetAddress: { chain: "btc", allNetwork: true },
620
+ btcGetPublicKey: { chain: "btc", allNetwork: true },
621
+ btcSignTransaction: { chain: "btc", allNetwork: false },
622
+ btcSignPsbt: { chain: "btc", allNetwork: false },
623
+ btcSignMessage: { chain: "btc", allNetwork: false },
624
+ btcGetMasterFingerprint: { chain: "btc", allNetwork: false },
625
+ solGetAddress: { chain: "sol", allNetwork: true },
626
+ solSignTransaction: { chain: "sol", allNetwork: false },
627
+ solSignMessage: { chain: "sol", allNetwork: false },
628
+ tronGetAddress: { chain: "tron", allNetwork: true },
629
+ tronSignTransaction: { chain: "tron", allNetwork: false },
630
+ tronSignMessage: { chain: "tron", allNetwork: false }
631
+ };
632
+ var ALL_NETWORK_METHOD_NAMES = Object.entries(HARDWARE_METHOD_CATALOG).filter(([, metadata]) => metadata.allNetwork).map(([method]) => method);
633
+ var ALL_NETWORK_METHOD_SET = new Set(ALL_NETWORK_METHOD_NAMES);
634
+ function getHardwareMethodMetadata(method) {
635
+ return HARDWARE_METHOD_CATALOG[method];
636
+ }
637
+ function isAllNetworkMethodName(method) {
638
+ return ALL_NETWORK_METHOD_SET.has(method);
639
+ }
640
+ function getAllNetworkMethodChain(method) {
641
+ return HARDWARE_METHOD_CATALOG[method].chain;
642
+ }
643
+
644
+ // src/utils/allNetwork.ts
645
+ async function runAllNetworkGetAddress({
646
+ connectId,
647
+ deviceId,
648
+ params,
649
+ getMethodChain = (method) => getAllNetworkMethodChain(method),
650
+ normalizeItem = (_method, item) => item,
651
+ buildUnsupportedNetworkResponse,
652
+ callItem,
653
+ attachIdentity,
654
+ shouldAbortBundle = () => false,
655
+ buildTopLevelFailure = defaultBuildTopLevelFailure
656
+ }) {
657
+ const responses = [];
658
+ for (const [index, item] of params.bundle.entries()) {
659
+ if (!isAllNetworkMethodName(String(item.methodName))) {
660
+ responses.push(buildUnsupportedMethodResponse(item));
661
+ continue;
662
+ }
663
+ const method = item.methodName;
664
+ const unsupportedNetwork = _optionalChain([buildUnsupportedNetworkResponse, 'optionalCall', _17 => _17(item, method)]);
665
+ if (unsupportedNetwork) {
666
+ responses.push(unsupportedNetwork);
667
+ continue;
668
+ }
669
+ const chain = getMethodChain(method, item);
670
+ const normalizedItem = normalizeItem(method, item);
671
+ const context = {
672
+ connectId,
673
+ deviceId,
674
+ method,
675
+ chain,
676
+ item: normalizedItem,
677
+ index
678
+ };
679
+ const response = await callItem(context);
680
+ const itemResponse = response.success ? await attachIdentity({
681
+ ...context,
682
+ payload: response.payload
683
+ }) : {
684
+ ...normalizedItem,
685
+ success: false,
686
+ payload: response.payload
687
+ };
688
+ const responseContext = { ...context, response: itemResponse };
689
+ if (!itemResponse.success && shouldAbortBundle(itemResponse, responseContext)) {
690
+ return buildTopLevelFailure(itemResponse, responseContext);
691
+ }
692
+ responses.push(itemResponse);
693
+ }
694
+ return success(responses);
695
+ }
696
+ function buildUnsupportedMethodResponse(item) {
697
+ return {
698
+ ...item,
699
+ success: false,
700
+ payload: {
701
+ code: 10002 /* InvalidParams */,
702
+ error: `Unsupported allNetwork method: ${String(item.methodName)}`
703
+ }
704
+ };
705
+ }
706
+ function defaultBuildTopLevelFailure(response) {
707
+ const payload = _nullishCoalesce(response.payload, () => ( {}));
708
+ return failure(
709
+ _nullishCoalesce(payload.code, () => ( 10106)) /* DeviceMismatch */,
710
+ _nullishCoalesce(payload.error, () => ( "All-network get-address aborted")),
711
+ normalizeFailureParams(payload.params)
712
+ );
713
+ }
714
+ function normalizeFailureParams(params) {
715
+ return params && typeof params === "object" ? params : void 0;
716
+ }
717
+
718
+ // src/constants.ts
719
+ var DEVICE_CONNECT_RETRY_DELAY_MS = 1e3;
720
+
721
+
722
+
723
+
724
+
725
+
726
+
727
+
728
+
729
+
730
+
731
+
732
+
733
+
734
+
735
+
736
+
737
+
738
+
739
+
740
+
741
+
742
+
743
+
744
+
745
+
746
+
747
+
748
+
749
+
750
+
751
+
752
+
753
+
754
+
755
+
756
+
757
+
758
+
759
+
760
+
761
+
762
+
763
+
764
+ exports.ALL_NETWORK_METHOD_NAMES = ALL_NETWORK_METHOD_NAMES; exports.CHAIN_FINGERPRINT_PATHS = CHAIN_FINGERPRINT_PATHS; exports.DEVICE = DEVICE; exports.DEVICE_CONNECT_RETRY_DELAY_MS = DEVICE_CONNECT_RETRY_DELAY_MS; exports.DEVICE_EVENT = DEVICE_EVENT; exports.DeviceJobQueue = DeviceJobQueue; exports.EConnectorInteraction = EConnectorInteraction; exports.HARDWARE_METHOD_CATALOG = HARDWARE_METHOD_CATALOG; exports.HardwareErrorCode = _chunkQD4EQWQAjs.HardwareErrorCode; exports.ORPHAN_ELIGIBLE_ERROR_CODES = _chunkQD4EQWQAjs.ORPHAN_ELIGIBLE_ERROR_CODES; exports.SDK = SDK; exports.TypedEventEmitter = TypedEventEmitter; exports.UI_EVENT = _chunkLYVS67EXjs.UI_EVENT; exports.UI_REQUEST = _chunkLYVS67EXjs.UI_REQUEST; exports.UI_REQUEST_CANCELLED_TAG = _chunkLYVS67EXjs.UI_REQUEST_CANCELLED_TAG; exports.UI_REQUEST_DEFAULT_TIMEOUT_MS = _chunkLYVS67EXjs.UI_REQUEST_DEFAULT_TIMEOUT_MS; exports.UI_REQUEST_PREEMPTED_TAG = _chunkLYVS67EXjs.UI_REQUEST_PREEMPTED_TAG; exports.UI_REQUEST_TIMEOUT_TAG = _chunkLYVS67EXjs.UI_REQUEST_TIMEOUT_TAG; exports.UI_RESPONSE = _chunkLYVS67EXjs.UI_RESPONSE; exports.UiRequestRegistry = _chunkLYVS67EXjs.UiRequestRegistry; exports.batchCall = batchCall; exports.buildUnsupportedMethodResponse = buildUnsupportedMethodResponse; exports.bytesToHex = bytesToHex2; exports.compareSemver = compareSemver; exports.createBridgedConnector = createBridgedConnector; exports.createCombinedConnector = createCombinedConnector; exports.createHwkError = _chunkQD4EQWQAjs.createHwkError; exports.deriveDeviceFingerprint = deriveDeviceFingerprint; exports.detectHardwareVendorFromDescriptor = detectHardwareVendorFromDescriptor; exports.enrichErrorMessage = _chunkQD4EQWQAjs.enrichErrorMessage; exports.ensure0x = ensure0x; exports.failure = failure; exports.getAllNetworkMethodChain = getAllNetworkMethodChain; exports.getHardwareMethodMetadata = getHardwareMethodMetadata; exports.hexToBytes = hexToBytes; exports.isAllNetworkMethodName = isAllNetworkMethodName; exports.isKnownNonTargetHardwareVendor = isKnownNonTargetHardwareVendor; exports.padHex64 = padHex64; exports.rehydrateConnectorError = rehydrateConnectorError; exports.runAllNetworkGetAddress = runAllNetworkGetAddress; exports.serializeConnectorError = serializeConnectorError; exports.stripHex = stripHex; exports.success = success;
680
765
  //# sourceMappingURL=index.js.map