@onekeyfe/hd-transport 1.2.0-alpha.6 → 1.2.0-alpha.63
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 +176 -0
- package/__tests__/protocol-v2-ble-frame-writer.test.js +119 -0
- package/__tests__/protocol-v2-link-manager.test.js +437 -0
- package/__tests__/protocol-v2-usb-transport-base.test.js +330 -0
- package/__tests__/protocol-v2.test.js +462 -53
- package/__tests__/transport-log.test.js +79 -0
- package/dist/constants.d.ts +4 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +784 -198
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +820 -227
- package/dist/protocols/index.d.ts +14 -5
- 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/constants.d.ts +1 -0
- package/dist/protocols/v2/constants.d.ts.map +1 -1
- package/dist/protocols/v2/decode.d.ts +13 -2
- package/dist/protocols/v2/decode.d.ts.map +1 -1
- package/dist/protocols/v2/encode.d.ts +2 -3
- package/dist/protocols/v2/encode.d.ts.map +1 -1
- package/dist/protocols/v2/errors.d.ts +8 -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 -1
- package/dist/protocols/v2/index.d.ts.map +1 -1
- package/dist/protocols/v2/link-manager.d.ts +39 -0
- package/dist/protocols/v2/link-manager.d.ts.map +1 -0
- package/dist/protocols/v2/sequence-cursor.d.ts +5 -0
- package/dist/protocols/v2/sequence-cursor.d.ts.map +1 -0
- package/dist/protocols/v2/session.d.ts +19 -5
- package/dist/protocols/v2/session.d.ts.map +1 -1
- package/dist/protocols/v2/usb-transport-base.d.ts +32 -0
- package/dist/protocols/v2/usb-transport-base.d.ts.map +1 -0
- package/dist/serialization/protobuf/decode.d.ts.map +1 -1
- package/dist/types/messages.d.ts +376 -110
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/transport.d.ts +14 -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 +1155 -483
- package/package.json +3 -3
- package/scripts/protobuf-build.sh +86 -208
- package/scripts/protobuf-patches/index.js +1 -0
- package/scripts/protobuf-types.js +19 -1
- package/src/constants.ts +28 -14
- package/src/index.ts +12 -1
- package/src/protocols/index.ts +39 -40
- package/src/protocols/v2/ble-frame-writer.ts +77 -0
- package/src/protocols/v2/constants.ts +1 -0
- package/src/protocols/v2/crc8.ts +1 -1
- package/src/protocols/v2/decode.ts +71 -37
- package/src/protocols/v2/encode.ts +2 -28
- package/src/protocols/v2/errors.ts +25 -0
- package/src/protocols/v2/frame-assembler.ts +6 -4
- package/src/protocols/v2/index.ts +2 -1
- package/src/protocols/v2/link-manager.ts +209 -0
- package/src/protocols/v2/sequence-cursor.ts +10 -0
- package/src/protocols/v2/session.ts +157 -200
- package/src/protocols/v2/usb-transport-base.ts +213 -0
- package/src/serialization/protobuf/decode.ts +4 -1
- package/src/types/messages.ts +458 -142
- package/src/types/transport.ts +14 -3
- package/src/utils/transportLog.ts +102 -0
- package/dist/protocols/v2/debug.d.ts +0 -13
- package/dist/protocols/v2/debug.d.ts.map +0 -1
- package/src/protocols/v2/debug.ts +0 -26
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 = {
|
|
@@ -2412,6 +2510,19 @@ export type Features = {
|
|
|
2412
2510
|
onekey_se04_state?: string | null;
|
|
2413
2511
|
attach_to_pin_user?: boolean;
|
|
2414
2512
|
unlocked_attach_pin?: boolean;
|
|
2513
|
+
coprocessor_bt_name?: string;
|
|
2514
|
+
coprocessor_version?: string;
|
|
2515
|
+
coprocessor_bt_enable?: boolean;
|
|
2516
|
+
romloader_version?: string;
|
|
2517
|
+
onekey_romloader_version?: string;
|
|
2518
|
+
onekey_romloader_hash?: string;
|
|
2519
|
+
onekey_bootloader_version?: string;
|
|
2520
|
+
onekey_bootloader_hash?: string;
|
|
2521
|
+
onekey_bootloader_build_id?: string;
|
|
2522
|
+
onekey_coprocessor_bt_name?: string;
|
|
2523
|
+
onekey_coprocessor_version?: string;
|
|
2524
|
+
onekey_coprocessor_build_id?: string;
|
|
2525
|
+
onekey_coprocessor_hash?: string;
|
|
2415
2526
|
};
|
|
2416
2527
|
|
|
2417
2528
|
// OnekeyFeatures
|
|
@@ -2911,8 +3022,6 @@ export type UnLockDeviceResponse = {
|
|
|
2911
3022
|
// GetPassphraseState
|
|
2912
3023
|
export type GetPassphraseState = {
|
|
2913
3024
|
passphrase_state?: string;
|
|
2914
|
-
_only_main_pin?: boolean;
|
|
2915
|
-
allow_create_attach_pin?: boolean;
|
|
2916
3025
|
};
|
|
2917
3026
|
|
|
2918
3027
|
// PassphraseState
|
|
@@ -4478,19 +4587,13 @@ export type TxAckPaymentRequest = {
|
|
|
4478
4587
|
signature: string;
|
|
4479
4588
|
};
|
|
4480
4589
|
|
|
4481
|
-
//
|
|
4482
|
-
export type
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
// StartSession
|
|
4490
|
-
export type StartSession = {
|
|
4491
|
-
session_id?: string;
|
|
4492
|
-
_skip_passphrase?: boolean;
|
|
4493
|
-
derive_cardano?: boolean;
|
|
4590
|
+
// EthereumSignTypedDataQR
|
|
4591
|
+
export type EthereumSignTypedDataQR = {
|
|
4592
|
+
address_n: number[];
|
|
4593
|
+
json_data?: string;
|
|
4594
|
+
chain_id?: number;
|
|
4595
|
+
metamask_v4_compat?: boolean;
|
|
4596
|
+
request_id?: string;
|
|
4494
4597
|
};
|
|
4495
4598
|
|
|
4496
4599
|
// SetBusy
|
|
@@ -4521,28 +4624,6 @@ export type WriteSEPrivateKey = {
|
|
|
4521
4624
|
private_key: string;
|
|
4522
4625
|
};
|
|
4523
4626
|
|
|
4524
|
-
export enum WallpaperTarget {
|
|
4525
|
-
Home = 0,
|
|
4526
|
-
Lock = 1,
|
|
4527
|
-
}
|
|
4528
|
-
|
|
4529
|
-
// SetWallpaper
|
|
4530
|
-
export type SetWallpaper = {
|
|
4531
|
-
target: WallpaperTarget;
|
|
4532
|
-
path: string;
|
|
4533
|
-
};
|
|
4534
|
-
|
|
4535
|
-
// GetWallpaper
|
|
4536
|
-
export type GetWallpaper = {
|
|
4537
|
-
target: WallpaperTarget;
|
|
4538
|
-
};
|
|
4539
|
-
|
|
4540
|
-
// Wallpaper
|
|
4541
|
-
export type Wallpaper = {
|
|
4542
|
-
target: WallpaperTarget;
|
|
4543
|
-
path: string;
|
|
4544
|
-
};
|
|
4545
|
-
|
|
4546
4627
|
// UnlockPath
|
|
4547
4628
|
export type UnlockPath = {
|
|
4548
4629
|
address_n: number[];
|
|
@@ -4561,59 +4642,49 @@ export enum MoneroNetworkType {
|
|
|
4561
4642
|
FAKECHAIN = 3,
|
|
4562
4643
|
}
|
|
4563
4644
|
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
num: string;
|
|
4568
|
-
};
|
|
4569
|
-
|
|
4570
|
-
// ViewDetail
|
|
4571
|
-
export type ViewDetail = {
|
|
4572
|
-
key: number;
|
|
4573
|
-
value: string;
|
|
4574
|
-
is_overview: boolean;
|
|
4575
|
-
has_icon: boolean;
|
|
4576
|
-
};
|
|
4577
|
-
|
|
4578
|
-
export enum ViewTipType {
|
|
4579
|
-
Default = 0,
|
|
4580
|
-
Highlight = 1,
|
|
4581
|
-
Recommend = 2,
|
|
4582
|
-
Warning = 3,
|
|
4583
|
-
Danger = 4,
|
|
4645
|
+
export enum UiAnimationType {
|
|
4646
|
+
Unknown = 0,
|
|
4647
|
+
Signing = 1,
|
|
4584
4648
|
}
|
|
4585
4649
|
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
// ViewSignPage
|
|
4593
|
-
export type ViewSignPage = {
|
|
4594
|
-
title: string;
|
|
4595
|
-
amount?: UintType;
|
|
4596
|
-
general: ViewDetail[];
|
|
4597
|
-
tip?: ViewTip;
|
|
4598
|
-
};
|
|
4650
|
+
export enum UiAnimationCommand {
|
|
4651
|
+
CommandUnknown = 0,
|
|
4652
|
+
Start = 1,
|
|
4653
|
+
Stop = 2,
|
|
4654
|
+
Refresh = 3,
|
|
4655
|
+
}
|
|
4599
4656
|
|
|
4600
|
-
//
|
|
4601
|
-
export type
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
path: string;
|
|
4657
|
+
// UiAnimationRequest
|
|
4658
|
+
export type UiAnimationRequest = {
|
|
4659
|
+
command: UiAnimationCommand;
|
|
4660
|
+
type?: UiAnimationType;
|
|
4605
4661
|
};
|
|
4606
4662
|
|
|
4607
4663
|
// ProtocolInfoRequest
|
|
4608
|
-
export type ProtocolInfoRequest = {
|
|
4664
|
+
export type ProtocolInfoRequest = {
|
|
4665
|
+
eventless_wallet_session?: boolean;
|
|
4666
|
+
};
|
|
4609
4667
|
|
|
4610
4668
|
// ProtocolInfo
|
|
4611
4669
|
export type ProtocolInfo = {
|
|
4612
4670
|
version: number;
|
|
4671
|
+
build_fingerprint: string;
|
|
4613
4672
|
supported_messages: number[];
|
|
4614
|
-
protobuf_definition?: string;
|
|
4615
4673
|
};
|
|
4616
4674
|
|
|
4675
|
+
export enum DeviceErrorCode {
|
|
4676
|
+
DeviceError_None = 0,
|
|
4677
|
+
DeviceError_Busy = 1,
|
|
4678
|
+
DeviceError_NotInitialized = 2,
|
|
4679
|
+
DeviceError_ActionCancelled = 3,
|
|
4680
|
+
DeviceError_PinAlreadyUsed = 4,
|
|
4681
|
+
DeviceError_PersistFailed = 5,
|
|
4682
|
+
DeviceError_SeError = 6,
|
|
4683
|
+
DeviceError_InvalidLanguage = 7,
|
|
4684
|
+
DeviceError_WallpaperNotUsable = 8,
|
|
4685
|
+
DeviceError_DeviceLocked = 9,
|
|
4686
|
+
}
|
|
4687
|
+
|
|
4617
4688
|
export enum DeviceRebootType {
|
|
4618
4689
|
Normal = 0,
|
|
4619
4690
|
Romloader = 1,
|
|
@@ -4627,9 +4698,22 @@ export type DeviceReboot = {
|
|
|
4627
4698
|
|
|
4628
4699
|
// DeviceSettings
|
|
4629
4700
|
export type DeviceSettings = {
|
|
4630
|
-
label?: string;
|
|
4631
4701
|
bt_enable?: boolean;
|
|
4632
4702
|
language?: string;
|
|
4703
|
+
wallpaper_path?: string;
|
|
4704
|
+
brightness?: number;
|
|
4705
|
+
animation_enable?: boolean;
|
|
4706
|
+
tap_to_wake?: boolean;
|
|
4707
|
+
haptic_feedback?: boolean;
|
|
4708
|
+
device_name_display_enabled?: boolean;
|
|
4709
|
+
airgap_mode?: boolean;
|
|
4710
|
+
usb_lock_enable?: boolean;
|
|
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;
|
|
4633
4717
|
};
|
|
4634
4718
|
|
|
4635
4719
|
// DeviceSettingsGet
|
|
@@ -4640,6 +4724,19 @@ export type DeviceSettingsSet = {
|
|
|
4640
4724
|
settings: DeviceSettings;
|
|
4641
4725
|
};
|
|
4642
4726
|
|
|
4727
|
+
export enum DeviceSettingsPage {
|
|
4728
|
+
DeviceReset = 0,
|
|
4729
|
+
DevicePinChange = 1,
|
|
4730
|
+
DevicePassphrase = 2,
|
|
4731
|
+
DeviceAirgap = 3,
|
|
4732
|
+
}
|
|
4733
|
+
|
|
4734
|
+
// DeviceSettingsPageShow
|
|
4735
|
+
export type DeviceSettingsPageShow = {
|
|
4736
|
+
page: DeviceSettingsPage;
|
|
4737
|
+
field_name?: string;
|
|
4738
|
+
};
|
|
4739
|
+
|
|
4643
4740
|
// DeviceCertificate
|
|
4644
4741
|
export type DeviceCertificate = {
|
|
4645
4742
|
cert_and_pubkey: string;
|
|
@@ -4664,6 +4761,54 @@ export type DeviceCertificateSign = {
|
|
|
4664
4761
|
data: string;
|
|
4665
4762
|
};
|
|
4666
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
|
+
burn_in_completed?: boolean;
|
|
4789
|
+
factory_test_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
|
+
|
|
4667
4812
|
export enum DeviceFirmwareTargetType {
|
|
4668
4813
|
FW_MGMT_TARGET_INVALID = 0,
|
|
4669
4814
|
FW_MGMT_TARGET_CRATE = 1,
|
|
@@ -4728,49 +4873,6 @@ export type DeviceFirmwareUpdateStatus = {
|
|
|
4728
4873
|
records: DeviceFirmwareUpdateRecord[];
|
|
4729
4874
|
};
|
|
4730
4875
|
|
|
4731
|
-
export enum DeviceFactoryAck {
|
|
4732
|
-
FACTORY_ACK_SUCCESS = 0,
|
|
4733
|
-
FACTORY_ACK_FAIL = 1,
|
|
4734
|
-
}
|
|
4735
|
-
|
|
4736
|
-
// DeviceFactoryInfoManufactureTime
|
|
4737
|
-
export type DeviceFactoryInfoManufactureTime = {
|
|
4738
|
-
year: number;
|
|
4739
|
-
month: number;
|
|
4740
|
-
day: number;
|
|
4741
|
-
hour: number;
|
|
4742
|
-
minute: number;
|
|
4743
|
-
second: number;
|
|
4744
|
-
};
|
|
4745
|
-
|
|
4746
|
-
// DeviceFactoryInfo
|
|
4747
|
-
export type DeviceFactoryInfo = {
|
|
4748
|
-
version?: number;
|
|
4749
|
-
serial_number?: string;
|
|
4750
|
-
burn_in_completed?: boolean;
|
|
4751
|
-
factory_test_completed?: boolean;
|
|
4752
|
-
manufacture_time?: DeviceFactoryInfoManufactureTime;
|
|
4753
|
-
};
|
|
4754
|
-
|
|
4755
|
-
// DeviceFactoryInfoSet
|
|
4756
|
-
export type DeviceFactoryInfoSet = {
|
|
4757
|
-
info: DeviceFactoryInfo;
|
|
4758
|
-
};
|
|
4759
|
-
|
|
4760
|
-
// DeviceFactoryInfoGet
|
|
4761
|
-
export type DeviceFactoryInfoGet = {};
|
|
4762
|
-
|
|
4763
|
-
// DeviceFactoryPermanentLock
|
|
4764
|
-
export type DeviceFactoryPermanentLock = {
|
|
4765
|
-
check_a: string;
|
|
4766
|
-
check_b: string;
|
|
4767
|
-
};
|
|
4768
|
-
|
|
4769
|
-
// DeviceFactoryTest
|
|
4770
|
-
export type DeviceFactoryTest = {
|
|
4771
|
-
burn_in_test: boolean;
|
|
4772
|
-
};
|
|
4773
|
-
|
|
4774
4876
|
export enum DeviceType {
|
|
4775
4877
|
CLASSIC1 = 0,
|
|
4776
4878
|
CLASSIC1S = 1,
|
|
@@ -4841,7 +4943,6 @@ export type DeviceInfoTargets = {
|
|
|
4841
4943
|
se2?: boolean;
|
|
4842
4944
|
se3?: boolean;
|
|
4843
4945
|
se4?: boolean;
|
|
4844
|
-
status?: boolean;
|
|
4845
4946
|
};
|
|
4846
4947
|
|
|
4847
4948
|
// DeviceInfoTypes
|
|
@@ -4868,9 +4969,17 @@ export type ProtocolV2DeviceInfo = {
|
|
|
4868
4969
|
se2?: DeviceSEInfo;
|
|
4869
4970
|
se3?: DeviceSEInfo;
|
|
4870
4971
|
se4?: DeviceSEInfo;
|
|
4871
|
-
status?: DeviceStatus;
|
|
4872
4972
|
};
|
|
4873
4973
|
|
|
4974
|
+
export enum DeviceSessionErrorCode {
|
|
4975
|
+
DeviceSessionError_None = 0,
|
|
4976
|
+
DeviceSessionError_UserCancelled = 1,
|
|
4977
|
+
DeviceSessionError_InvalidSession = 2,
|
|
4978
|
+
DeviceSessionError_AttachPinUnavailable = 3,
|
|
4979
|
+
DeviceSessionError_PassphraseDisabled = 4,
|
|
4980
|
+
DeviceSessionError_Busy = 5,
|
|
4981
|
+
}
|
|
4982
|
+
|
|
4874
4983
|
// DeviceSessionGet
|
|
4875
4984
|
export type DeviceSessionGet = {
|
|
4876
4985
|
session_id?: string;
|
|
@@ -4882,6 +4991,27 @@ export type DeviceSession = {
|
|
|
4882
4991
|
btc_test_address?: string;
|
|
4883
4992
|
};
|
|
4884
4993
|
|
|
4994
|
+
export enum DeviceSessionPinType {
|
|
4995
|
+
Any = 1,
|
|
4996
|
+
Main = 2,
|
|
4997
|
+
AttachToPin = 3,
|
|
4998
|
+
}
|
|
4999
|
+
|
|
5000
|
+
// DeviceSessionAskPin
|
|
5001
|
+
export type DeviceSessionAskPin = {
|
|
5002
|
+
type?: DeviceSessionPinType;
|
|
5003
|
+
};
|
|
5004
|
+
|
|
5005
|
+
// DeviceSessionAskPassphrase
|
|
5006
|
+
export type DeviceSessionAskPassphrase = {
|
|
5007
|
+
passphrase?: string;
|
|
5008
|
+
on_device: boolean;
|
|
5009
|
+
};
|
|
5010
|
+
|
|
5011
|
+
export enum DeviceSessionAskPin_FailureSubCodes {
|
|
5012
|
+
UserCancel = 1,
|
|
5013
|
+
}
|
|
5014
|
+
|
|
4885
5015
|
// DeviceStatus
|
|
4886
5016
|
export type DeviceStatus = {
|
|
4887
5017
|
device_id?: string;
|
|
@@ -4893,6 +5023,9 @@ export type DeviceStatus = {
|
|
|
4893
5023
|
unlocked_by_attach_to_pin?: boolean;
|
|
4894
5024
|
};
|
|
4895
5025
|
|
|
5026
|
+
// DeviceStatusGet
|
|
5027
|
+
export type DeviceStatusGet = {};
|
|
5028
|
+
|
|
4896
5029
|
// FilesystemPermissionFix
|
|
4897
5030
|
export type FilesystemPermissionFix = {};
|
|
4898
5031
|
|
|
@@ -4972,7 +5105,173 @@ export type FilesystemDirRemove = {
|
|
|
4972
5105
|
};
|
|
4973
5106
|
|
|
4974
5107
|
// FilesystemFormat
|
|
4975
|
-
export type FilesystemFormat = {
|
|
5108
|
+
export type FilesystemFormat = {
|
|
5109
|
+
data: boolean;
|
|
5110
|
+
user: boolean;
|
|
5111
|
+
};
|
|
5112
|
+
|
|
5113
|
+
// InternalMyAddressRequest
|
|
5114
|
+
export type InternalMyAddressRequest = {
|
|
5115
|
+
coin_type: number;
|
|
5116
|
+
chain_id: number;
|
|
5117
|
+
account_index: number;
|
|
5118
|
+
derive_type: number;
|
|
5119
|
+
};
|
|
5120
|
+
|
|
5121
|
+
export enum OnboardingStep {
|
|
5122
|
+
ONBOARDING_STEP_UNKNOWN = 0,
|
|
5123
|
+
ONBOARDING_STEP_CHECKING = 1,
|
|
5124
|
+
ONBOARDING_STEP_PERSONALIZATION = 2,
|
|
5125
|
+
ONBOARDING_STEP_PIN = 3,
|
|
5126
|
+
ONBOARDING_STEP_SETUP = 4,
|
|
5127
|
+
ONBOARDING_STEP_DONE = 5,
|
|
5128
|
+
}
|
|
5129
|
+
|
|
5130
|
+
export enum OnboardingPhase {
|
|
5131
|
+
ONBOARDING_PHASE_UNKNOWN = 0,
|
|
5132
|
+
ONBOARDING_PHASE_SAFETY_CHECK = 1,
|
|
5133
|
+
ONBOARDING_PHASE_PIN_SETUP = 2,
|
|
5134
|
+
ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
|
|
5135
|
+
ONBOARDING_PHASE_SETUP_CHOICE = 4,
|
|
5136
|
+
ONBOARDING_PHASE_WALLET_CREATE_START = 5,
|
|
5137
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
|
|
5138
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
|
|
5139
|
+
ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
|
|
5140
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
|
|
5141
|
+
ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
|
|
5142
|
+
ONBOARDING_PHASE_WALLET_READY = 11,
|
|
5143
|
+
ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
|
|
5144
|
+
ONBOARDING_PHASE_SEEDCARD_BACKUP = 13,
|
|
5145
|
+
}
|
|
5146
|
+
|
|
5147
|
+
export enum OnboardingSetupKind {
|
|
5148
|
+
ONBOARDING_SETUP_KIND_UNKNOWN = 0,
|
|
5149
|
+
ONBOARDING_SETUP_KIND_CHOICE = 1,
|
|
5150
|
+
ONBOARDING_SETUP_KIND_CREATE = 2,
|
|
5151
|
+
ONBOARDING_SETUP_KIND_RESTORE = 3,
|
|
5152
|
+
}
|
|
5153
|
+
|
|
5154
|
+
export enum OnboardingSetupMethod {
|
|
5155
|
+
ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
|
|
5156
|
+
ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
|
|
5157
|
+
ONBOARDING_SETUP_METHOD_SEEDCARD = 2,
|
|
5158
|
+
}
|
|
5159
|
+
|
|
5160
|
+
// OnboardingSetupStatus
|
|
5161
|
+
export type OnboardingSetupStatus = {
|
|
5162
|
+
kind?: OnboardingSetupKind;
|
|
5163
|
+
method?: OnboardingSetupMethod;
|
|
5164
|
+
};
|
|
5165
|
+
|
|
5166
|
+
// OnboardingStatusGet
|
|
5167
|
+
export type OnboardingStatusGet = {};
|
|
5168
|
+
|
|
5169
|
+
// OnboardingStatus
|
|
5170
|
+
export type OnboardingStatus = {
|
|
5171
|
+
step?: OnboardingStep;
|
|
5172
|
+
phase?: OnboardingPhase;
|
|
5173
|
+
setup?: OnboardingSetupStatus;
|
|
5174
|
+
pin_set?: boolean;
|
|
5175
|
+
wallet_initialized?: boolean;
|
|
5176
|
+
};
|
|
5177
|
+
|
|
5178
|
+
// PortfolioUpdate
|
|
5179
|
+
export type PortfolioUpdate = {};
|
|
5180
|
+
|
|
5181
|
+
// ViewAmount
|
|
5182
|
+
export type ViewAmount = {
|
|
5183
|
+
is_unlimited: boolean;
|
|
5184
|
+
num: string;
|
|
5185
|
+
};
|
|
5186
|
+
|
|
5187
|
+
// ViewDetail
|
|
5188
|
+
export type ViewDetail = {
|
|
5189
|
+
key: number;
|
|
5190
|
+
value: string;
|
|
5191
|
+
is_overview: boolean;
|
|
5192
|
+
has_icon: boolean;
|
|
5193
|
+
};
|
|
5194
|
+
|
|
5195
|
+
export enum ViewTipType {
|
|
5196
|
+
Default = 0,
|
|
5197
|
+
Highlight = 1,
|
|
5198
|
+
Recommend = 2,
|
|
5199
|
+
Warning = 3,
|
|
5200
|
+
Danger = 4,
|
|
5201
|
+
}
|
|
5202
|
+
|
|
5203
|
+
// ViewTip
|
|
5204
|
+
export type ViewTip = {
|
|
5205
|
+
type: ViewTipType;
|
|
5206
|
+
text: string;
|
|
5207
|
+
};
|
|
5208
|
+
|
|
5209
|
+
// ViewRawData
|
|
5210
|
+
export type ViewRawData = {
|
|
5211
|
+
initial_data: string;
|
|
5212
|
+
placeholder: number;
|
|
5213
|
+
};
|
|
5214
|
+
|
|
5215
|
+
export enum ViewSignLayout {
|
|
5216
|
+
LayoutDefault = 0,
|
|
5217
|
+
LayoutSafeTxCreate = 1,
|
|
5218
|
+
LayoutFinalConfirm = 2,
|
|
5219
|
+
Layout7702 = 3,
|
|
5220
|
+
LayoutFlat = 4,
|
|
5221
|
+
LayoutEthApprove = 5,
|
|
5222
|
+
}
|
|
5223
|
+
|
|
5224
|
+
// ViewSignPage
|
|
5225
|
+
export type ViewSignPage = {
|
|
5226
|
+
title: string;
|
|
5227
|
+
amount?: UintType;
|
|
5228
|
+
general: ViewDetail[];
|
|
5229
|
+
tip?: ViewTip;
|
|
5230
|
+
raw_data?: ViewRawData;
|
|
5231
|
+
slide_to_confirm?: boolean;
|
|
5232
|
+
layout?: ViewSignLayout;
|
|
5233
|
+
};
|
|
5234
|
+
|
|
5235
|
+
// ViewVerifyPage
|
|
5236
|
+
export type ViewVerifyPage = {
|
|
5237
|
+
title: string;
|
|
5238
|
+
address: string;
|
|
5239
|
+
path: string;
|
|
5240
|
+
network?: string;
|
|
5241
|
+
derive_type?: string;
|
|
5242
|
+
value_key?: number;
|
|
5243
|
+
};
|
|
5244
|
+
|
|
5245
|
+
export enum ProtocolV2FailureType {
|
|
5246
|
+
Failure_InvalidMessage = 1,
|
|
5247
|
+
Failure_UndefinedError = 2,
|
|
5248
|
+
Failure_UsageError = 3,
|
|
5249
|
+
Failure_DataError = 4,
|
|
5250
|
+
Failure_ProcessError = 5,
|
|
5251
|
+
}
|
|
5252
|
+
|
|
5253
|
+
export enum Enum_ProtocolV2Capability {
|
|
5254
|
+
Capability_Bitcoin = 1,
|
|
5255
|
+
Capability_Bitcoin_like = 2,
|
|
5256
|
+
Capability_Binance = 3,
|
|
5257
|
+
Capability_Cardano = 4,
|
|
5258
|
+
Capability_Crypto = 5,
|
|
5259
|
+
Capability_EOS = 6,
|
|
5260
|
+
Capability_Ethereum = 7,
|
|
5261
|
+
Capability_Lisk = 8,
|
|
5262
|
+
Capability_Monero = 9,
|
|
5263
|
+
Capability_NEM = 10,
|
|
5264
|
+
Capability_Ripple = 11,
|
|
5265
|
+
Capability_Stellar = 12,
|
|
5266
|
+
Capability_Tezos = 13,
|
|
5267
|
+
Capability_U2F = 14,
|
|
5268
|
+
Capability_Shamir = 15,
|
|
5269
|
+
Capability_ShamirGroups = 16,
|
|
5270
|
+
Capability_PassphraseEntry = 17,
|
|
5271
|
+
Capability_AttachToPin = 18,
|
|
5272
|
+
Capability_EthereumTypedData = 1000,
|
|
5273
|
+
}
|
|
5274
|
+
export type ProtocolV2Capability = keyof typeof Enum_ProtocolV2Capability;
|
|
4976
5275
|
|
|
4977
5276
|
// custom connect definitions
|
|
4978
5277
|
export type MessageType = {
|
|
@@ -5249,6 +5548,15 @@ export type MessageType = {
|
|
|
5249
5548
|
KaspaSignTx: KaspaSignTx;
|
|
5250
5549
|
KaspaTxInputRequest: KaspaTxInputRequest;
|
|
5251
5550
|
KaspaTxInputAck: KaspaTxInputAck;
|
|
5551
|
+
KaspaOutpoint: KaspaOutpoint;
|
|
5552
|
+
KaspaTxRequestSignature: KaspaTxRequestSignature;
|
|
5553
|
+
KaspaTxRequest: KaspaTxRequest;
|
|
5554
|
+
KaspaTxAckInput: KaspaTxAckInput;
|
|
5555
|
+
KaspaTxAckOutput: KaspaTxAckOutput;
|
|
5556
|
+
KaspaTxAckPayloadChunk: KaspaTxAckPayloadChunk;
|
|
5557
|
+
KaspaTxAckPrevMeta: KaspaTxAckPrevMeta;
|
|
5558
|
+
KaspaTxAckPrevInput: KaspaTxAckPrevInput;
|
|
5559
|
+
KaspaTxAckPrevOutput: KaspaTxAckPrevOutput;
|
|
5252
5560
|
KaspaSignedTx: KaspaSignedTx;
|
|
5253
5561
|
LnurlAuth: LnurlAuth;
|
|
5254
5562
|
LnurlAuthResp: LnurlAuthResp;
|
|
@@ -5538,47 +5846,41 @@ export type MessageType = {
|
|
|
5538
5846
|
CoinPurchaseMemo: CoinPurchaseMemo;
|
|
5539
5847
|
PaymentRequestMemo: PaymentRequestMemo;
|
|
5540
5848
|
TxAckPaymentRequest: TxAckPaymentRequest;
|
|
5541
|
-
|
|
5542
|
-
StartSession: StartSession;
|
|
5849
|
+
EthereumSignTypedDataQR: EthereumSignTypedDataQR;
|
|
5543
5850
|
SetBusy: SetBusy;
|
|
5544
5851
|
GetFirmwareHash: GetFirmwareHash;
|
|
5545
5852
|
FirmwareHash: FirmwareHash;
|
|
5546
5853
|
GetNonce: GetNonce;
|
|
5547
5854
|
Nonce: Nonce;
|
|
5548
5855
|
WriteSEPrivateKey: WriteSEPrivateKey;
|
|
5549
|
-
SetWallpaper: SetWallpaper;
|
|
5550
|
-
GetWallpaper: GetWallpaper;
|
|
5551
|
-
Wallpaper: Wallpaper;
|
|
5552
5856
|
UnlockPath: UnlockPath;
|
|
5553
5857
|
UnlockedPathRequest: UnlockedPathRequest;
|
|
5554
|
-
|
|
5555
|
-
ViewDetail: ViewDetail;
|
|
5556
|
-
ViewTip: ViewTip;
|
|
5557
|
-
ViewSignPage: ViewSignPage;
|
|
5558
|
-
ViewVerifyPage: ViewVerifyPage;
|
|
5858
|
+
UiAnimationRequest: UiAnimationRequest;
|
|
5559
5859
|
ProtocolInfoRequest: ProtocolInfoRequest;
|
|
5560
5860
|
ProtocolInfo: ProtocolInfo;
|
|
5561
5861
|
DeviceReboot: DeviceReboot;
|
|
5562
5862
|
DeviceSettings: DeviceSettings;
|
|
5563
5863
|
DeviceSettingsGet: DeviceSettingsGet;
|
|
5564
5864
|
DeviceSettingsSet: DeviceSettingsSet;
|
|
5865
|
+
DeviceSettingsPageShow: DeviceSettingsPageShow;
|
|
5565
5866
|
DeviceCertificate: DeviceCertificate;
|
|
5566
5867
|
DeviceCertificateWrite: DeviceCertificateWrite;
|
|
5567
5868
|
DeviceCertificateRead: DeviceCertificateRead;
|
|
5568
5869
|
DeviceCertificateSignature: DeviceCertificateSignature;
|
|
5569
5870
|
DeviceCertificateSign: DeviceCertificateSign;
|
|
5570
|
-
|
|
5571
|
-
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
5572
|
-
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
5573
|
-
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
5574
|
-
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
5575
|
-
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
5871
|
+
DeviceMiscUsbMscControl: DeviceMiscUsbMscControl;
|
|
5576
5872
|
DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
|
|
5577
5873
|
DeviceFactoryInfo: DeviceFactoryInfo;
|
|
5578
5874
|
DeviceFactoryInfoSet: DeviceFactoryInfoSet;
|
|
5579
5875
|
DeviceFactoryInfoGet: DeviceFactoryInfoGet;
|
|
5580
5876
|
DeviceFactoryPermanentLock: DeviceFactoryPermanentLock;
|
|
5581
5877
|
DeviceFactoryTest: DeviceFactoryTest;
|
|
5878
|
+
DeviceFirmwareTarget: DeviceFirmwareTarget;
|
|
5879
|
+
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
5880
|
+
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
5881
|
+
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
5882
|
+
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
5883
|
+
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
5582
5884
|
DeviceFirmwareImageInfo: DeviceFirmwareImageInfo;
|
|
5583
5885
|
DeviceHardwareInfo: DeviceHardwareInfo;
|
|
5584
5886
|
DeviceMainMcuInfo: DeviceMainMcuInfo;
|
|
@@ -5589,7 +5891,10 @@ export type MessageType = {
|
|
|
5589
5891
|
DeviceInfoGet: DeviceInfoGet;
|
|
5590
5892
|
DeviceSessionGet: DeviceSessionGet;
|
|
5591
5893
|
DeviceSession: DeviceSession;
|
|
5894
|
+
DeviceSessionAskPin: DeviceSessionAskPin;
|
|
5895
|
+
DeviceSessionAskPassphrase: DeviceSessionAskPassphrase;
|
|
5592
5896
|
DeviceStatus: DeviceStatus;
|
|
5897
|
+
DeviceStatusGet: DeviceStatusGet;
|
|
5593
5898
|
FilesystemPermissionFix: FilesystemPermissionFix;
|
|
5594
5899
|
FilesystemPathInfo: FilesystemPathInfo;
|
|
5595
5900
|
FilesystemPathInfoQuery: FilesystemPathInfoQuery;
|
|
@@ -5602,6 +5907,17 @@ export type MessageType = {
|
|
|
5602
5907
|
FilesystemDirMake: FilesystemDirMake;
|
|
5603
5908
|
FilesystemDirRemove: FilesystemDirRemove;
|
|
5604
5909
|
FilesystemFormat: FilesystemFormat;
|
|
5910
|
+
InternalMyAddressRequest: InternalMyAddressRequest;
|
|
5911
|
+
OnboardingSetupStatus: OnboardingSetupStatus;
|
|
5912
|
+
OnboardingStatusGet: OnboardingStatusGet;
|
|
5913
|
+
OnboardingStatus: OnboardingStatus;
|
|
5914
|
+
PortfolioUpdate: PortfolioUpdate;
|
|
5915
|
+
ViewAmount: ViewAmount;
|
|
5916
|
+
ViewDetail: ViewDetail;
|
|
5917
|
+
ViewTip: ViewTip;
|
|
5918
|
+
ViewRawData: ViewRawData;
|
|
5919
|
+
ViewSignPage: ViewSignPage;
|
|
5920
|
+
ViewVerifyPage: ViewVerifyPage;
|
|
5605
5921
|
};
|
|
5606
5922
|
|
|
5607
5923
|
export type MessageKey = keyof MessageType;
|