@onekeyfe/hd-transport 1.2.0-alpha.2 → 1.2.0-alpha.3
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 +8 -0
- package/__tests__/protocol-v2.test.js +33 -0
- package/dist/index.d.ts +95 -124
- package/dist/index.js +28 -39
- package/dist/protocols/index.d.ts.map +1 -1
- package/dist/serialization/protobuf/messages.d.ts.map +1 -1
- package/dist/types/messages.d.ts +68 -88
- package/dist/types/messages.d.ts.map +1 -1
- package/messages-protocol-v2.json +329 -323
- package/package.json +2 -2
- package/src/protocols/index.ts +1 -0
- package/src/serialization/protobuf/messages.ts +6 -1
- package/src/types/messages.ts +86 -113
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocols/index.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAA+C,MAAM,cAAc,CAAC;AAElG,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAMhE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAElD,eAAO,MAAM,iCAAiC,QAAQ,CAAC;AAEvD,KAAK,iBAAiB,GAAG;IACvB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocols/index.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAA+C,MAAM,cAAc,CAAC;AAElG,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAMhE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAElD,eAAO,MAAM,iCAAiC,QAAQ,CAAC;AAEvD,KAAK,iBAAiB,GAAG;IACvB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAsCF,eAAO,MAAM,UAAU;;;;;;;;;;CAOtB,CAAC;AAEF,eAAO,MAAM,UAAU;yBAEV,iBAAiB,QACpB,MAAM,QACN,OAAO,MAAM,EAAE,OAAO,CAAC,YACpB,sBAAsB;yBAkCtB,iBAAiB,SACnB,UAAU,YACR,KAAK,sBAAsB,EAAE,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;;;;;;;;;;CA4B5E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/serialization/protobuf/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,iBAMvD;AAED,eAAO,MAAM,qBAAqB,aAAc,SAAS,IAAI,QAAQ,MAAM;;;CAiB1E,CAAC;AAEF,eAAO,MAAM,qBAAqB,aAAc,SAAS,IAAI,UAAU,MAAM;;;
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/serialization/protobuf/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,iBAMvD;AAED,eAAO,MAAM,qBAAqB,aAAc,SAAS,IAAI,QAAQ,MAAM;;;CAiB1E,CAAC;AAEF,eAAO,MAAM,qBAAqB,aAAc,SAAS,IAAI,UAAU,MAAM;;;CAgB5E,CAAC"}
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -3325,6 +3325,19 @@ export type TxAckPaymentRequest = {
|
|
|
3325
3325
|
amount?: UintType;
|
|
3326
3326
|
signature: string;
|
|
3327
3327
|
};
|
|
3328
|
+
export type DebugLinkInput = {
|
|
3329
|
+
x?: number;
|
|
3330
|
+
y?: number;
|
|
3331
|
+
duration_ms?: number;
|
|
3332
|
+
x_end?: number;
|
|
3333
|
+
y_end?: number;
|
|
3334
|
+
};
|
|
3335
|
+
export type InternalMyAddressRequest = {
|
|
3336
|
+
coin_type: number;
|
|
3337
|
+
chain_id: number;
|
|
3338
|
+
account_index: number;
|
|
3339
|
+
derive_type: number;
|
|
3340
|
+
};
|
|
3328
3341
|
export type SetBusy = {
|
|
3329
3342
|
expiry_ms?: number;
|
|
3330
3343
|
};
|
|
@@ -3341,6 +3354,21 @@ export type Nonce = {
|
|
|
3341
3354
|
export type WriteSEPrivateKey = {
|
|
3342
3355
|
private_key: string;
|
|
3343
3356
|
};
|
|
3357
|
+
export declare enum WallpaperTarget {
|
|
3358
|
+
Home = 0,
|
|
3359
|
+
Lock = 1
|
|
3360
|
+
}
|
|
3361
|
+
export type SetWallpaper = {
|
|
3362
|
+
target: WallpaperTarget;
|
|
3363
|
+
path: string;
|
|
3364
|
+
};
|
|
3365
|
+
export type GetWallpaper = {
|
|
3366
|
+
target: WallpaperTarget;
|
|
3367
|
+
};
|
|
3368
|
+
export type Wallpaper = {
|
|
3369
|
+
target: WallpaperTarget;
|
|
3370
|
+
path: string;
|
|
3371
|
+
};
|
|
3344
3372
|
export type UnlockPath = {
|
|
3345
3373
|
address_n: number[];
|
|
3346
3374
|
mac?: string;
|
|
@@ -3354,37 +3382,37 @@ export declare enum MoneroNetworkType {
|
|
|
3354
3382
|
STAGENET = 2,
|
|
3355
3383
|
FAKECHAIN = 3
|
|
3356
3384
|
}
|
|
3357
|
-
export type
|
|
3385
|
+
export type ViewAmount = {
|
|
3386
|
+
is_unlimited: boolean;
|
|
3358
3387
|
num: string;
|
|
3359
|
-
decimals: number;
|
|
3360
|
-
symbol: string;
|
|
3361
3388
|
};
|
|
3362
|
-
export type
|
|
3363
|
-
key: number;
|
|
3364
|
-
address: string;
|
|
3365
|
-
owner?: string;
|
|
3366
|
-
icon?: string;
|
|
3367
|
-
};
|
|
3368
|
-
export type TxDetailsNetwork = {
|
|
3369
|
-
coin_type: number;
|
|
3370
|
-
chain_id?: number;
|
|
3371
|
-
};
|
|
3372
|
-
export type TxDetailsGeneral = {
|
|
3389
|
+
export type ViewDetail = {
|
|
3373
3390
|
key: number;
|
|
3374
3391
|
value: string;
|
|
3375
3392
|
is_overview: boolean;
|
|
3393
|
+
has_icon: boolean;
|
|
3376
3394
|
};
|
|
3377
|
-
export declare enum
|
|
3378
|
-
|
|
3379
|
-
|
|
3395
|
+
export declare enum ViewTipType {
|
|
3396
|
+
Default = 0,
|
|
3397
|
+
Highlight = 1,
|
|
3398
|
+
Recommend = 2,
|
|
3399
|
+
Warning = 3,
|
|
3400
|
+
Danger = 4
|
|
3380
3401
|
}
|
|
3381
|
-
export type
|
|
3402
|
+
export type ViewTip = {
|
|
3403
|
+
type: ViewTipType;
|
|
3404
|
+
text: string;
|
|
3405
|
+
};
|
|
3406
|
+
export type ViewSignPage = {
|
|
3382
3407
|
title: string;
|
|
3383
|
-
display_type: TxDetailsDisplayType;
|
|
3384
3408
|
amount?: UintType;
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3409
|
+
general: ViewDetail[];
|
|
3410
|
+
tip?: ViewTip;
|
|
3411
|
+
};
|
|
3412
|
+
export type ViewVerifyPage = {
|
|
3413
|
+
title: string;
|
|
3414
|
+
address: string;
|
|
3415
|
+
path: string;
|
|
3388
3416
|
};
|
|
3389
3417
|
export type GetProtoVersion = {};
|
|
3390
3418
|
export type ProtoVersion = {
|
|
@@ -3395,17 +3423,9 @@ export declare enum DevRebootType {
|
|
|
3395
3423
|
Boardloader = 1,
|
|
3396
3424
|
Bootloader = 2
|
|
3397
3425
|
}
|
|
3398
|
-
export declare enum DeviceRebootType {
|
|
3399
|
-
Normal = 0,
|
|
3400
|
-
Romloader = 1,
|
|
3401
|
-
Bootloader = 2
|
|
3402
|
-
}
|
|
3403
3426
|
export type DevReboot = {
|
|
3404
3427
|
reboot_type: DevRebootType;
|
|
3405
3428
|
};
|
|
3406
|
-
export type DeviceReboot = {
|
|
3407
|
-
reboot_type: DeviceRebootType;
|
|
3408
|
-
};
|
|
3409
3429
|
export declare enum DeviceType {
|
|
3410
3430
|
CLASSIC1 = 0,
|
|
3411
3431
|
CLASSIC1S = 1,
|
|
@@ -3431,6 +3451,7 @@ export type DevFirmwareImageInfo = {
|
|
|
3431
3451
|
export type DevHardwareInfo = {
|
|
3432
3452
|
device_type?: DeviceType;
|
|
3433
3453
|
serial_no?: string;
|
|
3454
|
+
device_id?: string;
|
|
3434
3455
|
hardware_version?: string;
|
|
3435
3456
|
hardware_version_raw_adc?: number;
|
|
3436
3457
|
};
|
|
@@ -3479,7 +3500,6 @@ export type DevGetDeviceInfo = {
|
|
|
3479
3500
|
targets?: DevInfoTargets;
|
|
3480
3501
|
types?: DevInfoTypes;
|
|
3481
3502
|
};
|
|
3482
|
-
export type DeviceGetDeviceInfo = DevGetDeviceInfo;
|
|
3483
3503
|
export type ProtocolV2DeviceInfo = {
|
|
3484
3504
|
protocol_version: number;
|
|
3485
3505
|
hw?: DevHardwareInfo;
|
|
@@ -3492,72 +3512,35 @@ export type ProtocolV2DeviceInfo = {
|
|
|
3492
3512
|
status?: DevStatus;
|
|
3493
3513
|
};
|
|
3494
3514
|
export declare enum DevFirmwareTargetType {
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
TARGET_SE02 = 7,
|
|
3503
|
-
TARGET_SE03 = 8,
|
|
3504
|
-
TARGET_SE04 = 9,
|
|
3505
|
-
TARGET_RESOURCE = 10
|
|
3506
|
-
}
|
|
3507
|
-
export declare enum DeviceFirmwareTargetType {
|
|
3508
|
-
TARGET_INVALID = 0,
|
|
3509
|
-
TARGET_ROMLOADER = 1,
|
|
3510
|
-
TARGET_BOOTLOADER = 2,
|
|
3511
|
-
TARGET_APPLICATION_P1 = 3,
|
|
3512
|
-
TARGET_APPLICATION_P2 = 4,
|
|
3513
|
-
TARGET_COPROCESSOR = 5,
|
|
3514
|
-
TARGET_SE01 = 6,
|
|
3515
|
-
TARGET_SE02 = 7,
|
|
3516
|
-
TARGET_SE03 = 8,
|
|
3517
|
-
TARGET_SE04 = 9,
|
|
3515
|
+
TARGET_MAIN_APP = 0,
|
|
3516
|
+
TARGET_MAIN_BOOT = 1,
|
|
3517
|
+
TARGET_BT = 2,
|
|
3518
|
+
TARGET_SE1 = 3,
|
|
3519
|
+
TARGET_SE2 = 4,
|
|
3520
|
+
TARGET_SE3 = 5,
|
|
3521
|
+
TARGET_SE4 = 6,
|
|
3518
3522
|
TARGET_RESOURCE = 10
|
|
3519
3523
|
}
|
|
3520
3524
|
export type DevFirmwareTarget = {
|
|
3521
3525
|
target_id: DevFirmwareTargetType;
|
|
3522
3526
|
path: string;
|
|
3523
3527
|
};
|
|
3524
|
-
export type DeviceFirmwareTarget = {
|
|
3525
|
-
target_id: DeviceFirmwareTargetType;
|
|
3526
|
-
path: string;
|
|
3527
|
-
};
|
|
3528
3528
|
export type DevFirmwareUpdate = {
|
|
3529
3529
|
targets: DevFirmwareTarget[];
|
|
3530
3530
|
};
|
|
3531
|
-
export type DeviceFirmwareUpdate = {
|
|
3532
|
-
targets: DeviceFirmwareTarget[];
|
|
3533
|
-
max_concurrent?: number;
|
|
3534
|
-
};
|
|
3535
3531
|
export type DevFirmwareInstallProgress = {
|
|
3536
3532
|
target_id: DevFirmwareTargetType;
|
|
3537
3533
|
progress: number;
|
|
3538
3534
|
stage?: string;
|
|
3539
3535
|
};
|
|
3540
|
-
export type DeviceFirmwareInstallProgress = {
|
|
3541
|
-
target_id: DeviceFirmwareTargetType;
|
|
3542
|
-
progress: number;
|
|
3543
|
-
stage?: string;
|
|
3544
|
-
};
|
|
3545
3536
|
export type DevFirmwareUpdateStatusEntry = {
|
|
3546
3537
|
target_id: DevFirmwareTargetType;
|
|
3547
3538
|
status: number;
|
|
3548
3539
|
};
|
|
3549
|
-
export type DeviceFirmwareUpdateStatusEntry = {
|
|
3550
|
-
target_id: DeviceFirmwareTargetType;
|
|
3551
|
-
status: number;
|
|
3552
|
-
};
|
|
3553
3540
|
export type DevGetFirmwareUpdateStatus = {};
|
|
3554
|
-
export type DeviceGetFirmwareUpdateStatus = {};
|
|
3555
3541
|
export type DevFirmwareUpdateStatus = {
|
|
3556
3542
|
targets: DevFirmwareUpdateStatusEntry[];
|
|
3557
3543
|
};
|
|
3558
|
-
export type DeviceFirmwareUpdateStatus = {
|
|
3559
|
-
targets: DeviceFirmwareUpdateStatusEntry[];
|
|
3560
|
-
};
|
|
3561
3544
|
export type FactoryDeviceInfoSettings = {
|
|
3562
3545
|
serial_no?: string;
|
|
3563
3546
|
cpu_info?: string;
|
|
@@ -4217,23 +4200,27 @@ export type MessageType = {
|
|
|
4217
4200
|
CoinPurchaseMemo: CoinPurchaseMemo;
|
|
4218
4201
|
PaymentRequestMemo: PaymentRequestMemo;
|
|
4219
4202
|
TxAckPaymentRequest: TxAckPaymentRequest;
|
|
4203
|
+
DebugLinkInput: DebugLinkInput;
|
|
4204
|
+
InternalMyAddressRequest: InternalMyAddressRequest;
|
|
4220
4205
|
SetBusy: SetBusy;
|
|
4221
4206
|
GetFirmwareHash: GetFirmwareHash;
|
|
4222
4207
|
FirmwareHash: FirmwareHash;
|
|
4223
4208
|
GetNonce: GetNonce;
|
|
4224
4209
|
Nonce: Nonce;
|
|
4225
4210
|
WriteSEPrivateKey: WriteSEPrivateKey;
|
|
4211
|
+
SetWallpaper: SetWallpaper;
|
|
4212
|
+
GetWallpaper: GetWallpaper;
|
|
4213
|
+
Wallpaper: Wallpaper;
|
|
4226
4214
|
UnlockPath: UnlockPath;
|
|
4227
4215
|
UnlockedPathRequest: UnlockedPathRequest;
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4216
|
+
ViewAmount: ViewAmount;
|
|
4217
|
+
ViewDetail: ViewDetail;
|
|
4218
|
+
ViewTip: ViewTip;
|
|
4219
|
+
ViewSignPage: ViewSignPage;
|
|
4220
|
+
ViewVerifyPage: ViewVerifyPage;
|
|
4233
4221
|
GetProtoVersion: GetProtoVersion;
|
|
4234
4222
|
ProtoVersion: ProtoVersion;
|
|
4235
4223
|
DevReboot: DevReboot;
|
|
4236
|
-
DeviceReboot: DeviceReboot;
|
|
4237
4224
|
DevFirmwareImageInfo: DevFirmwareImageInfo;
|
|
4238
4225
|
DevHardwareInfo: DevHardwareInfo;
|
|
4239
4226
|
DevMainMcuInfo: DevMainMcuInfo;
|
|
@@ -4243,19 +4230,12 @@ export type MessageType = {
|
|
|
4243
4230
|
DevInfoTypes: DevInfoTypes;
|
|
4244
4231
|
DevStatus: DevStatus;
|
|
4245
4232
|
DevGetDeviceInfo: DevGetDeviceInfo;
|
|
4246
|
-
DeviceGetDeviceInfo: DeviceGetDeviceInfo;
|
|
4247
4233
|
DevFirmwareTarget: DevFirmwareTarget;
|
|
4248
|
-
DeviceFirmwareTarget: DeviceFirmwareTarget;
|
|
4249
4234
|
DevFirmwareUpdate: DevFirmwareUpdate;
|
|
4250
|
-
DeviceFirmwareUpdate: DeviceFirmwareUpdate;
|
|
4251
4235
|
DevFirmwareInstallProgress: DevFirmwareInstallProgress;
|
|
4252
|
-
DeviceFirmwareInstallProgress: DeviceFirmwareInstallProgress;
|
|
4253
4236
|
DevFirmwareUpdateStatusEntry: DevFirmwareUpdateStatusEntry;
|
|
4254
|
-
DeviceFirmwareUpdateStatusEntry: DeviceFirmwareUpdateStatusEntry;
|
|
4255
4237
|
DevGetFirmwareUpdateStatus: DevGetFirmwareUpdateStatus;
|
|
4256
|
-
DeviceGetFirmwareUpdateStatus: DeviceGetFirmwareUpdateStatus;
|
|
4257
4238
|
DevFirmwareUpdateStatus: DevFirmwareUpdateStatus;
|
|
4258
|
-
DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
|
|
4259
4239
|
FactoryDeviceInfoSettings: FactoryDeviceInfoSettings;
|
|
4260
4240
|
FactoryGetDeviceInfo: FactoryGetDeviceInfo;
|
|
4261
4241
|
FactoryDeviceInfo: FactoryDeviceInfo;
|