@onekeyfe/hd-core 1.2.0-alpha.53 → 1.2.0-alpha.54

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.
Files changed (251) hide show
  1. package/__tests__/AllNetworkGetAddressBase.tracing.test.ts +0 -78
  2. package/__tests__/DeviceCommands.test.ts +0 -45
  3. package/__tests__/DeviceEventRegistration.test.ts +0 -6
  4. package/__tests__/check-all-firmware-release-protocol-v2.test.ts +3 -198
  5. package/__tests__/connectSettings.test.ts +47 -5
  6. package/__tests__/device-initialize-timeout.test.ts +56 -0
  7. package/__tests__/device-lifecycle-events.test.ts +3 -105
  8. package/__tests__/firmware-update/check-all-firmware-release.test.ts +175 -0
  9. package/__tests__/firmware-update/firmware-artifact-source.test.ts +119 -0
  10. package/__tests__/firmware-update/firmware-host-binding.test.ts +70 -0
  11. package/__tests__/firmware-update/firmware-preparation-error.test.ts +27 -0
  12. package/__tests__/firmware-update/firmware-update-bootloader-poll.test.ts +200 -0
  13. package/__tests__/firmware-update/firmware-update-capabilities.test.ts +13 -0
  14. package/__tests__/firmware-update/firmware-update-plan-bootloader-identity.test.ts +294 -0
  15. package/__tests__/firmware-update/firmware-update-plan.test.ts +593 -0
  16. package/__tests__/firmware-update/firmware-update-prepared-plan.test.ts +213 -0
  17. package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +59 -31
  18. package/__tests__/firmware-update/firmware-update-v3-reconnect.test.ts +58 -0
  19. package/__tests__/firmware-update/firmware-upload-source.test.ts +70 -0
  20. package/__tests__/get-device-state.test.ts +12 -132
  21. package/__tests__/homescreen.test.ts +1 -41
  22. package/__tests__/logBlockEvent.test.ts +1 -1
  23. package/__tests__/method-protocol-support.test.ts +0 -19
  24. package/__tests__/open-wallet-session.test.ts +33 -446
  25. package/__tests__/protocol-v2-unlock-policy.test.ts +35 -201
  26. package/__tests__/protocol-v2.test.ts +1034 -1378
  27. package/__tests__/protocolV2UiInteraction.test.ts +0 -63
  28. package/__tests__/public-pro2-api-boundary.test.ts +0 -1
  29. package/__tests__/search-devices.test.ts +3 -12
  30. package/dist/api/BaseMethod.d.ts +1 -3
  31. package/dist/api/BaseMethod.d.ts.map +1 -1
  32. package/dist/api/CheckAllFirmwareRelease.d.ts +1 -2
  33. package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
  34. package/dist/api/FirmwareUpdate.d.ts.map +1 -1
  35. package/dist/api/FirmwareUpdateV2.d.ts +11 -0
  36. package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
  37. package/dist/api/FirmwareUpdateV3.d.ts +7 -3
  38. package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
  39. package/dist/api/FirmwareUpdateV4.d.ts +25 -11
  40. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  41. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  42. package/dist/api/OpenWalletSession.d.ts.map +1 -1
  43. package/dist/api/SearchDevices.d.ts.map +1 -1
  44. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
  45. package/dist/api/device/DeviceUnlock.d.ts +2 -2
  46. package/dist/api/device/DeviceUnlock.d.ts.map +1 -1
  47. package/dist/api/device/DeviceUpdateBootloader.d.ts +5 -1
  48. package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
  49. package/dist/api/firmware/FirmwareArtifactSource.d.ts +25 -0
  50. package/dist/api/firmware/FirmwareArtifactSource.d.ts.map +1 -0
  51. package/dist/api/firmware/FirmwareHostBinding.d.ts +6 -0
  52. package/dist/api/firmware/FirmwareHostBinding.d.ts.map +1 -0
  53. package/dist/api/firmware/FirmwarePreparationError.d.ts +3 -0
  54. package/dist/api/firmware/FirmwarePreparationError.d.ts.map +1 -0
  55. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +9 -0
  56. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
  57. package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts +3 -0
  58. package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts.map +1 -0
  59. package/dist/api/firmware/FirmwareUpdatePlan.d.ts +25 -0
  60. package/dist/api/firmware/FirmwareUpdatePlan.d.ts.map +1 -0
  61. package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts +32 -0
  62. package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts.map +1 -0
  63. package/dist/api/firmware/getBinary.d.ts +7 -0
  64. package/dist/api/firmware/getBinary.d.ts.map +1 -1
  65. package/dist/api/firmware/progressThrottle.d.ts +3 -0
  66. package/dist/api/firmware/progressThrottle.d.ts.map +1 -0
  67. package/dist/api/firmware/updateBootloader.d.ts +2 -0
  68. package/dist/api/firmware/updateBootloader.d.ts.map +1 -1
  69. package/dist/api/firmware/uploadFirmware.d.ts +9 -1
  70. package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
  71. package/dist/api/helpers/protocolV2FileWrite.d.ts +0 -2
  72. package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -1
  73. package/dist/api/index.d.ts +0 -2
  74. package/dist/api/index.d.ts.map +1 -1
  75. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -1
  76. package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
  77. package/dist/api/stellar/StellarSignTransaction.d.ts +1 -1
  78. package/dist/core/deviceEventRegistration.d.ts +0 -2
  79. package/dist/core/deviceEventRegistration.d.ts.map +1 -1
  80. package/dist/core/index.d.ts.map +1 -1
  81. package/dist/data-manager/DataManager.d.ts +2 -4
  82. package/dist/data-manager/DataManager.d.ts.map +1 -1
  83. package/dist/data-manager/connectSettings.d.ts.map +1 -1
  84. package/dist/device/Device.d.ts +6 -29
  85. package/dist/device/Device.d.ts.map +1 -1
  86. package/dist/device/DeviceCommands.d.ts +4 -4
  87. package/dist/device/DeviceCommands.d.ts.map +1 -1
  88. package/dist/device/DevicePool.d.ts.map +1 -1
  89. package/dist/events/device.d.ts +0 -4
  90. package/dist/events/device.d.ts.map +1 -1
  91. package/dist/events/logBlockEvent.d.ts.map +1 -1
  92. package/dist/events/ui-promise.d.ts +2 -4
  93. package/dist/events/ui-promise.d.ts.map +1 -1
  94. package/dist/events/ui-request.d.ts +2 -31
  95. package/dist/events/ui-request.d.ts.map +1 -1
  96. package/dist/events/ui-response.d.ts +2 -10
  97. package/dist/events/ui-response.d.ts.map +1 -1
  98. package/dist/index.d.ts +231 -214
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +3497 -2559
  101. package/dist/inject.d.ts +1 -6
  102. package/dist/inject.d.ts.map +1 -1
  103. package/dist/lowLevelInject.d.ts.map +1 -1
  104. package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
  105. package/dist/protocols/protocol-v2/lockedError.d.ts +2 -0
  106. package/dist/protocols/protocol-v2/lockedError.d.ts.map +1 -0
  107. package/dist/protocols/protocol-v2/uiInteraction.d.ts +4 -7
  108. package/dist/protocols/protocol-v2/uiInteraction.d.ts.map +1 -1
  109. package/dist/protocols/protocol-v2/unlockPolicy.d.ts +3 -1
  110. package/dist/protocols/protocol-v2/unlockPolicy.d.ts.map +1 -1
  111. package/dist/protocols/protocol-v2/unlockRetry.d.ts +10 -0
  112. package/dist/protocols/protocol-v2/unlockRetry.d.ts.map +1 -0
  113. package/dist/protocols/protocol-v2/walletSession.d.ts +1 -5
  114. package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -1
  115. package/dist/topLevelInject.d.ts.map +1 -1
  116. package/dist/types/api/checkAllFirmwareRelease.d.ts +4 -2
  117. package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
  118. package/dist/types/api/deviceUnlock.d.ts +1 -5
  119. package/dist/types/api/deviceUnlock.d.ts.map +1 -1
  120. package/dist/types/api/deviceUpdateBootloader.d.ts +6 -0
  121. package/dist/types/api/deviceUpdateBootloader.d.ts.map +1 -1
  122. package/dist/types/api/export.d.ts +4 -2
  123. package/dist/types/api/export.d.ts.map +1 -1
  124. package/dist/types/api/firmwareUpdate.d.ts +70 -2
  125. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  126. package/dist/types/api/firmwareUpdateCapabilities.d.ts +9 -0
  127. package/dist/types/api/firmwareUpdateCapabilities.d.ts.map +1 -0
  128. package/dist/types/api/firmwareUpdatePlan.d.ts +28 -0
  129. package/dist/types/api/firmwareUpdatePlan.d.ts.map +1 -0
  130. package/dist/types/api/firmwareUpdatePreparedPlan.d.ts +42 -0
  131. package/dist/types/api/firmwareUpdatePreparedPlan.d.ts.map +1 -0
  132. package/dist/types/api/index.d.ts +10 -7
  133. package/dist/types/api/index.d.ts.map +1 -1
  134. package/dist/types/api/protocolV2.d.ts +0 -3
  135. package/dist/types/api/protocolV2.d.ts.map +1 -1
  136. package/dist/types/device.d.ts.map +1 -1
  137. package/dist/types/params.d.ts +0 -1
  138. package/dist/types/params.d.ts.map +1 -1
  139. package/dist/types/settings.d.ts +13 -22
  140. package/dist/types/settings.d.ts.map +1 -1
  141. package/dist/utils/deviceFeaturesCompat.d.ts +1 -0
  142. package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -1
  143. package/dist/utils/deviceFeaturesUtils.d.ts +0 -4
  144. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  145. package/dist/utils/homescreen.d.ts +0 -4
  146. package/dist/utils/homescreen.d.ts.map +1 -1
  147. package/dist/utils/index.d.ts +1 -1
  148. package/dist/utils/index.d.ts.map +1 -1
  149. package/dist/utils/patch.d.ts +1 -1
  150. package/dist/utils/patch.d.ts.map +1 -1
  151. package/dist/utils/pro2Wallpaper.d.ts +0 -10
  152. package/dist/utils/pro2Wallpaper.d.ts.map +1 -1
  153. package/package.json +4 -4
  154. package/src/api/BaseMethod.ts +10 -8
  155. package/src/api/CheckAllFirmwareRelease.ts +57 -54
  156. package/src/api/FirmwareUpdate.ts +15 -7
  157. package/src/api/FirmwareUpdateV2.ts +316 -126
  158. package/src/api/FirmwareUpdateV3.ts +265 -63
  159. package/src/api/FirmwareUpdateV4.ts +965 -566
  160. package/src/api/GetPassphraseState.ts +1 -7
  161. package/src/api/OpenWalletSession.ts +17 -54
  162. package/src/api/SearchDevices.ts +1 -3
  163. package/src/api/allnetwork/AllNetworkGetAddressBase.ts +11 -32
  164. package/src/api/device/DeviceUnlock.ts +3 -8
  165. package/src/api/device/DeviceUpdateBootloader.ts +122 -6
  166. package/src/api/firmware/FirmwareArtifactSource.ts +278 -0
  167. package/src/api/firmware/FirmwareHostBinding.ts +100 -0
  168. package/src/api/firmware/FirmwarePreparationError.ts +12 -0
  169. package/src/api/firmware/FirmwareUpdateBaseMethod.ts +83 -16
  170. package/src/api/firmware/FirmwareUpdateCapabilities.ts +9 -0
  171. package/src/api/firmware/FirmwareUpdatePlan.ts +772 -0
  172. package/src/api/firmware/FirmwareUpdatePreparedPlan.ts +415 -0
  173. package/src/api/firmware/progressThrottle.ts +44 -0
  174. package/src/api/firmware/updateBootloader.ts +19 -4
  175. package/src/api/firmware/uploadFirmware.ts +144 -39
  176. package/src/api/helpers/protocolV2FileWrite.ts +4 -11
  177. package/src/api/index.ts +0 -2
  178. package/src/api/protocol-v2/ProtocolInfoRequest.ts +1 -3
  179. package/src/api/protocol-v2/helpers.ts +0 -1
  180. package/src/core/deviceEventRegistration.ts +0 -4
  181. package/src/core/index.ts +83 -167
  182. package/src/data/messages/messages-protocol-v2.json +0 -25
  183. package/src/data-manager/DataManager.ts +38 -67
  184. package/src/data-manager/connectSettings.ts +11 -0
  185. package/src/device/Device.ts +42 -258
  186. package/src/device/DeviceCommands.ts +1 -7
  187. package/src/device/DevicePool.ts +2 -7
  188. package/src/events/device.ts +0 -4
  189. package/src/events/logBlockEvent.ts +0 -1
  190. package/src/events/ui-promise.ts +2 -4
  191. package/src/events/ui-request.ts +2 -36
  192. package/src/events/ui-response.ts +2 -12
  193. package/src/index.ts +5 -0
  194. package/src/inject.ts +24 -60
  195. package/src/lowLevelInject.ts +8 -7
  196. package/src/protocols/protocol-v2/features.ts +3 -10
  197. package/src/protocols/protocol-v2/lockedError.ts +10 -0
  198. package/src/protocols/protocol-v2/uiInteraction.ts +6 -46
  199. package/src/protocols/protocol-v2/unlockPolicy.ts +105 -1
  200. package/src/protocols/protocol-v2/unlockRetry.ts +109 -0
  201. package/src/protocols/protocol-v2/walletSession.ts +30 -180
  202. package/src/topLevelInject.ts +8 -7
  203. package/src/types/api/checkAllFirmwareRelease.ts +4 -2
  204. package/src/types/api/deviceUnlock.ts +1 -12
  205. package/src/types/api/deviceUpdateBootloader.ts +6 -0
  206. package/src/types/api/export.ts +18 -1
  207. package/src/types/api/firmwareUpdate.ts +76 -3
  208. package/src/types/api/firmwareUpdateCapabilities.ts +9 -0
  209. package/src/types/api/firmwareUpdatePlan.ts +38 -0
  210. package/src/types/api/firmwareUpdatePreparedPlan.ts +53 -0
  211. package/src/types/api/index.ts +14 -13
  212. package/src/types/api/protocolV2.ts +0 -13
  213. package/src/types/device.ts +0 -3
  214. package/src/types/params.ts +1 -7
  215. package/src/types/settings.ts +13 -42
  216. package/src/utils/deviceFeaturesCompat.ts +6 -0
  217. package/src/utils/deviceFeaturesUtils.ts +0 -8
  218. package/src/utils/homescreen.ts +6 -32
  219. package/src/utils/index.ts +1 -6
  220. package/src/utils/pro2Wallpaper.ts +8 -35
  221. package/__tests__/deviceUploadNft.test.ts +0 -293
  222. package/__tests__/pro2Nft.test.ts +0 -108
  223. package/__tests__/protocol-binding.test.ts +0 -89
  224. package/__tests__/protocol-v2-resources.test.ts +0 -284
  225. package/__tests__/protocol-v2-ui-lifecycle.test.ts +0 -91
  226. package/__tests__/uiProgressThrottle.test.ts +0 -74
  227. package/__tests__/uiPromiseRegistry.test.ts +0 -86
  228. package/dist/api/DetectDeviceConnectProtocol.d.ts +0 -7
  229. package/dist/api/DetectDeviceConnectProtocol.d.ts.map +0 -1
  230. package/dist/api/protocol-v2/DeviceUploadNft.d.ts +0 -31
  231. package/dist/api/protocol-v2/DeviceUploadNft.d.ts.map +0 -1
  232. package/dist/core/uiPromiseRegistry.d.ts +0 -4
  233. package/dist/core/uiPromiseRegistry.d.ts.map +0 -1
  234. package/dist/protocols/protocol-v2/resources.d.ts +0 -30
  235. package/dist/protocols/protocol-v2/resources.d.ts.map +0 -1
  236. package/dist/protocols/protocol-v2/unlockPolicyRunner.d.ts +0 -22
  237. package/dist/protocols/protocol-v2/unlockPolicyRunner.d.ts.map +0 -1
  238. package/dist/types/api/detectDeviceConnectProtocol.d.ts +0 -4
  239. package/dist/types/api/detectDeviceConnectProtocol.d.ts.map +0 -1
  240. package/dist/utils/pro2Nft.d.ts +0 -31
  241. package/dist/utils/pro2Nft.d.ts.map +0 -1
  242. package/dist/utils/uiProgressThrottle.d.ts +0 -3
  243. package/dist/utils/uiProgressThrottle.d.ts.map +0 -1
  244. package/src/api/DetectDeviceConnectProtocol.ts +0 -18
  245. package/src/api/protocol-v2/DeviceUploadNft.ts +0 -189
  246. package/src/core/uiPromiseRegistry.ts +0 -41
  247. package/src/protocols/protocol-v2/resources.ts +0 -359
  248. package/src/protocols/protocol-v2/unlockPolicyRunner.ts +0 -118
  249. package/src/types/api/detectDeviceConnectProtocol.ts +0 -7
  250. package/src/utils/pro2Nft.ts +0 -142
  251. package/src/utils/uiProgressThrottle.ts +0 -63
