@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/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,143 @@ 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 declare enum OnboardingStep {
|
|
3833
|
+
ONBOARDING_STEP_UNKNOWN = 0,
|
|
3834
|
+
ONBOARDING_STEP_CHECKING = 1,
|
|
3835
|
+
ONBOARDING_STEP_PERSONALIZATION = 2,
|
|
3836
|
+
ONBOARDING_STEP_PIN = 3,
|
|
3837
|
+
ONBOARDING_STEP_SETUP = 4,
|
|
3838
|
+
ONBOARDING_STEP_DONE = 5
|
|
3839
|
+
}
|
|
3840
|
+
export declare enum OnboardingPhase {
|
|
3841
|
+
ONBOARDING_PHASE_UNKNOWN = 0,
|
|
3842
|
+
ONBOARDING_PHASE_SAFETY_CHECK = 1,
|
|
3843
|
+
ONBOARDING_PHASE_PIN_SETUP = 2,
|
|
3844
|
+
ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
|
|
3845
|
+
ONBOARDING_PHASE_SETUP_CHOICE = 4,
|
|
3846
|
+
ONBOARDING_PHASE_WALLET_CREATE_START = 5,
|
|
3847
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
|
|
3848
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
|
|
3849
|
+
ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
|
|
3850
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
|
|
3851
|
+
ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
|
|
3852
|
+
ONBOARDING_PHASE_WALLET_READY = 11,
|
|
3853
|
+
ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
|
|
3854
|
+
ONBOARDING_PHASE_SEEDCARD_BACKUP = 13
|
|
3855
|
+
}
|
|
3856
|
+
export declare enum OnboardingSetupKind {
|
|
3857
|
+
ONBOARDING_SETUP_KIND_UNKNOWN = 0,
|
|
3858
|
+
ONBOARDING_SETUP_KIND_CHOICE = 1,
|
|
3859
|
+
ONBOARDING_SETUP_KIND_CREATE = 2,
|
|
3860
|
+
ONBOARDING_SETUP_KIND_RESTORE = 3
|
|
3861
|
+
}
|
|
3862
|
+
export declare enum OnboardingSetupMethod {
|
|
3863
|
+
ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
|
|
3864
|
+
ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
|
|
3865
|
+
ONBOARDING_SETUP_METHOD_SEEDCARD = 2
|
|
3866
|
+
}
|
|
3867
|
+
export type OnboardingSetupStatus = {
|
|
3868
|
+
kind?: OnboardingSetupKind;
|
|
3869
|
+
method?: OnboardingSetupMethod;
|
|
3870
|
+
};
|
|
3871
|
+
export type OnboardingStatusGet = {};
|
|
3872
|
+
export type OnboardingStatus = {
|
|
3873
|
+
step?: OnboardingStep;
|
|
3874
|
+
phase?: OnboardingPhase;
|
|
3875
|
+
setup?: OnboardingSetupStatus;
|
|
3876
|
+
pin_set?: boolean;
|
|
3877
|
+
wallet_initialized?: boolean;
|
|
3878
|
+
};
|
|
3879
|
+
export type PortfolioUpdate = {};
|
|
3880
|
+
export type ViewAmount = {
|
|
3881
|
+
is_unlimited: boolean;
|
|
3882
|
+
num: string;
|
|
3883
|
+
};
|
|
3884
|
+
export type ViewDetail = {
|
|
3885
|
+
key: number;
|
|
3886
|
+
value: string;
|
|
3887
|
+
is_overview: boolean;
|
|
3888
|
+
has_icon: boolean;
|
|
3889
|
+
};
|
|
3890
|
+
export declare enum ViewTipType {
|
|
3891
|
+
Default = 0,
|
|
3892
|
+
Highlight = 1,
|
|
3893
|
+
Recommend = 2,
|
|
3894
|
+
Warning = 3,
|
|
3895
|
+
Danger = 4
|
|
3896
|
+
}
|
|
3897
|
+
export type ViewTip = {
|
|
3898
|
+
type: ViewTipType;
|
|
3899
|
+
text: string;
|
|
3900
|
+
};
|
|
3901
|
+
export type ViewRawData = {
|
|
3902
|
+
initial_data: string;
|
|
3903
|
+
placeholder: number;
|
|
3904
|
+
};
|
|
3905
|
+
export declare enum ViewSignLayout {
|
|
3906
|
+
LayoutDefault = 0,
|
|
3907
|
+
LayoutSafeTxCreate = 1,
|
|
3908
|
+
LayoutFinalConfirm = 2,
|
|
3909
|
+
Layout7702 = 3,
|
|
3910
|
+
LayoutFlat = 4,
|
|
3911
|
+
LayoutEthApprove = 5
|
|
3912
|
+
}
|
|
3913
|
+
export type ViewSignPage = {
|
|
3914
|
+
title: string;
|
|
3915
|
+
amount?: UintType;
|
|
3916
|
+
general: ViewDetail[];
|
|
3917
|
+
tip?: ViewTip;
|
|
3918
|
+
raw_data?: ViewRawData;
|
|
3919
|
+
slide_to_confirm?: boolean;
|
|
3920
|
+
layout?: ViewSignLayout;
|
|
3921
|
+
};
|
|
3922
|
+
export type ViewVerifyPage = {
|
|
3923
|
+
title: string;
|
|
3924
|
+
address: string;
|
|
3925
|
+
path: string;
|
|
3926
|
+
network?: string;
|
|
3927
|
+
derive_type?: string;
|
|
3928
|
+
value_key?: number;
|
|
3929
|
+
};
|
|
3930
|
+
export declare enum ProtocolV2FailureType {
|
|
3931
|
+
Failure_InvalidMessage = 1,
|
|
3932
|
+
Failure_UndefinedError = 2,
|
|
3933
|
+
Failure_UsageError = 3,
|
|
3934
|
+
Failure_DataError = 4,
|
|
3935
|
+
Failure_ProcessError = 5
|
|
3936
|
+
}
|
|
3937
|
+
export declare enum Enum_ProtocolV2Capability {
|
|
3938
|
+
Capability_Bitcoin = 1,
|
|
3939
|
+
Capability_Bitcoin_like = 2,
|
|
3940
|
+
Capability_Binance = 3,
|
|
3941
|
+
Capability_Cardano = 4,
|
|
3942
|
+
Capability_Crypto = 5,
|
|
3943
|
+
Capability_EOS = 6,
|
|
3944
|
+
Capability_Ethereum = 7,
|
|
3945
|
+
Capability_Lisk = 8,
|
|
3946
|
+
Capability_Monero = 9,
|
|
3947
|
+
Capability_NEM = 10,
|
|
3948
|
+
Capability_Ripple = 11,
|
|
3949
|
+
Capability_Stellar = 12,
|
|
3950
|
+
Capability_Tezos = 13,
|
|
3951
|
+
Capability_U2F = 14,
|
|
3952
|
+
Capability_Shamir = 15,
|
|
3953
|
+
Capability_ShamirGroups = 16,
|
|
3954
|
+
Capability_PassphraseEntry = 17,
|
|
3955
|
+
Capability_AttachToPin = 18,
|
|
3956
|
+
Capability_EthereumTypedData = 1000
|
|
3957
|
+
}
|
|
3958
|
+
export type ProtocolV2Capability = keyof typeof Enum_ProtocolV2Capability;
|
|
3710
3959
|
export type MessageType = {
|
|
3711
3960
|
AlephiumGetAddress: AlephiumGetAddress;
|
|
3712
3961
|
AlephiumAddress: AlephiumAddress;
|
|
@@ -3981,6 +4230,15 @@ export type MessageType = {
|
|
|
3981
4230
|
KaspaSignTx: KaspaSignTx;
|
|
3982
4231
|
KaspaTxInputRequest: KaspaTxInputRequest;
|
|
3983
4232
|
KaspaTxInputAck: KaspaTxInputAck;
|
|
4233
|
+
KaspaOutpoint: KaspaOutpoint;
|
|
4234
|
+
KaspaTxRequestSignature: KaspaTxRequestSignature;
|
|
4235
|
+
KaspaTxRequest: KaspaTxRequest;
|
|
4236
|
+
KaspaTxAckInput: KaspaTxAckInput;
|
|
4237
|
+
KaspaTxAckOutput: KaspaTxAckOutput;
|
|
4238
|
+
KaspaTxAckPayloadChunk: KaspaTxAckPayloadChunk;
|
|
4239
|
+
KaspaTxAckPrevMeta: KaspaTxAckPrevMeta;
|
|
4240
|
+
KaspaTxAckPrevInput: KaspaTxAckPrevInput;
|
|
4241
|
+
KaspaTxAckPrevOutput: KaspaTxAckPrevOutput;
|
|
3984
4242
|
KaspaSignedTx: KaspaSignedTx;
|
|
3985
4243
|
LnurlAuth: LnurlAuth;
|
|
3986
4244
|
LnurlAuthResp: LnurlAuthResp;
|
|
@@ -4270,47 +4528,41 @@ export type MessageType = {
|
|
|
4270
4528
|
CoinPurchaseMemo: CoinPurchaseMemo;
|
|
4271
4529
|
PaymentRequestMemo: PaymentRequestMemo;
|
|
4272
4530
|
TxAckPaymentRequest: TxAckPaymentRequest;
|
|
4273
|
-
|
|
4274
|
-
StartSession: StartSession;
|
|
4531
|
+
EthereumSignTypedDataQR: EthereumSignTypedDataQR;
|
|
4275
4532
|
SetBusy: SetBusy;
|
|
4276
4533
|
GetFirmwareHash: GetFirmwareHash;
|
|
4277
4534
|
FirmwareHash: FirmwareHash;
|
|
4278
4535
|
GetNonce: GetNonce;
|
|
4279
4536
|
Nonce: Nonce;
|
|
4280
4537
|
WriteSEPrivateKey: WriteSEPrivateKey;
|
|
4281
|
-
SetWallpaper: SetWallpaper;
|
|
4282
|
-
GetWallpaper: GetWallpaper;
|
|
4283
|
-
Wallpaper: Wallpaper;
|
|
4284
4538
|
UnlockPath: UnlockPath;
|
|
4285
4539
|
UnlockedPathRequest: UnlockedPathRequest;
|
|
4286
|
-
|
|
4287
|
-
ViewDetail: ViewDetail;
|
|
4288
|
-
ViewTip: ViewTip;
|
|
4289
|
-
ViewSignPage: ViewSignPage;
|
|
4290
|
-
ViewVerifyPage: ViewVerifyPage;
|
|
4540
|
+
UiAnimationRequest: UiAnimationRequest;
|
|
4291
4541
|
ProtocolInfoRequest: ProtocolInfoRequest;
|
|
4292
4542
|
ProtocolInfo: ProtocolInfo;
|
|
4293
4543
|
DeviceReboot: DeviceReboot;
|
|
4294
4544
|
DeviceSettings: DeviceSettings;
|
|
4295
4545
|
DeviceSettingsGet: DeviceSettingsGet;
|
|
4296
4546
|
DeviceSettingsSet: DeviceSettingsSet;
|
|
4547
|
+
DeviceSettingsPageShow: DeviceSettingsPageShow;
|
|
4297
4548
|
DeviceCertificate: DeviceCertificate;
|
|
4298
4549
|
DeviceCertificateWrite: DeviceCertificateWrite;
|
|
4299
4550
|
DeviceCertificateRead: DeviceCertificateRead;
|
|
4300
4551
|
DeviceCertificateSignature: DeviceCertificateSignature;
|
|
4301
4552
|
DeviceCertificateSign: DeviceCertificateSign;
|
|
4302
|
-
|
|
4303
|
-
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
4304
|
-
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
4305
|
-
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
4306
|
-
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
4307
|
-
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
4553
|
+
DeviceMiscUsbMscControl: DeviceMiscUsbMscControl;
|
|
4308
4554
|
DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
|
|
4309
4555
|
DeviceFactoryInfo: DeviceFactoryInfo;
|
|
4310
4556
|
DeviceFactoryInfoSet: DeviceFactoryInfoSet;
|
|
4311
4557
|
DeviceFactoryInfoGet: DeviceFactoryInfoGet;
|
|
4312
4558
|
DeviceFactoryPermanentLock: DeviceFactoryPermanentLock;
|
|
4313
4559
|
DeviceFactoryTest: DeviceFactoryTest;
|
|
4560
|
+
DeviceFirmwareTarget: DeviceFirmwareTarget;
|
|
4561
|
+
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
4562
|
+
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
4563
|
+
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
4564
|
+
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
4565
|
+
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
4314
4566
|
DeviceFirmwareImageInfo: DeviceFirmwareImageInfo;
|
|
4315
4567
|
DeviceHardwareInfo: DeviceHardwareInfo;
|
|
4316
4568
|
DeviceMainMcuInfo: DeviceMainMcuInfo;
|
|
@@ -4321,7 +4573,10 @@ export type MessageType = {
|
|
|
4321
4573
|
DeviceInfoGet: DeviceInfoGet;
|
|
4322
4574
|
DeviceSessionGet: DeviceSessionGet;
|
|
4323
4575
|
DeviceSession: DeviceSession;
|
|
4576
|
+
DeviceSessionAskPin: DeviceSessionAskPin;
|
|
4577
|
+
DeviceSessionAskPassphrase: DeviceSessionAskPassphrase;
|
|
4324
4578
|
DeviceStatus: DeviceStatus;
|
|
4579
|
+
DeviceStatusGet: DeviceStatusGet;
|
|
4325
4580
|
FilesystemPermissionFix: FilesystemPermissionFix;
|
|
4326
4581
|
FilesystemPathInfo: FilesystemPathInfo;
|
|
4327
4582
|
FilesystemPathInfoQuery: FilesystemPathInfoQuery;
|
|
@@ -4334,6 +4589,17 @@ export type MessageType = {
|
|
|
4334
4589
|
FilesystemDirMake: FilesystemDirMake;
|
|
4335
4590
|
FilesystemDirRemove: FilesystemDirRemove;
|
|
4336
4591
|
FilesystemFormat: FilesystemFormat;
|
|
4592
|
+
InternalMyAddressRequest: InternalMyAddressRequest;
|
|
4593
|
+
OnboardingSetupStatus: OnboardingSetupStatus;
|
|
4594
|
+
OnboardingStatusGet: OnboardingStatusGet;
|
|
4595
|
+
OnboardingStatus: OnboardingStatus;
|
|
4596
|
+
PortfolioUpdate: PortfolioUpdate;
|
|
4597
|
+
ViewAmount: ViewAmount;
|
|
4598
|
+
ViewDetail: ViewDetail;
|
|
4599
|
+
ViewTip: ViewTip;
|
|
4600
|
+
ViewRawData: ViewRawData;
|
|
4601
|
+
ViewSignPage: ViewSignPage;
|
|
4602
|
+
ViewVerifyPage: ViewVerifyPage;
|
|
4337
4603
|
};
|
|
4338
4604
|
export type MessageKey = keyof MessageType;
|
|
4339
4605
|
export type MessageResponse<T extends MessageKey> = {
|