@onekeyfe/hd-transport 1.2.8 → 1.2.9
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__/babylon-context-hash.test.js +44 -0
- package/__tests__/protocol-v2-file-write-pipeline.test.js +478 -0
- package/__tests__/protocol-v2.test.js +3 -3
- package/__tests__/transport-log.test.js +176 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +157 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +253 -72
- package/dist/protocols/v2/session.d.ts +7 -1
- package/dist/protocols/v2/session.d.ts.map +1 -1
- package/dist/types/messages.d.ts +72 -0
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/transport.d.ts +6 -0
- package/dist/types/transport.d.ts.map +1 -1
- package/dist/utils/transportLog.d.ts.map +1 -1
- package/messages-protocol-v2.json +152 -0
- package/package.json +2 -2
- package/scripts/protobuf-build.sh +30 -0
- package/scripts/protobuf-types.js +1 -0
- package/src/constants.ts +10 -1
- package/src/index.ts +1 -0
- package/src/protocols/v2/session.ts +326 -96
- package/src/types/messages.ts +97 -0
- package/src/types/transport.ts +25 -0
- package/src/utils/transportLog.ts +17 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/types/transport.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AAEvC,eAAO,MAAM,eAAe;;CAElB,CAAC;AAEX,MAAM,MAAM,8BAA8B,GAAG;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvC,MAAM,MAAM,oBAAoB,GAC5B,KAAK,GACL,QAAQ,GACR,KAAK,GACL,QAA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C,CAAC;IAC7F,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C,2BAA2B,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAEjG,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transportLog.d.ts","sourceRoot":"","sources":["../../src/utils/transportLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"transportLog.d.ts","sourceRoot":"","sources":["../../src/utils/transportLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA6F7C,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAKxF;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;EAO9B;AAID,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,WAE3D"}
|
|
@@ -11034,6 +11034,149 @@
|
|
|
11034
11034
|
}
|
|
11035
11035
|
}
|
|
11036
11036
|
},
|
|
11037
|
+
"ZcashAddressType": {
|
|
11038
|
+
"values": {
|
|
11039
|
+
"UNIFIED_ORCHARD_P2PKH": 0,
|
|
11040
|
+
"TRANSPARENT_P2PKH": 1,
|
|
11041
|
+
"UNIFIED_ORCHARD": 2
|
|
11042
|
+
}
|
|
11043
|
+
},
|
|
11044
|
+
"ZcashAddressScope": {
|
|
11045
|
+
"values": {
|
|
11046
|
+
"EXTERNAL": 0,
|
|
11047
|
+
"INTERNAL": 1
|
|
11048
|
+
}
|
|
11049
|
+
},
|
|
11050
|
+
"ZcashGetAddress": {
|
|
11051
|
+
"fields": {
|
|
11052
|
+
"address_n": {
|
|
11053
|
+
"rule": "repeated",
|
|
11054
|
+
"type": "uint32",
|
|
11055
|
+
"id": 1,
|
|
11056
|
+
"options": {
|
|
11057
|
+
"packed": false
|
|
11058
|
+
}
|
|
11059
|
+
},
|
|
11060
|
+
"show_display": {
|
|
11061
|
+
"type": "bool",
|
|
11062
|
+
"id": 2
|
|
11063
|
+
},
|
|
11064
|
+
"include_seed_fingerprint": {
|
|
11065
|
+
"type": "bool",
|
|
11066
|
+
"id": 3
|
|
11067
|
+
},
|
|
11068
|
+
"diversifier_index": {
|
|
11069
|
+
"type": "uint32",
|
|
11070
|
+
"id": 5,
|
|
11071
|
+
"options": {
|
|
11072
|
+
"default": 0
|
|
11073
|
+
}
|
|
11074
|
+
},
|
|
11075
|
+
"address_type": {
|
|
11076
|
+
"type": "ZcashAddressType",
|
|
11077
|
+
"id": 6,
|
|
11078
|
+
"options": {
|
|
11079
|
+
"default": "UNIFIED_ORCHARD_P2PKH"
|
|
11080
|
+
}
|
|
11081
|
+
},
|
|
11082
|
+
"scope": {
|
|
11083
|
+
"type": "ZcashAddressScope",
|
|
11084
|
+
"id": 7,
|
|
11085
|
+
"options": {
|
|
11086
|
+
"default": "EXTERNAL"
|
|
11087
|
+
}
|
|
11088
|
+
}
|
|
11089
|
+
}
|
|
11090
|
+
},
|
|
11091
|
+
"ZcashAddress": {
|
|
11092
|
+
"fields": {
|
|
11093
|
+
"address": {
|
|
11094
|
+
"rule": "required",
|
|
11095
|
+
"type": "string",
|
|
11096
|
+
"id": 1
|
|
11097
|
+
},
|
|
11098
|
+
"seed_fingerprint": {
|
|
11099
|
+
"type": "bytes",
|
|
11100
|
+
"id": 3
|
|
11101
|
+
}
|
|
11102
|
+
}
|
|
11103
|
+
},
|
|
11104
|
+
"ZcashGetFullViewingKey": {
|
|
11105
|
+
"fields": {
|
|
11106
|
+
"address_n": {
|
|
11107
|
+
"rule": "repeated",
|
|
11108
|
+
"type": "uint32",
|
|
11109
|
+
"id": 1,
|
|
11110
|
+
"options": {
|
|
11111
|
+
"packed": false
|
|
11112
|
+
}
|
|
11113
|
+
}
|
|
11114
|
+
}
|
|
11115
|
+
},
|
|
11116
|
+
"ZcashFullViewingKey": {
|
|
11117
|
+
"fields": {
|
|
11118
|
+
"ufvk": {
|
|
11119
|
+
"rule": "required",
|
|
11120
|
+
"type": "string",
|
|
11121
|
+
"id": 1
|
|
11122
|
+
}
|
|
11123
|
+
}
|
|
11124
|
+
},
|
|
11125
|
+
"ZcashSignPczt": {
|
|
11126
|
+
"fields": {
|
|
11127
|
+
"pczt_length": {
|
|
11128
|
+
"rule": "required",
|
|
11129
|
+
"type": "uint32",
|
|
11130
|
+
"id": 1
|
|
11131
|
+
},
|
|
11132
|
+
"pczt_initial_chunk": {
|
|
11133
|
+
"rule": "required",
|
|
11134
|
+
"type": "bytes",
|
|
11135
|
+
"id": 2
|
|
11136
|
+
}
|
|
11137
|
+
}
|
|
11138
|
+
},
|
|
11139
|
+
"ZcashPcztChunkRequest": {
|
|
11140
|
+
"fields": {
|
|
11141
|
+
"chunk_length": {
|
|
11142
|
+
"rule": "required",
|
|
11143
|
+
"type": "uint32",
|
|
11144
|
+
"id": 1
|
|
11145
|
+
}
|
|
11146
|
+
}
|
|
11147
|
+
},
|
|
11148
|
+
"ZcashPcztChunkAck": {
|
|
11149
|
+
"fields": {
|
|
11150
|
+
"data_chunk": {
|
|
11151
|
+
"rule": "required",
|
|
11152
|
+
"type": "bytes",
|
|
11153
|
+
"id": 1
|
|
11154
|
+
}
|
|
11155
|
+
}
|
|
11156
|
+
},
|
|
11157
|
+
"ZcashSignedPczt": {
|
|
11158
|
+
"fields": {
|
|
11159
|
+
"pczt_length": {
|
|
11160
|
+
"rule": "required",
|
|
11161
|
+
"type": "uint32",
|
|
11162
|
+
"id": 1
|
|
11163
|
+
},
|
|
11164
|
+
"pczt_initial_chunk": {
|
|
11165
|
+
"rule": "required",
|
|
11166
|
+
"type": "bytes",
|
|
11167
|
+
"id": 2
|
|
11168
|
+
}
|
|
11169
|
+
}
|
|
11170
|
+
},
|
|
11171
|
+
"ZcashSignedPcztChunkRequest": {
|
|
11172
|
+
"fields": {
|
|
11173
|
+
"chunk_length": {
|
|
11174
|
+
"rule": "required",
|
|
11175
|
+
"type": "uint32",
|
|
11176
|
+
"id": 1
|
|
11177
|
+
}
|
|
11178
|
+
}
|
|
11179
|
+
},
|
|
11037
11180
|
"wire_in": {
|
|
11038
11181
|
"type": "bool",
|
|
11039
11182
|
"id": 50002,
|
|
@@ -11459,6 +11602,15 @@
|
|
|
11459
11602
|
"MessageType_NeoAddress": 12302,
|
|
11460
11603
|
"MessageType_NeoSignTx": 12303,
|
|
11461
11604
|
"MessageType_NeoSignedTx": 12304,
|
|
11605
|
+
"MessageType_ZcashGetAddress": 12400,
|
|
11606
|
+
"MessageType_ZcashAddress": 12401,
|
|
11607
|
+
"MessageType_ZcashSignPczt": 12402,
|
|
11608
|
+
"MessageType_ZcashSignedPczt": 12403,
|
|
11609
|
+
"MessageType_ZcashPcztChunkRequest": 12404,
|
|
11610
|
+
"MessageType_ZcashPcztChunkAck": 12405,
|
|
11611
|
+
"MessageType_ZcashSignedPcztChunkRequest": 12406,
|
|
11612
|
+
"MessageType_ZcashGetFullViewingKey": 12407,
|
|
11613
|
+
"MessageType_ZcashFullViewingKey": 12408,
|
|
11462
11614
|
"MessageType_DeviceFactoryInfoSet": 60000,
|
|
11463
11615
|
"MessageType_DeviceFactoryInfoGet": 60001,
|
|
11464
11616
|
"MessageType_DeviceFactoryInfo": 60002,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9",
|
|
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": "36cc567ae08ffb9190b44efc6430d4199343be9e"
|
|
32
32
|
}
|
|
@@ -54,6 +54,36 @@ grep -hv -e '^import ' -e '^syntax' -e '^package' -e 'option java_' "$SRC_PATH"/
|
|
|
54
54
|
| sed 's/^option /\/\/ option /' \
|
|
55
55
|
| grep -v ' reserved ' >> "$V1_TMP_PROTO"
|
|
56
56
|
|
|
57
|
+
# Classic 1s exposes these messages before the shared firmware submodule includes them.
|
|
58
|
+
# Wire contract: https://onekeygroup.slack.com/archives/C0A7BUG1DT6/p1791598732003599
|
|
59
|
+
node - "$V1_TMP_PROTO" <<'NODE'
|
|
60
|
+
const fs = require('fs');
|
|
61
|
+
const protoPath = process.argv[2];
|
|
62
|
+
let proto = fs.readFileSync(protoPath, 'utf8');
|
|
63
|
+
proto = proto.replace('enum MessageType {', `enum MessageType {
|
|
64
|
+
MessageType_BabylonDeriveContextHash = 10054 [(bitcoin_only) = true, (wire_in) = true];
|
|
65
|
+
MessageType_BabylonDerivedContextHash = 10055 [(bitcoin_only) = true, (wire_out) = true];`);
|
|
66
|
+
proto += `
|
|
67
|
+
enum CanonicalBitcoinNetwork {
|
|
68
|
+
BITCOIN_MAINNET = 0;
|
|
69
|
+
BITCOIN_TESTNET = 1;
|
|
70
|
+
BITCOIN_SIGNET = 2;
|
|
71
|
+
BITCOIN_REGTEST = 3;
|
|
72
|
+
}
|
|
73
|
+
message BabylonDeriveContextHash {
|
|
74
|
+
repeated uint32 address_n = 1;
|
|
75
|
+
required InputScriptType script_type = 2;
|
|
76
|
+
required bytes app_name = 3;
|
|
77
|
+
required bytes context = 4;
|
|
78
|
+
required CanonicalBitcoinNetwork network = 5;
|
|
79
|
+
}
|
|
80
|
+
message BabylonDerivedContextHash {
|
|
81
|
+
required bytes secret = 1;
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
fs.writeFileSync(protoPath, proto);
|
|
85
|
+
NODE
|
|
86
|
+
|
|
57
87
|
npx pbjs -t json -p "$DIST_PATH" -o "$DIST_PATH/messages.json" --keep-case "$V1_TMP_PROTO"
|
|
58
88
|
cp "$DIST_PATH/messages.json" "$CORE_MESSAGES_DIR/messages.json"
|
|
59
89
|
|
|
@@ -55,6 +55,7 @@ const hasParsedType = name => types.some(t => t && t.name === name);
|
|
|
55
55
|
// enums used as keys (string), used as values (number) by default
|
|
56
56
|
const ENUM_KEYS = [
|
|
57
57
|
'InputScriptType',
|
|
58
|
+
'CanonicalBitcoinNetwork',
|
|
58
59
|
'OutputScriptType',
|
|
59
60
|
'RequestType',
|
|
60
61
|
'KaspaInputScriptType',
|
package/src/constants.ts
CHANGED
|
@@ -30,8 +30,9 @@ export const PROTOCOL_V2_WEBUSB_FILE_CHUNK_SIZE = 4000;
|
|
|
30
30
|
export const PROTOCOL_V2_BLE_FILE_CHUNK_SIZE = 1800;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* FirmwareUpdateV4 chunk size for its fixed BLE staging paths.
|
|
33
|
+
* FirmwareUpdateV4 chunk size for its fixed BLE staging paths when writes are serial.
|
|
34
34
|
* The longest current path still leaves 28 bytes below the 2048-byte BLE frame limit.
|
|
35
|
+
* Pipelined writes use PROTOCOL_V2_BLE_FILE_CHUNK_SIZE so two frames fit the UART FIFO.
|
|
35
36
|
*/
|
|
36
37
|
export const PROTOCOL_V2_BLE_FIRMWARE_FILE_CHUNK_SIZE = 1960;
|
|
37
38
|
|
|
@@ -41,6 +42,14 @@ export const PROTOCOL_V2_BLE_FILE_READ_CHUNK_SIZE = 900;
|
|
|
41
42
|
/** Pro2 BLE/UART RX FIFO must hold a complete Proto Link frame. */
|
|
42
43
|
export const PROTOCOL_V2_BLE_FRAME_MAX_BYTES = 2048;
|
|
43
44
|
|
|
45
|
+
/**
|
|
46
|
+
* FilesystemFileWrite frames kept in flight by a file write pipeline. The main MCU copies a
|
|
47
|
+
* complete frame out of its UART FIFO before handling it, but a frame waiting to be parsed and
|
|
48
|
+
* the next one being received can both be resident: two full frames must fit (4096-byte FIFO).
|
|
49
|
+
* With 1800-byte chunks two frames take about 3.75 KB.
|
|
50
|
+
*/
|
|
51
|
+
export const PROTOCOL_V2_FILE_WRITE_PIPELINE_WINDOW = 2;
|
|
52
|
+
|
|
44
53
|
/** @deprecated Use the transport-specific WebUSB or BLE file chunk constant. */
|
|
45
54
|
export const PROTOCOL_V2_FILE_CHUNK_SIZE = PROTOCOL_V2_WEBUSB_FILE_CHUNK_SIZE;
|
|
46
55
|
|