@onekeyfe/hd-transport 1.2.0-alpha.3 → 1.2.0-alpha.30

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 (65) hide show
  1. package/README.md +1 -1
  2. package/__tests__/messages.test.js +142 -0
  3. package/__tests__/protocol-v2-ble-frame-writer.test.js +119 -0
  4. package/__tests__/protocol-v2-link-manager.test.js +389 -0
  5. package/__tests__/protocol-v2-usb-transport-base.test.js +330 -0
  6. package/__tests__/protocol-v2.test.js +555 -119
  7. package/dist/constants.d.ts +6 -3
  8. package/dist/constants.d.ts.map +1 -1
  9. package/dist/index.d.ts +981 -278
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +759 -247
  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 +38 -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 +523 -158
  37. package/dist/types/messages.d.ts.map +1 -1
  38. package/dist/types/transport.d.ts +13 -3
  39. package/dist/types/transport.d.ts.map +1 -1
  40. package/messages-protocol-v2.json +796 -620
  41. package/package.json +3 -3
  42. package/scripts/protobuf-build.sh +96 -310
  43. package/scripts/protobuf-patches/index.js +1 -0
  44. package/scripts/protobuf-types.js +19 -1
  45. package/src/constants.ts +29 -15
  46. package/src/index.ts +11 -1
  47. package/src/protocols/index.ts +39 -40
  48. package/src/protocols/v2/ble-frame-writer.ts +77 -0
  49. package/src/protocols/v2/constants.ts +1 -0
  50. package/src/protocols/v2/crc8.ts +1 -1
  51. package/src/protocols/v2/decode.ts +71 -37
  52. package/src/protocols/v2/encode.ts +2 -28
  53. package/src/protocols/v2/errors.ts +25 -0
  54. package/src/protocols/v2/frame-assembler.ts +6 -4
  55. package/src/protocols/v2/index.ts +2 -1
  56. package/src/protocols/v2/link-manager.ts +186 -0
  57. package/src/protocols/v2/sequence-cursor.ts +10 -0
  58. package/src/protocols/v2/session.ts +157 -201
  59. package/src/protocols/v2/usb-transport-base.ts +213 -0
  60. package/src/serialization/protobuf/decode.ts +4 -1
  61. package/src/types/messages.ts +623 -181
  62. package/src/types/transport.ts +13 -3
  63. package/dist/protocols/v2/debug.d.ts +0 -13
  64. package/dist/protocols/v2/debug.d.ts.map +0 -1
  65. 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,12 +3439,12 @@ export type TxAckPaymentRequest = {
3325
3439
  amount?: UintType;
3326
3440
  signature: string;
3327
3441
  };
3328
- export type DebugLinkInput = {
3329
- x?: number;
3330
- y?: number;
3331
- duration_ms?: number;
3332
- x_end?: number;
3333
- y_end?: number;
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;
3334
3448
  };
