@onekeyfe/hd-transport 1.2.2-alpha.100 → 1.2.2-alpha.102
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/README.md +1 -1
- package/__tests__/messages.test.js +87 -18
- package/__tests__/protocol-v2-link-manager.test.js +70 -0
- package/__tests__/protocol-v2-usb-transport-base.test.js +6 -4
- package/__tests__/protocol-v2.test.js +218 -3
- package/dist/index.d.ts +126 -21
- package/dist/index.js +99 -13
- package/dist/protocols/v2/link-manager.d.ts +1 -0
- package/dist/protocols/v2/link-manager.d.ts.map +1 -1
- package/dist/protocols/v2/session.d.ts +9 -1
- package/dist/protocols/v2/session.d.ts.map +1 -1
- package/dist/types/messages.d.ts +81 -12
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/transport.d.ts +3 -0
- package/dist/types/transport.d.ts.map +1 -1
- package/messages-protocol-v2.json +1591 -1382
- package/package.json +2 -2
- package/src/constants.ts +1 -1
- package/src/protocols/v2/link-manager.ts +46 -5
- package/src/protocols/v2/session.ts +67 -3
- package/src/types/messages.ts +104 -16
- package/src/types/transport.ts +6 -0
package/dist/index.js
CHANGED
|
@@ -995,6 +995,25 @@ function hexToBytes(hex) {
|
|
|
995
995
|
}
|
|
996
996
|
return bytes;
|
|
997
997
|
}
|
|
998
|
+
function detectProtocolV2LinkDisabledError({ schemas, assembler, bytes, }) {
|
|
999
|
+
var _a, _b;
|
|
1000
|
+
try {
|
|
1001
|
+
for (const frame of assembler.drain(bytes)) {
|
|
1002
|
+
const response = call(ProtocolV2.decodeFrame(schemas, frame));
|
|
1003
|
+
if (response.type === 'Failure') {
|
|
1004
|
+
const failureCode = (_a = response.message) === null || _a === void 0 ? void 0 : _a.code;
|
|
1005
|
+
const firmwareMessage = (_b = response.message) === null || _b === void 0 ? void 0 : _b.message;
|
|
1006
|
+
if (isProtocolV2LinkDisabledFailure(failureCode, firmwareMessage)) {
|
|
1007
|
+
return createProtocolV2LinkDisabledError(failureCode, firmwareMessage);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
catch (_c) {
|
|
1013
|
+
assembler.reset();
|
|
1014
|
+
}
|
|
1015
|
+
return undefined;
|
|
1016
|
+
}
|
|
998
1017
|
function bytesToHex(bytes) {
|
|
999
1018
|
return Array.from(bytes)
|
|
1000
1019
|
.map(b => b.toString(16).padStart(2, '0'))
|
|
@@ -1141,8 +1160,10 @@ class ProtocolV2Session {
|
|
|
1141
1160
|
? {}
|
|
1142
1161
|
: { writeWithResponse: callOptions.writeWithResponse })), { generation, signal: abortController.signal });
|
|
1143
1162
|
const runCall = () => __awaiter(this, void 0, void 0, function* () {
|
|
1144
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1145
|
-
|
|
1163
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1164
|
+
if (!this.pendingResponseAfterWrite) {
|
|
1165
|
+
yield (prepareCall === null || prepareCall === void 0 ? void 0 : prepareCall(baseCallContext));
|
|
1166
|
+
}
|
|
1146
1167
|
const protoSeq = this.sequenceCursor.next();
|
|
1147
1168
|
const frame = ProtocolV2.encodeFrame(schemas, name, data, {
|
|
1148
1169
|
packetSrc,
|
|
@@ -1164,6 +1185,12 @@ class ProtocolV2Session {
|
|
|
1164
1185
|
(_b = logger === null || logger === void 0 ? void 0 : logger.error) === null || _b === void 0 ? void 0 : _b.call(logger, `${logPrefix} write metrics callback failed: ${String(error)}`);
|
|
1165
1186
|
}
|
|
1166
1187
|
if (callOptions.returnAfterWrite) {
|
|
1188
|
+
if ((_c = callOptions.expectedTypes) === null || _c === void 0 ? void 0 : _c.length) {
|
|
1189
|
+
this.pendingResponseAfterWrite = {
|
|
1190
|
+
expectedTypes: new Set(callOptions.expectedTypes),
|
|
1191
|
+
onResponse: callOptions.onResponseAfterWrite,
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1167
1194
|
return { type: 'WriteCompleted', message: {} };
|
|
1168
1195
|
}
|
|
1169
1196
|
while (!abortController.signal.aborted) {
|
|
@@ -1208,14 +1235,31 @@ class ProtocolV2Session {
|
|
|
1208
1235
|
}
|
|
1209
1236
|
this.lastResponseSequence = decoded.seq;
|
|
1210
1237
|
const response = call(decoded);
|
|
1211
|
-
|
|
1212
|
-
|
|
1238
|
+
const { pendingResponseAfterWrite } = this;
|
|
1239
|
+
let belongsToWriteOnlyCall = false;
|
|
1240
|
+
if (pendingResponseAfterWrite) {
|
|
1241
|
+
belongsToWriteOnlyCall = pendingResponseAfterWrite.expectedTypes.has(response.type);
|
|
1242
|
+
if (belongsToWriteOnlyCall || COMMON_TERMINAL_RESPONSE_TYPES.has(response.type)) {
|
|
1243
|
+
this.pendingResponseAfterWrite = undefined;
|
|
1244
|
+
if (belongsToWriteOnlyCall) {
|
|
1245
|
+
try {
|
|
1246
|
+
(_d = pendingResponseAfterWrite.onResponse) === null || _d === void 0 ? void 0 : _d.call(pendingResponseAfterWrite, response);
|
|
1247
|
+
}
|
|
1248
|
+
catch (error) {
|
|
1249
|
+
(_e = logger === null || logger === void 0 ? void 0 : logger.error) === null || _e === void 0 ? void 0 : _e.call(logger, `${logPrefix} delayed response callback failed: ${String(error)}`);
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
if (belongsToWriteOnlyCall) ;
|
|
1255
|
+
else if ((_f = callOptions.intermediateTypes) === null || _f === void 0 ? void 0 : _f.includes(response.type)) {
|
|
1256
|
+
(_g = callOptions.onIntermediateResponse) === null || _g === void 0 ? void 0 : _g.call(callOptions, response);
|
|
1213
1257
|
}
|
|
1214
1258
|
else if (isExpectedTerminalResponse(response, callOptions.expectedTypes)) {
|
|
1215
1259
|
return response;
|
|
1216
1260
|
}
|
|
1217
1261
|
else if (!shouldReduceDebug) {
|
|
1218
|
-
(
|
|
1262
|
+
(_h = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _h === void 0 ? void 0 : _h.call(logger, `[${logPrefix}] skip unexpected response for ${name}: expected=${(_j = callOptions.expectedTypes) === null || _j === void 0 ? void 0 : _j.join('|')} got=${response.type}`);
|
|
1219
1263
|
}
|
|
1220
1264
|
}
|
|
1221
1265
|
}
|
|
@@ -1228,7 +1272,7 @@ class ProtocolV2Session {
|
|
|
1228
1272
|
});
|
|
1229
1273
|
}
|
|
1230
1274
|
}
|
|
1231
|
-
function probeProtocolV2({ call, timeoutMs, logger, logPrefix = 'ProtocolV2', onBeforeProbe, onProbeFailed, }) {
|
|
1275
|
+
function probeProtocolV2({ call, timeoutMs, logger, logPrefix = 'ProtocolV2', onBeforeProbe, onProbeFailed, shouldRethrow, }) {
|
|
1232
1276
|
var _a, _b, _c;
|
|
1233
1277
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1234
1278
|
let probeError;
|
|
@@ -1251,7 +1295,7 @@ function probeProtocolV2({ call, timeoutMs, logger, logPrefix = 'ProtocolV2', on
|
|
|
1251
1295
|
probeError = new Error(`unexpected response type ${response.type}`);
|
|
1252
1296
|
}
|
|
1253
1297
|
catch (error) {
|
|
1254
|
-
if (isProtocolV2LinkDisabledError(error)) {
|
|
1298
|
+
if (isProtocolV2LinkDisabledError(error) || (shouldRethrow === null || shouldRethrow === void 0 ? void 0 : shouldRethrow(error))) {
|
|
1255
1299
|
throw error;
|
|
1256
1300
|
}
|
|
1257
1301
|
probeError = error;
|
|
@@ -1273,17 +1317,43 @@ class ProtocolV2LinkManager {
|
|
|
1273
1317
|
this.options = options;
|
|
1274
1318
|
}
|
|
1275
1319
|
call(key, createAdapter, name, data, options) {
|
|
1276
|
-
var _a
|
|
1320
|
+
var _a;
|
|
1277
1321
|
const generation = (_a = this.generations.get(key)) !== null && _a !== void 0 ? _a : 0;
|
|
1322
|
+
const previousQueue = this.callQueues.get(key);
|
|
1323
|
+
const timeoutMs = (options === null || options === void 0 ? void 0 : options.timeoutMs) && options.timeoutMs > 0
|
|
1324
|
+
? options.timeoutMs
|
|
1325
|
+
: PROTOCOL_V2_DEFAULT_RESPONSE_TIMEOUT_MS;
|
|
1326
|
+
const queuedAt = Date.now();
|
|
1327
|
+
let queueTimeout;
|
|
1328
|
+
let queueTimeoutError;
|
|
1329
|
+
const timeoutWhileQueued = new Promise((_, reject) => {
|
|
1330
|
+
queueTimeout = setTimeout(() => {
|
|
1331
|
+
queueTimeout = undefined;
|
|
1332
|
+
queueTimeoutError = this.createQueuedCallTimeoutError(key, name, timeoutMs);
|
|
1333
|
+
reject(queueTimeoutError);
|
|
1334
|
+
}, timeoutMs);
|
|
1335
|
+
});
|
|
1278
1336
|
const run = () => {
|
|
1337
|
+
if (queueTimeout) {
|
|
1338
|
+
clearTimeout(queueTimeout);
|
|
1339
|
+
queueTimeout = undefined;
|
|
1340
|
+
}
|
|
1341
|
+
if (queueTimeoutError) {
|
|
1342
|
+
throw queueTimeoutError;
|
|
1343
|
+
}
|
|
1279
1344
|
this.assertCallGeneration(key, generation);
|
|
1280
|
-
|
|
1345
|
+
const remainingTimeoutMs = previousQueue ? timeoutMs - (Date.now() - queuedAt) : timeoutMs;
|
|
1346
|
+
if (remainingTimeoutMs <= 0) {
|
|
1347
|
+
throw this.createQueuedCallTimeoutError(key, name, timeoutMs);
|
|
1348
|
+
}
|
|
1349
|
+
return this.executeCall(key, createAdapter, name, data, Object.assign(Object.assign({}, options), { timeoutMs: remainingTimeoutMs }));
|
|
1281
1350
|
};
|
|
1282
|
-
const previous =
|
|
1283
|
-
const
|
|
1284
|
-
const
|
|
1351
|
+
const previous = previousQueue !== null && previousQueue !== void 0 ? previousQueue : Promise.resolve();
|
|
1352
|
+
const execution = previous.then(run, run);
|
|
1353
|
+
const result = Promise.race([execution, timeoutWhileQueued]);
|
|
1354
|
+
const queue = execution.catch(() => undefined);
|
|
1285
1355
|
this.callQueues.set(key, queue);
|
|
1286
|
-
|
|
1356
|
+
execution
|
|
1287
1357
|
.then(() => this.clearSettledCallQueue(key, queue), () => this.clearSettledCallQueue(key, queue))
|
|
1288
1358
|
.catch(() => undefined);
|
|
1289
1359
|
return result;
|
|
@@ -1408,6 +1478,13 @@ class ProtocolV2LinkManager {
|
|
|
1408
1478
|
this.callQueues.delete(key);
|
|
1409
1479
|
}
|
|
1410
1480
|
}
|
|
1481
|
+
createQueuedCallTimeoutError(key, name, timeoutMs) {
|
|
1482
|
+
var _a;
|
|
1483
|
+
const adapterTimeoutError = (_a = this.links.get(key)) === null || _a === void 0 ? void 0 : _a.adapter.createTimeoutError;
|
|
1484
|
+
return adapterTimeoutError
|
|
1485
|
+
? adapterTimeoutError(name, timeoutMs)
|
|
1486
|
+
: new ProtocolV2LinkError('response-timeout', `Protocol V2 call timeout after ${timeoutMs}ms while queued for ${name}`);
|
|
1487
|
+
}
|
|
1411
1488
|
assertCallGeneration(key, generation) {
|
|
1412
1489
|
var _a;
|
|
1413
1490
|
const currentGeneration = (_a = this.generations.get(key)) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -1953,6 +2030,7 @@ exports.NEMImportanceTransferMode = void 0;
|
|
|
1953
2030
|
exports.SolanaOffChainMessageVersion = void 0;
|
|
1954
2031
|
(function (SolanaOffChainMessageVersion) {
|
|
1955
2032
|
SolanaOffChainMessageVersion[SolanaOffChainMessageVersion["MESSAGE_VERSION_0"] = 0] = "MESSAGE_VERSION_0";
|
|
2033
|
+
SolanaOffChainMessageVersion[SolanaOffChainMessageVersion["MESSAGE_VERSION_1"] = 1] = "MESSAGE_VERSION_1";
|
|
1956
2034
|
})(exports.SolanaOffChainMessageVersion || (exports.SolanaOffChainMessageVersion = {}));
|
|
1957
2035
|
exports.SolanaOffChainMessageFormat = void 0;
|
|
1958
2036
|
(function (SolanaOffChainMessageFormat) {
|
|
@@ -2105,6 +2183,12 @@ exports.DeviceFirmwareUpdateTaskStatus = void 0;
|
|
|
2105
2183
|
DeviceFirmwareUpdateTaskStatus[DeviceFirmwareUpdateTaskStatus["FW_MGMT_UPDATER_TASK_STATUS_FAILED_BUSY"] = 9] = "FW_MGMT_UPDATER_TASK_STATUS_FAILED_BUSY";
|
|
2106
2184
|
DeviceFirmwareUpdateTaskStatus[DeviceFirmwareUpdateTaskStatus["FW_MGMT_UPDATER_TASK_STATUS_FAILED_ENTRY_OUT_OF_BOUNDS"] = 10] = "FW_MGMT_UPDATER_TASK_STATUS_FAILED_ENTRY_OUT_OF_BOUNDS";
|
|
2107
2185
|
})(exports.DeviceFirmwareUpdateTaskStatus || (exports.DeviceFirmwareUpdateTaskStatus = {}));
|
|
2186
|
+
exports.DeviceFirmwareUpdatePhase = void 0;
|
|
2187
|
+
(function (DeviceFirmwareUpdatePhase) {
|
|
2188
|
+
DeviceFirmwareUpdatePhase[DeviceFirmwareUpdatePhase["FW_MGMT_UPDATER_PHASE_PREPARE"] = 0] = "FW_MGMT_UPDATER_PHASE_PREPARE";
|
|
2189
|
+
DeviceFirmwareUpdatePhase[DeviceFirmwareUpdatePhase["FW_MGMT_UPDATER_PHASE_INSTALL"] = 1] = "FW_MGMT_UPDATER_PHASE_INSTALL";
|
|
2190
|
+
DeviceFirmwareUpdatePhase[DeviceFirmwareUpdatePhase["FW_MGMT_UPDATER_PHASE_VERIFY"] = 2] = "FW_MGMT_UPDATER_PHASE_VERIFY";
|
|
2191
|
+
})(exports.DeviceFirmwareUpdatePhase || (exports.DeviceFirmwareUpdatePhase = {}));
|
|
2108
2192
|
exports.DeviceType = void 0;
|
|
2109
2193
|
(function (DeviceType) {
|
|
2110
2194
|
DeviceType[DeviceType["CLASSIC1"] = 0] = "CLASSIC1";
|
|
@@ -2312,6 +2396,7 @@ var messages = /*#__PURE__*/Object.freeze({
|
|
|
2312
2396
|
get DeviceFactoryAck () { return exports.DeviceFactoryAck; },
|
|
2313
2397
|
get DeviceFirmwareTargetType () { return exports.DeviceFirmwareTargetType; },
|
|
2314
2398
|
get DeviceFirmwareUpdateTaskStatus () { return exports.DeviceFirmwareUpdateTaskStatus; },
|
|
2399
|
+
get DeviceFirmwareUpdatePhase () { return exports.DeviceFirmwareUpdatePhase; },
|
|
2315
2400
|
get DeviceType () { return exports.DeviceType; },
|
|
2316
2401
|
get DeviceSeType () { return exports.DeviceSeType; },
|
|
2317
2402
|
get DeviceSEState () { return exports.DeviceSEState; },
|
|
@@ -2472,6 +2557,7 @@ exports.concatUint8Arrays = concatUint8Arrays;
|
|
|
2472
2557
|
exports.createProtocolV2LinkDisabledError = createProtocolV2LinkDisabledError;
|
|
2473
2558
|
exports.createTransportCallLog = createTransportCallLog;
|
|
2474
2559
|
exports["default"] = index;
|
|
2560
|
+
exports.detectProtocolV2LinkDisabledError = detectProtocolV2LinkDisabledError;
|
|
2475
2561
|
exports.getErrorMessage = getErrorMessage;
|
|
2476
2562
|
exports.getSafeTransportLogPayload = getSafeTransportLogPayload;
|
|
2477
2563
|
exports.hexToBytes = hexToBytes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-manager.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/link-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"link-manager.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/link-manager.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAEpG,MAAM,MAAM,iCAAiC,GAAG,YAAY,GAAG,aAAa,CAAC;AAE7E,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAClE,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E,SAA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,EAAE,GAAG,EACR,aAAa,EAAE,MAAM,qBAAqB,EAC1C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,iBAAiB,CAAC;IAMvB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BvD,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASjD,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5C,OAAO,CAAC,eAAe;YA+CT,WAAW;IAkBzB,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,4BAA4B;IAUpC,OAAO,CAAC,oBAAoB;CAW7B"}
|
|
@@ -40,11 +40,17 @@ export type ProtocolV2CallOptions = {
|
|
|
40
40
|
onIntermediateResponse?: (response: MessageFromOneKey) => void;
|
|
41
41
|
onWriteCompleted?: (metrics: TransportWriteMetrics) => void;
|
|
42
42
|
returnAfterWrite?: boolean;
|
|
43
|
+
onResponseAfterWrite?: (response: MessageFromOneKey) => void;
|
|
43
44
|
writeWithResponse?: boolean;
|
|
44
45
|
};
|
|
45
46
|
export { concatUint8Arrays, ProtocolV2FrameAssembler };
|
|
46
47
|
export { ProtocolV2SequenceCursor };
|
|
47
48
|
export declare function hexToBytes(hex: string): Uint8Array;
|
|
49
|
+
export declare function detectProtocolV2LinkDisabledError({ schemas, assembler, bytes, }: {
|
|
50
|
+
schemas: ProtocolV2Schemas;
|
|
51
|
+
assembler: ProtocolV2FrameAssembler;
|
|
52
|
+
bytes: Uint8Array;
|
|
53
|
+
}): import("./errors").ProtocolV2LinkDisabledError | undefined;
|
|
48
54
|
export declare function bytesToHex(bytes: Uint8Array): string;
|
|
49
55
|
export declare function isProtocolV2HighThroughputCall(name: string): boolean;
|
|
50
56
|
export declare function getErrorMessage(error: unknown): string;
|
|
@@ -54,6 +60,7 @@ export declare class ProtocolV2Session {
|
|
|
54
60
|
private readonly sequenceCursor;
|
|
55
61
|
private pendingCall;
|
|
56
62
|
private pendingWrite;
|
|
63
|
+
private pendingResponseAfterWrite?;
|
|
57
64
|
private lastResponseSequence?;
|
|
58
65
|
constructor(options: ProtocolV2SessionOptions);
|
|
59
66
|
call(name: string, data: Record<string, unknown>, callOptions?: ProtocolV2CallOptions): Promise<MessageFromOneKey>;
|
|
@@ -61,12 +68,13 @@ export declare class ProtocolV2Session {
|
|
|
61
68
|
private serializeWrite;
|
|
62
69
|
private executeCall;
|
|
63
70
|
}
|
|
64
|
-
export declare function probeProtocolV2({ call, timeoutMs, logger, logPrefix, onBeforeProbe, onProbeFailed, }: {
|
|
71
|
+
export declare function probeProtocolV2({ call, timeoutMs, logger, logPrefix, onBeforeProbe, onProbeFailed, shouldRethrow, }: {
|
|
65
72
|
call: (name: string, data: Record<string, unknown>, options?: ProtocolV2CallOptions) => Promise<MessageFromOneKey>;
|
|
66
73
|
timeoutMs: number;
|
|
67
74
|
logger?: ProtocolLogger;
|
|
68
75
|
logPrefix?: string;
|
|
69
76
|
onBeforeProbe?: () => Promise<void> | void;
|
|
70
77
|
onProbeFailed?: (error: unknown) => Promise<void> | void;
|
|
78
|
+
shouldRethrow?: (error: unknown) => boolean;
|
|
71
79
|
}): Promise<boolean>;
|
|
72
80
|
//# sourceMappingURL=session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/session.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAW7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CA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E,OAAO,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAmCxF,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,WAAW;CAiMpB;AAED,wBAAsB,eAAe,CAAC,EACpC,IAAI,EACJ,SAAS,EACT,MAAM,EACN,SAAwB,EACxB,aAAa,EACb,aAAa,EACb,aAAa,GACd,EAAE;IACD,IAAI,EAAE,CACJ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,qBAAqB,KAC5B,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC3C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACzD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CAC7C,oBAiCA"}
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1455,6 +1455,7 @@ export type EthereumSignTxOneKey = {
|
|
|
1455
1455
|
data_length?: number;
|
|
1456
1456
|
chain_id: number;
|
|
1457
1457
|
tx_type?: number;
|
|
1458
|
+
expected_address?: string;
|
|
1458
1459
|
};
|
|
1459
1460
|
export type EthereumAccessListOneKey = {
|
|
1460
1461
|
address: string;
|
|
@@ -1472,6 +1473,7 @@ export type EthereumSignTxEIP1559OneKey = {
|
|
|
1472
1473
|
data_length: number;
|
|
1473
1474
|
chain_id: number;
|
|
1474
1475
|
access_list: EthereumAccessListOneKey[];
|
|
1476
|
+
expected_address?: string;
|
|
1475
1477
|
};
|
|
1476
1478
|
export type EthereumAuthorizationSignature = {
|
|
1477
1479
|
y_parity: number;
|
|
@@ -2850,7 +2852,8 @@ export type SolanaSignedTx = {
|
|
|
2850
2852
|
signature?: string;
|
|
2851
2853
|
};
|
|
2852
2854
|
export declare enum SolanaOffChainMessageVersion {
|
|
2853
|
-
MESSAGE_VERSION_0 = 0
|
|
2855
|
+
MESSAGE_VERSION_0 = 0,
|
|
2856
|
+
MESSAGE_VERSION_1 = 1
|
|
2854
2857
|
}
|
|
2855
2858
|
export declare enum SolanaOffChainMessageFormat {
|
|
2856
2859
|
V0_RESTRICTED_ASCII = 0,
|
|
@@ -2862,6 +2865,7 @@ export type SolanaSignOffChainMessage = {
|
|
|
2862
2865
|
message_version?: SolanaOffChainMessageVersion;
|
|
2863
2866
|
message_format?: SolanaOffChainMessageFormat;
|
|
2864
2867
|
application_domain?: string;
|
|
2868
|
+
required_signers: string[];
|
|
2865
2869
|
};
|
|
2866
2870
|
export type SolanaSignUnsafeMessage = {
|
|
2867
2871
|
address_n: number[];
|
|
@@ -3412,8 +3416,6 @@ export declare enum CommandFlags {
|
|
|
3412
3416
|
Default = 0,
|
|
3413
3417
|
Factory_Only = 1
|
|
3414
3418
|
}
|
|
3415
|
-
export type experimental_message = {};
|
|
3416
|
-
export type experimental_field = {};
|
|
3417
3419
|
export type TextMemo = {
|
|
3418
3420
|
text: string;
|
|
3419
3421
|
};
|
|
@@ -3489,6 +3491,8 @@ export type UiAnimationRequest = {
|
|
|
3489
3491
|
command: UiAnimationCommand;
|
|
3490
3492
|
type?: UiAnimationType;
|
|
3491
3493
|
};
|
|
3494
|
+
export type experimental_message = {};
|
|
3495
|
+
export type experimental_field = {};
|
|
3492
3496
|
export type ProtocolInfoRequest = {
|
|
3493
3497
|
eventless_wallet_session?: boolean;
|
|
3494
3498
|
};
|
|
@@ -3566,6 +3570,13 @@ export type DeviceCertificateSign = {
|
|
|
3566
3570
|
export type DeviceMiscUsbMscControl = {
|
|
3567
3571
|
enable: boolean;
|
|
3568
3572
|
};
|
|
3573
|
+
export type DeviceFindMyTokenUpdate = {
|
|
3574
|
+
token: string;
|
|
3575
|
+
};
|
|
3576
|
+
export type DeviceFindMyTokenStateGet = {};
|
|
3577
|
+
export type DeviceFindMyTokenState = {
|
|
3578
|
+
burned: boolean;
|
|
3579
|
+
};
|
|
3569
3580
|
export declare enum DeviceFactoryAck {
|
|
3570
3581
|
FACTORY_ACK_SUCCESS = 0,
|
|
3571
3582
|
FACTORY_ACK_FAIL = 1
|
|
@@ -3584,11 +3595,15 @@ export type DeviceFactoryInfo = {
|
|
|
3584
3595
|
factory_test_completed?: boolean;
|
|
3585
3596
|
factory_burn_in_completed?: boolean;
|
|
3586
3597
|
manufacture_time?: DeviceFactoryInfoManufactureTime;
|
|
3598
|
+
data?: string;
|
|
3587
3599
|
};
|
|
3588
3600
|
export type DeviceFactoryInfoSet = {
|
|
3589
3601
|
info: DeviceFactoryInfo;
|
|
3602
|
+
full_data?: boolean;
|
|
3603
|
+
};
|
|
3604
|
+
export type DeviceFactoryInfoGet = {
|
|
3605
|
+
full_data?: boolean;
|
|
3590
3606
|
};
|
|
3591
|
-
export type DeviceFactoryInfoGet = {};
|
|
3592
3607
|
export type DeviceFactoryPermanentLock = {
|
|
3593
3608
|
check_a: string;
|
|
3594
3609
|
check_b: string;
|
|
@@ -3622,6 +3637,11 @@ export declare enum DeviceFirmwareUpdateTaskStatus {
|
|
|
3622
3637
|
FW_MGMT_UPDATER_TASK_STATUS_FAILED_BUSY = 9,
|
|
3623
3638
|
FW_MGMT_UPDATER_TASK_STATUS_FAILED_ENTRY_OUT_OF_BOUNDS = 10
|
|
3624
3639
|
}
|
|
3640
|
+
export declare enum DeviceFirmwareUpdatePhase {
|
|
3641
|
+
FW_MGMT_UPDATER_PHASE_PREPARE = 0,
|
|
3642
|
+
FW_MGMT_UPDATER_PHASE_INSTALL = 1,
|
|
3643
|
+
FW_MGMT_UPDATER_PHASE_VERIFY = 2
|
|
3644
|
+
}
|
|
3625
3645
|
export type DeviceFirmwareTarget = {
|
|
3626
3646
|
target_id: DeviceFirmwareTargetType;
|
|
3627
3647
|
path: string;
|
|
@@ -3629,15 +3649,25 @@ export type DeviceFirmwareTarget = {
|
|
|
3629
3649
|
export type DeviceFirmwareUpdateStage = {
|
|
3630
3650
|
targets: DeviceFirmwareTarget[];
|
|
3631
3651
|
};
|
|
3632
|
-
export type DeviceFirmwareUpdateRequest = {
|
|
3652
|
+
export type DeviceFirmwareUpdateRequest = {
|
|
3653
|
+
reboot_after_update?: boolean;
|
|
3654
|
+
};
|
|
3655
|
+
export type DeviceFirmwareUpdatePhaseInfo = {
|
|
3656
|
+
phase: DeviceFirmwareUpdatePhase;
|
|
3657
|
+
progress_percent: number;
|
|
3658
|
+
};
|
|
3633
3659
|
export type DeviceFirmwareUpdateRecord = {
|
|
3634
3660
|
target_id: DeviceFirmwareTargetType;
|
|
3635
3661
|
status?: DeviceFirmwareUpdateTaskStatus;
|
|
3662
|
+
progress_percent?: number;
|
|
3663
|
+
phase_info?: DeviceFirmwareUpdatePhaseInfo;
|
|
3636
3664
|
payload_version?: number;
|
|
3637
3665
|
path?: string;
|
|
3638
3666
|
};
|
|
3639
3667
|
export type DeviceFirmwareUpdateRecordFields = {
|
|
3640
3668
|
status?: boolean;
|
|
3669
|
+
progress_percent?: boolean;
|
|
3670
|
+
phase_info?: boolean;
|
|
3641
3671
|
payload_version?: boolean;
|
|
3642
3672
|
path?: boolean;
|
|
3643
3673
|
};
|
|
@@ -3739,11 +3769,11 @@ export declare enum DeviceSessionSeedDomain {
|
|
|
3739
3769
|
export type DeviceSessionGet = {
|
|
3740
3770
|
session_id?: string;
|
|
3741
3771
|
btc_test_address?: string;
|
|
3742
|
-
seed_domains: DeviceSessionSeedDomain[];
|
|
3743
3772
|
};
|
|
3744
3773
|
export type DeviceSession = {
|
|
3745
3774
|
session_id?: string;
|
|
3746
3775
|
btc_test_address?: string;
|
|
3776
|
+
seed_domains: DeviceSessionSeedDomain[];
|
|
3747
3777
|
};
|
|
3748
3778
|
export declare enum DeviceSessionPinType {
|
|
3749
3779
|
Any = 1,
|
|
@@ -3756,6 +3786,7 @@ export type DeviceSessionAskPin = {
|
|
|
3756
3786
|
export type DeviceSessionAskPassphrase = {
|
|
3757
3787
|
passphrase?: string;
|
|
3758
3788
|
on_device: boolean;
|
|
3789
|
+
seed_domains: DeviceSessionSeedDomain[];
|
|
3759
3790
|
};
|
|
3760
3791
|
export declare enum DeviceSessionAskPin_FailureSubCodes {
|
|
3761
3792
|
UserCancel = 1
|
|
@@ -3897,6 +3928,10 @@ export type ViewDetail = {
|
|
|
3897
3928
|
is_overview: boolean;
|
|
3898
3929
|
has_icon: boolean;
|
|
3899
3930
|
};
|
|
3931
|
+
export type ViewCustomField = {
|
|
3932
|
+
key: string;
|
|
3933
|
+
value: string;
|
|
3934
|
+
};
|
|
3900
3935
|
export declare enum ViewTipType {
|
|
3901
3936
|
Default = 0,
|
|
3902
3937
|
Highlight = 1,
|
|
@@ -3908,10 +3943,25 @@ export type ViewTip = {
|
|
|
3908
3943
|
type: ViewTipType;
|
|
3909
3944
|
text?: string;
|
|
3910
3945
|
text_id?: number;
|
|
3946
|
+
text_arg?: string;
|
|
3911
3947
|
};
|
|
3912
|
-
export type
|
|
3948
|
+
export type ViewActionCard = {
|
|
3913
3949
|
initial_data: string;
|
|
3914
|
-
|
|
3950
|
+
};
|
|
3951
|
+
export type ViewContentPreview = {
|
|
3952
|
+
content_key: number;
|
|
3953
|
+
preview: string;
|
|
3954
|
+
total_bytes?: number;
|
|
3955
|
+
};
|
|
3956
|
+
export type ViewContentEntry = {
|
|
3957
|
+
entry_key: number;
|
|
3958
|
+
value: string;
|
|
3959
|
+
};
|
|
3960
|
+
export type ViewContentPage = {
|
|
3961
|
+
page_index: number;
|
|
3962
|
+
page_count: number;
|
|
3963
|
+
chunk?: string;
|
|
3964
|
+
entry?: ViewContentEntry;
|
|
3915
3965
|
};
|
|
3916
3966
|
export declare enum ViewSignLayout {
|
|
3917
3967
|
LayoutDefault = 0,
|
|
@@ -3926,10 +3976,19 @@ export type ViewSignPage = {
|
|
|
3926
3976
|
amount?: UintType;
|
|
3927
3977
|
general: ViewDetail[];
|
|
3928
3978
|
tip?: ViewTip;
|
|
3929
|
-
|
|
3979
|
+
action_card?: ViewActionCard;
|
|
3930
3980
|
slide_to_confirm?: boolean;
|
|
3931
3981
|
layout?: ViewSignLayout;
|
|
3932
3982
|
title_id?: number;
|
|
3983
|
+
title_arg?: string;
|
|
3984
|
+
content?: ViewContentPreview;
|
|
3985
|
+
custom_field?: ViewCustomField;
|
|
3986
|
+
};
|
|
3987
|
+
export type ViewWarningPage = {
|
|
3988
|
+
title_id: number;
|
|
3989
|
+
text_id: number;
|
|
3990
|
+
text_arg?: string;
|
|
3991
|
+
cancellable?: boolean;
|
|
3933
3992
|
};
|
|
3934
3993
|
export type ViewVerifyPage = {
|
|
3935
3994
|
title?: string;
|
|
@@ -3940,6 +3999,7 @@ export type ViewVerifyPage = {
|
|
|
3940
3999
|
value_key?: number;
|
|
3941
4000
|
title_id?: number;
|
|
3942
4001
|
chain_id?: number;
|
|
4002
|
+
content?: ViewContentPreview;
|
|
3943
4003
|
};
|
|
3944
4004
|
export declare enum ProtocolV2FailureType {
|
|
3945
4005
|
Failure_InvalidMessage = 1,
|
|
@@ -4535,8 +4595,6 @@ export type MessageType = {
|
|
|
4535
4595
|
TronSignMessage: TronSignMessage;
|
|
4536
4596
|
TronMessageSignature: TronMessageSignature;
|
|
4537
4597
|
facotry: facotry;
|
|
4538
|
-
experimental_message: experimental_message;
|
|
4539
|
-
experimental_field: experimental_field;
|
|
4540
4598
|
TextMemo: TextMemo;
|
|
4541
4599
|
RefundMemo: RefundMemo;
|
|
4542
4600
|
CoinPurchaseMemo: CoinPurchaseMemo;
|
|
@@ -4552,6 +4610,8 @@ export type MessageType = {
|
|
|
4552
4610
|
UnlockPath: UnlockPath;
|
|
4553
4611
|
UnlockedPathRequest: UnlockedPathRequest;
|
|
4554
4612
|
UiAnimationRequest: UiAnimationRequest;
|
|
4613
|
+
experimental_message: experimental_message;
|
|
4614
|
+
experimental_field: experimental_field;
|
|
4555
4615
|
ProtocolInfoRequest: ProtocolInfoRequest;
|
|
4556
4616
|
ProtocolInfo: ProtocolInfo;
|
|
4557
4617
|
DeviceReboot: DeviceReboot;
|
|
@@ -4565,6 +4625,9 @@ export type MessageType = {
|
|
|
4565
4625
|
DeviceCertificateSignature: DeviceCertificateSignature;
|
|
4566
4626
|
DeviceCertificateSign: DeviceCertificateSign;
|
|
4567
4627
|
DeviceMiscUsbMscControl: DeviceMiscUsbMscControl;
|
|
4628
|
+
DeviceFindMyTokenUpdate: DeviceFindMyTokenUpdate;
|
|
4629
|
+
DeviceFindMyTokenStateGet: DeviceFindMyTokenStateGet;
|
|
4630
|
+
DeviceFindMyTokenState: DeviceFindMyTokenState;
|
|
4568
4631
|
DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
|
|
4569
4632
|
DeviceFactoryInfo: DeviceFactoryInfo;
|
|
4570
4633
|
DeviceFactoryInfoSet: DeviceFactoryInfoSet;
|
|
@@ -4574,6 +4637,7 @@ export type MessageType = {
|
|
|
4574
4637
|
DeviceFirmwareTarget: DeviceFirmwareTarget;
|
|
4575
4638
|
DeviceFirmwareUpdateStage: DeviceFirmwareUpdateStage;
|
|
4576
4639
|
DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
|
|
4640
|
+
DeviceFirmwareUpdatePhaseInfo: DeviceFirmwareUpdatePhaseInfo;
|
|
4577
4641
|
DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
|
|
4578
4642
|
DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
|
|
4579
4643
|
DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
|
|
@@ -4612,9 +4676,14 @@ export type MessageType = {
|
|
|
4612
4676
|
PortfolioUpdate: PortfolioUpdate;
|
|
4613
4677
|
ViewAmount: ViewAmount;
|
|
4614
4678
|
ViewDetail: ViewDetail;
|
|
4679
|
+
ViewCustomField: ViewCustomField;
|
|
4615
4680
|
ViewTip: ViewTip;
|
|
4616
|
-
|
|
4681
|
+
ViewActionCard: ViewActionCard;
|
|
4682
|
+
ViewContentPreview: ViewContentPreview;
|
|
4683
|
+
ViewContentEntry: ViewContentEntry;
|
|
4684
|
+
ViewContentPage: ViewContentPage;
|
|
4617
4685
|
ViewSignPage: ViewSignPage;
|
|
4686
|
+
ViewWarningPage: ViewWarningPage;
|
|
4618
4687
|
ViewVerifyPage: ViewVerifyPage;
|
|
4619
4688
|
};
|
|
4620
4689
|
export type MessageKey = keyof MessageType;
|