@onekeyfe/hd-transport 1.2.8-alpha.111 → 1.2.8-alpha.112
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__/transport-log.test.js +0 -44
- package/dist/index.d.ts +7 -68
- package/dist/index.js +1 -19
- package/dist/types/messages.d.ts +0 -47
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/transport.d.ts +1 -0
- package/dist/types/transport.d.ts.map +1 -1
- package/dist/utils/transportLog.d.ts.map +1 -1
- package/messages-protocol-v2.json +1 -138
- package/package.json +2 -2
- package/src/types/messages.ts +0 -63
- package/src/types/transport.ts +6 -0
- package/src/utils/transportLog.ts +1 -6
|
@@ -11034,61 +11034,6 @@
|
|
|
11034
11034
|
}
|
|
11035
11035
|
}
|
|
11036
11036
|
},
|
|
11037
|
-
"ZcashSignPczt": {
|
|
11038
|
-
"fields": {
|
|
11039
|
-
"pczt_length": {
|
|
11040
|
-
"rule": "required",
|
|
11041
|
-
"type": "uint32",
|
|
11042
|
-
"id": 1
|
|
11043
|
-
},
|
|
11044
|
-
"pczt_initial_chunk": {
|
|
11045
|
-
"rule": "required",
|
|
11046
|
-
"type": "bytes",
|
|
11047
|
-
"id": 2
|
|
11048
|
-
}
|
|
11049
|
-
}
|
|
11050
|
-
},
|
|
11051
|
-
"ZcashPcztChunkRequest": {
|
|
11052
|
-
"fields": {
|
|
11053
|
-
"chunk_length": {
|
|
11054
|
-
"rule": "required",
|
|
11055
|
-
"type": "uint32",
|
|
11056
|
-
"id": 1
|
|
11057
|
-
}
|
|
11058
|
-
}
|
|
11059
|
-
},
|
|
11060
|
-
"ZcashPcztChunkAck": {
|
|
11061
|
-
"fields": {
|
|
11062
|
-
"data_chunk": {
|
|
11063
|
-
"rule": "required",
|
|
11064
|
-
"type": "bytes",
|
|
11065
|
-
"id": 1
|
|
11066
|
-
}
|
|
11067
|
-
}
|
|
11068
|
-
},
|
|
11069
|
-
"ZcashSignedPczt": {
|
|
11070
|
-
"fields": {
|
|
11071
|
-
"pczt_length": {
|
|
11072
|
-
"rule": "required",
|
|
11073
|
-
"type": "uint32",
|
|
11074
|
-
"id": 1
|
|
11075
|
-
},
|
|
11076
|
-
"pczt_initial_chunk": {
|
|
11077
|
-
"rule": "required",
|
|
11078
|
-
"type": "bytes",
|
|
11079
|
-
"id": 2
|
|
11080
|
-
}
|
|
11081
|
-
}
|
|
11082
|
-
},
|
|
11083
|
-
"ZcashSignedPcztChunkRequest": {
|
|
11084
|
-
"fields": {
|
|
11085
|
-
"chunk_length": {
|
|
11086
|
-
"rule": "required",
|
|
11087
|
-
"type": "uint32",
|
|
11088
|
-
"id": 1
|
|
11089
|
-
}
|
|
11090
|
-
}
|
|
11091
|
-
},
|
|
11092
11037
|
"wire_in": {
|
|
11093
11038
|
"type": "bool",
|
|
11094
11039
|
"id": 50002,
|
|
@@ -11514,11 +11459,6 @@
|
|
|
11514
11459
|
"MessageType_NeoAddress": 12302,
|
|
11515
11460
|
"MessageType_NeoSignTx": 12303,
|
|
11516
11461
|
"MessageType_NeoSignedTx": 12304,
|
|
11517
|
-
"MessageType_ZcashSignPczt": 12402,
|
|
11518
|
-
"MessageType_ZcashSignedPczt": 12403,
|
|
11519
|
-
"MessageType_ZcashPcztChunkRequest": 12404,
|
|
11520
|
-
"MessageType_ZcashPcztChunkAck": 12405,
|
|
11521
|
-
"MessageType_ZcashSignedPcztChunkRequest": 12406,
|
|
11522
11462
|
"MessageType_DeviceFactoryInfoSet": 60000,
|
|
11523
11463
|
"MessageType_DeviceFactoryInfoGet": 60001,
|
|
11524
11464
|
"MessageType_DeviceFactoryInfo": 60002,
|
|
@@ -11571,9 +11511,7 @@
|
|
|
11571
11511
|
"MessageType_PortfolioUpdate": 61400,
|
|
11572
11512
|
"MessageType_NftUpdate": 61500,
|
|
11573
11513
|
"MessageType_OnboardingStatusGet": 61600,
|
|
11574
|
-
"MessageType_OnboardingStatus": 61601
|
|
11575
|
-
"MessageType_ZcashGetAddress": 12400,
|
|
11576
|
-
"MessageType_ZcashAddress": 12401
|
|
11514
|
+
"MessageType_OnboardingStatus": 61601
|
|
11577
11515
|
},
|
|
11578
11516
|
"reserved": [
|
|
11579
11517
|
[90, 92],
|
|
@@ -13792,81 +13730,6 @@
|
|
|
13792
13730
|
}
|
|
13793
13731
|
}
|
|
13794
13732
|
}
|
|
13795
|
-
},
|
|
13796
|
-
"ZcashAddressType": {
|
|
13797
|
-
"values": {
|
|
13798
|
-
"UNIFIED_ORCHARD_P2PKH": 0,
|
|
13799
|
-
"TRANSPARENT_P2PKH": 1,
|
|
13800
|
-
"UNIFIED_ORCHARD": 2
|
|
13801
|
-
}
|
|
13802
|
-
},
|
|
13803
|
-
"ZcashAddressScope": {
|
|
13804
|
-
"values": {
|
|
13805
|
-
"EXTERNAL": 0,
|
|
13806
|
-
"INTERNAL": 1
|
|
13807
|
-
}
|
|
13808
|
-
},
|
|
13809
|
-
"ZcashGetAddress": {
|
|
13810
|
-
"fields": {
|
|
13811
|
-
"address_n": {
|
|
13812
|
-
"rule": "repeated",
|
|
13813
|
-
"type": "uint32",
|
|
13814
|
-
"id": 1,
|
|
13815
|
-
"options": {
|
|
13816
|
-
"packed": false
|
|
13817
|
-
}
|
|
13818
|
-
},
|
|
13819
|
-
"show_display": {
|
|
13820
|
-
"type": "bool",
|
|
13821
|
-
"id": 2
|
|
13822
|
-
},
|
|
13823
|
-
"include_seed_fingerprint": {
|
|
13824
|
-
"type": "bool",
|
|
13825
|
-
"id": 3
|
|
13826
|
-
},
|
|
13827
|
-
"include_ufvk": {
|
|
13828
|
-
"type": "bool",
|
|
13829
|
-
"id": 4
|
|
13830
|
-
},
|
|
13831
|
-
"diversifier_index": {
|
|
13832
|
-
"type": "uint32",
|
|
13833
|
-
"id": 5,
|
|
13834
|
-
"options": {
|
|
13835
|
-
"default": 0
|
|
13836
|
-
}
|
|
13837
|
-
},
|
|
13838
|
-
"address_type": {
|
|
13839
|
-
"type": "ZcashAddressType",
|
|
13840
|
-
"id": 6,
|
|
13841
|
-
"options": {
|
|
13842
|
-
"default": "UNIFIED_ORCHARD_P2PKH"
|
|
13843
|
-
}
|
|
13844
|
-
},
|
|
13845
|
-
"scope": {
|
|
13846
|
-
"type": "ZcashAddressScope",
|
|
13847
|
-
"id": 7,
|
|
13848
|
-
"options": {
|
|
13849
|
-
"default": "EXTERNAL"
|
|
13850
|
-
}
|
|
13851
|
-
}
|
|
13852
|
-
}
|
|
13853
|
-
},
|
|
13854
|
-
"ZcashAddress": {
|
|
13855
|
-
"fields": {
|
|
13856
|
-
"address": {
|
|
13857
|
-
"rule": "required",
|
|
13858
|
-
"type": "string",
|
|
13859
|
-
"id": 1
|
|
13860
|
-
},
|
|
13861
|
-
"ufvk": {
|
|
13862
|
-
"type": "string",
|
|
13863
|
-
"id": 2
|
|
13864
|
-
},
|
|
13865
|
-
"seed_fingerprint": {
|
|
13866
|
-
"type": "bytes",
|
|
13867
|
-
"id": 3
|
|
13868
|
-
}
|
|
13869
|
-
}
|
|
13870
13733
|
}
|
|
13871
13734
|
}
|
|
13872
13735
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport",
|
|
3
|
-
"version": "1.2.8-alpha.
|
|
3
|
+
"version": "1.2.8-alpha.112",
|
|
4
4
|
"description": "Transport layer abstractions and utilities for OneKey hardware SDK.",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"long": "^4.0.0",
|
|
29
29
|
"protobufjs": "^6.11.2"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "d6f1b4cbc6a1c60bb158d70bae93f81c3b07ed1e"
|
|
32
32
|
}
|
package/src/types/messages.ts
CHANGED
|
@@ -4680,33 +4680,6 @@ export type UiAnimationRequest = {
|
|
|
4680
4680
|
type?: UiAnimationType;
|
|
4681
4681
|
};
|
|
4682
4682
|
|
|
4683
|
-
// ZcashSignPczt
|
|
4684
|
-
export type ZcashSignPczt = {
|
|
4685
|
-
pczt_length: number;
|
|
4686
|
-
pczt_initial_chunk: string;
|
|
4687
|
-
};
|
|
4688
|
-
|
|
4689
|
-
// ZcashPcztChunkRequest
|
|
4690
|
-
export type ZcashPcztChunkRequest = {
|
|
4691
|
-
chunk_length: number;
|
|
4692
|
-
};
|
|
4693
|
-
|
|
4694
|
-
// ZcashPcztChunkAck
|
|
4695
|
-
export type ZcashPcztChunkAck = {
|
|
4696
|
-
data_chunk: string;
|
|
4697
|
-
};
|
|
4698
|
-
|
|
4699
|
-
// ZcashSignedPczt
|
|
4700
|
-
export type ZcashSignedPczt = {
|
|
4701
|
-
pczt_length: number;
|
|
4702
|
-
pczt_initial_chunk: string;
|
|
4703
|
-
};
|
|
4704
|
-
|
|
4705
|
-
// ZcashSignedPcztChunkRequest
|
|
4706
|
-
export type ZcashSignedPcztChunkRequest = {
|
|
4707
|
-
chunk_length: number;
|
|
4708
|
-
};
|
|
4709
|
-
|
|
4710
4683
|
// experimental_message
|
|
4711
4684
|
export type experimental_message = {};
|
|
4712
4685
|
|
|
@@ -5401,35 +5374,6 @@ export type ViewVerifyPage = {
|
|
|
5401
5374
|
content?: ViewContentPreview;
|
|
5402
5375
|
};
|
|
5403
5376
|
|
|
5404
|
-
export enum ZcashAddressType {
|
|
5405
|
-
UNIFIED_ORCHARD_P2PKH = 0,
|
|
5406
|
-
TRANSPARENT_P2PKH = 1,
|
|
5407
|
-
UNIFIED_ORCHARD = 2,
|
|
5408
|
-
}
|
|
5409
|
-
|
|
5410
|
-
export enum ZcashAddressScope {
|
|
5411
|
-
EXTERNAL = 0,
|
|
5412
|
-
INTERNAL = 1,
|
|
5413
|
-
}
|
|
5414
|
-
|
|
5415
|
-
// ZcashGetAddress
|
|
5416
|
-
export type ZcashGetAddress = {
|
|
5417
|
-
address_n: number[];
|
|
5418
|
-
show_display?: boolean;
|
|
5419
|
-
include_seed_fingerprint?: boolean;
|
|
5420
|
-
include_ufvk?: boolean;
|
|
5421
|
-
diversifier_index?: number;
|
|
5422
|
-
address_type?: ZcashAddressType;
|
|
5423
|
-
scope?: ZcashAddressScope;
|
|
5424
|
-
};
|
|
5425
|
-
|
|
5426
|
-
// ZcashAddress
|
|
5427
|
-
export type ZcashAddress = {
|
|
5428
|
-
address: string;
|
|
5429
|
-
ufvk?: string;
|
|
5430
|
-
seed_fingerprint?: string;
|
|
5431
|
-
};
|
|
5432
|
-
|
|
5433
5377
|
export enum ProtocolV2FailureType {
|
|
5434
5378
|
Failure_InvalidMessage = 1,
|
|
5435
5379
|
Failure_UndefinedError = 2,
|
|
@@ -6044,11 +5988,6 @@ export type MessageType = {
|
|
|
6044
5988
|
UnlockPath: UnlockPath;
|
|
6045
5989
|
UnlockedPathRequest: UnlockedPathRequest;
|
|
6046
5990
|
UiAnimationRequest: UiAnimationRequest;
|
|
6047
|
-
ZcashSignPczt: ZcashSignPczt;
|
|
6048
|
-
ZcashPcztChunkRequest: ZcashPcztChunkRequest;
|
|
6049
|
-
ZcashPcztChunkAck: ZcashPcztChunkAck;
|
|
6050
|
-
ZcashSignedPczt: ZcashSignedPczt;
|
|
6051
|
-
ZcashSignedPcztChunkRequest: ZcashSignedPcztChunkRequest;
|
|
6052
5991
|
experimental_message: experimental_message;
|
|
6053
5992
|
experimental_field: experimental_field;
|
|
6054
5993
|
ProtocolInfoRequest: ProtocolInfoRequest;
|
|
@@ -6125,8 +6064,6 @@ export type MessageType = {
|
|
|
6125
6064
|
ViewSignPage: ViewSignPage;
|
|
6126
6065
|
ViewWarningPage: ViewWarningPage;
|
|
6127
6066
|
ViewVerifyPage: ViewVerifyPage;
|
|
6128
|
-
ZcashGetAddress: ZcashGetAddress;
|
|
6129
|
-
ZcashAddress: ZcashAddress;
|
|
6130
6067
|
};
|
|
6131
6068
|
|
|
6132
6069
|
export type MessageKey = keyof MessageType;
|
package/src/types/transport.ts
CHANGED
|
@@ -34,6 +34,12 @@ export type OneKeyDeviceInfoWithSession = OneKeyUsbDeviceInfo & {
|
|
|
34
34
|
export type OneKeyMobileDeviceInfo = {
|
|
35
35
|
id: string;
|
|
36
36
|
name: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* Color letter of the serial number ('A'-'Z') from the Pro2 / Neo BLE advertisement,
|
|
39
|
+
* possibly seen in an earlier scan. Set by the React Native and Electron BLE
|
|
40
|
+
* transports; absent when unknown.
|
|
41
|
+
*/
|
|
42
|
+
bleColorCode?: string;
|
|
37
43
|
};
|
|
38
44
|
|
|
39
45
|
export type OneKeyDeviceInfoBase = {
|
|
@@ -7,7 +7,6 @@ const SENSITIVE_LOG_KEYS = new Set([
|
|
|
7
7
|
'address',
|
|
8
8
|
'apikey',
|
|
9
9
|
'connectid',
|
|
10
|
-
'datachunk',
|
|
11
10
|
'devicestate',
|
|
12
11
|
'deviceid',
|
|
13
12
|
'entropy',
|
|
@@ -16,20 +15,16 @@ const SENSITIVE_LOG_KEYS = new Set([
|
|
|
16
15
|
'passphrase',
|
|
17
16
|
'passphrasestate',
|
|
18
17
|
'password',
|
|
19
|
-
'pczt',
|
|
20
18
|
'pin',
|
|
21
19
|
'privatekey',
|
|
22
20
|
'publickey',
|
|
23
21
|
'seed',
|
|
24
22
|
'secret',
|
|
25
|
-
'seedfingerprint',
|
|
26
23
|
'serialnumber',
|
|
27
24
|
'session',
|
|
28
25
|
'sessionid',
|
|
29
26
|
'signature',
|
|
30
|
-
'signedpczt',
|
|
31
27
|
'token',
|
|
32
|
-
'ufvk',
|
|
33
28
|
'uuid',
|
|
34
29
|
'walletsessionid',
|
|
35
30
|
'xprv',
|
|
@@ -50,7 +45,7 @@ const isSensitiveLogKey = (key: string) => {
|
|
|
50
45
|
};
|
|
51
46
|
|
|
52
47
|
const isSigningMessage = (messageName?: string) =>
|
|
53
|
-
Boolean(messageName && /(?:sign|txack|transaction
|
|
48
|
+
Boolean(messageName && /(?:sign|txack|transaction)/i.test(messageName));
|
|
54
49
|
|
|
55
50
|
const redactLogValue = (value: unknown, seen: WeakSet<object>): unknown => {
|
|
56
51
|
if (ArrayBuffer.isView(value)) {
|