@onekeyfe/hd-transport 1.2.0-alpha.4 → 1.2.0-alpha.40
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 +187 -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 +465 -56
- 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 +790 -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 +380 -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 +1161 -477
- 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 +464 -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/dist/types/messages.d.ts
CHANGED
|
@@ -1648,11 +1648,17 @@ export type KaspaAddress = {
|
|
|
1648
1648
|
};
|
|
1649
1649
|
export type KaspaSignTx = {
|
|
1650
1650
|
address_n: number[];
|
|
1651
|
-
raw_message
|
|
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;
|
|
@@ -1827,6 +1904,19 @@ export type Features = {
|
|
|
1827
1904
|
onekey_se04_state?: string | null;
|
|
1828
1905
|
attach_to_pin_user?: boolean;
|
|
1829
1906
|
unlocked_attach_pin?: boolean;
|
|
1907
|
+
coprocessor_bt_name?: string;
|
|
1908
|
+
coprocessor_version?: string;
|
|
1909
|
+
coprocessor_bt_enable?: boolean;
|
|
1910
|
+
romloader_version?: string;
|
|
1911
|
+
onekey_romloader_version?: string;
|
|
1912
|
+
onekey_romloader_hash?: string;
|
|
1913
|
+
onekey_bootloader_version?: string;
|
|
1914
|
+
onekey_bootloader_hash?: string;
|
|
1915
|
+
onekey_bootloader_build_id?: string;
|
|
1916
|
+
onekey_coprocessor_bt_name?: string;
|
|
1917
|
+
onekey_coprocessor_version?: string;
|
|
1918
|
+
onekey_coprocessor_build_id?: string;
|
|
1919
|
+
onekey_coprocessor_hash?: string;
|
|
1830
1920
|
};
|
|
1831
1921
|
export type OnekeyFeatures = {
|
|
1832
1922
|
onekey_device_type?: OneKeyDeviceType;
|
|
@@ -2178,8 +2268,6 @@ export type UnLockDeviceResponse = {
|
|
|
2178
2268
|
};
|
|
2179
2269
|
export type GetPassphraseState = {
|
|
2180
2270
|
passphrase_state?: string;
|
|
2181
|
-
_only_main_pin?: boolean;
|
|
2182
|
-
allow_create_attach_pin?: boolean;
|
|
2183
2271
|
};
|
|
2184
2272
|
export type PassphraseState = {
|
|
2185
2273
|
passphrase_state?: string;
|
|
@@ -3351,16 +3439,12 @@ export type TxAckPaymentRequest = {
|
|
|
3351
3439
|
amount?: UintType;
|
|
3352
3440
|
signature: string;
|
|
3353
3441
|
};
|
|
3354
|
-
export type
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
export type StartSession = {
|
|
3361
|
-
session_id?: string;
|
|
3362
|
-
_skip_passphrase?: boolean;
|
|
3363
|
-
derive_cardano?: boolean;
|
|
3442
|
+
export type EthereumSignTypedDataQR = {
|
|
3443
|
+
address_n: number[];
|
|
3444
|
+
json_data?: string;
|
|
3445
|
+
chain_id?: number;
|
|
3446
|
+
metamask_v4_compat?: boolean;
|
|
3447
|
+
request_id?: string;
|
|
3364
3448
|
};
|
|
3365
3449
|
export type SetBusy = {
|
|
3366
3450
|
expiry_ms?: number;
|
|
@@ -3378,21 +3462,6 @@ export type Nonce = {
|
|
|
3378
3462
|
export type WriteSEPrivateKey = {
|
|
3379
3463
|
private_key: string;
|
|
3380
3464
|
};
|
|
3381
|
-
export declare enum WallpaperTarget {
|
|
3382
|
-
Home = 0,
|
|
3383
|
-
Lock = 1
|
|
3384
|
-
}
|
|
3385
|
-
export type SetWallpaper = {
|
|
3386
|
-
target: WallpaperTarget;
|
|
3387
|
-
path: string;
|
|
3388
|
-
};
|
|
3389
|
-
export type GetWallpaper = {
|
|
3390
|
-
target: WallpaperTarget;
|
|
3391
|
-
};
|
|
3392
|
-
export type Wallpaper = {
|
|
3393
|
-
target: WallpaperTarget;
|
|
3394
|
-
path: string;
|
|
3395
|
-
};
|
|
3396
3465
|
export type UnlockPath = {
|
|
3397
3466
|
address_n: number[];
|
|
3398
3467
|
mac?: string;
|
|
@@ -3406,44 +3475,40 @@ export declare enum MoneroNetworkType {
|
|
|
3406
3475
|
STAGENET = 2,
|
|
3407
3476
|
FAKECHAIN = 3
|
|
3408
3477
|
}
|
|
3409
|
-
export
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
};
|
|
3413
|
-
export type ViewDetail = {
|
|
3414
|
-
key: number;
|
|
3415
|
-
value: string;
|
|
3416
|
-
is_overview: boolean;
|
|
3417
|
-
has_icon: boolean;
|
|
3418
|
-
};
|
|
3419
|
-
export declare enum ViewTipType {
|
|
3420
|
-
Default = 0,
|
|
3421
|
-
Highlight = 1,
|
|
3422
|
-
Recommend = 2,
|
|
3423
|
-
Warning = 3,
|
|
3424
|
-
Danger = 4
|
|
3478
|
+
export declare enum UiAnimationType {
|
|
3479
|
+
Unknown = 0,
|
|
3480
|
+
Signing = 1
|
|
3425
3481
|
}
|
|
3426
|
-
export
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3482
|
+
export declare enum UiAnimationCommand {
|
|
3483
|
+
CommandUnknown = 0,
|
|
3484
|
+
Start = 1,
|
|
3485
|
+
Stop = 2,
|
|
3486
|
+
Refresh = 3
|
|
3487
|
+
}
|
|
3488
|
+
export type UiAnimationRequest = {
|
|
3489
|
+
command: UiAnimationCommand;
|
|
3490
|
+
type?: UiAnimationType;
|
|
3435
3491
|
};
|
|
3436
|
-
export type
|
|
3437
|
-
|
|
3438
|
-
address: string;
|
|
3439
|
-
path: string;
|
|
3492
|
+
export type ProtocolInfoRequest = {
|
|
3493
|
+
eventless_wallet_session?: boolean;
|
|
3440
3494
|
};
|
|
3441
|
-
export type ProtocolInfoRequest = {};
|
|
3442
3495
|
export type ProtocolInfo = {
|
|
3443
3496
|
version: number;
|
|
3497
|
+
build_fingerprint: string;
|
|
3444
3498
|
supported_messages: number[];
|
|
3445
|
-
protobuf_definition?: string;
|
|
3446
3499
|
};
|
|
3500
|
+
export declare enum DeviceErrorCode {
|
|
3501
|
+
DeviceError_None = 0,
|
|
3502
|
+
DeviceError_Busy = 1,
|
|
3503
|
+
DeviceError_NotInitialized = 2,
|
|
3504
|
+
DeviceError_ActionCancelled = 3,
|
|
3505
|
+
DeviceError_PinAlreadyUsed = 4,
|
|
3506
|
+
DeviceError_PersistFailed = 5,
|
|
3507
|
+
DeviceError_SeError = 6,
|
|
3508
|
+
DeviceError_InvalidLanguage = 7,
|
|
3509
|
+
DeviceError_WallpaperNotUsable = 8,
|
|
3510
|
+
DeviceError_DeviceLocked = 9
|
|
3511
|
+
}
|
|
3447
3512
|
export declare enum DeviceRebootType {
|
|
3448
3513
|
Normal = 0,
|
|
3449
3514
|
Romloader = 1,
|
|
@@ -3453,14 +3518,37 @@ export type DeviceReboot = {
|
|
|
3453
3518
|
reboot_type: DeviceRebootType;
|
|
3454
3519
|
};
|
|
3455
3520
|
export type DeviceSettings = {
|
|
3456
|
-
label?: string;
|
|
3457
3521
|
bt_enable?: boolean;
|
|
3458
3522
|
language?: string;
|
|
3523
|
+
wallpaper_path?: string;
|
|
3524
|
+
brightness?: number;
|
|
3525
|
+
animation_enable?: boolean;
|
|
3526
|
+
tap_to_wake?: boolean;
|
|
3527
|
+
haptic_feedback?: boolean;
|
|
3528
|
+
device_name_display_enabled?: boolean;
|
|
3529
|
+
airgap_mode?: boolean;
|
|
3530
|
+
usb_lock_enable?: boolean;
|
|
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;
|
|
3459
3537
|
};
|
|
3460
3538
|
export type DeviceSettingsGet = {};
|
|
3461
3539
|
export type DeviceSettingsSet = {
|
|
3462
3540
|
settings: DeviceSettings;
|
|
3463
3541
|
};
|
|
3542
|
+
export declare enum DeviceSettingsPage {
|
|
3543
|
+
DeviceReset = 0,
|
|
3544
|
+
DevicePinChange = 1,
|
|
3545
|
+
DevicePassphrase = 2,
|
|
3546
|
+
DeviceAirgap = 3
|
|
3547
|
+
}
|
|
3548
|
+
export type DeviceSettingsPageShow = {
|
|
3549
|
+
page: DeviceSettingsPage;
|
|
3550
|
+
field_name?: string;
|
|
3551
|
+
};
|
|
3464
3552
|
export type DeviceCertificate = {
|
|
3465
3553
|
cert_and_pubkey: string;
|
|
3466
3554
|
private_key?: string;
|
|
@@ -3475,6 +3563,39 @@ export type DeviceCertificateSignature = {
|
|
|
3475
3563
|
export type DeviceCertificateSign = {
|
|
3476
3564
|
data: string;
|
|
3477
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
|
+
burn_in_completed?: boolean;
|
|
3585
|
+
factory_test_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
|
+
};
|
|
3478
3599
|
export declare enum DeviceFirmwareTargetType {
|
|
3479
3600
|
FW_MGMT_TARGET_INVALID = 0,
|
|
3480
3601
|
FW_MGMT_TARGET_CRATE = 1,
|
|
@@ -3525,36 +3646,6 @@ export type DeviceFirmwareUpdateStatusGet = {
|
|
|
3525
3646
|
export type DeviceFirmwareUpdateStatus = {
|
|
3526
3647
|
records: DeviceFirmwareUpdateRecord[];
|
|
3527
3648
|
};
|
|
3528
|
-
export declare enum DeviceFactoryAck {
|
|
3529
|
-
FACTORY_ACK_SUCCESS = 0,
|
|
3530
|
-
FACTORY_ACK_FAIL = 1
|
|
3531
|
-
}
|
|
3532
|
-
export type DeviceFactoryInfoManufactureTime = {
|
|
3533
|
-
year: number;
|
|
3534
|
-
month: number;
|
|
3535
|
-
day: number;
|
|
3536
|
-
hour: number;
|
|
3537
|
-
minute: number;
|
|
3538
|
-
second: number;
|
|
3539
|
-
};
|
|
3540
|
-
export type DeviceFactoryInfo = {
|
|
3541
|
-
version?: number;
|
|
3542
|
-
serial_number?: string;
|
|
3543
|
-
burn_in_completed?: boolean;
|
|
3544
|
-
factory_test_completed?: boolean;
|
|
3545
|
-
manufacture_time?: DeviceFactoryInfoManufactureTime;
|
|
3546
|
-
};
|
|
3547
|
-
export type DeviceFactoryInfoSet = {
|
|
3548
|
-
info: DeviceFactoryInfo;
|
|
3549
|
-
};
|
|
3550
|
-
export type DeviceFactoryInfoGet = {};
|
|
3551
|
-
export type DeviceFactoryPermanentLock = {
|
|
3552
|
-
check_a: string;
|
|
3553
|
-
check_b: string;
|
|
3554
|
-
};
|
|
3555
|
-
export type DeviceFactoryTest = {
|
|
3556
|
-
burn_in_test: boolean;
|
|
3557
|
-
};
|
|
3558
3649
|
export declare enum DeviceType {
|
|
3559
3650
|
CLASSIC1 = 0,
|
|
3560
3651
|
CLASSIC1S = 1,
|
|
@@ -3611,7 +3702,6 @@ export type DeviceInfoTargets = {
|
|
|
3611
3702
|
se2?: boolean;
|
|
3612
3703
|
se3?: boolean;
|
|
3613
3704
|
se4?: boolean;
|
|
3614
|
-
status?: boolean;
|
|
3615
3705
|
};
|
|
3616
3706
|
export type DeviceInfoTypes = {
|
|
3617
3707
|
version?: boolean;
|
|
@@ -3632,8 +3722,15 @@ export type ProtocolV2DeviceInfo = {
|
|
|
3632
3722
|
se2?: DeviceSEInfo;
|
|
3633
3723
|
se3?: DeviceSEInfo;
|
|
3634
3724
|
se4?: DeviceSEInfo;
|
|
3635
|
-
status?: DeviceStatus;
|
|
3636
3725
|
};
|
|
3726
|
+
export declare enum DeviceSessionErrorCode {
|
|
3727
|
+
DeviceSessionError_None = 0,
|
|
3728
|
+
DeviceSessionError_UserCancelled = 1,
|
|
3729
|
+
DeviceSessionError_InvalidSession = 2,
|
|
3730
|
+
DeviceSessionError_AttachPinUnavailable = 3,
|
|
3731
|
+
DeviceSessionError_PassphraseDisabled = 4,
|
|
3732
|
+
DeviceSessionError_Busy = 5
|
|
3733
|
+
}
|
|
3637
3734
|
export type DeviceSessionGet = {
|
|
3638
3735
|
session_id?: string;
|
|
3639
3736
|
};
|
|
@@ -3641,6 +3738,21 @@ export type DeviceSession = {
|
|
|
3641
3738
|
session_id?: string;
|
|
3642
3739
|
btc_test_address?: string;
|
|
3643
3740
|
};
|
|
3741
|
+
export declare enum DeviceSessionPinType {
|
|
3742
|
+
Any = 1,
|
|
3743
|
+
Main = 2,
|
|
3744
|
+
AttachToPin = 3
|
|
3745
|
+
}
|
|
3746
|
+
export type DeviceSessionAskPin = {
|
|
3747
|
+
type?: DeviceSessionPinType;
|
|
3748
|
+
};
|
|
3749
|
+
export type DeviceSessionAskPassphrase = {
|
|
3750
|
+
passphrase?: string;
|
|
3751
|
+
on_device: boolean;
|
|
3752
|
+
};
|
|
3753
|
+
export declare enum DeviceSessionAskPin_FailureSubCodes {
|
|
3754
|
+
UserCancel = 1
|
|
3755
|
+
}
|
|
3644
3756
|
export type DeviceStatus = {
|
|
3645
3757
|
device_id?: string;
|
|
3646
3758
|
unlocked?: boolean;
|
|
@@ -3650,6 +3762,7 @@ export type DeviceStatus = {
|
|
|
3650
3762
|
attach_to_pin_enabled?: boolean;
|
|
3651
3763
|
unlocked_by_attach_to_pin?: boolean;
|
|
3652
3764
|
};
|
|
3765
|
+
export type DeviceStatusGet = {};
|
|
3653
3766
|
export type FilesystemPermissionFix = {};
|
|
3654
3767
|
export type FilesystemPathInfo = {
|
|
3655
3768
|
exist: boolean;
|
|
@@ -3706,7 +3819,146 @@ export type FilesystemDirMake = {
|
|
|
3706
3819
|
export type FilesystemDirRemove = {
|
|
3707
3820
|
path: string;
|
|
3708
3821
|
};
|
|
3709
|
-
export type FilesystemFormat = {
|
|
3822
|
+
export type FilesystemFormat = {
|
|
3823
|
+
data: boolean;
|
|
3824
|
+
user: boolean;
|
|
3825
|
+
};
|
|
3826
|
+
export type InternalMyAddressRequest = {
|
|
3827
|
+
coin_type: number;
|
|
3828
|
+
chain_id: number;
|
|
3829
|
+
account_index: number;
|
|
3830
|
+
derive_type: number;
|
|
3831
|
+
};
|
|
3832
|
+
export type NftUpdate = {
|
|
3833
|
+
file_name_no_ext: string;
|
|
3834
|
+
};
|
|
3835
|
+
export declare enum OnboardingStep {
|
|
3836
|
+
ONBOARDING_STEP_UNKNOWN = 0,
|
|
3837
|
+
ONBOARDING_STEP_CHECKING = 1,
|
|
3838
|
+
ONBOARDING_STEP_PERSONALIZATION = 2,
|
|
3839
|
+
ONBOARDING_STEP_PIN = 3,
|
|
3840
|
+
ONBOARDING_STEP_SETUP = 4,
|
|
3841
|
+
ONBOARDING_STEP_DONE = 5
|
|
3842
|
+
}
|
|
3843
|
+
export declare enum OnboardingPhase {
|
|
3844
|
+
ONBOARDING_PHASE_UNKNOWN = 0,
|
|
3845
|
+
ONBOARDING_PHASE_SAFETY_CHECK = 1,
|
|
3846
|
+
ONBOARDING_PHASE_PIN_SETUP = 2,
|
|
3847
|
+
ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
|
|
3848
|
+
ONBOARDING_PHASE_SETUP_CHOICE = 4,
|
|
3849
|
+
ONBOARDING_PHASE_WALLET_CREATE_START = 5,
|
|
3850
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
|
|
3851
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
|
|
3852
|
+
ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
|
|
3853
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
|
|
3854
|
+
ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
|
|
3855
|
+
ONBOARDING_PHASE_WALLET_READY = 11,
|
|
3856
|
+
ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
|
|
3857
|
+
ONBOARDING_PHASE_SEEDCARD_BACKUP = 13
|
|
3858
|
+
}
|
|
3859
|
+
export declare enum OnboardingSetupKind {
|
|
3860
|
+
ONBOARDING_SETUP_KIND_UNKNOWN = 0,
|
|
3861
|
+
ONBOARDING_SETUP_KIND_CHOICE = 1,
|
|
3862
|
+
ONBOARDING_SETUP_KIND_CREATE = 2,
|
|
3863
|
+
ONBOARDING_SETUP_KIND_RESTORE = 3
|
|
3864
|
+
}
|
|
3865
|
+
export declare enum OnboardingSetupMethod {
|
|
3866
|
+
ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
|
|
3867
|
+
ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
|
|
3868
|
+
ONBOARDING_SETUP_METHOD_SEEDCARD = 2
|
|
3869
|
+
}
|
|
3870
|
+
export type OnboardingSetupStatus = {
|
|
3871
|
+
kind?: OnboardingSetupKind;
|
|
3872
|
+
method?: OnboardingSetupMethod;
|
|
3873
|
+
};
|
|
3874
|
+
export type OnboardingStatusGet = {};
|
|
3875
|
+
export type OnboardingStatus = {
|
|
3876
|
+
step?: OnboardingStep;
|
|
3877
|
+
phase?: OnboardingPhase;
|
|
3878
|
+
setup?: OnboardingSetupStatus;
|
|
3879
|
+
pin_set?: boolean;
|
|
3880
|
+
wallet_initialized?: boolean;
|
|
3881
|
+
};
|
|
3882
|
+
export type PortfolioUpdate = {};
|
|
3883
|
+
export type ViewAmount = {
|
|
3884
|
+
is_unlimited: boolean;
|
|
3885
|
+
num: string;
|
|
3886
|
+
};
|
|
3887
|
+
export type ViewDetail = {
|
|
3888
|
+
key: number;
|
|
3889
|
+
value: string;
|
|
3890
|
+
is_overview: boolean;
|
|
3891
|
+
has_icon: boolean;
|
|
3892
|
+
};
|
|
3893
|
+
export declare enum ViewTipType {
|
|
3894
|
+
Default = 0,
|
|
3895
|
+
Highlight = 1,
|
|
3896
|
+
Recommend = 2,
|
|
3897
|
+
Warning = 3,
|
|
3898
|
+
Danger = 4
|
|
3899
|
+
}
|
|
3900
|
+
export type ViewTip = {
|
|
3901
|
+
type: ViewTipType;
|
|
3902
|
+
text: string;
|
|
3903
|
+
};
|
|
3904
|
+
export type ViewRawData = {
|
|
3905
|
+
initial_data: string;
|
|
3906
|
+
placeholder: number;
|
|
3907
|
+
};
|
|
3908
|
+
export declare enum ViewSignLayout {
|
|
3909
|
+
LayoutDefault = 0,
|
|
3910
|
+
LayoutSafeTxCreate = 1,
|
|
3911
|
+
LayoutFinalConfirm = 2,
|
|
3912
|
+
Layout7702 = 3,
|
|
3913
|
+
LayoutFlat = 4,
|
|
3914
|
+
LayoutEthApprove = 5
|
|
3915
|
+
}
|
|
3916
|
+
export type ViewSignPage = {
|
|
3917
|
+
title: string;
|
|
3918
|
+
amount?: UintType;
|
|
3919
|
+
general: ViewDetail[];
|
|
3920
|
+
tip?: ViewTip;
|
|
3921
|
+
raw_data?: ViewRawData;
|
|
3922
|
+
slide_to_confirm?: boolean;
|
|
3923
|
+
layout?: ViewSignLayout;
|
|
3924
|
+
};
|
|
3925
|
+
export type ViewVerifyPage = {
|
|
3926
|
+
title: string;
|
|
3927
|
+
address: string;
|
|
3928
|
+
path: string;
|
|
3929
|
+
network?: string;
|
|
3930
|
+
derive_type?: string;
|
|
3931
|
+
value_key?: number;
|
|
3932
|
+
};
|
|
3933
|
+
export declare enum ProtocolV2FailureType {
|
|
3934
|
+
Failure_InvalidMessage = 1,
|
|
3935
|
+
Failure_UndefinedError = 2,
|
|
3936
|
+
Failure_UsageError = 3,
|
|
3937
|
+
Failure_DataError = 4,
|
|
3938
|
+
Failure_ProcessError = 5
|
|
3939
|
+
}
|
|
3940
|
+
export declare enum Enum_ProtocolV2Capability {
|
|
3941
|
+
Capability_Bitcoin = 1,
|
|
3942
|
+
Capability_Bitcoin_like = 2,
|
|
3943
|
+
Capability_Binance = 3,
|
|
3944
|
+
Capability_Cardano = 4,
|
|
3945
|
+
Capability_Crypto = 5,
|
|
3946
|
+
Capability_EOS = 6,
|
|
3947
|
+
Capability_Ethereum = 7,
|
|
3948
|
+
Capability_Lisk = 8,
|
|
3949
|
+
Capability_Monero = 9,
|
|
3950
|
+
Capability_NEM = 10,
|
|
3951
|
+
Capability_Ripple = 11,
|
|
3952
|
+
Capability_Stellar = 12,
|
|
3953
|
+
Capability_Tezos = 13,
|
|
3954
|
+
Capability_U2F = 14,
|
|
3955
|
+
Capability_Shamir = 15,
|
|
3956
|
+
Capability_ShamirGroups = 16,
|
|
3957
|
+
Capability_PassphraseEntry = 17,
|
|
3958
|
+
Capability_AttachToPin = 18,
|
|
3959
|
+
Capability_EthereumTypedData = 1000
|
|
3960
|
+
}
|
|
3961
|
+
export type ProtocolV2Capability = keyof typeof Enum_ProtocolV2Capability;
|
|
3710
3962
|
export type MessageType = {
|
|
3711
3963
|
AlephiumGetAddress: AlephiumGetAddress;
|
|
3712
3964
|
AlephiumAddress: AlephiumAddress;
|
|
@@ -3981,6 +4233,15 @@ export type MessageType = {
|
|
|
3981
4233
|
KaspaSignTx: KaspaSignTx;
|
|
3982
4234
|
KaspaTxInputRequest: KaspaTxInputRequest;
|
|
3983
4235
|
KaspaTxInputAck: KaspaTxInputAck;
|
|
4236
|
+
KaspaOutpoint: KaspaOutpoint;
|
|
4237
|
+
KaspaTxRequestSignature: KaspaTxRequestSignature;
|
|
4238
|
+
KaspaTxRequest: KaspaTxRequest;
|
|
4239
|
+
KaspaTxAckInput: KaspaTxAckInput;
|
|
4240
|
+
KaspaTxAckOutput: KaspaTxAckOutput;
|
|
4241
|
+
KaspaTxAckPayloadChunk: KaspaTxAckPayloadChunk;
|
|
4242
|
+
KaspaTxAckPrevMeta: KaspaTxAckPrevMeta;
|
|
4243
|
+
KaspaTxAckPrevInput: KaspaTxAckPrevInput;
|
|
4244
|
+
KaspaTxAckPrevOutput: KaspaTxAckPrevOutput;
|
|
3984
4245
|
KaspaSignedTx: KaspaSignedTx;
|
|
3985
4246
|
LnurlAuth: LnurlAuth;
|
|
3986
4247
|
LnurlAuthResp: LnurlAuthResp;
|
|
@@ -4270,47 +4531,41 @@ export type MessageType = {
|
|
|
4270
4531
|
CoinPurchaseMemo: CoinPurchaseMemo;
|
|
4271
4532
|
PaymentRequestMemo: PaymentRequestMemo;
|
|
4272
4533
|
TxAckPaymentRequest: TxAckPaymentRequest;
|
|
4273
|
-
|
|
4274
|
-
StartSession: StartSession;
|
|
4534
|
+
EthereumSignTypedDataQR: EthereumSignTypedDataQR;
|
|
4275
4535
|
SetBusy: SetBusy;
|
|
4276
4536
|
GetFirmwareHash: GetFirmwareHash;
|
|
4277
4537
|
FirmwareHash: FirmwareHash;
|
|
4278
4538
|
GetNonce: GetNonce;
|
|
4279
4539
|
Nonce: Nonce;
|
|
4280
4540
|
WriteSEPrivateKey: WriteSEPrivateKey;
|
|
4281
|
-
SetWallpaper: SetWallpaper;
|
|
4282
|
-
GetWallpaper: GetWallpaper;
|
|
4283
|
-
Wallpaper: Wallpaper;
|
|
4284
4541
|
UnlockPath: UnlockPath;
|
|
4285
4542
|
UnlockedPathRequest: UnlockedPathRequest;
|
|
4286
|
-
|
|
4287
|
-
ViewDetail: ViewDetail;
|
|
4288
|
-
ViewTip: ViewTip;
|
|
4289
|
-
ViewSignPage: ViewSignPage;
|
|
4290
|
-
ViewVerifyPage: ViewVerifyPage;
|
|
4543
|
+
UiAnimationRequest: UiAnimationRequest;
|
|
4291
4544
|
ProtocolInfoRequest: ProtocolInfoRequest;
|
|
4292
4545
|
ProtocolInfo: ProtocolInfo;
|
|
4293
4546
|
DeviceReboot: DeviceReboot;
|
|
4294
4547
|
DeviceSettings: DeviceSettings;
|
|
4295
4548
|
DeviceSettingsGet: DeviceSettingsGet;
|
|
4296
4549
|
DeviceSettingsSet: DeviceSettingsSet;
|
|
4550
|
+
DeviceSettingsPageShow: DeviceSettingsPageShow;
|
|
4297
4551
|
DeviceCertificate: DeviceCertificate;
|
|
4298
4552
|
DeviceCertificateWrite: DeviceCertificateWrite;
|
|
4299
4553
|
DeviceCertificateRead: DeviceCertificateRead;
|
|
4300
4554
|
DeviceCertificateSignature: DeviceCertificateSignature;
|
|
4301
4555
|
DeviceCertificateSign: DeviceCertificateSign;
|
|
4302
|
-
|
|
4303
|
-
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
4304
|
-
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
4305
|
-
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
4306
|
-
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
4307
|
-
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
4556
|
+
DeviceMiscUsbMscControl: DeviceMiscUsbMscControl;
|
|
4308
4557
|
DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
|
|
4309
4558
|
DeviceFactoryInfo: DeviceFactoryInfo;
|
|
4310
4559
|
DeviceFactoryInfoSet: DeviceFactoryInfoSet;
|
|
4311
4560
|
DeviceFactoryInfoGet: DeviceFactoryInfoGet;
|
|
4312
4561
|
DeviceFactoryPermanentLock: DeviceFactoryPermanentLock;
|
|
4313
4562
|
DeviceFactoryTest: DeviceFactoryTest;
|
|
4563
|
+
DeviceFirmwareTarget: DeviceFirmwareTarget;
|
|
4564
|
+
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
4565
|
+
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
4566
|
+
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
4567
|
+
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
4568
|
+
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
4314
4569
|
DeviceFirmwareImageInfo: DeviceFirmwareImageInfo;
|
|
4315
4570
|
DeviceHardwareInfo: DeviceHardwareInfo;
|
|
4316
4571
|
DeviceMainMcuInfo: DeviceMainMcuInfo;
|
|
@@ -4321,7 +4576,10 @@ export type MessageType = {
|
|
|
4321
4576
|
DeviceInfoGet: DeviceInfoGet;
|
|
4322
4577
|
DeviceSessionGet: DeviceSessionGet;
|
|
4323
4578
|
DeviceSession: DeviceSession;
|
|
4579
|
+
DeviceSessionAskPin: DeviceSessionAskPin;
|
|
4580
|
+
DeviceSessionAskPassphrase: DeviceSessionAskPassphrase;
|
|
4324
4581
|
DeviceStatus: DeviceStatus;
|
|
4582
|
+
DeviceStatusGet: DeviceStatusGet;
|
|
4325
4583
|
FilesystemPermissionFix: FilesystemPermissionFix;
|
|
4326
4584
|
FilesystemPathInfo: FilesystemPathInfo;
|
|
4327
4585
|
FilesystemPathInfoQuery: FilesystemPathInfoQuery;
|
|
@@ -4334,6 +4592,18 @@ export type MessageType = {
|
|
|
4334
4592
|
FilesystemDirMake: FilesystemDirMake;
|
|
4335
4593
|
FilesystemDirRemove: FilesystemDirRemove;
|
|
4336
4594
|
FilesystemFormat: FilesystemFormat;
|
|
4595
|
+
InternalMyAddressRequest: InternalMyAddressRequest;
|
|
4596
|
+
NftUpdate: NftUpdate;
|
|
4597
|
+
OnboardingSetupStatus: OnboardingSetupStatus;
|
|
4598
|
+
OnboardingStatusGet: OnboardingStatusGet;
|
|
4599
|
+
OnboardingStatus: OnboardingStatus;
|
|
4600
|
+
PortfolioUpdate: PortfolioUpdate;
|
|
4601
|
+
ViewAmount: ViewAmount;
|
|
4602
|
+
ViewDetail: ViewDetail;
|
|
4603
|
+
ViewTip: ViewTip;
|
|
4604
|
+
ViewRawData: ViewRawData;
|
|
4605
|
+
ViewSignPage: ViewSignPage;
|
|
4606
|
+
ViewVerifyPage: ViewVerifyPage;
|
|
4337
4607
|
};
|
|
4338
4608
|
export type MessageKey = keyof MessageType;
|
|
4339
4609
|
export type MessageResponse<T extends MessageKey> = {
|