@onekeyfe/hd-transport 1.2.0-alpha.4 → 1.2.0-alpha.40

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 (68) hide show
  1. package/__tests__/messages.test.js +187 -0
  2. package/__tests__/protocol-v2-ble-frame-writer.test.js +119 -0
  3. package/__tests__/protocol-v2-link-manager.test.js +437 -0
  4. package/__tests__/protocol-v2-usb-transport-base.test.js +330 -0
  5. package/__tests__/protocol-v2.test.js +465 -56
  6. package/__tests__/transport-log.test.js +79 -0
  7. package/dist/constants.d.ts +4 -1
  8. package/dist/constants.d.ts.map +1 -1
  9. package/dist/index.d.ts +790 -198
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +820 -227
  12. package/dist/protocols/index.d.ts +14 -5
  13. package/dist/protocols/index.d.ts.map +1 -1
  14. package/dist/protocols/v2/ble-frame-writer.d.ts +15 -0
  15. package/dist/protocols/v2/ble-frame-writer.d.ts.map +1 -0
  16. package/dist/protocols/v2/constants.d.ts +1 -0
  17. package/dist/protocols/v2/constants.d.ts.map +1 -1
  18. package/dist/protocols/v2/decode.d.ts +13 -2
  19. package/dist/protocols/v2/decode.d.ts.map +1 -1
  20. package/dist/protocols/v2/encode.d.ts +2 -3
  21. package/dist/protocols/v2/encode.d.ts.map +1 -1
  22. package/dist/protocols/v2/errors.d.ts +8 -0
  23. package/dist/protocols/v2/errors.d.ts.map +1 -0
  24. package/dist/protocols/v2/frame-assembler.d.ts.map +1 -1
  25. package/dist/protocols/v2/index.d.ts +2 -1
  26. package/dist/protocols/v2/index.d.ts.map +1 -1
  27. package/dist/protocols/v2/link-manager.d.ts +39 -0
  28. package/dist/protocols/v2/link-manager.d.ts.map +1 -0
  29. package/dist/protocols/v2/sequence-cursor.d.ts +5 -0
  30. package/dist/protocols/v2/sequence-cursor.d.ts.map +1 -0
  31. package/dist/protocols/v2/session.d.ts +19 -5
  32. package/dist/protocols/v2/session.d.ts.map +1 -1
  33. package/dist/protocols/v2/usb-transport-base.d.ts +32 -0
  34. package/dist/protocols/v2/usb-transport-base.d.ts.map +1 -0
  35. package/dist/serialization/protobuf/decode.d.ts.map +1 -1
  36. package/dist/types/messages.d.ts +380 -110
  37. package/dist/types/messages.d.ts.map +1 -1
  38. package/dist/types/transport.d.ts +14 -3
  39. package/dist/types/transport.d.ts.map +1 -1
  40. package/dist/utils/transportLog.d.ts +9 -0
  41. package/dist/utils/transportLog.d.ts.map +1 -0
  42. package/messages-protocol-v2.json +1161 -477
  43. package/package.json +3 -3
  44. package/scripts/protobuf-build.sh +86 -208
  45. package/scripts/protobuf-patches/index.js +1 -0
  46. package/scripts/protobuf-types.js +19 -1
  47. package/src/constants.ts +28 -14
  48. package/src/index.ts +12 -1
  49. package/src/protocols/index.ts +39 -40
  50. package/src/protocols/v2/ble-frame-writer.ts +77 -0
  51. package/src/protocols/v2/constants.ts +1 -0
  52. package/src/protocols/v2/crc8.ts +1 -1
  53. package/src/protocols/v2/decode.ts +71 -37
  54. package/src/protocols/v2/encode.ts +2 -28
  55. package/src/protocols/v2/errors.ts +25 -0
  56. package/src/protocols/v2/frame-assembler.ts +6 -4
  57. package/src/protocols/v2/index.ts +2 -1
  58. package/src/protocols/v2/link-manager.ts +209 -0
  59. package/src/protocols/v2/sequence-cursor.ts +10 -0
  60. package/src/protocols/v2/session.ts +157 -200
  61. package/src/protocols/v2/usb-transport-base.ts +213 -0
  62. package/src/serialization/protobuf/decode.ts +4 -1
  63. package/src/types/messages.ts +464 -142
  64. package/src/types/transport.ts +14 -3
  65. package/src/utils/transportLog.ts +102 -0
  66. package/dist/protocols/v2/debug.d.ts +0 -13
  67. package/dist/protocols/v2/debug.d.ts.map +0 -1
  68. package/src/protocols/v2/debug.ts +0 -26
