@onekeyfe/hd-transport 1.2.0-alpha.9 → 1.2.0-alpha.90
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 +169 -11
- package/__tests__/protocol-v2-ble-frame-writer.test.js +119 -0
- package/__tests__/protocol-v2-link-manager.test.js +120 -9
- package/__tests__/protocol-v2-usb-transport-base.test.js +36 -2
- package/__tests__/protocol-v2.test.js +438 -64
- package/__tests__/transport-log.test.js +79 -0
- package/dist/constants.d.ts +3 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +707 -242
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +597 -296
- package/dist/protocols/index.d.ts +13 -6
- package/dist/protocols/index.d.ts.map +1 -1
- package/dist/protocols/v2/ble-frame-writer.d.ts +15 -0
- package/dist/protocols/v2/ble-frame-writer.d.ts.map +1 -0
- package/dist/protocols/v2/decode.d.ts +12 -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 +4 -0
- package/dist/protocols/v2/link-manager.d.ts.map +1 -1
- package/dist/protocols/v2/session.d.ts +10 -4
- package/dist/protocols/v2/session.d.ts.map +1 -1
- package/dist/protocols/v2/usb-transport-base.d.ts +1 -0
- package/dist/protocols/v2/usb-transport-base.d.ts.map +1 -1
- package/dist/serialization/protobuf/decode.d.ts.map +1 -1
- package/dist/serialization/protobuf/encode.d.ts.map +1 -1
- package/dist/types/messages.d.ts +370 -144
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/transport.d.ts +20 -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 +1113 -547
- package/package.json +3 -3
- package/scripts/protobuf-build.sh +85 -253
- package/scripts/protobuf-patches/index.js +1 -0
- package/scripts/protobuf-types.js +19 -1
- package/src/constants.ts +30 -16
- package/src/index.ts +5 -1
- package/src/protocols/index.ts +37 -40
- package/src/protocols/v2/ble-frame-writer.ts +77 -0
- package/src/protocols/v2/crc8.ts +1 -1
- package/src/protocols/v2/decode.ts +50 -35
- 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 +54 -5
- package/src/protocols/v2/session.ts +151 -200
- package/src/protocols/v2/usb-transport-base.ts +29 -10
- package/src/serialization/protobuf/decode.ts +4 -1
- package/src/serialization/protobuf/encode.ts +5 -1
- package/src/types/messages.ts +450 -185
- package/src/types/transport.ts +28 -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;
|
|
@@ -3358,17 +3446,6 @@ export type EthereumSignTypedDataQR = {
|
|
|
3358
3446
|
metamask_v4_compat?: boolean;
|
|
3359
3447
|
request_id?: string;
|
|
3360
3448
|
};
|
|
3361
|
-
export type InternalMyAddressRequest = {
|
|
3362
|
-
coin_type: number;
|
|
3363
|
-
chain_id: number;
|
|
3364
|
-
account_index: number;
|
|
3365
|
-
derive_type: number;
|
|
3366
|
-
};
|
|
3367
|
-
export type StartSession = {
|
|
3368
|
-
session_id?: string;
|
|
3369
|
-
_skip_passphrase?: boolean;
|
|
3370
|
-
derive_cardano?: boolean;
|
|
3371
|
-
};
|
|
3372
3449
|
export type SetBusy = {
|
|
3373
3450
|
expiry_ms?: number;
|
|
3374
3451
|
};
|
|
@@ -3385,21 +3462,6 @@ export type Nonce = {
|
|
|
3385
3462
|
export type WriteSEPrivateKey = {
|
|
3386
3463
|
private_key: string;
|
|
3387
3464
|
};
|
|
3388
|
-
export declare enum WallpaperTarget {
|
|
3389
|
-
Home = 0,
|
|
3390
|
-
Lock = 1
|
|
3391
|
-
}
|
|
3392
|
-
export type SetWallpaper = {
|
|
3393
|
-
target: WallpaperTarget;
|
|
3394
|
-
path: string;
|
|
3395
|
-
};
|
|
3396
|
-
export type GetWallpaper = {
|
|
3397
|
-
target: WallpaperTarget;
|
|
3398
|
-
};
|
|
3399
|
-
export type Wallpaper = {
|
|
3400
|
-
target: WallpaperTarget;
|
|
3401
|
-
path: string;
|
|
3402
|
-
};
|
|
3403
3465
|
export type UnlockPath = {
|
|
3404
3466
|
address_n: number[];
|
|
3405
3467
|
mac?: string;
|
|
@@ -3413,55 +3475,40 @@ export declare enum MoneroNetworkType {
|
|
|
3413
3475
|
STAGENET = 2,
|
|
3414
3476
|
FAKECHAIN = 3
|
|
3415
3477
|
}
|
|
3416
|
-
export
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
};
|
|
3420
|
-
export type ViewDetail = {
|
|
3421
|
-
key: number;
|
|
3422
|
-
value: string;
|
|
3423
|
-
is_overview: boolean;
|
|
3424
|
-
has_icon: boolean;
|
|
3425
|
-
};
|
|
3426
|
-
export declare enum ViewTipType {
|
|
3427
|
-
Default = 0,
|
|
3428
|
-
Highlight = 1,
|
|
3429
|
-
Recommend = 2,
|
|
3430
|
-
Warning = 3,
|
|
3431
|
-
Danger = 4
|
|
3478
|
+
export declare enum UiAnimationType {
|
|
3479
|
+
Unknown = 0,
|
|
3480
|
+
Signing = 1
|
|
3432
3481
|
}
|
|
3433
|
-
export
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
initial_data: string;
|
|
3439
|
-
placeholder: number;
|
|
3440
|
-
};
|
|
3441
|
-
export declare enum ViewSignLayout {
|
|
3442
|
-
LayoutDefault = 0,
|
|
3443
|
-
LayoutSafeTxCreate = 1
|
|
3482
|
+
export declare enum UiAnimationCommand {
|
|
3483
|
+
CommandUnknown = 0,
|
|
3484
|
+
Start = 1,
|
|
3485
|
+
Stop = 2,
|
|
3486
|
+
Refresh = 3
|
|
3444
3487
|
}
|
|
3445
|
-
export type
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
general: ViewDetail[];
|
|
3449
|
-
tip?: ViewTip;
|
|
3450
|
-
raw_data?: ViewRawData;
|
|
3451
|
-
slide_to_confirm?: boolean;
|
|
3452
|
-
layout?: ViewSignLayout;
|
|
3488
|
+
export type UiAnimationRequest = {
|
|
3489
|
+
command: UiAnimationCommand;
|
|
3490
|
+
type?: UiAnimationType;
|
|
3453
3491
|
};
|
|
3454
|
-
export type
|
|
3455
|
-
|
|
3456
|
-
address: string;
|
|
3457
|
-
path: string;
|
|
3492
|
+
export type ProtocolInfoRequest = {
|
|
3493
|
+
eventless_wallet_session?: boolean;
|
|
3458
3494
|
};
|
|
3459
|
-
export type ProtocolInfoRequest = {};
|
|
3460
3495
|
export type ProtocolInfo = {
|
|
3461
3496
|
version: number;
|
|
3497
|
+
build_fingerprint: string;
|
|
3462
3498
|
supported_messages: number[];
|
|
3463
|
-
protobuf_definition?: string;
|
|
3464
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
|
+
}
|
|
3465
3512
|
export declare enum DeviceRebootType {
|
|
3466
3513
|
Normal = 0,
|
|
3467
3514
|
Romloader = 1,
|
|
@@ -3471,14 +3518,37 @@ export type DeviceReboot = {
|
|
|
3471
3518
|
reboot_type: DeviceRebootType;
|
|
3472
3519
|
};
|
|
3473
3520
|
export type DeviceSettings = {
|
|
3474
|
-
label?: string;
|
|
3475
3521
|
bt_enable?: boolean;
|
|
3476
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;
|
|
3477
3537
|
};
|
|
3478
3538
|
export type DeviceSettingsGet = {};
|
|
3479
3539
|
export type DeviceSettingsSet = {
|
|
3480
3540
|
settings: DeviceSettings;
|
|
3481
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
|
+
};
|
|
3482
3552
|
export type DeviceCertificate = {
|
|
3483
3553
|
cert_and_pubkey: string;
|
|
3484
3554
|
private_key?: string;
|
|
@@ -3493,6 +3563,39 @@ export type DeviceCertificateSignature = {
|
|
|
3493
3563
|
export type DeviceCertificateSign = {
|
|
3494
3564
|
data: string;
|
|
3495
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
|
+
};
|
|
3496
3599
|
export declare enum DeviceFirmwareTargetType {
|
|
3497
3600
|
FW_MGMT_TARGET_INVALID = 0,
|
|
3498
3601
|
FW_MGMT_TARGET_CRATE = 1,
|
|
@@ -3543,36 +3646,6 @@ export type DeviceFirmwareUpdateStatusGet = {
|
|
|
3543
3646
|
export type DeviceFirmwareUpdateStatus = {
|
|
3544
3647
|
records: DeviceFirmwareUpdateRecord[];
|
|
3545
3648
|
};
|
|
3546
|
-
export declare enum DeviceFactoryAck {
|
|
3547
|
-
FACTORY_ACK_SUCCESS = 0,
|
|
3548
|
-
FACTORY_ACK_FAIL = 1
|
|
3549
|
-
}
|
|
3550
|
-
export type DeviceFactoryInfoManufactureTime = {
|
|
3551
|
-
year: number;
|
|
3552
|
-
month: number;
|
|
3553
|
-
day: number;
|
|
3554
|
-
hour: number;
|
|
3555
|
-
minute: number;
|
|
3556
|
-
second: number;
|
|
3557
|
-
};
|
|
3558
|
-
export type DeviceFactoryInfo = {
|
|
3559
|
-
version?: number;
|
|
3560
|
-
serial_number?: string;
|
|
3561
|
-
burn_in_completed?: boolean;
|
|
3562
|
-
factory_test_completed?: boolean;
|
|
3563
|
-
manufacture_time?: DeviceFactoryInfoManufactureTime;
|
|
3564
|
-
};
|
|
3565
|
-
export type DeviceFactoryInfoSet = {
|
|
3566
|
-
info: DeviceFactoryInfo;
|
|
3567
|
-
};
|
|
3568
|
-
export type DeviceFactoryInfoGet = {};
|
|
3569
|
-
export type DeviceFactoryPermanentLock = {
|
|
3570
|
-
check_a: string;
|
|
3571
|
-
check_b: string;
|
|
3572
|
-
};
|
|
3573
|
-
export type DeviceFactoryTest = {
|
|
3574
|
-
burn_in_test: boolean;
|
|
3575
|
-
};
|
|
3576
3649
|
export declare enum DeviceType {
|
|
3577
3650
|
CLASSIC1 = 0,
|
|
3578
3651
|
CLASSIC1S = 1,
|
|
@@ -3629,7 +3702,6 @@ export type DeviceInfoTargets = {
|
|
|
3629
3702
|
se2?: boolean;
|
|
3630
3703
|
se3?: boolean;
|
|
3631
3704
|
se4?: boolean;
|
|
3632
|
-
status?: boolean;
|
|
3633
3705
|
};
|
|
3634
3706
|
export type DeviceInfoTypes = {
|
|
3635
3707
|
version?: boolean;
|
|
@@ -3650,15 +3722,43 @@ export type ProtocolV2DeviceInfo = {
|
|
|
3650
3722
|
se2?: DeviceSEInfo;
|
|
3651
3723
|
se3?: DeviceSEInfo;
|
|
3652
3724
|
se4?: DeviceSEInfo;
|
|
3653
|
-
status?: DeviceStatus;
|
|
3654
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
|
+
}
|
|
3734
|
+
export declare enum DeviceSessionSeedDomain {
|
|
3735
|
+
SeedDomain_Standard = 1,
|
|
3736
|
+
SeedDomain_Cardano = 2
|
|
3737
|
+
}
|
|
3655
3738
|
export type DeviceSessionGet = {
|
|
3656
3739
|
session_id?: string;
|
|
3740
|
+
btc_test_address?: string;
|
|
3741
|
+
seed_domains: DeviceSessionSeedDomain[];
|
|
3657
3742
|
};
|
|
3658
3743
|
export type DeviceSession = {
|
|
3659
3744
|
session_id?: string;
|
|
3660
3745
|
btc_test_address?: string;
|
|
3661
3746
|
};
|
|
3747
|
+
export declare enum DeviceSessionPinType {
|
|
3748
|
+
Any = 1,
|
|
3749
|
+
Main = 2,
|
|
3750
|
+
AttachToPin = 3
|
|
3751
|
+
}
|
|
3752
|
+
export type DeviceSessionAskPin = {
|
|
3753
|
+
type?: DeviceSessionPinType;
|
|
3754
|
+
};
|
|
3755
|
+
export type DeviceSessionAskPassphrase = {
|
|
3756
|
+
passphrase?: string;
|
|
3757
|
+
on_device: boolean;
|
|
3758
|
+
};
|
|
3759
|
+
export declare enum DeviceSessionAskPin_FailureSubCodes {
|
|
3760
|
+
UserCancel = 1
|
|
3761
|
+
}
|
|
3662
3762
|
export type DeviceStatus = {
|
|
3663
3763
|
device_id?: string;
|
|
3664
3764
|
unlocked?: boolean;
|
|
@@ -3669,27 +3769,6 @@ export type DeviceStatus = {
|
|
|
3669
3769
|
unlocked_by_attach_to_pin?: boolean;
|
|
3670
3770
|
};
|
|
3671
3771
|
export type DeviceStatusGet = {};
|
|
3672
|
-
export declare enum DevOnboardingStage {
|
|
3673
|
-
DEV_ONBOARDING_STAGE_UNKNOWN = 0,
|
|
3674
|
-
DEV_ONBOARDING_STAGE_SAFETY_CHECK = 1,
|
|
3675
|
-
DEV_ONBOARDING_STAGE_PERSONALIZATION = 2,
|
|
3676
|
-
DEV_ONBOARDING_STAGE_SELECT_SETUP_METHOD = 3,
|
|
3677
|
-
DEV_ONBOARDING_STAGE_NEW_DEVICE = 4,
|
|
3678
|
-
DEV_ONBOARDING_STAGE_SELECT_RESTORE_METHOD = 5,
|
|
3679
|
-
DEV_ONBOARDING_STAGE_RESTORE_MNEMONIC = 6,
|
|
3680
|
-
DEV_ONBOARDING_STAGE_RESTORE_SEEDCARD = 7,
|
|
3681
|
-
DEV_ONBOARDING_STAGE_WALLET_READY = 8,
|
|
3682
|
-
DEV_ONBOARDING_STAGE_SEEDCARD_BACKUP_PROMPT = 9,
|
|
3683
|
-
DEV_ONBOARDING_STAGE_SELECT_SEEDCARD_BACKUP_METHOD = 10,
|
|
3684
|
-
DEV_ONBOARDING_STAGE_SEEDCARD_BACKUP = 11,
|
|
3685
|
-
DEV_ONBOARDING_STAGE_DONE = 12
|
|
3686
|
-
}
|
|
3687
|
-
export type DevGetOnboardingStatus = {};
|
|
3688
|
-
export type DevOnboardingStatus = {
|
|
3689
|
-
stage: DevOnboardingStage;
|
|
3690
|
-
status_code?: number;
|
|
3691
|
-
detail_code?: number;
|
|
3692
|
-
};
|
|
3693
3772
|
export type FilesystemPermissionFix = {};
|
|
3694
3773
|
export type FilesystemPathInfo = {
|
|
3695
3774
|
exist: boolean;
|
|
@@ -3750,7 +3829,142 @@ export type FilesystemFormat = {
|
|
|
3750
3829
|
data: boolean;
|
|
3751
3830
|
user: boolean;
|
|
3752
3831
|
};
|
|
3832
|
+
export type InternalMyAddressRequest = {
|
|
3833
|
+
coin_type: number;
|
|
3834
|
+
chain_id: number;
|
|
3835
|
+
account_index: number;
|
|
3836
|
+
derive_type: number;
|
|
3837
|
+
};
|
|
3838
|
+
export type NftUpdate = {
|
|
3839
|
+
file_name_no_ext: string;
|
|
3840
|
+
};
|
|
3841
|
+
export declare enum OnboardingStep {
|
|
3842
|
+
ONBOARDING_STEP_UNKNOWN = 0,
|
|
3843
|
+
ONBOARDING_STEP_CHECKING = 1,
|
|
3844
|
+
ONBOARDING_STEP_PERSONALIZATION = 2,
|
|
3845
|
+
ONBOARDING_STEP_PIN = 3,
|
|
3846
|
+
ONBOARDING_STEP_SETUP = 4,
|
|
3847
|
+
ONBOARDING_STEP_DONE = 5
|
|
3848
|
+
}
|
|
3849
|
+
export declare enum OnboardingPhase {
|
|
3850
|
+
ONBOARDING_PHASE_UNKNOWN = 0,
|
|
3851
|
+
ONBOARDING_PHASE_SAFETY_CHECK = 1,
|
|
3852
|
+
ONBOARDING_PHASE_PIN_SETUP = 2,
|
|
3853
|
+
ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
|
|
3854
|
+
ONBOARDING_PHASE_SETUP_CHOICE = 4,
|
|
3855
|
+
ONBOARDING_PHASE_WALLET_CREATE_START = 5,
|
|
3856
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
|
|
3857
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
|
|
3858
|
+
ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
|
|
3859
|
+
ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
|
|
3860
|
+
ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
|
|
3861
|
+
ONBOARDING_PHASE_WALLET_READY = 11,
|
|
3862
|
+
ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
|
|
3863
|
+
ONBOARDING_PHASE_SEEDCARD_BACKUP = 13
|
|
3864
|
+
}
|
|
3865
|
+
export declare enum OnboardingSetupKind {
|
|
3866
|
+
ONBOARDING_SETUP_KIND_UNKNOWN = 0,
|
|
3867
|
+
ONBOARDING_SETUP_KIND_CHOICE = 1,
|
|
3868
|
+
ONBOARDING_SETUP_KIND_CREATE = 2,
|
|
3869
|
+
ONBOARDING_SETUP_KIND_RESTORE = 3
|
|
3870
|
+
}
|
|
3871
|
+
export declare enum OnboardingSetupMethod {
|
|
3872
|
+
ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
|
|
3873
|
+
ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
|
|
3874
|
+
ONBOARDING_SETUP_METHOD_SEEDCARD = 2
|
|
3875
|
+
}
|
|
3876
|
+
export type OnboardingSetupStatus = {
|
|
3877
|
+
kind?: OnboardingSetupKind;
|
|
3878
|
+
method?: OnboardingSetupMethod;
|
|
3879
|
+
};
|
|
3880
|
+
export type OnboardingStatusGet = {};
|
|
3881
|
+
export type OnboardingStatus = {
|
|
3882
|
+
step?: OnboardingStep;
|
|
3883
|
+
phase?: OnboardingPhase;
|
|
3884
|
+
setup?: OnboardingSetupStatus;
|
|
3885
|
+
pin_set?: boolean;
|
|
3886
|
+
wallet_initialized?: boolean;
|
|
3887
|
+
};
|
|
3753
3888
|
export type PortfolioUpdate = {};
|
|
3889
|
+
export type ViewAmount = {
|
|
3890
|
+
is_unlimited: boolean;
|
|
3891
|
+
num: string;
|
|
3892
|
+
};
|
|
3893
|
+
export type ViewDetail = {
|
|
3894
|
+
key: number;
|
|
3895
|
+
value: string;
|
|
3896
|
+
is_overview: boolean;
|
|
3897
|
+
has_icon: boolean;
|
|
3898
|
+
};
|
|
3899
|
+
export declare enum ViewTipType {
|
|
3900
|
+
Default = 0,
|
|
3901
|
+
Highlight = 1,
|
|
3902
|
+
Recommend = 2,
|
|
3903
|
+
Warning = 3,
|
|
3904
|
+
Danger = 4
|
|
3905
|
+
}
|
|
3906
|
+
export type ViewTip = {
|
|
3907
|
+
type: ViewTipType;
|
|
3908
|
+
text: string;
|
|
3909
|
+
};
|
|
3910
|
+
export type ViewRawData = {
|
|
3911
|
+
initial_data: string;
|
|
3912
|
+
placeholder: number;
|
|
3913
|
+
};
|
|
3914
|
+
export declare enum ViewSignLayout {
|
|
3915
|
+
LayoutDefault = 0,
|
|
3916
|
+
LayoutSafeTxCreate = 1,
|
|
3917
|
+
LayoutFinalConfirm = 2,
|
|
3918
|
+
Layout7702 = 3,
|
|
3919
|
+
LayoutFlat = 4,
|
|
3920
|
+
LayoutEthApprove = 5
|
|
3921
|
+
}
|
|
3922
|
+
export type ViewSignPage = {
|
|
3923
|
+
title: string;
|
|
3924
|
+
amount?: UintType;
|
|
3925
|
+
general: ViewDetail[];
|
|
3926
|
+
tip?: ViewTip;
|
|
3927
|
+
raw_data?: ViewRawData;
|
|
3928
|
+
slide_to_confirm?: boolean;
|
|
3929
|
+
layout?: ViewSignLayout;
|
|
3930
|
+
};
|
|
3931
|
+
export type ViewVerifyPage = {
|
|
3932
|
+
title: string;
|
|
3933
|
+
address: string;
|
|
3934
|
+
path: string;
|
|
3935
|
+
network?: string;
|
|
3936
|
+
derive_type?: string;
|
|
3937
|
+
value_key?: number;
|
|
3938
|
+
};
|
|
3939
|
+
export declare enum ProtocolV2FailureType {
|
|
3940
|
+
Failure_InvalidMessage = 1,
|
|
3941
|
+
Failure_UndefinedError = 2,
|
|
3942
|
+
Failure_UsageError = 3,
|
|
3943
|
+
Failure_DataError = 4,
|
|
3944
|
+
Failure_ProcessError = 5
|
|
3945
|
+
}
|
|
3946
|
+
export declare enum Enum_ProtocolV2Capability {
|
|
3947
|
+
Capability_Bitcoin = 1,
|
|
3948
|
+
Capability_Bitcoin_like = 2,
|
|
3949
|
+
Capability_Binance = 3,
|
|
3950
|
+
Capability_Cardano = 4,
|
|
3951
|
+
Capability_Crypto = 5,
|
|
3952
|
+
Capability_EOS = 6,
|
|
3953
|
+
Capability_Ethereum = 7,
|
|
3954
|
+
Capability_Lisk = 8,
|
|
3955
|
+
Capability_Monero = 9,
|
|
3956
|
+
Capability_NEM = 10,
|
|
3957
|
+
Capability_Ripple = 11,
|
|
3958
|
+
Capability_Stellar = 12,
|
|
3959
|
+
Capability_Tezos = 13,
|
|
3960
|
+
Capability_U2F = 14,
|
|
3961
|
+
Capability_Shamir = 15,
|
|
3962
|
+
Capability_ShamirGroups = 16,
|
|
3963
|
+
Capability_PassphraseEntry = 17,
|
|
3964
|
+
Capability_AttachToPin = 18,
|
|
3965
|
+
Capability_EthereumTypedData = 1000
|
|
3966
|
+
}
|
|
3967
|
+
export type ProtocolV2Capability = keyof typeof Enum_ProtocolV2Capability;
|
|
3754
3968
|
export type MessageType = {
|
|
3755
3969
|
AlephiumGetAddress: AlephiumGetAddress;
|
|
3756
3970
|
AlephiumAddress: AlephiumAddress;
|
|
@@ -4025,6 +4239,15 @@ export type MessageType = {
|
|
|
4025
4239
|
KaspaSignTx: KaspaSignTx;
|
|
4026
4240
|
KaspaTxInputRequest: KaspaTxInputRequest;
|
|
4027
4241
|
KaspaTxInputAck: KaspaTxInputAck;
|
|
4242
|
+
KaspaOutpoint: KaspaOutpoint;
|
|
4243
|
+
KaspaTxRequestSignature: KaspaTxRequestSignature;
|
|
4244
|
+
KaspaTxRequest: KaspaTxRequest;
|
|
4245
|
+
KaspaTxAckInput: KaspaTxAckInput;
|
|
4246
|
+
KaspaTxAckOutput: KaspaTxAckOutput;
|
|
4247
|
+
KaspaTxAckPayloadChunk: KaspaTxAckPayloadChunk;
|
|
4248
|
+
KaspaTxAckPrevMeta: KaspaTxAckPrevMeta;
|
|
4249
|
+
KaspaTxAckPrevInput: KaspaTxAckPrevInput;
|
|
4250
|
+
KaspaTxAckPrevOutput: KaspaTxAckPrevOutput;
|
|
4028
4251
|
KaspaSignedTx: KaspaSignedTx;
|
|
4029
4252
|
LnurlAuth: LnurlAuth;
|
|
4030
4253
|
LnurlAuthResp: LnurlAuthResp;
|
|
@@ -4315,48 +4538,40 @@ export type MessageType = {
|
|
|
4315
4538
|
PaymentRequestMemo: PaymentRequestMemo;
|
|
4316
4539
|
TxAckPaymentRequest: TxAckPaymentRequest;
|
|
4317
4540
|
EthereumSignTypedDataQR: EthereumSignTypedDataQR;
|
|
4318
|
-
InternalMyAddressRequest: InternalMyAddressRequest;
|
|
4319
|
-
StartSession: StartSession;
|
|
4320
4541
|
SetBusy: SetBusy;
|
|
4321
4542
|
GetFirmwareHash: GetFirmwareHash;
|
|
4322
4543
|
FirmwareHash: FirmwareHash;
|
|
4323
4544
|
GetNonce: GetNonce;
|
|
4324
4545
|
Nonce: Nonce;
|
|
4325
4546
|
WriteSEPrivateKey: WriteSEPrivateKey;
|
|
4326
|
-
SetWallpaper: SetWallpaper;
|
|
4327
|
-
GetWallpaper: GetWallpaper;
|
|
4328
|
-
Wallpaper: Wallpaper;
|
|
4329
4547
|
UnlockPath: UnlockPath;
|
|
4330
4548
|
UnlockedPathRequest: UnlockedPathRequest;
|
|
4331
|
-
|
|
4332
|
-
ViewDetail: ViewDetail;
|
|
4333
|
-
ViewTip: ViewTip;
|
|
4334
|
-
ViewRawData: ViewRawData;
|
|
4335
|
-
ViewSignPage: ViewSignPage;
|
|
4336
|
-
ViewVerifyPage: ViewVerifyPage;
|
|
4549
|
+
UiAnimationRequest: UiAnimationRequest;
|
|
4337
4550
|
ProtocolInfoRequest: ProtocolInfoRequest;
|
|
4338
4551
|
ProtocolInfo: ProtocolInfo;
|
|
4339
4552
|
DeviceReboot: DeviceReboot;
|
|
4340
4553
|
DeviceSettings: DeviceSettings;
|
|
4341
4554
|
DeviceSettingsGet: DeviceSettingsGet;
|
|
4342
4555
|
DeviceSettingsSet: DeviceSettingsSet;
|
|
4556
|
+
DeviceSettingsPageShow: DeviceSettingsPageShow;
|
|
4343
4557
|
DeviceCertificate: DeviceCertificate;
|
|
4344
4558
|
DeviceCertificateWrite: DeviceCertificateWrite;
|
|
4345
4559
|
DeviceCertificateRead: DeviceCertificateRead;
|
|
4346
4560
|
DeviceCertificateSignature: DeviceCertificateSignature;
|
|
4347
4561
|
DeviceCertificateSign: DeviceCertificateSign;
|
|
4348
|
-
|
|
4349
|
-
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
4350
|
-
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
4351
|
-
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
4352
|
-
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
4353
|
-
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
4562
|
+
DeviceMiscUsbMscControl: DeviceMiscUsbMscControl;
|
|
4354
4563
|
DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
|
|
4355
4564
|
DeviceFactoryInfo: DeviceFactoryInfo;
|
|
4356
4565
|
DeviceFactoryInfoSet: DeviceFactoryInfoSet;
|
|
4357
4566
|
DeviceFactoryInfoGet: DeviceFactoryInfoGet;
|
|
4358
4567
|
DeviceFactoryPermanentLock: DeviceFactoryPermanentLock;
|
|
4359
4568
|
DeviceFactoryTest: DeviceFactoryTest;
|
|
4569
|
+
DeviceFirmwareTarget: DeviceFirmwareTarget;
|
|
4570
|
+
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
4571
|
+
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
4572
|
+
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
4573
|
+
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
4574
|
+
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
4360
4575
|
DeviceFirmwareImageInfo: DeviceFirmwareImageInfo;
|
|
4361
4576
|
DeviceHardwareInfo: DeviceHardwareInfo;
|
|
4362
4577
|
DeviceMainMcuInfo: DeviceMainMcuInfo;
|
|
@@ -4367,10 +4582,10 @@ export type MessageType = {
|
|
|
4367
4582
|
DeviceInfoGet: DeviceInfoGet;
|
|
4368
4583
|
DeviceSessionGet: DeviceSessionGet;
|
|
4369
4584
|
DeviceSession: DeviceSession;
|
|
4585
|
+
DeviceSessionAskPin: DeviceSessionAskPin;
|
|
4586
|
+
DeviceSessionAskPassphrase: DeviceSessionAskPassphrase;
|
|
4370
4587
|
DeviceStatus: DeviceStatus;
|
|
4371
4588
|
DeviceStatusGet: DeviceStatusGet;
|
|
4372
|
-
DevGetOnboardingStatus: DevGetOnboardingStatus;
|
|
4373
|
-
DevOnboardingStatus: DevOnboardingStatus;
|
|
4374
4589
|
FilesystemPermissionFix: FilesystemPermissionFix;
|
|
4375
4590
|
FilesystemPathInfo: FilesystemPathInfo;
|
|
4376
4591
|
FilesystemPathInfoQuery: FilesystemPathInfoQuery;
|
|
@@ -4383,7 +4598,18 @@ export type MessageType = {
|
|
|
4383
4598
|
FilesystemDirMake: FilesystemDirMake;
|
|
4384
4599
|
FilesystemDirRemove: FilesystemDirRemove;
|
|
4385
4600
|
FilesystemFormat: FilesystemFormat;
|
|
4601
|
+
InternalMyAddressRequest: InternalMyAddressRequest;
|
|
4602
|
+
NftUpdate: NftUpdate;
|
|
4603
|
+
OnboardingSetupStatus: OnboardingSetupStatus;
|
|
4604
|
+
OnboardingStatusGet: OnboardingStatusGet;
|
|
4605
|
+
OnboardingStatus: OnboardingStatus;
|
|
4386
4606
|
PortfolioUpdate: PortfolioUpdate;
|
|
4607
|
+
ViewAmount: ViewAmount;
|
|
4608
|
+
ViewDetail: ViewDetail;
|
|
4609
|
+
ViewTip: ViewTip;
|
|
4610
|
+
ViewRawData: ViewRawData;
|
|
4611
|
+
ViewSignPage: ViewSignPage;
|
|
4612
|
+
ViewVerifyPage: ViewVerifyPage;
|
|
4387
4613
|
};
|
|
4388
4614
|
export type MessageKey = keyof MessageType;
|
|
4389
4615
|
export type MessageResponse<T extends MessageKey> = {
|