@onekeyfe/hd-transport 1.2.0-alpha.13 → 1.2.0-alpha.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/messages.test.js +144 -4
- package/__tests__/protocol-v2-ble-frame-writer.test.js +119 -0
- package/__tests__/protocol-v2-link-manager.test.js +176 -9
- package/__tests__/protocol-v2-usb-transport-base.test.js +36 -2
- package/__tests__/protocol-v2.test.js +540 -108
- package/__tests__/transport-log.test.js +79 -0
- package/dist/constants.d.ts +3 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +645 -217
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +679 -153
- package/dist/protocols/index.d.ts +17 -1
- package/dist/protocols/index.d.ts.map +1 -1
- package/dist/protocols/v2/ble-frame-writer.d.ts +15 -0
- package/dist/protocols/v2/ble-frame-writer.d.ts.map +1 -0
- package/dist/protocols/v2/decode.d.ts +11 -0
- package/dist/protocols/v2/decode.d.ts.map +1 -1
- package/dist/protocols/v2/errors.d.ts +16 -0
- package/dist/protocols/v2/errors.d.ts.map +1 -0
- package/dist/protocols/v2/frame-assembler.d.ts.map +1 -1
- package/dist/protocols/v2/index.d.ts +2 -0
- package/dist/protocols/v2/index.d.ts.map +1 -1
- package/dist/protocols/v2/link-manager.d.ts +5 -0
- package/dist/protocols/v2/link-manager.d.ts.map +1 -1
- package/dist/protocols/v2/session.d.ts +14 -4
- package/dist/protocols/v2/session.d.ts.map +1 -1
- package/dist/protocols/v2/usb-transport-base.d.ts +2 -0
- package/dist/protocols/v2/usb-transport-base.d.ts.map +1 -1
- package/dist/serialization/protobuf/decode.d.ts.map +1 -1
- package/dist/serialization/protobuf/encode.d.ts.map +1 -1
- package/dist/types/messages.d.ts +301 -156
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/transport.d.ts +21 -3
- package/dist/types/transport.d.ts.map +1 -1
- package/dist/utils/transportLog.d.ts +9 -0
- package/dist/utils/transportLog.d.ts.map +1 -0
- package/messages-protocol-v2.json +523 -449
- package/package.json +2 -2
- package/scripts/protobuf-build.sh +112 -32
- package/scripts/protobuf-patches/index.js +1 -0
- package/scripts/protobuf-types.js +10 -1
- package/src/constants.ts +30 -16
- package/src/index.ts +5 -1
- package/src/protocols/index.ts +114 -3
- package/src/protocols/v2/ble-frame-writer.ts +77 -0
- package/src/protocols/v2/crc8.ts +1 -1
- package/src/protocols/v2/decode.ts +49 -12
- package/src/protocols/v2/encode.ts +1 -1
- package/src/protocols/v2/errors.ts +54 -0
- package/src/protocols/v2/frame-assembler.ts +6 -4
- package/src/protocols/v2/index.ts +2 -0
- package/src/protocols/v2/link-manager.ts +65 -5
- package/src/protocols/v2/session.ts +224 -80
- package/src/protocols/v2/usb-transport-base.ts +42 -10
- package/src/serialization/protobuf/decode.ts +4 -1
- package/src/serialization/protobuf/encode.ts +5 -1
- package/src/types/messages.ts +375 -198
- package/src/types/transport.ts +30 -3
- package/src/utils/transportLog.ts +102 -0
package/src/types/messages.ts
CHANGED
|
@@ -2209,11 +2209,17 @@ export type KaspaAddress = {
|
|
|
2209
2209
|
// KaspaSignTx
|
|
2210
2210
|
export type KaspaSignTx = {
|
|
2211
2211
|
address_n: number[];
|
|
2212
|
-
raw_message
|
|
2212
|
+
raw_message?: string;
|
|
2213
2213
|
scheme?: string;
|
|
2214
2214
|
prefix?: string;
|
|
2215
2215
|
input_count?: number;
|
|
2216
2216
|
use_tweak?: boolean;
|
|
2217
|
+
output_count?: number;
|
|
2218
|
+
version?: number;
|
|
2219
|
+
lock_time?: number;
|
|
2220
|
+
subnetwork_id?: string;
|
|
2221
|
+
gas?: number;
|
|
2222
|
+
payload_length?: number;
|
|
2217
2223
|
};
|
|
2218
2224
|
|
|
2219
2225
|
// KaspaTxInputRequest
|
|
@@ -2228,6 +2234,98 @@ export type KaspaTxInputAck = {
|
|
|
2228
2234
|
raw_message: string;
|
|
2229
2235
|
};
|
|
2230
2236
|
|
|
2237
|
+
// KaspaOutpoint
|
|
2238
|
+
export type KaspaOutpoint = {
|
|
2239
|
+
tx_id: string;
|
|
2240
|
+
index: number;
|
|
2241
|
+
};
|
|
2242
|
+
|
|
2243
|
+
export enum Enum_KaspaInputScriptType {
|
|
2244
|
+
KASPA_SPEND_P2PK_SCHNORR = 0,
|
|
2245
|
+
KASPA_SPEND_P2PK_ECDSA = 1,
|
|
2246
|
+
}
|
|
2247
|
+
export type KaspaInputScriptType = keyof typeof Enum_KaspaInputScriptType;
|
|
2248
|
+
|
|
2249
|
+
export enum Enum_KaspaOutputScriptType {
|
|
2250
|
+
KASPA_PAYTOADDRESS = 0,
|
|
2251
|
+
KASPA_PAYTOCHANGE = 1,
|
|
2252
|
+
}
|
|
2253
|
+
export type KaspaOutputScriptType = keyof typeof Enum_KaspaOutputScriptType;
|
|
2254
|
+
|
|
2255
|
+
export enum Enum_KaspaRequestType {
|
|
2256
|
+
KASPA_TX_INPUT = 0,
|
|
2257
|
+
KASPA_TX_OUTPUT = 1,
|
|
2258
|
+
KASPA_TX_PAYLOAD = 2,
|
|
2259
|
+
KASPA_TX_FINISHED = 3,
|
|
2260
|
+
KASPA_TX_PREV_META = 4,
|
|
2261
|
+
}
|
|
2262
|
+
export type KaspaRequestType = keyof typeof Enum_KaspaRequestType;
|
|
2263
|
+
|
|
2264
|
+
// KaspaTxRequestSignature
|
|
2265
|
+
export type KaspaTxRequestSignature = {
|
|
2266
|
+
signature_index: number;
|
|
2267
|
+
signature: string;
|
|
2268
|
+
};
|
|
2269
|
+
|
|
2270
|
+
// KaspaTxRequest
|
|
2271
|
+
export type KaspaTxRequest = {
|
|
2272
|
+
request_type: KaspaRequestType;
|
|
2273
|
+
request_index?: number;
|
|
2274
|
+
signature?: KaspaTxRequestSignature;
|
|
2275
|
+
request_payload_length?: number;
|
|
2276
|
+
prev_tx_id?: string;
|
|
2277
|
+
};
|
|
2278
|
+
|
|
2279
|
+
// KaspaTxAckInput
|
|
2280
|
+
export type KaspaTxAckInput = {
|
|
2281
|
+
address_n: number[];
|
|
2282
|
+
previous_outpoint: KaspaOutpoint;
|
|
2283
|
+
amount: UintType;
|
|
2284
|
+
sequence: number;
|
|
2285
|
+
sig_op_count: number;
|
|
2286
|
+
script_type?: KaspaInputScriptType;
|
|
2287
|
+
use_tweak?: boolean;
|
|
2288
|
+
};
|
|
2289
|
+
|
|
2290
|
+
// KaspaTxAckOutput
|
|
2291
|
+
export type KaspaTxAckOutput = {
|
|
2292
|
+
script_type?: KaspaOutputScriptType;
|
|
2293
|
+
amount: UintType;
|
|
2294
|
+
address_n: number[];
|
|
2295
|
+
address?: string;
|
|
2296
|
+
scheme?: string;
|
|
2297
|
+
use_tweak?: boolean;
|
|
2298
|
+
};
|
|
2299
|
+
|
|
2300
|
+
// KaspaTxAckPayloadChunk
|
|
2301
|
+
export type KaspaTxAckPayloadChunk = {
|
|
2302
|
+
payload_chunk: string;
|
|
2303
|
+
};
|
|
2304
|
+
|
|
2305
|
+
// KaspaTxAckPrevMeta
|
|
2306
|
+
export type KaspaTxAckPrevMeta = {
|
|
2307
|
+
version: number;
|
|
2308
|
+
input_count: number;
|
|
2309
|
+
output_count: number;
|
|
2310
|
+
lock_time: number;
|
|
2311
|
+
subnetwork_id: string;
|
|
2312
|
+
gas: number;
|
|
2313
|
+
payload_length: number;
|
|
2314
|
+
};
|
|
2315
|
+
|
|
2316
|
+
// KaspaTxAckPrevInput
|
|
2317
|
+
export type KaspaTxAckPrevInput = {
|
|
2318
|
+
previous_outpoint: KaspaOutpoint;
|
|
2319
|
+
sequence: number;
|
|
2320
|
+
};
|
|
2321
|
+
|
|
2322
|
+
// KaspaTxAckPrevOutput
|
|
2323
|
+
export type KaspaTxAckPrevOutput = {
|
|
2324
|
+
amount: UintType;
|
|
2325
|
+
script_version: number;
|
|
2326
|
+
script_public_key: string;
|
|
2327
|
+
};
|
|
2328
|
+
|
|
2231
2329
|
// KaspaSignedTx
|
|
2232
2330
|
export type KaspaSignedTx = {
|
|
2233
2331
|
signature: string;
|
|
@@ -2261,7 +2359,7 @@ export enum Enum_SafetyCheckLevel {
|
|
|
2261
2359
|
PromptAlways = 1,
|
|
2262
2360
|
PromptTemporarily = 2,
|
|
2263
2361
|
}
|
|
2264
|
-
export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel;
|
|
2362
|
+
export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel | Enum_SafetyCheckLevel;
|
|
2265
2363
|
|
|
2266
2364
|
// Initialize
|
|
2267
2365
|
export type Initialize = {
|
|
@@ -2924,8 +3022,6 @@ export type UnLockDeviceResponse = {
|
|
|
2924
3022
|
// GetPassphraseState
|
|
2925
3023
|
export type GetPassphraseState = {
|
|
2926
3024
|
passphrase_state?: string;
|
|
2927
|
-
_only_main_pin?: boolean;
|
|
2928
|
-
allow_create_attach_pin?: boolean;
|
|
2929
3025
|
};
|
|
2930
3026
|
|
|
2931
3027
|
// PassphraseState
|
|
@@ -4500,21 +4596,6 @@ export type EthereumSignTypedDataQR = {
|
|
|
4500
4596
|
request_id?: string;
|
|
4501
4597
|
};
|
|
4502
4598
|
|
|
4503
|
-
// InternalMyAddressRequest
|
|
4504
|
-
export type InternalMyAddressRequest = {
|
|
4505
|
-
coin_type: number;
|
|
4506
|
-
chain_id: number;
|
|
4507
|
-
account_index: number;
|
|
4508
|
-
derive_type: number;
|
|
4509
|
-
};
|
|
4510
|
-
|
|
4511
|
-
// StartSession
|
|
4512
|
-
export type StartSession = {
|
|
4513
|
-
session_id?: string;
|
|
4514
|
-
_skip_passphrase?: boolean;
|
|
4515
|
-
derive_cardano?: boolean;
|
|
4516
|
-
};
|
|
4517
|
-
|
|
4518
4599
|
// SetBusy
|
|
4519
4600
|
export type SetBusy = {
|
|
4520
4601
|
expiry_ms?: number;
|
|
@@ -4543,28 +4624,6 @@ export type WriteSEPrivateKey = {
|
|
|
4543
4624
|
private_key: string;
|
|
4544
4625
|
};
|
|
4545
4626
|
|
|
4546
|
-
export enum WallpaperTarget {
|
|
4547
|
-
Home = 0,
|
|
4548
|
-
Lock = 1,
|
|
4549
|
-
}
|
|
4550
|
-
|
|
4551
|
-
// SetWallpaper
|
|
4552
|
-
export type SetWallpaper = {
|
|
4553
|
-
target: WallpaperTarget;
|
|
4554
|
-
path: string;
|
|
4555
|
-
};
|
|
4556
|
-
|
|
4557
|
-
// GetWallpaper
|
|
4558
|
-
export type GetWallpaper = {
|
|
4559
|
-
target: WallpaperTarget;
|
|
4560
|
-
};
|
|
4561
|
-
|
|
4562
|
-
// Wallpaper
|
|
4563
|
-
export type Wallpaper = {
|
|
4564
|
-
target: WallpaperTarget;
|
|
4565
|
-
path: string;
|
|
4566
|
-
};
|
|
4567
|
-
|
|
4568
4627
|
// UnlockPath
|
|
4569
4628
|
export type UnlockPath = {
|
|
4570
4629
|
address_n: number[];
|
|
@@ -4583,74 +4642,34 @@ export enum MoneroNetworkType {
|
|
|
4583
4642
|
FAKECHAIN = 3,
|
|
4584
4643
|
}
|
|
4585
4644
|
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
num: string;
|
|
4590
|
-
};
|
|
4591
|
-
|
|
4592
|
-
// ViewDetail
|
|
4593
|
-
export type ViewDetail = {
|
|
4594
|
-
key: number;
|
|
4595
|
-
value: string;
|
|
4596
|
-
is_overview: boolean;
|
|
4597
|
-
has_icon: boolean;
|
|
4598
|
-
};
|
|
4599
|
-
|
|
4600
|
-
export enum ViewTipType {
|
|
4601
|
-
Default = 0,
|
|
4602
|
-
Highlight = 1,
|
|
4603
|
-
Recommend = 2,
|
|
4604
|
-
Warning = 3,
|
|
4605
|
-
Danger = 4,
|
|
4645
|
+
export enum UiAnimationType {
|
|
4646
|
+
Unknown = 0,
|
|
4647
|
+
Signing = 1,
|
|
4606
4648
|
}
|
|
4607
4649
|
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
// ViewRawData
|
|
4615
|
-
export type ViewRawData = {
|
|
4616
|
-
initial_data: string;
|
|
4617
|
-
placeholder: number;
|
|
4618
|
-
};
|
|
4619
|
-
|
|
4620
|
-
export enum ViewSignLayout {
|
|
4621
|
-
LayoutDefault = 0,
|
|
4622
|
-
LayoutSafeTxCreate = 1,
|
|
4623
|
-
LayoutFinalConfirm = 2,
|
|
4624
|
-
Layout7702 = 3,
|
|
4625
|
-
LayoutFlat = 4,
|
|
4650
|
+
export enum UiAnimationCommand {
|
|
4651
|
+
CommandUnknown = 0,
|
|
4652
|
+
Start = 1,
|
|
4653
|
+
Stop = 2,
|
|
4654
|
+
Refresh = 3,
|
|
4626
4655
|
}
|
|
4627
4656
|
|
|
4628
|
-
//
|
|
4629
|
-
export type
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
general: ViewDetail[];
|
|
4633
|
-
tip?: ViewTip;
|
|
4634
|
-
raw_data?: ViewRawData;
|
|
4635
|
-
slide_to_confirm?: boolean;
|
|
4636
|
-
layout?: ViewSignLayout;
|
|
4637
|
-
};
|
|
4638
|
-
|
|
4639
|
-
// ViewVerifyPage
|
|
4640
|
-
export type ViewVerifyPage = {
|
|
4641
|
-
title: string;
|
|
4642
|
-
address: string;
|
|
4643
|
-
path: string;
|
|
4657
|
+
// UiAnimationRequest
|
|
4658
|
+
export type UiAnimationRequest = {
|
|
4659
|
+
command: UiAnimationCommand;
|
|
4660
|
+
type?: UiAnimationType;
|
|
4644
4661
|
};
|
|
4645
4662
|
|
|
4646
4663
|
// ProtocolInfoRequest
|
|
4647
|
-
export type ProtocolInfoRequest = {
|
|
4664
|
+
export type ProtocolInfoRequest = {
|
|
4665
|
+
eventless_wallet_session?: boolean;
|
|
4666
|
+
};
|
|
4648
4667
|
|
|
4649
4668
|
// ProtocolInfo
|
|
4650
4669
|
export type ProtocolInfo = {
|
|
4651
4670
|
version: number;
|
|
4671
|
+
build_fingerprint: string;
|
|
4652
4672
|
supported_messages: number[];
|
|
4653
|
-
protobuf_definition?: string;
|
|
4654
4673
|
};
|
|
4655
4674
|
|
|
4656
4675
|
export enum DeviceErrorCode {
|
|
@@ -4679,23 +4698,22 @@ export type DeviceReboot = {
|
|
|
4679
4698
|
|
|
4680
4699
|
// DeviceSettings
|
|
4681
4700
|
export type DeviceSettings = {
|
|
4682
|
-
label?: string;
|
|
4683
4701
|
bt_enable?: boolean;
|
|
4684
4702
|
language?: string;
|
|
4685
4703
|
wallpaper_path?: string;
|
|
4686
|
-
passphrase_enable?: boolean;
|
|
4687
4704
|
brightness?: number;
|
|
4688
|
-
autolock_delay_ms?: number;
|
|
4689
|
-
autoshutdown_delay_ms?: number;
|
|
4690
4705
|
animation_enable?: boolean;
|
|
4691
4706
|
tap_to_wake?: boolean;
|
|
4692
4707
|
haptic_feedback?: boolean;
|
|
4693
4708
|
device_name_display_enabled?: boolean;
|
|
4694
4709
|
airgap_mode?: boolean;
|
|
4695
|
-
fido_enabled?: boolean;
|
|
4696
|
-
experimental_features?: boolean;
|
|
4697
4710
|
usb_lock_enable?: boolean;
|
|
4698
4711
|
random_keypad?: boolean;
|
|
4712
|
+
passphrase_enable?: boolean;
|
|
4713
|
+
fido_enabled?: boolean;
|
|
4714
|
+
autolock_delay_ms?: number;
|
|
4715
|
+
autoshutdown_delay_ms?: number;
|
|
4716
|
+
label?: string;
|
|
4699
4717
|
};
|
|
4700
4718
|
|
|
4701
4719
|
// DeviceSettingsGet
|
|
@@ -4743,6 +4761,54 @@ export type DeviceCertificateSign = {
|
|
|
4743
4761
|
data: string;
|
|
4744
4762
|
};
|
|
4745
4763
|
|
|
4764
|
+
// DeviceMiscUsbMscControl
|
|
4765
|
+
export type DeviceMiscUsbMscControl = {
|
|
4766
|
+
enable: boolean;
|
|
4767
|
+
};
|
|
4768
|
+
|
|
4769
|
+
export enum DeviceFactoryAck {
|
|
4770
|
+
FACTORY_ACK_SUCCESS = 0,
|
|
4771
|
+
FACTORY_ACK_FAIL = 1,
|
|
4772
|
+
}
|
|
4773
|
+
|
|
4774
|
+
// DeviceFactoryInfoManufactureTime
|
|
4775
|
+
export type DeviceFactoryInfoManufactureTime = {
|
|
4776
|
+
year: number;
|
|
4777
|
+
month: number;
|
|
4778
|
+
day: number;
|
|
4779
|
+
hour: number;
|
|
4780
|
+
minute: number;
|
|
4781
|
+
second: number;
|
|
4782
|
+
};
|
|
4783
|
+
|
|
4784
|
+
// DeviceFactoryInfo
|
|
4785
|
+
export type DeviceFactoryInfo = {
|
|
4786
|
+
version?: number;
|
|
4787
|
+
serial_number?: string;
|
|
4788
|
+
factory_test_completed?: boolean;
|
|
4789
|
+
factory_burn_in_completed?: boolean;
|
|
4790
|
+
manufacture_time?: DeviceFactoryInfoManufactureTime;
|
|
4791
|
+
};
|
|
4792
|
+
|
|
4793
|
+
// DeviceFactoryInfoSet
|
|
4794
|
+
export type DeviceFactoryInfoSet = {
|
|
4795
|
+
info: DeviceFactoryInfo;
|
|
4796
|
+
};
|
|
4797
|
+
|
|
4798
|
+
// DeviceFactoryInfoGet
|
|
4799
|
+
export type DeviceFactoryInfoGet = {};
|
|
4800
|
+
|
|
4801
|
+
// DeviceFactoryPermanentLock
|
|
4802
|
+
export type DeviceFactoryPermanentLock = {
|
|
4803
|
+
check_a: string;
|
|
4804
|
+
check_b: string;
|
|
4805
|
+
};
|
|
4806
|
+
|
|
4807
|
+
// DeviceFactoryTest
|
|
4808
|
+
export type DeviceFactoryTest = {
|
|
4809
|
+
burn_in_test: boolean;
|
|
4810
|
+
};
|
|
4811
|
+
|
|
4746
4812
|
export enum DeviceFirmwareTargetType {
|
|
4747
4813
|
FW_MGMT_TARGET_INVALID = 0,
|
|
4748
4814
|
FW_MGMT_TARGET_CRATE = 1,
|
|
@@ -4777,11 +4843,14 @@ export type DeviceFirmwareTarget = {
|
|
|
4777
4843
|
path: string;
|
|
4778
4844
|
};
|
|
4779
4845
|
|
|
4780
|
-
//
|
|
4781
|
-
export type
|
|
4846
|
+
// DeviceFirmwareUpdateStage
|
|
4847
|
+
export type DeviceFirmwareUpdateStage = {
|
|
4782
4848
|
targets: DeviceFirmwareTarget[];
|
|
4783
4849
|
};
|
|
4784
4850
|
|
|
4851
|
+
// DeviceFirmwareUpdateRequest
|
|
4852
|
+
export type DeviceFirmwareUpdateRequest = {};
|
|
4853
|
+
|
|
4785
4854
|
// DeviceFirmwareUpdateRecord
|
|
4786
4855
|
export type DeviceFirmwareUpdateRecord = {
|
|
4787
4856
|
target_id: DeviceFirmwareTargetType;
|
|
@@ -4807,49 +4876,6 @@ export type DeviceFirmwareUpdateStatus = {
|
|
|
4807
4876
|
records: DeviceFirmwareUpdateRecord[];
|
|
4808
4877
|
};
|
|
4809
4878
|
|
|
4810
|
-
export enum DeviceFactoryAck {
|
|
4811
|
-
FACTORY_ACK_SUCCESS = 0,
|
|
4812
|
-
FACTORY_ACK_FAIL = 1,
|
|
4813
|
-
}
|
|
4814
|
-
|
|
4815
|
-
// DeviceFactoryInfoManufactureTime
|
|
4816
|
-
export type DeviceFactoryInfoManufactureTime = {
|
|
4817
|
-
year: number;
|
|
4818
|
-
month: number;
|
|
4819
|
-
day: number;
|
|
4820
|
-
hour: number;
|
|
4821
|
-
minute: number;
|
|
4822
|
-
second: number;
|
|
4823
|
-
};
|
|
4824
|
-
|
|
4825
|
-
// DeviceFactoryInfo
|
|
4826
|
-
export type DeviceFactoryInfo = {
|
|
4827
|
-
version?: number;
|
|
4828
|
-
serial_number?: string;
|
|
4829
|
-
burn_in_completed?: boolean;
|
|
4830
|
-
factory_test_completed?: boolean;
|
|
4831
|
-
manufacture_time?: DeviceFactoryInfoManufactureTime;
|
|
4832
|
-
};
|
|
4833
|
-
|
|
4834
|
-
// DeviceFactoryInfoSet
|
|
4835
|
-
export type DeviceFactoryInfoSet = {
|
|
4836
|
-
info: DeviceFactoryInfo;
|
|
4837
|
-
};
|
|
4838
|
-
|
|
4839
|
-
// DeviceFactoryInfoGet
|
|
4840
|
-
export type DeviceFactoryInfoGet = {};
|
|
4841
|
-
|
|
4842
|
-
// DeviceFactoryPermanentLock
|
|
4843
|
-
export type DeviceFactoryPermanentLock = {
|
|
4844
|
-
check_a: string;
|
|
4845
|
-
check_b: string;
|
|
4846
|
-
};
|
|
4847
|
-
|
|
4848
|
-
// DeviceFactoryTest
|
|
4849
|
-
export type DeviceFactoryTest = {
|
|
4850
|
-
burn_in_test: boolean;
|
|
4851
|
-
};
|
|
4852
|
-
|
|
4853
4879
|
export enum DeviceType {
|
|
4854
4880
|
CLASSIC1 = 0,
|
|
4855
4881
|
CLASSIC1S = 1,
|
|
@@ -4914,13 +4940,12 @@ export type DeviceSEInfo = {
|
|
|
4914
4940
|
// DeviceInfoTargets
|
|
4915
4941
|
export type DeviceInfoTargets = {
|
|
4916
4942
|
hw?: boolean;
|
|
4917
|
-
|
|
4943
|
+
main_mcu?: boolean;
|
|
4918
4944
|
coprocessor?: boolean;
|
|
4919
4945
|
se1?: boolean;
|
|
4920
4946
|
se2?: boolean;
|
|
4921
4947
|
se3?: boolean;
|
|
4922
4948
|
se4?: boolean;
|
|
4923
|
-
status?: boolean;
|
|
4924
4949
|
};
|
|
4925
4950
|
|
|
4926
4951
|
// DeviceInfoTypes
|
|
@@ -4941,18 +4966,33 @@ export type DeviceInfoGet = {
|
|
|
4941
4966
|
export type ProtocolV2DeviceInfo = {
|
|
4942
4967
|
protocol_version: number;
|
|
4943
4968
|
hw?: DeviceHardwareInfo;
|
|
4944
|
-
|
|
4969
|
+
main_mcu?: DeviceMainMcuInfo;
|
|
4945
4970
|
coprocessor?: DeviceCoprocessorInfo;
|
|
4946
4971
|
se1?: DeviceSEInfo;
|
|
4947
4972
|
se2?: DeviceSEInfo;
|
|
4948
4973
|
se3?: DeviceSEInfo;
|
|
4949
4974
|
se4?: DeviceSEInfo;
|
|
4950
|
-
status?: DeviceStatus;
|
|
4951
4975
|
};
|
|
4952
4976
|
|
|
4977
|
+
export enum DeviceSessionErrorCode {
|
|
4978
|
+
DeviceSessionError_None = 0,
|
|
4979
|
+
DeviceSessionError_UserCancelled = 1,
|
|
4980
|
+
DeviceSessionError_InvalidSession = 2,
|
|
4981
|
+
DeviceSessionError_AttachPinUnavailable = 3,
|
|
4982
|
+
DeviceSessionError_PassphraseDisabled = 4,
|
|
4983
|
+
DeviceSessionError_Busy = 5,
|
|
4984
|
+
}
|
|
4985
|
+
|
|
4986
|
+
export enum DeviceSessionSeedDomain {
|
|
4987
|
+
SeedDomain_Standard = 1,
|
|
4988
|
+
SeedDomain_Cardano = 2,
|
|
4989
|
+
}
|
|
4990
|
+
|
|
4953
4991
|
// DeviceSessionGet
|
|
4954
4992
|
export type DeviceSessionGet = {
|
|
4955
4993
|
session_id?: string;
|
|
4994
|
+
btc_test_address?: string;
|
|
4995
|
+
seed_domains: DeviceSessionSeedDomain[];
|
|
4956
4996
|
};
|
|
4957
4997
|
|
|
4958
4998
|
// DeviceSession
|
|
@@ -4961,8 +5001,22 @@ export type DeviceSession = {
|
|
|
4961
5001
|
btc_test_address?: string;
|
|
4962
5002
|
};
|
|
4963
5003
|
|
|
5004
|
+
export enum DeviceSessionPinType {
|
|
5005
|
+
Any = 1,
|
|
5006
|
+
Main = 2,
|
|
5007
|
+
AttachToPin = 3,
|
|
5008
|
+
}
|
|
5009
|
+
|
|
4964
5010
|
// DeviceSessionAskPin
|
|
4965
|
-
export type DeviceSessionAskPin = {
|
|
5011
|
+
export type DeviceSessionAskPin = {
|
|
5012
|
+
type?: DeviceSessionPinType;
|
|
5013
|
+
};
|
|
5014
|
+
|
|
5015
|
+
// DeviceSessionAskPassphrase
|
|
5016
|
+
export type DeviceSessionAskPassphrase = {
|
|
5017
|
+
passphrase?: string;
|
|
5018
|
+
on_device: boolean;
|
|
5019
|
+
};
|
|
4966
5020
|
|
|
4967
5021
|
export enum DeviceSessionAskPin_FailureSubCodes {
|
|
4968
5022
|
UserCancel = 1,
|
|
@@ -4982,32 +5036,6 @@ export type DeviceStatus = {
|
|
|
4982
5036
|
// DeviceStatusGet
|
|
4983
5037
|
export type DeviceStatusGet = {};
|
|
4984
5038
|
|
|
4985
|
-
export enum DevOnboardingStage {
|
|
4986
|
-
DEV_ONBOARDING_STAGE_UNKNOWN = 0,
|
|
4987
|
-
DEV_ONBOARDING_STAGE_SAFETY_CHECK = 1,
|
|
4988
|
-
DEV_ONBOARDING_STAGE_PERSONALIZATION = 2,
|
|
4989
|
-
DEV_ONBOARDING_STAGE_SELECT_SETUP_METHOD = 3,
|
|
4990
|
-
DEV_ONBOARDING_STAGE_NEW_DEVICE = 4,
|
|
4991
|
-
DEV_ONBOARDING_STAGE_SELECT_RESTORE_METHOD = 5,
|
|
4992
|
-
DEV_ONBOARDING_STAGE_RESTORE_MNEMONIC = 6,
|
|
4993
|
-
DEV_ONBOARDING_STAGE_RESTORE_SEEDCARD = 7,
|
|
4994
|
-
DEV_ONBOARDING_STAGE_WALLET_READY = 8,
|
|
4995
|
-
DEV_ONBOARDING_STAGE_SEEDCARD_BACKUP_PROMPT = 9,
|
|
4996
|
-
DEV_ONBOARDING_STAGE_SELECT_SEEDCARD_BACKUP_METHOD = 10,
|
|
4997
|
-
DEV_ONBOARDING_STAGE_SEEDCARD_BACKUP = 11,
|
|
4998
|
-
DEV_ONBOARDING_STAGE_DONE = 12,
|
|
4999
|
-
}
|
|
5000
|
-
|
|
5001
|
-
// DevGetOnboardingStatus
|
|
5002
|
-
export type DevGetOnboardingStatus = {};
|
|
5003
|
-
|
|
5004
|
-
// DevOnboardingStatus
|
|
5005
|
-
export type DevOnboardingStatus = {
|
|
5006
|
-
stage: DevOnboardingStage;
|
|
5007
|
-
status_code?: number;
|
|
5008
|
-
detail_code?: number;
|
|
5009
|
-
};
|
|
5010
|
-
|
|
5011
5039
|
// FilesystemPermissionFix
|
|
5012
5040
|
export type FilesystemPermissionFix = {};
|
|
5013
5041
|
|
|
@@ -5092,9 +5120,147 @@ export type FilesystemFormat = {
|
|
|
5092
5120
|
user: boolean;
|
|
5093
5121
|
};
|
|
5094
5122
|
|
|
5123
|
+
// InternalMyAddressRequest
|
|
5124
|
+
export type InternalMyAddressRequest = {
|
|
5125
|
+
coin_type: number;
|
|
5126
|
+
chain_id: number;
|
|
5127
|
+
account_index: number;
|
|
5128
|
+
derive_type: number;
|
|
5129
|
+
};
|
|
5130
|
+
|
|
5131
|
+
// NftUpdate
|
|
5132
|
+
export type NftUpdate = {
|
|
5133
|
+
file_name_no_ext: string;
|
|
5134
|
+
};
|
|
5135
|
+
|
|
5136
|
+
export enum OnboardingStep {
|
|
5137
|
+
ONBOARDING_STEP_UNKNOWN = 0,
|
|
5138
|
+
ONBOARDING_STEP_CHECKING = 1,
|
|
5139
|
+
ONBOARDING_STEP_PERSONALIZATION = 2,
|
|
5140
|
+
ONBOARDING_STEP_PIN = 3,
|
|
5141
|
+
ONBOARDING_STEP_SETUP = 4,
|
|
5142
|
+
ONBOARDING_STEP_DONE = 5,
|
|
5143
|
+
}
|
|
5144
|
+
|
|
5145
|
+
export enum OnboardingPhase {
|
|
5146
|
+
ONBOARDING_PHASE_UNKNOWN = 0,
|
|
5147
|
+
ONBOARDING_PHASE_SAFETY_CHECK = 1,
|
|
5148
|
+
ONBOARDING_PHASE_PIN_SETUP = 2,
|
|
5149
|
+
ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
|
|
5150
|
+
ONBOARDING_PHASE_SETUP_CHOICE = 4,
|
|
5151
|
+
ONBOARDING_PHASE_WALLET_CREATE_START = 5,
|
|
5152
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
|
|
5153
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
|
|
5154
|
+
ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
|
|
5155
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
|
|
5156
|
+
ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
|
|
5157
|
+
ONBOARDING_PHASE_WALLET_READY = 11,
|
|
5158
|
+
ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
|
|
5159
|
+
ONBOARDING_PHASE_SEEDCARD_BACKUP = 13,
|
|
5160
|
+
}
|
|
5161
|
+
|
|
5162
|
+
export enum OnboardingSetupKind {
|
|
5163
|
+
ONBOARDING_SETUP_KIND_UNKNOWN = 0,
|
|
5164
|
+
ONBOARDING_SETUP_KIND_CHOICE = 1,
|
|
5165
|
+
ONBOARDING_SETUP_KIND_CREATE = 2,
|
|
5166
|
+
ONBOARDING_SETUP_KIND_RESTORE = 3,
|
|
5167
|
+
}
|
|
5168
|
+
|
|
5169
|
+
export enum OnboardingSetupMethod {
|
|
5170
|
+
ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
|
|
5171
|
+
ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
|
|
5172
|
+
ONBOARDING_SETUP_METHOD_SEEDCARD = 2,
|
|
5173
|
+
}
|
|
5174
|
+
|
|
5175
|
+
// OnboardingSetupStatus
|
|
5176
|
+
export type OnboardingSetupStatus = {
|
|
5177
|
+
kind?: OnboardingSetupKind;
|
|
5178
|
+
method?: OnboardingSetupMethod;
|
|
5179
|
+
};
|
|
5180
|
+
|
|
5181
|
+
// OnboardingStatusGet
|
|
5182
|
+
export type OnboardingStatusGet = {};
|
|
5183
|
+
|
|
5184
|
+
// OnboardingStatus
|
|
5185
|
+
export type OnboardingStatus = {
|
|
5186
|
+
step?: OnboardingStep;
|
|
5187
|
+
phase?: OnboardingPhase;
|
|
5188
|
+
setup?: OnboardingSetupStatus;
|
|
5189
|
+
pin_set?: boolean;
|
|
5190
|
+
wallet_initialized?: boolean;
|
|
5191
|
+
};
|
|
5192
|
+
|
|
5095
5193
|
// PortfolioUpdate
|
|
5096
5194
|
export type PortfolioUpdate = {};
|
|
5097
5195
|
|
|
5196
|
+
// ViewAmount
|
|
5197
|
+
export type ViewAmount = {
|
|
5198
|
+
is_unlimited: boolean;
|
|
5199
|
+
num: string;
|
|
5200
|
+
};
|
|
5201
|
+
|
|
5202
|
+
// ViewDetail
|
|
5203
|
+
export type ViewDetail = {
|
|
5204
|
+
key: number;
|
|
5205
|
+
value: string;
|
|
5206
|
+
is_overview: boolean;
|
|
5207
|
+
has_icon: boolean;
|
|
5208
|
+
};
|
|
5209
|
+
|
|
5210
|
+
export enum ViewTipType {
|
|
5211
|
+
Default = 0,
|
|
5212
|
+
Highlight = 1,
|
|
5213
|
+
Recommend = 2,
|
|
5214
|
+
Warning = 3,
|
|
5215
|
+
Danger = 4,
|
|
5216
|
+
}
|
|
5217
|
+
|
|
5218
|
+
// ViewTip
|
|
5219
|
+
export type ViewTip = {
|
|
5220
|
+
type: ViewTipType;
|
|
5221
|
+
text?: string;
|
|
5222
|
+
text_id?: number;
|
|
5223
|
+
};
|
|
5224
|
+
|
|
5225
|
+
// ViewRawData
|
|
5226
|
+
export type ViewRawData = {
|
|
5227
|
+
initial_data: string;
|
|
5228
|
+
placeholder: number;
|
|
5229
|
+
};
|
|
5230
|
+
|
|
5231
|
+
export enum ViewSignLayout {
|
|
5232
|
+
LayoutDefault = 0,
|
|
5233
|
+
LayoutSafeTxCreate = 1,
|
|
5234
|
+
LayoutFinalConfirm = 2,
|
|
5235
|
+
Layout7702 = 3,
|
|
5236
|
+
LayoutFlat = 4,
|
|
5237
|
+
LayoutEthApprove = 5,
|
|
5238
|
+
}
|
|
5239
|
+
|
|
5240
|
+
// ViewSignPage
|
|
5241
|
+
export type ViewSignPage = {
|
|
5242
|
+
title?: string;
|
|
5243
|
+
amount?: UintType;
|
|
5244
|
+
general: ViewDetail[];
|
|
5245
|
+
tip?: ViewTip;
|
|
5246
|
+
raw_data?: ViewRawData;
|
|
5247
|
+
slide_to_confirm?: boolean;
|
|
5248
|
+
layout?: ViewSignLayout;
|
|
5249
|
+
title_id?: number;
|
|
5250
|
+
};
|
|
5251
|
+
|
|
5252
|
+
// ViewVerifyPage
|
|
5253
|
+
export type ViewVerifyPage = {
|
|
5254
|
+
title?: string;
|
|
5255
|
+
address: string;
|
|
5256
|
+
path: string;
|
|
5257
|
+
network?: string;
|
|
5258
|
+
derive_type?: string;
|
|
5259
|
+
value_key?: number;
|
|
5260
|
+
title_id?: number;
|
|
5261
|
+
chain_id?: number;
|
|
5262
|
+
};
|
|
5263
|
+
|
|
5098
5264
|
export enum ProtocolV2FailureType {
|
|
5099
5265
|
Failure_InvalidMessage = 1,
|
|
5100
5266
|
Failure_UndefinedError = 2,
|
|
@@ -5401,6 +5567,15 @@ export type MessageType = {
|
|
|
5401
5567
|
KaspaSignTx: KaspaSignTx;
|
|
5402
5568
|
KaspaTxInputRequest: KaspaTxInputRequest;
|
|
5403
5569
|
KaspaTxInputAck: KaspaTxInputAck;
|
|
5570
|
+
KaspaOutpoint: KaspaOutpoint;
|
|
5571
|
+
KaspaTxRequestSignature: KaspaTxRequestSignature;
|
|
5572
|
+
KaspaTxRequest: KaspaTxRequest;
|
|
5573
|
+
KaspaTxAckInput: KaspaTxAckInput;
|
|
5574
|
+
KaspaTxAckOutput: KaspaTxAckOutput;
|
|
5575
|
+
KaspaTxAckPayloadChunk: KaspaTxAckPayloadChunk;
|
|
5576
|
+
KaspaTxAckPrevMeta: KaspaTxAckPrevMeta;
|
|
5577
|
+
KaspaTxAckPrevInput: KaspaTxAckPrevInput;
|
|
5578
|
+
KaspaTxAckPrevOutput: KaspaTxAckPrevOutput;
|
|
5404
5579
|
KaspaSignedTx: KaspaSignedTx;
|
|
5405
5580
|
LnurlAuth: LnurlAuth;
|
|
5406
5581
|
LnurlAuthResp: LnurlAuthResp;
|
|
@@ -5691,25 +5866,15 @@ export type MessageType = {
|
|
|
5691
5866
|
PaymentRequestMemo: PaymentRequestMemo;
|
|
5692
5867
|
TxAckPaymentRequest: TxAckPaymentRequest;
|
|
5693
5868
|
EthereumSignTypedDataQR: EthereumSignTypedDataQR;
|
|
5694
|
-
InternalMyAddressRequest: InternalMyAddressRequest;
|
|
5695
|
-
StartSession: StartSession;
|
|
5696
5869
|
SetBusy: SetBusy;
|
|
5697
5870
|
GetFirmwareHash: GetFirmwareHash;
|
|
5698
5871
|
FirmwareHash: FirmwareHash;
|
|
5699
5872
|
GetNonce: GetNonce;
|
|
5700
5873
|
Nonce: Nonce;
|
|
5701
5874
|
WriteSEPrivateKey: WriteSEPrivateKey;
|
|
5702
|
-
SetWallpaper: SetWallpaper;
|
|
5703
|
-
GetWallpaper: GetWallpaper;
|
|
5704
|
-
Wallpaper: Wallpaper;
|
|
5705
5875
|
UnlockPath: UnlockPath;
|
|
5706
5876
|
UnlockedPathRequest: UnlockedPathRequest;
|
|
5707
|
-
|
|
5708
|
-
ViewDetail: ViewDetail;
|
|
5709
|
-
ViewTip: ViewTip;
|
|
5710
|
-
ViewRawData: ViewRawData;
|
|
5711
|
-
ViewSignPage: ViewSignPage;
|
|
5712
|
-
ViewVerifyPage: ViewVerifyPage;
|
|
5877
|
+
UiAnimationRequest: UiAnimationRequest;
|
|
5713
5878
|
ProtocolInfoRequest: ProtocolInfoRequest;
|
|
5714
5879
|
ProtocolInfo: ProtocolInfo;
|
|
5715
5880
|
DeviceReboot: DeviceReboot;
|
|
@@ -5722,18 +5887,20 @@ export type MessageType = {
|
|
|
5722
5887
|
DeviceCertificateRead: DeviceCertificateRead;
|
|
5723
5888
|
DeviceCertificateSignature: DeviceCertificateSignature;
|
|
5724
5889
|
DeviceCertificateSign: DeviceCertificateSign;
|
|
5725
|
-
|
|
5726
|
-
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
5727
|
-
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
5728
|
-
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
5729
|
-
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
5730
|
-
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
5890
|
+
DeviceMiscUsbMscControl: DeviceMiscUsbMscControl;
|
|
5731
5891
|
DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
|
|
5732
5892
|
DeviceFactoryInfo: DeviceFactoryInfo;
|
|
5733
5893
|
DeviceFactoryInfoSet: DeviceFactoryInfoSet;
|
|
5734
5894
|
DeviceFactoryInfoGet: DeviceFactoryInfoGet;
|
|
5735
5895
|
DeviceFactoryPermanentLock: DeviceFactoryPermanentLock;
|
|
5736
5896
|
DeviceFactoryTest: DeviceFactoryTest;
|
|
5897
|
+
DeviceFirmwareTarget: DeviceFirmwareTarget;
|
|
5898
|
+
DeviceFirmwareUpdateStage: DeviceFirmwareUpdateStage;
|
|
5899
|
+
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
5900
|
+
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
5901
|
+
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
5902
|
+
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
5903
|
+
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
5737
5904
|
DeviceFirmwareImageInfo: DeviceFirmwareImageInfo;
|
|
5738
5905
|
DeviceHardwareInfo: DeviceHardwareInfo;
|
|
5739
5906
|
DeviceMainMcuInfo: DeviceMainMcuInfo;
|
|
@@ -5745,10 +5912,9 @@ export type MessageType = {
|
|
|
5745
5912
|
DeviceSessionGet: DeviceSessionGet;
|
|
5746
5913
|
DeviceSession: DeviceSession;
|
|
5747
5914
|
DeviceSessionAskPin: DeviceSessionAskPin;
|
|
5915
|
+
DeviceSessionAskPassphrase: DeviceSessionAskPassphrase;
|
|
5748
5916
|
DeviceStatus: DeviceStatus;
|
|
5749
5917
|
DeviceStatusGet: DeviceStatusGet;
|
|
5750
|
-
DevGetOnboardingStatus: DevGetOnboardingStatus;
|
|
5751
|
-
DevOnboardingStatus: DevOnboardingStatus;
|
|
5752
5918
|
FilesystemPermissionFix: FilesystemPermissionFix;
|
|
5753
5919
|
FilesystemPathInfo: FilesystemPathInfo;
|
|
5754
5920
|
FilesystemPathInfoQuery: FilesystemPathInfoQuery;
|
|
@@ -5761,7 +5927,18 @@ export type MessageType = {
|
|
|
5761
5927
|
FilesystemDirMake: FilesystemDirMake;
|
|
5762
5928
|
FilesystemDirRemove: FilesystemDirRemove;
|
|
5763
5929
|
FilesystemFormat: FilesystemFormat;
|
|
5930
|
+
InternalMyAddressRequest: InternalMyAddressRequest;
|
|
5931
|
+
NftUpdate: NftUpdate;
|
|
5932
|
+
OnboardingSetupStatus: OnboardingSetupStatus;
|
|
5933
|
+
OnboardingStatusGet: OnboardingStatusGet;
|
|
5934
|
+
OnboardingStatus: OnboardingStatus;
|
|
5764
5935
|
PortfolioUpdate: PortfolioUpdate;
|
|
5936
|
+
ViewAmount: ViewAmount;
|
|
5937
|
+
ViewDetail: ViewDetail;
|
|
5938
|
+
ViewTip: ViewTip;
|
|
5939
|
+
ViewRawData: ViewRawData;
|
|
5940
|
+
ViewSignPage: ViewSignPage;
|
|
5941
|
+
ViewVerifyPage: ViewVerifyPage;
|
|
5765
5942
|
};
|
|
5766
5943
|
|
|
5767
5944
|
export type MessageKey = keyof MessageType;
|