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

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 (58) hide show
  1. package/README.md +1 -1
  2. package/__tests__/messages.test.js +122 -0
  3. package/__tests__/protocol-v2-link-manager.test.js +326 -0
  4. package/__tests__/protocol-v2-usb-transport-base.test.js +296 -0
  5. package/__tests__/protocol-v2.test.js +371 -107
  6. package/dist/constants.d.ts +5 -3
  7. package/dist/constants.d.ts.map +1 -1
  8. package/dist/index.d.ts +912 -371
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +551 -254
  11. package/dist/protocols/index.d.ts +10 -5
  12. package/dist/protocols/index.d.ts.map +1 -1
  13. package/dist/protocols/v2/constants.d.ts +1 -0
  14. package/dist/protocols/v2/constants.d.ts.map +1 -1
  15. package/dist/protocols/v2/decode.d.ts +2 -2
  16. package/dist/protocols/v2/decode.d.ts.map +1 -1
  17. package/dist/protocols/v2/encode.d.ts +2 -3
  18. package/dist/protocols/v2/encode.d.ts.map +1 -1
  19. package/dist/protocols/v2/index.d.ts +0 -1
  20. package/dist/protocols/v2/index.d.ts.map +1 -1
  21. package/dist/protocols/v2/link-manager.d.ts +35 -0
  22. package/dist/protocols/v2/link-manager.d.ts.map +1 -0
  23. package/dist/protocols/v2/sequence-cursor.d.ts +5 -0
  24. package/dist/protocols/v2/sequence-cursor.d.ts.map +1 -0
  25. package/dist/protocols/v2/session.d.ts +15 -4
  26. package/dist/protocols/v2/session.d.ts.map +1 -1
  27. package/dist/protocols/v2/usb-transport-base.d.ts +31 -0
  28. package/dist/protocols/v2/usb-transport-base.d.ts.map +1 -0
  29. package/dist/serialization/protobuf/decode.d.ts.map +1 -1
  30. package/dist/serialization/protobuf/messages.d.ts.map +1 -1
  31. package/dist/types/messages.d.ts +535 -226
  32. package/dist/types/messages.d.ts.map +1 -1
  33. package/dist/types/transport.d.ts +5 -3
  34. package/dist/types/transport.d.ts.map +1 -1
  35. package/messages-protocol-v2.json +825 -709
  36. package/package.json +3 -3
  37. package/scripts/protobuf-build.sh +96 -310
  38. package/scripts/protobuf-patches/index.js +1 -0
  39. package/scripts/protobuf-types.js +12 -0
  40. package/src/constants.ts +21 -15
  41. package/src/index.ts +8 -0
  42. package/src/protocols/index.ts +31 -40
  43. package/src/protocols/v2/constants.ts +1 -0
  44. package/src/protocols/v2/crc8.ts +1 -1
  45. package/src/protocols/v2/decode.ts +31 -34
  46. package/src/protocols/v2/encode.ts +2 -28
  47. package/src/protocols/v2/index.ts +0 -1
  48. package/src/protocols/v2/link-manager.ts +160 -0
  49. package/src/protocols/v2/sequence-cursor.ts +10 -0
  50. package/src/protocols/v2/session.ts +79 -180
  51. package/src/protocols/v2/usb-transport-base.ts +194 -0
  52. package/src/serialization/protobuf/decode.ts +4 -1
  53. package/src/serialization/protobuf/messages.ts +6 -1
  54. package/src/types/messages.ts +637 -266
  55. package/src/types/transport.ts +3 -3
  56. package/dist/protocols/v2/debug.d.ts +0 -13
  57. package/dist/protocols/v2/debug.d.ts.map +0 -1
  58. package/src/protocols/v2/debug.ts +0 -26
@@ -882,11 +882,15 @@ export declare enum FailureType {
882
882
  Failure_PinMismatch = 12,
883
883
  Failure_WipeCodeMismatch = 13,
884
884
  Failure_InvalidSession = 14,
885
- Failure_FirmwareError = 99
885
+ Failure_FirmwareError = 99,
886
+ Failure_InvalidMessage = 1,
887
+ Failure_UndefinedError = 2,
888
+ Failure_UsageError = 3
886
889
  }
887
890
  export type Failure = {
888
891
  code?: FailureType;
889
892
  message?: string;
893
+ subcode?: number;
890
894
  };
