@onekeyfe/hd-transport 1.2.0-alpha.1 → 1.2.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport",
3
- "version": "1.2.0-alpha.1",
3
+ "version": "1.2.0-alpha.2",
4
4
  "description": "Transport layer abstractions and utilities for OneKey hardware SDK.",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -28,5 +28,5 @@
28
28
  "long": "^4.0.0",
29
29
  "protobufjs": "^6.11.2"
30
30
  },
31
- "gitHead": "4f4aae3a47be7bd54b4db4a10c400056784e01bd"
31
+ "gitHead": "6c183b7f7027f4b4d3db4f427f6360351a6c6680"
32
32
  }
@@ -4452,23 +4452,6 @@ export type TxAckPaymentRequest = {
4452
4452
  signature: string;
4453
4453
  };
4454
4454
 
4455
- // DebugLinkInput
4456
- export type DebugLinkInput = {
4457
- x?: number;
4458
- y?: number;
4459
- duration_ms?: number;
4460
- x_end?: number;
4461
- y_end?: number;
4462
- };
4463
-
4464
- // InternalMyAddressRequest
4465
- export type InternalMyAddressRequest = {
4466
- coin_type: number;
4467
- chain_id: number;
4468
- account_index: number;
4469
- derive_type: number;
4470
- };
4471
-
4472
4455
  // SetBusy
