@onekeyfe/hd-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.
@@ -44,7 +44,6 @@ import FirmwareUpdateV3 from '../src/api/FirmwareUpdateV3';
44
44
  import FirmwareUpdateV4, {
45
45
  assertProtocolV2FirmwareTargetsSupported,
46
46
  assertProtocolV2ReconnectIdentity,
47
- supportsProtocolV2BleFileWriteWindow,
48
47
  } from '../src/api/FirmwareUpdateV4';
49
48
  import GetPassphraseState from '../src/api/GetPassphraseState';
50
49
  import GetOnekeyFeatures from '../src/api/GetOnekeyFeatures';
@@ -8884,404 +8883,6 @@ describe('Protocol V2 firmware update targets', () => {
8884
8883
  expect((method as any).protocolV2SourceUpdateProcess).not.toHaveBeenCalled();
8885
8884
  });
8886
8885
 
8887
- describe('RESC header check link recovery', () => {
8888
- const currentHeader = {
8889
- version: [1, 0, 0],
8890
- payloadHash: '11'.repeat(64),
8891
- headerHash: '22'.repeat(64),
8892
- };
8893
- const linkLost = () =>
8894
- ERRORS.TypedError(
8895
- HardwareErrorCode.RuntimeError,
8896
- 'Device protocol has not been detected for E2:92:2E:16:47:B9'
8897
- );
8898
- const createResource = (name: string) => ({
8899
- name,
8900
- source: { size: 3, readAt: jest.fn(), close: jest.fn() },
8901
- devicePath: `vol0:/bundles/${name}`,
8902
- version: [1, 0, 0],
8903
- payloadHash: '11'.repeat(64),
8904
- headerHash: '22'.repeat(64),
8905
- });
8906
- const createMethod = () => {
8907
- const method = new FirmwareUpdateV4({
8908
- id: 1,
8909
- payload: {
8910
- method: 'firmwareUpdateV4',
8911
- },
8912
- });
8913
- method.postTipMessage = jest.fn();
8914
- method.postProgressMessage = jest.fn();
8915
- (method as any).protocolV2SourceUpdateProcess = jest.fn(
8916
- ({ processedSize }: { processedSize: number }) => Promise.resolve(processedSize + 3)
8917
- );
8918
- (method as any).verifyProtocolV2StagedFile = jest.fn().mockResolvedValue(undefined);
8919
- (method as any).recoverProtocolV2FileTransfer = jest.fn().mockResolvedValue(undefined);
8920
- return method;
8921
- };
8922
-
8923
- test('reconnects and asks again when the link drops during a header check', async () => {
8924
- const method = createMethod();
8925
- (method as any).readProtocolV2DeviceFileHeader = jest
8926
- .fn()
8927
- .mockRejectedValueOnce(linkLost())
8928
- .mockResolvedValue(currentHeader);
8929
-
8930
- await (method as any).executeProtocolV2TransferPhase({
8931
- installSources: [],
8932
- resourceSources: [createResource('images.okpkg'), createResource('fonts.okpkg')],
8933
- });
8934
-
8935
- expect((method as any).recoverProtocolV2FileTransfer).toHaveBeenCalledTimes(1);
8936
- expect((method as any).readProtocolV2DeviceFileHeader).toHaveBeenCalledTimes(3);
8937
- expect((method as any).protocolV2SourceUpdateProcess).not.toHaveBeenCalled();
8938
- });
8939
-
8940
- test.each([
8941
- ['BLE disconnect', () => ERRORS.TypedError(HardwareErrorCode.BleDeviceDisconnected)],
8942
- ['BLE timeout', () => ERRORS.TypedError(HardwareErrorCode.BleTimeoutError)],
8943
- [
8944
- 'invalidated Protocol V2 link',
8945
- () =>
8946
- Object.assign(new Error('Protocol V2 link generation changed'), {
8947
- name: 'ProtocolV2LinkError',
8948
- code: 'generation',
8949
- }),
8950
- ],
8951
- ['released transport', () => new Error('React Native BLE transport released')],
8952
- ['cleaned Electron BLE state', () => new Error('Electron BLE device state cleaned')],
8953
- [
8954
- 'Electron BLE device that is no longer connected',
8955
- () => ERRORS.TypedError(HardwareErrorCode.TransportNotFound, 'Device AA:BB not connected'),
8956
- ],
8957
- ])('rethrows a %s from the header check for recovery', async (_label, createError) => {
8958
- const method = createMethod();
8959
- (method as any).readProtocolV2DeviceFileHeader = jest.fn().mockRejectedValue(createError());
8960
-
8961
- await expect(
8962
- (method as any).isProtocolV2ResourceBundleUpToDate(createResource('images.okpkg'))
8963
- ).rejects.toBeDefined();
8964
- });
8965
-
8966
- test('treats a device-side header read failure as stale without reconnecting', async () => {
8967
- const method = createMethod();
8968
- (method as any).readProtocolV2DeviceFileHeader = jest
8969
- .fn()
8970
- .mockRejectedValue(ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'Failure: busy'));
8971
-
8972
- await (method as any).executeProtocolV2TransferPhase({
8973
- installSources: [],
8974
- resourceSources: [createResource('images.okpkg')],
8975
- });
8976
-
8977
- expect((method as any).recoverProtocolV2FileTransfer).not.toHaveBeenCalled();
8978
- expect((method as any).protocolV2SourceUpdateProcess).toHaveBeenCalledTimes(1);
8979
- });
8980
-
8981
- test('limits header-check reconnects per transfer phase', async () => {
8982
- const method = createMethod();
8983
- (method as any).readProtocolV2DeviceFileHeader = jest.fn().mockRejectedValue(linkLost());
8984
-
8985
- await (method as any).executeProtocolV2TransferPhase({
8986
- installSources: [],
8987
- resourceSources: ['a.okpkg', 'b.okpkg', 'c.okpkg'].map(createResource),
8988
- });
8989
-
8990
- expect((method as any).recoverProtocolV2FileTransfer).toHaveBeenCalledTimes(2);
8991
- expect((method as any).protocolV2SourceUpdateProcess).toHaveBeenCalledTimes(3);
8992
- });
8993
-
8994
- test('resends without further reconnects when the header-check reconnect fails', async () => {
8995
- const method = createMethod();
8996
- (method as any).readProtocolV2DeviceFileHeader = jest.fn().mockRejectedValue(linkLost());
8997
- (method as any).recoverProtocolV2FileTransfer = jest
8998
- .fn()
8999
- .mockRejectedValue(ERRORS.TypedError(HardwareErrorCode.DeviceNotFound));
9000
-
9001
- await (method as any).executeProtocolV2TransferPhase({
9002
- installSources: [],
9003
- resourceSources: [createResource('images.okpkg'), createResource('fonts.okpkg')],
9004
- });
9005
-
9006
- expect((method as any).recoverProtocolV2FileTransfer).toHaveBeenCalledTimes(1);
9007
- expect((method as any).protocolV2SourceUpdateProcess).toHaveBeenCalledTimes(2);
9008
- });
9009
-
9010
- test.each(['mismatch: expected A, received B', 'unavailable: expected path A'])(
9011
- 'aborts instead of resending when the reconnected device identity is %s',
9012
- async identityFailure => {
9013
- const method = createMethod();
9014
- (method as any).readProtocolV2DeviceFileHeader = jest.fn().mockRejectedValue(linkLost());
9015
- (method as any).recoverProtocolV2FileTransfer = jest
9016
- .fn()
9017
- .mockRejectedValue(
9018
- ERRORS.TypedError(
9019
- HardwareErrorCode.DeviceNotFound,
9020
- `Protocol V2 reconnect physical identity ${identityFailure}`
9021
- )
9022
- );
9023
-
9024
- await expect(
9025
- (method as any).executeProtocolV2TransferPhase({
9026
- installSources: [],
9027
- resourceSources: [createResource('images.okpkg')],
9028
- })
9029
- ).rejects.toMatchObject({ errorCode: HardwareErrorCode.DeviceNotFound });
9030
- expect((method as any).protocolV2SourceUpdateProcess).not.toHaveBeenCalled();
9031
- }
9032
- );
9033
- });
9034
-
9035
- test.each([
9036
- ['1.0.3', '1.0.3', true],
9037
- ['1.0.10', '1.0.3', true],
9038
- ['1.0.2', '1.0.3', false],
9039
- ['0.0.0.1', '1.0.3', false],
9040
- ['1.0.2', undefined, true],
9041
- ['1.0.1', undefined, false],
9042
- ] as const)(
9043
- 'gates the BLE file write window on bootloader %s with minimum %s',
9044
- (bootloaderVersion, minBootloaderVersion, expected) => {
9045
- expect(supportsProtocolV2BleFileWriteWindow(bootloaderVersion, minBootloaderVersion)).toBe(
9046
- expected
9047
- );
9048
- }
9049
- );
9050
-
9051
- test.each([
9052
- ['react-native', 'bootloader', true],
9053
- ['desktop-web-ble', 'bootloader', true],
9054
- ['lowlevel', 'bootloader', false],
9055
- ['webusb', 'bootloader', false],
9056
- ['react-native', 'normal', false],
9057
- ] as const)(
9058
- 'enables the BLE file write window for %s in %s mode only with a supported bootloader',
9059
- (env, mode, expected) => {
9060
- const getSettingsSpy = jest.spyOn(DataManager, 'getSettings').mockReturnValue(env);
9061
- const method = new FirmwareUpdateV4({
9062
- id: 1,
9063
- payload: {
9064
- method: 'firmwareUpdateV4',
9065
- },
9066
- });
9067
- (method as any).device = stubDevice({
9068
- features: { mode, bootloaderMode: mode === 'bootloader', bootloaderVersion: '1.0.3' },
9069
- });
9070
-
9071
- try {
9072
- expect((method as any).shouldUseProtocolV2BleFileWriteWindow('1.0.3')).toBe(expected);
9073
- expect((method as any).shouldUseProtocolV2BleFileWriteWindow('1.0.4')).toBe(false);
9074
- } finally {
9075
- getSettingsSpy.mockRestore();
9076
- }
9077
- }
9078
- );
9079
-
9080
- describe('windowed BLE file write', () => {
9081
- const confirm = (request: { file: { offset: number; data: ArrayBuffer } }) => ({
9082
- type: 'FilesystemFile',
9083
- message: { processed_byte: request.file.offset + request.file.data.byteLength },
9084
- });
9085
- const streamAll = (requests: any[]) =>
9086
- jest.fn(async (_name: string, _resType: string, first: any, options: any) => {
9087
- const { next, onResponse } = options.fileWritePipeline;
9088
- let request = first;
9089
- let last;
9090
- while (request) {
9091
- requests.push(request);
9092
- last = confirm(request);
9093
- onResponse(last);
9094
- request = await next();
9095
- }
9096
- return last;
9097
- });
9098
- const createMethod = (typedCall: jest.Mock) => {
9099
- const method = new FirmwareUpdateV4({
9100
- id: 1,
9101
- payload: {
9102
- method: 'firmwareUpdateV4',
9103
- },
9104
- });
9105
- (method as any).device = stubDevice({ getCommands: () => ({ typedCall }) });
9106
- (method as any).shouldUseProtocolV2BleFileWriteWindow = jest.fn().mockReturnValue(true);
9107
- (method as any).getProtocolV2FirmwareChunkSize = jest.fn().mockReturnValue(1000);
9108
- (method as any).recoverProtocolV2FileTransfer = jest.fn().mockResolvedValue(undefined);
9109
- method.postProgressMessage = jest.fn();
9110
- return method;
9111
- };
9112
- const transfer = async (method: FirmwareUpdateV4) => {
9113
- const source = await openFirmwareByteSource({ binary: new Uint8Array(2500).buffer });
9114
- try {
9115
- const processedSize: number = await (method as any).protocolV2SourceUpdateProcess({
9116
- source,
9117
- filePath: 'vol0:/application_p1.bin',
9118
- processedSize: 500,
9119
- totalSize: 3000,
9120
- });
9121
- return processedSize;
9122
- } finally {
9123
- await source?.close();
9124
- }
9125
- };
9126
-
9127
- test('streams the file through one FileWrite call and reports confirmed chunks', async () => {
9128
- const requests: any[] = [];
9129
- const typedCall = streamAll(requests);
9130
- const method = createMethod(typedCall);
9131
-
9132
- await expect(transfer(method)).resolves.toBe(3000);
9133
-
9134
- expect(typedCall).toHaveBeenCalledTimes(1);
9135
- expect(typedCall).toHaveBeenCalledWith(
9136
- 'FilesystemFileWrite',
9137
- 'FilesystemFile',
9138
- expect.anything(),
9139
- expect.objectContaining({
9140
- writeWithResponse: false,
9141
- fileWritePipeline: expect.objectContaining({
9142
- next: expect.any(Function),
9143
- onResponse: expect.any(Function),
9144
- }),
9145
- })
9146
- );
9147
- expect(requests.map(request => request.file.offset)).toEqual([0, 1000, 2000]);
9148
- expect(requests.map(request => request.file.data.byteLength)).toEqual([1000, 1000, 500]);
9149
- expect(requests.map(request => request.overwrite)).toEqual([true, false, false]);
9150
- expect(requests.map(request => request.ui_percentage)).toEqual([50, 84, 99]);
9151
- expect(
9152
- requests.every(
9153
- request =>
9154
- request.append === false &&
9155
- request.file.total_size === 2500 &&
9156
- request.file.path === 'vol0:/application_p1.bin'
9157
- )
9158
- ).toBe(true);
9159
- const transferredBytes = (method.postProgressMessage as jest.Mock).mock.calls.map(
9160
- ([, , metrics]) => metrics.transferredBytes
9161
- );
9162
- expect(transferredBytes).toEqual([1500, 2500, 3000]);
9163
- });
9164
-
9165
- test('caps windowed staging writes at the generic BLE chunk', async () => {
9166
- const requests: any[] = [];
9167
- const method = createMethod(streamAll(requests));
9168
- delete (method as any).getProtocolV2FirmwareChunkSize;
9169
- (method as any).params = { platform: 'native', chunkSize: 4096 };
9170
-
9171
- await expect(transfer(method)).resolves.toBe(3000);
9172
-
9173
- expect(requests.map(request => request.file.offset)).toEqual([0, 1800]);
9174
- expect(requests.map(request => request.file.data.byteLength)).toEqual([1800, 700]);
9175
- });
9176
-
9177
- test.each([
9178
- ['react-native', 10_000],
9179
- ['desktop-web-ble', 10_000],
9180
- ] as const)('bounds each windowed response wait in %s', async (env, timeoutMs) => {
9181
- const getSettingsSpy = jest.spyOn(DataManager, 'getSettings').mockReturnValue(env);
9182
- const typedCall = streamAll([]);
9183
-
9184
- try {
9185
- await transfer(createMethod(typedCall));
9186
- } finally {
9187
- getSettingsSpy.mockRestore();
9188
- }
9189
-
9190
- expect(typedCall.mock.calls[0][3]).toEqual(expect.objectContaining({ timeoutMs }));
9191
- });
9192
-
9193
- test('restarts the whole file after a failed windowed write', async () => {
9194
- const requests: any[] = [];
9195
- const succeed = streamAll(requests);
9196
- const typedCall = jest
9197
- .fn()
9198
- .mockRejectedValueOnce(new Error('Protocol V2 file write response does not match'))
9199
- .mockImplementation(succeed);
9200
- const method = createMethod(typedCall);
9201
-
9202
- await expect(transfer(method)).resolves.toBe(3000);
9203
-
9204
- expect((method as any).recoverProtocolV2FileTransfer).toHaveBeenCalledTimes(1);
9205
- expect(typedCall).toHaveBeenCalledTimes(2);
9206
- expect(typedCall.mock.calls[1][2]).toEqual(
9207
- expect.objectContaining({ overwrite: true, file: expect.objectContaining({ offset: 0 }) })
9208
- );
9209
- expect(requests.map(request => request.file.offset)).toEqual([0, 1000, 2000]);
9210
- });
9211
-
9212
- test('stops sending on cancel and raises it after the transport call returns', async () => {
9213
- const abortController = new AbortController();
9214
- const requests: any[] = [];
9215
- const succeed = streamAll(requests);
9216
- const typedCall = jest.fn((name: string, resType: string, first: any, options: any) =>
9217
- succeed(name, resType, first, {
9218
- ...options,
9219
- fileWritePipeline: {
9220
- ...options.fileWritePipeline,
9221
- onResponse: (response: any) => {
9222
- options.fileWritePipeline.onResponse(response);
9223
- abortController.abort();
9224
- },
9225
- },
9226
- })
9227
- );
9228
- const method = createMethod(typedCall);
9229
- method.abortSignal = abortController.signal;
9230
-
9231
- await expect(transfer(method)).rejects.toMatchObject({
9232
- errorCode: HardwareErrorCode.CallQueueActionCancelled,
9233
- });
9234
- expect(requests.map(request => request.file.offset)).toEqual([0]);
9235
- expect((method as any).recoverProtocolV2FileTransfer).not.toHaveBeenCalled();
9236
- });
9237
-
9238
- test('raises a source read error after the windowed call and retries the file', async () => {
9239
- const requests: any[] = [];
9240
- const typedCall = streamAll(requests);
9241
- const method = createMethod(typedCall);
9242
- const bytes = new Uint8Array(2500);
9243
- let failed = false;
9244
- const source = {
9245
- size: bytes.length,
9246
- readAt: jest.fn((offset: number, length: number) => {
9247
- if (offset === 1000 && !failed) {
9248
- failed = true;
9249
- return Promise.reject(new Error('artifact read failed'));
9250
- }
9251
- return Promise.resolve(bytes.slice(offset, offset + length).buffer);
9252
- }),
9253
- close: jest.fn(),
9254
- };
9255
-
9256
- await expect(
9257
- (method as any).protocolV2SourceUpdateProcess({
9258
- source,
9259
- filePath: 'vol0:/application_p1.bin',
9260
- processedSize: 0,
9261
- totalSize: 2500,
9262
- })
9263
- ).resolves.toBe(2500);
9264
-
9265
- expect(typedCall).toHaveBeenCalledTimes(2);
9266
- expect((method as any).recoverProtocolV2FileTransfer).toHaveBeenCalledTimes(1);
9267
- expect(requests.map(request => request.file.offset)).toEqual([0, 0, 1000, 2000]);
9268
- });
9269
-
9270
- test('rejects a windowed write that does not confirm the whole file', async () => {
9271
- const typedCall = jest.fn((_name: string, _resType: string, first: any) =>
9272
- Promise.resolve(confirm(first))
9273
- );
9274
- const method = createMethod(typedCall);
9275
-
9276
- await expect(transfer(method)).rejects.toMatchObject({
9277
- errorCode: HardwareErrorCode.EmmcFileWriteFirmwareError,
9278
- message: expect.stringContaining('invalid processed_byte 1000 for file size 2500'),
9279
- });
9280
- expect(typedCall).toHaveBeenCalledTimes(3);
9281
- expect((method as any).recoverProtocolV2FileTransfer).toHaveBeenCalledTimes(2);
9282
- });
9283
- });
9284
-
9285
8886
  test('uses absolute processed_byte offsets and disables append for firmware file writes', async () => {
9286
8887
  const method = new FirmwareUpdateV4({
9287
8888
  id: 1,
@@ -10011,27 +9612,6 @@ describe('Protocol V2 firmware update targets', () => {
10011
9612
  expect(writePayloads.map(payload => payload.file.data.byteLength)).toEqual([1960, 1]);
10012
9613
  });
10013
9614
 
10014
- test.each([
10015
- [false, 'vol0:/application_p1.bin', 1960],
10016
- [true, 'vol0:/application_p1.bin', 1800],
10017
- [true, 'vol0:/bundles/images/animation.okpkg', 1800],
10018
- ])(
10019
- 'sizes BLE write chunks for fileWriteWindow=%s and %s',
10020
- (fileWriteWindow, filePath, expected) => {
10021
- const method = new FirmwareUpdateV4({
10022
- id: 1,
10023
- payload: {
10024
- method: 'firmwareUpdateV4',
10025
- },
10026
- });
10027
- (method as any).params = { platform: 'native', chunkSize: 4096 };
10028
-
10029
- expect(
10030
- (method as any).getProtocolV2FirmwareChunkSize('write', filePath, fileWriteWindow)
10031
- ).toBe(expected);
10032
- }
10033
- );
10034
-
10035
9615
  test('keeps confirmation active after the Request write until terminal Success arrives', async () => {
10036
9616
  const method = new FirmwareUpdateV4({
10037
9617
  id: 1,
@@ -338,6 +338,42 @@ describe('SearchDevices', () => {
338
338
  }
339
339
  );
340
340
 
341
+ test('BLE discovery returns the advertised color letter without a device identity', async () => {
342
+ mockIsBleConnect.mockReturnValue(true);
343
+
344
+ const descriptor = {
345
+ id: 'ble-peripheral-id',
346
+ path: 'ble-peripheral-id',
347
+ name: 'Neo A1B2',
348
+ commType: 'ble',
349
+ bleColorCode: 'E',
350
+ };
351
+ const method = new SearchDevices({
352
+ id: 1,
353
+ payload: {
354
+ method: 'searchDevices',
355
+ },
356
+ } as any);
357
+ method.init();
358
+ method.connector = {
359
+ enumerate: jest.fn().mockResolvedValue({
360
+ descriptors: [descriptor],
361
+ }),
362
+ } as any;
363
+
364
+ await expect(method.run()).resolves.toEqual([
365
+ {
366
+ ...descriptor,
367
+ connectId: 'ble-peripheral-id',
368
+ serialNo: null,
369
+ uuid: '',
370
+ deviceId: null,
371
+ deviceType: 'neo',
372
+ bleColorCode: 'E',
373
+ },
374
+ ]);
375
+ });
376
+
341
377
  test.each([
342
378
  ['Pro2 A1B2 - Find My', undefined, 'Pro 2 A1B2'],
343
379
  ['Pro2 5E9D - Finde My', undefined, 'Pro 2 5E9D'],
@@ -2,7 +2,6 @@ import { EDeviceType } from '@onekeyfe/hd-shared';
2
2
  import { FirmwareUpdateBaseMethod } from './firmware/FirmwareUpdateBaseMethod';
3
3
  import type { FirmwareUpdateV4Params } from '../types/api/firmwareUpdate';
4
4
  export declare function assertProtocolV2FirmwareTargetsSupported(deviceType: EDeviceType | string | undefined, params: FirmwareUpdateV4Params, hasExplicitTargetSelection?: boolean): void;
5
- export declare function supportsProtocolV2BleFileWriteWindow(bootloaderVersion: string, minBootloaderVersion?: string | undefined): boolean;
6
5
  export declare const isProtocolV2FirmwareFingerprintValid: (binary: ArrayBuffer | Uint8Array, fingerprint: string | undefined) => boolean;
7
6
  export declare const assertProtocolV2ReconnectIdentity: (expectedSerialNumber?: string, actualSerialNumber?: string, expectedPath?: string, actualPath?: string) => void;
8
7
  export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareUpdateV4Params> {
@@ -69,7 +68,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
69
68
  private getProtocolV2ResourceComparePath;
70
69
  private readProtocolV2DeviceFileHeader;
71
70
  private isProtocolV2ResourceBundleUpToDate;
72
- private isProtocolV2ResourceBundleUpToDateWithRecovery;
73
71
  private isProtocolV2BootloaderMode;
74
72
  private isProtocolV2RomloaderMode;
75
73
  private rebootProtocolV2ToBootloader;
@@ -101,8 +99,6 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
101
99
  private ensureProtocolV2DeviceAcquired;
102
100
  private isProtocolV2ReconnectIdentityError;
103
101
  private fileWriteChunk;
104
- private shouldUseProtocolV2BleFileWriteWindow;
105
- private writeProtocolV2SourceWindowed;
106
102
  private recoverProtocolV2FileTransfer;
107
103
  private acquireProtocolV2BleDevice;
108
104
  private protocolV2StartFirmwareUpdate;
@@ -1 +1 @@
1
- {"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkD,MAAM,qBAAqB,CAAC;AA4BlG,OAAO,EAAE,wBAAwB,EAAE,M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B;IAiBjC,OAAO,CAAC,wBAAwB;YAkBlB,iCAAiC;YA6CjC,uCAAuC;YA0CvC,+BAA+B;IAmF7C,OAAO,CAAC,6BAA6B;IAMrC,OAAO,CAAC,gCAAgC;YAM1B,8BAA8B;YAmD9B,kCAAkC;IA+BhD,OAAO,CAAC,0BAA0B;IAUlC,OAAO,CAAC,yBAAyB;YAcnB,4BAA4B;IAkBpC,6BAA6B;YAkBrB,+BAA+B;IAkD7C,OAAO,CAAC,6BAA6B;YAkCvB,6BAA6B;YA0B7B,0CAA0C;YA6B1C,uBAAuB;YAiCvB,8BAA8B;YAkF9B,6BAA6B;IAuF3C,OAAO,CAAC,mCAAmC;YAI7B,0BAA0B;IAaxC,OAAO,CAAC,8BAA8B;IAiBtC,OAAO,CAAC,4BAA4B;IAoLpC,OAAO,CAAC,6BAA6B;IAcrC,OAAO,CAAC,qCAAqC;IAoC7C,OAAO,CAAC,kCAAkC;IAyC1C,OAAO,CAAC,8CAA8C;YAIxC,uCAAuC;YA8UvC,gCAAgC;YAehC,yBAAyB;IAUvC,OAAO,CAAC,2BAA2B;YAMrB,8BAA8B;IAQ5C,OAAO,CAAC,0BAA0B;YAkBpB,mCAAmC;YAWnC,qCAAqC;YAmDrC,yBAAyB;YAgGzB,8BAA8B;IAU5C,OAAO,CAAC,kCAAkC;YAQ5B,cAAc;YAyCd,6BAA6B;YAW7B,0BAA0B;YAoB1B,6BAA6B;YAwD7B,gBAAgB;IA0B9B,OAAO,CAAC,qBAAqB;CAM9B"}
package/dist/index.d.ts CHANGED
@@ -383,6 +383,12 @@ type SearchDevice = {
383
383
  deviceType: IDeviceType;
384
384
  name: string;
385
385
  commType: OneKeyDeviceCommType;
386
+ /**
387
+ * React Native and Electron BLE discovery only. Serial-number color letter ('A'-'Z')
388
+ * advertised by Pro2 / Neo, possibly remembered from an earlier advertisement in this
389
+ * process. Absent when unknown; the letter's meaning depends on deviceType.
390
+ */
391
+ bleColorCode?: string;
386
392
  };
387
393
  /** Identity confirmed over USB. The descriptor path is only a transport address. */
388
394
  type UsbDeviceIdentity = {