@onekeyfe/hd-core 1.2.8-alpha.6 → 1.2.8-alpha.9
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/README.md +0 -27
- package/__tests__/DeviceCommands.test.ts +66 -13
- package/__tests__/core-error-output.test.ts +34 -3
- package/__tests__/device-lifecycle-events.test.ts +64 -17
- package/__tests__/device-pool-state.test.ts +50 -0
- package/__tests__/protocol-v2-bootloader-mode.test.ts +43 -2
- package/__tests__/protocol-v2.test.ts +0 -47
- package/__tests__/refresh-device-state.test.ts +19 -17
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/GetDeviceState.d.ts.map +1 -1
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/device/Device.d.ts +2 -0
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts +4 -4
- package/dist/device/DeviceCommands.d.ts.map +1 -1
- package/dist/device/DevicePool.d.ts.map +1 -1
- package/dist/events/logBlockEvent.d.ts.map +1 -1
- package/dist/index.d.ts +9 -14
- package/dist/index.js +39 -148
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/export.d.ts +0 -1
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +0 -2
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/params.d.ts +1 -0
- package/dist/types/params.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV4.ts +8 -25
- package/src/api/GetDeviceState.ts +2 -5
- package/src/api/index.ts +0 -1
- package/src/api/protocol-v2/DeviceReboot.ts +2 -0
- package/src/core/index.ts +3 -7
- package/src/data/messages/messages.json +0 -51
- package/src/device/Device.ts +11 -1
- package/src/device/DeviceCommands.ts +15 -1
- package/src/device/DevicePool.ts +12 -2
- package/src/events/core.ts +2 -2
- package/src/events/logBlockEvent.ts +0 -1
- package/src/inject.ts +0 -2
- package/src/types/api/export.ts +0 -1
- package/src/types/api/index.ts +0 -2
- package/src/types/params.ts +1 -1
- package/__tests__/btc-derive-context-hash.test.ts +0 -200
- package/dist/api/btc/BTCDeriveContextHash.d.ts +0 -16
- package/dist/api/btc/BTCDeriveContextHash.d.ts.map +0 -1
- package/dist/types/api/btcDeriveContextHash.d.ts +0 -10
- package/dist/types/api/btcDeriveContextHash.d.ts.map +0 -1
- package/src/api/btc/BTCDeriveContextHash.ts +0 -90
- package/src/types/api/btcDeriveContextHash.ts +0 -15
package/README.md
CHANGED
|
@@ -29,31 +29,4 @@ import Core from '@onekeyfe/hd-core';
|
|
|
29
29
|
Documentation is available [Hardware SDK Getting Started](https://developer.onekey.so/en/hardware-sdk/getting-started)
|
|
30
30
|
|
|
31
31
|
## Examples
|
|
32
|
-
|
|
33
|
-
### Babylon context hash
|
|
34
|
-
|
|
35
|
-
`btcDeriveContextHash(connectId, deviceId, params)` requires Classic 1s firmware
|
|
36
|
-
3.21.0 or later and Protocol V1. It uses the existing wallet session and device
|
|
37
|
-
confirmation flow. Other device families and Protocol V2 are not supported.
|
|
38
|
-
|
|
39
|
-
```typescript
|
|
40
|
-
const result = await HardwareSDK.btcDeriveContextHash(connectId, deviceId, {
|
|
41
|
-
path: "m/84'/0'/0'/0/0", // The currently selected Bitcoin key, not the IKM path.
|
|
42
|
-
appName: 'babylon-btc-vault',
|
|
43
|
-
context: 'deadbeef',
|
|
44
|
-
network: 'bitcoin-mainnet',
|
|
45
|
-
});
|
|
46
|
-
// result.payload.secret is a 32-byte value encoded as 64 lowercase hex characters.
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
`appName` must contain 1–64 ASCII lowercase letters, digits or hyphens. `context`
|
|
50
|
-
must be lowercase hex without `0x`, containing 1–1024 decoded bytes. `network` is
|
|
51
|
-
required: `bitcoin-mainnet`, `bitcoin-testnet` (testnet3/testnet4), `bitcoin-signet`,
|
|
52
|
-
or `bitcoin-regtest`. The SDK infers the Bitcoin input script type from `path` and
|
|
53
|
-
encodes `appName` as ASCII bytes; the device performs the derivation internally.
|
|
54
|
-
Device rejection and unsupported firmware errors propagate through the normal
|
|
55
|
-
SDK response. Treat the returned secret as sensitive and do not log or persist it.
|
|
56
|
-
|
|
57
|
-
See the [Babylon specification](https://github.com/babylonlabs-io/babylon-toolkit/blob/main/docs/specs/derive-context-hash.md).
|
|
58
|
-
|
|
59
32
|
// TODO: add example url
|
|
@@ -130,19 +130,6 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
130
130
|
);
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
it('preserves the Protocol V2 peer-removed pairing error code', async () => {
|
|
134
|
-
const commands = createCommands();
|
|
135
|
-
const transportError = Object.assign(new Error('Peer removed pairing information'), {
|
|
136
|
-
errorCode: HardwareErrorCode.BlePeerRemovedPairingInformation,
|
|
137
|
-
});
|
|
138
|
-
commands.mainId = 'main-id';
|
|
139
|
-
commands.transport = {
|
|
140
|
-
call: jest.fn().mockRejectedValue(transportError),
|
|
141
|
-
} as any;
|
|
142
|
-
|
|
143
|
-
await expect(commands._commonCall('DeviceInfoGet', {})).rejects.toBe(transportError);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
133
|
it('logs canonical DeviceStatus response fields without exposing the device ID', async () => {
|
|
147
134
|
const commands = createCommands();
|
|
148
135
|
const log = getLogger(LoggerNames.DeviceCommands);
|
|
@@ -414,6 +401,27 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
414
401
|
).rejects.toMatchObject({ errorCode: HardwareErrorCode.DeviceBusy });
|
|
415
402
|
});
|
|
416
403
|
|
|
404
|
+
it('maps commands rejected during a Protocol V2 firmware update to DeviceBusy', async () => {
|
|
405
|
+
const commands = createCommands();
|
|
406
|
+
const message = 'Requested command not allowed while a firmware update is in progress';
|
|
407
|
+
|
|
408
|
+
await expect(
|
|
409
|
+
commands._filterCommonTypes(
|
|
410
|
+
{
|
|
411
|
+
type: 'Failure',
|
|
412
|
+
message: { code: 'Failure_ProcessError', message },
|
|
413
|
+
} as any,
|
|
414
|
+
'ProtocolInfoRequest'
|
|
415
|
+
)
|
|
416
|
+
).rejects.toMatchObject({
|
|
417
|
+
errorCode: HardwareErrorCode.DeviceBusy,
|
|
418
|
+
params: {
|
|
419
|
+
failureCode: 'Failure_ProcessError',
|
|
420
|
+
firmwareMessage: message,
|
|
421
|
+
},
|
|
422
|
+
});
|
|
423
|
+
});
|
|
424
|
+
|
|
417
425
|
it('maps the current AskPin passphrase-disabled response without relying on a subcode', async () => {
|
|
418
426
|
const commands = createCommands();
|
|
419
427
|
|
|
@@ -551,6 +559,51 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
551
559
|
}
|
|
552
560
|
);
|
|
553
561
|
|
|
562
|
+
it('maps the Protocol V2 seed-session busy response to DeviceBusy', async () => {
|
|
563
|
+
const commands = createCommands();
|
|
564
|
+
|
|
565
|
+
await expect(
|
|
566
|
+
commands._filterCommonTypes(
|
|
567
|
+
{
|
|
568
|
+
type: 'Failure',
|
|
569
|
+
message: {
|
|
570
|
+
code: 'Failure_ProcessError',
|
|
571
|
+
subcode: DeviceSessionErrorCode.DeviceSessionError_UserCancelled,
|
|
572
|
+
message: 'PIN cancelled',
|
|
573
|
+
},
|
|
574
|
+
} as any,
|
|
575
|
+
'SignTx'
|
|
576
|
+
)
|
|
577
|
+
).rejects.toMatchObject({
|
|
578
|
+
errorCode: HardwareErrorCode.DeviceBusy,
|
|
579
|
+
params: {
|
|
580
|
+
failureCode: 'Failure_ProcessError',
|
|
581
|
+
subcode: DeviceSessionErrorCode.DeviceSessionError_UserCancelled,
|
|
582
|
+
firmwareMessage: 'PIN cancelled',
|
|
583
|
+
},
|
|
584
|
+
});
|
|
585
|
+
});
|
|
586
|
+
|
|
587
|
+
it('keeps the same Protocol V2 response as ActionCancelled for DeviceSession calls', async () => {
|
|
588
|
+
const commands = createCommands();
|
|
589
|
+
|
|
590
|
+
await expect(
|
|
591
|
+
commands._filterCommonTypes(
|
|
592
|
+
{
|
|
593
|
+
type: 'Failure',
|
|
594
|
+
message: {
|
|
595
|
+
code: 'Failure_ProcessError',
|
|
596
|
+
subcode: DeviceSessionErrorCode.DeviceSessionError_UserCancelled,
|
|
597
|
+
message: 'PIN cancelled',
|
|
598
|
+
},
|
|
599
|
+
} as any,
|
|
600
|
+
'DeviceSessionAskPin'
|
|
601
|
+
)
|
|
602
|
+
).rejects.toMatchObject({
|
|
603
|
+
errorCode: HardwareErrorCode.ActionCancelled,
|
|
604
|
+
});
|
|
605
|
+
});
|
|
606
|
+
|
|
554
607
|
it('does not use the legacy cancellation-message fallback for Protocol V1', async () => {
|
|
555
608
|
const commands = createCommands();
|
|
556
609
|
(commands.device.isProtocolV2 as jest.Mock).mockReturnValue(false);
|
|
@@ -3,7 +3,7 @@ import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
|
3
3
|
import { initConnector, initCore } from '../src/core';
|
|
4
4
|
import { DataManager } from '../src/data-manager';
|
|
5
5
|
import TransportManager from '../src/data-manager/TransportManager';
|
|
6
|
-
import { IFRAME } from '../src/events';
|
|
6
|
+
import { IFRAME, createErrorMessage } from '../src/events';
|
|
7
7
|
import SearchDevices from '../src/api/SearchDevices';
|
|
8
8
|
import { DeviceList } from '../src/device/DeviceList';
|
|
9
9
|
import { Device } from '../src/device/Device';
|
|
@@ -28,6 +28,23 @@ describe('Core 错误输出边界', () => {
|
|
|
28
28
|
jest.restoreAllMocks();
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
+
test('entry-point errors preserve USB recovery context across JSON serialization', () => {
|
|
32
|
+
const params = {
|
|
33
|
+
operation: 'open',
|
|
34
|
+
nativeErrorName: 'SecurityError',
|
|
35
|
+
nativeErrorMessage: 'Access denied',
|
|
36
|
+
};
|
|
37
|
+
const error = ERRORS.TypedError(
|
|
38
|
+
HardwareErrorCode.BridgeNeedsPermission,
|
|
39
|
+
'Access denied',
|
|
40
|
+
params
|
|
41
|
+
);
|
|
42
|
+
expect(JSON.parse(JSON.stringify(createErrorMessage(error)))).toEqual({
|
|
43
|
+
success: false,
|
|
44
|
+
payload: { code: HardwareErrorCode.BridgeNeedsPermission, error: 'Access denied', params },
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
31
48
|
test.each([
|
|
32
49
|
['webusb', false],
|
|
33
50
|
['desktop-webusb', false],
|
|
@@ -108,14 +125,28 @@ describe('Core 错误输出边界', () => {
|
|
|
108
125
|
HardwareErrorCode.BleDeviceBondedCanceled,
|
|
109
126
|
HardwareErrorCode.BleDeviceDisconnected,
|
|
110
127
|
HardwareErrorCode.PollingTimeout,
|
|
128
|
+
HardwareErrorCode.BlePoweredOff,
|
|
129
|
+
HardwareErrorCode.BleUnsupported,
|
|
130
|
+
HardwareErrorCode.BridgeNeedsPermission,
|
|
131
|
+
HardwareErrorCode.WebUsbDeviceAccessError,
|
|
111
132
|
])(
|
|
112
|
-
'preserves terminal
|
|
133
|
+
'preserves terminal transport error %s in the public response without polling again',
|
|
113
134
|
async errorCode => {
|
|
114
|
-
jest
|
|
135
|
+
jest
|
|
136
|
+
.spyOn(DataManager, 'getSettings')
|
|
137
|
+
.mockReturnValue(
|
|
138
|
+
[
|
|
139
|
+
HardwareErrorCode.BridgeNeedsPermission,
|
|
140
|
+
HardwareErrorCode.WebUsbDeviceAccessError,
|
|
141
|
+
].includes(errorCode)
|
|
142
|
+
? ('desktop-webusb' as never)
|
|
143
|
+
: ('react-native' as never)
|
|
144
|
+
);
|
|
115
145
|
const error = ERRORS.TypedError(errorCode);
|
|
116
146
|
const acquire = jest.fn().mockRejectedValue(error);
|
|
117
147
|
jest.spyOn(TransportManager, 'getTransport').mockReturnValue({
|
|
118
148
|
acquire,
|
|
149
|
+
enumerate: jest.fn().mockResolvedValue([{ path: 'ble-pairing-test' }]),
|
|
119
150
|
release: jest.fn().mockResolvedValue(true),
|
|
120
151
|
stop: jest.fn().mockResolvedValue(undefined),
|
|
121
152
|
} as never);
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
isMissingDetectedProtocolV2Error,
|
|
11
11
|
isRetryableBleConnectionError,
|
|
12
12
|
isRetryableBleProtocolV2ProbeError,
|
|
13
|
-
isTerminalBleStaleBondError,
|
|
14
13
|
resolveBleConnectProtocol,
|
|
15
14
|
} from '../src/core';
|
|
16
15
|
import { DataManager } from '../src/data-manager';
|
|
@@ -611,7 +610,6 @@ describe('public device lifecycle events', () => {
|
|
|
611
610
|
test.each([
|
|
612
611
|
[HardwareErrorCode.RuntimeError, true],
|
|
613
612
|
[HardwareErrorCode.BleDeviceBondError, false],
|
|
614
|
-
[HardwareErrorCode.BlePeerRemovedPairingInformation, false],
|
|
615
613
|
] as const)(
|
|
616
614
|
'retries a Protocol V2 probe mismatch with error code %s: %s',
|
|
617
615
|
(errorCode, expected) => {
|
|
@@ -631,8 +629,6 @@ describe('public device lifecycle events', () => {
|
|
|
631
629
|
[HardwareErrorCode.BleTimeoutError, true],
|
|
632
630
|
[HardwareErrorCode.PollingTimeout, false],
|
|
633
631
|
[HardwareErrorCode.BleDeviceBondError, false],
|
|
634
|
-
[HardwareErrorCode.BlePeerRemovedPairingInformation, false],
|
|
635
|
-
[HardwareErrorCode.BleBondInvalid, false],
|
|
636
632
|
] as const)('retries a BLE connection error with error code %s: %s', (errorCode, expected) => {
|
|
637
633
|
const method = { payload: { connectProtocol: 'V2' } } as never;
|
|
638
634
|
const error = {
|
|
@@ -685,19 +681,6 @@ describe('public device lifecycle events', () => {
|
|
|
685
681
|
}
|
|
686
682
|
);
|
|
687
683
|
|
|
688
|
-
test.each([
|
|
689
|
-
[HardwareErrorCode.BleDeviceBondError, true],
|
|
690
|
-
[HardwareErrorCode.BlePeerRemovedPairingInformation, true],
|
|
691
|
-
[HardwareErrorCode.BleBondInvalid, true],
|
|
692
|
-
[HardwareErrorCode.DeviceNotFound, false],
|
|
693
|
-
] as const)('treats BLE stale-bond error code %s as terminal: %s', (errorCode, expected) => {
|
|
694
|
-
const error = {
|
|
695
|
-
errorCode,
|
|
696
|
-
};
|
|
697
|
-
|
|
698
|
-
expect(isTerminalBleStaleBondError(error)).toBe(expected);
|
|
699
|
-
});
|
|
700
|
-
|
|
701
684
|
test.each([
|
|
702
685
|
[HardwareErrorCode.DeviceCheckDeviceIdError, true],
|
|
703
686
|
[HardwareErrorCode.DeviceNotFound, false],
|
|
@@ -729,6 +712,48 @@ describe('public device lifecycle events', () => {
|
|
|
729
712
|
expect(() => JSON.stringify(disconnectMessage?.payload.device)).not.toThrow();
|
|
730
713
|
});
|
|
731
714
|
|
|
715
|
+
test.each(['V1', 'V2'] as const)(
|
|
716
|
+
'preserves the %s connection identity for a transport disconnect after wipe',
|
|
717
|
+
protocol => {
|
|
718
|
+
jest.spyOn(DataManager, 'getSettings').mockReturnValue('webusb' as never);
|
|
719
|
+
core = initCore();
|
|
720
|
+
initConnector();
|
|
721
|
+
const messages: CoreMessage[] = [];
|
|
722
|
+
core.on(CORE_EVENT, message => messages.push(message));
|
|
723
|
+
const device = createInitializedDevice(protocol);
|
|
724
|
+
const connectId = device.getConnectId();
|
|
725
|
+
DevicePool.devicesCache[connectId] = device;
|
|
726
|
+
|
|
727
|
+
device.invalidateAfterWipe();
|
|
728
|
+
expect(device.toMessageObject()).toBeNull();
|
|
729
|
+
DevicePool.emitter.emit(DEVICE.CONNECT, device);
|
|
730
|
+
expect(messages.some(message => message.type === DEVICE.CONNECT)).toBe(false);
|
|
731
|
+
DevicePool.emitter.emit(TRANSPORT_EVENT.DEVICE_DISCONNECT, { connectId });
|
|
732
|
+
|
|
733
|
+
const disconnects = messages.filter(message => message.type === DEVICE.DISCONNECT);
|
|
734
|
+
expect(disconnects).toHaveLength(1);
|
|
735
|
+
expect(disconnects[0].payload.device).toMatchObject({
|
|
736
|
+
connectId,
|
|
737
|
+
serialNo: 'SERIAL-001',
|
|
738
|
+
deviceId: 'wallet-device-id',
|
|
739
|
+
});
|
|
740
|
+
expect(() => JSON.stringify(disconnects[0].payload.device)).not.toThrow();
|
|
741
|
+
|
|
742
|
+
device.features = {
|
|
743
|
+
...createInitializedDevice(protocol).features,
|
|
744
|
+
deviceId: 'new-device-id',
|
|
745
|
+
initialized: false,
|
|
746
|
+
mode: 'notInitialized',
|
|
747
|
+
} as never;
|
|
748
|
+
DevicePool.emitter.emit(TRANSPORT_EVENT.DEVICE_DISCONNECT, { connectId });
|
|
749
|
+
const nextDisconnects = messages.filter(message => message.type === DEVICE.DISCONNECT);
|
|
750
|
+
expect(nextDisconnects[1].payload.device).toMatchObject({
|
|
751
|
+
deviceId: 'new-device-id',
|
|
752
|
+
mode: 'notInitialized',
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
);
|
|
756
|
+
|
|
732
757
|
test('treats an acquired BLE device as reusable until the transport disconnects', async () => {
|
|
733
758
|
jest.spyOn(DataManager, 'getSettings').mockReturnValue('desktop-web-ble' as never);
|
|
734
759
|
const device = createInitializedDevice('V2');
|
|
@@ -1014,6 +1039,28 @@ describe('public device lifecycle events', () => {
|
|
|
1014
1039
|
expect(device.wasInterruptedByUser()).toBe(false);
|
|
1015
1040
|
});
|
|
1016
1041
|
|
|
1042
|
+
test.each(['V1', 'V2'] as const)(
|
|
1043
|
+
'retires a failed USB %s session before the next user attempt',
|
|
1044
|
+
async protocol => {
|
|
1045
|
+
jest.spyOn(DataManager, 'getSettings').mockReturnValue('desktop-webusb' as never);
|
|
1046
|
+
const device = createInitializedDevice(protocol);
|
|
1047
|
+
device.originalDescriptor = { ...device.originalDescriptor, session: device.mainId };
|
|
1048
|
+
const disconnect = jest.fn().mockResolvedValue(undefined);
|
|
1049
|
+
const release = jest.fn().mockResolvedValue(undefined);
|
|
1050
|
+
device.deviceConnector = { disconnect, release } as never;
|
|
1051
|
+
device.commands = { disposed: false, dispose: jest.fn() } as never;
|
|
1052
|
+
(device as unknown as { deviceAcquired: boolean }).deviceAcquired = true;
|
|
1053
|
+
const error = ERRORS.TypedError(HardwareErrorCode.WebUsbDeviceAccessError);
|
|
1054
|
+
await expect(device.run(() => Promise.reject(error))).rejects.toBe(error);
|
|
1055
|
+
await new Promise(resolve => {
|
|
1056
|
+
setImmediate(resolve);
|
|
1057
|
+
});
|
|
1058
|
+
expect(disconnect).toHaveBeenCalledWith(device.mainId);
|
|
1059
|
+
expect(release).toHaveBeenCalledTimes(1);
|
|
1060
|
+
expect(device.hasDeviceAcquire()).toBe(false);
|
|
1061
|
+
}
|
|
1062
|
+
);
|
|
1063
|
+
|
|
1017
1064
|
test('waits for the canceled run to finish releasing before cancellation completes', async () => {
|
|
1018
1065
|
jest.spyOn(DataManager, 'getSettings').mockReturnValue('react-native' as never);
|
|
1019
1066
|
const device = createInitializedDevice('V2');
|
|
@@ -85,6 +85,56 @@ describe('DevicePool state lifecycle', () => {
|
|
|
85
85
|
expect(result.deviceList).toEqual([device]);
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
+
test.each([
|
|
89
|
+
['V1', undefined],
|
|
90
|
+
['V1', 'wipe-path'],
|
|
91
|
+
['V2', undefined],
|
|
92
|
+
['V2', 'wipe-path'],
|
|
93
|
+
] as const)('rediscovers a wiped %s device with connect id %s', async (protocol, connectId) => {
|
|
94
|
+
const descriptor = { path: 'wipe-path', protocolType: protocol } as never;
|
|
95
|
+
const device = Device.fromDescriptor(descriptor);
|
|
96
|
+
device.features = {
|
|
97
|
+
protocol,
|
|
98
|
+
deviceType: protocol === 'V2' ? 'pro2' : 'classic',
|
|
99
|
+
deviceId: 'old-device-id',
|
|
100
|
+
serialNo: 'wipe-path',
|
|
101
|
+
initialized: true,
|
|
102
|
+
mode: 'normal',
|
|
103
|
+
} as never;
|
|
104
|
+
DevicePool.devicesCache = { 'wipe-path': device };
|
|
105
|
+
device.invalidateAfterWipe();
|
|
106
|
+
expect(device.toMessageObject()).toBeNull();
|
|
107
|
+
const connect = jest.spyOn(device, 'connect').mockResolvedValue(true);
|
|
108
|
+
const initialize = jest.spyOn(device, 'initialize').mockImplementation(() => {
|
|
109
|
+
device.features = {
|
|
110
|
+
protocol,
|
|
111
|
+
deviceType: protocol === 'V2' ? 'pro2' : 'classic',
|
|
112
|
+
deviceId: 'new-device-id',
|
|
113
|
+
serialNo: 'wipe-path',
|
|
114
|
+
initialized: false,
|
|
115
|
+
mode: 'notInitialized',
|
|
116
|
+
} as never;
|
|
117
|
+
return Promise.resolve();
|
|
118
|
+
});
|
|
119
|
+
const release = jest.spyOn(device, 'release').mockResolvedValue(undefined);
|
|
120
|
+
|
|
121
|
+
try {
|
|
122
|
+
const result = await DevicePool.getDevices([descriptor], connectId);
|
|
123
|
+
expect(initialize).toHaveBeenCalledTimes(1);
|
|
124
|
+
expect(connect).toHaveBeenCalledTimes(1);
|
|
125
|
+
expect(release).toHaveBeenCalledTimes(1);
|
|
126
|
+
expect(result.deviceList[0].toMessageObject()).toMatchObject({
|
|
127
|
+
deviceId: 'new-device-id',
|
|
128
|
+
mode: 'notInitialized',
|
|
129
|
+
features: { initialized: false },
|
|
130
|
+
});
|
|
131
|
+
await DevicePool.getDevices([descriptor], connectId);
|
|
132
|
+
expect(initialize).toHaveBeenCalledTimes(1);
|
|
133
|
+
} finally {
|
|
134
|
+
jest.restoreAllMocks();
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
88
138
|
test('keeps a discovered device when its Protocol V2 label cannot be read', async () => {
|
|
89
139
|
const labelError = new Error('settings unavailable');
|
|
90
140
|
const getDeviceState = jest
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { EDeviceType } from '@onekeyfe/hd-shared';
|
|
2
|
+
|
|
3
|
+
import DeviceReboot from '../src/api/protocol-v2/DeviceReboot';
|
|
1
4
|
import { Device } from '../src/device/Device';
|
|
2
5
|
import { UI_REQUEST } from '../src/events/ui-request';
|
|
3
6
|
|
|
@@ -23,12 +26,50 @@ const createBootloaderDevice = (protocolType: 'V1' | 'V2') => {
|
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
describe('Pro2 bootloader mode', () => {
|
|
26
|
-
test('
|
|
29
|
+
test('allows deviceReboot to return a Protocol V2 bootloader to normal mode', () => {
|
|
30
|
+
const device = createBootloaderDevice('V2');
|
|
31
|
+
const method = new DeviceReboot({
|
|
32
|
+
id: 1,
|
|
33
|
+
payload: { method: 'deviceReboot', rebootType: 'normal' },
|
|
34
|
+
});
|
|
35
|
+
method.init();
|
|
36
|
+
|
|
37
|
+
expect(device.hasUnexpectedMode(method.allowDeviceMode, method.requireDeviceMode)).toBeNull();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('blocks Protocol V2 methods that are not allowed in bootloader mode', () => {
|
|
41
|
+
const device = createBootloaderDevice('V2');
|
|
42
|
+
|
|
43
|
+
expect(device.hasUnexpectedMode([], [])).toBe(UI_REQUEST.BOOTLOADER);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('allows Protocol V2 methods that explicitly support bootloader mode', () => {
|
|
27
47
|
const device = createBootloaderDevice('V2');
|
|
28
48
|
|
|
29
|
-
expect(device.hasUnexpectedMode([], [])).toBeNull();
|
|
49
|
+
expect(device.hasUnexpectedMode([UI_REQUEST.BOOTLOADER], [])).toBeNull();
|
|
30
50
|
});
|
|
31
51
|
|
|
52
|
+
test.each([EDeviceType.Pro2, EDeviceType.Neo])(
|
|
53
|
+
'blocks unsupported Protocol V2 methods in %s romloader mode',
|
|
54
|
+
deviceType => {
|
|
55
|
+
const device = createBootloaderDevice('V2');
|
|
56
|
+
device.updateState(
|
|
57
|
+
{
|
|
58
|
+
protocol: 'V2',
|
|
59
|
+
identity: { deviceType },
|
|
60
|
+
status: { mode: 'romloader', initialized: null },
|
|
61
|
+
},
|
|
62
|
+
'initialize'
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
expect(device.hasUnexpectedMode([], [])).toBe(UI_REQUEST.BOOTLOADER);
|
|
66
|
+
expect(device.hasUnexpectedMode([UI_REQUEST.NOT_INITIALIZE], [])).toBe(UI_REQUEST.BOOTLOADER);
|
|
67
|
+
expect(
|
|
68
|
+
device.hasUnexpectedMode([UI_REQUEST.BOOTLOADER, UI_REQUEST.NOT_INITIALIZE], [])
|
|
69
|
+
).toBeNull();
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
|
|
32
73
|
test('keeps the Protocol V1 bootloader restriction', () => {
|
|
33
74
|
const device = createBootloaderDevice('V1');
|
|
34
75
|
|
|
@@ -4991,23 +4991,6 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4991
4991
|
expect(typedCall.mock.calls.map(call => call[0])).toEqual(['DeviceInfoGet']);
|
|
4992
4992
|
});
|
|
4993
4993
|
|
|
4994
|
-
test('stops V4 bootloader reconnect polling on a stale BLE bond', async () => {
|
|
4995
|
-
const method = new FirmwareUpdateV4({
|
|
4996
|
-
id: 1,
|
|
4997
|
-
payload: {
|
|
4998
|
-
method: 'firmwareUpdateV4',
|
|
4999
|
-
},
|
|
5000
|
-
});
|
|
5001
|
-
const staleBondError = ERRORS.TypedError(HardwareErrorCode.BlePeerRemovedPairingInformation);
|
|
5002
|
-
const reconnectProtocolV2Device = jest.fn().mockRejectedValue(staleBondError);
|
|
5003
|
-
(method as any).reconnectProtocolV2Device = reconnectProtocolV2Device;
|
|
5004
|
-
|
|
5005
|
-
await expect((method as any).waitForProtocolV2BootloaderMode(60_000, 0)).rejects.toBe(
|
|
5006
|
-
staleBondError
|
|
5007
|
-
);
|
|
5008
|
-
expect(reconnectProtocolV2Device).toHaveBeenCalledTimes(1);
|
|
5009
|
-
});
|
|
5010
|
-
|
|
5011
4994
|
test('polls again when Protocol V2 bootloader serial is temporarily unavailable', async () => {
|
|
5012
4995
|
const method = new FirmwareUpdateV4({
|
|
5013
4996
|
id: 1,
|
|
@@ -9009,36 +8992,6 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
9009
8992
|
);
|
|
9010
8993
|
});
|
|
9011
8994
|
|
|
9012
|
-
test('does not retry or wrap a stale BLE bond during a V4 file transfer', async () => {
|
|
9013
|
-
const method = new FirmwareUpdateV4({
|
|
9014
|
-
id: 1,
|
|
9015
|
-
payload: {
|
|
9016
|
-
method: 'firmwareUpdateV4',
|
|
9017
|
-
},
|
|
9018
|
-
});
|
|
9019
|
-
const staleBondError = ERRORS.TypedError(HardwareErrorCode.BlePeerRemovedPairingInformation);
|
|
9020
|
-
(method as any).fileWriteChunk = jest.fn().mockRejectedValue(staleBondError);
|
|
9021
|
-
const recoverProtocolV2FileTransfer = jest.fn();
|
|
9022
|
-
(method as any).recoverProtocolV2FileTransfer = recoverProtocolV2FileTransfer;
|
|
9023
|
-
const source = await openFirmwareByteSource({
|
|
9024
|
-
binary: new Uint8Array([1]).buffer,
|
|
9025
|
-
});
|
|
9026
|
-
|
|
9027
|
-
try {
|
|
9028
|
-
await expect(
|
|
9029
|
-
(method as any).protocolV2SourceUpdateProcess({
|
|
9030
|
-
source,
|
|
9031
|
-
filePath: 'vol1:firmware.bin',
|
|
9032
|
-
processedSize: 0,
|
|
9033
|
-
totalSize: 1,
|
|
9034
|
-
})
|
|
9035
|
-
).rejects.toBe(staleBondError);
|
|
9036
|
-
} finally {
|
|
9037
|
-
await source?.close();
|
|
9038
|
-
}
|
|
9039
|
-
expect(recoverProtocolV2FileTransfer).not.toHaveBeenCalled();
|
|
9040
|
-
});
|
|
9041
|
-
|
|
9042
8995
|
test('does not recover or wrap a cancelled V4 file transfer', async () => {
|
|
9043
8996
|
const method = new FirmwareUpdateV4({
|
|
9044
8997
|
id: 1,
|
|
@@ -73,24 +73,26 @@ describe('live device state reads', () => {
|
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
75
|
|
|
76
|
-
test('
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
test.each(['bootloader', 'romloader'] as const)(
|
|
77
|
+
'reports %s mode for settings scope after minimal mode detection',
|
|
78
|
+
async mode => {
|
|
79
|
+
const getDeviceState = jest.fn().mockResolvedValue({ status: { mode } });
|
|
80
|
+
const method = new GetDeviceState({
|
|
81
|
+
id: 1,
|
|
82
|
+
payload: { method: 'getDeviceState', scope: 'settings' },
|
|
83
|
+
});
|
|
84
|
+
method.init();
|
|
85
|
+
(method as any).device = {
|
|
86
|
+
isProtocolV2: () => true,
|
|
87
|
+
getDeviceState,
|
|
88
|
+
};
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
await expect(method.run()).rejects.toMatchObject({
|
|
91
|
+
errorCode: HardwareErrorCode.NotAllowInBootloaderMode,
|
|
92
|
+
});
|
|
93
|
+
expect(getDeviceState).toHaveBeenCalledWith({ refreshSections: ['status', 'settings'] });
|
|
94
|
+
}
|
|
95
|
+
);
|
|
94
96
|
|
|
95
97
|
test('rejects an unknown scope', () => {
|
|
96
98
|
const method = new GetDeviceState({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkD,MAAM,qBAAqB,CAAC;AA0BlG,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAiC/E,OAAO,KAAK,EAEV,sBAAsB,EAEvB,MAAM,6BAA6B,CAAC;AAuErC,wBAAgB,wCAAwC,CACtD,UAAU,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,EAC5C,MAAM,EAAE,sBAAsB,EAC9B,0BAA0B,UAAQ,QAiCnC;AA6UD,e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W7B,0BAA0B;YAoB1B,6BAA6B;YAwD7B,gBAAgB;IA0B9B,OAAO,CAAC,qBAAqB;CAM9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetDeviceState.d.ts","sourceRoot":"","sources":["../../src/api/GetDeviceState.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,KAAK,EAAoB,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAU1F,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CACpD,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAC9C;IACC,qBAAqB;IAIrB,IAAI;IAmBE,GAAG;
|
|
1
|
+
{"version":3,"file":"GetDeviceState.d.ts","sourceRoot":"","sources":["../../src/api/GetDeviceState.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,KAAK,EAAoB,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAU1F,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CACpD,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAC9C;IACC,qBAAqB;IAIrB,IAAI;IAmBE,GAAG;CAaV"}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -52,7 +52,6 @@ export { default as allNetworkGetAddress } from './allnetwork/AllNetworkGetAddre
|
|
|
52
52
|
export { default as allNetworkGetAddressByLoop } from './allnetwork/AllNetworkGetAddressByLoop';
|
|
53
53
|
export { default as btcGetAddress } from './btc/BTCGetAddress';
|
|
54
54
|
export { default as btcGetPublicKey } from './btc/BTCGetPublicKey';
|
|
55
|
-
export { default as btcDeriveContextHash } from './btc/BTCDeriveContextHash';
|
|
56
55
|
export { default as btcSignMessage } from './btc/BTCSignMessage';
|
|
57
56
|
export { default as btcSignPsbt } from './btc/BTCSignPsbt';
|
|
58
57
|
export { default as btcSignTransaction } from './btc/BTCSignTransaction';
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAC9F,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,s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E,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAElF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceReboot.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceReboot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeviceReboot.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceReboot.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,UAAU,CAAC,kBAAkB,CAAC;IACtE,qBAAqB;IAIrB,IAAI;IAaE,GAAG;CAQV"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export declare function getPostCallPendingPromise(method: BaseMethod, device: De
|
|
|
12
12
|
export declare function isRetryableBleProtocolV2ProbeError(method: BaseMethod, error: unknown): boolean;
|
|
13
13
|
export declare function isRetryableBleConnectionError(method: BaseMethod, error: unknown): boolean;
|
|
14
14
|
export declare function isMissingDetectedProtocolV2Error(method: BaseMethod, error: unknown): boolean;
|
|
15
|
-
export declare function isTerminalBleStaleBondError(error: unknown): boolean;
|
|
16
15
|
export declare function isDeviceIdentityMismatchError(error: unknown): boolean;
|
|
17
16
|
export declare function resolveBleConnectProtocol(method: BaseMethod): ProtocolType | undefined;
|
|
18
17
|
export declare const cancel: (context: CoreContext, connectId?: string) => void;
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAEL,KAAK,6BAA6B,EAElC,KAAK,YAAY,EAIlB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAEL,KAAK,6BAA6B,EAElC,KAAK,YAAY,EAIlB,MAAM,wBAAwB,CAAC;AAgChC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAsB1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAYxD,OAAO,KAAK,EAAE,eAAe,EAAyB,MAAM,UAAU,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAmD,MAAM,WAAW,CAAC;AAI9F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAYpD,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;AA0E7D,eAAO,MAAM,OAAO,YAAmB,WAAW,WAAW,WAAW,iBA0FvE,CAAC;AA2FF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAY3F;AAunBD,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,WAWpF;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,WAoB/E;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,WAQlF;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,WAI3D;AAiKD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,CAMtF;AA4MD,eAAO,MAAM,MAAM,YAAa,WAAW,cAAc,MAAM,SA4G9D,CAAC;AA8GF,eAAO,MAAM,qBAAqB,gFAejC,CAAC;AAiLF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IAC5C,OAAO,CAAC,cAAc,CAAoB;IAE1C,SAAgB,aAAa,EAAE,MAAM,CAAC;IAEtC,OAAO,CAAC,YAAY,CAAsB;IAE1C,OAAO,CAAC,cAAc,CAAC,CAAgB;IAGvC,OAAO,CAAC,sBAAsB,CAAoC;IAElE,OAAO,CAAC,iBAAiB,CAAoB;;IAS7C,OAAO,CAAC,cAAc;IAuChB,aAAa,CAAC,OAAO,EAAE,WAAW;IAuExC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAOV,gBAAgB;CAiC/B;AAED,eAAO,MAAM,QAAQ,YAIpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAYzB,CAAC;AAMF,eAAO,MAAM,IAAI,aACL,eAAe,aACd,GAAG,WACL,6BAA6B,8BAiBvC,CAAC;AAEF,eAAO,MAAM,eAAe;SAKrB,eAAe,CAAC,KAAK,CAAC;eAChB,GAAG;;UASf,CAAC"}
|
package/dist/device/Device.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export declare class Device extends EventEmitter {
|
|
|
70
70
|
private connectionAttempt;
|
|
71
71
|
private interruptedAttempt;
|
|
72
72
|
private stateStore;
|
|
73
|
+
private deviceBeforeWipe;
|
|
73
74
|
private protocolV2StateNeedsReload;
|
|
74
75
|
private protocolV2RuntimeContext?;
|
|
75
76
|
private protocolV2RuntimeContextPromise?;
|
|
@@ -98,6 +99,7 @@ export declare class Device extends EventEmitter {
|
|
|
98
99
|
constructor(descriptor: DeviceDescriptor, sdkInstanceId?: string);
|
|
99
100
|
static fromDescriptor(originalDescriptor: DeviceDescriptor, sdkInstanceId?: string): Device;
|
|
100
101
|
toMessageObject(): DeviceTyped | null;
|
|
102
|
+
toDisconnectMessageObject(): DeviceTyped | null;
|
|
101
103
|
connect(connectProtocol?: HardwareConnectProtocol, options?: {
|
|
102
104
|
forceProtocolDetection?: boolean;
|
|
103
105
|
}): Promise<boolean>;
|