@@ -74,9 +74,7 @@ import type { DeviceStateReadOptions } from '../types/api/getDeviceState';
74
74
  import type {
75
75
  DeviceButtonRequestPayload,
76
76
  DeviceFeaturesPayload,
77
- HardwareUiInteractionMeta,
78
77
  PassphraseRequestPayload,
79
- ProtocolV2UiEventMetadata,
80
78
  } from '../events';
81
79
  import type { PassphrasePromptResponse } from './DeviceCommands';
82
80
  import type { Deferred, HardwareConnectProtocol } from '@onekeyfe/hd-shared';
@@ -95,10 +93,14 @@ export type InitOptions = {
95
93
  passphraseState?: string;
96
94
  deriveCardano?: boolean;
97
95
  connectProtocol?: HardwareConnectProtocol;
98
- forceProtocolDetection?: boolean;
99
96
  protocolV2DeviceInfoTimeoutMs?: number;
100
97
  /** Refresh Protocol V2 runtime state before returning discovery results. */
101
98
  refreshRuntimeState?: boolean;
99
+ /**
100
+ * Protocol V1 Initialize response timeout override. Reboot-wait polling passes a
101
+ * short value so an unanswered probe settles before the next poll tick.
102
+ */
103
+ timeoutMs?: number;
102
104
  };
