@onekeyfe/hd-transport 1.2.0-alpha.10 → 1.2.0-alpha.12

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
@@ -411,16 +411,11 @@ function crc8(data, len) {
411
411
  return crc;
412
412
  }
413
413
 
414
- function logProtocolV2Debug(options, stage, details) {
415
- var _a, _b, _c;
416
- (_b = (_a = options === null || options === void 0 ? void 0 : options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, `[${(_c = options.logPrefix) !== null && _c !== void 0 ? _c : 'ProtocolV2'}] ${stage}`, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (options.context ? { context: options.context } : {})), (options.messageName ? { messageName: options.messageName } : {})), (options.messageTypeId !== undefined ? { messageTypeId: options.messageTypeId } : {})), (options.pbPayloadLength !== undefined ? { pbPayloadLength: options.pbPayloadLength } : {})), details));
417
- }
418
-
419
414
  const PROTO_SEQ_DEFAULT = 1;
420
415
  function nextProtoSeq(current) {
421
416
  return current >= 255 ? 1 : current + 1;
422
417
  }
423
- function encodeFrame(payload, packetSrc, router, debugOptions, seq) {
418
+ function encodeFrame(payload, packetSrc, router, seq) {
424
419
  const resolvedPacketSrc = packetSrc !== null && packetSrc !== void 0 ? packetSrc : 0;
425
420
  const resolvedRouter = router !== null && router !== void 0 ? router : 0;
426
421
  const resolvedSeq = seq !== null && seq !== void 0 ? seq : PROTO_SEQ_DEFAULT;
@@ -445,24 +440,14 @@ function encodeFrame(payload, packetSrc, router, debugOptions, seq) {
445
440
  frame.set(payload, 7);
446
441
  }
447
442
  frame[frameLen - 1] = crc8(frame, frameLen - 1);
448
- logProtocolV2Debug(debugOptions, 'encode raw frame', {
449
- frameLen,
450
- payloadLen,
451
- packetSrc: resolvedPacketSrc,
452
- router: frame[4],
453
- attr: frame[5],
454
- seq: frame[6],
455
- headerCrc: frame[3],
456
- frameCrc: frame[frameLen - 1],
457
- });
458
443
  return frame;
459
444
  }
460
- function encodeProtobufFrame(messageTypeId, pbPayload, packetSrc, router, debugOptions, seq) {
445
+ function encodeProtobufFrame(messageTypeId, pbPayload, packetSrc, router, seq) {
461
446
  const payload = new Uint8Array(2 + pbPayload.length);
462
447
  payload[0] = messageTypeId % 256;
463
448
  payload[1] = Math.floor(messageTypeId / 256) % 256;
464
449
  payload.set(pbPayload, 2);
465
- return encodeFrame(payload, packetSrc, router, Object.assign(Object.assign({}, debugOptions), { messageTypeId, pbPayloadLength: pbPayload.length }), seq);
450
+ return encodeFrame(payload, packetSrc, router, seq);
466
451
  }
467
452
 
468
453
  function validateFrame(data) {
@@ -500,10 +485,8 @@ function isAckFrame(data) {
500
485
  }
501
486
  return true;
502
487
  }
503
- function decodeFrame(data, debugOptions) {
488
+ function decodeFrame(data) {
504
489
  const frameLen = validateFrame(data);
505
- const expectedHeaderCrc = data[3];
506
- const expectedFrameCrc = data[frameLen - 1];
507
490
  const seq = data[6];
508
491
  const payloadData = data.slice(7, frameLen - 1);
509
492
  if (payloadData.length < 2) {
@@ -511,19 +494,6 @@ function decodeFrame(data, debugOptions) {
511
494
  }
512
495
  const messageTypeId = payloadData[0] + payloadData[1] * 256;
513
496
  const pbPayload = payloadData.slice(2);
514
- logProtocolV2Debug(debugOptions, 'decode raw frame', {
515
- frameLen,
516
- dataLength: data.length,
517
- router: data[4],
518
- attr: data[5],
519
- seq,
520
- headerCrc: data[3],
521
- expectedHeaderCrc,
522
- frameCrc: data[frameLen - 1],
523
- expectedFrameCrc,
524
- messageTypeId,
525
- pbPayloadLength: pbPayload.length,
526
- });
527
497
  return { messageTypeId, pbPayload, seq };
528
498
  }
529
499
 
@@ -609,7 +579,6 @@ var protocolV2Codec = /*#__PURE__*/Object.freeze({
609
579
  PROTO_DATA_TYPE_ACK: PROTO_DATA_TYPE_ACK,
610
580
  CRC8_TABLE: CRC8_TABLE,
611
581
  crc8: crc8,
612
- logProtocolV2Debug: logProtocolV2Debug,
613
582
  nextProtoSeq: nextProtoSeq,
614
583
  encodeFrame: encodeFrame,
615
584
  encodeProtobufFrame: encodeProtobufFrame,
@@ -666,45 +635,19 @@ const ProtocolV1 = {
666
635
  const ProtocolV2 = {
667
636
  isAckFrame,
668
637
  encodeFrame(schemas, name, data, options = {}) {
669
- var _a, _b, _c, _d, _e, _f, _g;
670
638
  const encodeMessages = resolveProtocolV2EncodeSchema(name, schemas);
671
639
  const { Message, messageTypeId } = createMessageFromName(encodeMessages, name);
672
640
  const pbBuffer = encode(Message, data);
673
641
  pbBuffer.reset();
674
642
  const rawPbBuffer = pbBuffer.toBuffer();
675
643
  const pbBytes = new Uint8Array(rawPbBuffer);
676
- (_b = (_a = options.logger) === null || _a === void 0 ? void 0 : _a.debug) === null || _b === void 0 ? void 0 : _b.call(_a, `[${(_c = options.logPrefix) !== null && _c !== void 0 ? _c : 'ProtocolV2'}] encode protobuf`, {
677
- context: (_d = options.context) !== null && _d !== void 0 ? _d : `encode:${name}`,
678
- messageName: name,
679
- messageTypeId,
680
- pbPayloadLength: pbBytes.length,
681
- packetSrc: (_e = options.packetSrc) !== null && _e !== void 0 ? _e : 0,
682
- router: (_f = options.router) !== null && _f !== void 0 ? _f : 0,
683
- });
684
- return encodeProtobufFrame(messageTypeId, pbBytes, options.packetSrc, options.router, {
685
- logger: options.logger,
686
- logPrefix: options.logPrefix,
687
- context: (_g = options.context) !== null && _g !== void 0 ? _g : `encode:${name}`,
688
- messageName: name,
689
- }, options.seq);
644
+ return encodeProtobufFrame(messageTypeId, pbBytes, options.packetSrc, options.router, options.seq);
690
645
  },
691
- decodeFrame(schemas, frame, options = {}) {
692
- var _a, _b, _c, _d, _e;
693
- const { messageTypeId, pbPayload, seq } = decodeFrame(frame, {
694
- logger: options.logger,
695
- logPrefix: options.logPrefix,
696
- context: (_a = options.context) !== null && _a !== void 0 ? _a : 'decode',
697
- });
646
+ decodeFrame(schemas, frame) {
647
+ const { messageTypeId, pbPayload, seq } = decodeFrame(frame);
698
648
  const { Message, messageName } = createProtocolV2MessageFromType(messageTypeId, schemas);
699
649
  const rxByteBuffer = ByteBuffer__default["default"].wrap(Buffer.from(pbPayload));
700
650
  const message = decode(Message, rxByteBuffer);
701
- (_c = (_b = options.logger) === null || _b === void 0 ? void 0 : _b.debug) === null || _c === void 0 ? void 0 : _c.call(_b, `[${(_d = options.logPrefix) !== null && _d !== void 0 ? _d : 'ProtocolV2'}] decode protobuf`, {
702
- context: (_e = options.context) !== null && _e !== void 0 ? _e : `decode:${messageName}`,
703
- messageName,
704
- messageTypeId,
705
- pbPayloadLength: pbPayload.length,
706
- seq,
707
- });
708
651
  return {
709
652
  message,
710
653
  messageName,
@@ -853,11 +796,6 @@ function bytesToHex(bytes) {
853
796
  .map(b => b.toString(16).padStart(2, '0'))
854
797
  .join('');
855
798
  }
856
- const PROTOCOL_V2_DEBUG_HEADER_BYTES = 7;
857
- const PROTOCOL_V2_DEBUG_ARRAY_ITEMS_LIMIT = 20;
858
- const PROTOCOL_V2_DEBUG_OBJECT_KEYS_LIMIT = 40;
859
- const PROTOCOL_V2_DEBUG_STRING_LIMIT = 512;
860
- const PROTOCOL_V2_DEBUG_DEPTH_LIMIT = 4;
861
799
  const HIGH_VOLUME_PROTOCOL_V2_CALLS = new Set([
862
800
  ...LogBlockCommand,
863
801
  'FilesystemFileRead',
@@ -867,80 +805,6 @@ const HIGH_VOLUME_PROTOCOL_V2_CALLS = new Set([
867
805
  function shouldReduceProtocolV2Debug(name) {
868
806
  return HIGH_VOLUME_PROTOCOL_V2_CALLS.has(name);
869
807
  }
870
- function frameHeaderDebugHex(frame) {
871
- return bytesToHex(frame.slice(0, PROTOCOL_V2_DEBUG_HEADER_BYTES));
872
- }
873
- function getBinaryByteLength(value) {
874
- if (value instanceof ArrayBuffer) {
875
- return value.byteLength;
876
- }
877
- if (ArrayBuffer.isView(value)) {
878
- return value.byteLength;
879
- }
880
- if (typeof Blob !== 'undefined' && value instanceof Blob) {
881
- return value.size;
882
- }
883
- return undefined;
884
- }
885
- function summarizeRedactedData(value) {
886
- const byteLength = getBinaryByteLength(value);
887
- if (byteLength !== undefined) {
888
- return `[redacted data: ${byteLength} bytes]`;
889
- }
890
- if (typeof value === 'string') {
891
- return `[redacted data: string length=${value.length}]`;
892
- }
893
- if (Array.isArray(value)) {
894
- return `[redacted data: array length=${value.length}]`;
895
- }
896
- if (value && typeof value === 'object') {
897
- return `[redacted data: object keys=${Object.keys(value).length}]`;
898
- }
899
- return `[redacted data: ${typeof value}]`;
900
- }
901
- function sanitizeProtocolV2DebugPayload(value, key = '', depth = 0) {
902
- if (/^(data|payload)$/i.test(key) && value !== null && value !== undefined) {
903
- return summarizeRedactedData(value);
904
- }
905
- if (/(passphrase|pin|mnemonic|seed|private)/i.test(key)) {
906
- return '[redacted sensitive value]';
907
- }
908
- const byteLength = getBinaryByteLength(value);
909
- if (byteLength !== undefined) {
910
- return `[binary: ${byteLength} bytes]`;
911
- }
912
- if (typeof value === 'string') {
913
- return value.length > PROTOCOL_V2_DEBUG_STRING_LIMIT
914
- ? `${value.slice(0, PROTOCOL_V2_DEBUG_STRING_LIMIT)}... (len=${value.length})`
915
- : value;
916
- }
917
- if (!value || typeof value !== 'object') {
918
- return value;
919
- }
920
- if (depth >= PROTOCOL_V2_DEBUG_DEPTH_LIMIT) {
921
- return Array.isArray(value)
922
- ? `[array length=${value.length}]`
923
- : `[object keys=${Object.keys(value).length}]`;
924
- }
925
- if (Array.isArray(value)) {
926
- const items = value
927
- .slice(0, PROTOCOL_V2_DEBUG_ARRAY_ITEMS_LIMIT)
928
- .map(item => sanitizeProtocolV2DebugPayload(item, key, depth + 1));
929
- if (value.length > PROTOCOL_V2_DEBUG_ARRAY_ITEMS_LIMIT) {
930
- items.push(`... (${value.length - PROTOCOL_V2_DEBUG_ARRAY_ITEMS_LIMIT} more)`);
931
- }
932
- return items;
933
- }
934
- const entries = Object.entries(value).slice(0, PROTOCOL_V2_DEBUG_OBJECT_KEYS_LIMIT);
935
- const sanitized = {};
936
- entries.forEach(([entryKey, entryValue]) => {
937
- sanitized[entryKey] = sanitizeProtocolV2DebugPayload(entryValue, entryKey, depth + 1);
938
- });
939
- if (Object.keys(value).length > PROTOCOL_V2_DEBUG_OBJECT_KEYS_LIMIT) {
940
- sanitized.__truncated__ = `${Object.keys(value).length - PROTOCOL_V2_DEBUG_OBJECT_KEYS_LIMIT} more keys`;
941
- }
942
- return sanitized;
943
- }
944
808
  const COMMON_TERMINAL_RESPONSE_TYPES = new Set([
945
809
  'Failure',
946
810
  'ButtonRequest',
@@ -1003,7 +867,6 @@ class ProtocolV2Session {
1003
867
  return result;
1004
868
  }
1005
869
  executeCall(name, data, callOptions) {
1006
- var _a, _b;
1007
870
  return __awaiter(this, void 0, void 0, function* () {
1008
871
  const { schemas, router, packetSrc = PROTOCOL_V2_PACKET_SRC_COMMAND, maxFrameBytes, prepareCall, writeFrame, readFrame, logger, logPrefix = 'ProtocolV2', createTimeoutError, generation = 0, } = this.options;
1009
872
  const shouldReduceDebug = shouldReduceProtocolV2Debug(name);
@@ -1019,58 +882,31 @@ class ProtocolV2Session {
1019
882
  packetSrc,
1020
883
  router,
1021
884
  seq: protoSeq,
1022
- logger: shouldReduceDebug ? undefined : logger,
1023
- logPrefix,
1024
- context: `tx:${name}`,
1025
885
  });
1026
- const expectedSeq = frame[6];
1027
886
  if (maxFrameBytes !== undefined && frame.length > maxFrameBytes) {
1028
887
  throw new Error(`Protocol V2 frame too large for transport: ${frame.length} > ${maxFrameBytes}`);
1029
888
  }
1030
- if (!shouldReduceDebug) {
1031
- (_a = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _a === void 0 ? void 0 : _a.call(logger, `[${logPrefix}] TX payload name=${name}`, sanitizeProtocolV2DebugPayload(data));
1032
- (_b = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _b === void 0 ? void 0 : _b.call(logger, `[${logPrefix}] TX frame name=${name} len=${frame.length} router=${frame[4]} attr=${frame[5]} seq=${expectedSeq} headerHex=${frameHeaderDebugHex(frame)}`);
1033
- }
1034
889
  yield withProtocolTimeout(writeFrame(frame, callContext), PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS, () => new Error(`Protocol V2 write timeout after ${PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS}ms for ${name}`));
1035
890
  const cancellation = { cancelled: false };
1036
891
  const readResponse = () => __awaiter(this, void 0, void 0, function* () {
1037
- var _c, _d, _e, _f, _g, _h, _j, _k, _l;
892
+ var _a, _b, _c, _d;
1038
893
  while (!cancellation.cancelled) {
1039
894
  const rxFrame = yield readFrame(callContext);
1040
895
  if (cancellation.cancelled) {
1041
896
  break;
1042
897
  }
1043
- if (!shouldReduceDebug) {
1044
- (_c = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _c === void 0 ? void 0 : _c.call(logger, `[${logPrefix}] RX frame len=${rxFrame.length} router=${rxFrame[4]} attr=${rxFrame[5]} seq=${rxFrame[6]} headerHex=${frameHeaderDebugHex(rxFrame)}`);
1045
- }
1046
898
  const isAck = ProtocolV2.isAckFrame(rxFrame);
1047
- if (isAck) {
1048
- if (!shouldReduceDebug) {
1049
- (_d = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _d === void 0 ? void 0 : _d.call(logger, `[${logPrefix}] skip Proto Link ACK seq=${rxFrame[6]}`);
1050
- }
1051
- }
1052
899
  if (!isAck) {
1053
- const decoded = ProtocolV2.decodeFrame(schemas, rxFrame, {
1054
- logger: shouldReduceDebug ? undefined : logger,
1055
- logPrefix,
1056
- context: `rx:${name}`,
1057
- });
1058
- if (!shouldReduceDebug && decoded.seq !== expectedSeq) {
1059
- (_e = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _e === void 0 ? void 0 : _e.call(logger, `[${logPrefix}] seq differs for ${name}: tx=${expectedSeq}, rx=${decoded.seq}`);
1060
- }
1061
- if (!shouldReduceDebug) {
1062
- (_f = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _f === void 0 ? void 0 : _f.call(logger, `[${logPrefix}] TX name=${name} seq=${expectedSeq} | RX seq=${decoded.seq} messageTypeId=${decoded.messageTypeId} pbPayload=${decoded.pbPayload.length}B`);
1063
- (_g = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _g === void 0 ? void 0 : _g.call(logger, `[${logPrefix}] RX payload type=${decoded.type} messageTypeId=${decoded.messageTypeId}`, sanitizeProtocolV2DebugPayload(decoded.message));
1064
- }
900
+ const decoded = ProtocolV2.decodeFrame(schemas, rxFrame);
1065
901
  const response = call(decoded);
1066
- if ((_h = callOptions.intermediateTypes) === null || _h === void 0 ? void 0 : _h.includes(response.type)) {
1067
- (_j = callOptions.onIntermediateResponse) === null || _j === void 0 ? void 0 : _j.call(callOptions, response);
902
+ if ((_a = callOptions.intermediateTypes) === null || _a === void 0 ? void 0 : _a.includes(response.type)) {
903
+ (_b = callOptions.onIntermediateResponse) === null || _b === void 0 ? void 0 : _b.call(callOptions, response);
1068
904
  }
1069
905
  else if (isExpectedTerminalResponse(response, callOptions.expectedTypes)) {
1070
906
  return response;
1071
907
  }
1072
908
  else if (!shouldReduceDebug) {
1073
- (_k = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _k === void 0 ? void 0 : _k.call(logger, `[${logPrefix}] skip unexpected response for ${name}: expected=${(_l = callOptions.expectedTypes) === null || _l === void 0 ? void 0 : _l.join('|')} got=${response.type}`);
909
+ (_c = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _c === void 0 ? void 0 : _c.call(logger, `[${logPrefix}] skip unexpected response for ${name}: expected=${(_d = callOptions.expectedTypes) === null || _d === void 0 ? void 0 : _d.join('|')} got=${response.type}`);
1074
910
  }
1075
911
  }
1076
912
  }
@@ -1813,12 +1649,32 @@ exports.ViewSignLayout = void 0;
1813
1649
  ViewSignLayout[ViewSignLayout["LayoutDefault"] = 0] = "LayoutDefault";
1814
1650
  ViewSignLayout[ViewSignLayout["LayoutSafeTxCreate"] = 1] = "LayoutSafeTxCreate";
1815
1651
  })(exports.ViewSignLayout || (exports.ViewSignLayout = {}));
1652
+ exports.DeviceErrorCode = void 0;
1653
+ (function (DeviceErrorCode) {
1654
+ DeviceErrorCode[DeviceErrorCode["DeviceError_None"] = 0] = "DeviceError_None";
1655
+ DeviceErrorCode[DeviceErrorCode["DeviceError_Busy"] = 1] = "DeviceError_Busy";
1656
+ DeviceErrorCode[DeviceErrorCode["DeviceError_NotInitialized"] = 2] = "DeviceError_NotInitialized";
1657
+ DeviceErrorCode[DeviceErrorCode["DeviceError_ActionCancelled"] = 3] = "DeviceError_ActionCancelled";
1658
+ DeviceErrorCode[DeviceErrorCode["DeviceError_PinAlreadyUsed"] = 4] = "DeviceError_PinAlreadyUsed";
1659
+ DeviceErrorCode[DeviceErrorCode["DeviceError_PersistFailed"] = 5] = "DeviceError_PersistFailed";
1660
+ DeviceErrorCode[DeviceErrorCode["DeviceError_SeError"] = 6] = "DeviceError_SeError";
1661
+ DeviceErrorCode[DeviceErrorCode["DeviceError_InvalidLanguage"] = 7] = "DeviceError_InvalidLanguage";
1662
+ DeviceErrorCode[DeviceErrorCode["DeviceError_WallpaperNotUsable"] = 8] = "DeviceError_WallpaperNotUsable";
1663
+ DeviceErrorCode[DeviceErrorCode["DeviceError_DeviceLocked"] = 9] = "DeviceError_DeviceLocked";
1664
+ })(exports.DeviceErrorCode || (exports.DeviceErrorCode = {}));
1816
1665
  exports.DeviceRebootType = void 0;
1817
1666
  (function (DeviceRebootType) {
1818
1667
  DeviceRebootType[DeviceRebootType["Normal"] = 0] = "Normal";
1819
1668
  DeviceRebootType[DeviceRebootType["Romloader"] = 1] = "Romloader";
1820
1669
  DeviceRebootType[DeviceRebootType["Bootloader"] = 2] = "Bootloader";
1821
1670
  })(exports.DeviceRebootType || (exports.DeviceRebootType = {}));
1671
+ exports.DeviceSettingsPage = void 0;
1672
+ (function (DeviceSettingsPage) {
1673
+ DeviceSettingsPage[DeviceSettingsPage["DeviceReset"] = 0] = "DeviceReset";
1674
+ DeviceSettingsPage[DeviceSettingsPage["DevicePinChange"] = 1] = "DevicePinChange";
1675
+ DeviceSettingsPage[DeviceSettingsPage["DevicePassphrase"] = 2] = "DevicePassphrase";
1676
+ DeviceSettingsPage[DeviceSettingsPage["DeviceAirgap"] = 3] = "DeviceAirgap";
1677
+ })(exports.DeviceSettingsPage || (exports.DeviceSettingsPage = {}));
1822
1678
  exports.DeviceFirmwareTargetType = void 0;
1823
1679
  (function (DeviceFirmwareTargetType) {
1824
1680
  DeviceFirmwareTargetType[DeviceFirmwareTargetType["FW_MGMT_TARGET_INVALID"] = 0] = "FW_MGMT_TARGET_INVALID";
@@ -1957,7 +1813,9 @@ var messages = /*#__PURE__*/Object.freeze({
1957
1813
  get MoneroNetworkType () { return exports.MoneroNetworkType; },
1958
1814
  get ViewTipType () { return exports.ViewTipType; },
1959
1815
  get ViewSignLayout () { return exports.ViewSignLayout; },
1816
+ get DeviceErrorCode () { return exports.DeviceErrorCode; },
1960
1817
  get DeviceRebootType () { return exports.DeviceRebootType; },
1818
+ get DeviceSettingsPage () { return exports.DeviceSettingsPage; },
1961
1819
  get DeviceFirmwareTargetType () { return exports.DeviceFirmwareTargetType; },
1962
1820
  get DeviceFirmwareUpdateTaskStatus () { return exports.DeviceFirmwareUpdateTaskStatus; },
1963
1821
  get DeviceFactoryAck () { return exports.DeviceFactoryAck; },
@@ -4,7 +4,6 @@ import { encodeEnvelopeMessage } from './v1/packets';
4
4
  import { decodeMessage as decodeV1Message } from './v1/receive';
5
5
  import { isAckFrame } from './v2';
6
6
  import type { Root } from 'protobufjs/light';
7
- import type { ProtocolV2DebugLogger } from './v2';
8
7
  export declare const PROTOCOL_V2_SYS_MESSAGE_THRESHOLD = 60000;
9
8
  type ProtocolV2Schemas = {
10
9
  protocolV1: Root;
@@ -14,9 +13,6 @@ type ProtocolV2FrameOptions = {
14
13
  packetSrc?: number;
15
14
  router?: number;
16
15
  seq?: number;
17
- logger?: ProtocolV2DebugLogger;
18
- logPrefix?: string;
19
- context?: string;
20
16
  };
21
17
  export declare const ProtocolV1: {
22
18
  encodeEnvelope: typeof encodeEnvelopeMessage;
@@ -32,7 +28,7 @@ export declare const ProtocolV1: {
32
28
  export declare const ProtocolV2: {
33
29
  isAckFrame: typeof isAckFrame;
34
30
  encodeFrame(schemas: ProtocolV2Schemas, name: string, data: Record<string, unknown>, options?: ProtocolV2FrameOptions): Uint8Array;
35
- decodeFrame(schemas: ProtocolV2Schemas, frame: Uint8Array, options?: Pick<ProtocolV2FrameOptions, 'logger' | 'logPrefix' | 'context'>): {
31
+ decodeFrame(schemas: ProtocolV2Schemas, frame: Uint8Array): {
36
32
  message: {
37
33
  [key: string]: any;
38
34
  };
@@ -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;AAIhE,OAAO,EAAqD,UAAU,EAAE,MAAM,MAAM,CAAC;AAErF,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;;yBAIV,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
+ {"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;AAIhE,OAAO,EAAqD,UAAU,EAAE,MAAM,MAAM,CAAC;AAErF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,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;CACd,CAAC;AAsCF,eAAO,MAAM,UAAU;;;;;;;;;;CAOtB,CAAC;AAEF,eAAO,MAAM,UAAU;;yBAIV,iBAAiB,QACpB,MAAM,QACN,OAAO,MAAM,EAAE,OAAO,CAAC,YACpB,sBAAsB;yBAkBZ,iBAAiB,SAAS,UAAU;;;;;;;;;;CAe1D,CAAC"}
@@ -1,9 +1,8 @@
1
- import type { ProtocolV2FrameDebugOptions } from './debug';
2
1
  export interface ProtoV2Frame {
3
2
  messageTypeId: number;
4
3
  pbPayload: Uint8Array;
5
4
  seq: number;
6
5
  }
7
6
  export declare function isAckFrame(data: Uint8Array): boolean;
8
- export declare function decodeFrame(data: Uint8Array, debugOptions?: ProtocolV2FrameDebugOptions): ProtoV2Frame;
7
+ export declare function decodeFrame(data: Uint8Array): ProtoV2Frame;
9
8
  //# sourceMappingURL=decode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/decode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAE3D,MAAM,WAAW,YAAY;IAE3B,aAAa,EAAE,MAAM,CAAC;IAEtB,SAAS,EAAE,UAAU,CAAC;IAEtB,GAAG,EAAE,MAAM,CAAC;CACb;AAwCD,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAWpD;AAYD,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,EAChB,YAAY,CAAC,EAAE,2BAA2B,GACzC,YAAY,CA+Bd"}
1
+ {"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/decode.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAE3B,aAAa,EAAE,MAAM,CAAC;IAEtB,SAAS,EAAE,UAAU,CAAC;IAEtB,GAAG,EAAE,MAAM,CAAC;CACb;AAwCD,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAWpD;AAYD,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAe1D"}
@@ -1,5 +1,4 @@
1
- import type { ProtocolV2FrameDebugOptions } from './debug';
2
1
  export declare function nextProtoSeq(current: number): number;
3
- export declare function encodeFrame(payload: Uint8Array | null, packetSrc?: number, router?: number, debugOptions?: ProtocolV2FrameDebugOptions, seq?: number): Uint8Array;
4
- export declare function encodeProtobufFrame(messageTypeId: number, pbPayload: Uint8Array, packetSrc?: number, router?: number, debugOptions?: ProtocolV2FrameDebugOptions, seq?: number): Uint8Array;
2
+ export declare function encodeFrame(payload: Uint8Array | null, packetSrc?: number, router?: number, seq?: number): Uint8Array;
3
+ export declare function encodeProtobufFrame(messageTypeId: number, pbPayload: Uint8Array, packetSrc?: number, router?: number, seq?: number): Uint8Array;
5
4
  //# sourceMappingURL=encode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/encode.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAU3D,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD;AAgBD,wBAAgB,WAAW,CACzB,OAAO,EAAE,UAAU,GAAG,IAAI,EAC1B,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,2BAA2B,EAC1C,GAAG,CAAC,EAAE,MAAM,GACX,UAAU,CA4CZ;AASD,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,UAAU,EACrB,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,2BAA2B,EAC1C,GAAG,CAAC,EAAE,MAAM,GACX,UAAU,CAgBZ"}
1
+ {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/encode.ts"],"names":[],"mappings":"AAYA,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpD;AAgBD,wBAAgB,WAAW,CACzB,OAAO,EAAE,UAAU,GAAG,IAAI,EAC1B,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,GACX,UAAU,CAiCZ;AASD,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,UAAU,EACrB,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,GACX,UAAU,CAMZ"}
@@ -1,6 +1,5 @@
1
1
  export * from './constants';
2
2
  export * from './crc8';
3
- export * from './debug';
4
3
  export * from './encode';
5
4
  export * from './decode';
6
5
  export * from './frame-assembler';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAK7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,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,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,KAAK,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AC,WAAW,CAAuC;gBAE9C,OAAO,EAAE,wBAAwB;IAK7C,IAAI,CACF,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,WAAW,GAAE,qBAA0B,GACtC,OAAO,CAAC,iBAAiB,CAAC;YASf,WAAW;CAsG1B;AAED,wBAAsB,eAAe,CAAC,EACpC,IAAI,EACJ,SAAS,EACT,MAAM,EACN,SAAwB,EACxB,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;CAC1D,oBAoBA"}
@@ -3462,6 +3462,18 @@ export type ProtocolInfo = {
3462
3462
  supported_messages: number[];
3463
3463
  protobuf_definition?: string;
3464
3464
  };
3465
+ export declare enum DeviceErrorCode {
3466
+ DeviceError_None = 0,
3467
+ DeviceError_Busy = 1,
3468
+ DeviceError_NotInitialized = 2,
3469
+ DeviceError_ActionCancelled = 3,
3470
+ DeviceError_PinAlreadyUsed = 4,
3471
+ DeviceError_PersistFailed = 5,
3472
+ DeviceError_SeError = 6,
3473
+ DeviceError_InvalidLanguage = 7,
3474
+ DeviceError_WallpaperNotUsable = 8,
3475
+ DeviceError_DeviceLocked = 9
3476
+ }
3465
3477
  export declare enum DeviceRebootType {
3466
3478
  Normal = 0,
3467
3479
  Romloader = 1,
@@ -3474,11 +3486,35 @@ export type DeviceSettings = {
3474
3486
  label?: string;
3475
3487
  bt_enable?: boolean;
3476
3488
  language?: string;
3489
+ wallpaper_path?: string;
3490
+ passphrase_enable?: boolean;
3491
+ brightness?: number;
3492
+ autolock_delay_ms?: number;
3493
+ autoshutdown_delay_ms?: number;
3494
+ animation_enable?: boolean;
3495
+ tap_to_wake?: boolean;
3496
+ haptic_feedback?: boolean;
3497
+ device_name_display_enabled?: boolean;
3498
+ airgap_mode?: boolean;
3499
+ fido_enabled?: boolean;
3500
+ experimental_features?: boolean;
3501
+ usb_lock_enable?: boolean;
3502
+ random_keypad?: boolean;
3477
3503
  };
3478
3504
  export type DeviceSettingsGet = {};
3479
3505
  export type DeviceSettingsSet = {
3480
3506
  settings: DeviceSettings;
3481
3507
  };
3508
+ export declare enum DeviceSettingsPage {
3509
+ DeviceReset = 0,
3510
+ DevicePinChange = 1,
3511
+ DevicePassphrase = 2,
3512
+ DeviceAirgap = 3
3513
+ }
3514
+ export type DeviceSettingsPageShow = {
3515
+ page: DeviceSettingsPage;
3516
+ field_name?: string;
3517
+ };
3482
3518
  export type DeviceCertificate = {
3483
3519
  cert_and_pubkey: string;
3484
3520
  private_key?: string;
@@ -4346,6 +4382,7 @@ export type MessageType = {
4346
4382
  DeviceSettings: DeviceSettings;
4347
4383
  DeviceSettingsGet: DeviceSettingsGet;
4348
4384
  DeviceSettingsSet: DeviceSettingsSet;
4385
+ DeviceSettingsPageShow: DeviceSettingsPageShow;
4349
4386
  DeviceCertificate: DeviceCertificate;
4350
4387
  DeviceCertificateWrite: DeviceCertificateWrite;
4351
4388
  DeviceCertificateRead: DeviceCertificateRead;