@onekeyfe/hd-core 1.2.0-alpha.2 → 1.2.0-alpha.3

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 (44) hide show
  1. package/__tests__/protocol-v2.test.ts +162 -106
  2. package/dist/api/GetPassphraseState.d.ts +4 -4
  3. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  4. package/dist/api/protocol-v2/helpers.d.ts +2 -3
  5. package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
  6. package/dist/constants/index.d.ts +2 -1
  7. package/dist/constants/index.d.ts.map +1 -1
  8. package/dist/core/index.d.ts.map +1 -1
  9. package/dist/data-manager/connectSettings.d.ts.map +1 -1
  10. package/dist/device/Device.d.ts +1 -0
  11. package/dist/device/Device.d.ts.map +1 -1
  12. package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
  13. package/dist/deviceProfile/buildDeviceProfile.d.ts.map +1 -1
  14. package/dist/index.d.ts +12 -10
  15. package/dist/index.js +500 -477
  16. package/dist/protocols/protocol-v2/features.d.ts +2 -2
  17. package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
  18. package/dist/types/api/getPassphraseState.d.ts +4 -4
  19. package/dist/types/api/getPassphraseState.d.ts.map +1 -1
  20. package/dist/types/api/protocolV2.d.ts +3 -3
  21. package/dist/types/api/protocolV2.d.ts.map +1 -1
  22. package/dist/types/settings.d.ts +1 -0
  23. package/dist/types/settings.d.ts.map +1 -1
  24. package/dist/utils/deviceFeaturesUtils.d.ts +2 -0
  25. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  26. package/dist/utils/patch.d.ts +1 -1
  27. package/dist/utils/patch.d.ts.map +1 -1
  28. package/package.json +4 -4
  29. package/src/api/GetPassphraseState.ts +7 -4
  30. package/src/api/protocol-v2/DeviceReboot.ts +3 -3
  31. package/src/api/protocol-v2/helpers.ts +1 -26
  32. package/src/constants/index.ts +10 -1
  33. package/src/core/index.ts +2 -0
  34. package/src/data/messages/messages-protocol-v2.json +329 -323
  35. package/src/data-manager/connectSettings.ts +6 -0
  36. package/src/device/Device.ts +12 -1
  37. package/src/device/DevicePool.ts +6 -6
  38. package/src/deviceProfile/buildDeviceFeatures.ts +2 -1
  39. package/src/deviceProfile/buildDeviceProfile.ts +2 -3
  40. package/src/protocols/protocol-v2/features.ts +8 -7
  41. package/src/types/api/getPassphraseState.ts +4 -4
  42. package/src/types/api/protocolV2.ts +2 -3
  43. package/src/types/settings.ts +5 -0
  44. package/src/utils/deviceFeaturesUtils.ts +7 -1
package/dist/index.js CHANGED
@@ -25742,11 +25742,6 @@ var nested = {
25742
25742
  MessageType_NeoAddress: 12302,
25743
25743
  MessageType_NeoSignTx: 12303,
25744
25744
  MessageType_NeoSignedTx: 12304,
25745
- MessageType_UiviewShowAddressRequest: 30200,
25746
- MessageType_UiviewShowPublicKeyRequest: 30201,
25747
- MessageType_UiviewConfirmTxRequest: 30202,
25748
- MessageType_UiviewConfirmSignMessageRequest: 30203,
25749
- MessageType_UiviewResponse: 30204,
25750
25745
  MessageType_ReadSEPublicKey: 10004,
25751
25746
  MessageType_SEPublicKey: 10005,
25752
25747
  MessageType_WriteSEPublicCert: 10006,
@@ -25757,6 +25752,9 @@ var nested = {
25757
25752
  MessageType_ResourceUpload: 10018,
25758
25753
  MessageType_ZoomRequest: 10019,
25759
25754
  MessageType_BlurRequest: 10032,
25755
+ MessageType_SetWallpaper: 10033,
25756
+ MessageType_GetWallpaper: 10034,
25757
+ MessageType_Wallpaper: 10035,
25760
25758
  MessageType_ResourceRequest: 10020,
25761
25759
  MessageType_ResourceAck: 10021,
25762
25760
  MessageType_ResourceUpdate: 10022,
@@ -25798,13 +25796,7 @@ var nested = {
25798
25796
  MessageType_DevFirmwareUpdate: 61000,
25799
25797
  MessageType_DevFirmwareInstallProgress: 61001,
25800
25798
  MessageType_DevGetFirmwareUpdateStatus: 61002,
25801
- MessageType_DevFirmwareUpdateStatus: 61003,
25802
- MessageType_DeviceReboot: 60400,
25803
- MessageType_DeviceGetDeviceInfo: 60600,
25804
- MessageType_DeviceFirmwareUpdate: 61000,
25805
- MessageType_DeviceFirmwareInstallProgress: 61001,
25806
- MessageType_DeviceGetFirmwareUpdateStatus: 61002,
25807
- MessageType_DeviceFirmwareUpdateStatus: 61003
25799
+ MessageType_DevFirmwareUpdateStatus: 61003
25808
25800
  }
25809
25801
  },
25810
25802
  AlephiumGetAddress: {
@@ -29399,6 +29391,208 @@ var nested = {
29399
29391
  }
29400
29392
  }
29401
29393
  },