891
895
  export declare enum Enum_ButtonRequestType {
892
896
  ButtonRequest_Other = 1,
@@ -1644,11 +1648,17 @@ export type KaspaAddress = {
1644
1648
  };
1645
1649
  export type KaspaSignTx = {
1646
1650
  address_n: number[];
1647
- raw_message: string;
1651
+ raw_message?: string;
1648
1652
  scheme?: string;
1649
1653
  prefix?: string;
1650
1654
  input_count?: number;
1651
1655
  use_tweak?: boolean;
1656
+ output_count?: number;
1657
+ version?: number;
1658
+ lock_time?: number;
1659
+ subnetwork_id?: string;
1660
+ gas?: number;
1661
+ payload_length?: number;
1652
1662
  };
1653
1663
  export type KaspaTxInputRequest = {
1654
1664
  request_index: number;
@@ -1658,6 +1668,77 @@ export type KaspaTxInputAck = {
1658
1668
  address_n: number[];
1659
1669
  raw_message: string;
1660
1670
  };
1671
+ export type KaspaOutpoint = {
1672
+ tx_id: string;
1673
+ index: number;
1674
+ };
1675
+ export declare enum Enum_KaspaInputScriptType {
1676
+ KASPA_SPEND_P2PK_SCHNORR = 0,
1677
+ KASPA_SPEND_P2PK_ECDSA = 1
1678
+ }
1679
+ export type KaspaInputScriptType = keyof typeof Enum_KaspaInputScriptType;
1680
+ export declare enum Enum_KaspaOutputScriptType {
1681
+ KASPA_PAYTOADDRESS = 0,
1682
+ KASPA_PAYTOCHANGE = 1
1683
+ }
1684
+ export type KaspaOutputScriptType = keyof typeof Enum_KaspaOutputScriptType;
1685
+ export declare enum Enum_KaspaRequestType {
1686
+ KASPA_TX_INPUT = 0,
1687
+ KASPA_TX_OUTPUT = 1,
1688
+ KASPA_TX_PAYLOAD = 2,
1689
+ KASPA_TX_FINISHED = 3,
1690
+ KASPA_TX_PREV_META = 4
1691
+ }
1692
+ export type KaspaRequestType = keyof typeof Enum_KaspaRequestType;
1693
+ export type KaspaTxRequestSignature = {
1694
+ signature_index: number;
1695
+ signature: string;
1696
+ };
1697
+ export type KaspaTxRequest = {
1698
+ request_type: KaspaRequestType;
1699
+ request_index?: number;
1700
+ signature?: KaspaTxRequestSignature;
1701
+ request_payload_length?: number;
1702
+ prev_tx_id?: string;
1703
+ };
1704
+ export type KaspaTxAckInput = {
1705
+ address_n: number[];
1706
+ previous_outpoint: KaspaOutpoint;
1707
+ amount: UintType;
1708
+ sequence: number;
1709
+ sig_op_count: number;
1710
+ script_type?: KaspaInputScriptType;
1711
+ use_tweak?: boolean;
1712
+ };
1713
+ export type KaspaTxAckOutput = {
1714
+ script_type?: KaspaOutputScriptType;
1715
+ amount: UintType;
1716
+ address_n: number[];
1717
+ address?: string;
1718
+ scheme?: string;
1719
+ use_tweak?: boolean;
1720
+ };
1721
+ export type KaspaTxAckPayloadChunk = {
1722
+ payload_chunk: string;
1723
+ };
1724
+ export type KaspaTxAckPrevMeta = {
1725
+ version: number;
1726
+ input_count: number;
1727
+ output_count: number;
1728
+ lock_time: number;
1729
+ subnetwork_id: string;
1730
+ gas: number;
1731
+ payload_length: number;
1732
+ };
1733
+ export type KaspaTxAckPrevInput = {
1734
+ previous_outpoint: KaspaOutpoint;
1735
+ sequence: number;
1736
+ };
1737
+ export type KaspaTxAckPrevOutput = {
1738
+ amount: UintType;
1739
+ script_version: number;
1740
+ script_public_key: string;
1741
+ };
1661
1742
  export type KaspaSignedTx = {
1662
1743
  signature: string;
1663
1744
  };
@@ -1684,7 +1765,7 @@ export declare enum Enum_SafetyCheckLevel {
1684
1765
  PromptAlways = 1,
1685
1766
  PromptTemporarily = 2
1686
1767
  }
1687
- export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel;
1768
+ export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel | Enum_SafetyCheckLevel;
1688
1769
  export type Initialize = {
1689
1770
  session_id?: string;
1690
1771
  _skip_passphrase?: boolean;
@@ -1823,6 +1904,19 @@ export type Features = {
1823
1904
  onekey_se04_state?: string | null;
1824
1905
  attach_to_pin_user?: boolean;
1825
1906
  unlocked_attach_pin?: boolean;
1907
+ coprocessor_bt_name?: string;
1908
+ coprocessor_version?: string;
1909
+ coprocessor_bt_enable?: boolean;
1910
+ romloader_version?: string;
1911
+ onekey_romloader_version?: string;
1912
+ onekey_romloader_hash?: string;
1913
+ onekey_bootloader_version?: string;
1914
+ onekey_bootloader_hash?: string;
1915
+ onekey_bootloader_build_id?: string;
1916
+ onekey_coprocessor_bt_name?: string;
1917
+ onekey_coprocessor_version?: string;
1918
+ onekey_coprocessor_build_id?: string;
1919
+ onekey_coprocessor_hash?: string;
1826
1920
  };
1827
1921
  export type OnekeyFeatures = {
1828
1922
  onekey_device_type?: OneKeyDeviceType;
@@ -1869,6 +1963,28 @@ export type OnekeyFeatures = {
1869
1963
  onekey_se02_boot_build_id?: string;
1870
1964
  onekey_se03_boot_build_id?: string;
1871
1965
  onekey_se04_boot_build_id?: string;
1966
+ onekey_romloader_version?: string;
1967
+ onekey_bootloader_version?: string;
1968
+ onekey_romloader_hash?: string;
1969
+ onekey_bootloader_hash?: string;
1970
+ onekey_romloader_build_id?: string;
1971
+ onekey_bootloader_build_id?: string;
1972
+ onekey_coprocessor_bt_name?: string;
1973
+ onekey_coprocessor_version?: string;
1974
+ onekey_coprocessor_build_id?: string;
1975
+ onekey_coprocessor_hash?: string;
1976
+ onekey_se01_bootloader_version?: string;
1977
+ onekey_se02_bootloader_version?: string;
1978
+ onekey_se03_bootloader_version?: string;
1979
+ onekey_se04_bootloader_version?: string;
1980
+ onekey_se01_bootloader_hash?: string;
1981
+ onekey_se02_bootloader_hash?: string;
1982
+ onekey_se03_bootloader_hash?: string;
1983
+ onekey_se04_bootloader_hash?: string;
1984
+ onekey_se01_bootloader_build_id?: string;
1985
+ onekey_se02_bootloader_build_id?: string;
1986
+ onekey_se03_bootloader_build_id?: string;
1987
+ onekey_se04_bootloader_build_id?: string;
1872
1988
  };
1873
1989
  export type LockDevice = {};
1874
1990
  export type EndSession = {};
@@ -2152,8 +2268,6 @@ export type UnLockDeviceResponse = {
2152
2268
  };
2153
2269
  export type GetPassphraseState = {
2154
2270
  passphrase_state?: string;
2155
- _only_main_pin?: boolean;
2156
- allow_create_attach_pin?: boolean;
2157
2271
  };
2158
2272
  export type PassphraseState = {
2159
2273
  passphrase_state?: string;
@@ -3325,6 +3439,24 @@ export type TxAckPaymentRequest = {
3325
3439
  amount?: UintType;
3326
3440
  signature: string;
3327
3441
  };
3442
+ export type EthereumSignTypedDataQR = {
3443
+ address_n: number[];
3444
+ json_data?: string;
3445
+ chain_id?: number;
3446
+ metamask_v4_compat?: boolean;
3447
+ request_id?: string;
3448
+ };
3449
+ export type InternalMyAddressRequest = {
3450
+ coin_type: number;
3451
+ chain_id: number;
3452
+ account_index: number;
3453
+ derive_type: number;
3454
+ };
3455
+ export type StartSession = {
3456
+ session_id?: string;
3457
+ _skip_passphrase?: boolean;
3458
+ derive_cardano?: boolean;
3459
+ };
3328
3460
  export type SetBusy = {
3329
3461
  expiry_ms?: number;
3330
3462
  };
@@ -3341,6 +3473,21 @@ export type Nonce = {
3341
3473
  export type WriteSEPrivateKey = {
3342
3474
  private_key: string;
3343
3475
  };
3476
+ export declare enum WallpaperTarget {
3477
+ Home = 0,
3478
+ Lock = 1
3479
+ }
3480
+ export type SetWallpaper = {
3481
+ target: WallpaperTarget;
3482
+ path: string;
3483
+ };
3484
+ export type GetWallpaper = {
3485
+ target: WallpaperTarget;
3486
+ };
3487
+ export type Wallpaper = {
3488
+ target: WallpaperTarget;
3489
+ path: string;
3490
+ };
3344
3491
  export type UnlockPath = {
3345
3492
  address_n: number[];
3346
3493
  mac?: string;
@@ -3354,225 +3501,356 @@ export declare enum MoneroNetworkType {
3354
3501
  STAGENET = 2,
3355
3502
  FAKECHAIN = 3
3356
3503
  }
3357
- export type TxDetailsAmount = {
3504
+ export type ViewAmount = {
3505
+ is_unlimited: boolean;
3358
3506
  num: string;
3359
- decimals: number;
3360
- symbol: string;
3361
- };
3362
- export type TxDetailsAddress = {
3363
- key: number;
3364
- address: string;
3365
- owner?: string;
3366
- icon?: string;
3367
- };
3368
- export type TxDetailsNetwork = {
3369
- coin_type: number;
3370
- chain_id?: number;
3371
3507
  };
3372
- export type TxDetailsGeneral = {
3508
+ export type ViewDetail = {
3373
3509
  key: number;
3374
3510
  value: string;
3375
3511
  is_overview: boolean;
3512
+ has_icon: boolean;
3376
3513
  };
3377
- export declare enum TxDetailsDisplayType {
3378
- DISPLAY_TYPE_INFO = 0,
3379
- DISPLAY_TYPE_SIGN = 1
3514
+ export declare enum ViewTipType {
3515
+ Default = 0,
3516
+ Highlight = 1,
3517
+ Recommend = 2,
3518
+ Warning = 3,
3519
+ Danger = 4
3380
3520
  }
3381
- export type TxDetailsPage = {
3521
+ export type ViewTip = {
3522
+ type: ViewTipType;
3523
+ text: string;
3524
+ };
3525
+ export type ViewRawData = {
3526
+ initial_data: string;
3527
+ placeholder: number;
3528
+ };
3529
+ export declare enum ViewSignLayout {
3530
+ LayoutDefault = 0,
3531
+ LayoutSafeTxCreate = 1,
3532
+ LayoutFinalConfirm = 2,
3533
+ Layout7702 = 3,
3534
+ LayoutFlat = 4,
3535
+ LayoutEthApprove = 5
3536
+ }
3537
+ export type ViewSignPage = {
3382
3538
  title: string;
3383
- display_type: TxDetailsDisplayType;
3384
3539
  amount?: UintType;
3385
- network?: TxDetailsNetwork;
3386
- address: TxDetailsAddress[];
3387
- general: TxDetailsGeneral[];
3540
+ general: ViewDetail[];
3541
+ tip?: ViewTip;
3542
+ raw_data?: ViewRawData;
3543
+ slide_to_confirm?: boolean;
3544
+ layout?: ViewSignLayout;
3388
3545
  };
3389
- export type GetProtoVersion = {};
3390
- export type ProtoVersion = {
3391
- proto_version: number;
3546
+ export type ViewVerifyPage = {
3547
+ title: string;
3548
+ address: string;
3549
+ path: string;
3550
+ network?: string;
3551
+ derive_type?: string;
3552
+ value_key?: number;
3392
3553
  };
3393
- export declare enum DevRebootType {
3394
- Normal = 0,
3395
- Boardloader = 1,
3396
- Bootloader = 2
3554
+ export type ProtocolInfoRequest = {};
3555
+ export type ProtocolInfo = {
3556
+ version: number;
3557
+ supported_messages: number[];
3558
+ protobuf_definition?: string;
3559
+ };
3560
+ export declare enum DeviceErrorCode {
3561
+ DeviceError_None = 0,
3562
+ DeviceError_Busy = 1,
3563
+ DeviceError_NotInitialized = 2,
3564
+ DeviceError_ActionCancelled = 3,
3565
+ DeviceError_PinAlreadyUsed = 4,
3566
+ DeviceError_PersistFailed = 5,
3567
+ DeviceError_SeError = 6,
3568
+ DeviceError_InvalidLanguage = 7,
3569
+ DeviceError_WallpaperNotUsable = 8,
3570
+ DeviceError_DeviceLocked = 9
3397
3571
  }
3398
3572
  export declare enum DeviceRebootType {
3399
3573
  Normal = 0,
3400
3574
  Romloader = 1,
3401
3575
  Bootloader = 2
3402
3576
  }
3403
- export type DevReboot = {
3404
- reboot_type: DevRebootType;
3405
- };
3406
3577
  export type DeviceReboot = {
3407
3578
  reboot_type: DeviceRebootType;
3408
3579
  };
3580
+ export type DeviceSettings = {
3581
+ bt_enable?: boolean;
3582
+ language?: string;
3583
+ wallpaper_path?: string;
3584
+ brightness?: number;
3585
+ animation_enable?: boolean;
3586
+ tap_to_wake?: boolean;
3587
+ haptic_feedback?: boolean;
3588
+ device_name_display_enabled?: boolean;
3589
+ airgap_mode?: boolean;
3590
+ usb_lock_enable?: boolean;
3591
+ random_keypad?: boolean;
3592
+ passphrase_enable?: boolean;
3593
+ fido_enabled?: boolean;
3594
+ autolock_delay_ms?: number;
3595
+ autoshutdown_delay_ms?: number;
3596
+ label?: string;
3597
+ };
3598
+ export type DeviceSettingsGet = {};
3599
+ export type DeviceSettingsSet = {
3600
+ settings: DeviceSettings;
3601
+ };
3602
+ export declare enum DeviceSettingsPage {
3603
+ DeviceReset = 0,
3604
+ DevicePinChange = 1,
3605
+ DevicePassphrase = 2,
3606
+ DeviceAirgap = 3
3607
+ }
3608
+ export type DeviceSettingsPageShow = {
3609
+ page: DeviceSettingsPage;
3610
+ field_name?: string;
3611
+ };
3612
+ export type DeviceCertificate = {
3613
+ cert_and_pubkey: string;
3614
+ private_key?: string;
3615
+ };
3616
+ export type DeviceCertificateWrite = {
3617
+ cert: DeviceCertificate;
3618
+ };
3619
+ export type DeviceCertificateRead = {};
3620
+ export type DeviceCertificateSignature = {
3621
+ data: string;
3622
+ };
3623
+ export type DeviceCertificateSign = {
3624
+ data: string;
3625
+ };
3626
+ export declare enum DeviceFirmwareTargetType {
3627
+ FW_MGMT_TARGET_INVALID = 0,
3628
+ FW_MGMT_TARGET_CRATE = 1,
3629
+ FW_MGMT_TARGET_ROMLOADER = 2,
3630
+ FW_MGMT_TARGET_BOOTLOADER = 3,
3631
+ FW_MGMT_TARGET_APPLICATION_P1 = 4,
3632
+ FW_MGMT_TARGET_APPLICATION_P2 = 5,
3633
+ FW_MGMT_TARGET_COPROCESSOR = 6,
3634
+ FW_MGMT_TARGET_SE01 = 7,
3635
+ FW_MGMT_TARGET_SE02 = 8,
3636
+ FW_MGMT_TARGET_SE03 = 9,
3637
+ FW_MGMT_TARGET_SE04 = 10
3638
+ }
3639
+ export declare enum DeviceFirmwareUpdateTaskStatus {
3640
+ FW_MGMT_UPDATER_TASK_STATUS_PENDING = 0,
3641
+ FW_MGMT_UPDATER_TASK_STATUS_IN_PROGRESS = 1,
3642
+ FW_MGMT_UPDATER_TASK_STATUS_FINISHED = 2,
3643
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_FILE_NOT_FOUND = 3,
3644
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_FILE_READ = 4,
3645
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_FILE_WRITE = 5,
3646
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_VERIFY = 6,
3647
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_INSTALL = 7,
3648
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_ABORT = 8,
3649
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_BUSY = 9,
3650
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_ENTRY_OUT_OF_BOUNDS = 10
3651
+ }
3652
+ export type DeviceFirmwareTarget = {
3653
+ target_id: DeviceFirmwareTargetType;
3654
+ path: string;
3655
+ };
3656
+ export type DeviceFirmwareUpdateRequest = {
3657
+ targets: DeviceFirmwareTarget[];
3658
+ };
3659
+ export type DeviceFirmwareUpdateRecord = {
3660
+ target_id: DeviceFirmwareTargetType;
3661
+ status?: DeviceFirmwareUpdateTaskStatus;
3662
+ payload_version?: number;
3663
+ path?: string;
3664
+ };
3665
+ export type DeviceFirmwareUpdateRecordFields = {
3666
+ status?: boolean;
3667
+ payload_version?: boolean;
3668
+ path?: boolean;
3669
+ };
3670
+ export type DeviceFirmwareUpdateStatusGet = {
3671
+ fields?: DeviceFirmwareUpdateRecordFields;
3672
+ };
3673
+ export type DeviceFirmwareUpdateStatus = {
3674
+ records: DeviceFirmwareUpdateRecord[];
3675
+ };
3676
+ export declare enum DeviceFactoryAck {
3677
+ FACTORY_ACK_SUCCESS = 0,
3678
+ FACTORY_ACK_FAIL = 1
3679
+ }
3680
+ export type DeviceFactoryInfoManufactureTime = {
3681
+ year: number;
3682
+ month: number;
3683
+ day: number;
3684
+ hour: number;
3685
+ minute: number;
3686
+ second: number;
3687
+ };
3688
+ export type DeviceFactoryInfo = {
3689
+ version?: number;
3690
+ serial_number?: string;
3691
+ burn_in_completed?: boolean;
3692
+ factory_test_completed?: boolean;
3693
+ manufacture_time?: DeviceFactoryInfoManufactureTime;
3694
+ };
3695
+ export type DeviceFactoryInfoSet = {
3696
+ info: DeviceFactoryInfo;
3697
+ };
3698
+ export type DeviceFactoryInfoGet = {};
3699
+ export type DeviceFactoryPermanentLock = {
3700
+ check_a: string;
3701
+ check_b: string;
3702
+ };
3703
+ export type DeviceFactoryTest = {
3704
+ burn_in_test: boolean;
3705
+ };
3409
3706
  export declare enum DeviceType {
3410
3707
  CLASSIC1 = 0,
3411
3708
  CLASSIC1S = 1,
3412
3709
  MINI = 2,
3413
3710
  TOUCH = 3,
3414
3711
  PRO = 5,
3415
- CLASSIC1S_PURE = 6
3712
+ CLASSIC1S_PURE = 6,
3713
+ PRO2 = 7,
3714
+ NEO = 8
3416
3715
  }
3417
- export declare enum DevSeType {
3716
+ export declare enum DeviceSeType {
3418
3717
  THD89 = 0,
3419
3718
  SE608A = 1
3420
3719
  }
3421
- export declare enum DevSEState {
3720
+ export declare enum DeviceSEState {
3422
3721
  BOOT = 0,
3423
3722
  APP_FACTORY = 51,
3424
3723
  APP = 85
3425
3724
  }
3426
- export type DevFirmwareImageInfo = {
3725
+ export type DeviceFirmwareImageInfo = {
3427
3726
  version?: string;
3428
3727
  build_id?: string;
3429
3728
  hash?: string;
3430
3729
  };
3431
- export type DevHardwareInfo = {
3432
- device_type?: DeviceType;
3730
+ export type DeviceHardwareInfo = {
3731
+ Device_type?: DeviceType;
3433
3732
  serial_no?: string;
3434
3733
  hardware_version?: string;
3435
3734
  hardware_version_raw_adc?: number;
3436
3735
  };
3437
- export type DevMainMcuInfo = {
3438
- board?: DevFirmwareImageInfo;
3439
- boot?: DevFirmwareImageInfo;
3440
- app?: DevFirmwareImageInfo;
3441
- };
3442
- export type DevBluetoothInfo = {
3443
- boot?: DevFirmwareImageInfo;
3444
- app?: DevFirmwareImageInfo;
3445
- adv_name?: string;
3446
- mac?: string;
3447
- };
3448
- export type DevSEInfo = {
3449
- boot?: DevFirmwareImageInfo;
3450
- app?: DevFirmwareImageInfo;
3451
- type?: DevSeType;
3452
- state?: DevSEState;
3453
- };
3454
- export type DevInfoTargets = {
3736
+ export type DeviceMainMcuInfo = {
3737
+ romloader?: DeviceFirmwareImageInfo;
3738
+ bootloader?: DeviceFirmwareImageInfo;
3739
+ application?: DeviceFirmwareImageInfo;
3740
+ application_data?: DeviceFirmwareImageInfo;
3741
+ };
3742
+ export type DeviceCoprocessorInfo = {
3743
+ bootloader?: DeviceFirmwareImageInfo;
3744
+ application?: DeviceFirmwareImageInfo;
3745
+ bt_adv_name?: string;
3746
+ bt_mac?: string;
3747
+ };
3748
+ export type DeviceSEInfo = {
3749
+ bootloader?: DeviceFirmwareImageInfo;
3750
+ application?: DeviceFirmwareImageInfo;
3751
+ type?: DeviceSeType;
3752
+ state?: DeviceSEState;
3753
+ };
3754
+ export type DeviceInfoTargets = {
3455
3755
  hw?: boolean;
3456
3756
  fw?: boolean;
3457
- bt?: boolean;
3757
+ coprocessor?: boolean;
3458
3758
  se1?: boolean;
3459
3759
  se2?: boolean;
3460
3760
  se3?: boolean;
3461
3761
  se4?: boolean;
3462
3762
  status?: boolean;
3463
3763
  };
3464
- export type DevInfoTypes = {
3764
+ export type DeviceInfoTypes = {
3465
3765
  version?: boolean;
3466
3766
  build_id?: boolean;
3467
3767
  hash?: boolean;
3468
3768
  specific?: boolean;
3469
3769
  };
3470
- export type DevStatus = {
3471
- language?: string;
3472
- bt_enable?: boolean;
3473
- init_states?: boolean;
3474
- backup_required?: boolean;
3475
- passphrase_protection?: boolean;
3476
- label?: string;
3477
- };
3478
- export type DevGetDeviceInfo = {
3479
- targets?: DevInfoTargets;
3480
- types?: DevInfoTypes;
3770
+ export type DeviceInfoGet = {
3771
+ targets?: DeviceInfoTargets;
3772
+ types?: DeviceInfoTypes;
3481
3773
  };
3482
- export type DeviceGetDeviceInfo = DevGetDeviceInfo;
3483
3774
  export type ProtocolV2DeviceInfo = {
3484
3775
  protocol_version: number;
3485
- hw?: DevHardwareInfo;
3486
- fw?: DevMainMcuInfo;
3487
- bt?: DevBluetoothInfo;
3488
- se1?: DevSEInfo;
3489
- se2?: DevSEInfo;
3490
- se3?: DevSEInfo;
3491
- se4?: DevSEInfo;
3492
- status?: DevStatus;
3493
- };
3494
- export declare enum DevFirmwareTargetType {
3495
- TARGET_INVALID = 0,
3496
- TARGET_ROMLOADER = 1,
3497
- TARGET_BOOTLOADER = 2,
3498
- TARGET_APPLICATION_P1 = 3,
3499
- TARGET_APPLICATION_P2 = 4,
3500
- TARGET_COPROCESSOR = 5,
3501
- TARGET_SE01 = 6,
3502
- TARGET_SE02 = 7,
3503
- TARGET_SE03 = 8,
3504
- TARGET_SE04 = 9,
3505
- TARGET_RESOURCE = 10
3506
- }
3507
- export declare enum DeviceFirmwareTargetType {
3508
- TARGET_INVALID = 0,
3509
- TARGET_ROMLOADER = 1,
3510
- TARGET_BOOTLOADER = 2,
3511
- TARGET_APPLICATION_P1 = 3,
3512
- TARGET_APPLICATION_P2 = 4,
3513
- TARGET_COPROCESSOR = 5,
3514
- TARGET_SE01 = 6,
3515
- TARGET_SE02 = 7,
3516
- TARGET_SE03 = 8,
3517
- TARGET_SE04 = 9,
3518
- TARGET_RESOURCE = 10
3519
- }
3520
- export type DevFirmwareTarget = {
3521
- target_id: DevFirmwareTargetType;
3522
- path: string;
3523
- };
3524
- export type DeviceFirmwareTarget = {
3525
- target_id: DeviceFirmwareTargetType;
3526
- path: string;
3527
- };
3528
- export type DevFirmwareUpdate = {
3529
- targets: DevFirmwareTarget[];
3530
- };
3531
- export type DeviceFirmwareUpdate = {
3532
- targets: DeviceFirmwareTarget[];
3533
- max_concurrent?: number;
3534
- };
3535
- export type DevFirmwareInstallProgress = {
3536
- target_id: DevFirmwareTargetType;
3537
- progress: number;
3538
- stage?: string;
3539
- };
3540
- export type DeviceFirmwareInstallProgress = {
3541
- target_id: DeviceFirmwareTargetType;
3542
- progress: number;
3543
- stage?: string;
3544
- };
3545
- export type DevFirmwareUpdateStatusEntry = {
3546
- target_id: DevFirmwareTargetType;
3547
- status: number;
3548
- };
3549
- export type DeviceFirmwareUpdateStatusEntry = {
3550
- target_id: DeviceFirmwareTargetType;
3551
- status: number;
3552
- };
3553
- export type DevGetFirmwareUpdateStatus = {};
3554
- export type DeviceGetFirmwareUpdateStatus = {};
3555
- export type DevFirmwareUpdateStatus = {
3556
- targets: DevFirmwareUpdateStatusEntry[];
3557
- };
3558
- export type DeviceFirmwareUpdateStatus = {
3559
- targets: DeviceFirmwareUpdateStatusEntry[];
3560
- };
3561
- export type FactoryDeviceInfoSettings = {
3562
- serial_no?: string;
3563
- cpu_info?: string;
3564
- pre_firmware?: string;
3776
+ hw?: DeviceHardwareInfo;
3777
+ fw?: DeviceMainMcuInfo;
3778
+ coprocessor?: DeviceCoprocessorInfo;
3779
+ se1?: DeviceSEInfo;
3780
+ se2?: DeviceSEInfo;
3781
+ se3?: DeviceSEInfo;
3782
+ se4?: DeviceSEInfo;
3783
+ status?: DeviceStatus;
3784
+ };
3785
+ export type DeviceSessionGet = {
3786
+ session_id?: string;
3565
3787
  };
3566
- export type FactoryGetDeviceInfo = {};
3567
- export type FactoryDeviceInfo = {
3568
- serial_no?: string;
3569
- spi_flash_info?: string;
3570
- se_info?: string;
3571
- nft_voucher?: string;
3572
- cpu_info?: string;
3573
- pre_firmware?: string;
3788
+ export type DeviceSession = {
3789
+ session_id?: string;
3790
+ btc_test_address?: string;
3574
3791
  };
3575
- export type FilesystemFixPermission = {};
3792
+ export type DeviceSessionAskPin = {};
3793
+ export declare enum DeviceSessionAskPin_FailureSubCodes {
3794
+ UserCancel = 1
3795
+ }
3796
+ export type DeviceStatus = {
3797
+ device_id?: string;
3798
+ unlocked?: boolean;
3799
+ init_states?: boolean;
3800
+ backup_required?: boolean;
3801
+ passphrase_enabled?: boolean;
3802
+ attach_to_pin_enabled?: boolean;
3803
+ unlocked_by_attach_to_pin?: boolean;
3804
+ };
3805
+ export type DeviceStatusGet = {};
3806
+ export declare enum DevOnboardingStep {
3807
+ DEV_ONBOARDING_STEP_UNKNOWN = 0,
3808
+ DEV_ONBOARDING_STEP_CHECKING = 1,
3809
+ DEV_ONBOARDING_STEP_PERSONALIZATION = 2,
3810
+ DEV_ONBOARDING_STEP_PIN = 3,
3811
+ DEV_ONBOARDING_STEP_SETUP = 4,
3812
+ DEV_ONBOARDING_STEP_DONE = 5
3813
+ }
3814
+ export declare enum DevOnboardingPhase {
3815
+ DEV_ONBOARDING_PHASE_UNKNOWN = 0,
3816
+ DEV_ONBOARDING_PHASE_SAFETY_CHECK = 1,
3817
+ DEV_ONBOARDING_PHASE_PIN_SETUP = 2,
3818
+ DEV_ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
3819
+ DEV_ONBOARDING_PHASE_SETUP_CHOICE = 4,
3820
+ DEV_ONBOARDING_PHASE_WALLET_CREATE_START = 5,
3821
+ DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
3822
+ DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
3823
+ DEV_ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
3824
+ DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
3825
+ DEV_ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
3826
+ DEV_ONBOARDING_PHASE_WALLET_READY = 11,
3827
+ DEV_ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
3828
+ DEV_ONBOARDING_PHASE_SEEDCARD_BACKUP = 13
3829
+ }
3830
+ export declare enum DevOnboardingSetupKind {
3831
+ DEV_ONBOARDING_SETUP_KIND_UNKNOWN = 0,
3832
+ DEV_ONBOARDING_SETUP_KIND_CHOICE = 1,
3833
+ DEV_ONBOARDING_SETUP_KIND_CREATE = 2,
3834
+ DEV_ONBOARDING_SETUP_KIND_RESTORE = 3
3835
+ }
3836
+ export declare enum DevOnboardingSetupMethod {
3837
+ DEV_ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
3838
+ DEV_ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
3839
+ DEV_ONBOARDING_SETUP_METHOD_SEEDCARD = 2
3840
+ }
3841
+ export type DevOnboardingSetupStatus = {
3842
+ kind?: DevOnboardingSetupKind;
3843
+ method?: DevOnboardingSetupMethod;
3844
+ };
3845
+ export type DevGetOnboardingStatus = {};
3846
+ export type DevOnboardingStatus = {
3847
+ step?: DevOnboardingStep;
3848
+ phase?: DevOnboardingPhase;
3849
+ setup?: DevOnboardingSetupStatus;
3850
+ pin_set?: boolean;
3851
+ wallet_initialized?: boolean;
3852
+ };
3853
+ export type FilesystemPermissionFix = {};
3576
3854
  export type FilesystemPathInfo = {
3577
3855
  exist: boolean;
3578
3856
  size: number;
@@ -3628,32 +3906,40 @@ export type FilesystemDirMake = {
3628
3906
  export type FilesystemDirRemove = {
3629
3907
  path: string;
3630
3908
  };
3631
- export type FilesystemFormat = {};
3632
- export declare enum OnboardingStep {
3633
- ONBOARDING_STEP_UNKNOWN = 0,
3634
- ONBOARDING_STEP_DEVICE_VERIFICATION = 1,
3635
- ONBOARDING_STEP_PERSONALIZATION = 2,
3636
- ONBOARDING_STEP_SETUP = 3,
3637
- ONBOARDING_STEP_FIRMWARE = 4
3909
+ export type FilesystemFormat = {
3910
+ data: boolean;
3911
+ user: boolean;
3912
+ };
3913
+ export type PortfolioUpdate = {};
3914
+ export declare enum ProtocolV2FailureType {
3915
+ Failure_InvalidMessage = 1,
3916
+ Failure_UndefinedError = 2,
3917
+ Failure_UsageError = 3,
3918
+ Failure_DataError = 4,
3919
+ Failure_ProcessError = 5
3638
3920
  }
3639
- export type GetOnboardingStatus = {};
3640
- export type NewDevice = {
3641
- seedcard_backup?: boolean;
3642
- };
3643
- export type Restore = {
3644
- mnemonic?: boolean;
3645
- seedcard?: boolean;
3646
- };
3647
- export type Setup = {
3648
- new_device?: NewDevice;
3649
- restore?: Restore;
3650
- };
3651
- export type OnboardingStatus = {
3652
- step: OnboardingStep;
3653
- setup?: Setup;
3654
- detail_code?: number;
3655
- detail_str?: string;
3656
- };
3921
+ export declare enum Enum_ProtocolV2Capability {
3922
+ Capability_Bitcoin = 1,
3923
+ Capability_Bitcoin_like = 2,
3924
+ Capability_Binance = 3,
3925
+ Capability_Cardano = 4,
3926
+ Capability_Crypto = 5,
3927
+ Capability_EOS = 6,
3928
+ Capability_Ethereum = 7,
3929
+ Capability_Lisk = 8,
3930
+ Capability_Monero = 9,
3931
+ Capability_NEM = 10,
3932
+ Capability_Ripple = 11,
3933
+ Capability_Stellar = 12,
3934
+ Capability_Tezos = 13,
3935
+ Capability_U2F = 14,
3936
+ Capability_Shamir = 15,
3937
+ Capability_ShamirGroups = 16,
3938
+ Capability_PassphraseEntry = 17,
3939
+ Capability_AttachToPin = 18,
3940
+ Capability_EthereumTypedData = 1000
3941
+ }
3942
+ export type ProtocolV2Capability = keyof typeof Enum_ProtocolV2Capability;
3657
3943
  export type MessageType = {
3658
3944
  AlephiumGetAddress: AlephiumGetAddress;
3659
3945
  AlephiumAddress: AlephiumAddress;
@@ -3928,6 +4214,15 @@ export type MessageType = {
3928
4214
  KaspaSignTx: KaspaSignTx;
3929
4215
  KaspaTxInputRequest: KaspaTxInputRequest;
3930
4216
  KaspaTxInputAck: KaspaTxInputAck;
4217
+ KaspaOutpoint: KaspaOutpoint;
4218
+ KaspaTxRequestSignature: KaspaTxRequestSignature;
4219
+ KaspaTxRequest: KaspaTxRequest;
4220
+ KaspaTxAckInput: KaspaTxAckInput;
4221
+ KaspaTxAckOutput: KaspaTxAckOutput;
4222
+ KaspaTxAckPayloadChunk: KaspaTxAckPayloadChunk;
4223
+ KaspaTxAckPrevMeta: KaspaTxAckPrevMeta;
4224
+ KaspaTxAckPrevInput: KaspaTxAckPrevInput;
4225
+ KaspaTxAckPrevOutput: KaspaTxAckPrevOutput;
3931
4226
  KaspaSignedTx: KaspaSignedTx;
3932
4227
  LnurlAuth: LnurlAuth;
3933
4228
  LnurlAuthResp: LnurlAuthResp;
@@ -4217,49 +4512,67 @@ export type MessageType = {
4217
4512
  CoinPurchaseMemo: CoinPurchaseMemo;
4218
4513
  PaymentRequestMemo: PaymentRequestMemo;
4219
4514
  TxAckPaymentRequest: TxAckPaymentRequest;
4515
+ EthereumSignTypedDataQR: EthereumSignTypedDataQR;
4516
+ InternalMyAddressRequest: InternalMyAddressRequest;
4517
+ StartSession: StartSession;
4220
4518
  SetBusy: SetBusy;
4221
4519
  GetFirmwareHash: GetFirmwareHash;
4222
4520
  FirmwareHash: FirmwareHash;
4223
4521
  GetNonce: GetNonce;
4224
4522
  Nonce: Nonce;
4225
4523
  WriteSEPrivateKey: WriteSEPrivateKey;
4524
+ SetWallpaper: SetWallpaper;
4525
+ GetWallpaper: GetWallpaper;
4526
+ Wallpaper: Wallpaper;
4226
4527
  UnlockPath: UnlockPath;
4227
4528
  UnlockedPathRequest: UnlockedPathRequest;
4228
- TxDetailsAmount: TxDetailsAmount;
4229
- TxDetailsAddress: TxDetailsAddress;
4230
- TxDetailsNetwork: TxDetailsNetwork;
4231
- TxDetailsGeneral: TxDetailsGeneral;
4232
- TxDetailsPage: TxDetailsPage;
4233
- GetProtoVersion: GetProtoVersion;
4234
- ProtoVersion: ProtoVersion;
4235
- DevReboot: DevReboot;
4529
+ ViewAmount: ViewAmount;
4530
+ ViewDetail: ViewDetail;
4531
+ ViewTip: ViewTip;
4532
+ ViewRawData: ViewRawData;
4533
+ ViewSignPage: ViewSignPage;
4534
+ ViewVerifyPage: ViewVerifyPage;
4535
+ ProtocolInfoRequest: ProtocolInfoRequest;
4536
+ ProtocolInfo: ProtocolInfo;
4236
4537
  DeviceReboot: DeviceReboot;
4237
- DevFirmwareImageInfo: DevFirmwareImageInfo;
4238
- DevHardwareInfo: DevHardwareInfo;
4239
- DevMainMcuInfo: DevMainMcuInfo;
4240
- DevBluetoothInfo: DevBluetoothInfo;
4241
- DevSEInfo: DevSEInfo;
4242
- DevInfoTargets: DevInfoTargets;
4243
- DevInfoTypes: DevInfoTypes;
4244
- DevStatus: DevStatus;
4245
- DevGetDeviceInfo: DevGetDeviceInfo;
4246
- DeviceGetDeviceInfo: DeviceGetDeviceInfo;
4247
- DevFirmwareTarget: DevFirmwareTarget;
4538
+ DeviceSettings: DeviceSettings;
4539
+ DeviceSettingsGet: DeviceSettingsGet;
4540
+ DeviceSettingsSet: DeviceSettingsSet;
4541
+ DeviceSettingsPageShow: DeviceSettingsPageShow;
4542
+ DeviceCertificate: DeviceCertificate;
4543
+ DeviceCertificateWrite: DeviceCertificateWrite;
4544
+ DeviceCertificateRead: DeviceCertificateRead;
4545
+ DeviceCertificateSignature: DeviceCertificateSignature;
4546
+ DeviceCertificateSign: DeviceCertificateSign;
4248
4547
  DeviceFirmwareTarget: DeviceFirmwareTarget;
4249
- DevFirmwareUpdate: DevFirmwareUpdate;
4250
- DeviceFirmwareUpdate: DeviceFirmwareUpdate;
4251
- DevFirmwareInstallProgress: DevFirmwareInstallProgress;
4252
- DeviceFirmwareInstallProgress: DeviceFirmwareInstallProgress;
4253
- DevFirmwareUpdateStatusEntry: DevFirmwareUpdateStatusEntry;
4254
- DeviceFirmwareUpdateStatusEntry: DeviceFirmwareUpdateStatusEntry;
4255
- DevGetFirmwareUpdateStatus: DevGetFirmwareUpdateStatus;
4256
- DeviceGetFirmwareUpdateStatus: DeviceGetFirmwareUpdateStatus;
4257
- DevFirmwareUpdateStatus: DevFirmwareUpdateStatus;
4548
+ DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
4549
+ DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
4550
+ DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
4551
+ DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
4258
4552
  DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
4259
- FactoryDeviceInfoSettings: FactoryDeviceInfoSettings;
4260
- FactoryGetDeviceInfo: FactoryGetDeviceInfo;
4261
- FactoryDeviceInfo: FactoryDeviceInfo;
4262
- FilesystemFixPermission: FilesystemFixPermission;
4553
+ DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
4554
+ DeviceFactoryInfo: DeviceFactoryInfo;
4555
+ DeviceFactoryInfoSet: DeviceFactoryInfoSet;
4556
+ DeviceFactoryInfoGet: DeviceFactoryInfoGet;
4557
+ DeviceFactoryPermanentLock: DeviceFactoryPermanentLock;
4558
+ DeviceFactoryTest: DeviceFactoryTest;
4559
+ DeviceFirmwareImageInfo: DeviceFirmwareImageInfo;
4560
+ DeviceHardwareInfo: DeviceHardwareInfo;
4561
+ DeviceMainMcuInfo: DeviceMainMcuInfo;
4562
+ DeviceCoprocessorInfo: DeviceCoprocessorInfo;
4563
+ DeviceSEInfo: DeviceSEInfo;
4564
+ DeviceInfoTargets: DeviceInfoTargets;
4565
+ DeviceInfoTypes: DeviceInfoTypes;
4566
+ DeviceInfoGet: DeviceInfoGet;
4567
+ DeviceSessionGet: DeviceSessionGet;
4568
+ DeviceSession: DeviceSession;
4569
+ DeviceSessionAskPin: DeviceSessionAskPin;
4570
+ DeviceStatus: DeviceStatus;
4571
+ DeviceStatusGet: DeviceStatusGet;
4572
+ DevOnboardingSetupStatus: DevOnboardingSetupStatus;
4573
+ DevGetOnboardingStatus: DevGetOnboardingStatus;
4574
+ DevOnboardingStatus: DevOnboardingStatus;
4575
+ FilesystemPermissionFix: FilesystemPermissionFix;
4263
4576
  FilesystemPathInfo: FilesystemPathInfo;
4264
4577
  FilesystemPathInfoQuery: FilesystemPathInfoQuery;
4265
4578
  FilesystemFile: FilesystemFile;
@@ -4271,11 +4584,7 @@ export type MessageType = {
4271
4584
  FilesystemDirMake: FilesystemDirMake;
4272
4585
  FilesystemDirRemove: FilesystemDirRemove;
4273
4586
  FilesystemFormat: FilesystemFormat;
4274
- GetOnboardingStatus: GetOnboardingStatus;
4275
- NewDevice: NewDevice;
4276
- Restore: Restore;
4277
- Setup: Setup;
4278
- OnboardingStatus: OnboardingStatus;
4587
+ PortfolioUpdate: PortfolioUpdate;
4279
4588
  };
4280
4589
  export type MessageKey = keyof MessageType;
4281
4590
  export type MessageResponse<T extends MessageKey> = {