@onekeyfe/hd-transport 1.2.2-alpha.100 → 1.2.2-alpha.101

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/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
- yield (prepareCall === null || prepareCall === void 0 ? void 0 : prepareCall(baseCallContext));
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
- if ((_c = callOptions.intermediateTypes) === null || _c === void 0 ? void 0 : _c.includes(response.type)) {
1212
- (_d = callOptions.onIntermediateResponse) === null || _d === void 0 ? void 0 : _d.call(callOptions, response);
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
- (_e = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _e === void 0 ? void 0 : _e.call(logger, `[${logPrefix}] skip unexpected response for ${name}: expected=${(_f = callOptions.expectedTypes) === null || _f === void 0 ? void 0 : _f.join('|')} got=${response.type}`);
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, _b;
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
- return this.executeCall(key, createAdapter, name, data, options);
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 = (_b = this.callQueues.get(key)) !== null && _b !== void 0 ? _b : Promise.resolve();
1283
- const result = previous.then(run, run);
1284
- const queue = result.catch(() => undefined);
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
- result
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;
@@ -35,6 +35,7 @@ export declare class ProtocolV2LinkManager<Key> {
35
35
  private getOrCreateLink;
36
36
  private executeCall;
37
37
  private clearSettledCallQueue;
38
+ private createQueuedCallTimeoutError;
38
39
  private assertCallGeneration;
39
40
  }
40
41
  //# sourceMappingURL=link-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"link-manager.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/link-manager.ts"],"names":[],"mappings":"AAIA,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,SAAS,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/D,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5C,MAAM,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IAC5C,SAAS,CAAC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AAM,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,CAAC;AAE5E,cAAc,UAAU,CAAC;AAEzB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACjC,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,iBAAiB,CA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,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"}
@@ -1455,6 +1455,8 @@ export type EthereumSignTxOneKey = {
1455
1455
  data_length?: number;
1456
1456
  chain_id: number;
1457
1457
  tx_type?: number;
1458
+ expected_address?: string;
1459
+ source_fingerprint?: number;
1458
1460
  };
1459
1461
  export type EthereumAccessListOneKey = {
1460
1462
  address: string;
@@ -1472,6 +1474,8 @@ export type EthereumSignTxEIP1559OneKey = {
1472
1474
  data_length: number;
1473
1475
  chain_id: number;
1474
1476
  access_list: EthereumAccessListOneKey[];
1477
+ expected_address?: string;
1478
+ source_fingerprint?: number;
1475
1479
  };
1476
1480
  export type EthereumAuthorizationSignature = {
1477
1481
  y_parity: number;
@@ -1513,6 +1517,7 @@ export type EthereumSignMessageOneKey = {
1513
1517
  address_n: number[];
1514
1518
  message: string;
1515
1519
  chain_id?: number;
1520
+ source_fingerprint?: number;
1516
1521
  };
1517
1522
  export type EthereumMessageSignatureOneKey = {
1518
1523
  signature: string;
@@ -2845,12 +2850,14 @@ export type SolanaSignTx = {
2845
2850
  address_n: number[];
2846
2851
  raw_tx: string;
2847
2852
  extra_info?: SolanaTxExtraInfo;
2853
+ source_fingerprint?: number;
2848
2854
  };
2849
2855
  export type SolanaSignedTx = {
2850
2856
  signature?: string;
2851
2857
  };
2852
2858
  export declare enum SolanaOffChainMessageVersion {
2853
- MESSAGE_VERSION_0 = 0
2859
+ MESSAGE_VERSION_0 = 0,
2860
+ MESSAGE_VERSION_1 = 1
2854
2861
  }
2855
2862
  export declare enum SolanaOffChainMessageFormat {
2856
2863
  V0_RESTRICTED_ASCII = 0,
@@ -2862,10 +2869,13 @@ export type SolanaSignOffChainMessage = {
2862
2869
  message_version?: SolanaOffChainMessageVersion;
2863
2870
  message_format?: SolanaOffChainMessageFormat;
2864
2871
  application_domain?: string;
2872
+ required_signers: string[];
2873
+ source_fingerprint?: number;
2865
2874
  };
2866
2875
  export type SolanaSignUnsafeMessage = {
2867
2876
  address_n: number[];
2868
2877
  message: string;
2878
+ source_fingerprint?: number;
2869
2879
  };
2870
2880
  export type SolanaMessageSignature = {
2871
2881
  signature: string;
@@ -3412,8 +3422,6 @@ export declare enum CommandFlags {
3412
3422
  Default = 0,
3413
3423
  Factory_Only = 1
3414
3424
  }
3415
- export type experimental_message = {};
3416
- export type experimental_field = {};
3417
3425
  export type TextMemo = {
3418
3426
  text: string;
3419
3427
  };
@@ -3445,6 +3453,7 @@ export type EthereumSignTypedDataQR = {
3445
3453
  chain_id?: number;
3446
3454
  metamask_v4_compat?: boolean;
3447
3455
  request_id?: string;
3456
+ source_fingerprint?: number;
3448
3457
  };
3449
3458
  export type SetBusy = {
3450
3459
  expiry_ms?: number;
@@ -3489,6 +3498,8 @@ export type UiAnimationRequest = {
3489
3498
  command: UiAnimationCommand;
3490
3499
  type?: UiAnimationType;
3491
3500
  };
3501
+ export type experimental_message = {};
3502
+ export type experimental_field = {};
3492
3503
  export type ProtocolInfoRequest = {
3493
3504
  eventless_wallet_session?: boolean;
3494
3505
  };
@@ -3566,6 +3577,13 @@ export type DeviceCertificateSign = {
3566
3577
  export type DeviceMiscUsbMscControl = {
3567
3578
  enable: boolean;
3568
3579
  };
3580
+ export type DeviceFindMyTokenUpdate = {
3581
+ token: string;
3582
+ };
3583
+ export type DeviceFindMyTokenStateGet = {};
3584
+ export type DeviceFindMyTokenState = {
3585
+ burned: boolean;
3586
+ };
3569
3587
  export declare enum DeviceFactoryAck {
3570
3588
  FACTORY_ACK_SUCCESS = 0,
3571
3589
  FACTORY_ACK_FAIL = 1
@@ -3622,6 +3640,11 @@ export declare enum DeviceFirmwareUpdateTaskStatus {
3622
3640
  FW_MGMT_UPDATER_TASK_STATUS_FAILED_BUSY = 9,
3623
3641
  FW_MGMT_UPDATER_TASK_STATUS_FAILED_ENTRY_OUT_OF_BOUNDS = 10
3624
3642
  }
3643
+ export declare enum DeviceFirmwareUpdatePhase {
3644
+ FW_MGMT_UPDATER_PHASE_PREPARE = 0,
3645
+ FW_MGMT_UPDATER_PHASE_INSTALL = 1,
3646
+ FW_MGMT_UPDATER_PHASE_VERIFY = 2
3647
+ }
3625
3648
  export type DeviceFirmwareTarget = {
3626
3649
  target_id: DeviceFirmwareTargetType;
3627
3650
  path: string;
@@ -3629,15 +3652,25 @@ export type DeviceFirmwareTarget = {
3629
3652
  export type DeviceFirmwareUpdateStage = {
3630
3653
  targets: DeviceFirmwareTarget[];
3631
3654
  };
3632
- export type DeviceFirmwareUpdateRequest = {};
3655
+ export type DeviceFirmwareUpdateRequest = {
3656
+ reboot_after_update?: boolean;
3657
+ };
3658
+ export type DeviceFirmwareUpdatePhaseInfo = {
3659
+ phase: DeviceFirmwareUpdatePhase;
3660
+ progress_percent: number;
3661
+ };
3633
3662
  export type DeviceFirmwareUpdateRecord = {
3634
3663
  target_id: DeviceFirmwareTargetType;
3635
3664
  status?: DeviceFirmwareUpdateTaskStatus;
3665
+ progress_percent?: number;
3666
+ phase_info?: DeviceFirmwareUpdatePhaseInfo;
3636
3667
  payload_version?: number;
3637
3668
  path?: string;
3638
3669
  };
3639
3670
  export type DeviceFirmwareUpdateRecordFields = {
3640
3671
  status?: boolean;
3672
+ progress_percent?: boolean;
3673
+ phase_info?: boolean;
3641
3674
  payload_version?: boolean;
3642
3675
  path?: boolean;
3643
3676
  };
@@ -3739,11 +3772,11 @@ export declare enum DeviceSessionSeedDomain {
3739
3772
  export type DeviceSessionGet = {
3740
3773
  session_id?: string;
3741
3774
  btc_test_address?: string;
3742
- seed_domains: DeviceSessionSeedDomain[];
3743
3775
  };
3744
3776
  export type DeviceSession = {
3745
3777
  session_id?: string;
3746
3778
  btc_test_address?: string;
3779
+ seed_domains: DeviceSessionSeedDomain[];
3747
3780
  };
3748
3781
  export declare enum DeviceSessionPinType {
3749
3782
  Any = 1,
@@ -3756,6 +3789,7 @@ export type DeviceSessionAskPin = {
3756
3789
  export type DeviceSessionAskPassphrase = {
3757
3790
  passphrase?: string;
3758
3791
  on_device: boolean;
3792
+ seed_domains: DeviceSessionSeedDomain[];
3759
3793
  };
3760
3794
  export declare enum DeviceSessionAskPin_FailureSubCodes {
3761
3795
  UserCancel = 1
@@ -3897,6 +3931,10 @@ export type ViewDetail = {
3897
3931
  is_overview: boolean;
3898
3932
  has_icon: boolean;
3899
3933
  };
3934
+ export type ViewCustomField = {
3935
+ key: string;
3936
+ value: string;
3937
+ };
3900
3938
  export declare enum ViewTipType {
3901
3939
  Default = 0,
3902
3940
  Highlight = 1,
@@ -3908,10 +3946,25 @@ export type ViewTip = {
3908
3946
  type: ViewTipType;
3909
3947
  text?: string;
3910
3948
  text_id?: number;
3949
+ text_arg?: string;
3911
3950
  };
3912
- export type ViewRawData = {
3951
+ export type ViewActionCard = {
3913
3952
  initial_data: string;
3914
- placeholder: number;
3953
+ };
3954
+ export type ViewContentPreview = {
3955
+ content_key: number;
3956
+ preview: string;
3957
+ total_bytes?: number;
3958
+ };
3959
+ export type ViewContentEntry = {
3960
+ entry_key: number;
3961
+ value: string;
3962
+ };
3963
+ export type ViewContentPage = {
3964
+ page_index: number;
3965
+ page_count: number;
3966
+ chunk?: string;
3967
+ entry?: ViewContentEntry;
3915
3968
  };
3916
3969
  export declare enum ViewSignLayout {
3917
3970
  LayoutDefault = 0,
@@ -3926,10 +3979,19 @@ export type ViewSignPage = {
3926
3979
  amount?: UintType;
3927
3980
  general: ViewDetail[];
3928
3981
  tip?: ViewTip;
3929
- raw_data?: ViewRawData;
3982
+ action_card?: ViewActionCard;
3930
3983
  slide_to_confirm?: boolean;
3931
3984
  layout?: ViewSignLayout;
3932
3985
  title_id?: number;
3986
+ title_arg?: string;
3987
+ content?: ViewContentPreview;
3988
+ custom_field?: ViewCustomField;
3989
+ };
3990
+ export type ViewWarningPage = {
3991
+ title_id: number;
3992
+ text_id: number;
3993
+ text_arg?: string;
3994
+ cancellable?: boolean;
3933
3995
  };
3934
3996
  export type ViewVerifyPage = {
3935
3997
  title?: string;
@@ -3940,6 +4002,7 @@ export type ViewVerifyPage = {
3940
4002
  value_key?: number;
3941
4003
  title_id?: number;
3942
4004
  chain_id?: number;
4005
+ content?: ViewContentPreview;
3943
4006
  };
3944
4007
  export declare enum ProtocolV2FailureType {
3945
4008
  Failure_InvalidMessage = 1,
@@ -4535,8 +4598,6 @@ export type MessageType = {
4535
4598
  TronSignMessage: TronSignMessage;
4536
4599
  TronMessageSignature: TronMessageSignature;
4537
4600
  facotry: facotry;
4538
- experimental_message: experimental_message;
4539
- experimental_field: experimental_field;
4540
4601
  TextMemo: TextMemo;
4541
4602
  RefundMemo: RefundMemo;
4542
4603
  CoinPurchaseMemo: CoinPurchaseMemo;
@@ -4552,6 +4613,8 @@ export type MessageType = {
4552
4613
  UnlockPath: UnlockPath;
4553
4614
  UnlockedPathRequest: UnlockedPathRequest;
4554
4615
  UiAnimationRequest: UiAnimationRequest;
4616
+ experimental_message: experimental_message;
4617
+ experimental_field: experimental_field;
4555
4618
  ProtocolInfoRequest: ProtocolInfoRequest;
4556
4619
  ProtocolInfo: ProtocolInfo;
4557
4620
  DeviceReboot: DeviceReboot;
@@ -4565,6 +4628,9 @@ export type MessageType = {
4565
4628
  DeviceCertificateSignature: DeviceCertificateSignature;
4566
4629
  DeviceCertificateSign: DeviceCertificateSign;
4567
4630
  DeviceMiscUsbMscControl: DeviceMiscUsbMscControl;
4631
+ DeviceFindMyTokenUpdate: DeviceFindMyTokenUpdate;
4632
+ DeviceFindMyTokenStateGet: DeviceFindMyTokenStateGet;
4633
+ DeviceFindMyTokenState: DeviceFindMyTokenState;
4568
4634
  DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
4569
4635
  DeviceFactoryInfo: DeviceFactoryInfo;
4570
4636
  DeviceFactoryInfoSet: DeviceFactoryInfoSet;
@@ -4574,6 +4640,7 @@ export type MessageType = {
4574
4640
  DeviceFirmwareTarget: DeviceFirmwareTarget;
4575
4641
  DeviceFirmwareUpdateStage: DeviceFirmwareUpdateStage;
4576
4642
  DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
4643
+ DeviceFirmwareUpdatePhaseInfo: DeviceFirmwareUpdatePhaseInfo;
4577
4644
  DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
4578
4645
  DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
4579
4646
  DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
@@ -4612,9 +4679,14 @@ export type MessageType = {
4612
4679
  PortfolioUpdate: PortfolioUpdate;
4613
4680
  ViewAmount: ViewAmount;
4614
4681
  ViewDetail: ViewDetail;
4682
+ ViewCustomField: ViewCustomField;
4615
4683
  ViewTip: ViewTip;
4616
- ViewRawData: ViewRawData;
4684
+ ViewActionCard: ViewActionCard;
4685
+ ViewContentPreview: ViewContentPreview;
4686
+ ViewContentEntry: ViewContentEntry;
4687
+ ViewContentPage: ViewContentPage;
4617
4688
  ViewSignPage: ViewSignPage;
4689
+ ViewWarningPage: ViewWarningPage;
4618
4690
  ViewVerifyPage: ViewVerifyPage;
4619
4691
  };
4620
4692
  export type MessageKey = keyof MessageType;