29394
+ DebugLinkInput: {
29395
+ fields: {
29396
+ x: {
29397
+ type: "uint32",
29398
+ id: 1
29399
+ },
29400
+ y: {
29401
+ type: "uint32",
29402
+ id: 2
29403
+ },
29404
+ duration_ms: {
29405
+ type: "uint32",
29406
+ id: 3
29407
+ },
29408
+ x_end: {
29409
+ type: "uint32",
29410
+ id: 4
29411
+ },
29412
+ y_end: {
29413
+ type: "uint32",
29414
+ id: 5
29415
+ }
29416
+ }
29417
+ },
29418
+ DebugLinkLayout: {
29419
+ fields: {
29420
+ lines: {
29421
+ rule: "repeated",
29422
+ type: "string",
29423
+ id: 1
29424
+ }
29425
+ }
29426
+ },
29427
+ DebugLinkReseedRandom: {
29428
+ fields: {
29429
+ value: {
29430
+ type: "uint32",
29431
+ id: 1
29432
+ }
29433
+ }
29434
+ },
29435
+ DebugLinkRecordScreen: {
29436
+ fields: {
29437
+ target_directory: {
29438
+ type: "string",
29439
+ id: 1
29440
+ }
29441
+ }
29442
+ },
29443
+ DebugLinkGetState: {
29444
+ fields: {
29445
+ wait_word_list: {
29446
+ type: "bool",
29447
+ id: 1
29448
+ },
29449
+ wait_word_pos: {
29450
+ type: "bool",
29451
+ id: 2
29452
+ },
29453
+ wait_layout: {
29454
+ type: "bool",
29455
+ id: 3
29456
+ }
29457
+ }
29458
+ },
29459
+ DebugLinkState: {
29460
+ fields: {
29461
+ layout: {
29462
+ type: "bytes",
29463
+ id: 1
29464
+ },
29465
+ pin: {
29466
+ type: "string",
29467
+ id: 2
29468
+ },
29469
+ matrix: {
29470
+ type: "string",
29471
+ id: 3
29472
+ },
29473
+ mnemonic_secret: {
29474
+ type: "bytes",
29475
+ id: 4
29476
+ },
29477
+ node: {
29478
+ type: "HDNodeType",
29479
+ id: 5
29480
+ },
29481
+ passphrase_protection: {
29482
+ type: "bool",
29483
+ id: 6
29484
+ },
29485
+ reset_word: {
29486
+ type: "string",
29487
+ id: 7
29488
+ },
29489
+ reset_entropy: {
29490
+ type: "bytes",
29491
+ id: 8
29492
+ },
29493
+ recovery_fake_word: {
29494
+ type: "string",
29495
+ id: 9
29496
+ },
29497
+ recovery_word_pos: {
29498
+ type: "uint32",
29499
+ id: 10
29500
+ },
29501
+ reset_word_pos: {
29502
+ type: "uint32",
29503
+ id: 11
29504
+ },
29505
+ mnemonic_type: {
29506
+ type: "BackupType",
29507
+ id: 12
29508
+ },
29509
+ layout_lines: {
29510
+ rule: "repeated",
29511
+ type: "string",
29512
+ id: 13
29513
+ }
29514
+ }
29515
+ },
29516
+ DebugLinkStop: {
29517
+ fields: {
29518
+ }
29519
+ },
29520
+ DebugLinkLog: {
29521
+ fields: {
29522
+ level: {
29523
+ type: "uint32",
29524
+ id: 1
29525
+ },
29526
+ bucket: {
29527
+ type: "string",
29528
+ id: 2
29529
+ },
29530
+ text: {
29531
+ type: "string",
29532
+ id: 3
29533
+ }
29534
+ }
29535
+ },
29536
+ DebugLinkMemoryRead: {
29537
+ fields: {
29538
+ address: {
29539
+ type: "uint32",
29540
+ id: 1
29541
+ },
29542
+ length: {
29543
+ type: "uint32",
29544
+ id: 2
29545
+ }
29546
+ }
29547
+ },
29548
+ DebugLinkMemory: {
29549
+ fields: {
29550
+ memory: {
29551
+ type: "bytes",
29552
+ id: 1
29553
+ }
29554
+ }
29555
+ },
29556
+ DebugLinkMemoryWrite: {
29557
+ fields: {
29558
+ address: {
29559
+ type: "uint32",
29560
+ id: 1
29561
+ },
29562
+ memory: {
29563
+ type: "bytes",
29564
+ id: 2
29565
+ },
29566
+ flash: {
29567
+ type: "bool",
29568
+ id: 3
29569
+ }
29570
+ }
29571
+ },
29572
+ DebugLinkFlashErase: {
29573
+ fields: {
29574
+ sector: {
29575
+ type: "uint32",
29576
+ id: 1
29577
+ }
29578
+ }
29579
+ },
29580
+ DebugLinkEraseSdCard: {
29581
+ fields: {
29582
+ format: {
29583
+ type: "bool",
29584
+ id: 1
29585
+ }
29586
+ }
29587
+ },
29588
+ DebugLinkWatchLayout: {
29589
+ fields: {
29590
+ watch: {
29591
+ type: "bool",
29592
+ id: 1
29593
+ }
29594
+ }
29595
+ },
29402
29596
  EosGetPublicKey: {
29403
29597
  fields: {
29404
29598
  address_n: {
@@ -31232,6 +31426,30 @@ var nested = {
31232
31426
  }
31233
31427
  }
31234
31428
  },
31429
+ InternalMyAddressRequest: {
31430
+ fields: {
31431
+ coin_type: {
31432
+ rule: "required",
31433
+ type: "uint32",
31434
+ id: 1
31435
+ },
31436
+ chain_id: {
31437
+ rule: "required",
31438
+ type: "uint32",
31439
+ id: 2
31440
+ },
31441
+ account_index: {
31442
+ rule: "required",
31443
+ type: "uint32",
31444
+ id: 3
31445
+ },
31446
+ derive_type: {
31447
+ rule: "required",
31448
+ type: "uint32",
31449
+ id: 4
31450
+ }
31451
+ }
31452
+ },
31235
31453
  KaspaGetAddress: {
31236
31454
  fields: {
31237
31455
  address_n: {
@@ -32576,6 +32794,49 @@ var nested = {
32576
32794
  }
32577
32795
  }
32578
32796
  },
32797
+ WallpaperTarget: {
32798
+ values: {
32799
+ Home: 0,
32800
+ Lock: 1
32801
+ }
32802
+ },
32803
+ SetWallpaper: {
32804
+ fields: {
32805
+ target: {
32806
+ rule: "required",
32807
+ type: "WallpaperTarget",
32808
+ id: 1
32809
+ },
32810
+ path: {
32811
+ rule: "required",
32812
+ type: "string",
32813
+ id: 2
32814
+ }
32815
+ }
32816
+ },
32817
+ GetWallpaper: {
32818
+ fields: {
32819
+ target: {
32820
+ rule: "required",
32821
+ type: "WallpaperTarget",
32822
+ id: 1
32823
+ }
32824
+ }
32825
+ },
32826
+ Wallpaper: {
32827
+ fields: {
32828
+ target: {
32829
+ rule: "required",
32830
+ type: "WallpaperTarget",
32831
+ id: 1
32832
+ },
32833
+ path: {
32834
+ rule: "required",
32835
+ type: "string",
32836
+ id: 2
32837
+ }
32838
+ }
32839
+ },
32579
32840
  ResourceUpdate: {
32580
32841
  fields: {
32581
32842
  file_name: {
@@ -34664,210 +34925,30 @@ var nested = {
34664
34925
  },
34665
34926
  RippleGetAddress: {
34666
34927
  fields: {
34667
- address_n: {
34668
- rule: "repeated",
34669
- type: "uint32",
34670
- id: 1,
34671
- options: {
34672
- packed: false
34673
- }
34674
- },
34675
- show_display: {
34676
- type: "bool",
34677
- id: 2
34678
- }
34679
- }
34680
- },
34681
- RippleAddress: {
34682
- fields: {
34683
- address: {
34684
- rule: "required",
34685
- type: "string",
34686
- id: 1
34687
- }
34688
- }
34689
- },
34690
- RippleSignTx: {
34691
- fields: {
34692
- address_n: {
34693
- rule: "repeated",
34694
- type: "uint32",
34695
- id: 1,
34696
- options: {
34697
- packed: false
34698
- }
34699
- },
34700
- fee: {
34701
- rule: "required",
34702
- type: "uint64",
34703
- id: 2
34704
- },
34705
- flags: {
34706
- type: "uint32",
34707
- id: 3,
34708
- options: {
34709
- "default": 0
34710
- }
34711
- },
34712
- sequence: {
34713
- rule: "required",
34714
- type: "uint32",
34715
- id: 4
34716
- },
34717
- last_ledger_sequence: {
34718
- type: "uint32",
34719
- id: 5
34720
- },
34721
- payment: {
34722
- rule: "required",
34723
- type: "RipplePayment",
34724
- id: 6
34725
- }
34726
- },
34727
- nested: {
34728
- RipplePayment: {
34729
- fields: {
34730
- amount: {
34731
- rule: "required",
34732
- type: "uint64",
34733
- id: 1
34734
- },
34735
- destination: {
34736
- rule: "required",
34737
- type: "string",
34738
- id: 2
34739
- },
34740
- destination_tag: {
34741
- type: "uint32",
34742
- id: 3
34743
- }
34744
- }
34745
- }
34746
- }
34747
- },
34748
- RippleSignedTx: {
34749
- fields: {
34750
- signature: {
34751
- rule: "required",
34752
- type: "bytes",
34753
- id: 1
34754
- },
34755
- serialized_tx: {
34756
- rule: "required",
34757
- type: "bytes",
34758
- id: 2
34759
- }
34760
- }
34761
- },
34762
- ScdoGetAddress: {
34763
- fields: {
34764
- address_n: {
34765
- rule: "repeated",
34766
- type: "uint32",
34767
- id: 1,
34768
- options: {
34769
- packed: false
34770
- }
34771
- },
34772
- show_display: {
34773
- type: "bool",
34774
- id: 2
34775
- }
34776
- }
34777
- },
34778
- ScdoAddress: {
34779
- fields: {
34780
- address: {
34781
- rule: "required",
34782
- type: "string",
34783
- id: 1
34784
- }
34785
- }
34786
- },
34787
- ScdoSignTx: {
34788
- fields: {
34789
- address_n: {
34790
- rule: "repeated",
34791
- type: "uint32",
34792
- id: 1,
34793
- options: {
34794
- packed: false
34795
- }
34796
- },
34797
- nonce: {
34798
- rule: "required",
34799
- type: "bytes",
34800
- id: 2
34801
- },
34802
- gas_price: {
34803
- rule: "required",
34804
- type: "bytes",
34805
- id: 3
34806
- },
34807
- gas_limit: {
34808
- rule: "required",
34809
- type: "bytes",
34810
- id: 4
34811
- },
34812
- to: {
34813
- rule: "required",
34814
- type: "string",
34815
- id: 5
34816
- },
34817
- value: {
34818
- rule: "required",
34819
- type: "bytes",
34820
- id: 6
34821
- },
34822
- timestamp: {
34823
- rule: "required",
34824
- type: "bytes",
34825
- id: 7
34826
- },
34827
- data_initial_chunk: {
34828
- type: "bytes",
34829
- id: 8,
34830
- options: {
34831
- "default": ""
34832
- }
34833
- },
34834
- data_length: {
34835
- type: "uint32",
34836
- id: 9,
34837
- options: {
34838
- "default": 0
34839
- }
34840
- },
34841
- tx_type: {
34842
- type: "uint32",
34843
- id: 10,
34844
- options: {
34845
- "default": 0
34846
- }
34847
- }
34848
- }
34849
- },
34850
- ScdoSignedTx: {
34851
- fields: {
34852
- data_length: {
34928
+ address_n: {
34929
+ rule: "repeated",
34853
34930
  type: "uint32",
34854
- id: 1
34931
+ id: 1,
34932
+ options: {
34933
+ packed: false
34934
+ }
34855
34935
  },
34856
- signature: {
34857
- type: "bytes",
34936
+ show_display: {
34937
+ type: "bool",
34858
34938
  id: 2
34859
34939
  }
34860
34940
  }
34861
34941
  },
34862
- ScdoTxAck: {
34942
+ RippleAddress: {
34863
34943
  fields: {
34864
- data_chunk: {
34865
- type: "bytes",
34944
+ address: {
34945
+ rule: "required",
34946
+ type: "string",
34866
34947
  id: 1
34867
34948
  }
34868
34949
  }
34869
34950
  },
34870
- ScdoSignMessage: {
34951
+ RippleSignTx: {
34871
34952
  fields: {
34872
34953
  address_n: {
34873
34954
  rule: "repeated",
@@ -34877,20 +34958,64 @@ var nested = {
34877
34958
  packed: false
34878
34959
  }
34879
34960
  },
34880
- message: {
34881
- type: "bytes",
34961
+ fee: {
34962
+ rule: "required",
34963
+ type: "uint64",
34882
34964
  id: 2
34965
+ },
34966
+ flags: {
34967
+ type: "uint32",
34968
+ id: 3,
34969
+ options: {
34970
+ "default": 0
34971
+ }
34972
+ },
34973
+ sequence: {
34974
+ rule: "required",
34975
+ type: "uint32",
34976
+ id: 4
34977
+ },
34978
+ last_ledger_sequence: {
34979
+ type: "uint32",
34980
+ id: 5
34981
+ },
34982
+ payment: {
34983
+ rule: "required",
34984
+ type: "RipplePayment",
34985
+ id: 6
34986
+ }
34987
+ },
34988
+ nested: {
34989
+ RipplePayment: {
34990
+ fields: {
34991
+ amount: {
34992
+ rule: "required",
34993
+ type: "uint64",
34994
+ id: 1
34995
+ },
34996
+ destination: {
34997
+ rule: "required",
34998
+ type: "string",
34999
+ id: 2
35000
+ },
35001
+ destination_tag: {
35002
+ type: "uint32",
35003
+ id: 3
35004
+ }
35005
+ }
34883
35006
  }
34884
35007
  }
34885
35008
  },
34886
- ScdoSignedMessage: {
35009
+ RippleSignedTx: {
34887
35010
  fields: {
34888
35011
  signature: {
35012
+ rule: "required",
34889
35013
  type: "bytes",
34890
35014
  id: 1
34891
35015
  },
34892
- address: {
34893
- type: "string",
35016
+ serialized_tx: {
35017
+ rule: "required",
35018
+ type: "bytes",
34894
35019
  id: 2
34895
35020
  }
34896
35021
  }
@@ -36863,114 +36988,105 @@ var nested = {
36863
36988
  }
36864
36989
  }
36865
36990
  },
36866
- TxDetailsAmount: {
36991
+ ViewAmount: {
36867
36992
  fields: {
36868
- num: {
36993
+ is_unlimited: {
36869
36994
  rule: "required",
36870
- type: "string",
36995
+ type: "bool",
36871
36996
  id: 1
36872
36997
  },
36873
- decimals: {
36874
- rule: "required",
36875
- type: "uint32",
36876
- id: 2
36877
- },
36878
- symbol: {
36998
+ num: {
36879
36999
  rule: "required",
36880
37000
  type: "string",
36881
- id: 3
37001
+ id: 2
36882
37002
  }
36883
37003
  }
36884
37004
  },
36885
- TxDetailsAddress: {
37005
+ ViewDetail: {
36886
37006
  fields: {
36887
37007
  key: {
36888
37008
  rule: "required",
36889
37009
  type: "uint32",
36890
37010
  id: 1
36891
37011
  },
36892
- address: {
37012
+ value: {
36893
37013
  rule: "required",
36894
37014
  type: "string",
36895
37015
  id: 2
36896
37016
  },
36897
- owner: {
36898
- type: "string",
37017
+ is_overview: {
37018
+ rule: "required",
37019
+ type: "bool",
36899
37020
  id: 3
36900
37021
  },
36901
- icon: {
36902
- type: "string",
37022
+ has_icon: {
37023
+ rule: "required",
37024
+ type: "bool",
36903
37025
  id: 4
36904
37026
  }
36905
37027
  }
36906
37028
  },
36907
- TxDetailsNetwork: {
37029
+ ViewTipType: {
37030
+ values: {
37031
+ Default: 0,
37032
+ Highlight: 1,
37033
+ Recommend: 2,
37034
+ Warning: 3,
37035
+ Danger: 4
37036
+ }
37037
+ },
37038
+ ViewTip: {
36908
37039
  fields: {
36909
- coin_type: {
37040
+ type: {
36910
37041
  rule: "required",
36911
- type: "uint64",
37042
+ type: "ViewTipType",
36912
37043
  id: 1
36913
37044
  },
36914
- chain_id: {
36915
- type: "uint64",
37045
+ text: {
37046
+ rule: "required",
37047
+ type: "string",
36916
37048
  id: 2
36917
37049
  }
36918
37050
  }
36919
37051
  },
36920
- TxDetailsGeneral: {
37052
+ ViewSignPage: {
36921
37053
  fields: {
36922
- key: {
37054
+ title: {
36923
37055
  rule: "required",
36924
- type: "uint32",
37056
+ type: "string",
36925
37057
  id: 1
36926
37058
  },
36927
- value: {
36928
- rule: "required",
36929
- type: "string",
37059
+ amount: {
37060
+ type: "ViewAmount",
36930
37061
  id: 2
36931
37062
  },
36932
- is_overview: {
36933
- rule: "required",
36934
- type: "bool",
37063
+ general: {
37064
+ rule: "repeated",
37065
+ type: "ViewDetail",
36935
37066
  id: 3
37067
+ },
37068
+ tip: {
37069
+ type: "ViewTip",
37070
+ id: 4
36936
37071
  }
36937
37072
  }
36938
37073
  },
36939
- TxDetailsDisplayType: {
36940
- values: {
36941
- DISPLAY_TYPE_INFO: 0,
36942
- DISPLAY_TYPE_SIGN: 1
36943
- }
36944
- },
36945
- TxDetailsPage: {
37074
+ ViewVerifyPage: {
36946
37075
  fields: {
36947
37076
  title: {
36948
37077
  rule: "required",
36949
37078
  type: "string",
36950
37079
  id: 1
36951
37080
  },
36952
- display_type: {
37081
+ address: {
36953
37082
  rule: "required",
36954
- type: "TxDetailsDisplayType",
37083
+ type: "string",
36955
37084
  id: 2
36956
37085
  },
36957
- amount: {
36958
- type: "TxDetailsAmount",
37086
+ path: {
37087
+ rule: "required",
37088
+ type: "string",
36959
37089
  id: 3
36960
- },
36961
- network: {
36962
- type: "TxDetailsNetwork",
36963
- id: 4
36964
- },
36965
- address: {
36966
- rule: "repeated",
36967
- type: "TxDetailsAddress",
36968
- id: 5
36969
- },
36970
- general: {
36971
- rule: "repeated",
36972
- type: "TxDetailsGeneral",
36973
- id: 6
36974
37090
  }
36975
37091
  }
36976
37092
  },
@@ -37286,6 +37402,10 @@ var nested = {
37286
37402
  type: "string",
37287
37403
  id: 11
37288
37404
  },
37405
+ device_id: {
37406
+ type: "string",
37407
+ id: 12
37408
+ },
37289
37409
  hardware_version: {
37290
37410
  type: "string",
37291
37411
  id: 100
@@ -37491,16 +37611,13 @@ var nested = {
37491
37611
  },
37492
37612
  DevFirmwareTargetType: {
37493
37613
  values: {
37494
- TARGET_INVALID: 0,
37495
- TARGET_ROMLOADER: 1,
37496
- TARGET_BOOTLOADER: 2,
37497
- TARGET_APPLICATION_P1: 3,
37498
- TARGET_APPLICATION_P2: 4,
37499
- TARGET_COPROCESSOR: 5,
37500
- TARGET_SE01: 6,
37501
- TARGET_SE02: 7,
37502
- TARGET_SE03: 8,
37503
- TARGET_SE04: 9,
37614
+ TARGET_MAIN_APP: 0,
37615
+ TARGET_MAIN_BOOT: 1,
37616
+ TARGET_BT: 2,
37617
+ TARGET_SE1: 3,
37618
+ TARGET_SE2: 4,
37619
+ TARGET_SE3: 5,
37620
+ TARGET_SE4: 6,
37504
37621
  TARGET_RESOURCE: 10
37505
37622
  }
37506
37623
  },
@@ -38641,117 +38758,6 @@ var nested = {
38641
38758
  }
38642
38759
  }
38643
38760
  }
38644
- },
38645
- DeviceRebootType: {
38646
- values: {
38647
- Normal: 0,
38648
- Romloader: 1,
38649
- Bootloader: 2
38650
- }
38651
- },
38652
- DeviceReboot: {
38653
- fields: {
38654
- reboot_type: {
38655
- rule: "required",
38656
- type: "DeviceRebootType",
38657
- id: 1
38658
- }
38659
- }
38660
- },
38661
- DeviceGetDeviceInfo: {
38662
- fields: {
38663
- targets: {
38664
- type: "DevInfoTargets",
38665
- id: 1
38666
- },
38667
- types: {
38668
- type: "DevInfoTypes",
38669
- id: 2
38670
- }
38671
- }
38672
- },
38673
- DeviceFirmwareTargetType: {
38674
- values: {
38675
- TARGET_INVALID: 0,
38676
- TARGET_ROMLOADER: 1,
38677
- TARGET_BOOTLOADER: 2,
38678
- TARGET_APPLICATION_P1: 3,
38679
- TARGET_APPLICATION_P2: 4,
38680
- TARGET_COPROCESSOR: 5,
38681
- TARGET_SE01: 6,
38682
- TARGET_SE02: 7,
38683
- TARGET_SE03: 8,
38684
- TARGET_SE04: 9,
38685
- TARGET_RESOURCE: 10
38686
- }
38687
- },
38688
- DeviceFirmwareTarget: {
38689
- fields: {
38690
- target_id: {
38691
- rule: "required",
38692
- type: "DeviceFirmwareTargetType",
38693
- id: 1
38694
- },
38695
- path: {
38696
- rule: "required",
38697
- type: "string",
38698
- id: 2
38699
- }
38700
- }
38701
- },
38702
- DeviceFirmwareUpdate: {
38703
- fields: {
38704
- targets: {
38705
- rule: "repeated",
38706
- type: "DeviceFirmwareTarget",
38707
- id: 1
38708
- }
38709
- }
38710
- },
38711
- DeviceFirmwareInstallProgress: {
38712
- fields: {
38713
- target_id: {
38714
- rule: "required",
38715
- type: "DeviceFirmwareTargetType",
38716
- id: 1
38717
- },
38718
- progress: {
38719
- rule: "required",
38720
- type: "uint32",
38721
- id: 2
38722
- },
38723
- stage: {
38724
- type: "string",
38725
- id: 3
38726
- }
38727
- }
38728
- },
38729
- DeviceFirmwareUpdateStatusEntry: {
38730
- fields: {
38731
- target_id: {
38732
- rule: "required",
38733
- type: "DeviceFirmwareTargetType",
38734
- id: 1
38735
- },
38736
- status: {
38737
- rule: "required",
38738
- type: "uint32",
38739
- id: 2
38740
- }
38741
- }
38742
- },
38743
- DeviceGetFirmwareUpdateStatus: {
38744
- fields: {
38745
- }
38746
- },
38747
- DeviceFirmwareUpdateStatus: {
38748
- fields: {
38749
- targets: {
38750
- rule: "repeated",
38751
- type: "DeviceFirmwareUpdateStatusEntry",
38752
- id: 1
38753
- }
38754
- }
38755
38761
  }
38756
38762
  };
38757
38763
  var MessagesProtocolV2JSON = {
@@ -39205,6 +39211,9 @@ const getPassphraseStateWithRefreshDeviceInfo = (device, options) => __awaiter(v
39205
39211
  const { features } = device;
39206
39212
  const locked = (features === null || features === void 0 ? void 0 : features.unlocked) === false;
39207
39213
  const deviceType = device.getCurrentDeviceType();
39214
+ if (options === null || options === void 0 ? void 0 : options.initSession) {
39215
+ device.clearInternalState();
39216
+ }
39208
39217
  const { passphraseState, newSession, unlockedAttachPin } = yield getPassphraseState(device, Object.assign({}, options));
39209
39218
  const isModeT = deviceType === hdShared.EDeviceType.Touch ||
39210
39219
  deviceType === hdShared.EDeviceType.Pro ||
@@ -39215,7 +39224,7 @@ const getPassphraseStateWithRefreshDeviceInfo = (device, options) => __awaiter(v
39215
39224
  yield device.getFeatures();
39216
39225
  }
39217
39226
  const deviceId = device.getCurrentDeviceId();
39218
- device.updateInternalState((_a = device.getCurrentPassphraseProtection()) !== null && _a !== void 0 ? _a : false, passphraseState, deviceId, newSession, (_b = device.features) === null || _b === void 0 ? void 0 : _b.sessionId);
39227
+ device.updateInternalState((_a = device.getCurrentPassphraseProtection()) !== null && _a !== void 0 ? _a : false, passphraseState, deviceId, newSession, (options === null || options === void 0 ? void 0 : options.initSession) ? null : (_b = device.features) === null || _b === void 0 ? void 0 : _b.sessionId);
39219
39228
  return { passphraseState, newSession, unlockedAttachPin };
39220
39229
  });
39221
39230
  const supportProSeriesAttachPinPassphrase = (deviceType, firmwareVersion) => deviceType === hdShared.EDeviceType.Pro && semver__default["default"].gte(firmwareVersion, '4.15.0');
@@ -39382,6 +39391,7 @@ const initialSettings = {
39382
39391
  env: 'web',
39383
39392
  lazyLoad: false,
39384
39393
  timestamp: new Date().getTime(),
39394
+ protocolV2DeviceInfoMockEnabled: false,
39385
39395
  };
39386
39396
  const getEnv = () => {
39387
39397
  if (typeof chrome !== 'undefined' &&
@@ -39455,6 +39465,9 @@ const parseConnectSettings = (input = {}) => {
39455
39465
  if (input.fetchConfig) {
39456
39466
  settings.fetchConfig = input.fetchConfig;
39457
39467
  }
39468
+ if (typeof input.protocolV2DeviceInfoMockEnabled === 'boolean') {
39469
+ settings.protocolV2DeviceInfoMockEnabled = input.protocolV2DeviceInfoMockEnabled;
39470
+ }
39458
39471
  return settings;
39459
39472
  };
39460
39473
 
@@ -40212,14 +40225,14 @@ class DevicePool extends events.exports {
40212
40225
  _a = false;
40213
40226
  const descriptor = _d;
40214
40227
  const device = yield this._createDevice(descriptor, initOptions);
40215
- const uuid = device.getCurrentSerialNo();
40216
- if (uuid) {
40217
- if (this.devicesCache[uuid]) {
40218
- const cache = this.devicesCache[uuid];
40228
+ const connectId = device.getConnectId();
40229
+ if (connectId) {
40230
+ if (this.devicesCache[connectId]) {
40231
+ const cache = this.devicesCache[connectId];
40219
40232
  cache.updateDescriptor(descriptor, true);
40220
40233
  }
40221
- this.devicesCache[uuid] = device;
40222
- devices[uuid] = device;
40234
+ this.devicesCache[connectId] = device;
40235
+ devices[connectId] = device;
40223
40236
  }
40224
40237
  deviceList.push(device);
40225
40238
  }
@@ -41099,6 +41112,11 @@ const PROTOCOL_V2_FULL_DEVICE_INFO_REQUEST = {
41099
41112
  };
41100
41113
  const PROTOCOL_V2_DEVICE_INFO_REQUEST = PROTOCOL_V2_FULL_DEVICE_INFO_REQUEST;
41101
41114
  const PROTOCOL_V2_DEVICE_INFO_TIMEOUT_MS = 10 * 1000;
41115
+ let protocolV2DeviceInfoMockEnabled = false;
41116
+ const setProtocolV2DeviceInfoMock = (enabled) => {
41117
+ protocolV2DeviceInfoMockEnabled = enabled;
41118
+ };
41119
+ const isProtocolV2DeviceInfoMockEnabled = () => protocolV2DeviceInfoMockEnabled;
41102
41120
  const buildMockProtocolV2DeviceInfo = () => ({
41103
41121
  protocol_version: 2,
41104
41122
  hw: {
@@ -41117,9 +41135,13 @@ const buildMockProtocolV2DeviceInfo = () => ({
41117
41135
  });
41118
41136
  function requestProtocolV2DeviceInfo({ commands, timeoutMs = PROTOCOL_V2_DEVICE_INFO_TIMEOUT_MS, request = PROTOCOL_V2_FEATURES_DEVICE_INFO_REQUEST, }) {
41119
41137
  return __awaiter(this, void 0, void 0, function* () {
41120
- {
41138
+ if (isProtocolV2DeviceInfoMockEnabled()) {
41121
41139
  return buildMockProtocolV2DeviceInfo();
41122
41140
  }
41141
+ const { message } = yield commands.typedCall('DevGetDeviceInfo', 'DeviceInfo', request, {
41142
+ timeoutMs,
41143
+ });
41144
+ return message;
41123
41145
  });
41124
41146
  }
41125
41147
 
@@ -41302,12 +41324,14 @@ function buildProfileFromProtocolV1({ protocol = 'V1', features, protocolV1OneKe
41302
41324
  : {}));
41303
41325
  }
41304
41326
  function buildProfileFromProtocolV2({ deviceInfo, sources = ['deviceInfo'], scope = 'basic', includeRaw = false, }) {
41305
- var _a, _b, _c, _d, _e;
41306
- const serialNo = ((_a = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.hw) === null || _a === void 0 ? void 0 : _a.serial_no) || '';
41307
- const label = (_c = (_b = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : null;
41308
- const bleName = (_e = (_d = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.bt) === null || _d === void 0 ? void 0 : _d.adv_name) !== null && _e !== void 0 ? _e : null;
41327
+ var _a, _b, _c, _d, _e, _f;
41328
+ const deviceId = ((_a = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.hw) === null || _a === void 0 ? void 0 : _a.device_id) || '';
41329
+ const serialNo = ((_b = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.hw) === null || _b === void 0 ? void 0 : _b.serial_no) || '';
41330
+ const label = (_d = (_c = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : null;
41331
+ const bleName = (_f = (_e = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.bt) === null || _e === void 0 ? void 0 : _e.adv_name) !== null && _f !== void 0 ? _f : null;
41309
41332
  const verify = normalizeV2Verify(deviceInfo);
41310
- return Object.assign(Object.assign({ protocol: 'V2', sources, deviceType: hdShared.EDeviceType.Pro2, firmwareType: hdShared.EFirmwareType.Universal, deviceId: '', serialNo,
41333
+ return Object.assign(Object.assign({ protocol: 'V2', sources, deviceType: hdShared.EDeviceType.Pro2, firmwareType: hdShared.EFirmwareType.Universal, deviceId,
41334
+ serialNo,
41311
41335
  label,
41312
41336
  bleName, status: normalizeV2Status(deviceInfo), versions: normalizeV2Versions(deviceInfo) }, (shouldIncludeVerify(scope) ? { verify } : {})), (includeRaw
41313
41337
  ? {
@@ -41494,7 +41518,7 @@ const buildProtocolV1FeaturesPayload = (protocolV1Features, previous) => {
41494
41518
  };
41495
41519
  };
41496
41520
  const buildProtocolV2FeaturesPayload = (deviceInfo, previous) => {
41497
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77;
41521
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79;
41498
41522
  const info = deviceInfo;
41499
41523
  const fwApplication = firstValue((_a = info === null || info === void 0 ? void 0 : info.fw) === null || _a === void 0 ? void 0 : _a.application, (_b = info === null || info === void 0 ? void 0 : info.fw) === null || _b === void 0 ? void 0 : _b.app);
41500
41524
  const fwBootloader = firstValue((_c = info === null || info === void 0 ? void 0 : info.fw) === null || _c === void 0 ? void 0 : _c.bootloader, (_d = info === null || info === void 0 ? void 0 : info.fw) === null || _d === void 0 ? void 0 : _d.boot);
@@ -41504,22 +41528,23 @@ const buildProtocolV2FeaturesPayload = (deviceInfo, previous) => {
41504
41528
  const bootloaderVersion = firstMeaningfulVersion(getImageVersion(fwBootloader), previous === null || previous === void 0 ? void 0 : previous.bootloaderVersion);
41505
41529
  const boardVersion = firstMeaningfulVersion(getImageVersion(fwBoard), previous === null || previous === void 0 ? void 0 : previous.boardVersion);
41506
41530
  const bleVersion = firstMeaningfulVersion(getImageVersion(bleApplication), previous === null || previous === void 0 ? void 0 : previous.bleVersion);
41507
- const serialNo = (_k = firstValue((_j = info === null || info === void 0 ? void 0 : info.hw) === null || _j === void 0 ? void 0 : _j.serial_no, previous === null || previous === void 0 ? void 0 : previous.serialNo)) !== null && _k !== void 0 ? _k : '';
41508
- const label = (_m = firstValue((_l = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _l === void 0 ? void 0 : _l.label, previous === null || previous === void 0 ? void 0 : previous.label)) !== null && _m !== void 0 ? _m : null;
41509
- const bleName = firstValue((_o = info === null || info === void 0 ? void 0 : info.coprocessor) === null || _o === void 0 ? void 0 : _o.bt_adv_name, (_p = info === null || info === void 0 ? void 0 : info.bt) === null || _p === void 0 ? void 0 : _p.adv_name, previous === null || previous === void 0 ? void 0 : previous.bleName);
41510
- const initialized = (_r = firstValue((_q = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _q === void 0 ? void 0 : _q.init_states, previous === null || previous === void 0 ? void 0 : previous.initialized)) !== null && _r !== void 0 ? _r : null;
41511
- const passphraseProtection = (_t = firstValue((_s = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _s === void 0 ? void 0 : _s.passphrase_protection, previous === null || previous === void 0 ? void 0 : previous.passphraseProtection)) !== null && _t !== void 0 ? _t : null;
41512
- const language = (_v = firstValue((_u = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _u === void 0 ? void 0 : _u.language, previous === null || previous === void 0 ? void 0 : previous.language)) !== null && _v !== void 0 ? _v : null;
41513
- const backupRequired = (_x = firstValue((_w = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _w === void 0 ? void 0 : _w.backup_required, previous === null || previous === void 0 ? void 0 : previous.backupRequired)) !== null && _x !== void 0 ? _x : null;
41514
- const bleEnabled = firstValue((_y = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _y === void 0 ? void 0 : _y.bt_enable, previous === null || previous === void 0 ? void 0 : previous.bleEnabled);
41531
+ const deviceId = (_k = firstValue((_j = info === null || info === void 0 ? void 0 : info.hw) === null || _j === void 0 ? void 0 : _j.device_id, previous === null || previous === void 0 ? void 0 : previous.deviceId)) !== null && _k !== void 0 ? _k : null;
41532
+ const serialNo = (_m = firstValue((_l = info === null || info === void 0 ? void 0 : info.hw) === null || _l === void 0 ? void 0 : _l.serial_no, previous === null || previous === void 0 ? void 0 : previous.serialNo)) !== null && _m !== void 0 ? _m : '';
41533
+ const label = (_p = firstValue((_o = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _o === void 0 ? void 0 : _o.label, previous === null || previous === void 0 ? void 0 : previous.label)) !== null && _p !== void 0 ? _p : null;
41534
+ const bleName = firstValue((_q = info === null || info === void 0 ? void 0 : info.coprocessor) === null || _q === void 0 ? void 0 : _q.bt_adv_name, (_r = info === null || info === void 0 ? void 0 : info.bt) === null || _r === void 0 ? void 0 : _r.adv_name, previous === null || previous === void 0 ? void 0 : previous.bleName);
41535
+ const initialized = (_t = firstValue((_s = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _s === void 0 ? void 0 : _s.init_states, previous === null || previous === void 0 ? void 0 : previous.initialized)) !== null && _t !== void 0 ? _t : null;
41536
+ const passphraseProtection = (_v = firstValue((_u = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _u === void 0 ? void 0 : _u.passphrase_protection, previous === null || previous === void 0 ? void 0 : previous.passphraseProtection)) !== null && _v !== void 0 ? _v : null;
41537
+ const language = (_x = firstValue((_w = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _w === void 0 ? void 0 : _w.language, previous === null || previous === void 0 ? void 0 : previous.language)) !== null && _x !== void 0 ? _x : null;
41538
+ const backupRequired = (_z = firstValue((_y = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _y === void 0 ? void 0 : _y.backup_required, previous === null || previous === void 0 ? void 0 : previous.backupRequired)) !== null && _z !== void 0 ? _z : null;
41539
+ const bleEnabled = firstValue((_0 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.status) === null || _0 === void 0 ? void 0 : _0.bt_enable, previous === null || previous === void 0 ? void 0 : previous.bleEnabled);
41515
41540
  return {
41516
41541
  protocol: 'V2',
41517
- protocolVersion: (_0 = (_z = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.protocol_version) !== null && _z !== void 0 ? _z : previous === null || previous === void 0 ? void 0 : previous.protocolVersion) !== null && _0 !== void 0 ? _0 : null,
41542
+ protocolVersion: (_2 = (_1 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.protocol_version) !== null && _1 !== void 0 ? _1 : previous === null || previous === void 0 ? void 0 : previous.protocolVersion) !== null && _2 !== void 0 ? _2 : null,
41518
41543
  deviceType: hdShared.EDeviceType.Pro2,
41519
- firmwareType: (_1 = previous === null || previous === void 0 ? void 0 : previous.firmwareType) !== null && _1 !== void 0 ? _1 : hdShared.EFirmwareType.Universal,
41544
+ firmwareType: (_3 = previous === null || previous === void 0 ? void 0 : previous.firmwareType) !== null && _3 !== void 0 ? _3 : hdShared.EFirmwareType.Universal,
41520
41545
  model: 'pro2',
41521
41546
  vendor: 'onekey.so',
41522
- deviceId: null,
41547
+ deviceId,
41523
41548
  serialNo,
41524
41549
  label,
41525
41550
  bleName: bleName !== null && bleName !== void 0 ? bleName : null,
@@ -41527,8 +41552,8 @@ const buildProtocolV2FeaturesPayload = (deviceInfo, previous) => {
41527
41552
  mode: initialized === false ? 'notInitialized' : initialized === true ? 'normal' : 'unknown',
41528
41553
  initialized,
41529
41554
  bootloaderMode: false,
41530
- unlocked: (_2 = previous === null || previous === void 0 ? void 0 : previous.unlocked) !== null && _2 !== void 0 ? _2 : null,
41531
- firmwarePresent: (_3 = previous === null || previous === void 0 ? void 0 : previous.firmwarePresent) !== null && _3 !== void 0 ? _3 : null,
41555
+ unlocked: (_4 = previous === null || previous === void 0 ? void 0 : previous.unlocked) !== null && _4 !== void 0 ? _4 : null,
41556
+ firmwarePresent: (_5 = previous === null || previous === void 0 ? void 0 : previous.firmwarePresent) !== null && _5 !== void 0 ? _5 : null,
41532
41557
  passphraseProtection,
41533
41558
  pinProtection: null,
41534
41559
  backupRequired,
@@ -41549,42 +41574,42 @@ const buildProtocolV2FeaturesPayload = (deviceInfo, previous) => {
41549
41574
  bootloaderVersion,
41550
41575
  boardVersion,
41551
41576
  bleVersion,
41552
- se01Version: firstMeaningfulVersion(getImageVersion((_4 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _4 === void 0 ? void 0 : _4.app), previous === null || previous === void 0 ? void 0 : previous.se01Version),
41553
- se02Version: firstMeaningfulVersion(getImageVersion((_5 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _5 === void 0 ? void 0 : _5.app), previous === null || previous === void 0 ? void 0 : previous.se02Version),
41554
- se03Version: firstMeaningfulVersion(getImageVersion((_6 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _6 === void 0 ? void 0 : _6.app), previous === null || previous === void 0 ? void 0 : previous.se03Version),
41555
- se04Version: firstMeaningfulVersion(getImageVersion((_7 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _7 === void 0 ? void 0 : _7.app), previous === null || previous === void 0 ? void 0 : previous.se04Version),
41556
- se01BootVersion: firstMeaningfulVersion(getImageVersion((_8 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _8 === void 0 ? void 0 : _8.boot), previous === null || previous === void 0 ? void 0 : previous.se01BootVersion),
41557
- se02BootVersion: firstMeaningfulVersion(getImageVersion((_9 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _9 === void 0 ? void 0 : _9.boot), previous === null || previous === void 0 ? void 0 : previous.se02BootVersion),
41558
- se03BootVersion: firstMeaningfulVersion(getImageVersion((_10 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _10 === void 0 ? void 0 : _10.boot), previous === null || previous === void 0 ? void 0 : previous.se03BootVersion),
41559
- se04BootVersion: firstMeaningfulVersion(getImageVersion((_11 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _11 === void 0 ? void 0 : _11.boot), previous === null || previous === void 0 ? void 0 : previous.se04BootVersion),
41560
- seVersion: (_12 = previous === null || previous === void 0 ? void 0 : previous.seVersion) !== null && _12 !== void 0 ? _12 : null,
41577
+ se01Version: firstMeaningfulVersion(getImageVersion((_6 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _6 === void 0 ? void 0 : _6.app), previous === null || previous === void 0 ? void 0 : previous.se01Version),
41578
+ se02Version: firstMeaningfulVersion(getImageVersion((_7 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _7 === void 0 ? void 0 : _7.app), previous === null || previous === void 0 ? void 0 : previous.se02Version),
41579
+ se03Version: firstMeaningfulVersion(getImageVersion((_8 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _8 === void 0 ? void 0 : _8.app), previous === null || previous === void 0 ? void 0 : previous.se03Version),
41580
+ se04Version: firstMeaningfulVersion(getImageVersion((_9 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _9 === void 0 ? void 0 : _9.app), previous === null || previous === void 0 ? void 0 : previous.se04Version),
41581
+ se01BootVersion: firstMeaningfulVersion(getImageVersion((_10 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _10 === void 0 ? void 0 : _10.boot), previous === null || previous === void 0 ? void 0 : previous.se01BootVersion),
41582
+ se02BootVersion: firstMeaningfulVersion(getImageVersion((_11 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _11 === void 0 ? void 0 : _11.boot), previous === null || previous === void 0 ? void 0 : previous.se02BootVersion),
41583
+ se03BootVersion: firstMeaningfulVersion(getImageVersion((_12 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _12 === void 0 ? void 0 : _12.boot), previous === null || previous === void 0 ? void 0 : previous.se03BootVersion),
41584
+ se04BootVersion: firstMeaningfulVersion(getImageVersion((_13 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _13 === void 0 ? void 0 : _13.boot), previous === null || previous === void 0 ? void 0 : previous.se04BootVersion),
41585
+ seVersion: (_14 = previous === null || previous === void 0 ? void 0 : previous.seVersion) !== null && _14 !== void 0 ? _14 : null,
41561
41586
  verify: {
41562
- firmwareBuildId: (_13 = getImageBuildId(fwApplication)) !== null && _13 !== void 0 ? _13 : (_14 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _14 === void 0 ? void 0 : _14.firmwareBuildId,
41563
- firmwareHash: (_15 = getImageHash(fwApplication)) !== null && _15 !== void 0 ? _15 : (_16 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _16 === void 0 ? void 0 : _16.firmwareHash,
41564
- bootloaderBuildId: (_17 = getImageBuildId(fwBootloader)) !== null && _17 !== void 0 ? _17 : (_18 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _18 === void 0 ? void 0 : _18.bootloaderBuildId,
41565
- bootloaderHash: (_19 = getImageHash(fwBootloader)) !== null && _19 !== void 0 ? _19 : (_20 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _20 === void 0 ? void 0 : _20.bootloaderHash,
41566
- boardBuildId: (_21 = getImageBuildId(fwBoard)) !== null && _21 !== void 0 ? _21 : (_22 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _22 === void 0 ? void 0 : _22.boardBuildId,
41567
- boardHash: (_23 = getImageHash(fwBoard)) !== null && _23 !== void 0 ? _23 : (_24 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _24 === void 0 ? void 0 : _24.boardHash,
41568
- bleBuildId: (_25 = getImageBuildId(bleApplication)) !== null && _25 !== void 0 ? _25 : (_26 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _26 === void 0 ? void 0 : _26.bleBuildId,
41569
- bleHash: (_27 = getImageHash(bleApplication)) !== null && _27 !== void 0 ? _27 : (_28 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _28 === void 0 ? void 0 : _28.bleHash,
41570
- se01BuildId: (_30 = getImageBuildId((_29 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _29 === void 0 ? void 0 : _29.app)) !== null && _30 !== void 0 ? _30 : (_31 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _31 === void 0 ? void 0 : _31.se01BuildId,
41571
- se01Hash: (_33 = getImageHash((_32 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _32 === void 0 ? void 0 : _32.app)) !== null && _33 !== void 0 ? _33 : (_34 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _34 === void 0 ? void 0 : _34.se01Hash,
41572
- se02BuildId: (_36 = getImageBuildId((_35 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _35 === void 0 ? void 0 : _35.app)) !== null && _36 !== void 0 ? _36 : (_37 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _37 === void 0 ? void 0 : _37.se02BuildId,
41573
- se02Hash: (_39 = getImageHash((_38 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _38 === void 0 ? void 0 : _38.app)) !== null && _39 !== void 0 ? _39 : (_40 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _40 === void 0 ? void 0 : _40.se02Hash,
41574
- se03BuildId: (_42 = getImageBuildId((_41 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _41 === void 0 ? void 0 : _41.app)) !== null && _42 !== void 0 ? _42 : (_43 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _43 === void 0 ? void 0 : _43.se03BuildId,
41575
- se03Hash: (_45 = getImageHash((_44 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _44 === void 0 ? void 0 : _44.app)) !== null && _45 !== void 0 ? _45 : (_46 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _46 === void 0 ? void 0 : _46.se03Hash,
41576
- se04BuildId: (_48 = getImageBuildId((_47 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _47 === void 0 ? void 0 : _47.app)) !== null && _48 !== void 0 ? _48 : (_49 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _49 === void 0 ? void 0 : _49.se04BuildId,
41577
- se04Hash: (_51 = getImageHash((_50 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _50 === void 0 ? void 0 : _50.app)) !== null && _51 !== void 0 ? _51 : (_52 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _52 === void 0 ? void 0 : _52.se04Hash,
41578
- se01BootBuildId: (_54 = getImageBuildId((_53 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _53 === void 0 ? void 0 : _53.boot)) !== null && _54 !== void 0 ? _54 : (_55 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _55 === void 0 ? void 0 : _55.se01BootBuildId,
41579
- se01BootHash: (_57 = getImageHash((_56 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _56 === void 0 ? void 0 : _56.boot)) !== null && _57 !== void 0 ? _57 : (_58 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _58 === void 0 ? void 0 : _58.se01BootHash,
41580
- se02BootBuildId: (_60 = getImageBuildId((_59 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _59 === void 0 ? void 0 : _59.boot)) !== null && _60 !== void 0 ? _60 : (_61 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _61 === void 0 ? void 0 : _61.se02BootBuildId,
41581
- se02BootHash: (_63 = getImageHash((_62 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _62 === void 0 ? void 0 : _62.boot)) !== null && _63 !== void 0 ? _63 : (_64 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _64 === void 0 ? void 0 : _64.se02BootHash,
41582
- se03BootBuildId: (_66 = getImageBuildId((_65 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _65 === void 0 ? void 0 : _65.boot)) !== null && _66 !== void 0 ? _66 : (_67 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _67 === void 0 ? void 0 : _67.se03BootBuildId,
41583
- se03BootHash: (_69 = getImageHash((_68 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _68 === void 0 ? void 0 : _68.boot)) !== null && _69 !== void 0 ? _69 : (_70 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _70 === void 0 ? void 0 : _70.se03BootHash,
41584
- se04BootBuildId: (_72 = getImageBuildId((_71 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _71 === void 0 ? void 0 : _71.boot)) !== null && _72 !== void 0 ? _72 : (_73 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _73 === void 0 ? void 0 : _73.se04BootBuildId,
41585
- se04BootHash: (_75 = getImageHash((_74 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _74 === void 0 ? void 0 : _74.boot)) !== null && _75 !== void 0 ? _75 : (_76 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _76 === void 0 ? void 0 : _76.se04BootHash,
41587
+ firmwareBuildId: (_15 = getImageBuildId(fwApplication)) !== null && _15 !== void 0 ? _15 : (_16 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _16 === void 0 ? void 0 : _16.firmwareBuildId,
41588
+ firmwareHash: (_17 = getImageHash(fwApplication)) !== null && _17 !== void 0 ? _17 : (_18 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _18 === void 0 ? void 0 : _18.firmwareHash,
41589
+ bootloaderBuildId: (_19 = getImageBuildId(fwBootloader)) !== null && _19 !== void 0 ? _19 : (_20 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _20 === void 0 ? void 0 : _20.bootloaderBuildId,
41590
+ bootloaderHash: (_21 = getImageHash(fwBootloader)) !== null && _21 !== void 0 ? _21 : (_22 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _22 === void 0 ? void 0 : _22.bootloaderHash,
41591
+ boardBuildId: (_23 = getImageBuildId(fwBoard)) !== null && _23 !== void 0 ? _23 : (_24 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _24 === void 0 ? void 0 : _24.boardBuildId,
41592
+ boardHash: (_25 = getImageHash(fwBoard)) !== null && _25 !== void 0 ? _25 : (_26 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _26 === void 0 ? void 0 : _26.boardHash,
41593
+ bleBuildId: (_27 = getImageBuildId(bleApplication)) !== null && _27 !== void 0 ? _27 : (_28 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _28 === void 0 ? void 0 : _28.bleBuildId,
41594
+ bleHash: (_29 = getImageHash(bleApplication)) !== null && _29 !== void 0 ? _29 : (_30 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _30 === void 0 ? void 0 : _30.bleHash,
41595
+ se01BuildId: (_32 = getImageBuildId((_31 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _31 === void 0 ? void 0 : _31.app)) !== null && _32 !== void 0 ? _32 : (_33 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _33 === void 0 ? void 0 : _33.se01BuildId,
41596
+ se01Hash: (_35 = getImageHash((_34 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _34 === void 0 ? void 0 : _34.app)) !== null && _35 !== void 0 ? _35 : (_36 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _36 === void 0 ? void 0 : _36.se01Hash,
41597
+ se02BuildId: (_38 = getImageBuildId((_37 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _37 === void 0 ? void 0 : _37.app)) !== null && _38 !== void 0 ? _38 : (_39 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _39 === void 0 ? void 0 : _39.se02BuildId,
41598
+ se02Hash: (_41 = getImageHash((_40 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _40 === void 0 ? void 0 : _40.app)) !== null && _41 !== void 0 ? _41 : (_42 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _42 === void 0 ? void 0 : _42.se02Hash,
41599
+ se03BuildId: (_44 = getImageBuildId((_43 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _43 === void 0 ? void 0 : _43.app)) !== null && _44 !== void 0 ? _44 : (_45 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _45 === void 0 ? void 0 : _45.se03BuildId,
41600
+ se03Hash: (_47 = getImageHash((_46 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _46 === void 0 ? void 0 : _46.app)) !== null && _47 !== void 0 ? _47 : (_48 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _48 === void 0 ? void 0 : _48.se03Hash,
41601
+ se04BuildId: (_50 = getImageBuildId((_49 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _49 === void 0 ? void 0 : _49.app)) !== null && _50 !== void 0 ? _50 : (_51 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _51 === void 0 ? void 0 : _51.se04BuildId,
41602
+ se04Hash: (_53 = getImageHash((_52 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _52 === void 0 ? void 0 : _52.app)) !== null && _53 !== void 0 ? _53 : (_54 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _54 === void 0 ? void 0 : _54.se04Hash,
41603
+ se01BootBuildId: (_56 = getImageBuildId((_55 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _55 === void 0 ? void 0 : _55.boot)) !== null && _56 !== void 0 ? _56 : (_57 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _57 === void 0 ? void 0 : _57.se01BootBuildId,
41604
+ se01BootHash: (_59 = getImageHash((_58 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se1) === null || _58 === void 0 ? void 0 : _58.boot)) !== null && _59 !== void 0 ? _59 : (_60 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _60 === void 0 ? void 0 : _60.se01BootHash,
41605
+ se02BootBuildId: (_62 = getImageBuildId((_61 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _61 === void 0 ? void 0 : _61.boot)) !== null && _62 !== void 0 ? _62 : (_63 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _63 === void 0 ? void 0 : _63.se02BootBuildId,
41606
+ se02BootHash: (_65 = getImageHash((_64 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se2) === null || _64 === void 0 ? void 0 : _64.boot)) !== null && _65 !== void 0 ? _65 : (_66 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _66 === void 0 ? void 0 : _66.se02BootHash,
41607
+ se03BootBuildId: (_68 = getImageBuildId((_67 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _67 === void 0 ? void 0 : _67.boot)) !== null && _68 !== void 0 ? _68 : (_69 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _69 === void 0 ? void 0 : _69.se03BootBuildId,
41608
+ se03BootHash: (_71 = getImageHash((_70 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se3) === null || _70 === void 0 ? void 0 : _70.boot)) !== null && _71 !== void 0 ? _71 : (_72 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _72 === void 0 ? void 0 : _72.se03BootHash,
41609
+ se04BootBuildId: (_74 = getImageBuildId((_73 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _73 === void 0 ? void 0 : _73.boot)) !== null && _74 !== void 0 ? _74 : (_75 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _75 === void 0 ? void 0 : _75.se04BootBuildId,
41610
+ se04BootHash: (_77 = getImageHash((_76 = deviceInfo === null || deviceInfo === void 0 ? void 0 : deviceInfo.se4) === null || _76 === void 0 ? void 0 : _76.boot)) !== null && _77 !== void 0 ? _77 : (_78 = previous === null || previous === void 0 ? void 0 : previous.verify) === null || _78 === void 0 ? void 0 : _78.se04BootHash,
41586
41611
  },
41587
- sessionId: (_77 = previous === null || previous === void 0 ? void 0 : previous.sessionId) !== null && _77 !== void 0 ? _77 : null,
41612
+ sessionId: (_79 = previous === null || previous === void 0 ? void 0 : previous.sessionId) !== null && _79 !== void 0 ? _79 : null,
41588
41613
  passphraseState: previous === null || previous === void 0 ? void 0 : previous.passphraseState,
41589
41614
  unlockedAttachPin: previous === null || previous === void 0 ? void 0 : previous.unlockedAttachPin,
41590
41615
  raw: {
@@ -41637,10 +41662,11 @@ class Device extends events.exports {
41637
41662
  const bleName = this.getCurrentBleName();
41638
41663
  const label = this.getCurrentLabel();
41639
41664
  const serialNo = this.getCurrentSerialNo();
41665
+ const connectId = this.getConnectId();
41640
41666
  const deviceId = this.getCurrentDeviceId() || null;
41641
41667
  const features = this.features;
41642
41668
  return {
41643
- connectId: DataManager.isBleConnect(env) ? this.mainId || null : serialNo,
41669
+ connectId: DataManager.isBleConnect(env) ? this.mainId || null : connectId,
41644
41670
  uuid: serialNo,
41645
41671
  commType: this.originalDescriptor.commType,
41646
41672
  sdkInstanceId: this.sdkInstanceId,
@@ -41829,6 +41855,12 @@ class Device extends events.exports {
41829
41855
  getCurrentSerialNo() {
41830
41856
  return this.features ? getDeviceUUID(this.features) : '';
41831
41857
  }
41858
+ getConnectId() {
41859
+ const serialNo = this.getCurrentSerialNo();
41860
+ if (serialNo)
41861
+ return serialNo;
41862
+ return this.originalDescriptor.path || this.originalDescriptor.id || '';
41863
+ }
41832
41864
  getCurrentBleName() {
41833
41865
  return getDeviceBleName(this.features);
41834
41866
  }
@@ -43054,16 +43086,19 @@ class GetPassphraseState extends BaseMethod {
43054
43086
  expectPassphraseState: this.payload.passphraseState,
43055
43087
  onlyMainPin: this.payload.useEmptyPassphrase,
43056
43088
  allowCreateAttachPin: this.payload.allowCreateAttachPin,
43089
+ initSession: this.payload.initSession,
43057
43090
  });
43058
43091
  const { features } = this.device;
43059
43092
  const passphraseProtection = (_a = this.device.getCurrentPassphraseProtection()) !== null && _a !== void 0 ? _a : null;
43060
43093
  const deviceType = this.device.getCurrentDeviceType();
43061
43094
  const isProSeries = deviceType === hdShared.EDeviceType.Pro || deviceType === hdShared.EDeviceType.Pro2;
43062
43095
  return Promise.resolve({
43063
- passphrase_state: isProSeries || passphraseProtection === true ? passphraseState : undefined,
43064
- session_id: (_b = newSession !== null && newSession !== void 0 ? newSession : features === null || features === void 0 ? void 0 : features.sessionId) !== null && _b !== void 0 ? _b : undefined,
43065
- unlocked_attach_pin: unlockedAttachPin !== null && unlockedAttachPin !== void 0 ? unlockedAttachPin : features === null || features === void 0 ? void 0 : features.unlockedAttachPin,
43066
- passphrase_protection: passphraseProtection,
43096
+ passphraseState: isProSeries || passphraseProtection === true ? passphraseState : undefined,
43097
+ sessionId: this.payload.initSession
43098
+ ? newSession !== null && newSession !== void 0 ? newSession : undefined
43099
+ : (_b = newSession !== null && newSession !== void 0 ? newSession : features === null || features === void 0 ? void 0 : features.sessionId) !== null && _b !== void 0 ? _b : undefined,
43100
+ unlockedAttachPin: unlockedAttachPin !== null && unlockedAttachPin !== void 0 ? unlockedAttachPin : features === null || features === void 0 ? void 0 : features.unlockedAttachPin,
43101
+ passphraseProtection,
43067
43102
  });
43068
43103
  });
43069
43104
  }
@@ -45864,16 +45899,6 @@ const DEV_REBOOT_TYPES = {
45864
45899
  Bootloader: hdTransport.DevRebootType.Bootloader,
45865
45900
  bootloader: hdTransport.DevRebootType.Bootloader,
45866
45901
  };
45867
- const DEVICE_REBOOT_TYPES = {
45868
- Normal: hdTransport.DeviceRebootType.Normal,
45869
- normal: hdTransport.DeviceRebootType.Normal,
45870
- Romloader: hdTransport.DeviceRebootType.Romloader,
45871
- romloader: hdTransport.DeviceRebootType.Romloader,
45872
- Boardloader: hdTransport.DeviceRebootType.Romloader,
45873
- boardloader: hdTransport.DeviceRebootType.Romloader,
45874
- Bootloader: hdTransport.DeviceRebootType.Bootloader,
45875
- bootloader: hdTransport.DeviceRebootType.Bootloader,
45876
- };
45877
45902
  const PROTOCOL_V2_FIRMWARE_UPDATE_OPTIONS = {
45878
45903
  intermediateTypes: ['DevFirmwareInstallProgress'],
45879
45904
  };
@@ -45939,18 +45964,6 @@ function normalizeRebootType(value) {
45939
45964
  }
45940
45965
  return hdTransport.DevRebootType.Normal;
45941
45966
  }
45942
- function normalizeDeviceRebootType(value) {
45943
- if (typeof value === 'number')
45944
- return value;
45945
- if (typeof value === 'string') {
45946
- const numeric = Number(value);
45947
- if (Number.isFinite(numeric))
45948
- return numeric;
45949
- if (value in DEVICE_REBOOT_TYPES)
45950
- return DEVICE_REBOOT_TYPES[value];
45951
- }
45952
- return hdTransport.DeviceRebootType.Normal;
45953
- }
45954
45967
  const VALID_FIRMWARE_TARGET_IDS = new Set([0, 1, 2, 3, 4, 5, 6, 10]);
45955
45968
  function normalizeTargetId(value, name) {
45956
45969
  if (value === undefined || value === null) {
@@ -46720,8 +46733,8 @@ class DeviceReboot extends BaseMethod {
46720
46733
  run() {
46721
46734
  var _a;
46722
46735
  return __awaiter(this, void 0, void 0, function* () {
46723
- const res = yield this.device.commands.typedCall('DeviceReboot', 'Success', {
46724
- reboot_type: normalizeDeviceRebootType((_a = this.params.reboot_type) !== null && _a !== void 0 ? _a : this.params.rebootType),
46736
+ const res = yield this.device.commands.typedCall('DevReboot', 'Success', {
46737
+ reboot_type: normalizeRebootType((_a = this.params.reboot_type) !== null && _a !== void 0 ? _a : this.params.rebootType),
46725
46738
  });
46726
46739
  return Promise.resolve(res.message);
46727
46740
  });
@@ -57920,12 +57933,14 @@ const initTransport = (Transport, plugin) => {
57920
57933
  TransportManager.setTransport(Transport, plugin);
57921
57934
  };
57922
57935
  const init = (settings, Transport, plugin) => __awaiter(void 0, void 0, void 0, function* () {
57936
+ var _r;
57923
57937
  try {
57924
57938
  try {
57925
57939
  yield DataManager.load(settings);
57940
+ setProtocolV2DeviceInfoMock((_r = settings.protocolV2DeviceInfoMockEnabled) !== null && _r !== void 0 ? _r : false);
57926
57941
  initTransport(Transport, plugin);
57927
57942
  }
57928
- catch (_r) {
57943
+ catch (_s) {
57929
57944
  Log.error('DataManager.load error');
57930
57945
  }
57931
57946
  enableLog(DataManager.getSettings('debug'));
@@ -57976,10 +57991,18 @@ Object.defineProperty(exports, 'PROTO', {
57976
57991
  enumerable: true,
57977
57992
  get: function () { return hdTransport.Messages; }
57978
57993
  });
57994
+ Object.defineProperty(exports, 'ResourceType', {
57995
+ enumerable: true,
57996
+ get: function () { return hdTransport.ResourceType; }
57997
+ });
57979
57998
  Object.defineProperty(exports, 'TonSignDataType', {
57980
57999
  enumerable: true,
57981
58000
  get: function () { return hdTransport.TonSignDataType; }
57982
58001
  });
58002
+ Object.defineProperty(exports, 'TonWalletVersion', {
58003
+ enumerable: true,
58004
+ get: function () { return hdTransport.TonWalletVersion; }
58005
+ });
57983
58006
  exports.CORE_EVENT = CORE_EVENT;
57984
58007
  exports.Core = Core;
57985
58008
  exports.DEFAULT_PRIORITY = DEFAULT_PRIORITY;