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