3335
3449
  export type InternalMyAddressRequest = {
3336
3450
  coin_type: number;
@@ -3338,6 +3452,11 @@ export type InternalMyAddressRequest = {
3338
3452
  account_index: number;
3339
3453
  derive_type: number;
3340
3454
  };
3455
+ export type StartSession = {
3456
+ session_id?: string;
3457
+ _skip_passphrase?: boolean;
3458
+ derive_cardano?: boolean;
3459
+ };
3341
3460
  export type SetBusy = {
3342
3461
  expiry_ms?: number;
3343
3462
  };
@@ -3382,6 +3501,20 @@ export declare enum MoneroNetworkType {
3382
3501
  STAGENET = 2,
3383
3502
  FAKECHAIN = 3
3384
3503
  }
3504
+ export declare enum UiAnimationType {
3505
+ Unknown = 0,
3506
+ Signing = 1
3507
+ }
3508
+ export declare enum UiAnimationCommand {
3509
+ CommandUnknown = 0,
3510
+ Start = 1,
3511
+ Stop = 2,
3512
+ Refresh = 3
3513
+ }
3514
+ export type UiAnimationRequest = {
3515
+ command: UiAnimationCommand;
3516
+ type?: UiAnimationType;
3517
+ };
3385
3518
  export type ViewAmount = {
3386
3519
  is_unlimited: boolean;
3387
3520
  num: string;
@@ -3403,28 +3536,188 @@ export type ViewTip = {
3403
3536
  type: ViewTipType;
3404
3537
  text: string;
3405
3538
  };
3539
+ export type ViewRawData = {
3540
+ initial_data: string;
3541
+ placeholder: number;
3542
+ };
3543
+ export declare enum ViewSignLayout {
3544
+ LayoutDefault = 0,
3545
+ LayoutSafeTxCreate = 1,
3546
+ LayoutFinalConfirm = 2,
3547
+ Layout7702 = 3,
3548
+ LayoutFlat = 4,
3549
+ LayoutEthApprove = 5
3550
+ }
3406
3551
  export type ViewSignPage = {
3407
3552
  title: string;
3408
3553
  amount?: UintType;
3409
3554
  general: ViewDetail[];
3410
3555
  tip?: ViewTip;
3556
+ raw_data?: ViewRawData;
3557
+ slide_to_confirm?: boolean;
3558
+ layout?: ViewSignLayout;
3411
3559
  };
3412
3560
  export type ViewVerifyPage = {
3413
3561
  title: string;
3414
3562
  address: string;
3415
3563
  path: string;
3564
+ network?: string;
3565
+ derive_type?: string;
3566
+ value_key?: number;
3416
3567
  };
3417
- export type GetProtoVersion = {};
3418
- export type ProtoVersion = {
3419
- proto_version: number;
3568
+ export type ProtocolInfoRequest = {
3569
+ eventless_wallet_session?: boolean;
3420
3570
  };
3421
- export declare enum DevRebootType {
3571
+ export type ProtocolInfo = {
3572
+ version: number;
3573
+ supported_messages: number[];
3574
+ protobuf_definition?: string;
3575
+ };
3576
+ export declare enum DeviceErrorCode {
3577
+ DeviceError_None = 0,
3578
+ DeviceError_Busy = 1,
3579
+ DeviceError_NotInitialized = 2,
3580
+ DeviceError_ActionCancelled = 3,
3581
+ DeviceError_PinAlreadyUsed = 4,
3582
+ DeviceError_PersistFailed = 5,
3583
+ DeviceError_SeError = 6,
3584
+ DeviceError_InvalidLanguage = 7,
3585
+ DeviceError_WallpaperNotUsable = 8,
3586
+ DeviceError_DeviceLocked = 9
3587
+ }
3588
+ export declare enum DeviceRebootType {
3422
3589
  Normal = 0,
3423
- Boardloader = 1,
3590
+ Romloader = 1,
3424
3591
  Bootloader = 2
3425
3592
  }
3426
- export type DevReboot = {
3427
- reboot_type: DevRebootType;
3593
+ export type DeviceReboot = {
3594
+ reboot_type: DeviceRebootType;
3595
+ };
3596
+ export type DeviceSettings = {
3597
+ bt_enable?: boolean;
3598
+ language?: string;
3599
+ wallpaper_path?: string;
3600
+ brightness?: number;
3601
+ animation_enable?: boolean;
3602
+ tap_to_wake?: boolean;
3603
+ haptic_feedback?: boolean;
3604
+ device_name_display_enabled?: boolean;
3605
+ airgap_mode?: boolean;
3606
+ usb_lock_enable?: boolean;
3607
+ random_keypad?: boolean;
3608
+ passphrase_enable?: boolean;
3609
+ fido_enabled?: boolean;
3610
+ autolock_delay_ms?: number;
3611
+ autoshutdown_delay_ms?: number;
3612
+ label?: string;
3613
+ };
3614
+ export type DeviceSettingsGet = {};
3615
+ export type DeviceSettingsSet = {
3616
+ settings: DeviceSettings;
3617
+ };
3618
+ export declare enum DeviceSettingsPage {
3619
+ DeviceReset = 0,
3620
+ DevicePinChange = 1,
3621
+ DevicePassphrase = 2,
3622
+ DeviceAirgap = 3
3623
+ }
3624
+ export type DeviceSettingsPageShow = {
3625
+ page: DeviceSettingsPage;
3626
+ field_name?: string;
3627
+ };
3628
+ export type DeviceCertificate = {
3629
+ cert_and_pubkey: string;
3630
+ private_key?: string;
3631
+ };
3632
+ export type DeviceCertificateWrite = {
3633
+ cert: DeviceCertificate;
3634
+ };
3635
+ export type DeviceCertificateRead = {};
3636
+ export type DeviceCertificateSignature = {
3637
+ data: string;
3638
+ };
3639
+ export type DeviceCertificateSign = {
3640
+ data: string;
3641
+ };
3642
+ export declare enum DeviceFirmwareTargetType {
3643
+ FW_MGMT_TARGET_INVALID = 0,
3644
+ FW_MGMT_TARGET_CRATE = 1,
3645
+ FW_MGMT_TARGET_ROMLOADER = 2,
3646
+ FW_MGMT_TARGET_BOOTLOADER = 3,
3647
+ FW_MGMT_TARGET_APPLICATION_P1 = 4,
3648
+ FW_MGMT_TARGET_APPLICATION_P2 = 5,
3649
+ FW_MGMT_TARGET_COPROCESSOR = 6,
3650
+ FW_MGMT_TARGET_SE01 = 7,
3651
+ FW_MGMT_TARGET_SE02 = 8,
3652
+ FW_MGMT_TARGET_SE03 = 9,
3653
+ FW_MGMT_TARGET_SE04 = 10
3654
+ }
3655
+ export declare enum DeviceFirmwareUpdateTaskStatus {
3656
+ FW_MGMT_UPDATER_TASK_STATUS_PENDING = 0,
3657
+ FW_MGMT_UPDATER_TASK_STATUS_IN_PROGRESS = 1,
3658
+ FW_MGMT_UPDATER_TASK_STATUS_FINISHED = 2,
3659
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_FILE_NOT_FOUND = 3,
3660
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_FILE_READ = 4,
3661
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_FILE_WRITE = 5,
3662
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_VERIFY = 6,
3663
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_INSTALL = 7,
3664
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_ABORT = 8,
3665
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_BUSY = 9,
3666
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_ENTRY_OUT_OF_BOUNDS = 10
3667
+ }
3668
+ export type DeviceFirmwareTarget = {
3669
+ target_id: DeviceFirmwareTargetType;
3670
+ path: string;
3671
+ };
3672
+ export type DeviceFirmwareUpdateRequest = {
3673
+ targets: DeviceFirmwareTarget[];
3674
+ };
3675
+ export type DeviceFirmwareUpdateRecord = {
3676
+ target_id: DeviceFirmwareTargetType;
3677
+ status?: DeviceFirmwareUpdateTaskStatus;
3678
+ payload_version?: number;
3679
+ path?: string;
3680
+ };
3681
+ export type DeviceFirmwareUpdateRecordFields = {
3682
+ status?: boolean;
3683
+ payload_version?: boolean;
3684
+ path?: boolean;
3685
+ };
3686
+ export type DeviceFirmwareUpdateStatusGet = {
3687
+ fields?: DeviceFirmwareUpdateRecordFields;
3688
+ };
3689
+ export type DeviceFirmwareUpdateStatus = {
3690
+ records: DeviceFirmwareUpdateRecord[];
3691
+ };
3692
+ export declare enum DeviceFactoryAck {
3693
+ FACTORY_ACK_SUCCESS = 0,
3694
+ FACTORY_ACK_FAIL = 1
3695
+ }
3696
+ export type DeviceFactoryInfoManufactureTime = {
3697
+ year: number;
3698
+ month: number;
3699
+ day: number;
3700
+ hour: number;
3701
+ minute: number;
3702
+ second: number;
3703
+ };
3704
+ export type DeviceFactoryInfo = {
3705
+ version?: number;
3706
+ serial_number?: string;
3707
+ burn_in_completed?: boolean;
3708
+ factory_test_completed?: boolean;
3709
+ manufacture_time?: DeviceFactoryInfoManufactureTime;
3710
+ };
3711
+ export type DeviceFactoryInfoSet = {
3712
+ info: DeviceFactoryInfo;
3713
+ };
3714
+ export type DeviceFactoryInfoGet = {};
3715
+ export type DeviceFactoryPermanentLock = {
3716
+ check_a: string;
3717
+ check_b: string;
3718
+ };
3719
+ export type DeviceFactoryTest = {
3720
+ burn_in_test: boolean;
3428
3721
  };
3429
3722
  export declare enum DeviceType {
3430
3723
  CLASSIC1 = 0,
@@ -3432,130 +3725,166 @@ export declare enum DeviceType {
3432
3725
  MINI = 2,
3433
3726
  TOUCH = 3,
3434
3727
  PRO = 5,
3435
- CLASSIC1S_PURE = 6
3728
+ CLASSIC1S_PURE = 6,
3729
+ PRO2 = 7,
3730
+ NEO = 8
3436
3731
  }
3437
- export declare enum DevSeType {
3732
+ export declare enum DeviceSeType {
3438
3733
  THD89 = 0,
3439
3734
  SE608A = 1
3440
3735
  }
3441
- export declare enum DevSEState {
3736
+ export declare enum DeviceSEState {
3442
3737
  BOOT = 0,
3443
3738
  APP_FACTORY = 51,
3444
3739
  APP = 85
3445
3740
  }
3446
- export type DevFirmwareImageInfo = {
3741
+ export type DeviceFirmwareImageInfo = {
3447
3742
  version?: string;
3448
3743
  build_id?: string;
3449
3744
  hash?: string;
3450
3745
  };
3451
- export type DevHardwareInfo = {
3452
- device_type?: DeviceType;
3746
+ export type DeviceHardwareInfo = {
3747
+ Device_type?: DeviceType;
3453
3748
  serial_no?: string;
3454
- device_id?: string;
3455
3749
  hardware_version?: string;
3456
3750
  hardware_version_raw_adc?: number;
3457
3751
  };
3458
- export type DevMainMcuInfo = {
3459
- board?: DevFirmwareImageInfo;
3460
- boot?: DevFirmwareImageInfo;
3461
- app?: DevFirmwareImageInfo;
3462
- };
3463
- export type DevBluetoothInfo = {
3464
- boot?: DevFirmwareImageInfo;
3465
- app?: DevFirmwareImageInfo;
3466
- adv_name?: string;
3467
- mac?: string;
3468
- };
3469
- export type DevSEInfo = {
3470
- boot?: DevFirmwareImageInfo;
3471
- app?: DevFirmwareImageInfo;
3472
- type?: DevSeType;
3473
- state?: DevSEState;
3474
- };
3475
- export type DevInfoTargets = {
3752
+ export type DeviceMainMcuInfo = {
3753
+ romloader?: DeviceFirmwareImageInfo;
3754
+ bootloader?: DeviceFirmwareImageInfo;
3755
+ application?: DeviceFirmwareImageInfo;
3756
+ application_data?: DeviceFirmwareImageInfo;
3757
+ };
3758
+ export type DeviceCoprocessorInfo = {
3759
+ bootloader?: DeviceFirmwareImageInfo;
3760
+ application?: DeviceFirmwareImageInfo;
3761
+ bt_adv_name?: string;
3762
+ bt_mac?: string;
3763
+ };
3764
+ export type DeviceSEInfo = {
3765
+ bootloader?: DeviceFirmwareImageInfo;
3766
+ application?: DeviceFirmwareImageInfo;
3767
+ type?: DeviceSeType;
3768
+ state?: DeviceSEState;
3769
+ };
3770
+ export type DeviceInfoTargets = {
3476
3771
  hw?: boolean;
3477
3772
  fw?: boolean;
3478
- bt?: boolean;
3773
+ coprocessor?: boolean;
3479
3774
  se1?: boolean;
3480
3775
  se2?: boolean;
3481
3776
  se3?: boolean;
3482
3777
  se4?: boolean;
3483
3778
  status?: boolean;
3484
3779
  };
3485
- export type DevInfoTypes = {
3780
+ export type DeviceInfoTypes = {
3486
3781
  version?: boolean;
3487
3782
  build_id?: boolean;
3488
3783
  hash?: boolean;
3489
3784
  specific?: boolean;
3490
3785
  };
3491
- export type DevStatus = {
3492
- language?: string;
3493
- bt_enable?: boolean;
3494
- init_states?: boolean;
3495
- backup_required?: boolean;
3496
- passphrase_protection?: boolean;
3497
- label?: string;
3498
- };
3499
- export type DevGetDeviceInfo = {
3500
- targets?: DevInfoTargets;
3501
- types?: DevInfoTypes;
3786
+ export type DeviceInfoGet = {
3787
+ targets?: DeviceInfoTargets;
3788
+ types?: DeviceInfoTypes;
3502
3789
  };
3503
3790
  export type ProtocolV2DeviceInfo = {
3504
3791
  protocol_version: number;
3505
- hw?: DevHardwareInfo;
3506
- fw?: DevMainMcuInfo;
3507
- bt?: DevBluetoothInfo;
3508
- se1?: DevSEInfo;
3509
- se2?: DevSEInfo;
3510
- se3?: DevSEInfo;
3511
- se4?: DevSEInfo;
3512
- status?: DevStatus;
3513
- };
3514
- export declare enum DevFirmwareTargetType {
3515
- TARGET_MAIN_APP = 0,
3516
- TARGET_MAIN_BOOT = 1,
3517
- TARGET_BT = 2,
3518
- TARGET_SE1 = 3,
3519
- TARGET_SE2 = 4,
3520
- TARGET_SE3 = 5,
3521
- TARGET_SE4 = 6,
3522
- TARGET_RESOURCE = 10
3792
+ hw?: DeviceHardwareInfo;
3793
+ fw?: DeviceMainMcuInfo;
3794
+ coprocessor?: DeviceCoprocessorInfo;
3795
+ se1?: DeviceSEInfo;
3796
+ se2?: DeviceSEInfo;
3797
+ se3?: DeviceSEInfo;
3798
+ se4?: DeviceSEInfo;
3799
+ status?: DeviceStatus;
3800
+ };
3801
+ export declare enum DeviceSessionErrorCode {
3802
+ DeviceSessionError_None = 0,
3803
+ DeviceSessionError_UserCancelled = 1,
3804
+ DeviceSessionError_InvalidSession = 2,
3805
+ DeviceSessionError_AttachPinUnavailable = 3,
3806
+ DeviceSessionError_PassphraseDisabled = 4,
3807
+ DeviceSessionError_Busy = 5
3523
3808
  }
3524
- export type DevFirmwareTarget = {
3525
- target_id: DevFirmwareTargetType;
3526
- path: string;
3527
- };
3528
- export type DevFirmwareUpdate = {
3529
- targets: DevFirmwareTarget[];
3530
- };
3531
- export type DevFirmwareInstallProgress = {
3532
- target_id: DevFirmwareTargetType;
3533
- progress: number;
3534
- stage?: string;
3535
- };
3536
- export type DevFirmwareUpdateStatusEntry = {
3537
- target_id: DevFirmwareTargetType;
3538
- status: number;
3809
+ export type DeviceSessionGet = {
3810
+ session_id?: string;
3539
3811
  };
3540
- export type DevGetFirmwareUpdateStatus = {};
3541
- export type DevFirmwareUpdateStatus = {
3542
- targets: DevFirmwareUpdateStatusEntry[];
3812
+ export type DeviceSession = {
3813
+ session_id?: string;
3814
+ btc_test_address?: string;
3543
3815
  };
3544
- export type FactoryDeviceInfoSettings = {
3545
- serial_no?: string;
3546
- cpu_info?: string;
3547
- pre_firmware?: string;
3816
+ export declare enum DeviceSessionPinType {
3817
+ Any = 1,
3818
+ Main = 2,
3819
+ AttachToPin = 3
3820
+ }
3821
+ export type DeviceSessionAskPin = {
3822
+ type?: DeviceSessionPinType;
3548
3823
  };
3549
- export type FactoryGetDeviceInfo = {};
3550
- export type FactoryDeviceInfo = {
3551
- serial_no?: string;
3552
- spi_flash_info?: string;
3553
- se_info?: string;
3554
- nft_voucher?: string;
3555
- cpu_info?: string;
3556
- pre_firmware?: string;
3824
+ export type DeviceSessionAskPassphrase = {
3825
+ passphrase?: string;
3557
3826
  };
3558
- export type FilesystemFixPermission = {};
3827
+ export declare enum DeviceSessionAskPin_FailureSubCodes {
3828
+ UserCancel = 1
3829
+ }
3830
+ export type DeviceStatus = {
3831
+ device_id?: string;
3832
+ unlocked?: boolean;
3833
+ init_states?: boolean;
3834
+ backup_required?: boolean;
3835
+ passphrase_enabled?: boolean;
3836
+ attach_to_pin_enabled?: boolean;
3837
+ unlocked_by_attach_to_pin?: boolean;
3838
+ };
3839
+ export type DeviceStatusGet = {};
3840
+ export declare enum DevOnboardingStep {
3841
+ DEV_ONBOARDING_STEP_UNKNOWN = 0,
3842
+ DEV_ONBOARDING_STEP_CHECKING = 1,
3843
+ DEV_ONBOARDING_STEP_PERSONALIZATION = 2,
3844
+ DEV_ONBOARDING_STEP_PIN = 3,
3845
+ DEV_ONBOARDING_STEP_SETUP = 4,
3846
+ DEV_ONBOARDING_STEP_DONE = 5
3847
+ }
3848
+ export declare enum DevOnboardingPhase {
3849
+ DEV_ONBOARDING_PHASE_UNKNOWN = 0,
3850
+ DEV_ONBOARDING_PHASE_SAFETY_CHECK = 1,
3851
+ DEV_ONBOARDING_PHASE_PIN_SETUP = 2,
3852
+ DEV_ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
3853
+ DEV_ONBOARDING_PHASE_SETUP_CHOICE = 4,
3854
+ DEV_ONBOARDING_PHASE_WALLET_CREATE_START = 5,
3855
+ DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
3856
+ DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
3857
+ DEV_ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
3858
+ DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
3859
+ DEV_ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
3860
+ DEV_ONBOARDING_PHASE_WALLET_READY = 11,
3861
+ DEV_ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
3862
+ DEV_ONBOARDING_PHASE_SEEDCARD_BACKUP = 13
3863
+ }
3864
+ export declare enum DevOnboardingSetupKind {
3865
+ DEV_ONBOARDING_SETUP_KIND_UNKNOWN = 0,
3866
+ DEV_ONBOARDING_SETUP_KIND_CHOICE = 1,
3867
+ DEV_ONBOARDING_SETUP_KIND_CREATE = 2,
3868
+ DEV_ONBOARDING_SETUP_KIND_RESTORE = 3
3869
+ }
3870
+ export declare enum DevOnboardingSetupMethod {
3871
+ DEV_ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
3872
+ DEV_ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
3873
+ DEV_ONBOARDING_SETUP_METHOD_SEEDCARD = 2
3874
+ }
3875
+ export type DevOnboardingSetupStatus = {
3876
+ kind?: DevOnboardingSetupKind;
3877
+ method?: DevOnboardingSetupMethod;
3878
+ };
3879
+ export type DevGetOnboardingStatus = {};
3880
+ export type DevOnboardingStatus = {
3881
+ step?: DevOnboardingStep;
3882
+ phase?: DevOnboardingPhase;
3883
+ setup?: DevOnboardingSetupStatus;
3884
+ pin_set?: boolean;
3885
+ wallet_initialized?: boolean;
3886
+ };
3887
+ export type FilesystemPermissionFix = {};
3559
3888
  export type FilesystemPathInfo = {
3560
3889
  exist: boolean;
3561
3890
  size: number;
@@ -3611,32 +3940,40 @@ export type FilesystemDirMake = {
3611
3940
  export type FilesystemDirRemove = {
3612
3941
  path: string;
3613
3942
  };
3614
- export type FilesystemFormat = {};
3615
- export declare enum OnboardingStep {
3616
- ONBOARDING_STEP_UNKNOWN = 0,
3617
- ONBOARDING_STEP_DEVICE_VERIFICATION = 1,
3618
- ONBOARDING_STEP_PERSONALIZATION = 2,
3619
- ONBOARDING_STEP_SETUP = 3,
3620
- ONBOARDING_STEP_FIRMWARE = 4
3943
+ export type FilesystemFormat = {
3944
+ data: boolean;
3945
+ user: boolean;
3946
+ };
3947
+ export type PortfolioUpdate = {};
3948
+ export declare enum ProtocolV2FailureType {
3949
+ Failure_InvalidMessage = 1,
3950
+ Failure_UndefinedError = 2,
3951
+ Failure_UsageError = 3,
3952
+ Failure_DataError = 4,
3953
+ Failure_ProcessError = 5
3621
3954
  }
3622
- export type GetOnboardingStatus = {};
3623
- export type NewDevice = {
3624
- seedcard_backup?: boolean;
3625
- };
3626
- export type Restore = {
3627
- mnemonic?: boolean;
3628
- seedcard?: boolean;
3629
- };
3630
- export type Setup = {
3631
- new_device?: NewDevice;
3632
- restore?: Restore;
3633
- };
3634
- export type OnboardingStatus = {
3635
- step: OnboardingStep;
3636
- setup?: Setup;
3637
- detail_code?: number;
3638
- detail_str?: string;
3639
- };
3955
+ export declare enum Enum_ProtocolV2Capability {
3956
+ Capability_Bitcoin = 1,
3957
+ Capability_Bitcoin_like = 2,
3958
+ Capability_Binance = 3,
3959
+ Capability_Cardano = 4,
3960
+ Capability_Crypto = 5,
3961
+ Capability_EOS = 6,
3962
+ Capability_Ethereum = 7,
3963
+ Capability_Lisk = 8,
3964
+ Capability_Monero = 9,
3965
+ Capability_NEM = 10,
3966
+ Capability_Ripple = 11,
3967
+ Capability_Stellar = 12,
3968
+ Capability_Tezos = 13,
3969
+ Capability_U2F = 14,
3970
+ Capability_Shamir = 15,
3971
+ Capability_ShamirGroups = 16,
3972
+ Capability_PassphraseEntry = 17,
3973
+ Capability_AttachToPin = 18,
3974
+ Capability_EthereumTypedData = 1000
3975
+ }
3976
+ export type ProtocolV2Capability = keyof typeof Enum_ProtocolV2Capability;
3640
3977
  export type MessageType = {
3641
3978
  AlephiumGetAddress: AlephiumGetAddress;
3642
3979
  AlephiumAddress: AlephiumAddress;
@@ -3911,6 +4248,15 @@ export type MessageType = {
3911
4248
  KaspaSignTx: KaspaSignTx;
3912
4249
  KaspaTxInputRequest: KaspaTxInputRequest;
3913
4250
  KaspaTxInputAck: KaspaTxInputAck;
4251
+ KaspaOutpoint: KaspaOutpoint;
4252
+ KaspaTxRequestSignature: KaspaTxRequestSignature;
4253
+ KaspaTxRequest: KaspaTxRequest;
4254
+ KaspaTxAckInput: KaspaTxAckInput;
4255
+ KaspaTxAckOutput: KaspaTxAckOutput;
4256
+ KaspaTxAckPayloadChunk: KaspaTxAckPayloadChunk;
4257
+ KaspaTxAckPrevMeta: KaspaTxAckPrevMeta;
4258
+ KaspaTxAckPrevInput: KaspaTxAckPrevInput;
4259
+ KaspaTxAckPrevOutput: KaspaTxAckPrevOutput;
3914
4260
  KaspaSignedTx: KaspaSignedTx;
3915
4261
  LnurlAuth: LnurlAuth;
3916
4262
  LnurlAuthResp: LnurlAuthResp;
@@ -4200,8 +4546,9 @@ export type MessageType = {
4200
4546
  CoinPurchaseMemo: CoinPurchaseMemo;
4201
4547
  PaymentRequestMemo: PaymentRequestMemo;
4202
4548
  TxAckPaymentRequest: TxAckPaymentRequest;
4203
- DebugLinkInput: DebugLinkInput;
4549
+ EthereumSignTypedDataQR: EthereumSignTypedDataQR;
4204
4550
  InternalMyAddressRequest: InternalMyAddressRequest;
4551
+ StartSession: StartSession;
4205
4552
  SetBusy: SetBusy;
4206
4553
  GetFirmwareHash: GetFirmwareHash;
4207
4554
  FirmwareHash: FirmwareHash;
@@ -4213,33 +4560,55 @@ export type MessageType = {
4213
4560
  Wallpaper: Wallpaper;
4214
4561
  UnlockPath: UnlockPath;
4215
4562
  UnlockedPathRequest: UnlockedPathRequest;
4563
+ UiAnimationRequest: UiAnimationRequest;
4216
4564
  ViewAmount: ViewAmount;
4217
4565
  ViewDetail: ViewDetail;
4218
4566
  ViewTip: ViewTip;
4567
+ ViewRawData: ViewRawData;
4219
4568
  ViewSignPage: ViewSignPage;
4220
4569
  ViewVerifyPage: ViewVerifyPage;
4221
- GetProtoVersion: GetProtoVersion;
4222
- ProtoVersion: ProtoVersion;
4223
- DevReboot: DevReboot;
4224
- DevFirmwareImageInfo: DevFirmwareImageInfo;
4225
- DevHardwareInfo: DevHardwareInfo;
4226
- DevMainMcuInfo: DevMainMcuInfo;
4227
- DevBluetoothInfo: DevBluetoothInfo;
4228
- DevSEInfo: DevSEInfo;
4229
- DevInfoTargets: DevInfoTargets;
4230
- DevInfoTypes: DevInfoTypes;
4231
- DevStatus: DevStatus;
4232
- DevGetDeviceInfo: DevGetDeviceInfo;
4233
- DevFirmwareTarget: DevFirmwareTarget;
4234
- DevFirmwareUpdate: DevFirmwareUpdate;
4235
- DevFirmwareInstallProgress: DevFirmwareInstallProgress;
4236
- DevFirmwareUpdateStatusEntry: DevFirmwareUpdateStatusEntry;
4237
- DevGetFirmwareUpdateStatus: DevGetFirmwareUpdateStatus;
4238
- DevFirmwareUpdateStatus: DevFirmwareUpdateStatus;
4239
- FactoryDeviceInfoSettings: FactoryDeviceInfoSettings;
4240
- FactoryGetDeviceInfo: FactoryGetDeviceInfo;
4241
- FactoryDeviceInfo: FactoryDeviceInfo;
4242
- FilesystemFixPermission: FilesystemFixPermission;
4570
+ ProtocolInfoRequest: ProtocolInfoRequest;
4571
+ ProtocolInfo: ProtocolInfo;
4572
+ DeviceReboot: DeviceReboot;
4573
+ DeviceSettings: DeviceSettings;
4574
+ DeviceSettingsGet: DeviceSettingsGet;
4575
+ DeviceSettingsSet: DeviceSettingsSet;
4576
+ DeviceSettingsPageShow: DeviceSettingsPageShow;
4577
+ DeviceCertificate: DeviceCertificate;
4578
+ DeviceCertificateWrite: DeviceCertificateWrite;
4579
+ DeviceCertificateRead: DeviceCertificateRead;
4580
+ DeviceCertificateSignature: DeviceCertificateSignature;
4581
+ DeviceCertificateSign: DeviceCertificateSign;
4582
+ DeviceFirmwareTarget: DeviceFirmwareTarget;
4583
+ DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
4584
+ DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
4585
+ DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
4586
+ DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
4587
+ DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
4588
+ DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
4589
+ DeviceFactoryInfo: DeviceFactoryInfo;
4590
+ DeviceFactoryInfoSet: DeviceFactoryInfoSet;
4591
+ DeviceFactoryInfoGet: DeviceFactoryInfoGet;
4592
+ DeviceFactoryPermanentLock: DeviceFactoryPermanentLock;
4593
+ DeviceFactoryTest: DeviceFactoryTest;
4594
+ DeviceFirmwareImageInfo: DeviceFirmwareImageInfo;
4595
+ DeviceHardwareInfo: DeviceHardwareInfo;
4596
+ DeviceMainMcuInfo: DeviceMainMcuInfo;
4597
+ DeviceCoprocessorInfo: DeviceCoprocessorInfo;
4598
+ DeviceSEInfo: DeviceSEInfo;
4599
+ DeviceInfoTargets: DeviceInfoTargets;
4600
+ DeviceInfoTypes: DeviceInfoTypes;
4601
+ DeviceInfoGet: DeviceInfoGet;
4602
+ DeviceSessionGet: DeviceSessionGet;
4603
+ DeviceSession: DeviceSession;
4604
+ DeviceSessionAskPin: DeviceSessionAskPin;
4605
+ DeviceSessionAskPassphrase: DeviceSessionAskPassphrase;
4606
+ DeviceStatus: DeviceStatus;
4607
+ DeviceStatusGet: DeviceStatusGet;
4608
+ DevOnboardingSetupStatus: DevOnboardingSetupStatus;
4609
+ DevGetOnboardingStatus: DevGetOnboardingStatus;
4610
+ DevOnboardingStatus: DevOnboardingStatus;
4611
+ FilesystemPermissionFix: FilesystemPermissionFix;
4243
4612
  FilesystemPathInfo: FilesystemPathInfo;
4244
4613
  FilesystemPathInfoQuery: FilesystemPathInfoQuery;
4245
4614
  FilesystemFile: FilesystemFile;
@@ -4251,11 +4620,7 @@ export type MessageType = {
4251
4620
  FilesystemDirMake: FilesystemDirMake;
4252
4621
  FilesystemDirRemove: FilesystemDirRemove;
4253
4622
  FilesystemFormat: FilesystemFormat;
4254
- GetOnboardingStatus: GetOnboardingStatus;
4255
- NewDevice: NewDevice;
4256
- Restore: Restore;
4257
- Setup: Setup;
4258
- OnboardingStatus: OnboardingStatus;
4623
+ PortfolioUpdate: PortfolioUpdate;
4259
4624
  };
4260
4625
  export type MessageKey = keyof MessageType;
4261
4626
  export type MessageResponse<T extends MessageKey> = {