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

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 (87) hide show
  1. package/README.md +2 -4
  2. package/__tests__/build-receive.test.js +6 -8
  3. package/__tests__/decode-features.test.js +3 -2
  4. package/__tests__/messages.test.js +8 -0
  5. package/__tests__/protocol-v2.test.js +754 -0
  6. package/dist/constants.d.ts +14 -5
  7. package/dist/constants.d.ts.map +1 -1
  8. package/dist/index.d.ts +905 -41
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +811 -84
  11. package/dist/protocols/index.d.ts +45 -0
  12. package/dist/protocols/index.d.ts.map +1 -0
  13. package/dist/protocols/v1/decode.d.ts +11 -0
  14. package/dist/protocols/v1/decode.d.ts.map +1 -0
  15. package/dist/protocols/v1/encode.d.ts +11 -0
  16. package/dist/protocols/v1/encode.d.ts.map +1 -0
  17. package/dist/protocols/v1/index.d.ts +5 -0
  18. package/dist/protocols/v1/index.d.ts.map +1 -0
  19. package/dist/protocols/v1/packets.d.ts +7 -0
  20. package/dist/protocols/v1/packets.d.ts.map +1 -0
  21. package/dist/{serialization → protocols/v1}/receive.d.ts +1 -1
  22. package/dist/protocols/v1/receive.d.ts.map +1 -0
  23. package/dist/protocols/v2/constants.d.ts +7 -0
  24. package/dist/protocols/v2/constants.d.ts.map +1 -0
  25. package/dist/protocols/v2/crc8.d.ts +3 -0
  26. package/dist/protocols/v2/crc8.d.ts.map +1 -0
  27. package/dist/protocols/v2/debug.d.ts +13 -0
  28. package/dist/protocols/v2/debug.d.ts.map +1 -0
  29. package/dist/protocols/v2/decode.d.ts +8 -0
  30. package/dist/protocols/v2/decode.d.ts.map +1 -0
  31. package/dist/protocols/v2/encode.d.ts +5 -0
  32. package/dist/protocols/v2/encode.d.ts.map +1 -0
  33. package/dist/protocols/v2/frame-assembler.d.ts +12 -0
  34. package/dist/protocols/v2/frame-assembler.d.ts.map +1 -0
  35. package/dist/protocols/v2/index.d.ts +7 -0
  36. package/dist/protocols/v2/index.d.ts.map +1 -0
  37. package/dist/protocols/v2/session.d.ts +50 -0
  38. package/dist/protocols/v2/session.d.ts.map +1 -0
  39. package/dist/serialization/index.d.ts +6 -3
  40. package/dist/serialization/index.d.ts.map +1 -1
  41. package/dist/serialization/protobuf/decode.d.ts.map +1 -1
  42. package/dist/serialization/protobuf/messages.d.ts +1 -1
  43. package/dist/serialization/protobuf/messages.d.ts.map +1 -1
  44. package/dist/types/messages.d.ts +441 -11
  45. package/dist/types/messages.d.ts.map +1 -1
  46. package/dist/types/transport.d.ts +14 -2
  47. package/dist/types/transport.d.ts.map +1 -1
  48. package/dist/utils/logBlockCommand.d.ts.map +1 -1
  49. package/messages-protocol-v2.json +13375 -0
  50. package/package.json +3 -3
  51. package/scripts/protobuf-build.sh +314 -20
  52. package/scripts/protobuf-patches/TxInputType.js +1 -0
  53. package/scripts/protobuf-patches/index.js +2 -0
  54. package/scripts/protobuf-types.js +224 -18
  55. package/src/constants.ts +42 -6
  56. package/src/index.ts +39 -11
  57. package/src/protocols/index.ts +144 -0
  58. package/src/{serialization/protocol → protocols/v1}/decode.ts +4 -4
  59. package/src/{serialization/protocol → protocols/v1}/encode.ts +18 -13
  60. package/src/protocols/v1/index.ts +4 -0
  61. package/src/protocols/v1/packets.ts +53 -0
  62. package/src/{serialization → protocols/v1}/receive.ts +5 -5
  63. package/src/protocols/v2/constants.ts +6 -0
  64. package/src/protocols/v2/crc8.ts +34 -0
  65. package/src/protocols/v2/debug.ts +26 -0
  66. package/src/protocols/v2/decode.ts +92 -0
  67. package/src/protocols/v2/encode.ts +116 -0
  68. package/src/protocols/v2/frame-assembler.ts +98 -0
  69. package/src/protocols/v2/index.ts +6 -0
  70. package/src/protocols/v2/session.ts +429 -0
  71. package/src/serialization/index.ts +6 -5
  72. package/src/serialization/protobuf/decode.ts +7 -0
  73. package/src/serialization/protobuf/messages.ts +8 -4
  74. package/src/types/messages.ts +579 -13
  75. package/src/types/transport.ts +26 -2
  76. package/src/utils/logBlockCommand.ts +9 -1
  77. package/dist/serialization/protocol/decode.d.ts +0 -11
  78. package/dist/serialization/protocol/decode.d.ts.map +0 -1
  79. package/dist/serialization/protocol/encode.d.ts +0 -11
  80. package/dist/serialization/protocol/encode.d.ts.map +0 -1
  81. package/dist/serialization/protocol/index.d.ts +0 -3
  82. package/dist/serialization/protocol/index.d.ts.map +0 -1
  83. package/dist/serialization/receive.d.ts.map +0 -1
  84. package/dist/serialization/send.d.ts +0 -7
  85. package/dist/serialization/send.d.ts.map +0 -1
  86. package/src/serialization/protocol/index.ts +0 -2
  87. package/src/serialization/send.ts +0 -58
