@onekeyfe/hd-transport 1.2.0-alpha.17 → 1.2.0-alpha.170

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/__tests__/messages.test.js +137 -32
  2. package/__tests__/protocol-v2-ble-frame-writer.test.js +119 -0
  3. package/__tests__/protocol-v2-link-manager.test.js +176 -9
  4. package/__tests__/protocol-v2-usb-transport-base.test.js +36 -2
  5. package/__tests__/protocol-v2.test.js +535 -70
  6. package/__tests__/transport-log.test.js +79 -0
  7. package/dist/constants.d.ts +3 -1
  8. package/dist/constants.d.ts.map +1 -1
  9. package/dist/index.d.ts +654 -286
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +681 -160
  12. package/dist/protocols/index.d.ts +17 -1
  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/decode.d.ts +11 -0
  17. package/dist/protocols/v2/decode.d.ts.map +1 -1
  18. package/dist/protocols/v2/errors.d.ts +16 -0
  19. package/dist/protocols/v2/errors.d.ts.map +1 -0
  20. package/dist/protocols/v2/frame-assembler.d.ts.map +1 -1
  21. package/dist/protocols/v2/index.d.ts +2 -0
  22. package/dist/protocols/v2/index.d.ts.map +1 -1
  23. package/dist/protocols/v2/link-manager.d.ts +5 -0
  24. package/dist/protocols/v2/link-manager.d.ts.map +1 -1
  25. package/dist/protocols/v2/session.d.ts +14 -4
  26. package/dist/protocols/v2/session.d.ts.map +1 -1
  27. package/dist/protocols/v2/usb-transport-base.d.ts +2 -0
  28. package/dist/protocols/v2/usb-transport-base.d.ts.map +1 -1
  29. package/dist/serialization/protobuf/decode.d.ts.map +1 -1
  30. package/dist/serialization/protobuf/encode.d.ts.map +1 -1
  31. package/dist/types/messages.d.ts +304 -203
  32. package/dist/types/messages.d.ts.map +1 -1
  33. package/dist/types/transport.d.ts +20 -2
  34. package/dist/types/transport.d.ts.map +1 -1
  35. package/dist/utils/transportLog.d.ts +9 -0
  36. package/dist/utils/transportLog.d.ts.map +1 -0
  37. package/messages-protocol-v2.json +515 -540
  38. package/package.json +2 -2
  39. package/scripts/protobuf-patches/index.js +1 -0
  40. package/scripts/protobuf-types.js +10 -1
  41. package/src/constants.ts +30 -16
  42. package/src/index.ts +5 -1
  43. package/src/protocols/index.ts +114 -3
  44. package/src/protocols/v2/ble-frame-writer.ts +77 -0
  45. package/src/protocols/v2/crc8.ts +1 -1
  46. package/src/protocols/v2/decode.ts +49 -12
  47. package/src/protocols/v2/encode.ts +1 -1
  48. package/src/protocols/v2/errors.ts +54 -0
  49. package/src/protocols/v2/frame-assembler.ts +6 -4
  50. package/src/protocols/v2/index.ts +2 -0
  51. package/src/protocols/v2/link-manager.ts +65 -5
  52. package/src/protocols/v2/session.ts +224 -86
  53. package/src/protocols/v2/usb-transport-base.ts +42 -10
  54. package/src/serialization/protobuf/decode.ts +4 -1
  55. package/src/serialization/protobuf/encode.ts +5 -1
  56. package/src/types/messages.ts +377 -259
  57. package/src/types/transport.ts +37 -7
  58. package/src/utils/transportLog.ts +102 -0
@@ -1648,11 +1648,17 @@ export type KaspaAddress = {
1648
1648
  };
1649
1649
  export type KaspaSignTx = {
1650
1650
  address_n: number[];
1651
- raw_message: string;
1651
+ raw_message?: string;
1652
1652
  scheme?: string;
1653
1653
  prefix?: string;
1654
1654
  input_count?: number;
1655
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;
1656
1662
  };
