@onekeyfe/hwk-adapter-core 1.2.8-alpha.117 → 1.2.8-alpha.119
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-T5HIQPNG.js → chunk-UFNTICCX.js} +4 -1
- package/dist/chunk-UFNTICCX.js.map +1 -0
- package/dist/{chunk-KTRQZ5AJ.mjs → chunk-V2OHL2JS.mjs} +4 -1
- package/dist/chunk-V2OHL2JS.mjs.map +1 -0
- package/dist/{chunk-AYS7A7Z3.js → chunk-VVAN3W2C.js} +7 -3
- package/dist/chunk-VVAN3W2C.js.map +1 -0
- package/dist/{chunk-G5EU7VRW.mjs → chunk-VWVDPWNI.mjs} +6 -2
- package/dist/chunk-VWVDPWNI.mjs.map +1 -0
- package/dist/{errors-BgJ4kzRx.d.ts → errors-DednD9bG.d.mts} +5 -0
- package/dist/{errors-BgJ4kzRx.d.mts → errors-DednD9bG.d.ts} +5 -0
- 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 +288 -274
- package/dist/index.d.ts +288 -274
- package/dist/index.js +47 -49
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{ui-events-C61GTilK.d.ts → ui-events-BCbB6sfo.d.mts} +11 -0
- package/dist/{ui-events-C61GTilK.d.mts → ui-events-BCbB6sfo.d.ts} +11 -0
- package/dist/ui-events.d.mts +1 -1
- package/dist/ui-events.d.ts +1 -1
- package/dist/ui-events.js +3 -3
- package/dist/ui-events.mjs +2 -2
- package/package.json +2 -2
- package/dist/chunk-AYS7A7Z3.js.map +0 -1
- package/dist/chunk-G5EU7VRW.mjs.map +0 -1
- package/dist/chunk-KTRQZ5AJ.mjs.map +0 -1
- package/dist/chunk-T5HIQPNG.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var _chunkYLCHSNXOjs = require('./chunk-YLCHSNXO.js');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkVVAN3W2Cjs = require('./chunk-VVAN3W2C.js');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ var _chunkAYS7A7Z3js = require('./chunk-AYS7A7Z3.js');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkUFNTICCXjs = require('./chunk-UFNTICCX.js');
|
|
23
23
|
|
|
24
24
|
// src/types/response.ts
|
|
25
25
|
function success(payload) {
|
|
@@ -32,7 +32,7 @@ function failure(code, error, params, origin, recovery) {
|
|
|
32
32
|
error,
|
|
33
33
|
code,
|
|
34
34
|
...origin !== void 0 ? { origin } : {},
|
|
35
|
-
recovery: _nullishCoalesce(recovery, () => (
|
|
35
|
+
recovery: _nullishCoalesce(recovery, () => ( _chunkUFNTICCXjs.defaultRecoveryForCode.call(void 0, code))),
|
|
36
36
|
...params ? { params } : {}
|
|
37
37
|
}
|
|
38
38
|
};
|
|
@@ -314,13 +314,13 @@ var OperationRegistry = class {
|
|
|
314
314
|
if (!active) {
|
|
315
315
|
const ended = this._ended.get(operationId);
|
|
316
316
|
if (ended) {
|
|
317
|
-
throw
|
|
317
|
+
throw _chunkUFNTICCXjs.createHwkError.call(void 0, {
|
|
318
318
|
code: 10113 /* OperationEnded */,
|
|
319
319
|
message: `Hardware operation has ended (${ended.reason})`,
|
|
320
320
|
params: { operationId, reason: ended.reason }
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
|
-
throw
|
|
323
|
+
throw _chunkUFNTICCXjs.createHwkError.call(void 0, {
|
|
324
324
|
code: 10112 /* OperationNotFound */,
|
|
325
325
|
message: "Hardware operation was not found",
|
|
326
326
|
params: { operationId }
|
|
@@ -358,11 +358,9 @@ var OperationRegistry = class {
|
|
|
358
358
|
(operation) => operation.connectionKeys.includes(connectionKey)
|
|
359
359
|
);
|
|
360
360
|
}
|
|
361
|
-
/**
|
|
361
|
+
/** Only an explicitly supplied operation job key owns the call's UI requests. */
|
|
362
362
|
findOperationIdByJobKey(jobKey) {
|
|
363
|
-
|
|
364
|
-
if (isHardwareOperationId(jobKey)) return jobKey;
|
|
365
|
-
return _optionalChain([this, 'access', _9 => _9.findActiveByConnectionKey, 'call', _10 => _10(jobKey), 'optionalAccess', _11 => _11.operationId]);
|
|
363
|
+
return isHardwareOperationId(jobKey) ? jobKey : void 0;
|
|
366
364
|
}
|
|
367
365
|
/**
|
|
368
366
|
* End an operation on the caller's explicit release. Throws for an unknown id; returns undefined
|
|
@@ -381,7 +379,7 @@ var OperationRegistry = class {
|
|
|
381
379
|
if (active.timer) clearTimeout(active.timer);
|
|
382
380
|
this._active.delete(operationId);
|
|
383
381
|
this._rememberEnded(active, reason);
|
|
384
|
-
_optionalChain([this, 'access',
|
|
382
|
+
_optionalChain([this, 'access', _9 => _9._onEnded, 'optionalCall', _10 => _10(active, reason)]);
|
|
385
383
|
return active;
|
|
386
384
|
}
|
|
387
385
|
endByConnectionKey(connectionKey, reason, exceptOperationId) {
|
|
@@ -407,7 +405,7 @@ var OperationRegistry = class {
|
|
|
407
405
|
const timer = setTimeout(() => {
|
|
408
406
|
this.end(operationId, "timeout");
|
|
409
407
|
}, this._ttlMs);
|
|
410
|
-
_optionalChain([timer, 'access',
|
|
408
|
+
_optionalChain([timer, 'access', _11 => _11.unref, 'optionalCall', _12 => _12()]);
|
|
411
409
|
return timer;
|
|
412
410
|
}
|
|
413
411
|
_rememberEnded(operation, reason) {
|
|
@@ -424,17 +422,17 @@ function resolveHardwareOperationTarget(positionalTargetId, commonOperationId, e
|
|
|
424
422
|
const commonId = commonOperationId || void 0;
|
|
425
423
|
const parsedTarget = parseHardwareRuntimeId(targetId);
|
|
426
424
|
const parsedCommon = parseHardwareRuntimeId(commonId);
|
|
427
|
-
const positionalOperationId = _optionalChain([parsedTarget, 'optionalAccess',
|
|
425
|
+
const positionalOperationId = _optionalChain([parsedTarget, 'optionalAccess', _13 => _13.kind]) === "operation" ? targetId : void 0;
|
|
428
426
|
if (hasHardwareRuntimeIdPrefix(targetId) && !parsedTarget) {
|
|
429
427
|
return failure(10002 /* InvalidParams */, "Invalid hardware operation target id");
|
|
430
428
|
}
|
|
431
|
-
if (_optionalChain([parsedTarget, 'optionalAccess',
|
|
429
|
+
if (_optionalChain([parsedTarget, 'optionalAccess', _14 => _14.kind]) === "link") {
|
|
432
430
|
return failure(
|
|
433
431
|
10002 /* InvalidParams */,
|
|
434
432
|
"Hardware transport link id cannot be used as an operation target"
|
|
435
433
|
);
|
|
436
434
|
}
|
|
437
|
-
if (commonId && _optionalChain([parsedCommon, 'optionalAccess',
|
|
435
|
+
if (commonId && _optionalChain([parsedCommon, 'optionalAccess', _15 => _15.kind]) !== "operation") {
|
|
438
436
|
return failure(10002 /* InvalidParams */, "Invalid hardware operation id");
|
|
439
437
|
}
|
|
440
438
|
if (expectedVendor && [parsedTarget, parsedCommon].some((parsed) => parsed && parsed.vendor !== expectedVendor)) {
|
|
@@ -497,14 +495,14 @@ function createBridgedConnector(vendor, connectionType, bridge) {
|
|
|
497
495
|
},
|
|
498
496
|
off: (event, handler) => {
|
|
499
497
|
const inner = handlerMap.get(event);
|
|
500
|
-
const bridgeHandler = _optionalChain([inner, 'optionalAccess',
|
|
498
|
+
const bridgeHandler = _optionalChain([inner, 'optionalAccess', _16 => _16.get, 'call', _17 => _17(handler)]);
|
|
501
499
|
if (!bridgeHandler || !inner) return;
|
|
502
500
|
bridge.offEvent({ vendor }, bridgeHandler);
|
|
503
501
|
inner.delete(handler);
|
|
504
502
|
if (inner.size === 0) handlerMap.delete(event);
|
|
505
503
|
},
|
|
506
504
|
reset: () => bridge.reset({ vendor }),
|
|
507
|
-
configure: bridge.configure ? (config) => _optionalChain([bridge, 'access',
|
|
505
|
+
configure: bridge.configure ? (config) => _optionalChain([bridge, 'access', _18 => _18.configure, 'optionalCall', _19 => _19({ vendor, config })]) : void 0,
|
|
508
506
|
setKnownCredentials: bridge.setKnownCredentials ? (credentials) => bridge.setKnownCredentials({ vendor, credentials }) : void 0
|
|
509
507
|
};
|
|
510
508
|
}
|
|
@@ -582,13 +580,13 @@ function isDeviceUnavailableError(error) {
|
|
|
582
580
|
return false;
|
|
583
581
|
}
|
|
584
582
|
function combinedDeviceNotFoundError(message) {
|
|
585
|
-
return
|
|
583
|
+
return _chunkUFNTICCXjs.createHwkError.call(void 0, {
|
|
586
584
|
code: 10100 /* DeviceNotFound */,
|
|
587
585
|
message
|
|
588
586
|
});
|
|
589
587
|
}
|
|
590
588
|
function combinedSessionNotFoundError(message) {
|
|
591
|
-
return
|
|
589
|
+
return _chunkUFNTICCXjs.createHwkError.call(void 0, {
|
|
592
590
|
code: 10101 /* DeviceDisconnected */,
|
|
593
591
|
message
|
|
594
592
|
});
|
|
@@ -617,7 +615,7 @@ function createCombinedConnector(connectors) {
|
|
|
617
615
|
};
|
|
618
616
|
const broadcastCredentials = async () => {
|
|
619
617
|
await Promise.all(
|
|
620
|
-
connectors.map((child) => Promise.resolve(_optionalChain([child, 'access',
|
|
618
|
+
connectors.map((child) => Promise.resolve(_optionalChain([child, 'access', _20 => _20.setKnownCredentials, 'optionalCall', _21 => _21(sharedCredentials)])))
|
|
621
619
|
);
|
|
622
620
|
};
|
|
623
621
|
for (const child of connectors) {
|
|
@@ -722,7 +720,7 @@ function createCombinedConnector(connectors) {
|
|
|
722
720
|
}
|
|
723
721
|
}
|
|
724
722
|
const message = lastError instanceof Error ? lastError.message : `Combined connector: device not found: ${deviceId}`;
|
|
725
|
-
throw
|
|
723
|
+
throw _chunkUFNTICCXjs.createHwkError.call(void 0, {
|
|
726
724
|
code: 10100 /* DeviceNotFound */,
|
|
727
725
|
message
|
|
728
726
|
});
|
|
@@ -737,9 +735,9 @@ function createCombinedConnector(connectors) {
|
|
|
737
735
|
let owner;
|
|
738
736
|
let session;
|
|
739
737
|
if (deviceId) {
|
|
740
|
-
({ session, owner } = await connectByExplicitId(deviceId, _optionalChain([options, 'optionalAccess',
|
|
738
|
+
({ session, owner } = await connectByExplicitId(deviceId, _optionalChain([options, 'optionalAccess', _22 => _22.transportType])));
|
|
741
739
|
} else {
|
|
742
|
-
const resolved = await resolveOwner(void 0, _optionalChain([options, 'optionalAccess',
|
|
740
|
+
const resolved = await resolveOwner(void 0, _optionalChain([options, 'optionalAccess', _23 => _23.transportType]));
|
|
743
741
|
owner = resolved.owner;
|
|
744
742
|
session = await owner.connect(resolved.deviceId);
|
|
745
743
|
}
|
|
@@ -785,7 +783,7 @@ function createCombinedConnector(connectors) {
|
|
|
785
783
|
},
|
|
786
784
|
off: (event, handler) => {
|
|
787
785
|
const inner = forwarders.get(event);
|
|
788
|
-
const attached = _optionalChain([inner, 'optionalAccess',
|
|
786
|
+
const attached = _optionalChain([inner, 'optionalAccess', _24 => _24.get, 'call', _25 => _25(handler)]);
|
|
789
787
|
if (!attached || !inner) return;
|
|
790
788
|
for (const { child, handler: forward } of attached) {
|
|
791
789
|
child.off(event, forward);
|
|
@@ -800,7 +798,7 @@ function createCombinedConnector(connectors) {
|
|
|
800
798
|
forwarders.clear();
|
|
801
799
|
},
|
|
802
800
|
configure: connectors.some((c) => c.configure) ? async (config) => {
|
|
803
|
-
await Promise.all(connectors.map((child) => Promise.resolve(_optionalChain([child, 'access',
|
|
801
|
+
await Promise.all(connectors.map((child) => Promise.resolve(_optionalChain([child, 'access', _26 => _26.configure, 'optionalCall', _27 => _27(config)]))));
|
|
804
802
|
deviceOwner.clear();
|
|
805
803
|
sessionOwner.clear();
|
|
806
804
|
} : void 0,
|
|
@@ -844,19 +842,19 @@ var TypedEventEmitter = class {
|
|
|
844
842
|
}
|
|
845
843
|
/** Number of listeners registered for `event`. 0 if none. */
|
|
846
844
|
listenerCount(event) {
|
|
847
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
845
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _28 => _28._listeners, 'access', _29 => _29.get, 'call', _30 => _30(event), 'optionalAccess', _31 => _31.size]), () => ( 0));
|
|
848
846
|
}
|
|
849
847
|
};
|
|
850
848
|
|
|
851
849
|
// src/utils/requestSaveDeviceBinding.ts
|
|
852
850
|
function emitDeviceBindingStatus(emitter, selectionRequestId, status) {
|
|
853
|
-
emitter.emit(
|
|
854
|
-
type:
|
|
851
|
+
emitter.emit(_chunkVVAN3W2Cjs.UI_REQUEST.DEVICE_BINDING_STATUS, {
|
|
852
|
+
type: _chunkVVAN3W2Cjs.UI_REQUEST.DEVICE_BINDING_STATUS,
|
|
855
853
|
payload: { selectionRequestId, status }
|
|
856
854
|
});
|
|
857
855
|
}
|
|
858
856
|
async function requestSaveDeviceBinding(emitter, registry, binding, signal) {
|
|
859
|
-
const type =
|
|
857
|
+
const type = _chunkVVAN3W2Cjs.UI_REQUEST.REQUEST_SAVE_DEVICE_BINDING;
|
|
860
858
|
const emitStatus = (status) => emitDeviceBindingStatus(emitter, binding.selectionRequestId, status);
|
|
861
859
|
const declined = (reason) => {
|
|
862
860
|
emitStatus("failed");
|
|
@@ -865,29 +863,29 @@ async function requestSaveDeviceBinding(emitter, registry, binding, signal) {
|
|
|
865
863
|
if (!emitter.listenerCount(type)) {
|
|
866
864
|
return declined("skipped");
|
|
867
865
|
}
|
|
868
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
866
|
+
if (_optionalChain([signal, 'optionalAccess', _32 => _32.aborted])) throw signal.reason;
|
|
869
867
|
const requestId = registry.createRequestId();
|
|
870
868
|
const pending = registry.wait(type, { requestId, operationId: binding.operationId });
|
|
871
869
|
void pending.catch(() => void 0);
|
|
872
870
|
const cancel = () => registry.cancel(type, requestId);
|
|
873
|
-
_optionalChain([signal, 'optionalAccess',
|
|
871
|
+
_optionalChain([signal, 'optionalAccess', _33 => _33.addEventListener, 'call', _34 => _34("abort", cancel, { once: true })]);
|
|
874
872
|
try {
|
|
875
873
|
emitter.emit(type, { type, payload: { ...binding, requestId } });
|
|
876
874
|
const response = await pending;
|
|
877
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
878
|
-
if (_optionalChain([response, 'optionalAccess',
|
|
879
|
-
return declined(_nullishCoalesce(_optionalChain([response, 'optionalAccess',
|
|
875
|
+
if (_optionalChain([signal, 'optionalAccess', _35 => _35.aborted])) throw signal.reason;
|
|
876
|
+
if (_optionalChain([response, 'optionalAccess', _36 => _36.saved]) !== true) {
|
|
877
|
+
return declined(_nullishCoalesce(_optionalChain([response, 'optionalAccess', _37 => _37.reason]), () => ( "skipped")));
|
|
880
878
|
}
|
|
881
879
|
emitStatus("saved");
|
|
882
880
|
return { saved: true };
|
|
883
881
|
} catch (error) {
|
|
884
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
882
|
+
if (_optionalChain([signal, 'optionalAccess', _38 => _38.aborted])) {
|
|
885
883
|
emitStatus("cancelled");
|
|
886
884
|
throw error;
|
|
887
885
|
}
|
|
888
886
|
return declined("skipped");
|
|
889
887
|
} finally {
|
|
890
|
-
_optionalChain([signal, 'optionalAccess',
|
|
888
|
+
_optionalChain([signal, 'optionalAccess', _39 => _39.removeEventListener, 'call', _40 => _40("abort", cancel)]);
|
|
891
889
|
registry.cancel(type, requestId);
|
|
892
890
|
}
|
|
893
891
|
}
|
|
@@ -902,10 +900,10 @@ async function requestBleDeviceSelection({
|
|
|
902
900
|
allowUsbFallback = false,
|
|
903
901
|
pollIntervalMs = 1500
|
|
904
902
|
}) {
|
|
905
|
-
const type =
|
|
903
|
+
const type = _chunkVVAN3W2Cjs.UI_REQUEST.REQUEST_SELECT_DEVICE;
|
|
906
904
|
if (signal.aborted) throw signal.reason;
|
|
907
905
|
if (!emitter.listenerCount(type)) {
|
|
908
|
-
throw
|
|
906
|
+
throw _chunkUFNTICCXjs.createHwkError.call(void 0, {
|
|
909
907
|
code: 10100 /* DeviceNotFound */,
|
|
910
908
|
message: "Select a Bluetooth device before continuing"
|
|
911
909
|
});
|
|
@@ -920,7 +918,7 @@ async function requestBleDeviceSelection({
|
|
|
920
918
|
const stop = () => {
|
|
921
919
|
stopped = true;
|
|
922
920
|
if (timer !== void 0) clearTimeout(timer);
|
|
923
|
-
_optionalChain([wake, 'optionalCall',
|
|
921
|
+
_optionalChain([wake, 'optionalCall', _41 => _41()]);
|
|
924
922
|
};
|
|
925
923
|
const waitForNextScan = () => new Promise((resolve) => {
|
|
926
924
|
wake = resolve;
|
|
@@ -950,7 +948,7 @@ async function requestBleDeviceSelection({
|
|
|
950
948
|
while (!stopped) {
|
|
951
949
|
const snapshot = await rescan();
|
|
952
950
|
if (stopped || signal.aborted) return;
|
|
953
|
-
const usbFallback = allowUsbFallback ? _optionalChain([snapshot, 'optionalAccess',
|
|
951
|
+
const usbFallback = allowUsbFallback ? _optionalChain([snapshot, 'optionalAccess', _42 => _42.find, 'call', _43 => _43((device2) => device2.connectionType === "usb")]) : void 0;
|
|
954
952
|
if (usbFallback) return usbFallback;
|
|
955
953
|
if (snapshot) {
|
|
956
954
|
devices = snapshot;
|
|
@@ -968,7 +966,7 @@ async function requestBleDeviceSelection({
|
|
|
968
966
|
await polling;
|
|
969
967
|
if (signal.aborted) throw signal.reason;
|
|
970
968
|
if (!device) {
|
|
971
|
-
throw
|
|
969
|
+
throw _chunkUFNTICCXjs.createHwkError.call(void 0, {
|
|
972
970
|
code: 10100 /* DeviceNotFound */,
|
|
973
971
|
message: "Selected Bluetooth device is no longer available"
|
|
974
972
|
});
|
|
@@ -982,7 +980,7 @@ async function requestBleDeviceSelection({
|
|
|
982
980
|
stop();
|
|
983
981
|
signal.removeEventListener("abort", cancel);
|
|
984
982
|
registry.cancel(type, requestId);
|
|
985
|
-
await _optionalChain([polling, 'optionalAccess',
|
|
983
|
+
await _optionalChain([polling, 'optionalAccess', _44 => _44.catch, 'call', _45 => _45(() => void 0)]);
|
|
986
984
|
}
|
|
987
985
|
}
|
|
988
986
|
|
|
@@ -1022,7 +1020,7 @@ var MAX_CBOR_DEPTH = 64;
|
|
|
1022
1020
|
var DEFAULT_MAX_CBOR_BYTES = 8 * 1024 * 1024;
|
|
1023
1021
|
var ARGUMENT_BYTES = [1, 2, 4, 8];
|
|
1024
1022
|
function malformed(reason) {
|
|
1025
|
-
return
|
|
1023
|
+
return _chunkUFNTICCXjs.createHwkError.call(void 0, {
|
|
1026
1024
|
code: 10002 /* InvalidParams */,
|
|
1027
1025
|
message: `Malformed CBOR payload: ${reason}`
|
|
1028
1026
|
});
|
|
@@ -1487,7 +1485,7 @@ var TREZOR_BLE_SERVICE_UUID = "8c000001-a59b-4d58-a9ad-073df69fa1b1";
|
|
|
1487
1485
|
var LEDGER_USB_VENDOR_ID = 11415;
|
|
1488
1486
|
var KEYSTONE_USB_VENDOR_ID = 4617;
|
|
1489
1487
|
var KEYSTONE_USB_PRODUCT_ID = 12289;
|
|
1490
|
-
var lower = (value) => _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
1488
|
+
var lower = (value) => _nullishCoalesce(_optionalChain([value, 'optionalAccess', _46 => _46.trim, 'call', _47 => _47(), 'access', _48 => _48.toLowerCase, 'call', _49 => _49()]), () => ( ""));
|
|
1491
1489
|
var hasServiceUuid = (input, uuid) => {
|
|
1492
1490
|
const expected = uuid.toLowerCase();
|
|
1493
1491
|
const values = [
|
|
@@ -1530,7 +1528,7 @@ async function batchCall(params, callFn, onProgress) {
|
|
|
1530
1528
|
return result;
|
|
1531
1529
|
}
|
|
1532
1530
|
results.push(result.payload);
|
|
1533
|
-
_optionalChain([onProgress, 'optionalCall',
|
|
1531
|
+
_optionalChain([onProgress, 'optionalCall', _50 => _50({ index: i, total: params.length })]);
|
|
1534
1532
|
}
|
|
1535
1533
|
return { success: true, payload: results };
|
|
1536
1534
|
}
|
|
@@ -1591,7 +1589,7 @@ function getHardwareMethodMetadata(method) {
|
|
|
1591
1589
|
}
|
|
1592
1590
|
var SAFE_NON_CHAIN_METHODS = /* @__PURE__ */ new Set(["getFeatures", "authenticateDevice"]);
|
|
1593
1591
|
function canReplayHardwareMethodAfterTransportFailure(method) {
|
|
1594
|
-
return _optionalChain([getHardwareMethodMetadata, 'call',
|
|
1592
|
+
return _optionalChain([getHardwareMethodMetadata, 'call', _51 => _51(method), 'optionalAccess', _52 => _52.replayAfterTransportFailure]) === "safe" || SAFE_NON_CHAIN_METHODS.has(method);
|
|
1595
1593
|
}
|
|
1596
1594
|
function isAllNetworkMethodName(method) {
|
|
1597
1595
|
return ALL_NETWORK_METHOD_SET.has(method);
|
|
@@ -1620,7 +1618,7 @@ async function runAllNetworkGetAddress({
|
|
|
1620
1618
|
continue;
|
|
1621
1619
|
}
|
|
1622
1620
|
const method = item.methodName;
|
|
1623
|
-
const unsupportedNetwork = _optionalChain([buildUnsupportedNetworkResponse, 'optionalCall',
|
|
1621
|
+
const unsupportedNetwork = _optionalChain([buildUnsupportedNetworkResponse, 'optionalCall', _53 => _53(item, method)]);
|
|
1624
1622
|
if (unsupportedNetwork) {
|
|
1625
1623
|
responses.push(unsupportedNetwork);
|
|
1626
1624
|
continue;
|
|
@@ -1680,8 +1678,8 @@ function isConnectionLost(code) {
|
|
|
1680
1678
|
}
|
|
1681
1679
|
function buildAllNetworkCancelledFailure(signal) {
|
|
1682
1680
|
const reason = signal.reason;
|
|
1683
|
-
const code = typeof _optionalChain([reason, 'optionalAccess',
|
|
1684
|
-
const message = typeof _optionalChain([reason, 'optionalAccess',
|
|
1681
|
+
const code = typeof _optionalChain([reason, 'optionalAccess', _54 => _54.code]) === "number" ? reason.code : 10005 /* UserAborted */;
|
|
1682
|
+
const message = typeof _optionalChain([reason, 'optionalAccess', _55 => _55.message]) === "string" ? reason.message : "";
|
|
1685
1683
|
return failure(code, message || "All-network get-address cancelled");
|
|
1686
1684
|
}
|
|
1687
1685
|
function buildUnsupportedMethodResponse(item) {
|
|
@@ -1784,5 +1782,5 @@ var DEVICE_CONNECT_RETRY_DELAY_MS = 1e3;
|
|
|
1784
1782
|
|
|
1785
1783
|
|
|
1786
1784
|
|
|
1787
|
-
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.HARDWARE_RUNTIME_ID_PREFIX = HARDWARE_RUNTIME_ID_PREFIX; exports.HardwareErrorCode =
|
|
1785
|
+
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.HARDWARE_RUNTIME_ID_PREFIX = HARDWARE_RUNTIME_ID_PREFIX; exports.HardwareErrorCode = _chunkUFNTICCXjs.HardwareErrorCode; exports.MISSING_BIP32_MASTER_FINGERPRINT = MISSING_BIP32_MASTER_FINGERPRINT; exports.OPERATION_DEFAULT_TTL_MS = OPERATION_DEFAULT_TTL_MS; exports.ORPHAN_ELIGIBLE_ERROR_CODES = _chunkUFNTICCXjs.ORPHAN_ELIGIBLE_ERROR_CODES; exports.OperationRegistry = OperationRegistry; exports.SDK = SDK; exports.TypedEventEmitter = TypedEventEmitter; exports.UI_EVENT = _chunkVVAN3W2Cjs.UI_EVENT; exports.UI_REQUEST = _chunkVVAN3W2Cjs.UI_REQUEST; exports.UI_REQUEST_CANCELLED_TAG = _chunkVVAN3W2Cjs.UI_REQUEST_CANCELLED_TAG; exports.UI_REQUEST_DEFAULT_TIMEOUT_MS = _chunkVVAN3W2Cjs.UI_REQUEST_DEFAULT_TIMEOUT_MS; exports.UI_REQUEST_PREEMPTED_TAG = _chunkVVAN3W2Cjs.UI_REQUEST_PREEMPTED_TAG; exports.UI_REQUEST_TIMEOUT_TAG = _chunkVVAN3W2Cjs.UI_REQUEST_TIMEOUT_TAG; exports.UI_RESPONSE = _chunkVVAN3W2Cjs.UI_RESPONSE; exports.UiRequestRegistry = _chunkVVAN3W2Cjs.UiRequestRegistry; exports.assertBoundedCbor = assertBoundedCbor; exports.batchCall = batchCall; exports.boundedCborFromHex = boundedCborFromHex; exports.buildAllNetworkCancelledFailure = buildAllNetworkCancelledFailure; exports.buildUnsupportedMethodResponse = buildUnsupportedMethodResponse; exports.bytesToHex = bytesToHex3; exports.canReplayHardwareMethodAfterTransportFailure = canReplayHardwareMethodAfterTransportFailure; exports.compareSemver = compareSemver; exports.createBridgedConnector = createBridgedConnector; exports.createCombinedConnector = createCombinedConnector; exports.createHardwareLinkId = createHardwareLinkId; exports.createHardwareOperationId = createHardwareOperationId; exports.createHardwareSearchTargetId = createHardwareSearchTargetId; exports.createHwkError = _chunkUFNTICCXjs.createHwkError; exports.defaultOriginForCode = _chunkUFNTICCXjs.defaultOriginForCode; exports.defaultRecoveryForCode = _chunkUFNTICCXjs.defaultRecoveryForCode; exports.deriveDeviceFingerprint = deriveDeviceFingerprint; exports.detectHardwareVendorFromDescriptor = detectHardwareVendorFromDescriptor; exports.emitDeviceBindingStatus = emitDeviceBindingStatus; exports.enrichErrorMessage = _chunkYLCHSNXOjs.enrichErrorMessage; exports.ensure0x = ensure0x; exports.failure = failure; exports.getAllNetworkMethodChain = getAllNetworkMethodChain; exports.getHardwareMethodMetadata = getHardwareMethodMetadata; exports.hasHardwareRuntimeIdPrefix = hasHardwareRuntimeIdPrefix; exports.hexToBytes = hexToBytes; exports.isAllNetworkMethodName = isAllNetworkMethodName; exports.isConnectionLost = isConnectionLost; exports.isHardwareOperationId = isHardwareOperationId; exports.isHwkRecoveryHint = _chunkUFNTICCXjs.isHwkRecoveryHint; exports.isKnownNonTargetHardwareVendor = isKnownNonTargetHardwareVendor; exports.isUserRefusal = isUserRefusal; exports.isWalletSafetyFailure = isWalletSafetyFailure; exports.operationMayHaveCompletedParams = _chunkUFNTICCXjs.operationMayHaveCompletedParams; exports.padHex64 = padHex64; exports.parseBip32MasterFingerprint = parseBip32MasterFingerprint; exports.parseHardwareRuntimeId = parseHardwareRuntimeId; exports.parseWalletMasterFingerprint = parseWalletMasterFingerprint; exports.pickConnectionContext = pickConnectionContext; exports.prepareSolanaOffchainMessageV1 = prepareSolanaOffchainMessageV1; exports.rehydrateConnectorError = rehydrateConnectorError; exports.requestBleDeviceSelection = requestBleDeviceSelection; exports.requestSaveDeviceBinding = requestSaveDeviceBinding; exports.resolveHardwareOperationTarget = resolveHardwareOperationTarget; exports.resolveSearchTargetReusePolicy = resolveSearchTargetReusePolicy; exports.runAllNetworkGetAddress = runAllNetworkGetAddress; exports.serializeConnectorError = serializeConnectorError; exports.stripHex = stripHex; exports.success = success; exports.summarizeForLog = summarizeForLog; exports.toPhysicalDeviceSearchTarget = toPhysicalDeviceSearchTarget;
|
|
1788
1786
|
//# sourceMappingURL=index.js.map
|