@@ -275,6 +275,7 @@ export type GetAddress = {
275
275
  };
276
276
  export type Address = {
277
277
  address: string;
278
+ mac?: string;
278
279
  };
279
280
  export type GetOwnershipId = {
280
281
  address_n: number[];
@@ -303,6 +304,13 @@ export type VerifyMessage = {
303
304
  message: string;
304
305
  coin_name?: string;
305
306
  };
307
+ export type CoinJoinRequest = {
308
+ fee_rate: number;
309
+ no_fee_threshold: number;
310
+ min_registrable_amount: number;
311
+ mask_public_key: string;
312
+ signature: string;
313
+ };
306
314
  export type SignTx = {
307
315
  outputs_count: number;
308
316
  inputs_count: number;
@@ -316,6 +324,8 @@ export type SignTx = {
316
324
  branch_id?: number;
317
325
  amount_unit?: AmountUnit;
318
326
  decred_staking_ticket?: boolean;
327
+ serialize?: boolean;
328
+ coinjoin_request?: CoinJoinRequest;
319
329
  };
320
330
  export declare enum Enum_RequestType {
321
331
  TXINPUT = 0,
@@ -324,7 +334,8 @@ export declare enum Enum_RequestType {
324
334
  TXFINISHED = 3,
325
335
  TXEXTRADATA = 4,
326
336
  TXORIGINPUT = 5,
327
- TXORIGOUTPUT = 6
337
+ TXORIGOUTPUT = 6,
338
+ TXPAYMENTREQ = 7
328
339
  }
329
340
  export type RequestType = keyof typeof Enum_RequestType;
330
341
  export type TxRequestDetailsType = {
@@ -359,6 +370,7 @@ type CommonTxInputType = {
359
370
  witness?: string;
360
371
  ownership_proof?: string;
361
372
  commitment_data?: string;
373
+ coinjoin_flags?: number;
362
374
  };
363
375
  export type TxInputType = (CommonTxInputType & {
364
376
  address_n: number[];
@@ -498,12 +510,15 @@ export type OwnershipProof = {
498
510
  };
499
511
  export type AuthorizeCoinJoin = {
500
512
  coordinator: string;
501
- max_total_fee: number;
513
+ max_total_fee?: number;
502
514
  fee_per_anonymity?: number;
503
515
  address_n: number[];
504
516
  coin_name?: string;
505
517
  script_type?: InputScriptType;
506
518
  amount_unit?: AmountUnit;
519
+ max_rounds?: number;
520
+ max_coordinator_fee_rate?: number;
521
+ max_fee_per_kvbyte?: number;
507
522
  };
508
523
  export type BIP32Address = {
509
524
  address_n: number[];
@@ -1658,7 +1673,10 @@ export type LnurlAuthResp = {
1658
1673
  export declare enum Enum_BackupType {
1659
1674
  Bip39 = 0,
1660
1675
  Slip39_Basic = 1,
1661
- Slip39_Advanced = 2
1676
+ Slip39_Advanced = 2,
1677
+ Slip39_Single_Extendable = 3,
1678
+ Slip39_Basic_Extendable = 4,
1679
+ Slip39_Advanced_Extendable = 5
1662
1680
  }
1663
1681
  export type BackupType = keyof typeof Enum_BackupType;
1664
1682
  export declare enum Enum_SafetyCheckLevel {
@@ -2134,6 +2152,8 @@ export type UnLockDeviceResponse = {
2134
2152
  };
2135
2153
  export type GetPassphraseState = {
2136
2154
  passphrase_state?: string;
2155
+ _only_main_pin?: boolean;
2156
+ allow_create_attach_pin?: boolean;
2137
2157
  };
2138
2158
  export type PassphraseState = {
2139
2159
  passphrase_state?: string;
@@ -2189,7 +2209,7 @@ export type MoneroTransactionRsigData = {
2189
2209
  export type MoneroGetAddress = {
2190
2210
  address_n: number[];
2191
2211
  show_display?: boolean;
2192
- network_type?: number;
2212
+ network_type?: number | MoneroNetworkType;
2193
2213
  account?: number;
2194
2214
  minor?: number;
2195
2215
  payment_id?: string;
@@ -2199,7 +2219,7 @@ export type MoneroAddress = {
2199
2219
  };
2200
2220
  export type MoneroGetWatchKey = {
2201
2221
  address_n: number[];
2202
- network_type?: number;
2222
+ network_type?: number | MoneroNetworkType;
2203
2223
  };
2204
2224
  export type MoneroWatchKey = {
2205
2225
  watch_key?: string;
@@ -2225,7 +2245,7 @@ export type MoneroTransactionData = {
2225
2245
  export type MoneroTransactionInitRequest = {
2226
2246
  version?: number;
2227
2247
  address_n: number[];
2228
- network_type?: number;
2248
+ network_type?: number | MoneroNetworkType;
2229
2249
  tsx_data?: MoneroTransactionData;
2230
2250
  };
2231
2251
  export type MoneroTransactionInitAck = {
@@ -2317,7 +2337,7 @@ export type MoneroKeyImageExportInitRequest = {
2317
2337
  num?: number;
2318
2338
  hash?: string;
2319
2339
  address_n: number[];
2320
- network_type?: number;
2340
+ network_type?: number | MoneroNetworkType;
2321
2341
  subs: MoneroSubAddressIndicesList[];
2322
2342
  };
2323
2343
  export type MoneroKeyImageExportInitAck = {};
@@ -2345,7 +2365,7 @@ export type MoneroKeyImageSyncFinalAck = {
2345
2365
  };
2346
2366
  export type MoneroGetTxKeyRequest = {
2347
2367
  address_n: number[];
2348
- network_type?: number;
2368
+ network_type?: number | MoneroNetworkType;
2349
2369
  salt1?: string;
2350
2370
  salt2?: string;
2351
2371
  tx_enc_keys?: string;
@@ -2360,7 +2380,7 @@ export type MoneroGetTxKeyAck = {
2360
2380
  };
2361
2381
  export type MoneroLiveRefreshStartRequest = {
2362
2382
  address_n: number[];
2363
- network_type?: number;
2383
+ network_type?: number | MoneroNetworkType;
2364
2384
  };
2365
2385
  export type MoneroLiveRefreshStartAck = {};
2366
2386
  export type MoneroLiveRefreshStepRequest = {
@@ -3124,6 +3144,7 @@ export type TonSignedMessage = {
3124
3144
  signature?: string;
3125
3145
  signning_message?: string;
3126
3146
  init_data_length?: number;
3147
+ signing_message?: string;
3127
3148
  };
3128
3149
  export type TonSignProof = {
3129
3150
  address_n: number[];
@@ -3277,6 +3298,345 @@ export declare enum CommandFlags {
3277
3298
  Default = 0,
3278
3299
  Factory_Only = 1
3279
3300
  }
3301
+ export type experimental_message = {};
3302
+ export type experimental_field = {};
3303
+ export type TextMemo = {
3304
+ text: string;
3305
+ };
3306
+ export type RefundMemo = {
3307
+ address: string;
3308
+ mac: string;
3309
+ };
3310
+ export type CoinPurchaseMemo = {
3311
+ coin_type: number;
3312
+ amount: UintType;
3313
+ address: string;
3314
+ mac: string;
3315
+ };
3316
+ export type PaymentRequestMemo = {
3317
+ text_memo?: TextMemo;
3318
+ refund_memo?: RefundMemo;
3319
+ coin_purchase_memo?: CoinPurchaseMemo;
3320
+ };
3321
+ export type TxAckPaymentRequest = {
3322
+ nonce?: string;
3323
+ recipient_name: string;
3324
+ memos?: PaymentRequestMemo[];
3325
+ amount?: UintType;
3326
+ signature: string;
3327
+ };
3328
+ export type DebugLinkInput = {
3329
+ x?: number;
3330
+ y?: number;
3331
+ duration_ms?: number;
3332
+ x_end?: number;
3333
+ y_end?: number;
3334
+ };
3335
+ export type InternalMyAddressRequest = {
3336
+ coin_type: number;
3337
+ chain_id: number;
3338
+ account_index: number;
3339
+ derive_type: number;
3340
+ };
3341
+ export type SetBusy = {
3342
+ expiry_ms?: number;
3343
+ };
3344
+ export type GetFirmwareHash = {
3345
+ challenge?: string;
3346
+ };
3347
+ export type FirmwareHash = {
3348
+ hash: string;
3349
+ };
3350
+ export type GetNonce = {};
3351
+ export type Nonce = {
3352
+ nonce: string;
3353
+ };
3354
+ export type WriteSEPrivateKey = {
3355
+ private_key: string;
3356
+ };
3357
+ export declare enum WallpaperTarget {
3358
+ Home = 0,
3359
+ Lock = 1
3360
+ }
3361
+ export type SetWallpaper = {
3362
+ target: WallpaperTarget;
3363
+ path: string;
3364
+ };
3365
+ export type GetWallpaper = {
3366
+ target: WallpaperTarget;
3367
+ };
3368
+ export type Wallpaper = {
3369
+ target: WallpaperTarget;
3370
+ path: string;
3371
+ };
3372
+ export type UnlockPath = {
3373
+ address_n: number[];
3374
+ mac?: string;
3375
+ };
3376
+ export type UnlockedPathRequest = {
3377
+ mac?: string;
3378
+ };
3379
+ export declare enum MoneroNetworkType {
3380
+ MAINNET = 0,
3381
+ TESTNET = 1,
3382
+ STAGENET = 2,
3383
+ FAKECHAIN = 3
3384
+ }
3385
+ export type ViewAmount = {
3386
+ is_unlimited: boolean;
3387
+ num: string;
3388
+ };
3389
+ export type ViewDetail = {
3390
+ key: number;
3391
+ value: string;
3392
+ is_overview: boolean;
3393
+ has_icon: boolean;
3394
+ };
3395
+ export declare enum ViewTipType {
3396
+ Default = 0,
3397
+ Highlight = 1,
3398
+ Recommend = 2,
3399
+ Warning = 3,
3400
+ Danger = 4
3401
+ }
3402
+ export type ViewTip = {
3403
+ type: ViewTipType;
3404
+ text: string;
3405
+ };
3406
+ export type ViewSignPage = {
3407
+ title: string;
3408
+ amount?: UintType;
3409
+ general: ViewDetail[];
3410
+ tip?: ViewTip;
3411
+ };
3412
+ export type ViewVerifyPage = {
3413
+ title: string;
3414
+ address: string;
3415
+ path: string;
3416
+ };
3417
+ export type GetProtoVersion = {};
3418
+ export type ProtoVersion = {
3419
+ proto_version: number;
3420
+ };
3421
+ export declare enum DevRebootType {
3422
+ Normal = 0,
3423
+ Boardloader = 1,
3424
+ Bootloader = 2
3425
+ }
3426
+ export type DevReboot = {
3427
+ reboot_type: DevRebootType;
3428
+ };
3429
+ export declare enum DeviceType {
3430
+ CLASSIC1 = 0,
3431
+ CLASSIC1S = 1,
3432
+ MINI = 2,
3433
+ TOUCH = 3,
3434
+ PRO = 5,
3435
+ CLASSIC1S_PURE = 6
3436
+ }
3437
+ export declare enum DevSeType {
3438
+ THD89 = 0,
3439
+ SE608A = 1
3440
+ }
3441
+ export declare enum DevSEState {
3442
+ BOOT = 0,
3443
+ APP_FACTORY = 51,
3444
+ APP = 85
3445
+ }
3446
+ export type DevFirmwareImageInfo = {
3447
+ version?: string;
3448
+ build_id?: string;
3449
+ hash?: string;
3450
+ };
3451
+ export type DevHardwareInfo = {
3452
+ device_type?: DeviceType;
3453
+ serial_no?: string;
3454
+ device_id?: string;
3455
+ hardware_version?: string;
3456
+ hardware_version_raw_adc?: number;
3457
+ };
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 = {
3476
+ hw?: boolean;
3477
+ fw?: boolean;
3478
+ bt?: boolean;
3479
+ se1?: boolean;
3480
+ se2?: boolean;
3481
+ se3?: boolean;
3482
+ se4?: boolean;
3483
+ status?: boolean;
3484
+ };
3485
+ export type DevInfoTypes = {
3486
+ version?: boolean;
3487
+ build_id?: boolean;
3488
+ hash?: boolean;
3489
+ specific?: boolean;
3490
+ };
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;
3502
+ };
3503
+ export type ProtocolV2DeviceInfo = {
3504
+ 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
3523
+ }
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;
3539
+ };
3540
+ export type DevGetFirmwareUpdateStatus = {};
3541
+ export type DevFirmwareUpdateStatus = {
3542
+ targets: DevFirmwareUpdateStatusEntry[];
3543
+ };
3544
+ export type FactoryDeviceInfoSettings = {
3545
+ serial_no?: string;
3546
+ cpu_info?: string;
3547
+ pre_firmware?: string;
3548
+ };
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;
3557
+ };
3558
+ export type FilesystemFixPermission = {};
3559
+ export type FilesystemPathInfo = {
3560
+ exist: boolean;
3561
+ size: number;
3562
+ year: number;
3563
+ month: number;
3564
+ day: number;
3565
+ hour: number;
3566
+ minute: number;
3567
+ second: number;
3568
+ readonly: boolean;
3569
+ hidden: boolean;
3570
+ system: boolean;
3571
+ archive: boolean;
3572
+ directory: boolean;
3573
+ };
3574
+ export type FilesystemPathInfoQuery = {
3575
+ path: string;
3576
+ };
3577
+ export type FilesystemFile = {
3578
+ path: string;
3579
+ offset: number;
3580
+ total_size: number;
3581
+ data?: Buffer | ArrayBuffer | Uint8Array | string;
3582
+ data_hash?: number;
3583
+ processed_byte?: number;
3584
+ };
3585
+ export type FilesystemFileRead = {
3586
+ file: FilesystemFile;
3587
+ chunk_len?: number;
3588
+ ui_percentage?: number;
3589
+ };
3590
+ export type FilesystemFileWrite = {
3591
+ file: FilesystemFile;
3592
+ overwrite: boolean;
3593
+ append: boolean;
3594
+ ui_percentage?: number;
3595
+ };
3596
+ export type FilesystemFileDelete = {
3597
+ path: string;
3598
+ };
3599
+ export type FilesystemDir = {
3600
+ path: string;
3601
+ child_dirs?: string;
3602
+ child_files?: string;
3603
+ };
3604
+ export type FilesystemDirList = {
3605
+ path: string;
3606
+ depth?: number;
3607
+ };
3608
+ export type FilesystemDirMake = {
3609
+ path: string;
3610
+ };
3611
+ export type FilesystemDirRemove = {
3612
+ path: string;
3613
+ };
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
3621
+ }
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
+ };
3280
3640
  export type MessageType = {
3281
3641
  AlephiumGetAddress: AlephiumGetAddress;
3282
3642
  AlephiumAddress: AlephiumAddress;
@@ -3332,6 +3692,7 @@ export type MessageType = {
3332
3692
  SignMessage: SignMessage;
3333
3693
  MessageSignature: MessageSignature;
3334
3694
  VerifyMessage: VerifyMessage;
3695
+ CoinJoinRequest: CoinJoinRequest;
3335
3696
  SignTx: SignTx;
3336
3697
  TxRequestDetailsType: TxRequestDetailsType;
3337
3698
  TxRequestSerializedType: TxRequestSerializedType;
@@ -3600,7 +3961,7 @@ export type MessageType = {
3600
3961
  BixinBackupDeviceAck: BixinBackupDeviceAck;
3601
3962
  DeviceInfoSettings: DeviceInfoSettings;
3602
3963
  GetDeviceInfo: GetDeviceInfo;
3603
- DeviceInfo: DeviceInfo;
3964
+ DeviceInfo: DeviceInfo | ProtocolV2DeviceInfo;
3604
3965
  ReadSEPublicKey: ReadSEPublicKey;
3605
3966
  SEPublicKey: SEPublicKey;
3606
3967
  WriteSEPublicCert: WriteSEPublicCert;
@@ -3832,12 +4193,81 @@ export type MessageType = {
3832
4193
  TronSignMessage: TronSignMessage;
3833
4194
  TronMessageSignature: TronMessageSignature;
3834
4195
  facotry: facotry;
4196
+ experimental_message: experimental_message;
4197
+ experimental_field: experimental_field;
4198
+ TextMemo: TextMemo;
4199
+ RefundMemo: RefundMemo;
4200
+ CoinPurchaseMemo: CoinPurchaseMemo;
4201
+ PaymentRequestMemo: PaymentRequestMemo;
4202
+ TxAckPaymentRequest: TxAckPaymentRequest;
4203
+ DebugLinkInput: DebugLinkInput;
4204
+ InternalMyAddressRequest: InternalMyAddressRequest;
4205
+ SetBusy: SetBusy;
4206
+ GetFirmwareHash: GetFirmwareHash;
4207
+ FirmwareHash: FirmwareHash;
4208
+ GetNonce: GetNonce;
4209
+ Nonce: Nonce;
4210
+ WriteSEPrivateKey: WriteSEPrivateKey;
4211
+ SetWallpaper: SetWallpaper;
4212
+ GetWallpaper: GetWallpaper;
4213
+ Wallpaper: Wallpaper;
4214
+ UnlockPath: UnlockPath;
4215
+ UnlockedPathRequest: UnlockedPathRequest;
4216
+ ViewAmount: ViewAmount;
4217
+ ViewDetail: ViewDetail;
4218
+ ViewTip: ViewTip;
4219
+ ViewSignPage: ViewSignPage;
4220
+ 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;
4243
+ FilesystemPathInfo: FilesystemPathInfo;
4244
+ FilesystemPathInfoQuery: FilesystemPathInfoQuery;
4245
+ FilesystemFile: FilesystemFile;
4246
+ FilesystemFileRead: FilesystemFileRead;
4247
+ FilesystemFileWrite: FilesystemFileWrite;
4248
+ FilesystemFileDelete: FilesystemFileDelete;
4249
+ FilesystemDir: FilesystemDir;
4250
+ FilesystemDirList: FilesystemDirList;
4251
+ FilesystemDirMake: FilesystemDirMake;
4252
+ FilesystemDirRemove: FilesystemDirRemove;
4253
+ FilesystemFormat: FilesystemFormat;
4254
+ GetOnboardingStatus: GetOnboardingStatus;
4255
+ NewDevice: NewDevice;
4256
+ Restore: Restore;
4257
+ Setup: Setup;
4258
+ OnboardingStatus: OnboardingStatus;
3835
4259
  };
3836
4260
  export type MessageKey = keyof MessageType;
3837
4261
  export type MessageResponse<T extends MessageKey> = {
3838
4262
  type: T;
3839
4263
  message: MessageType[T];
3840
4264
  };
3841
- export type TypedCall = <T extends MessageKey, R extends MessageKey>(type: T, resType: R, message?: MessageType[T]) => Promise<MessageResponse<R>>;
4265
+ export type MessageResponseMap = {
4266
+ [K in MessageKey]: MessageResponse<K>;
4267
+ };
4268
+ export type TypedCall = {
4269
+ <T extends MessageKey, R extends readonly MessageKey[]>(type: T, resType: R, message?: MessageType[T]): Promise<MessageResponseMap[R[number]]>;
4270
+ <T extends MessageKey, R extends MessageKey>(type: T, resType: R, message?: MessageType[T]): Promise<MessageResponse<R>>;
4271
+ };
3842
4272
  export {};
3843
4273
  //# sourceMappingURL=messages.d.ts.map