4473
4456
  export type SetBusy = {
4474
4457
  expiry_ms?: number;
@@ -4497,28 +4480,6 @@ export type WriteSEPrivateKey = {
4497
4480
  private_key: string;
4498
4481
  };
4499
4482
 
4500
- export enum WallpaperTarget {
4501
- Home = 0,
4502
- Lock = 1,
4503
- }
4504
-
4505
- // SetWallpaper
4506
- export type SetWallpaper = {
4507
- target: WallpaperTarget;
4508
- path: string;
4509
- };
4510
-
4511
- // GetWallpaper
4512
- export type GetWallpaper = {
4513
- target: WallpaperTarget;
4514
- };
4515
-
4516
- // Wallpaper
4517
- export type Wallpaper = {
4518
- target: WallpaperTarget;
4519
- path: string;
4520
- };
4521
-
4522
4483
  // UnlockPath
4523
4484
  export type UnlockPath = {
4524
4485
  address_n: number[];
@@ -4537,47 +4498,47 @@ export enum MoneroNetworkType {
4537
4498
  FAKECHAIN = 3,
4538
4499
  }
4539
4500
 
4540
- // ViewAmount
4541
- export type ViewAmount = {
4542
- is_unlimited: boolean;
4501
+ // TxDetailsAmount
4502
+ export type TxDetailsAmount = {
4543
4503
  num: string;
4504
+ decimals: number;
4505
+ symbol: string;
4544
4506
  };
4545
4507
 
4546
- // ViewDetail
4547
- export type ViewDetail = {
4508
+ // TxDetailsAddress
4509
+ export type TxDetailsAddress = {
4510
+ key: number;
4511
+ address: string;
4512
+ owner?: string;
4513
+ icon?: string;
4514
+ };
4515
+
4516
+ // TxDetailsNetwork
4517
+ export type TxDetailsNetwork = {
4518
+ coin_type: number;
4519
+ chain_id?: number;
4520
+ };
4521
+
4522
+ // TxDetailsGeneral
4523
+ export type TxDetailsGeneral = {
4548
4524
  key: number;
4549
4525
  value: string;
4550
4526
  is_overview: boolean;
4551
- has_icon: boolean;
4552
4527
  };
4553
4528
 
4554
- export enum ViewTipType {
4555
- Default = 0,
4556
- Highlight = 1,
4557
- Recommend = 2,
4558
- Warning = 3,
4559
- Danger = 4,
4529
+ export enum TxDetailsDisplayType {
4530
+ DISPLAY_TYPE_INFO = 0,
4531
+ DISPLAY_TYPE_SIGN = 1,
4560
4532
  }
4561
4533
 
4562
- // ViewTip
4563
- export type ViewTip = {
4564
- type: ViewTipType;
4565
- text: string;
4566
- };
4567
-
4568
- // ViewSignPage
4569
- export type ViewSignPage = {
4534
+ // TxDetailsPage
4535
+ export type TxDetailsPage = {
4570
4536
  title: string;
4537
+ display_type: TxDetailsDisplayType;
4571
4538
  amount?: UintType;
4572
- general: ViewDetail[];
4573
- tip?: ViewTip;
4574
- };
4575
-
4576
- // ViewVerifyPage
4577
- export type ViewVerifyPage = {
4578
- title: string;
4579
- address: string;
4580
- path: string;
4539
+ network?: TxDetailsNetwork;
4540
+ address: TxDetailsAddress[];
4541
+ general: TxDetailsGeneral[];
4581
4542
  };
4582
4543
 
4583
4544
  // GetProtoVersion
@@ -4594,11 +4555,22 @@ export enum DevRebootType {
4594
4555
  Bootloader = 2,
4595
4556
  }
4596
4557
 
4558
+ export enum DeviceRebootType {
4559
+ Normal = 0,
4560
+ Romloader = 1,
4561
+ Bootloader = 2,
4562
+ }
4563
+
4597
4564
  // DevReboot
4598
4565
  export type DevReboot = {
4599
4566
  reboot_type: DevRebootType;
4600
4567
  };
4601
4568
 
4569
+ // DeviceReboot
4570
+ export type DeviceReboot = {
4571
+ reboot_type: DeviceRebootType;
4572
+ };
4573
+
4602
4574
  export enum DeviceType {
4603
4575
  CLASSIC1 = 0,
4604
4576
  CLASSIC1S = 1,
@@ -4630,7 +4602,6 @@ export type DevFirmwareImageInfo = {
4630
4602
  export type DevHardwareInfo = {
4631
4603
  device_type?: DeviceType;
4632
4604
  serial_no?: string;
4633
- device_id?: string;
4634
4605
  hardware_version?: string;
4635
4606
  hardware_version_raw_adc?: number;
4636
4607
  };
@@ -4694,6 +4665,9 @@ export type DevGetDeviceInfo = {
4694
4665
  types?: DevInfoTypes;
4695
4666
  };
4696
4667
 
4668
+ // DeviceGetDeviceInfo
4669
+ export type DeviceGetDeviceInfo = DevGetDeviceInfo;
4670
+
4697
4671
  // ProtocolV2DeviceInfo
4698
4672
  export type ProtocolV2DeviceInfo = {
4699
4673
  protocol_version: number;
@@ -4708,13 +4682,30 @@ export type ProtocolV2DeviceInfo = {
4708
4682
  };
4709
4683
 
4710
4684
  export enum DevFirmwareTargetType {
4711
- TARGET_MAIN_APP = 0,
4712
- TARGET_MAIN_BOOT = 1,
4713
- TARGET_BT = 2,
4714
- TARGET_SE1 = 3,
4715
- TARGET_SE2 = 4,
4716
- TARGET_SE3 = 5,
4717
- TARGET_SE4 = 6,
4685
+ TARGET_INVALID = 0,
4686
+ TARGET_ROMLOADER = 1,
4687
+ TARGET_BOOTLOADER = 2,
4688
+ TARGET_APPLICATION_P1 = 3,
4689
+ TARGET_APPLICATION_P2 = 4,
4690
+ TARGET_COPROCESSOR = 5,
4691
+ TARGET_SE01 = 6,
4692
+ TARGET_SE02 = 7,
4693
+ TARGET_SE03 = 8,
4694
+ TARGET_SE04 = 9,
4695
+ TARGET_RESOURCE = 10,
4696
+ }
4697
+
4698
+ export enum DeviceFirmwareTargetType {
4699
+ TARGET_INVALID = 0,
4700
+ TARGET_ROMLOADER = 1,
4701
+ TARGET_BOOTLOADER = 2,
4702
+ TARGET_APPLICATION_P1 = 3,
4703
+ TARGET_APPLICATION_P2 = 4,
4704
+ TARGET_COPROCESSOR = 5,
4705
+ TARGET_SE01 = 6,
4706
+ TARGET_SE02 = 7,
4707
+ TARGET_SE03 = 8,
4708
+ TARGET_SE04 = 9,
4718
4709
  TARGET_RESOURCE = 10,
4719
4710
  }
4720
4711
 
@@ -4724,11 +4715,23 @@ export type DevFirmwareTarget = {
4724
4715
  path: string;
4725
4716
  };
4726
4717
 
4718
+ // DeviceFirmwareTarget
4719
+ export type DeviceFirmwareTarget = {
4720
+ target_id: DeviceFirmwareTargetType;
4721
+ path: string;
4722
+ };
4723
+
4727
4724
  // DevFirmwareUpdate
4728
4725
  export type DevFirmwareUpdate = {
4729
4726
  targets: DevFirmwareTarget[];
4730
4727
  };
4731
4728
 
4729
+ // DeviceFirmwareUpdate
4730
+ export type DeviceFirmwareUpdate = {
4731
+ targets: DeviceFirmwareTarget[];
4732
+ max_concurrent?: number;
4733
+ };
4734
+
4732
4735
  // DevFirmwareInstallProgress
4733
4736
  export type DevFirmwareInstallProgress = {
4734
4737
  target_id: DevFirmwareTargetType;
@@ -4736,20 +4739,41 @@ export type DevFirmwareInstallProgress = {
4736
4739
  stage?: string;
4737
4740
  };
4738
4741
 
4742
+ // DeviceFirmwareInstallProgress
4743
+ export type DeviceFirmwareInstallProgress = {
4744
+ target_id: DeviceFirmwareTargetType;
4745
+ progress: number;
4746
+ stage?: string;
4747
+ };
4748
+
4739
4749
  // DevFirmwareUpdateStatusEntry
4740
4750
  export type DevFirmwareUpdateStatusEntry = {
4741
4751
  target_id: DevFirmwareTargetType;
4742
4752
  status: number;
4743
4753
  };
4744
4754
 
4755
+ // DeviceFirmwareUpdateStatusEntry
4756
+ export type DeviceFirmwareUpdateStatusEntry = {
4757
+ target_id: DeviceFirmwareTargetType;
4758
+ status: number;
4759
+ };
4760
+
4745
4761
  // DevGetFirmwareUpdateStatus
4746
4762
  export type DevGetFirmwareUpdateStatus = {};
4747
4763
 
4764
+ // DeviceGetFirmwareUpdateStatus
4765
+ export type DeviceGetFirmwareUpdateStatus = {};
4766
+
4748
4767
  // DevFirmwareUpdateStatus
4749
4768
  export type DevFirmwareUpdateStatus = {
4750
4769
  targets: DevFirmwareUpdateStatusEntry[];
4751
4770
  };
4752
4771
 
4772
+ // DeviceFirmwareUpdateStatus
4773
+ export type DeviceFirmwareUpdateStatus = {
4774
+ targets: DeviceFirmwareUpdateStatusEntry[];
4775
+ };
4776
+
4753
4777
  // FactoryDeviceInfoSettings
4754
4778
  export type FactoryDeviceInfoSettings = {
4755
4779
  serial_no?: string;
@@ -5448,27 +5472,23 @@ export type MessageType = {
5448
5472
  CoinPurchaseMemo: CoinPurchaseMemo;
5449
5473
  PaymentRequestMemo: PaymentRequestMemo;
5450
5474
  TxAckPaymentRequest: TxAckPaymentRequest;
5451
- DebugLinkInput: DebugLinkInput;
5452
- InternalMyAddressRequest: InternalMyAddressRequest;
5453
5475
  SetBusy: SetBusy;
5454
5476
  GetFirmwareHash: GetFirmwareHash;
5455
5477
  FirmwareHash: FirmwareHash;
5456
5478
  GetNonce: GetNonce;
5457
5479
  Nonce: Nonce;
5458
5480
  WriteSEPrivateKey: WriteSEPrivateKey;
5459
- SetWallpaper: SetWallpaper;
5460
- GetWallpaper: GetWallpaper;
5461
- Wallpaper: Wallpaper;
5462
5481
  UnlockPath: UnlockPath;
5463
5482
  UnlockedPathRequest: UnlockedPathRequest;
5464
- ViewAmount: ViewAmount;
5465
- ViewDetail: ViewDetail;
5466
- ViewTip: ViewTip;
5467
- ViewSignPage: ViewSignPage;
5468
- ViewVerifyPage: ViewVerifyPage;
5483
+ TxDetailsAmount: TxDetailsAmount;
5484
+ TxDetailsAddress: TxDetailsAddress;
5485
+ TxDetailsNetwork: TxDetailsNetwork;
5486
+ TxDetailsGeneral: TxDetailsGeneral;
5487
+ TxDetailsPage: TxDetailsPage;
5469
5488
  GetProtoVersion: GetProtoVersion;
5470
5489
  ProtoVersion: ProtoVersion;
5471
5490
  DevReboot: DevReboot;
5491
+ DeviceReboot: DeviceReboot;
5472
5492
  DevFirmwareImageInfo: DevFirmwareImageInfo;
5473
5493
  DevHardwareInfo: DevHardwareInfo;
5474
5494
  DevMainMcuInfo: DevMainMcuInfo;
@@ -5478,12 +5498,19 @@ export type MessageType = {
5478
5498
  DevInfoTypes: DevInfoTypes;
5479
5499
  DevStatus: DevStatus;
5480
5500
  DevGetDeviceInfo: DevGetDeviceInfo;
5501
+ DeviceGetDeviceInfo: DeviceGetDeviceInfo;
5481
5502
  DevFirmwareTarget: DevFirmwareTarget;
5503
+ DeviceFirmwareTarget: DeviceFirmwareTarget;
5482
5504
  DevFirmwareUpdate: DevFirmwareUpdate;
5505
+ DeviceFirmwareUpdate: DeviceFirmwareUpdate;
5483
5506
  DevFirmwareInstallProgress: DevFirmwareInstallProgress;
5507
+ DeviceFirmwareInstallProgress: DeviceFirmwareInstallProgress;
5484
5508
  DevFirmwareUpdateStatusEntry: DevFirmwareUpdateStatusEntry;
5509
+ DeviceFirmwareUpdateStatusEntry: DeviceFirmwareUpdateStatusEntry;
5485
5510
  DevGetFirmwareUpdateStatus: DevGetFirmwareUpdateStatus;
5511
+ DeviceGetFirmwareUpdateStatus: DeviceGetFirmwareUpdateStatus;
5486
5512
  DevFirmwareUpdateStatus: DevFirmwareUpdateStatus;
5513
+ DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
5487
5514
  FactoryDeviceInfoSettings: FactoryDeviceInfoSettings;
5488
5515
  FactoryGetDeviceInfo: FactoryGetDeviceInfo;
5489
5516
  FactoryDeviceInfo: FactoryDeviceInfo;