@@ -2209,11 +2209,17 @@ export type KaspaAddress = {
2209
2209
  // KaspaSignTx
2210
2210
  export type KaspaSignTx = {
2211
2211
  address_n: number[];
2212
- raw_message: string;
2212
+ raw_message?: string;
2213
2213
  scheme?: string;
2214
2214
  prefix?: string;
2215
2215
  input_count?: number;
2216
2216
  use_tweak?: boolean;
2217
+ output_count?: number;
2218
+ version?: number;
2219
+ lock_time?: number;
2220
+ subnetwork_id?: string;
2221
+ gas?: number;
2222
+ payload_length?: number;
2217
2223
  };
2218
2224
 
2219
2225
  // KaspaTxInputRequest
@@ -2228,6 +2234,98 @@ export type KaspaTxInputAck = {
2228
2234
  raw_message: string;
2229
2235
  };
2230
2236
 
2237
+ // KaspaOutpoint
2238
+ export type KaspaOutpoint = {
2239
+ tx_id: string;
2240
+ index: number;
2241
+ };
2242
+
2243
+ export enum Enum_KaspaInputScriptType {
2244
+ KASPA_SPEND_P2PK_SCHNORR = 0,
2245
+ KASPA_SPEND_P2PK_ECDSA = 1,
2246
+ }
2247
+ export type KaspaInputScriptType = keyof typeof Enum_KaspaInputScriptType;
2248
+
2249
+ export enum Enum_KaspaOutputScriptType {
2250
+ KASPA_PAYTOADDRESS = 0,
2251
+ KASPA_PAYTOCHANGE = 1,
2252
+ }
2253
+ export type KaspaOutputScriptType = keyof typeof Enum_KaspaOutputScriptType;
2254
+
2255
+ export enum Enum_KaspaRequestType {
2256
+ KASPA_TX_INPUT = 0,
2257
+ KASPA_TX_OUTPUT = 1,
2258
+ KASPA_TX_PAYLOAD = 2,
2259
+ KASPA_TX_FINISHED = 3,
2260
+ KASPA_TX_PREV_META = 4,
2261
+ }
2262
+ export type KaspaRequestType = keyof typeof Enum_KaspaRequestType;
2263
+
2264
+ // KaspaTxRequestSignature
2265
+ export type KaspaTxRequestSignature = {
2266
+ signature_index: number;
2267
+ signature: string;
2268
+ };
2269
+
2270
+ // KaspaTxRequest
2271
+ export type KaspaTxRequest = {
2272
+ request_type: KaspaRequestType;
2273
+ request_index?: number;
2274
+ signature?: KaspaTxRequestSignature;
2275
+ request_payload_length?: number;
2276
+ prev_tx_id?: string;
2277
+ };
2278
+
2279
+ // KaspaTxAckInput
2280
+ export type KaspaTxAckInput = {
2281
+ address_n: number[];
2282
+ previous_outpoint: KaspaOutpoint;
2283
+ amount: UintType;
2284
+ sequence: number;
2285
+ sig_op_count: number;
2286
+ script_type?: KaspaInputScriptType;
2287
+ use_tweak?: boolean;
2288
+ };
2289
+
2290
+ // KaspaTxAckOutput
2291
+ export type KaspaTxAckOutput = {
2292
+ script_type?: KaspaOutputScriptType;
2293
+ amount: UintType;
2294
+ address_n: number[];
2295
+ address?: string;
2296
+ scheme?: string;
2297
+ use_tweak?: boolean;
2298
+ };
2299
+
2300
+ // KaspaTxAckPayloadChunk
2301
+ export type KaspaTxAckPayloadChunk = {
2302
+ payload_chunk: string;
2303
+ };
2304
+
2305
+ // KaspaTxAckPrevMeta
2306
+ export type KaspaTxAckPrevMeta = {
2307
+ version: number;
2308
+ input_count: number;
2309
+ output_count: number;
2310
+ lock_time: number;
2311
+ subnetwork_id: string;
2312
+ gas: number;
2313
+ payload_length: number;
2314
+ };
2315
+
2316
+ // KaspaTxAckPrevInput
2317
+ export type KaspaTxAckPrevInput = {
2318
+ previous_outpoint: KaspaOutpoint;
2319
+ sequence: number;
2320
+ };
2321
+
2322
+ // KaspaTxAckPrevOutput
2323
+ export type KaspaTxAckPrevOutput = {
2324
+ amount: UintType;
2325
+ script_version: number;
2326
+ script_public_key: string;
2327
+ };
2328
+
2231
2329
  // KaspaSignedTx
2232
2330
  export type KaspaSignedTx = {
2233
2331
  signature: string;
@@ -2261,7 +2359,7 @@ export enum Enum_SafetyCheckLevel {
2261
2359
  PromptAlways = 1,
2262
2360
  PromptTemporarily = 2,
2263
2361
  }
2264
- export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel;
2362
+ export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel | Enum_SafetyCheckLevel;
2265
2363
 
2266
2364
  // Initialize
2267
2365
  export type Initialize = {
@@ -2412,6 +2510,19 @@ export type Features = {
2412
2510
  onekey_se04_state?: string | null;
2413
2511
  attach_to_pin_user?: boolean;
2414
2512
  unlocked_attach_pin?: boolean;
2513
+ coprocessor_bt_name?: string;
2514
+ coprocessor_version?: string;
2515
+ coprocessor_bt_enable?: boolean;
2516
+ romloader_version?: string;
2517
+ onekey_romloader_version?: string;
2518
+ onekey_romloader_hash?: string;
2519
+ onekey_bootloader_version?: string;
2520
+ onekey_bootloader_hash?: string;
2521
+ onekey_bootloader_build_id?: string;
2522
+ onekey_coprocessor_bt_name?: string;
2523
+ onekey_coprocessor_version?: string;
2524
+ onekey_coprocessor_build_id?: string;
2525
+ onekey_coprocessor_hash?: string;
2415
2526
  };
2416
2527
 
2417
2528
  // OnekeyFeatures
@@ -2911,8 +3022,6 @@ export type UnLockDeviceResponse = {
2911
3022
  // GetPassphraseState
2912
3023
  export type GetPassphraseState = {
2913
3024
  passphrase_state?: string;
2914
- _only_main_pin?: boolean;
2915
- allow_create_attach_pin?: boolean;
2916
3025
  };
2917
3026
 
2918
3027
  // PassphraseState
@@ -4478,19 +4587,13 @@ export type TxAckPaymentRequest = {
4478
4587
  signature: string;
4479
4588
  };
4480
4589
 
4481
- // InternalMyAddressRequest
4482
- export type InternalMyAddressRequest = {
4483
- coin_type: number;
4484
- chain_id: number;
4485
- account_index: number;
4486
- derive_type: number;
4487
- };
4488
-
4489
- // StartSession
4490
- export type StartSession = {
4491
- session_id?: string;
4492
- _skip_passphrase?: boolean;
4493
- derive_cardano?: boolean;
4590
+ // EthereumSignTypedDataQR
4591
+ export type EthereumSignTypedDataQR = {
4592
+ address_n: number[];
4593
+ json_data?: string;
4594
+ chain_id?: number;
4595
+ metamask_v4_compat?: boolean;
4596
+ request_id?: string;
4494
4597
  };
4495
4598
 
4496
4599
  // SetBusy
@@ -4521,28 +4624,6 @@ export type WriteSEPrivateKey = {
4521
4624
  private_key: string;
4522
4625
  };
4523
4626
 
4524
- export enum WallpaperTarget {
4525
- Home = 0,
4526
- Lock = 1,
4527
- }
4528
-
4529
- // SetWallpaper
4530
- export type SetWallpaper = {
4531
- target: WallpaperTarget;
4532
- path: string;
4533
- };
4534
-
4535
- // GetWallpaper
4536
- export type GetWallpaper = {
4537
- target: WallpaperTarget;
4538
- };
4539
-
4540
- // Wallpaper
4541
- export type Wallpaper = {
4542
- target: WallpaperTarget;
4543
- path: string;
4544
- };
4545
-
4546
4627
  // UnlockPath
4547
4628
  export type UnlockPath = {
4548
4629
  address_n: number[];
@@ -4561,59 +4642,49 @@ export enum MoneroNetworkType {
4561
4642
  FAKECHAIN = 3,
4562
4643
  }
4563
4644
 
4564
- // ViewAmount
4565
- export type ViewAmount = {
4566
- is_unlimited: boolean;
4567
- num: string;
4568
- };
4569
-
4570
- // ViewDetail
4571
- export type ViewDetail = {
4572
- key: number;
4573
- value: string;
4574
- is_overview: boolean;
4575
- has_icon: boolean;
4576
- };
4577
-
4578
- export enum ViewTipType {
4579
- Default = 0,
4580
- Highlight = 1,
4581
- Recommend = 2,
4582
- Warning = 3,
4583
- Danger = 4,
4645
+ export enum UiAnimationType {
4646
+ Unknown = 0,
4647
+ Signing = 1,
4584
4648
  }
4585
4649
 
4586
- // ViewTip
4587
- export type ViewTip = {
4588
- type: ViewTipType;
4589
- text: string;
4590
- };
4650
+ export enum UiAnimationCommand {
4651
+ CommandUnknown = 0,
4652
+ Start = 1,
4653
+ Stop = 2,
4654
+ Refresh = 3,
4655
+ }
4591
4656
 
4592
- // ViewSignPage
4593
- export type ViewSignPage = {
4594
- title: string;
4595
- amount?: UintType;
4596
- general: ViewDetail[];
4597
- tip?: ViewTip;
4598
- };
4599
-
4600
- // ViewVerifyPage
4601
- export type ViewVerifyPage = {
4602
- title: string;
4603
- address: string;
4604
- path: string;
4657
+ // UiAnimationRequest
4658
+ export type UiAnimationRequest = {
4659
+ command: UiAnimationCommand;
4660
+ type?: UiAnimationType;
4605
4661
  };
4606
4662
 
4607
4663
  // ProtocolInfoRequest
4608
- export type ProtocolInfoRequest = {};
4664
+ export type ProtocolInfoRequest = {
4665
+ eventless_wallet_session?: boolean;
4666
+ };
4609
4667
 
4610
4668
  // ProtocolInfo
4611
4669
  export type ProtocolInfo = {
4612
4670
  version: number;
4671
+ build_fingerprint: string;
4613
4672
  supported_messages: number[];
4614
- protobuf_definition?: string;
4615
4673
  };
4616
4674
 
4675
+ export enum DeviceErrorCode {
4676
+ DeviceError_None = 0,
4677
+ DeviceError_Busy = 1,
4678
+ DeviceError_NotInitialized = 2,
4679
+ DeviceError_ActionCancelled = 3,
4680
+ DeviceError_PinAlreadyUsed = 4,
4681
+ DeviceError_PersistFailed = 5,
4682
+ DeviceError_SeError = 6,
4683
+ DeviceError_InvalidLanguage = 7,
4684
+ DeviceError_WallpaperNotUsable = 8,
4685
+ DeviceError_DeviceLocked = 9,
4686
+ }
4687
+
4617
4688
  export enum DeviceRebootType {
4618
4689
  Normal = 0,
4619
4690
  Romloader = 1,
@@ -4627,9 +4698,22 @@ export type DeviceReboot = {
4627
4698
 
4628
4699
  // DeviceSettings
4629
4700
  export type DeviceSettings = {
4630
- label?: string;
4631
4701
  bt_enable?: boolean;
4632
4702
  language?: string;
4703
+ wallpaper_path?: string;
4704
+ brightness?: number;
4705
+ animation_enable?: boolean;
4706
+ tap_to_wake?: boolean;
4707
+ haptic_feedback?: boolean;
4708
+ device_name_display_enabled?: boolean;
4709
+ airgap_mode?: boolean;
4710
+ usb_lock_enable?: boolean;
4711
+ random_keypad?: boolean;
4712
+ passphrase_enable?: boolean;
4713
+ fido_enabled?: boolean;
4714
+ autolock_delay_ms?: number;
4715
+ autoshutdown_delay_ms?: number;
4716
+ label?: string;
4633
4717
  };
4634
4718
 
4635
4719
  // DeviceSettingsGet
@@ -4640,6 +4724,19 @@ export type DeviceSettingsSet = {
4640
4724
  settings: DeviceSettings;
4641
4725
  };
4642
4726
 
4727
+ export enum DeviceSettingsPage {
4728
+ DeviceReset = 0,
4729
+ DevicePinChange = 1,
4730
+ DevicePassphrase = 2,
4731
+ DeviceAirgap = 3,
4732
+ }
4733
+
4734
+ // DeviceSettingsPageShow
4735
+ export type DeviceSettingsPageShow = {
4736
+ page: DeviceSettingsPage;
4737
+ field_name?: string;
4738
+ };
4739
+
4643
4740
  // DeviceCertificate
4644
4741
  export type DeviceCertificate = {
4645
4742
  cert_and_pubkey: string;
@@ -4664,6 +4761,54 @@ export type DeviceCertificateSign = {
4664
4761
  data: string;
4665
4762
  };
4666
4763
 
4764
+ // DeviceMiscUsbMscControl
4765
+ export type DeviceMiscUsbMscControl = {
4766
+ enable: boolean;
4767
+ };
4768
+
4769
+ export enum DeviceFactoryAck {
4770
+ FACTORY_ACK_SUCCESS = 0,
4771
+ FACTORY_ACK_FAIL = 1,
4772
+ }
4773
+
4774
+ // DeviceFactoryInfoManufactureTime
4775
+ export type DeviceFactoryInfoManufactureTime = {
4776
+ year: number;
4777
+ month: number;
4778
+ day: number;
4779
+ hour: number;
4780
+ minute: number;
4781
+ second: number;
4782
+ };
4783
+
4784
+ // DeviceFactoryInfo
4785
+ export type DeviceFactoryInfo = {
4786
+ version?: number;
4787
+ serial_number?: string;
4788
+ burn_in_completed?: boolean;
4789
+ factory_test_completed?: boolean;
4790
+ manufacture_time?: DeviceFactoryInfoManufactureTime;
4791
+ };
4792
+
4793
+ // DeviceFactoryInfoSet
4794
+ export type DeviceFactoryInfoSet = {
4795
+ info: DeviceFactoryInfo;
4796
+ };
4797
+
4798
+ // DeviceFactoryInfoGet
4799
+ export type DeviceFactoryInfoGet = {};
4800
+
4801
+ // DeviceFactoryPermanentLock
4802
+ export type DeviceFactoryPermanentLock = {
4803
+ check_a: string;
4804
+ check_b: string;
4805
+ };
4806
+
4807
+ // DeviceFactoryTest
4808
+ export type DeviceFactoryTest = {
4809
+ burn_in_test: boolean;
4810
+ };
4811
+
4667
4812
  export enum DeviceFirmwareTargetType {
4668
4813
  FW_MGMT_TARGET_INVALID = 0,
4669
4814
  FW_MGMT_TARGET_CRATE = 1,
@@ -4728,49 +4873,6 @@ export type DeviceFirmwareUpdateStatus = {
4728
4873
  records: DeviceFirmwareUpdateRecord[];
4729
4874
  };
4730
4875
 
4731
- export enum DeviceFactoryAck {
4732
- FACTORY_ACK_SUCCESS = 0,
4733
- FACTORY_ACK_FAIL = 1,
4734
- }
4735
-
4736
- // DeviceFactoryInfoManufactureTime
4737
- export type DeviceFactoryInfoManufactureTime = {
4738
- year: number;
4739
- month: number;
4740
- day: number;
4741
- hour: number;
4742
- minute: number;
4743
- second: number;
4744
- };
4745
-
4746
- // DeviceFactoryInfo
4747
- export type DeviceFactoryInfo = {
4748
- version?: number;
4749
- serial_number?: string;
4750
- burn_in_completed?: boolean;
4751
- factory_test_completed?: boolean;
4752
- manufacture_time?: DeviceFactoryInfoManufactureTime;
4753
- };
4754
-
4755
- // DeviceFactoryInfoSet
4756
- export type DeviceFactoryInfoSet = {
4757
- info: DeviceFactoryInfo;
4758
- };
4759
-
4760
- // DeviceFactoryInfoGet
4761
- export type DeviceFactoryInfoGet = {};
4762
-
4763
- // DeviceFactoryPermanentLock
4764
- export type DeviceFactoryPermanentLock = {
4765
- check_a: string;
4766
- check_b: string;
4767
- };
4768
-
4769
- // DeviceFactoryTest
4770
- export type DeviceFactoryTest = {
4771
- burn_in_test: boolean;
4772
- };
4773
-
4774
4876
  export enum DeviceType {
4775
4877
  CLASSIC1 = 0,
4776
4878
  CLASSIC1S = 1,
@@ -4841,7 +4943,6 @@ export type DeviceInfoTargets = {
4841
4943
  se2?: boolean;
4842
4944
  se3?: boolean;
4843
4945
  se4?: boolean;
4844
- status?: boolean;
4845
4946
  };
4846
4947
 
4847
4948
  // DeviceInfoTypes
@@ -4868,9 +4969,17 @@ export type ProtocolV2DeviceInfo = {
4868
4969
  se2?: DeviceSEInfo;
4869
4970
  se3?: DeviceSEInfo;
4870
4971
  se4?: DeviceSEInfo;
4871
- status?: DeviceStatus;
4872
4972
  };
4873
4973
 
4974
+ export enum DeviceSessionErrorCode {
4975
+ DeviceSessionError_None = 0,
4976
+ DeviceSessionError_UserCancelled = 1,
4977
+ DeviceSessionError_InvalidSession = 2,
4978
+ DeviceSessionError_AttachPinUnavailable = 3,
4979
+ DeviceSessionError_PassphraseDisabled = 4,
4980
+ DeviceSessionError_Busy = 5,
4981
+ }
4982
+
4874
4983
  // DeviceSessionGet
4875
4984
  export type DeviceSessionGet = {
4876
4985
  session_id?: string;
@@ -4882,6 +4991,27 @@ export type DeviceSession = {
4882
4991
  btc_test_address?: string;
4883
4992
  };
4884
4993
 
4994
+ export enum DeviceSessionPinType {
4995
+ Any = 1,
4996
+ Main = 2,
4997
+ AttachToPin = 3,
4998
+ }
4999
+
5000
+ // DeviceSessionAskPin
5001
+ export type DeviceSessionAskPin = {
5002
+ type?: DeviceSessionPinType;
5003
+ };
5004
+
5005
+ // DeviceSessionAskPassphrase
5006
+ export type DeviceSessionAskPassphrase = {
5007
+ passphrase?: string;
5008
+ on_device: boolean;
5009
+ };
5010
+
5011
+ export enum DeviceSessionAskPin_FailureSubCodes {
5012
+ UserCancel = 1,
5013
+ }
5014
+
4885
5015
  // DeviceStatus
4886
5016
  export type DeviceStatus = {
4887
5017
  device_id?: string;
@@ -4893,6 +5023,9 @@ export type DeviceStatus = {
4893
5023
  unlocked_by_attach_to_pin?: boolean;
4894
5024
  };
4895
5025
 
5026
+ // DeviceStatusGet
5027
+ export type DeviceStatusGet = {};
5028
+
4896
5029
  // FilesystemPermissionFix
4897
5030
  export type FilesystemPermissionFix = {};
4898
5031
 
@@ -4972,7 +5105,178 @@ export type FilesystemDirRemove = {
4972
5105
  };
4973
5106
 
4974
5107
  // FilesystemFormat
4975
- export type FilesystemFormat = {};
5108
+ export type FilesystemFormat = {
5109
+ data: boolean;
5110
+ user: boolean;
5111
+ };
5112
+
5113
+ // InternalMyAddressRequest
5114
+ export type InternalMyAddressRequest = {
5115
+ coin_type: number;
5116
+ chain_id: number;
5117
+ account_index: number;
5118
+ derive_type: number;
5119
+ };
5120
+
5121
+ // NftUpdate
5122
+ export type NftUpdate = {
5123
+ file_name_no_ext: string;
5124
+ };
5125
+
5126
+ export enum OnboardingStep {
5127
+ ONBOARDING_STEP_UNKNOWN = 0,
5128
+ ONBOARDING_STEP_CHECKING = 1,
5129
+ ONBOARDING_STEP_PERSONALIZATION = 2,
5130
+ ONBOARDING_STEP_PIN = 3,
5131
+ ONBOARDING_STEP_SETUP = 4,
5132
+ ONBOARDING_STEP_DONE = 5,
5133
+ }
5134
+
5135
+ export enum OnboardingPhase {
5136
+ ONBOARDING_PHASE_UNKNOWN = 0,
5137
+ ONBOARDING_PHASE_SAFETY_CHECK = 1,
5138
+ ONBOARDING_PHASE_PIN_SETUP = 2,
5139
+ ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
5140
+ ONBOARDING_PHASE_SETUP_CHOICE = 4,
5141
+ ONBOARDING_PHASE_WALLET_CREATE_START = 5,
5142
+ ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
5143
+ ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
5144
+ ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
5145
+ ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
5146
+ ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
5147
+ ONBOARDING_PHASE_WALLET_READY = 11,
5148
+ ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
5149
+ ONBOARDING_PHASE_SEEDCARD_BACKUP = 13,
5150
+ }
5151
+
5152
+ export enum OnboardingSetupKind {
5153
+ ONBOARDING_SETUP_KIND_UNKNOWN = 0,
5154
+ ONBOARDING_SETUP_KIND_CHOICE = 1,
5155
+ ONBOARDING_SETUP_KIND_CREATE = 2,
5156
+ ONBOARDING_SETUP_KIND_RESTORE = 3,
5157
+ }
5158
+
5159
+ export enum OnboardingSetupMethod {
5160
+ ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
5161
+ ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
5162
+ ONBOARDING_SETUP_METHOD_SEEDCARD = 2,
5163
+ }
5164
+
5165
+ // OnboardingSetupStatus
5166
+ export type OnboardingSetupStatus = {
5167
+ kind?: OnboardingSetupKind;
5168
+ method?: OnboardingSetupMethod;
5169
+ };
5170
+
5171
+ // OnboardingStatusGet
5172
+ export type OnboardingStatusGet = {};
5173
+
5174
+ // OnboardingStatus
5175
+ export type OnboardingStatus = {
5176
+ step?: OnboardingStep;
5177
+ phase?: OnboardingPhase;
5178
+ setup?: OnboardingSetupStatus;
5179
+ pin_set?: boolean;
5180
+ wallet_initialized?: boolean;
5181
+ };
5182
+
5183
+ // PortfolioUpdate
5184
+ export type PortfolioUpdate = {};
5185
+
5186
+ // ViewAmount
5187
+ export type ViewAmount = {
5188
+ is_unlimited: boolean;
5189
+ num: string;
5190
+ };
5191
+
5192
+ // ViewDetail
5193
+ export type ViewDetail = {
5194
+ key: number;
5195
+ value: string;
5196
+ is_overview: boolean;
5197
+ has_icon: boolean;
5198
+ };
5199
+
5200
+ export enum ViewTipType {
5201
+ Default = 0,
5202
+ Highlight = 1,
5203
+ Recommend = 2,
5204
+ Warning = 3,
5205
+ Danger = 4,
5206
+ }
5207
+
5208
+ // ViewTip
5209
+ export type ViewTip = {
5210
+ type: ViewTipType;
5211
+ text: string;
5212
+ };
5213
+
5214
+ // ViewRawData
5215
+ export type ViewRawData = {
5216
+ initial_data: string;
5217
+ placeholder: number;
5218
+ };
5219
+
5220
+ export enum ViewSignLayout {
5221
+ LayoutDefault = 0,
5222
+ LayoutSafeTxCreate = 1,
5223
+ LayoutFinalConfirm = 2,
5224
+ Layout7702 = 3,
5225
+ LayoutFlat = 4,
5226
+ LayoutEthApprove = 5,
5227
+ }
5228
+
5229
+ // ViewSignPage
5230
+ export type ViewSignPage = {
5231
+ title: string;
5232
+ amount?: UintType;
5233
+ general: ViewDetail[];
5234
+ tip?: ViewTip;
5235
+ raw_data?: ViewRawData;
5236
+ slide_to_confirm?: boolean;
5237
+ layout?: ViewSignLayout;
5238
+ };
5239
+
5240
+ // ViewVerifyPage
5241
+ export type ViewVerifyPage = {
5242
+ title: string;
5243
+ address: string;
5244
+ path: string;
5245
+ network?: string;
5246
+ derive_type?: string;
5247
+ value_key?: number;
5248
+ };
5249
+
5250
+ export enum ProtocolV2FailureType {
5251
+ Failure_InvalidMessage = 1,
5252
+ Failure_UndefinedError = 2,
5253
+ Failure_UsageError = 3,
5254
+ Failure_DataError = 4,
5255
+ Failure_ProcessError = 5,
5256
+ }
5257
+
5258
+ export enum Enum_ProtocolV2Capability {
5259
+ Capability_Bitcoin = 1,
5260
+ Capability_Bitcoin_like = 2,
5261
+ Capability_Binance = 3,
5262
+ Capability_Cardano = 4,
5263
+ Capability_Crypto = 5,
5264
+ Capability_EOS = 6,
5265
+ Capability_Ethereum = 7,
5266
+ Capability_Lisk = 8,
5267
+ Capability_Monero = 9,
5268
+ Capability_NEM = 10,
5269
+ Capability_Ripple = 11,
5270
+ Capability_Stellar = 12,
5271
+ Capability_Tezos = 13,
5272
+ Capability_U2F = 14,
5273
+ Capability_Shamir = 15,
5274
+ Capability_ShamirGroups = 16,
5275
+ Capability_PassphraseEntry = 17,
5276
+ Capability_AttachToPin = 18,
5277
+ Capability_EthereumTypedData = 1000,
5278
+ }
5279
+ export type ProtocolV2Capability = keyof typeof Enum_ProtocolV2Capability;
4976
5280
 
4977
5281
  // custom connect definitions
4978
5282
  export type MessageType = {
@@ -5249,6 +5553,15 @@ export type MessageType = {
5249
5553
  KaspaSignTx: KaspaSignTx;
5250
5554
  KaspaTxInputRequest: KaspaTxInputRequest;
5251
5555
  KaspaTxInputAck: KaspaTxInputAck;
5556
+ KaspaOutpoint: KaspaOutpoint;
5557
+ KaspaTxRequestSignature: KaspaTxRequestSignature;
5558
+ KaspaTxRequest: KaspaTxRequest;
5559
+ KaspaTxAckInput: KaspaTxAckInput;
5560
+ KaspaTxAckOutput: KaspaTxAckOutput;
5561
+ KaspaTxAckPayloadChunk: KaspaTxAckPayloadChunk;
5562
+ KaspaTxAckPrevMeta: KaspaTxAckPrevMeta;
5563
+ KaspaTxAckPrevInput: KaspaTxAckPrevInput;
5564
+ KaspaTxAckPrevOutput: KaspaTxAckPrevOutput;
5252
5565
  KaspaSignedTx: KaspaSignedTx;
5253
5566
  LnurlAuth: LnurlAuth;
5254
5567
  LnurlAuthResp: LnurlAuthResp;
@@ -5538,47 +5851,41 @@ export type MessageType = {
5538
5851
  CoinPurchaseMemo: CoinPurchaseMemo;
5539
5852
  PaymentRequestMemo: PaymentRequestMemo;
5540
5853
  TxAckPaymentRequest: TxAckPaymentRequest;
5541
- InternalMyAddressRequest: InternalMyAddressRequest;
5542
- StartSession: StartSession;
5854
+ EthereumSignTypedDataQR: EthereumSignTypedDataQR;
5543
5855
  SetBusy: SetBusy;
5544
5856
  GetFirmwareHash: GetFirmwareHash;
5545
5857
  FirmwareHash: FirmwareHash;
5546
5858
  GetNonce: GetNonce;
5547
5859
  Nonce: Nonce;
5548
5860
  WriteSEPrivateKey: WriteSEPrivateKey;
5549
- SetWallpaper: SetWallpaper;
5550
- GetWallpaper: GetWallpaper;
5551
- Wallpaper: Wallpaper;
5552
5861
  UnlockPath: UnlockPath;
5553
5862
  UnlockedPathRequest: UnlockedPathRequest;
5554
- ViewAmount: ViewAmount;
5555
- ViewDetail: ViewDetail;
5556
- ViewTip: ViewTip;
5557
- ViewSignPage: ViewSignPage;
5558
- ViewVerifyPage: ViewVerifyPage;
5863
+ UiAnimationRequest: UiAnimationRequest;
5559
5864
  ProtocolInfoRequest: ProtocolInfoRequest;
5560
5865
  ProtocolInfo: ProtocolInfo;
5561
5866
  DeviceReboot: DeviceReboot;
5562
5867
  DeviceSettings: DeviceSettings;
5563
5868
  DeviceSettingsGet: DeviceSettingsGet;
5564
5869
  DeviceSettingsSet: DeviceSettingsSet;
5870
+ DeviceSettingsPageShow: DeviceSettingsPageShow;
5565
5871
  DeviceCertificate: DeviceCertificate;
5566
5872
  DeviceCertificateWrite: DeviceCertificateWrite;
5567
5873
  DeviceCertificateRead: DeviceCertificateRead;
5568
5874
  DeviceCertificateSignature: DeviceCertificateSignature;
5569
5875
  DeviceCertificateSign: DeviceCertificateSign;
5570
- DeviceFirmwareTarget: DeviceFirmwareTarget;
5571
- DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
5572
- DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
5573
- DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
5574
- DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
5575
- DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
5876
+ DeviceMiscUsbMscControl: DeviceMiscUsbMscControl;
5576
5877
  DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
5577
5878
  DeviceFactoryInfo: DeviceFactoryInfo;
5578
5879
  DeviceFactoryInfoSet: DeviceFactoryInfoSet;
5579
5880
  DeviceFactoryInfoGet: DeviceFactoryInfoGet;
5580
5881
  DeviceFactoryPermanentLock: DeviceFactoryPermanentLock;
5581
5882
  DeviceFactoryTest: DeviceFactoryTest;
5883
+ DeviceFirmwareTarget: DeviceFirmwareTarget;
5884
+ DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
5885
+ DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
5886
+ DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
5887
+ DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
5888
+ DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
5582
5889
  DeviceFirmwareImageInfo: DeviceFirmwareImageInfo;
5583
5890
  DeviceHardwareInfo: DeviceHardwareInfo;
5584
5891
  DeviceMainMcuInfo: DeviceMainMcuInfo;
@@ -5589,7 +5896,10 @@ export type MessageType = {
5589
5896
  DeviceInfoGet: DeviceInfoGet;
5590
5897
  DeviceSessionGet: DeviceSessionGet;
5591
5898
  DeviceSession: DeviceSession;
5899
+ DeviceSessionAskPin: DeviceSessionAskPin;
5900
+ DeviceSessionAskPassphrase: DeviceSessionAskPassphrase;
5592
5901
  DeviceStatus: DeviceStatus;
5902
+ DeviceStatusGet: DeviceStatusGet;
5593
5903
  FilesystemPermissionFix: FilesystemPermissionFix;
5594
5904
  FilesystemPathInfo: FilesystemPathInfo;
5595
5905
  FilesystemPathInfoQuery: FilesystemPathInfoQuery;
@@ -5602,6 +5912,18 @@ export type MessageType = {
5602
5912
  FilesystemDirMake: FilesystemDirMake;
5603
5913
  FilesystemDirRemove: FilesystemDirRemove;
5604
5914
  FilesystemFormat: FilesystemFormat;
5915
+ InternalMyAddressRequest: InternalMyAddressRequest;
5916
+ NftUpdate: NftUpdate;
5917
+ OnboardingSetupStatus: OnboardingSetupStatus;
5918
+ OnboardingStatusGet: OnboardingStatusGet;
5919
+ OnboardingStatus: OnboardingStatus;
5920
+ PortfolioUpdate: PortfolioUpdate;
5921
+ ViewAmount: ViewAmount;
5922
+ ViewDetail: ViewDetail;
5923
+ ViewTip: ViewTip;
5924
+ ViewRawData: ViewRawData;
5925
+ ViewSignPage: ViewSignPage;
5926
+ ViewVerifyPage: ViewVerifyPage;
5605
5927
  };
5606
5928
 
5607
5929
  export type MessageKey = keyof MessageType;