103
105
 
104
106
  export type RunOptions = {
@@ -135,8 +137,6 @@ const isProtocolV2DeviceStatusUnsupportedError = (error: unknown) => {
135
137
 
136
138
  export interface DeviceEvents {
137
139
  [DEVICE.PIN]: [Device, PROTO.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
138
- [DEVICE.PIN_ON_DEVICE]: [Device, DeviceSessionPinType, ProtocolV2UiEventMetadata?];
139
- [DEVICE.PIN_ON_DEVICE_COMPLETE]: [Device, HardwareUiInteractionMeta];
140
140
  [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, PassphraseRequestPayload?];
141
141
  [DEVICE.ATTACH_PIN_ON_DEVICE]: [Device, PassphraseRequestPayload?];
142
142
  [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
@@ -235,24 +235,6 @@ export class Device extends EventEmitter {
235
235
  /** Force the next initialization to reload DeviceInfo after reconnect or reboot. */
236
236
  private protocolV2StateNeedsReload = false;
237
237
 
238
- /** Runtime context negotiated once per active Protocol V2 link. */
239
- private protocolV2RuntimeContext?: ProtocolInfo;
240
-
241
- /** Coalesces concurrent first-use runtime negotiation on the same active link. */
242
- private protocolV2RuntimeContextPromise?: Promise<ProtocolInfo>;
243
-
244
- /** Invalidates an in-flight runtime-context response without adding a transport epoch. */
245
- private protocolV2RuntimeContextRequestToken?: object;
246
-
247
- private protocolV2UiInteraction?: {
248
- interactionId: string;
249
- phaseCounter: number;
250
- sequence: number;
251
- opened: boolean;
252
- };
253
-
254
- private protocolV2UiInteractionCounter = 0;
255
-
256
238
  get state() {
257
239
  return this.stateStore.getState();
258
240
  }
@@ -378,10 +360,7 @@ export class Device extends EventEmitter {
378
360
  * Device connect
379
361
  * @returns {Promise<boolean>}
380
362
  */
381
- connect(
382
- connectProtocol?: HardwareConnectProtocol,
383
- options?: { forceProtocolDetection?: boolean }
384
- ) {
363
+ connect(connectProtocol?: HardwareConnectProtocol) {
385
364
  const env = DataManager.getSettings('env');
386
365
  // eslint-disable-next-line no-async-promise-executor
387
366
  return new Promise<boolean>(async (resolve, reject) => {
@@ -391,7 +370,7 @@ export class Device extends EventEmitter {
391
370
  return;
392
371
  }
393
372
  try {
394
- await this.acquire(connectProtocol, options);
373
+ await this.acquire(connectProtocol);
395
374
  resolve(true);
396
375
  } catch (error) {
397
376
  reject(error);
@@ -401,7 +380,7 @@ export class Device extends EventEmitter {
401
380
  // 不存在 Session ID 或存在 Session ID 但设备在别处使用,都需要 acquire 获取最新 sessionID
402
381
  if (!this.mainId || (!this.isUsedHere() && this.originalDescriptor)) {
403
382
  try {
404
- await this.acquire(connectProtocol, options);
383
+ await this.acquire(connectProtocol);
405
384
  resolve(true);
406
385
  } catch (error) {
407
386
  reject(error);
@@ -418,16 +397,11 @@ export class Device extends EventEmitter {
418
397
 
419
398
  async acquire(
420
399
  expectedProtocol?: HardwareConnectProtocol,
421
- options?: { throwOnRunPromiseError?: boolean; forceProtocolDetection?: boolean }
400
+ options?: { throwOnRunPromiseError?: boolean }
422
401
  ) {
423
402
  const env = DataManager.getSettings('env');
424
403
  const mainIdKey = DataManager.isBleConnect(env) ? 'id' : 'session';
425
- const previousProtocol = this.originalDescriptor.protocolType;
426
- // A protocol stored after a successful probe is authoritative. Only the explicit
427
- // first-connection/recovery path may bypass it and probe both protocols again.
428
- const strictProtocol = options?.forceProtocolDetection
429
- ? undefined
430
- : expectedProtocol ?? this.originalDescriptor.protocolType;
404
+ const protocolHint = expectedProtocol ? undefined : this.originalDescriptor.protocolType;
431
405
  try {
432
406
  let acquireResult: unknown;
433
407
  if (DataManager.isBleConnect(env)) {
@@ -439,8 +413,8 @@ export class Device extends EventEmitter {
439
413
  this.originalDescriptor.id,
440
414
  undefined,
441
415
  true,
442
- strictProtocol,
443
- undefined
416
+ expectedProtocol,
417
+ protocolHint
444
418
  );
445
419
  this.mainId = (acquireResult as any)?.uuid ?? '';
446
420
  Log.debug('Expected uuid:', this.mainId);
@@ -449,31 +423,24 @@ export class Device extends EventEmitter {
449
423
  this.originalDescriptor.path,
450
424
  this.originalDescriptor.session,
451
425
  undefined,
452
- strictProtocol,
453
- undefined
426
+ expectedProtocol,
427
+ protocolHint
454
428
  );
455
429
  this.mainId = acquireResult as string | undefined;
456
430
  Log.debug('Expected session id:', this.mainId);
457
431
  }
432
+ this.deviceAcquired = true;
433
+ this.updateDescriptor({ [mainIdKey]: this.mainId } as unknown as DeviceDescriptor);
434
+
458
435
  // Propagate protocol version detected during acquire.
459
436
  const detectedProtocol =
460
437
  (acquireResult as { protocolType?: HardwareConnectProtocol } | undefined)?.protocolType ??
461
438
  TransportManager.transport?.getProtocolType?.(
462
439
  DataManager.isBleConnect(env) ? this.originalDescriptor.id : this.originalDescriptor.path
463
440
  );
464
- if (options?.forceProtocolDetection && !detectedProtocol) {
465
- throw ERRORS.TypedError(
466
- HardwareErrorCode.RuntimeError,
467
- `Active protocol detection returned no protocol for ${
468
- this.originalDescriptor.path || this.originalDescriptor.id
469
- }`
470
- );
471
- }
472
441
  if (detectedProtocol) {
473
442
  this.originalDescriptor.protocolType = detectedProtocol;
474
443
  }
475
- this.deviceAcquired = true;
476
- this.updateDescriptor({ [mainIdKey]: this.mainId } as unknown as DeviceDescriptor);
477
444
 
478
445
  if (this.commands) {
479
446
  await this.commands.dispose(false);
@@ -481,22 +448,6 @@ export class Device extends EventEmitter {
481
448
 
482
449
  this.commands = new DeviceCommands(this, this.mainId ?? '');
483
450
  } catch (error) {
484
- if (options?.forceProtocolDetection) {
485
- this.originalDescriptor.protocolType = previousProtocol;
486
- const failedSession = this.mainId;
487
- this.deviceAcquired = false;
488
- if (failedSession) {
489
- try {
490
- await this.deviceConnector?.release?.(failedSession, false);
491
- } catch (releaseError) {
492
- Log.debug('Failed to release an unsuccessful protocol probe', releaseError);
493
- }
494
- }
495
- if (!DataManager.isBleConnect(env)) {
496
- this.mainId = null;
497
- this.updateDescriptor({ session: null } as DeviceDescriptor);
498
- }
499
- }
500
451
  if (options?.throwOnRunPromiseError) {
501
452
  throw error;
502
453
  }
@@ -905,7 +856,7 @@ export class Device extends EventEmitter {
905
856
  const initStartAt = Date.now();
906
857
  const { message } = await this.commands.typedCall('Initialize', 'Features', payload, {
907
858
  // iOS BLE bound devices can need close to 20 seconds.
908
- timeoutMs: 25 * 1000,
859
+ timeoutMs: options?.timeoutMs ?? 25 * 1000,
909
860
  });
910
861
  this.setLastInitializeDuration(Date.now() - initStartAt);
911
862
  this._updateFeatures(message, initSession);
@@ -1018,10 +969,7 @@ export class Device extends EventEmitter {
1018
969
  await this.getFeatures();
1019
970
  }
1020
971
 
1021
- const supportsProtocolV1OnekeyFeatures =
1022
- this.getCurrentDeviceType() === EDeviceType.Touch ||
1023
- this.getCurrentDeviceType() === EDeviceType.Pro;
1024
- if (!this.isProtocolV2() && refresh.has('verification') && supportsProtocolV1OnekeyFeatures) {
972
+ if (!this.isProtocolV2() && refresh.has('verification')) {
1025
973
  const { message } = await this.commands.typedCall('OnekeyGetFeatures', 'OnekeyFeatures');
1026
974
  this.updateState(mapProtocolV1OnekeyFeaturesToState(message), 'device-info');
1027
975
  }
@@ -1044,7 +992,13 @@ export class Device extends EventEmitter {
1044
992
  }
1045
993
 
1046
994
  if (refresh.has('status') && !initializedWithDeviceInfo) {
1047
- await this.probeProtocolV2RuntimeState(refreshedDeviceInfo);
995
+ const deviceInfo =
996
+ refreshedDeviceInfo ??
997
+ (await requestProtocolV2DeviceInfo({
998
+ commands: this.commands,
999
+ request: getProtocolV2DeviceInfoRequest(),
1000
+ }));
1001
+ await this.probeProtocolV2RuntimeState(deviceInfo);
1048
1002
  }
1049
1003
 
1050
1004
  if (refresh.has('settings') && this.state?.status.mode === 'normal') {
@@ -1115,58 +1069,15 @@ export class Device extends EventEmitter {
1115
1069
  return this.features;
1116
1070
  }
1117
1071
 
1118
- async ensureProtocolV2RuntimeContext(timeoutMs?: number): Promise<ProtocolInfo> {
1119
- const cachedProtocolInfo =
1120
- this.protocolV2RuntimeContext ??
1121
- (!this.protocolV2StateNeedsReload
1122
- ? this.state?.raw?.protocolV2ProtocolInfo ?? undefined
1123
- : undefined);
1124
- if (cachedProtocolInfo) {
1125
- this.protocolV2RuntimeContext = cachedProtocolInfo;
1126
- return cachedProtocolInfo;
1127
- }
1128
-
1129
- if (this.protocolV2RuntimeContextPromise) {
1130
- return this.protocolV2RuntimeContextPromise;
1131
- }
1132
-
1133
- const requestToken = {};
1134
- const pendingRequest = (async () => {
1135
- const protocolInfo = await requestProtocolV2ProtocolInfo({
1136
- commands: this.commands,
1137
- timeoutMs,
1138
- });
1139
- if (this.protocolV2RuntimeContextRequestToken !== requestToken) {
1140
- throw ERRORS.TypedError(
1141
- HardwareErrorCode.DeviceInitializeFailed,
1142
- 'Protocol V2 runtime context was invalidated while loading.'
1143
- );
1144
- }
1145
- this.protocolV2RuntimeContext = protocolInfo;
1146
- return protocolInfo;
1147
- })();
1148
- this.protocolV2RuntimeContextRequestToken = requestToken;
1149
- this.protocolV2RuntimeContextPromise = pendingRequest;
1150
-
1151
- try {
1152
- return await pendingRequest;
1153
- } finally {
1154
- if (this.protocolV2RuntimeContextPromise === pendingRequest) {
1155
- this.protocolV2RuntimeContextPromise = undefined;
1156
- }
1157
- if (this.protocolV2RuntimeContextRequestToken === requestToken) {
1158
- this.protocolV2RuntimeContextRequestToken = undefined;
1159
- }
1160
- }
1161
- }
1162
-
1163
- async probeProtocolV2RuntimeState(deviceInfo?: ProtocolV2DeviceInfo, timeoutMs?: number) {
1164
- const protocolInfo = await this.ensureProtocolV2RuntimeContext(timeoutMs);
1072
+ async probeProtocolV2RuntimeState(deviceInfo: ProtocolV2DeviceInfo, timeoutMs?: number) {
1073
+ const protocolInfo = await requestProtocolV2ProtocolInfo({
1074
+ commands: this.commands,
1075
+ timeoutMs,
1076
+ });
1165
1077
  const runtimeMode = getProtocolV2RuntimeMode(protocolInfo);
1166
- const runtimeDeviceInfo = deviceInfo ?? this.state?.raw?.protocolV2DeviceInfo;
1167
- const protocolV2DeviceType = runtimeDeviceInfo
1168
- ? resolveProtocolV2DeviceIdentity(runtimeDeviceInfo.hw?.Device_type).deviceType
1169
- : this.getCurrentDeviceType();
1078
+ const protocolV2DeviceType = resolveProtocolV2DeviceIdentity(
1079
+ deviceInfo.hw?.Device_type
1080
+ ).deviceType;
1170
1081
  if (runtimeMode === 'romloader' && protocolV2DeviceType !== EDeviceType.Pro2) {
1171
1082
  throw ERRORS.TypedError(
1172
1083
  HardwareErrorCode.DeviceInitializeFailed,
@@ -1241,9 +1152,6 @@ export class Device extends EventEmitter {
1241
1152
  this.deviceAcquired = false;
1242
1153
  if (!this.isProtocolV2()) return;
1243
1154
  this.protocolV2StateNeedsReload = true;
1244
- this.protocolV2RuntimeContext = undefined;
1245
- this.protocolV2RuntimeContextPromise = undefined;
1246
- this.protocolV2RuntimeContextRequestToken = undefined;
1247
1155
  this.clearPreInitialized();
1248
1156
  }
1249
1157
 
@@ -1252,14 +1160,9 @@ export class Device extends EventEmitter {
1252
1160
  if (deviceId) {
1253
1161
  deviceWalletSessionStore.deleteDevice(deviceId);
1254
1162
  }
1255
- if (this.isProtocolV2()) {
1256
- if (this.originalDescriptor.path !== deviceId) {
1257
- deviceWalletSessionStore.deleteDevice(this.originalDescriptor.path);
1258
- }
1163
+ if (this.isProtocolV2() && this.originalDescriptor.path !== deviceId) {
1164
+ deviceWalletSessionStore.deleteDevice(this.originalDescriptor.path);
1259
1165
  this.protocolV2StateNeedsReload = true;
1260
- this.protocolV2RuntimeContext = undefined;
1261
- this.protocolV2RuntimeContextPromise = undefined;
1262
- this.protocolV2RuntimeContextRequestToken = undefined;
1263
1166
  }
1264
1167
 
1265
1168
  this.passphraseState = undefined;
@@ -1272,9 +1175,6 @@ export class Device extends EventEmitter {
1272
1175
  if (!this.isProtocolV2()) return;
1273
1176
 
1274
1177
  this.protocolV2StateNeedsReload = true;
1275
- this.protocolV2RuntimeContext = undefined;
1276
- this.protocolV2RuntimeContextPromise = undefined;
1277
- this.protocolV2RuntimeContextRequestToken = undefined;
1278
1178
  this.clearPreInitialized();
1279
1179
  let loaderMode: 'bootloader' | 'romloader' | undefined;
1280
1180
  if (rebootType === DeviceRebootType.Bootloader) {
@@ -1381,17 +1281,11 @@ export class Device extends EventEmitter {
1381
1281
  }
1382
1282
  };
1383
1283
 
1384
- const env = DataManager.getSettings('env');
1385
- if (options.forceProtocolDetection && env !== 'react-native' && this.isUsedHere()) {
1386
- await this.release();
1387
- }
1388
-
1389
- if (options.forceProtocolDetection || !this.isUsedHere() || this.commands.disposed) {
1284
+ if (!this.isUsedHere() || this.commands.disposed) {
1285
+ const env = DataManager.getSettings('env');
1390
1286
  if (env !== 'react-native') {
1391
1287
  try {
1392
- await this.acquire(options.connectProtocol, {
1393
- forceProtocolDetection: options.forceProtocolDetection,
1394
- });
1288
+ await this.acquire(options.connectProtocol);
1395
1289
  } catch (error) {
1396
1290
  clearRunPromise();
1397
1291
  runPromise.reject(error);
@@ -1633,85 +1527,6 @@ export class Device extends EventEmitter {
1633
1527
  return res.message;
1634
1528
  }
1635
1529
 
1636
- beginProtocolV2UiInteraction() {
1637
- if (!this.isProtocolV2()) return;
1638
- this.protocolV2UiInteraction = {
1639
- interactionId: `${this.instanceId}:${Date.now()}:${++this.protocolV2UiInteractionCounter}`,
1640
- phaseCounter: 0,
1641
- sequence: 0,
1642
- opened: false,
1643
- };
1644
- }
1645
-
1646
- createProtocolV2UiPhaseMetadata(
1647
- phase: HardwareUiInteractionMeta['phase'],
1648
- transition: HardwareUiInteractionMeta['transition'],
1649
- options?: {
1650
- phaseId?: string;
1651
- outcome?: HardwareUiInteractionMeta['outcome'];
1652
- }
1653
- ): HardwareUiInteractionMeta | undefined {
1654
- if (!this.isProtocolV2()) return undefined;
1655
- if (!this.protocolV2UiInteraction) this.beginProtocolV2UiInteraction();
1656
-
1657
- const interaction = this.protocolV2UiInteraction;
1658
- if (!interaction) return undefined;
1659
- const phaseId =
1660
- options?.phaseId ?? `${interaction.interactionId}:phase-${++interaction.phaseCounter}`;
1661
- interaction.opened = true;
1662
- interaction.sequence += 1;
1663
-
1664
- return {
1665
- interactionId: interaction.interactionId,
1666
- phaseId,
1667
- sequence: interaction.sequence,
1668
- phase,
1669
- transition,
1670
- ...(options?.outcome ? { outcome: options.outcome } : {}),
1671
- protocol: 'V2',
1672
- };
1673
- }
1674
-
1675
- completeProtocolV2UiPhase(
1676
- phase: HardwareUiInteractionMeta,
1677
- outcome: HardwareUiInteractionMeta['outcome'] = 'succeeded'
1678
- ) {
1679
- return this.createProtocolV2UiPhaseMetadata(phase.phase, 'complete', {
1680
- phaseId: phase.phaseId,
1681
- outcome,
1682
- });
1683
- }
1684
-
1685
- finishProtocolV2UiInteraction(
1686
- outcome?: HardwareUiInteractionMeta['outcome'],
1687
- options?: { ensureMetadata?: boolean }
1688
- ) {
1689
- const interaction = this.protocolV2UiInteraction;
1690
- if (!interaction || (!interaction.opened && !options?.ensureMetadata)) {
1691
- this.protocolV2UiInteraction = undefined;
1692
- return undefined;
1693
- }
1694
-
1695
- const phaseId = `${interaction.interactionId}:phase-${Math.max(interaction.phaseCounter, 1)}`;
1696
- interaction.opened = true;
1697
- interaction.sequence += 1;
1698
- const metadata: HardwareUiInteractionMeta = {
1699
- interactionId: interaction.interactionId,
1700
- phaseId,
1701
- sequence: interaction.sequence,
1702
- phase: 'processing',
1703
- transition: 'finish',
1704
- outcome: outcome ?? 'succeeded',
1705
- protocol: 'V2',
1706
- };
1707
- this.protocolV2UiInteraction = undefined;
1708
- return metadata;
1709
- }
1710
-
1711
- hasOpenProtocolV2UiInteraction() {
1712
- return this.protocolV2UiInteraction?.opened === true;
1713
- }
1714
-
1715
1530
  supportUnlockVersionRange(): DeviceFirmwareRange {
1716
1531
  // This range applies to Protocol V1 Pro devices; Pro2 has a dedicated unlock flow.
1717
1532
  return {
@@ -1721,33 +1536,10 @@ export class Device extends EventEmitter {
1721
1536
  };
1722
1537
  }
1723
1538
 
1724
- async unlockDevice(
1725
- pinType?: DeviceSessionPinType,
1726
- options?: ProtocolV2UiEventMetadata & { emitUiEvent?: boolean }
1727
- ) {
1539
+ async unlockDevice(pinType: DeviceSessionPinType = DeviceSessionPinType.Main) {
1728
1540
  if (this.isProtocolV2()) {
1729
- const requestedPinType = pinType ?? DeviceSessionPinType.Main;
1730
- const interaction =
1731
- options?.interaction ??
1732
- (options?.emitUiEvent === false
1733
- ? undefined
1734
- : this.createProtocolV2UiPhaseMetadata('pin', 'start'));
1735
- if (options?.emitUiEvent !== false) {
1736
- this.emit(DEVICE.PIN_ON_DEVICE, this, requestedPinType, {
1737
- source: options?.source ?? 'unlock-coordinator',
1738
- reason: options?.reason ?? 'device-unlock',
1739
- deviceOnly: options?.deviceOnly ?? true,
1740
- completion: options?.completion,
1741
- method: options?.method,
1742
- page: options?.page,
1743
- operation: options?.operation,
1744
- interaction: options?.interaction ?? interaction,
1745
- });
1746
- }
1747
1541
  try {
1748
- await this.commands.typedCall('DeviceSessionAskPin', 'Success', {
1749
- type: requestedPinType,
1750
- });
1542
+ await this.commands.typedCall('DeviceSessionAskPin', 'Success', { type: pinType });
1751
1543
  } catch (error) {
1752
1544
  const errorText =
1753
1545
  error instanceof Error
@@ -1759,11 +1551,6 @@ export class Device extends EventEmitter {
1759
1551
  throw error;
1760
1552
  }
1761
1553
 
1762
- const completion = interaction ? this.completeProtocolV2UiPhase(interaction) : undefined;
1763
- if (completion) {
1764
- this.emit(DEVICE.PIN_ON_DEVICE_COMPLETE, this, completion);
1765
- }
1766
-
1767
1554
  const status = await requestProtocolV2DeviceStatus({ commands: this.commands });
1768
1555
  return this.updateProtocolV2Status(status);
1769
1556
  }
@@ -1825,8 +1612,7 @@ export class Device extends EventEmitter {
1825
1612
  async checkPassphraseStateSafety(
1826
1613
  passphraseState?: string,
1827
1614
  useEmptyPassphrase?: boolean,
1828
- skipPassphraseCheck?: boolean,
1829
- deriveCardano?: boolean
1615
+ skipPassphraseCheck?: boolean
1830
1616
  ) {
1831
1617
  if (this.isUnacquired()) return false;
1832
1618
 
@@ -1835,8 +1621,6 @@ export class Device extends EventEmitter {
1835
1621
  await getPassphraseStateWithRefreshDeviceInfo(this, {
1836
1622
  expectPassphraseState: expectedPassphraseState,
1837
1623
  onlyMainPin: useEmptyPassphrase,
1838
- deriveCardano,
1839
- rejectAttachPinForMainWallet: useEmptyPassphrase === true,
1840
1624
  });
1841
1625
 
1842
1626
  // Main wallet and unlock Attach Pin, throw safe error
@@ -435,13 +435,7 @@ export class DeviceCommands {
435
435
  if (!shouldReduceDebugForCall(callType)) {
436
436
  Log.debug('_filterCommonTypes: ', {
437
437
  request: callType,
438
- response:
439
- callType === 'DeviceFirmwareUpdateStatusGet'
440
- ? {
441
- type: res.type,
442
- message: getSafeTransportLogPayload(res.message, res.type),
443
- }
444
- : res.type,
438
+ response: res.type,
445
439
  });
446
440
  }
447
441
  } catch (error) {
@@ -156,9 +156,7 @@ export class DevicePool extends EventEmitter {
156
156
  if (!device) {
157
157
  device = Device.fromDescriptor(descriptor);
158
158
  device.deviceConnector = this.connector;
159
- await device.connect(initOptions?.connectProtocol, {
160
- forceProtocolDetection: initOptions?.forceProtocolDetection,
161
- });
159
+ await device.connect(initOptions?.connectProtocol);
162
160
  try {
163
161
  await device.initialize(initOptions);
164
162
  if (initOptions?.refreshRuntimeState && device.isProtocolV2()) {
@@ -183,10 +181,7 @@ export class DevicePool extends EventEmitter {
183
181
  refreshError = error;
184
182
  }
185
183
  },
186
- {
187
- connectProtocol: initOptions.connectProtocol,
188
- forceProtocolDetection: initOptions.forceProtocolDetection,
189
- }
184
+ { connectProtocol: initOptions.connectProtocol }
190
185
  );
191
186
  if (refreshError instanceof Error) throw refreshError;
192
187
  if (refreshError) throw new Error(String(refreshError));
@@ -1,5 +1,4 @@
1
1
  import type { MessageFactoryFn } from './utils';
2
- import type { HardwareUiInteractionMeta } from './ui-request';
3
2
  import type { PROTO } from '../constants';
4
3
  import type {
5
4
  KnownDevice as Device,
@@ -27,8 +26,6 @@ export const DEVICE = {
27
26
  // onekey-transport events in protobuf format
28
27
  BUTTON: 'button',
29
28
  PIN: 'pin',
30
- PIN_ON_DEVICE: 'pin_on_device',
31
- PIN_ON_DEVICE_COMPLETE: 'pin_on_device_complete',
32
29
  PASSPHRASE: 'passphrase',
33
30
  PASSPHRASE_ON_DEVICE: 'passphrase_on_device',
34
31
  ATTACH_PIN_ON_DEVICE: 'attach_pin_on_device',
@@ -61,7 +58,6 @@ export type PassphraseRequestPayload = {
61
58
  source?: 'wallet-session-coordinator';
62
59
  reason?: 'open-wallet' | 'session-recovery';
63
60
  expectedPassphraseState?: string;
64
- interaction?: HardwareUiInteractionMeta;
65
61
  };
66
62
 
67
63
  export interface DeviceButtonRequest {
@@ -10,7 +10,6 @@ export const LogBlockEvent: Set<string> = new Set([
10
10
 
11
11
  const LogLabelMethod: Set<string> = new Set([
12
12
  'openWalletSession',
13
- 'deviceUploadNft',
14
13
  'deviceUploadWallpaper',
15
14
  'uploadPortfolio',
16
15
  'fileWrite',
@@ -1,7 +1,7 @@
1
1
  import type { Deferred } from '@onekeyfe/hd-shared';
2
2
  import type { DEVICE } from './device';
3
3
  import type { Device } from '../device/Device';
4
- import type { UiResponseCorrelation, UiResponseEvent } from './ui-response';
4
+ import type { UiResponseEvent } from './ui-response';
5
5
 
6
6
  export type UiPromiseResponse =
7
7
  | UiResponseEvent
@@ -11,6 +11,4 @@ export type UiPromise<T extends UiPromiseResponse['type']> = Deferred<
11
11
  Extract<UiPromiseResponse, { type: T }>,
12
12
  T,
13
13
  Device
14
- > & {
15
- responseCorrelation?: UiResponseCorrelation;
16
- };
14
+ >;
@@ -1,7 +1,6 @@
1
1
  import type { PROTO } from '../constants';
2
2
  import type { Device } from '../types';
3
3
  import type { DeviceButtonRequest } from './device';
4
- import type { UiResponseCorrelation } from './ui-response';
5
4
  import type { MessageFactoryFn } from './utils';
6
5
 
7
6
  export const UI_EVENT = 'UI_EVENT';
@@ -57,17 +56,6 @@ export type ProtocolV2UiEventSource =
57
56
 
58
57
  export type ProtocolV2UiCompletion = 'page-accepted' | 'operation-completed';
59
58
 
60
- export type HardwareUiInteractionMeta = {
61
- interactionId: string;
62
- phaseId: string;
63
- sequence: number;
64
- phase: 'pin' | 'passphrase' | 'passphrase-on-device' | 'button' | 'processing';
65
- transition: 'start' | 'complete' | 'finish';
66
- outcome?: 'submitted' | 'succeeded' | 'failed' | 'cancelled' | 'disconnected';
67
- protocol: 'V2';
68
- device?: Device;
69
- };
70
-
71
59
  export type ProtocolV2UiEventMetadata = {
72
60
  source?: ProtocolV2UiEventSource;
73
61
  reason?: string;
@@ -76,29 +64,12 @@ export type ProtocolV2UiEventMetadata = {
76
64
  method?: string;
77
65
  page?: string | number;
78
66
  operation?: string;
79
- interaction?: HardwareUiInteractionMeta;
80
67
  };
81
68
 
82
- export type UiRequestWindowClose =
83
- | {
84
- type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
85
- payload: HardwareUiInteractionMeta;
86
- }
87
- | {
88
- type: typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW;
89
- payload: HardwareUiInteractionMeta;
90
- }
91
- | {
92
- type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
93
- payload?: undefined;
94
- }
95
- | {
96
- type: typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW;
97
- payload?: undefined;
98
- };
99
-
100
69
  export interface UiRequestWithoutPayload {
101
70
  type:
71
+ | typeof UI_REQUEST.CLOSE_UI_WINDOW
72
+ | typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW
102
73
  | typeof UI_REQUEST.BLUETOOTH_PERMISSION
103
74
  | typeof UI_REQUEST.BLUETOOTH_UNSUPPORTED
104
75
  | typeof UI_REQUEST.BLUETOOTH_POWERED_OFF
@@ -122,7 +93,6 @@ export type UiRequestDeviceAction = {
122
93
  payload: ProtocolV2UiEventMetadata & {
123
94
  device: Device;
124
95
  type?: PROTO.PinMatrixRequestType | 'ButtonRequest_PinEntry' | 'ButtonRequest_AttachPin';
125
- responseCorrelation?: UiResponseCorrelation;
126
96
  };
127
97
  };
128
98
 
@@ -141,8 +111,6 @@ export interface UiRequestPassphrase {
141
111
  source?: 'wallet-session-coordinator';
142
112
  reason?: 'open-wallet' | 'session-recovery';
143
113
  expectedPassphraseState?: string;
144
- interaction?: HardwareUiInteractionMeta;
145
- responseCorrelation?: UiResponseCorrelation;
146
114
  };
147
115
  }
148
116
 
@@ -153,7 +121,6 @@ export interface UiRequestPassphraseOnDevice {
153
121
  passphraseState?: string;
154
122
  source?: 'wallet-session-coordinator';
155
123
  reason?: 'open-wallet' | 'session-recovery';
156
- interaction?: HardwareUiInteractionMeta;
157
124
  };
158
125
  }
159
126
 
@@ -224,7 +191,6 @@ export interface PreviousAddressResult {
224
191
 
225
192
  export type UiEvent =
226
193
  | UiRequestWithoutPayload
227
- | UiRequestWindowClose
228
194
  | UiRequestDeviceAction
229
195
  | UiRequestButton
230
196
  | UiRequestPassphraseOnDevice
@@ -11,22 +11,12 @@ export const UI_RESPONSE = {
11
11
  'ui-receive_select-device-for-switch-firmware-web-device',
12
12
  } as const;
13
13
 
14
- export interface UiResponseCorrelation {
15
- interactionId: string;
16
- deviceId: string;
17
- }
18
-
19
- export interface UiResponseCorrelationFields {
20
- interactionId?: string;
21
- deviceId?: string;
22
- }
23
-
24
- export interface UiResponsePin extends UiResponseCorrelationFields {
14
+ export interface UiResponsePin {
25
15
  type: typeof UI_RESPONSE.RECEIVE_PIN;
26
16
  payload: string;
27
17
  }
28
18
 
29
- export interface UiResponsePassphrase extends UiResponseCorrelationFields {
19
+ export interface UiResponsePassphrase {
30
20
  type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE;
31
21
  payload: {
32
22
  value: string;