1657
1663
  export type KaspaTxInputRequest = {
1658
1664
  request_index: number;
@@ -1662,6 +1668,77 @@ export type KaspaTxInputAck = {
1662
1668
  address_n: number[];
1663
1669
  raw_message: string;
1664
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
+ };
1665
1742
  export type KaspaSignedTx = {
1666
1743
  signature: string;
1667
1744
  };
@@ -1688,7 +1765,7 @@ export declare enum Enum_SafetyCheckLevel {
1688
1765
  PromptAlways = 1,
1689
1766
  PromptTemporarily = 2
1690
1767
  }
1691
- export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel;
1768
+ export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel | Enum_SafetyCheckLevel;
1692
1769
  export type Initialize = {
1693
1770
  session_id?: string;
1694
1771
  _skip_passphrase?: boolean;
@@ -3369,17 +3446,6 @@ export type EthereumSignTypedDataQR = {
3369
3446
  metamask_v4_compat?: boolean;
3370
3447
  request_id?: string;
3371
3448
  };
3372
- export type InternalMyAddressRequest = {
3373
- coin_type: number;
3374
- chain_id: number;
3375
- account_index: number;
3376
- derive_type: number;
3377
- };
3378
- export type StartSession = {
3379
- session_id?: string;
3380
- _skip_passphrase?: boolean;
3381
- derive_cardano?: boolean;
3382
- };
3383
3449
  export type SetBusy = {
3384
3450
  expiry_ms?: number;
3385
3451
  };
@@ -3396,21 +3462,6 @@ export type Nonce = {
3396
3462
  export type WriteSEPrivateKey = {
3397
3463
  private_key: string;
3398
3464
  };
3399
- export declare enum WallpaperTarget {
3400
- Home = 0,
3401
- Lock = 1
3402
- }
3403
- export type SetWallpaper = {
3404
- target: WallpaperTarget;
3405
- path: string;
3406
- };
3407
- export type GetWallpaper = {
3408
- target: WallpaperTarget;
3409
- };
3410
- export type Wallpaper = {
3411
- target: WallpaperTarget;
3412
- path: string;
3413
- };
3414
3465
  export type UnlockPath = {
3415
3466
  address_n: number[];
3416
3467
  mac?: string;
@@ -3424,57 +3475,27 @@ export declare enum MoneroNetworkType {
3424
3475
  STAGENET = 2,
3425
3476
  FAKECHAIN = 3
3426
3477
  }
3427
- export type ViewAmount = {
3428
- is_unlimited: boolean;
3429
- num: string;
3430
- };
3431
- export type ViewDetail = {
3432
- key: number;
3433
- value: string;
3434
- is_overview: boolean;
3435
- has_icon: boolean;
3436
- };
3437
- export declare enum ViewTipType {
3438
- Default = 0,
3439
- Highlight = 1,
3440
- Recommend = 2,
3441
- Warning = 3,
3442
- Danger = 4
3478
+ export declare enum UiAnimationType {
3479
+ Unknown = 0,
3480
+ Signing = 1
3443
3481
  }
3444
- export type ViewTip = {
3445
- type: ViewTipType;
3446
- text: string;
3447
- };
3448
- export type ViewRawData = {
3449
- initial_data: string;
3450
- placeholder: number;
3451
- };
3452
- export declare enum ViewSignLayout {
3453
- LayoutDefault = 0,
3454
- LayoutSafeTxCreate = 1,
3455
- LayoutFinalConfirm = 2,
3456
- Layout7702 = 3,
3457
- LayoutFlat = 4
3482
+ export declare enum UiAnimationCommand {
3483
+ CommandUnknown = 0,
3484
+ Start = 1,
3485
+ Stop = 2,
3486
+ Refresh = 3
3458
3487
  }
3459
- export type ViewSignPage = {
3460
- title: string;
3461
- amount?: UintType;
3462
- general: ViewDetail[];
3463
- tip?: ViewTip;
3464
- raw_data?: ViewRawData;
3465
- slide_to_confirm?: boolean;
3466
- layout?: ViewSignLayout;
3488
+ export type UiAnimationRequest = {
3489
+ command: UiAnimationCommand;
3490
+ type?: UiAnimationType;
3467
3491
  };
3468
- export type ViewVerifyPage = {
3469
- title: string;
3470
- address: string;
3471
- path: string;
3492
+ export type ProtocolInfoRequest = {
3493
+ eventless_wallet_session?: boolean;
3472
3494
  };
3473
- export type ProtocolInfoRequest = {};
3474
3495
  export type ProtocolInfo = {
3475
3496
  version: number;
3497
+ build_fingerprint: string;
3476
3498
  supported_messages: number[];
3477
- protobuf_definition?: string;
3478
3499
  };
3479
3500
  export declare enum DeviceErrorCode {
3480
3501
  DeviceError_None = 0,
@@ -3497,23 +3518,22 @@ export type DeviceReboot = {
3497
3518
  reboot_type: DeviceRebootType;
3498
3519
  };
3499
3520
  export type DeviceSettings = {
3500
- label?: string;
3501
3521
  bt_enable?: boolean;
3502
3522
  language?: string;
3503
3523
  wallpaper_path?: string;
3504
- passphrase_enable?: boolean;
3505
3524
  brightness?: number;
3506
- autolock_delay_ms?: number;
3507
- autoshutdown_delay_ms?: number;
3508
3525
  animation_enable?: boolean;
3509
3526
  tap_to_wake?: boolean;
3510
3527
  haptic_feedback?: boolean;
3511
3528
  device_name_display_enabled?: boolean;
3512
3529
  airgap_mode?: boolean;
3513
- fido_enabled?: boolean;
3514
- experimental_features?: boolean;
3515
3530
  usb_lock_enable?: boolean;
3516
3531
  random_keypad?: boolean;
3532
+ passphrase_enable?: boolean;
3533
+ fido_enabled?: boolean;
3534
+ autolock_delay_ms?: number;
3535
+ autoshutdown_delay_ms?: number;
3536
+ label?: string;
3517
3537
  };
3518
3538
  export type DeviceSettingsGet = {};
3519
3539
  export type DeviceSettingsSet = {
@@ -3543,6 +3563,39 @@ export type DeviceCertificateSignature = {
3543
3563
  export type DeviceCertificateSign = {
3544
3564
  data: string;
3545
3565
  };
3566
+ export type DeviceMiscUsbMscControl = {
3567
+ enable: boolean;
3568
+ };
3569
+ export declare enum DeviceFactoryAck {
3570
+ FACTORY_ACK_SUCCESS = 0,
3571
+ FACTORY_ACK_FAIL = 1
3572
+ }
3573
+ export type DeviceFactoryInfoManufactureTime = {
3574
+ year: number;
3575
+ month: number;
3576
+ day: number;
3577
+ hour: number;
3578
+ minute: number;
3579
+ second: number;
3580
+ };
3581
+ export type DeviceFactoryInfo = {
3582
+ version?: number;
3583
+ serial_number?: string;
3584
+ factory_test_completed?: boolean;
3585
+ factory_burn_in_completed?: boolean;
3586
+ manufacture_time?: DeviceFactoryInfoManufactureTime;
3587
+ };
3588
+ export type DeviceFactoryInfoSet = {
3589
+ info: DeviceFactoryInfo;
3590
+ };
3591
+ export type DeviceFactoryInfoGet = {};
3592
+ export type DeviceFactoryPermanentLock = {
3593
+ check_a: string;
3594
+ check_b: string;
3595
+ };
3596
+ export type DeviceFactoryTest = {
3597
+ burn_in_test: boolean;
3598
+ };
3546
3599
  export declare enum DeviceFirmwareTargetType {
3547
3600
  FW_MGMT_TARGET_INVALID = 0,
3548
3601
  FW_MGMT_TARGET_CRATE = 1,
@@ -3573,9 +3626,10 @@ export type DeviceFirmwareTarget = {
3573
3626
  target_id: DeviceFirmwareTargetType;
3574
3627
  path: string;
3575
3628
  };
3576
- export type DeviceFirmwareUpdateRequest = {
3629
+ export type DeviceFirmwareUpdateStage = {
3577
3630
  targets: DeviceFirmwareTarget[];
3578
3631
  };
3632
+ export type DeviceFirmwareUpdateRequest = {};
3579
3633
  export type DeviceFirmwareUpdateRecord = {
3580
3634
  target_id: DeviceFirmwareTargetType;
3581
3635
  status?: DeviceFirmwareUpdateTaskStatus;
@@ -3593,36 +3647,6 @@ export type DeviceFirmwareUpdateStatusGet = {
3593
3647
  export type DeviceFirmwareUpdateStatus = {
3594
3648
  records: DeviceFirmwareUpdateRecord[];
3595
3649
  };
3596
- export declare enum DeviceFactoryAck {
3597
- FACTORY_ACK_SUCCESS = 0,
3598
- FACTORY_ACK_FAIL = 1
3599
- }
3600
- export type DeviceFactoryInfoManufactureTime = {
3601
- year: number;
3602
- month: number;
3603
- day: number;
3604
- hour: number;
3605
- minute: number;
3606
- second: number;
3607
- };
3608
- export type DeviceFactoryInfo = {
3609
- version?: number;
3610
- serial_number?: string;
3611
- burn_in_completed?: boolean;
3612
- factory_test_completed?: boolean;
3613
- manufacture_time?: DeviceFactoryInfoManufactureTime;
3614
- };
3615
- export type DeviceFactoryInfoSet = {
3616
- info: DeviceFactoryInfo;
3617
- };
3618
- export type DeviceFactoryInfoGet = {};
3619
- export type DeviceFactoryPermanentLock = {
3620
- check_a: string;
3621
- check_b: string;
3622
- };
3623
- export type DeviceFactoryTest = {
3624
- burn_in_test: boolean;
3625
- };
3626
3650
  export declare enum DeviceType {
3627
3651
  CLASSIC1 = 0,
3628
3652
  CLASSIC1S = 1,
@@ -3673,13 +3697,12 @@ export type DeviceSEInfo = {
3673
3697
  };
3674
3698
  export type DeviceInfoTargets = {
3675
3699
  hw?: boolean;
3676
- fw?: boolean;
3700
+ main_mcu?: boolean;
3677
3701
  coprocessor?: boolean;
3678
3702
  se1?: boolean;
3679
3703
  se2?: boolean;
3680
3704
  se3?: boolean;
3681
3705
  se4?: boolean;
3682
- status?: boolean;
3683
3706
  };
3684
3707
  export type DeviceInfoTypes = {
3685
3708
  version?: boolean;
@@ -3694,36 +3717,46 @@ export type DeviceInfoGet = {
3694
3717
  export type ProtocolV2DeviceInfo = {
3695
3718
  protocol_version: number;
3696
3719
  hw?: DeviceHardwareInfo;
3697
- fw?: DeviceMainMcuInfo;
3720
+ main_mcu?: DeviceMainMcuInfo;
3698
3721
  coprocessor?: DeviceCoprocessorInfo;
3699
3722
  se1?: DeviceSEInfo;
3700
3723
  se2?: DeviceSEInfo;
3701
3724
  se3?: DeviceSEInfo;
3702
3725
  se4?: DeviceSEInfo;
3703
- status?: DeviceStatus;
3704
- };
3705
- export type DeviceSessionResume = {
3706
- session_id: string;
3707
3726
  };
3708
- export type DeviceHostPassphrase = {
3709
- passphrase: string;
3710
- };
3711
- export type DevicePassphraseOnDevice = {};
3712
- export type DeviceAttachPinOnDevice = {};
3713
- export type DeviceWalletSelect = {
3714
- host_passphrase?: DeviceHostPassphrase;
3715
- passphrase_on_device?: DevicePassphraseOnDevice;
3716
- attach_pin_on_device?: DeviceAttachPinOnDevice;
3717
- };
3718
- export type DeviceSessionOpen = {
3719
- resume?: DeviceSessionResume;
3720
- select?: DeviceWalletSelect;
3727
+ export declare enum DeviceSessionErrorCode {
3728
+ DeviceSessionError_None = 0,
3729
+ DeviceSessionError_UserCancelled = 1,
3730
+ DeviceSessionError_InvalidSession = 2,
3731
+ DeviceSessionError_AttachPinUnavailable = 3,
3732
+ DeviceSessionError_PassphraseDisabled = 4,
3733
+ DeviceSessionError_Busy = 5
3734
+ }
3735
+ export declare enum DeviceSessionSeedDomain {
3736
+ SeedDomain_Standard = 1,
3737
+ SeedDomain_Cardano = 2
3738
+ }
3739
+ export type DeviceSessionGet = {
3740
+ session_id?: string;
3741
+ btc_test_address?: string;
3742
+ seed_domains: DeviceSessionSeedDomain[];
3721
3743
  };
3722
3744
  export type DeviceSession = {
3723
3745
  session_id?: string;
3724
3746
  btc_test_address?: string;
3725
3747
  };
3726
- export type DeviceSessionAskPin = {};
3748
+ export declare enum DeviceSessionPinType {
3749
+ Any = 1,
3750
+ Main = 2,
3751
+ AttachToPin = 3
3752
+ }
3753
+ export type DeviceSessionAskPin = {
3754
+ type?: DeviceSessionPinType;
3755
+ };
3756
+ export type DeviceSessionAskPassphrase = {
3757
+ passphrase?: string;
3758
+ on_device: boolean;
3759
+ };
3727
3760
  export declare enum DeviceSessionAskPin_FailureSubCodes {
3728
3761
  UserCancel = 1
3729
3762
  }
@@ -3737,53 +3770,6 @@ export type DeviceStatus = {
3737
3770
  unlocked_by_attach_to_pin?: boolean;
3738
3771
  };
3739
3772
  export type DeviceStatusGet = {};
3740
- export declare enum DevOnboardingStep {
3741
- DEV_ONBOARDING_STEP_UNKNOWN = 0,
3742
- DEV_ONBOARDING_STEP_CHECKING = 1,
3743
- DEV_ONBOARDING_STEP_PERSONALIZATION = 2,
3744
- DEV_ONBOARDING_STEP_PIN = 3,
3745
- DEV_ONBOARDING_STEP_SETUP = 4,
3746
- DEV_ONBOARDING_STEP_DONE = 5
3747
- }
3748
- export declare enum DevOnboardingPhase {
3749
- DEV_ONBOARDING_PHASE_UNKNOWN = 0,
3750
- DEV_ONBOARDING_PHASE_SAFETY_CHECK = 1,
3751
- DEV_ONBOARDING_PHASE_PIN_SETUP = 2,
3752
- DEV_ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
3753
- DEV_ONBOARDING_PHASE_SETUP_CHOICE = 4,
3754
- DEV_ONBOARDING_PHASE_WALLET_CREATE_START = 5,
3755
- DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
3756
- DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
3757
- DEV_ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
3758
- DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
3759
- DEV_ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
3760
- DEV_ONBOARDING_PHASE_WALLET_READY = 11,
3761
- DEV_ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
3762
- DEV_ONBOARDING_PHASE_SEEDCARD_BACKUP = 13
3763
- }
3764
- export declare enum DevOnboardingSetupKind {
3765
- DEV_ONBOARDING_SETUP_KIND_UNKNOWN = 0,
3766
- DEV_ONBOARDING_SETUP_KIND_CHOICE = 1,
3767
- DEV_ONBOARDING_SETUP_KIND_CREATE = 2,
3768
- DEV_ONBOARDING_SETUP_KIND_RESTORE = 3
3769
- }
3770
- export declare enum DevOnboardingSetupMethod {
3771
- DEV_ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
3772
- DEV_ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
3773
- DEV_ONBOARDING_SETUP_METHOD_SEEDCARD = 2
3774
- }
3775
- export type DevOnboardingSetupStatus = {
3776
- kind?: DevOnboardingSetupKind;
3777
- method?: DevOnboardingSetupMethod;
3778
- };
3779
- export type DevGetOnboardingStatus = {};
3780
- export type DevOnboardingStatus = {
3781
- step?: DevOnboardingStep;
3782
- phase?: DevOnboardingPhase;
3783
- setup?: DevOnboardingSetupStatus;
3784
- pin_set?: boolean;
3785
- wallet_initialized?: boolean;
3786
- };
3787
3773
  export type FilesystemPermissionFix = {};
3788
3774
  export type FilesystemPathInfo = {
3789
3775
  exist: boolean;
@@ -3844,7 +3830,117 @@ export type FilesystemFormat = {
3844
3830
  data: boolean;
3845
3831
  user: boolean;
3846
3832
  };
3833
+ export type InternalMyAddressRequest = {
3834
+ coin_type: number;
3835
+ chain_id: number;
3836
+ account_index: number;
3837
+ derive_type: number;
3838
+ };
3839
+ export type NftUpdate = {
3840
+ file_name_no_ext: string;
3841
+ };
3842
+ export declare enum OnboardingStep {
3843
+ ONBOARDING_STEP_UNKNOWN = 0,
3844
+ ONBOARDING_STEP_CHECKING = 1,
3845
+ ONBOARDING_STEP_PERSONALIZATION = 2,
3846
+ ONBOARDING_STEP_PIN = 3,
3847
+ ONBOARDING_STEP_SETUP = 4,
3848
+ ONBOARDING_STEP_DONE = 5
3849
+ }
3850
+ export declare enum OnboardingPhase {
3851
+ ONBOARDING_PHASE_UNKNOWN = 0,
3852
+ ONBOARDING_PHASE_SAFETY_CHECK = 1,
3853
+ ONBOARDING_PHASE_PIN_SETUP = 2,
3854
+ ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
3855
+ ONBOARDING_PHASE_SETUP_CHOICE = 4,
3856
+ ONBOARDING_PHASE_WALLET_CREATE_START = 5,
3857
+ ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
3858
+ ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
3859
+ ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
3860
+ ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
3861
+ ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
3862
+ ONBOARDING_PHASE_WALLET_READY = 11,
3863
+ ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
3864
+ ONBOARDING_PHASE_SEEDCARD_BACKUP = 13
3865
+ }
3866
+ export declare enum OnboardingSetupKind {
3867
+ ONBOARDING_SETUP_KIND_UNKNOWN = 0,
3868
+ ONBOARDING_SETUP_KIND_CHOICE = 1,
3869
+ ONBOARDING_SETUP_KIND_CREATE = 2,
3870
+ ONBOARDING_SETUP_KIND_RESTORE = 3
3871
+ }
3872
+ export declare enum OnboardingSetupMethod {
3873
+ ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
3874
+ ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
3875
+ ONBOARDING_SETUP_METHOD_SEEDCARD = 2
3876
+ }
3877
+ export type OnboardingSetupStatus = {
3878
+ kind?: OnboardingSetupKind;
3879
+ method?: OnboardingSetupMethod;
3880
+ };
3881
+ export type OnboardingStatusGet = {};
3882
+ export type OnboardingStatus = {
3883
+ step?: OnboardingStep;
3884
+ phase?: OnboardingPhase;
3885
+ setup?: OnboardingSetupStatus;
3886
+ pin_set?: boolean;
3887
+ wallet_initialized?: boolean;
3888
+ };
3847
3889
  export type PortfolioUpdate = {};
3890
+ export type ViewAmount = {
3891
+ is_unlimited: boolean;
3892
+ num: string;
3893
+ };
3894
+ export type ViewDetail = {
3895
+ key: number;
3896
+ value: string;
3897
+ is_overview: boolean;
3898
+ has_icon: boolean;
3899
+ };
3900
+ export declare enum ViewTipType {
3901
+ Default = 0,
3902
+ Highlight = 1,
3903
+ Recommend = 2,
3904
+ Warning = 3,
3905
+ Danger = 4
3906
+ }
3907
+ export type ViewTip = {
3908
+ type: ViewTipType;
3909
+ text?: string;
3910
+ text_id?: number;
3911
+ };
3912
+ export type ViewRawData = {
3913
+ initial_data: string;
3914
+ placeholder: number;
3915
+ };
3916
+ export declare enum ViewSignLayout {
3917
+ LayoutDefault = 0,
3918
+ LayoutSafeTxCreate = 1,
3919
+ LayoutFinalConfirm = 2,
3920
+ Layout7702 = 3,
3921
+ LayoutFlat = 4,
3922
+ LayoutEthApprove = 5
3923
+ }
3924
+ export type ViewSignPage = {
3925
+ title?: string;
3926
+ amount?: UintType;
3927
+ general: ViewDetail[];
3928
+ tip?: ViewTip;
3929
+ raw_data?: ViewRawData;
3930
+ slide_to_confirm?: boolean;
3931
+ layout?: ViewSignLayout;
3932
+ title_id?: number;
3933
+ };
3934
+ export type ViewVerifyPage = {
3935
+ title?: string;
3936
+ address: string;
3937
+ path: string;
3938
+ network?: string;
3939
+ derive_type?: string;
3940
+ value_key?: number;
3941
+ title_id?: number;
3942
+ chain_id?: number;
3943
+ };
3848
3944
  export declare enum ProtocolV2FailureType {
3849
3945
  Failure_InvalidMessage = 1,
3850
3946
  Failure_UndefinedError = 2,
@@ -4148,6 +4244,15 @@ export type MessageType = {
4148
4244
  KaspaSignTx: KaspaSignTx;
4149
4245
  KaspaTxInputRequest: KaspaTxInputRequest;
4150
4246
  KaspaTxInputAck: KaspaTxInputAck;
4247
+ KaspaOutpoint: KaspaOutpoint;
4248
+ KaspaTxRequestSignature: KaspaTxRequestSignature;
4249
+ KaspaTxRequest: KaspaTxRequest;
4250
+ KaspaTxAckInput: KaspaTxAckInput;
4251
+ KaspaTxAckOutput: KaspaTxAckOutput;
4252
+ KaspaTxAckPayloadChunk: KaspaTxAckPayloadChunk;
4253
+ KaspaTxAckPrevMeta: KaspaTxAckPrevMeta;
4254
+ KaspaTxAckPrevInput: KaspaTxAckPrevInput;
4255
+ KaspaTxAckPrevOutput: KaspaTxAckPrevOutput;
4151
4256
  KaspaSignedTx: KaspaSignedTx;
4152
4257
  LnurlAuth: LnurlAuth;
4153
4258
  LnurlAuthResp: LnurlAuthResp;
@@ -4438,25 +4543,15 @@ export type MessageType = {
4438
4543
  PaymentRequestMemo: PaymentRequestMemo;
4439
4544
  TxAckPaymentRequest: TxAckPaymentRequest;
4440
4545
  EthereumSignTypedDataQR: EthereumSignTypedDataQR;
4441
- InternalMyAddressRequest: InternalMyAddressRequest;
4442
- StartSession: StartSession;
4443
4546
  SetBusy: SetBusy;
4444
4547
  GetFirmwareHash: GetFirmwareHash;
4445
4548
  FirmwareHash: FirmwareHash;
4446
4549
  GetNonce: GetNonce;
4447
4550
  Nonce: Nonce;
4448
4551
  WriteSEPrivateKey: WriteSEPrivateKey;
4449
- SetWallpaper: SetWallpaper;
4450
- GetWallpaper: GetWallpaper;
4451
- Wallpaper: Wallpaper;
4452
4552
  UnlockPath: UnlockPath;
4453
4553
  UnlockedPathRequest: UnlockedPathRequest;
4454
- ViewAmount: ViewAmount;
4455
- ViewDetail: ViewDetail;
4456
- ViewTip: ViewTip;
4457
- ViewRawData: ViewRawData;
4458
- ViewSignPage: ViewSignPage;
4459
- ViewVerifyPage: ViewVerifyPage;
4554
+ UiAnimationRequest: UiAnimationRequest;
4460
4555
  ProtocolInfoRequest: ProtocolInfoRequest;
4461
4556
  ProtocolInfo: ProtocolInfo;
4462
4557
  DeviceReboot: DeviceReboot;
@@ -4469,18 +4564,20 @@ export type MessageType = {
4469
4564
  DeviceCertificateRead: DeviceCertificateRead;
4470
4565
  DeviceCertificateSignature: DeviceCertificateSignature;
4471
4566
  DeviceCertificateSign: DeviceCertificateSign;
4472
- DeviceFirmwareTarget: DeviceFirmwareTarget;
4473
- DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
4474
- DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
4475
- DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
4476
- DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
4477
- DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
4567
+ DeviceMiscUsbMscControl: DeviceMiscUsbMscControl;
4478
4568
  DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
4479
4569
  DeviceFactoryInfo: DeviceFactoryInfo;
4480
4570
  DeviceFactoryInfoSet: DeviceFactoryInfoSet;
4481
4571
  DeviceFactoryInfoGet: DeviceFactoryInfoGet;
4482
4572
  DeviceFactoryPermanentLock: DeviceFactoryPermanentLock;
4483
4573
  DeviceFactoryTest: DeviceFactoryTest;
4574
+ DeviceFirmwareTarget: DeviceFirmwareTarget;
4575
+ DeviceFirmwareUpdateStage: DeviceFirmwareUpdateStage;
4576
+ DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
4577
+ DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
4578
+ DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
4579
+ DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
4580
+ DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
4484
4581
  DeviceFirmwareImageInfo: DeviceFirmwareImageInfo;
4485
4582
  DeviceHardwareInfo: DeviceHardwareInfo;
4486
4583
  DeviceMainMcuInfo: DeviceMainMcuInfo;
@@ -4489,19 +4586,12 @@ export type MessageType = {
4489
4586
  DeviceInfoTargets: DeviceInfoTargets;
4490
4587
  DeviceInfoTypes: DeviceInfoTypes;
4491
4588
  DeviceInfoGet: DeviceInfoGet;
4492
- DeviceSessionResume: DeviceSessionResume;
4493
- DeviceHostPassphrase: DeviceHostPassphrase;
4494
- DevicePassphraseOnDevice: DevicePassphraseOnDevice;
4495
- DeviceAttachPinOnDevice: DeviceAttachPinOnDevice;
4496
- DeviceWalletSelect: DeviceWalletSelect;
4497
- DeviceSessionOpen: DeviceSessionOpen;
4589
+ DeviceSessionGet: DeviceSessionGet;
4498
4590
  DeviceSession: DeviceSession;
4499
4591
  DeviceSessionAskPin: DeviceSessionAskPin;
4592
+ DeviceSessionAskPassphrase: DeviceSessionAskPassphrase;
4500
4593
  DeviceStatus: DeviceStatus;
4501
4594
  DeviceStatusGet: DeviceStatusGet;
4502
- DevOnboardingSetupStatus: DevOnboardingSetupStatus;
4503
- DevGetOnboardingStatus: DevGetOnboardingStatus;
4504
- DevOnboardingStatus: DevOnboardingStatus;
4505
4595
  FilesystemPermissionFix: FilesystemPermissionFix;
4506
4596
  FilesystemPathInfo: FilesystemPathInfo;
4507
4597
  FilesystemPathInfoQuery: FilesystemPathInfoQuery;
@@ -4514,7 +4604,18 @@ export type MessageType = {
4514
4604
  FilesystemDirMake: FilesystemDirMake;
4515
4605
  FilesystemDirRemove: FilesystemDirRemove;
4516
4606
  FilesystemFormat: FilesystemFormat;
4607
+ InternalMyAddressRequest: InternalMyAddressRequest;
4608
+ NftUpdate: NftUpdate;
4609
+ OnboardingSetupStatus: OnboardingSetupStatus;
4610
+ OnboardingStatusGet: OnboardingStatusGet;
4611
+ OnboardingStatus: OnboardingStatus;
4517
4612
  PortfolioUpdate: PortfolioUpdate;
4613
+ ViewAmount: ViewAmount;
4614
+ ViewDetail: ViewDetail;
4615
+ ViewTip: ViewTip;
4616
+ ViewRawData: ViewRawData;
4617
+ ViewSignPage: ViewSignPage;
4618
+ ViewVerifyPage: ViewVerifyPage;
4518
4619
  };
4519
4620
  export type MessageKey = keyof MessageType;
4520
4621
  export type MessageResponse<T extends MessageKey> = {