@onekeyfe/hd-transport 1.2.0-alpha.3 → 1.2.0-alpha.30

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.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/__tests__/messages.test.js +142 -0
  3. package/__tests__/protocol-v2-ble-frame-writer.test.js +119 -0
  4. package/__tests__/protocol-v2-link-manager.test.js +389 -0
  5. package/__tests__/protocol-v2-usb-transport-base.test.js +330 -0
  6. package/__tests__/protocol-v2.test.js +555 -119
  7. package/dist/constants.d.ts +6 -3
  8. package/dist/constants.d.ts.map +1 -1
  9. package/dist/index.d.ts +981 -278
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +759 -247
  12. package/dist/protocols/index.d.ts +14 -5
  13. package/dist/protocols/index.d.ts.map +1 -1
  14. package/dist/protocols/v2/ble-frame-writer.d.ts +15 -0
  15. package/dist/protocols/v2/ble-frame-writer.d.ts.map +1 -0
  16. package/dist/protocols/v2/constants.d.ts +1 -0
  17. package/dist/protocols/v2/constants.d.ts.map +1 -1
  18. package/dist/protocols/v2/decode.d.ts +13 -2
  19. package/dist/protocols/v2/decode.d.ts.map +1 -1
  20. package/dist/protocols/v2/encode.d.ts +2 -3
  21. package/dist/protocols/v2/encode.d.ts.map +1 -1
  22. package/dist/protocols/v2/errors.d.ts +8 -0
  23. package/dist/protocols/v2/errors.d.ts.map +1 -0
  24. package/dist/protocols/v2/frame-assembler.d.ts.map +1 -1
  25. package/dist/protocols/v2/index.d.ts +2 -1
  26. package/dist/protocols/v2/index.d.ts.map +1 -1
  27. package/dist/protocols/v2/link-manager.d.ts +38 -0
  28. package/dist/protocols/v2/link-manager.d.ts.map +1 -0
  29. package/dist/protocols/v2/sequence-cursor.d.ts +5 -0
  30. package/dist/protocols/v2/sequence-cursor.d.ts.map +1 -0
  31. package/dist/protocols/v2/session.d.ts +19 -5
  32. package/dist/protocols/v2/session.d.ts.map +1 -1
  33. package/dist/protocols/v2/usb-transport-base.d.ts +32 -0
  34. package/dist/protocols/v2/usb-transport-base.d.ts.map +1 -0
  35. package/dist/serialization/protobuf/decode.d.ts.map +1 -1
  36. package/dist/types/messages.d.ts +523 -158
  37. package/dist/types/messages.d.ts.map +1 -1
  38. package/dist/types/transport.d.ts +13 -3
  39. package/dist/types/transport.d.ts.map +1 -1
  40. package/messages-protocol-v2.json +796 -620
  41. package/package.json +3 -3
  42. package/scripts/protobuf-build.sh +96 -310
  43. package/scripts/protobuf-patches/index.js +1 -0
  44. package/scripts/protobuf-types.js +19 -1
  45. package/src/constants.ts +29 -15
  46. package/src/index.ts +11 -1
  47. package/src/protocols/index.ts +39 -40
  48. package/src/protocols/v2/ble-frame-writer.ts +77 -0
  49. package/src/protocols/v2/constants.ts +1 -0
  50. package/src/protocols/v2/crc8.ts +1 -1
  51. package/src/protocols/v2/decode.ts +71 -37
  52. package/src/protocols/v2/encode.ts +2 -28
  53. package/src/protocols/v2/errors.ts +25 -0
  54. package/src/protocols/v2/frame-assembler.ts +6 -4
  55. package/src/protocols/v2/index.ts +2 -1
  56. package/src/protocols/v2/link-manager.ts +186 -0
  57. package/src/protocols/v2/sequence-cursor.ts +10 -0
  58. package/src/protocols/v2/session.ts +157 -201
  59. package/src/protocols/v2/usb-transport-base.ts +213 -0
  60. package/src/serialization/protobuf/decode.ts +4 -1
  61. package/src/types/messages.ts +623 -181
  62. package/src/types/transport.ts +13 -3
  63. package/dist/protocols/v2/debug.d.ts +0 -13
  64. package/dist/protocols/v2/debug.d.ts.map +0 -1
  65. package/src/protocols/v2/debug.ts +0 -26
package/dist/index.d.ts CHANGED
@@ -60,33 +60,84 @@ declare const PROTO_HEAD_CRC_SIZE = 8;
60
60
  declare const CRC8_INIT = 48;
61
61
  declare const PACKET_SIZE = 4096;
62
62
  declare const PROTO_DATA_TYPE_PACKET = 0;
63
+ declare const PROTO_DATA_TYPE_ACK = 1;
63
64
 
64
65
  declare const CRC8_TABLE: Uint8Array;
66
+ /**
67
+ * Compute CRC-8 over the first len bytes using the firmware-compatible initial value.
68
+ */
65
69
  declare function crc8(data: Uint8Array, len: number): number;
66
70
 
67
- type ProtocolV2DebugLogger = {
68
- debug?: (...args: unknown[]) => void;
69
- };
70
- type ProtocolV2FrameDebugOptions = {
71
- logger?: ProtocolV2DebugLogger;
72
- logPrefix?: string;
73
- context?: string;
74
- messageName?: string;
75
- messageTypeId?: number;
76
- pbPayloadLength?: number;
77
- };
78
- declare function logProtocolV2Debug(options: ProtocolV2FrameDebugOptions | undefined, stage: string, details: Record<string, unknown>): void;
79
-
71
+ /**
72
+ * Advance a Protocol V2 sequence counter: 1-255, wraps around skipping 0.
73
+ */
80
74
  declare function nextProtoSeq(current: number): number;
81
- declare function encodeFrame(payload: Uint8Array | null, packetSrc?: number, router?: number, debugOptions?: ProtocolV2FrameDebugOptions, seq?: number): Uint8Array;
82
- declare function encodeProtobufFrame(messageTypeId: number, pbPayload: Uint8Array, packetSrc?: number, router?: number, debugOptions?: ProtocolV2FrameDebugOptions, seq?: number): Uint8Array;
75
+ /**
76
+ * Build a raw Protocol V2 frame (0x5A framing).
77
+ *
78
+ * Frame layout (PROTO_HEAD_CRC_SIZE = 8 overhead bytes):
79
+ * [0] SOF = 0x5A
80
+ * [1] frameLen low byte
81
+ * [2] frameLen high byte
82
+ * [3] CRC8 of bytes 0-2 (pre-header CRC)
83
+ * [4] router
84
+ * [5] attr = ((packetSrc & 0x0F) << 2) | dataType
85
+ * [6] seq (1-255, wraps skipping 0)
86
+ * [7..N-2] payload
87
+ * [N-1] CRC8 of bytes 0 to N-2 (frame CRC)
88
+ */
89
+ declare function encodeFrame(payload: Uint8Array | null, packetSrc?: number, router?: number, seq?: number): Uint8Array;
90
+ /**
91
+ * Build a Protocol V2 frame carrying a protobuf message.
92
+ *
93
+ * Payload layout:
94
+ * [0-1] messageTypeId as little-endian uint16
95
+ * [2..] protobuf-encoded message bytes
96
+ */
97
+ declare function encodeProtobufFrame(messageTypeId: number, pbPayload: Uint8Array, packetSrc?: number, router?: number, seq?: number): Uint8Array;
83
98
 
84
99
  interface ProtoV2Frame {
100
+ /** Little-endian message type ID */
85
101
  messageTypeId: number;
102
+ /** Raw protobuf-encoded payload (bytes after the 2-byte messageTypeId) */
86
103
  pbPayload: Uint8Array;
104
+ /** Sequence number from the frame header */
105
+ seq: number;
106
+ /** Routing channel from the frame header */
107
+ router: number;
108
+ /** Packet source from the frame header */
109
+ packetSrc: number;
110
+ /** Packet or ACK discriminator from the frame header */
111
+ dataType: number;
112
+ }
113
+ type ProtoV2FrameHeader = {
114
+ frameLen: number;
115
+ router: number;
116
+ packetSrc: number;
117
+ dataType: number;
87
118
  seq: number;
119
+ };
120
+ declare function inspectFrameHeader(data: Uint8Array): ProtoV2FrameHeader;
121
+ declare function isAckFrame(data: Uint8Array): boolean;
122
+ /**
123
+ * Parse and validate a Protocol V2 response frame.
124
+ *
125
+ * Validates:
126
+ * - SOF byte (0x5A)
127
+ * - Header CRC (bytes 0-2)
128
+ * - Frame CRC (full frame except last byte)
129
+ *
130
+ * Returns the decoded messageTypeId, raw protobuf payload, and sequence number.
131
+ */
132
+ declare function decodeFrame(data: Uint8Array): ProtoV2Frame;
133
+
134
+ type ProtocolV2LinkErrorCode = 'response-timeout' | 'io' | 'generation' | 'router' | 'packet-source' | 'ack-sequence' | 'response-sequence' | 'frame';
135
+ declare class ProtocolV2LinkError extends Error {
136
+ readonly code: ProtocolV2LinkErrorCode;
137
+ readonly cause?: unknown;
138
+ constructor(code: ProtocolV2LinkErrorCode, message: string, cause?: unknown);
88
139
  }
89
- declare function decodeFrame(data: Uint8Array, debugOptions?: ProtocolV2FrameDebugOptions): ProtoV2Frame;
140
+ declare const isProtocolV2LinkError: (error: unknown) => error is ProtocolV2LinkError;
90
141
 
91
142
  declare function concatUint8Arrays(arrays: Uint8Array[]): Uint8Array;
92
143
  declare class ProtocolV2FrameAssembler {
@@ -95,30 +146,57 @@ declare class ProtocolV2FrameAssembler {
95
146
  constructor(maxFrameBytes?: number);
96
147
  reset(): void;
97
148
  push(chunk: Uint8Array): Uint8Array | undefined;
149
+ /**
150
+ * Append a chunk (optional) and extract every complete frame currently
151
+ * buffered. Same validation/throw semantics as push(); push() stays
152
+ * backward compatible for callers that drain one frame at a time.
153
+ */
98
154
  drain(chunk?: Uint8Array): Uint8Array[];
99
155
  private append;
100
156
  private extractFrame;
101
157
  }
102
158
 
159
+ type ProtocolV2BleFrameWriterOptions = {
160
+ frame: Uint8Array;
161
+ packetCapacity: number;
162
+ writePacket: (packet: Uint8Array, packetIndex: number) => Promise<void>;
163
+ assertActive?: () => void;
164
+ signal?: AbortSignal;
165
+ abortMessage?: string;
166
+ initialDelayMs?: number;
167
+ burstSize?: number;
168
+ burstPauseMs?: number;
169
+ flushDelayMs?: number;
170
+ wait?: (timeoutMs: number) => Promise<void>;
171
+ };
172
+ declare function writeProtocolV2BleFrame({ frame, packetCapacity, writePacket, assertActive, signal, abortMessage, initialDelayMs, burstSize, burstPauseMs, flushDelayMs, wait, }: ProtocolV2BleFrameWriterOptions): Promise<void>;
173
+
103
174
  declare const protocolV2Codec_PROTO_HEAD_SOF: typeof PROTO_HEAD_SOF;
104
175
  declare const protocolV2Codec_PROTO_PRE_HEAD_SIZE: typeof PROTO_PRE_HEAD_SIZE;
105
176
  declare const protocolV2Codec_PROTO_HEAD_CRC_SIZE: typeof PROTO_HEAD_CRC_SIZE;
106
177
  declare const protocolV2Codec_CRC8_INIT: typeof CRC8_INIT;
107
178
  declare const protocolV2Codec_PACKET_SIZE: typeof PACKET_SIZE;
108
179
  declare const protocolV2Codec_PROTO_DATA_TYPE_PACKET: typeof PROTO_DATA_TYPE_PACKET;
180
+ declare const protocolV2Codec_PROTO_DATA_TYPE_ACK: typeof PROTO_DATA_TYPE_ACK;
109
181
  declare const protocolV2Codec_CRC8_TABLE: typeof CRC8_TABLE;
110
182
  declare const protocolV2Codec_crc8: typeof crc8;
111
- type protocolV2Codec_ProtocolV2DebugLogger = ProtocolV2DebugLogger;
112
- type protocolV2Codec_ProtocolV2FrameDebugOptions = ProtocolV2FrameDebugOptions;
113
- declare const protocolV2Codec_logProtocolV2Debug: typeof logProtocolV2Debug;
114
183
  declare const protocolV2Codec_nextProtoSeq: typeof nextProtoSeq;
115
184
  declare const protocolV2Codec_encodeFrame: typeof encodeFrame;
116
185
  declare const protocolV2Codec_encodeProtobufFrame: typeof encodeProtobufFrame;
117
186
  type protocolV2Codec_ProtoV2Frame = ProtoV2Frame;
187
+ type protocolV2Codec_ProtoV2FrameHeader = ProtoV2FrameHeader;
188
+ declare const protocolV2Codec_inspectFrameHeader: typeof inspectFrameHeader;
189
+ declare const protocolV2Codec_isAckFrame: typeof isAckFrame;
118
190
  declare const protocolV2Codec_decodeFrame: typeof decodeFrame;
191
+ type protocolV2Codec_ProtocolV2LinkErrorCode = ProtocolV2LinkErrorCode;
192
+ type protocolV2Codec_ProtocolV2LinkError = ProtocolV2LinkError;
193
+ declare const protocolV2Codec_ProtocolV2LinkError: typeof ProtocolV2LinkError;
194
+ declare const protocolV2Codec_isProtocolV2LinkError: typeof isProtocolV2LinkError;
119
195
  declare const protocolV2Codec_concatUint8Arrays: typeof concatUint8Arrays;
120
196
  type protocolV2Codec_ProtocolV2FrameAssembler = ProtocolV2FrameAssembler;
121
197
  declare const protocolV2Codec_ProtocolV2FrameAssembler: typeof ProtocolV2FrameAssembler;
198
+ type protocolV2Codec_ProtocolV2BleFrameWriterOptions = ProtocolV2BleFrameWriterOptions;
199
+ declare const protocolV2Codec_writeProtocolV2BleFrame: typeof writeProtocolV2BleFrame;
122
200
  declare namespace protocolV2Codec {
123
201
  export {
124
202
  protocolV2Codec_PROTO_HEAD_SOF as PROTO_HEAD_SOF,
@@ -127,18 +205,24 @@ declare namespace protocolV2Codec {
127
205
  protocolV2Codec_CRC8_INIT as CRC8_INIT,
128
206
  protocolV2Codec_PACKET_SIZE as PACKET_SIZE,
129
207
  protocolV2Codec_PROTO_DATA_TYPE_PACKET as PROTO_DATA_TYPE_PACKET,
208
+ protocolV2Codec_PROTO_DATA_TYPE_ACK as PROTO_DATA_TYPE_ACK,
130
209
  protocolV2Codec_CRC8_TABLE as CRC8_TABLE,
131
210
  protocolV2Codec_crc8 as crc8,
132
- protocolV2Codec_ProtocolV2DebugLogger as ProtocolV2DebugLogger,
133
- protocolV2Codec_ProtocolV2FrameDebugOptions as ProtocolV2FrameDebugOptions,
134
- protocolV2Codec_logProtocolV2Debug as logProtocolV2Debug,
135
211
  protocolV2Codec_nextProtoSeq as nextProtoSeq,
136
212
  protocolV2Codec_encodeFrame as encodeFrame,
137
213
  protocolV2Codec_encodeProtobufFrame as encodeProtobufFrame,
138
214
  protocolV2Codec_ProtoV2Frame as ProtoV2Frame,
215
+ protocolV2Codec_ProtoV2FrameHeader as ProtoV2FrameHeader,
216
+ protocolV2Codec_inspectFrameHeader as inspectFrameHeader,
217
+ protocolV2Codec_isAckFrame as isAckFrame,
139
218
  protocolV2Codec_decodeFrame as decodeFrame,
219
+ protocolV2Codec_ProtocolV2LinkErrorCode as ProtocolV2LinkErrorCode,
220
+ protocolV2Codec_ProtocolV2LinkError as ProtocolV2LinkError,
221
+ protocolV2Codec_isProtocolV2LinkError as isProtocolV2LinkError,
140
222
  protocolV2Codec_concatUint8Arrays as concatUint8Arrays,
141
223
  protocolV2Codec_ProtocolV2FrameAssembler as ProtocolV2FrameAssembler,
224
+ protocolV2Codec_ProtocolV2BleFrameWriterOptions as ProtocolV2BleFrameWriterOptions,
225
+ protocolV2Codec_writeProtocolV2BleFrame as writeProtocolV2BleFrame,
142
226
  };
143
227
  }
144
228
 
@@ -150,10 +234,8 @@ type ProtocolV2Schemas$1 = {
150
234
  type ProtocolV2FrameOptions = {
151
235
  packetSrc?: number;
152
236
  router?: number;
237
+ /** Sequence number (1-255). Managed per-session by ProtocolV2Session. */
153
238
  seq?: number;
154
- logger?: ProtocolV2DebugLogger;
155
- logPrefix?: string;
156
- context?: string;
157
239
  };
158
240
  declare const ProtocolV1: {
159
241
  encodeEnvelope: typeof encodeEnvelopeMessage;
@@ -167,8 +249,20 @@ declare const ProtocolV1: {
167
249
  decodeMessage: typeof decodeMessage;
168
250
  };
169
251
  declare const ProtocolV2: {
252
+ isAckFrame: typeof isAckFrame;
253
+ inspectFrameHeader: typeof inspectFrameHeader;
254
+ inspectFrame(schemas: ProtocolV2Schemas$1, frame: Uint8Array): {
255
+ messageName: string;
256
+ messageTypeId: number;
257
+ pbPayload: Uint8Array;
258
+ seq: number;
259
+ router: number;
260
+ packetSrc: number;
261
+ dataType: number;
262
+ type: string;
263
+ };
170
264
  encodeFrame(schemas: ProtocolV2Schemas$1, name: string, data: Record<string, unknown>, options?: ProtocolV2FrameOptions): Uint8Array;
171
- decodeFrame(schemas: ProtocolV2Schemas$1, frame: Uint8Array, options?: Pick<ProtocolV2FrameOptions, 'logger' | 'logPrefix' | 'context'>): {
265
+ decodeFrame(schemas: ProtocolV2Schemas$1, frame: Uint8Array): {
172
266
  message: {
173
267
  [key: string]: any;
174
268
  };
@@ -180,6 +274,14 @@ declare const ProtocolV2: {
180
274
  };
181
275
  };
182
276
 
277
+ declare const TRANSPORT_EVENT: {
278
+ readonly DEVICE_DISCONNECT: "transport-device-disconnect";
279
+ };
280
+ type TransportDeviceDisconnectEvent = {
281
+ id: string;
282
+ connectId: string;
283
+ name: string | null;
284
+ };
183
285
  type ProtocolType = 'V1' | 'V2';
184
286
  type OneKeyDeviceCommType = 'usb' | 'webusb' | 'ble' | 'webble' | 'electron-ble' | 'bridge' | 'emulator';
185
287
  type OneKeyUsbDeviceInfo = {
@@ -233,7 +335,7 @@ type Transport = {
233
335
  getProtocolType: (path: string) => ProtocolType | undefined;
234
336
  promptDeviceAccess?: () => Promise<USBDevice | BluetoothDevice | null>;
235
337
  init: ITransportInitFn;
236
- stop(): void;
338
+ stop(): void | Promise<void>;
237
339
  configured: boolean;
238
340
  version: string;
239
341
  name: string;
@@ -246,8 +348,10 @@ type LowLevelDevice = OneKeyDeviceInfoBase & {
246
348
  };
247
349
  type LowlevelTransportSharedPlugin = {
248
350
  enumerate: () => Promise<LowLevelDevice[]>;
249
- send: (uuid: string, data: string) => Promise<void>;
250
- receive: () => Promise<string>;
351
+ send: (uuid: string, data: string, options?: {
352
+ withoutResponse?: boolean;
353
+ }) => Promise<void>;
354
+ receive: (uuid?: string) => Promise<string>;
251
355
  connect: (uuid: string) => Promise<void>;
252
356
  disconnect: (uuid: string) => Promise<void>;
253
357
  init: () => Promise<void>;
@@ -1137,11 +1241,15 @@ declare enum FailureType {
1137
1241
  Failure_PinMismatch = 12,
1138
1242
  Failure_WipeCodeMismatch = 13,
1139
1243
  Failure_InvalidSession = 14,
1140
- Failure_FirmwareError = 99
1244
+ Failure_FirmwareError = 99,
1245
+ Failure_InvalidMessage = 1,
1246
+ Failure_UndefinedError = 2,
1247
+ Failure_UsageError = 3
1141
1248
  }
1142
1249
  type Failure = {
1143
1250
  code?: FailureType;
1144
1251
  message?: string;
1252
+ subcode?: number;
1145
1253
  };
1146
1254
  declare enum Enum_ButtonRequestType {
1147
1255
  ButtonRequest_Other = 1,
@@ -1899,11 +2007,17 @@ type KaspaAddress = {
1899
2007
  };
1900
2008
  type KaspaSignTx = {
1901
2009
  address_n: number[];
1902
- raw_message: string;
2010
+ raw_message?: string;
1903
2011
  scheme?: string;
1904
2012
  prefix?: string;
1905
2013
  input_count?: number;
1906
2014
  use_tweak?: boolean;
2015
+ output_count?: number;
2016
+ version?: number;
2017
+ lock_time?: number;
2018
+ subnetwork_id?: string;
2019
+ gas?: number;
2020
+ payload_length?: number;
1907
2021
  };
1908
2022
  type KaspaTxInputRequest = {
1909
2023
  request_index: number;
@@ -1913,6 +2027,77 @@ type KaspaTxInputAck = {
1913
2027
  address_n: number[];
1914
2028
  raw_message: string;
1915
2029
  };
2030
+ type KaspaOutpoint = {
2031
+ tx_id: string;
2032
+ index: number;
2033
+ };
2034
+ declare enum Enum_KaspaInputScriptType {
2035
+ KASPA_SPEND_P2PK_SCHNORR = 0,
2036
+ KASPA_SPEND_P2PK_ECDSA = 1
2037
+ }
2038
+ type KaspaInputScriptType = keyof typeof Enum_KaspaInputScriptType;
2039
+ declare enum Enum_KaspaOutputScriptType {
2040
+ KASPA_PAYTOADDRESS = 0,
2041
+ KASPA_PAYTOCHANGE = 1
2042
+ }
2043
+ type KaspaOutputScriptType = keyof typeof Enum_KaspaOutputScriptType;
2044
+ declare enum Enum_KaspaRequestType {
2045
+ KASPA_TX_INPUT = 0,
2046
+ KASPA_TX_OUTPUT = 1,
2047
+ KASPA_TX_PAYLOAD = 2,
2048
+ KASPA_TX_FINISHED = 3,
2049
+ KASPA_TX_PREV_META = 4
2050
+ }
2051
+ type KaspaRequestType = keyof typeof Enum_KaspaRequestType;
2052
+ type KaspaTxRequestSignature = {
2053
+ signature_index: number;
2054
+ signature: string;
2055
+ };
2056
+ type KaspaTxRequest = {
2057
+ request_type: KaspaRequestType;
2058
+ request_index?: number;
2059
+ signature?: KaspaTxRequestSignature;
2060
+ request_payload_length?: number;
2061
+ prev_tx_id?: string;
2062
+ };
2063
+ type KaspaTxAckInput = {
2064
+ address_n: number[];
2065
+ previous_outpoint: KaspaOutpoint;
2066
+ amount: UintType;
2067
+ sequence: number;
2068
+ sig_op_count: number;
2069
+ script_type?: KaspaInputScriptType;
2070
+ use_tweak?: boolean;
2071
+ };
2072
+ type KaspaTxAckOutput = {
2073
+ script_type?: KaspaOutputScriptType;
2074
+ amount: UintType;
2075
+ address_n: number[];
2076
+ address?: string;
2077
+ scheme?: string;
2078
+ use_tweak?: boolean;
2079
+ };
2080
+ type KaspaTxAckPayloadChunk = {
2081
+ payload_chunk: string;
2082
+ };
2083
+ type KaspaTxAckPrevMeta = {
2084
+ version: number;
2085
+ input_count: number;
2086
+ output_count: number;
2087
+ lock_time: number;
2088
+ subnetwork_id: string;
2089
+ gas: number;
2090
+ payload_length: number;
2091
+ };
2092
+ type KaspaTxAckPrevInput = {
2093
+ previous_outpoint: KaspaOutpoint;
2094
+ sequence: number;
2095
+ };
2096
+ type KaspaTxAckPrevOutput = {
2097
+ amount: UintType;
2098
+ script_version: number;
2099
+ script_public_key: string;
2100
+ };
1916
2101
  type KaspaSignedTx = {
1917
2102
  signature: string;
1918
2103
  };
@@ -1939,7 +2124,7 @@ declare enum Enum_SafetyCheckLevel {
1939
2124
  PromptAlways = 1,
1940
2125
  PromptTemporarily = 2
1941
2126
  }
1942
- type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel;
2127
+ type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel | Enum_SafetyCheckLevel;
1943
2128
  type Initialize = {
1944
2129
  session_id?: string;
1945
2130
  _skip_passphrase?: boolean;
@@ -2078,6 +2263,19 @@ type Features = {
2078
2263
  onekey_se04_state?: string | null;
2079
2264
  attach_to_pin_user?: boolean;
2080
2265
  unlocked_attach_pin?: boolean;
2266
+ coprocessor_bt_name?: string;
2267
+ coprocessor_version?: string;
2268
+ coprocessor_bt_enable?: boolean;
2269
+ romloader_version?: string;
2270
+ onekey_romloader_version?: string;
2271
+ onekey_romloader_hash?: string;
2272
+ onekey_bootloader_version?: string;
2273
+ onekey_bootloader_hash?: string;
2274
+ onekey_bootloader_build_id?: string;
2275
+ onekey_coprocessor_bt_name?: string;
2276
+ onekey_coprocessor_version?: string;
2277
+ onekey_coprocessor_build_id?: string;
2278
+ onekey_coprocessor_hash?: string;
2081
2279
  };
2082
2280
  type OnekeyFeatures = {
2083
2281
  onekey_device_type?: OneKeyDeviceType;
@@ -2124,6 +2322,28 @@ type OnekeyFeatures = {
2124
2322
  onekey_se02_boot_build_id?: string;
2125
2323
  onekey_se03_boot_build_id?: string;
2126
2324
  onekey_se04_boot_build_id?: string;
2325
+ onekey_romloader_version?: string;
2326
+ onekey_bootloader_version?: string;
2327
+ onekey_romloader_hash?: string;
2328
+ onekey_bootloader_hash?: string;
2329
+ onekey_romloader_build_id?: string;
2330
+ onekey_bootloader_build_id?: string;
2331
+ onekey_coprocessor_bt_name?: string;
2332
+ onekey_coprocessor_version?: string;
2333
+ onekey_coprocessor_build_id?: string;
2334
+ onekey_coprocessor_hash?: string;
2335
+ onekey_se01_bootloader_version?: string;
2336
+ onekey_se02_bootloader_version?: string;
2337
+ onekey_se03_bootloader_version?: string;
2338
+ onekey_se04_bootloader_version?: string;
2339
+ onekey_se01_bootloader_hash?: string;
2340
+ onekey_se02_bootloader_hash?: string;
2341
+ onekey_se03_bootloader_hash?: string;
2342
+ onekey_se04_bootloader_hash?: string;
2343
+ onekey_se01_bootloader_build_id?: string;
2344
+ onekey_se02_bootloader_build_id?: string;
2345
+ onekey_se03_bootloader_build_id?: string;
2346
+ onekey_se04_bootloader_build_id?: string;
2127
2347
  };
2128
2348
  type LockDevice = {};
2129
2349
  type EndSession = {};
@@ -2407,8 +2627,6 @@ type UnLockDeviceResponse = {
2407
2627
  };
2408
2628
  type GetPassphraseState = {
2409
2629
  passphrase_state?: string;
2410
- _only_main_pin?: boolean;
2411
- allow_create_attach_pin?: boolean;
2412
2630
  };
2413
2631
  type PassphraseState = {
2414
2632
  passphrase_state?: string;
@@ -3580,12 +3798,12 @@ type TxAckPaymentRequest = {
3580
3798
  amount?: UintType;
3581
3799
  signature: string;
3582
3800
  };
3583
- type DebugLinkInput = {
3584
- x?: number;
3585
- y?: number;
3586
- duration_ms?: number;
3587
- x_end?: number;
3588
- y_end?: number;
3801
+ type EthereumSignTypedDataQR = {
3802
+ address_n: number[];
3803
+ json_data?: string;
3804
+ chain_id?: number;
3805
+ metamask_v4_compat?: boolean;
3806
+ request_id?: string;
3589
3807
  };
3590
3808
  type InternalMyAddressRequest = {
3591
3809
  coin_type: number;
@@ -3593,6 +3811,11 @@ type InternalMyAddressRequest = {
3593
3811
  account_index: number;
3594
3812
  derive_type: number;
3595
3813
  };
3814
+ type StartSession = {
3815
+ session_id?: string;
3816
+ _skip_passphrase?: boolean;
3817
+ derive_cardano?: boolean;
3818
+ };
3596
3819
  type SetBusy = {
3597
3820
  expiry_ms?: number;
3598
3821
  };
@@ -3637,6 +3860,20 @@ declare enum MoneroNetworkType {
3637
3860
  STAGENET = 2,
3638
3861
  FAKECHAIN = 3
3639
3862
  }
3863
+ declare enum UiAnimationType {
3864
+ Unknown = 0,
3865
+ Signing = 1
3866
+ }
3867
+ declare enum UiAnimationCommand {
3868
+ CommandUnknown = 0,
3869
+ Start = 1,
3870
+ Stop = 2,
3871
+ Refresh = 3
3872
+ }
3873
+ type UiAnimationRequest = {
3874
+ command: UiAnimationCommand;
3875
+ type?: UiAnimationType;
3876
+ };
3640
3877
  type ViewAmount = {
3641
3878
  is_unlimited: boolean;
3642
3879
  num: string;
@@ -3658,28 +3895,188 @@ type ViewTip = {
3658
3895
  type: ViewTipType;
3659
3896
  text: string;
3660
3897
  };
3898
+ type ViewRawData = {
3899
+ initial_data: string;
3900
+ placeholder: number;
3901
+ };
3902
+ declare enum ViewSignLayout {
3903
+ LayoutDefault = 0,
3904
+ LayoutSafeTxCreate = 1,
3905
+ LayoutFinalConfirm = 2,
3906
+ Layout7702 = 3,
3907
+ LayoutFlat = 4,
3908
+ LayoutEthApprove = 5
3909
+ }
3661
3910
  type ViewSignPage = {
3662
3911
  title: string;
3663
3912
  amount?: UintType;
3664
3913
  general: ViewDetail[];
3665
3914
  tip?: ViewTip;
3915
+ raw_data?: ViewRawData;
3916
+ slide_to_confirm?: boolean;
3917
+ layout?: ViewSignLayout;
3666
3918
  };
3667
3919
  type ViewVerifyPage = {
3668
3920
  title: string;
3669
3921
  address: string;
3670
3922
  path: string;
3923
+ network?: string;
3924
+ derive_type?: string;
3925
+ value_key?: number;
3671
3926
  };
3672
- type GetProtoVersion = {};
3673
- type ProtoVersion = {
3674
- proto_version: number;
3927
+ type ProtocolInfoRequest = {
3928
+ eventless_wallet_session?: boolean;
3675
3929
  };
3676
- declare enum DevRebootType {
3930
+ type ProtocolInfo = {
3931
+ version: number;
3932
+ supported_messages: number[];
3933
+ protobuf_definition?: string;
3934
+ };
3935
+ declare enum DeviceErrorCode {
3936
+ DeviceError_None = 0,
3937
+ DeviceError_Busy = 1,
3938
+ DeviceError_NotInitialized = 2,
3939
+ DeviceError_ActionCancelled = 3,
3940
+ DeviceError_PinAlreadyUsed = 4,
3941
+ DeviceError_PersistFailed = 5,
3942
+ DeviceError_SeError = 6,
3943
+ DeviceError_InvalidLanguage = 7,
3944
+ DeviceError_WallpaperNotUsable = 8,
3945
+ DeviceError_DeviceLocked = 9
3946
+ }
3947
+ declare enum DeviceRebootType {
3677
3948
  Normal = 0,
3678
- Boardloader = 1,
3949
+ Romloader = 1,
3679
3950
  Bootloader = 2
3680
3951
  }
3681
- type DevReboot = {
3682
- reboot_type: DevRebootType;
3952
+ type DeviceReboot = {
3953
+ reboot_type: DeviceRebootType;
3954
+ };
3955
+ type DeviceSettings = {
3956
+ bt_enable?: boolean;
3957
+ language?: string;
3958
+ wallpaper_path?: string;
3959
+ brightness?: number;
3960
+ animation_enable?: boolean;
3961
+ tap_to_wake?: boolean;
3962
+ haptic_feedback?: boolean;
3963
+ device_name_display_enabled?: boolean;
3964
+ airgap_mode?: boolean;
3965
+ usb_lock_enable?: boolean;
3966
+ random_keypad?: boolean;
3967
+ passphrase_enable?: boolean;
3968
+ fido_enabled?: boolean;
3969
+ autolock_delay_ms?: number;
3970
+ autoshutdown_delay_ms?: number;
3971
+ label?: string;
3972
+ };
3973
+ type DeviceSettingsGet = {};
3974
+ type DeviceSettingsSet = {
3975
+ settings: DeviceSettings;
3976
+ };
3977
+ declare enum DeviceSettingsPage {
3978
+ DeviceReset = 0,
3979
+ DevicePinChange = 1,
3980
+ DevicePassphrase = 2,
3981
+ DeviceAirgap = 3
3982
+ }
3983
+ type DeviceSettingsPageShow = {
3984
+ page: DeviceSettingsPage;
3985
+ field_name?: string;
3986
+ };
3987
+ type DeviceCertificate = {
3988
+ cert_and_pubkey: string;
3989
+ private_key?: string;
3990
+ };
3991
+ type DeviceCertificateWrite = {
3992
+ cert: DeviceCertificate;
3993
+ };
3994
+ type DeviceCertificateRead = {};
3995
+ type DeviceCertificateSignature = {
3996
+ data: string;
3997
+ };
3998
+ type DeviceCertificateSign = {
3999
+ data: string;
4000
+ };
4001
+ declare enum DeviceFirmwareTargetType {
4002
+ FW_MGMT_TARGET_INVALID = 0,
4003
+ FW_MGMT_TARGET_CRATE = 1,
4004
+ FW_MGMT_TARGET_ROMLOADER = 2,
4005
+ FW_MGMT_TARGET_BOOTLOADER = 3,
4006
+ FW_MGMT_TARGET_APPLICATION_P1 = 4,
4007
+ FW_MGMT_TARGET_APPLICATION_P2 = 5,
4008
+ FW_MGMT_TARGET_COPROCESSOR = 6,
4009
+ FW_MGMT_TARGET_SE01 = 7,
4010
+ FW_MGMT_TARGET_SE02 = 8,
4011
+ FW_MGMT_TARGET_SE03 = 9,
4012
+ FW_MGMT_TARGET_SE04 = 10
4013
+ }
4014
+ declare enum DeviceFirmwareUpdateTaskStatus {
4015
+ FW_MGMT_UPDATER_TASK_STATUS_PENDING = 0,
4016
+ FW_MGMT_UPDATER_TASK_STATUS_IN_PROGRESS = 1,
4017
+ FW_MGMT_UPDATER_TASK_STATUS_FINISHED = 2,
4018
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_FILE_NOT_FOUND = 3,
4019
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_FILE_READ = 4,
4020
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_FILE_WRITE = 5,
4021
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_VERIFY = 6,
4022
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_INSTALL = 7,
4023
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_ABORT = 8,
4024
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_BUSY = 9,
4025
+ FW_MGMT_UPDATER_TASK_STATUS_FAILED_ENTRY_OUT_OF_BOUNDS = 10
4026
+ }
4027
+ type DeviceFirmwareTarget = {
4028
+ target_id: DeviceFirmwareTargetType;
4029
+ path: string;
4030
+ };
4031
+ type DeviceFirmwareUpdateRequest = {
4032
+ targets: DeviceFirmwareTarget[];
4033
+ };
4034
+ type DeviceFirmwareUpdateRecord = {
4035
+ target_id: DeviceFirmwareTargetType;
4036
+ status?: DeviceFirmwareUpdateTaskStatus;
4037
+ payload_version?: number;
4038
+ path?: string;
4039
+ };
4040
+ type DeviceFirmwareUpdateRecordFields = {
4041
+ status?: boolean;
4042
+ payload_version?: boolean;
4043
+ path?: boolean;
4044
+ };
4045
+ type DeviceFirmwareUpdateStatusGet = {
4046
+ fields?: DeviceFirmwareUpdateRecordFields;
4047
+ };
4048
+ type DeviceFirmwareUpdateStatus = {
4049
+ records: DeviceFirmwareUpdateRecord[];
4050
+ };
4051
+ declare enum DeviceFactoryAck {
4052
+ FACTORY_ACK_SUCCESS = 0,
4053
+ FACTORY_ACK_FAIL = 1
4054
+ }
4055
+ type DeviceFactoryInfoManufactureTime = {
4056
+ year: number;
4057
+ month: number;
4058
+ day: number;
4059
+ hour: number;
4060
+ minute: number;
4061
+ second: number;
4062
+ };
4063
+ type DeviceFactoryInfo = {
4064
+ version?: number;
4065
+ serial_number?: string;
4066
+ burn_in_completed?: boolean;
4067
+ factory_test_completed?: boolean;
4068
+ manufacture_time?: DeviceFactoryInfoManufactureTime;
4069
+ };
4070
+ type DeviceFactoryInfoSet = {
4071
+ info: DeviceFactoryInfo;
4072
+ };
4073
+ type DeviceFactoryInfoGet = {};
4074
+ type DeviceFactoryPermanentLock = {
4075
+ check_a: string;
4076
+ check_b: string;
4077
+ };
4078
+ type DeviceFactoryTest = {
4079
+ burn_in_test: boolean;
3683
4080
  };
3684
4081
  declare enum DeviceType {
3685
4082
  CLASSIC1 = 0,
@@ -3687,130 +4084,166 @@ declare enum DeviceType {
3687
4084
  MINI = 2,
3688
4085
  TOUCH = 3,
3689
4086
  PRO = 5,
3690
- CLASSIC1S_PURE = 6
4087
+ CLASSIC1S_PURE = 6,
4088
+ PRO2 = 7,
4089
+ NEO = 8
3691
4090
  }
3692
- declare enum DevSeType {
4091
+ declare enum DeviceSeType {
3693
4092
  THD89 = 0,
3694
4093
  SE608A = 1
3695
4094
  }
3696
- declare enum DevSEState {
4095
+ declare enum DeviceSEState {
3697
4096
  BOOT = 0,
3698
4097
  APP_FACTORY = 51,
3699
4098
  APP = 85
3700
4099
  }
3701
- type DevFirmwareImageInfo = {
4100
+ type DeviceFirmwareImageInfo = {
3702
4101
  version?: string;
3703
4102
  build_id?: string;
3704
4103
  hash?: string;
3705
4104
  };
3706
- type DevHardwareInfo = {
3707
- device_type?: DeviceType;
4105
+ type DeviceHardwareInfo = {
4106
+ Device_type?: DeviceType;
3708
4107
  serial_no?: string;
3709
- device_id?: string;
3710
4108
  hardware_version?: string;
3711
4109
  hardware_version_raw_adc?: number;
3712
4110
  };
3713
- type DevMainMcuInfo = {
3714
- board?: DevFirmwareImageInfo;
3715
- boot?: DevFirmwareImageInfo;
3716
- app?: DevFirmwareImageInfo;
3717
- };
3718
- type DevBluetoothInfo = {
3719
- boot?: DevFirmwareImageInfo;
3720
- app?: DevFirmwareImageInfo;
3721
- adv_name?: string;
3722
- mac?: string;
3723
- };
3724
- type DevSEInfo = {
3725
- boot?: DevFirmwareImageInfo;
3726
- app?: DevFirmwareImageInfo;
3727
- type?: DevSeType;
3728
- state?: DevSEState;
3729
- };
3730
- type DevInfoTargets = {
4111
+ type DeviceMainMcuInfo = {
4112
+ romloader?: DeviceFirmwareImageInfo;
4113
+ bootloader?: DeviceFirmwareImageInfo;
4114
+ application?: DeviceFirmwareImageInfo;
4115
+ application_data?: DeviceFirmwareImageInfo;
4116
+ };
4117
+ type DeviceCoprocessorInfo = {
4118
+ bootloader?: DeviceFirmwareImageInfo;
4119
+ application?: DeviceFirmwareImageInfo;
4120
+ bt_adv_name?: string;
4121
+ bt_mac?: string;
4122
+ };
4123
+ type DeviceSEInfo = {
4124
+ bootloader?: DeviceFirmwareImageInfo;
4125
+ application?: DeviceFirmwareImageInfo;
4126
+ type?: DeviceSeType;
4127
+ state?: DeviceSEState;
4128
+ };
4129
+ type DeviceInfoTargets = {
3731
4130
  hw?: boolean;
3732
4131
  fw?: boolean;
3733
- bt?: boolean;
4132
+ coprocessor?: boolean;
3734
4133
  se1?: boolean;
3735
4134
  se2?: boolean;
3736
4135
  se3?: boolean;
3737
4136
  se4?: boolean;
3738
4137
  status?: boolean;
3739
4138
  };
3740
- type DevInfoTypes = {
4139
+ type DeviceInfoTypes = {
3741
4140
  version?: boolean;
3742
4141
  build_id?: boolean;
3743
4142
  hash?: boolean;
3744
4143
  specific?: boolean;
3745
4144
  };
3746
- type DevStatus = {
3747
- language?: string;
3748
- bt_enable?: boolean;
3749
- init_states?: boolean;
3750
- backup_required?: boolean;
3751
- passphrase_protection?: boolean;
3752
- label?: string;
3753
- };
3754
- type DevGetDeviceInfo = {
3755
- targets?: DevInfoTargets;
3756
- types?: DevInfoTypes;
4145
+ type DeviceInfoGet = {
4146
+ targets?: DeviceInfoTargets;
4147
+ types?: DeviceInfoTypes;
3757
4148
  };
3758
4149
  type ProtocolV2DeviceInfo = {
3759
4150
  protocol_version: number;
3760
- hw?: DevHardwareInfo;
3761
- fw?: DevMainMcuInfo;
3762
- bt?: DevBluetoothInfo;
3763
- se1?: DevSEInfo;
3764
- se2?: DevSEInfo;
3765
- se3?: DevSEInfo;
3766
- se4?: DevSEInfo;
3767
- status?: DevStatus;
3768
- };
3769
- declare enum DevFirmwareTargetType {
3770
- TARGET_MAIN_APP = 0,
3771
- TARGET_MAIN_BOOT = 1,
3772
- TARGET_BT = 2,
3773
- TARGET_SE1 = 3,
3774
- TARGET_SE2 = 4,
3775
- TARGET_SE3 = 5,
3776
- TARGET_SE4 = 6,
3777
- TARGET_RESOURCE = 10
4151
+ hw?: DeviceHardwareInfo;
4152
+ fw?: DeviceMainMcuInfo;
4153
+ coprocessor?: DeviceCoprocessorInfo;
4154
+ se1?: DeviceSEInfo;
4155
+ se2?: DeviceSEInfo;
4156
+ se3?: DeviceSEInfo;
4157
+ se4?: DeviceSEInfo;
4158
+ status?: DeviceStatus;
4159
+ };
4160
+ declare enum DeviceSessionErrorCode {
4161
+ DeviceSessionError_None = 0,
4162
+ DeviceSessionError_UserCancelled = 1,
4163
+ DeviceSessionError_InvalidSession = 2,
4164
+ DeviceSessionError_AttachPinUnavailable = 3,
4165
+ DeviceSessionError_PassphraseDisabled = 4,
4166
+ DeviceSessionError_Busy = 5
3778
4167
  }
3779
- type DevFirmwareTarget = {
3780
- target_id: DevFirmwareTargetType;
3781
- path: string;
3782
- };
3783
- type DevFirmwareUpdate = {
3784
- targets: DevFirmwareTarget[];
3785
- };
3786
- type DevFirmwareInstallProgress = {
3787
- target_id: DevFirmwareTargetType;
3788
- progress: number;
3789
- stage?: string;
3790
- };
3791
- type DevFirmwareUpdateStatusEntry = {
3792
- target_id: DevFirmwareTargetType;
3793
- status: number;
4168
+ type DeviceSessionGet = {
4169
+ session_id?: string;
3794
4170
  };
3795
- type DevGetFirmwareUpdateStatus = {};
3796
- type DevFirmwareUpdateStatus = {
3797
- targets: DevFirmwareUpdateStatusEntry[];
4171
+ type DeviceSession = {
4172
+ session_id?: string;
4173
+ btc_test_address?: string;
3798
4174
  };
3799
- type FactoryDeviceInfoSettings = {
3800
- serial_no?: string;
3801
- cpu_info?: string;
3802
- pre_firmware?: string;
4175
+ declare enum DeviceSessionPinType {
4176
+ Any = 1,
4177
+ Main = 2,
4178
+ AttachToPin = 3
4179
+ }
4180
+ type DeviceSessionAskPin = {
4181
+ type?: DeviceSessionPinType;
3803
4182
  };
3804
- type FactoryGetDeviceInfo = {};
3805
- type FactoryDeviceInfo = {
3806
- serial_no?: string;
3807
- spi_flash_info?: string;
3808
- se_info?: string;
3809
- nft_voucher?: string;
3810
- cpu_info?: string;
3811
- pre_firmware?: string;
4183
+ type DeviceSessionAskPassphrase = {
4184
+ passphrase?: string;
3812
4185
  };
3813
- type FilesystemFixPermission = {};
4186
+ declare enum DeviceSessionAskPin_FailureSubCodes {
4187
+ UserCancel = 1
4188
+ }
4189
+ type DeviceStatus = {
4190
+ device_id?: string;
4191
+ unlocked?: boolean;
4192
+ init_states?: boolean;
4193
+ backup_required?: boolean;
4194
+ passphrase_enabled?: boolean;
4195
+ attach_to_pin_enabled?: boolean;
4196
+ unlocked_by_attach_to_pin?: boolean;
4197
+ };
4198
+ type DeviceStatusGet = {};
4199
+ declare enum DevOnboardingStep {
4200
+ DEV_ONBOARDING_STEP_UNKNOWN = 0,
4201
+ DEV_ONBOARDING_STEP_CHECKING = 1,
4202
+ DEV_ONBOARDING_STEP_PERSONALIZATION = 2,
4203
+ DEV_ONBOARDING_STEP_PIN = 3,
4204
+ DEV_ONBOARDING_STEP_SETUP = 4,
4205
+ DEV_ONBOARDING_STEP_DONE = 5
4206
+ }
4207
+ declare enum DevOnboardingPhase {
4208
+ DEV_ONBOARDING_PHASE_UNKNOWN = 0,
4209
+ DEV_ONBOARDING_PHASE_SAFETY_CHECK = 1,
4210
+ DEV_ONBOARDING_PHASE_PIN_SETUP = 2,
4211
+ DEV_ONBOARDING_PHASE_FINGERPRINT_SETUP = 3,
4212
+ DEV_ONBOARDING_PHASE_SETUP_CHOICE = 4,
4213
+ DEV_ONBOARDING_PHASE_WALLET_CREATE_START = 5,
4214
+ DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_VIEW = 6,
4215
+ DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_CONFIRM = 7,
4216
+ DEV_ONBOARDING_PHASE_RESTORE_METHOD_CHOICE = 8,
4217
+ DEV_ONBOARDING_PHASE_RECOVERY_PHRASE_RESTORE = 9,
4218
+ DEV_ONBOARDING_PHASE_SEEDCARD_RESTORE = 10,
4219
+ DEV_ONBOARDING_PHASE_WALLET_READY = 11,
4220
+ DEV_ONBOARDING_PHASE_SEEDCARD_BACKUP_PROMPT = 12,
4221
+ DEV_ONBOARDING_PHASE_SEEDCARD_BACKUP = 13
4222
+ }
4223
+ declare enum DevOnboardingSetupKind {
4224
+ DEV_ONBOARDING_SETUP_KIND_UNKNOWN = 0,
4225
+ DEV_ONBOARDING_SETUP_KIND_CHOICE = 1,
4226
+ DEV_ONBOARDING_SETUP_KIND_CREATE = 2,
4227
+ DEV_ONBOARDING_SETUP_KIND_RESTORE = 3
4228
+ }
4229
+ declare enum DevOnboardingSetupMethod {
4230
+ DEV_ONBOARDING_SETUP_METHOD_UNKNOWN = 0,
4231
+ DEV_ONBOARDING_SETUP_METHOD_RECOVERY_PHRASE = 1,
4232
+ DEV_ONBOARDING_SETUP_METHOD_SEEDCARD = 2
4233
+ }
4234
+ type DevOnboardingSetupStatus = {
4235
+ kind?: DevOnboardingSetupKind;
4236
+ method?: DevOnboardingSetupMethod;
4237
+ };
4238
+ type DevGetOnboardingStatus = {};
4239
+ type DevOnboardingStatus = {
4240
+ step?: DevOnboardingStep;
4241
+ phase?: DevOnboardingPhase;
4242
+ setup?: DevOnboardingSetupStatus;
4243
+ pin_set?: boolean;
4244
+ wallet_initialized?: boolean;
4245
+ };
4246
+ type FilesystemPermissionFix = {};
3814
4247
  type FilesystemPathInfo = {
3815
4248
  exist: boolean;
3816
4249
  size: number;
@@ -3866,32 +4299,40 @@ type FilesystemDirMake = {
3866
4299
  type FilesystemDirRemove = {
3867
4300
  path: string;
3868
4301
  };
3869
- type FilesystemFormat = {};
3870
- declare enum OnboardingStep {
3871
- ONBOARDING_STEP_UNKNOWN = 0,
3872
- ONBOARDING_STEP_DEVICE_VERIFICATION = 1,
3873
- ONBOARDING_STEP_PERSONALIZATION = 2,
3874
- ONBOARDING_STEP_SETUP = 3,
3875
- ONBOARDING_STEP_FIRMWARE = 4
4302
+ type FilesystemFormat = {
4303
+ data: boolean;
4304
+ user: boolean;
4305
+ };
4306
+ type PortfolioUpdate = {};
4307
+ declare enum ProtocolV2FailureType {
4308
+ Failure_InvalidMessage = 1,
4309
+ Failure_UndefinedError = 2,
4310
+ Failure_UsageError = 3,
4311
+ Failure_DataError = 4,
4312
+ Failure_ProcessError = 5
3876
4313
  }
3877
- type GetOnboardingStatus = {};
3878
- type NewDevice = {
3879
- seedcard_backup?: boolean;
3880
- };
3881
- type Restore = {
3882
- mnemonic?: boolean;
3883
- seedcard?: boolean;
3884
- };
3885
- type Setup = {
3886
- new_device?: NewDevice;
3887
- restore?: Restore;
3888
- };
3889
- type OnboardingStatus = {
3890
- step: OnboardingStep;
3891
- setup?: Setup;
3892
- detail_code?: number;
3893
- detail_str?: string;
3894
- };
4314
+ declare enum Enum_ProtocolV2Capability {
4315
+ Capability_Bitcoin = 1,
4316
+ Capability_Bitcoin_like = 2,
4317
+ Capability_Binance = 3,
4318
+ Capability_Cardano = 4,
4319
+ Capability_Crypto = 5,
4320
+ Capability_EOS = 6,
4321
+ Capability_Ethereum = 7,
4322
+ Capability_Lisk = 8,
4323
+ Capability_Monero = 9,
4324
+ Capability_NEM = 10,
4325
+ Capability_Ripple = 11,
4326
+ Capability_Stellar = 12,
4327
+ Capability_Tezos = 13,
4328
+ Capability_U2F = 14,
4329
+ Capability_Shamir = 15,
4330
+ Capability_ShamirGroups = 16,
4331
+ Capability_PassphraseEntry = 17,
4332
+ Capability_AttachToPin = 18,
4333
+ Capability_EthereumTypedData = 1000
4334
+ }
4335
+ type ProtocolV2Capability = keyof typeof Enum_ProtocolV2Capability;
3895
4336
  type MessageType = {
3896
4337
  AlephiumGetAddress: AlephiumGetAddress;
3897
4338
  AlephiumAddress: AlephiumAddress;
@@ -4166,6 +4607,15 @@ type MessageType = {
4166
4607
  KaspaSignTx: KaspaSignTx;
4167
4608
  KaspaTxInputRequest: KaspaTxInputRequest;
4168
4609
  KaspaTxInputAck: KaspaTxInputAck;
4610
+ KaspaOutpoint: KaspaOutpoint;
4611
+ KaspaTxRequestSignature: KaspaTxRequestSignature;
4612
+ KaspaTxRequest: KaspaTxRequest;
4613
+ KaspaTxAckInput: KaspaTxAckInput;
4614
+ KaspaTxAckOutput: KaspaTxAckOutput;
4615
+ KaspaTxAckPayloadChunk: KaspaTxAckPayloadChunk;
4616
+ KaspaTxAckPrevMeta: KaspaTxAckPrevMeta;
4617
+ KaspaTxAckPrevInput: KaspaTxAckPrevInput;
4618
+ KaspaTxAckPrevOutput: KaspaTxAckPrevOutput;
4169
4619
  KaspaSignedTx: KaspaSignedTx;
4170
4620
  LnurlAuth: LnurlAuth;
4171
4621
  LnurlAuthResp: LnurlAuthResp;
@@ -4455,8 +4905,9 @@ type MessageType = {
4455
4905
  CoinPurchaseMemo: CoinPurchaseMemo;
4456
4906
  PaymentRequestMemo: PaymentRequestMemo;
4457
4907
  TxAckPaymentRequest: TxAckPaymentRequest;
4458
- DebugLinkInput: DebugLinkInput;
4908
+ EthereumSignTypedDataQR: EthereumSignTypedDataQR;
4459
4909
  InternalMyAddressRequest: InternalMyAddressRequest;
4910
+ StartSession: StartSession;
4460
4911
  SetBusy: SetBusy;
4461
4912
  GetFirmwareHash: GetFirmwareHash;
4462
4913
  FirmwareHash: FirmwareHash;
@@ -4468,33 +4919,55 @@ type MessageType = {
4468
4919
  Wallpaper: Wallpaper;
4469
4920
  UnlockPath: UnlockPath;
4470
4921
  UnlockedPathRequest: UnlockedPathRequest;
4922
+ UiAnimationRequest: UiAnimationRequest;
4471
4923
  ViewAmount: ViewAmount;
4472
4924
  ViewDetail: ViewDetail;
4473
4925
  ViewTip: ViewTip;
4926
+ ViewRawData: ViewRawData;
4474
4927
  ViewSignPage: ViewSignPage;
4475
4928
  ViewVerifyPage: ViewVerifyPage;
4476
- GetProtoVersion: GetProtoVersion;
4477
- ProtoVersion: ProtoVersion;
4478
- DevReboot: DevReboot;
4479
- DevFirmwareImageInfo: DevFirmwareImageInfo;
4480
- DevHardwareInfo: DevHardwareInfo;
4481
- DevMainMcuInfo: DevMainMcuInfo;
4482
- DevBluetoothInfo: DevBluetoothInfo;
4483
- DevSEInfo: DevSEInfo;
4484
- DevInfoTargets: DevInfoTargets;
4485
- DevInfoTypes: DevInfoTypes;
4486
- DevStatus: DevStatus;
4487
- DevGetDeviceInfo: DevGetDeviceInfo;
4488
- DevFirmwareTarget: DevFirmwareTarget;
4489
- DevFirmwareUpdate: DevFirmwareUpdate;
4490
- DevFirmwareInstallProgress: DevFirmwareInstallProgress;
4491
- DevFirmwareUpdateStatusEntry: DevFirmwareUpdateStatusEntry;
4492
- DevGetFirmwareUpdateStatus: DevGetFirmwareUpdateStatus;
4493
- DevFirmwareUpdateStatus: DevFirmwareUpdateStatus;
4494
- FactoryDeviceInfoSettings: FactoryDeviceInfoSettings;
4495
- FactoryGetDeviceInfo: FactoryGetDeviceInfo;
4496
- FactoryDeviceInfo: FactoryDeviceInfo;
4497
- FilesystemFixPermission: FilesystemFixPermission;
4929
+ ProtocolInfoRequest: ProtocolInfoRequest;
4930
+ ProtocolInfo: ProtocolInfo;
4931
+ DeviceReboot: DeviceReboot;
4932
+ DeviceSettings: DeviceSettings;
4933
+ DeviceSettingsGet: DeviceSettingsGet;
4934
+ DeviceSettingsSet: DeviceSettingsSet;
4935
+ DeviceSettingsPageShow: DeviceSettingsPageShow;
4936
+ DeviceCertificate: DeviceCertificate;
4937
+ DeviceCertificateWrite: DeviceCertificateWrite;
4938
+ DeviceCertificateRead: DeviceCertificateRead;
4939
+ DeviceCertificateSignature: DeviceCertificateSignature;
4940
+ DeviceCertificateSign: DeviceCertificateSign;
4941
+ DeviceFirmwareTarget: DeviceFirmwareTarget;
4942
+ DeviceFirmwareUpdateRequest: DeviceFirmwareUpdateRequest;
4943
+ DeviceFirmwareUpdateRecord: DeviceFirmwareUpdateRecord;
4944
+ DeviceFirmwareUpdateRecordFields: DeviceFirmwareUpdateRecordFields;
4945
+ DeviceFirmwareUpdateStatusGet: DeviceFirmwareUpdateStatusGet;
4946
+ DeviceFirmwareUpdateStatus: DeviceFirmwareUpdateStatus;
4947
+ DeviceFactoryInfoManufactureTime: DeviceFactoryInfoManufactureTime;
4948
+ DeviceFactoryInfo: DeviceFactoryInfo;
4949
+ DeviceFactoryInfoSet: DeviceFactoryInfoSet;
4950
+ DeviceFactoryInfoGet: DeviceFactoryInfoGet;
4951
+ DeviceFactoryPermanentLock: DeviceFactoryPermanentLock;
4952
+ DeviceFactoryTest: DeviceFactoryTest;
4953
+ DeviceFirmwareImageInfo: DeviceFirmwareImageInfo;
4954
+ DeviceHardwareInfo: DeviceHardwareInfo;
4955
+ DeviceMainMcuInfo: DeviceMainMcuInfo;
4956
+ DeviceCoprocessorInfo: DeviceCoprocessorInfo;
4957
+ DeviceSEInfo: DeviceSEInfo;
4958
+ DeviceInfoTargets: DeviceInfoTargets;
4959
+ DeviceInfoTypes: DeviceInfoTypes;
4960
+ DeviceInfoGet: DeviceInfoGet;
4961
+ DeviceSessionGet: DeviceSessionGet;
4962
+ DeviceSession: DeviceSession;
4963
+ DeviceSessionAskPin: DeviceSessionAskPin;
4964
+ DeviceSessionAskPassphrase: DeviceSessionAskPassphrase;
4965
+ DeviceStatus: DeviceStatus;
4966
+ DeviceStatusGet: DeviceStatusGet;
4967
+ DevOnboardingSetupStatus: DevOnboardingSetupStatus;
4968
+ DevGetOnboardingStatus: DevGetOnboardingStatus;
4969
+ DevOnboardingStatus: DevOnboardingStatus;
4970
+ FilesystemPermissionFix: FilesystemPermissionFix;
4498
4971
  FilesystemPathInfo: FilesystemPathInfo;
4499
4972
  FilesystemPathInfoQuery: FilesystemPathInfoQuery;
4500
4973
  FilesystemFile: FilesystemFile;
@@ -4506,11 +4979,7 @@ type MessageType = {
4506
4979
  FilesystemDirMake: FilesystemDirMake;
4507
4980
  FilesystemDirRemove: FilesystemDirRemove;
4508
4981
  FilesystemFormat: FilesystemFormat;
4509
- GetOnboardingStatus: GetOnboardingStatus;
4510
- NewDevice: NewDevice;
4511
- Restore: Restore;
4512
- Setup: Setup;
4513
- OnboardingStatus: OnboardingStatus;
4982
+ PortfolioUpdate: PortfolioUpdate;
4514
4983
  };
4515
4984
  type MessageKey = keyof MessageType;
4516
4985
  type MessageResponse<T extends MessageKey> = {
@@ -4867,6 +5336,24 @@ type messages_KaspaAddress = KaspaAddress;
4867
5336
  type messages_KaspaSignTx = KaspaSignTx;
4868
5337
  type messages_KaspaTxInputRequest = KaspaTxInputRequest;
4869
5338
  type messages_KaspaTxInputAck = KaspaTxInputAck;
5339
+ type messages_KaspaOutpoint = KaspaOutpoint;
5340
+ type messages_Enum_KaspaInputScriptType = Enum_KaspaInputScriptType;
5341
+ declare const messages_Enum_KaspaInputScriptType: typeof Enum_KaspaInputScriptType;
5342
+ type messages_KaspaInputScriptType = KaspaInputScriptType;
5343
+ type messages_Enum_KaspaOutputScriptType = Enum_KaspaOutputScriptType;
5344
+ declare const messages_Enum_KaspaOutputScriptType: typeof Enum_KaspaOutputScriptType;
5345
+ type messages_KaspaOutputScriptType = KaspaOutputScriptType;
5346
+ type messages_Enum_KaspaRequestType = Enum_KaspaRequestType;
5347
+ declare const messages_Enum_KaspaRequestType: typeof Enum_KaspaRequestType;
5348
+ type messages_KaspaRequestType = KaspaRequestType;
5349
+ type messages_KaspaTxRequestSignature = KaspaTxRequestSignature;
5350
+ type messages_KaspaTxRequest = KaspaTxRequest;
5351
+ type messages_KaspaTxAckInput = KaspaTxAckInput;
5352
+ type messages_KaspaTxAckOutput = KaspaTxAckOutput;
5353
+ type messages_KaspaTxAckPayloadChunk = KaspaTxAckPayloadChunk;
5354
+ type messages_KaspaTxAckPrevMeta = KaspaTxAckPrevMeta;
5355
+ type messages_KaspaTxAckPrevInput = KaspaTxAckPrevInput;
5356
+ type messages_KaspaTxAckPrevOutput = KaspaTxAckPrevOutput;
4870
5357
  type messages_KaspaSignedTx = KaspaSignedTx;
4871
5358
  type messages_LnurlAuth = LnurlAuth;
4872
5359
  type messages_LnurlAuthResp = LnurlAuthResp;
@@ -5222,8 +5709,9 @@ type messages_RefundMemo = RefundMemo;
5222
5709
  type messages_CoinPurchaseMemo = CoinPurchaseMemo;
5223
5710
  type messages_PaymentRequestMemo = PaymentRequestMemo;
5224
5711
  type messages_TxAckPaymentRequest = TxAckPaymentRequest;
5225
- type messages_DebugLinkInput = DebugLinkInput;
5712
+ type messages_EthereumSignTypedDataQR = EthereumSignTypedDataQR;
5226
5713
  type messages_InternalMyAddressRequest = InternalMyAddressRequest;
5714
+ type messages_StartSession = StartSession;
5227
5715
  type messages_SetBusy = SetBusy;
5228
5716
  type messages_GetFirmwareHash = GetFirmwareHash;
5229
5717
  type messages_FirmwareHash = FirmwareHash;
@@ -5239,46 +5727,96 @@ type messages_UnlockPath = UnlockPath;
5239
5727
  type messages_UnlockedPathRequest = UnlockedPathRequest;
5240
5728
  type messages_MoneroNetworkType = MoneroNetworkType;
5241
5729
  declare const messages_MoneroNetworkType: typeof MoneroNetworkType;
5730
+ type messages_UiAnimationType = UiAnimationType;
5731
+ declare const messages_UiAnimationType: typeof UiAnimationType;
5732
+ type messages_UiAnimationCommand = UiAnimationCommand;
5733
+ declare const messages_UiAnimationCommand: typeof UiAnimationCommand;
5734
+ type messages_UiAnimationRequest = UiAnimationRequest;
5242
5735
  type messages_ViewAmount = ViewAmount;
5243
5736
  type messages_ViewDetail = ViewDetail;
5244
5737
  type messages_ViewTipType = ViewTipType;
5245
5738
  declare const messages_ViewTipType: typeof ViewTipType;
5246
5739
  type messages_ViewTip = ViewTip;
5740
+ type messages_ViewRawData = ViewRawData;
5741
+ type messages_ViewSignLayout = ViewSignLayout;
5742
+ declare const messages_ViewSignLayout: typeof ViewSignLayout;
5247
5743
  type messages_ViewSignPage = ViewSignPage;
5248
5744
  type messages_ViewVerifyPage = ViewVerifyPage;
5249
- type messages_GetProtoVersion = GetProtoVersion;
5250
- type messages_ProtoVersion = ProtoVersion;
5251
- type messages_DevRebootType = DevRebootType;
5252
- declare const messages_DevRebootType: typeof DevRebootType;
5253
- type messages_DevReboot = DevReboot;
5745
+ type messages_ProtocolInfoRequest = ProtocolInfoRequest;
5746
+ type messages_ProtocolInfo = ProtocolInfo;
5747
+ type messages_DeviceErrorCode = DeviceErrorCode;
5748
+ declare const messages_DeviceErrorCode: typeof DeviceErrorCode;
5749
+ type messages_DeviceRebootType = DeviceRebootType;
5750
+ declare const messages_DeviceRebootType: typeof DeviceRebootType;
5751
+ type messages_DeviceReboot = DeviceReboot;
5752
+ type messages_DeviceSettings = DeviceSettings;
5753
+ type messages_DeviceSettingsGet = DeviceSettingsGet;
5754
+ type messages_DeviceSettingsSet = DeviceSettingsSet;
5755
+ type messages_DeviceSettingsPage = DeviceSettingsPage;
5756
+ declare const messages_DeviceSettingsPage: typeof DeviceSettingsPage;
5757
+ type messages_DeviceSettingsPageShow = DeviceSettingsPageShow;
5758
+ type messages_DeviceCertificate = DeviceCertificate;
5759
+ type messages_DeviceCertificateWrite = DeviceCertificateWrite;
5760
+ type messages_DeviceCertificateRead = DeviceCertificateRead;
5761
+ type messages_DeviceCertificateSignature = DeviceCertificateSignature;
5762
+ type messages_DeviceCertificateSign = DeviceCertificateSign;
5763
+ type messages_DeviceFirmwareTargetType = DeviceFirmwareTargetType;
5764
+ declare const messages_DeviceFirmwareTargetType: typeof DeviceFirmwareTargetType;
5765
+ type messages_DeviceFirmwareUpdateTaskStatus = DeviceFirmwareUpdateTaskStatus;
5766
+ declare const messages_DeviceFirmwareUpdateTaskStatus: typeof DeviceFirmwareUpdateTaskStatus;
5767
+ type messages_DeviceFirmwareTarget = DeviceFirmwareTarget;
5768
+ type messages_DeviceFirmwareUpdateRequest = DeviceFirmwareUpdateRequest;
5769
+ type messages_DeviceFirmwareUpdateRecord = DeviceFirmwareUpdateRecord;
5770
+ type messages_DeviceFirmwareUpdateRecordFields = DeviceFirmwareUpdateRecordFields;
5771
+ type messages_DeviceFirmwareUpdateStatusGet = DeviceFirmwareUpdateStatusGet;
5772
+ type messages_DeviceFirmwareUpdateStatus = DeviceFirmwareUpdateStatus;
5773
+ type messages_DeviceFactoryAck = DeviceFactoryAck;
5774
+ declare const messages_DeviceFactoryAck: typeof DeviceFactoryAck;
5775
+ type messages_DeviceFactoryInfoManufactureTime = DeviceFactoryInfoManufactureTime;
5776
+ type messages_DeviceFactoryInfo = DeviceFactoryInfo;
5777
+ type messages_DeviceFactoryInfoSet = DeviceFactoryInfoSet;
5778
+ type messages_DeviceFactoryInfoGet = DeviceFactoryInfoGet;
5779
+ type messages_DeviceFactoryPermanentLock = DeviceFactoryPermanentLock;
5780
+ type messages_DeviceFactoryTest = DeviceFactoryTest;
5254
5781
  type messages_DeviceType = DeviceType;
5255
5782
  declare const messages_DeviceType: typeof DeviceType;
5256
- type messages_DevSeType = DevSeType;
5257
- declare const messages_DevSeType: typeof DevSeType;
5258
- type messages_DevSEState = DevSEState;
5259
- declare const messages_DevSEState: typeof DevSEState;
5260
- type messages_DevFirmwareImageInfo = DevFirmwareImageInfo;
5261
- type messages_DevHardwareInfo = DevHardwareInfo;
5262
- type messages_DevMainMcuInfo = DevMainMcuInfo;
5263
- type messages_DevBluetoothInfo = DevBluetoothInfo;
5264
- type messages_DevSEInfo = DevSEInfo;
5265
- type messages_DevInfoTargets = DevInfoTargets;
5266
- type messages_DevInfoTypes = DevInfoTypes;
5267
- type messages_DevStatus = DevStatus;
5268
- type messages_DevGetDeviceInfo = DevGetDeviceInfo;
5783
+ type messages_DeviceSeType = DeviceSeType;
5784
+ declare const messages_DeviceSeType: typeof DeviceSeType;
5785
+ type messages_DeviceSEState = DeviceSEState;
5786
+ declare const messages_DeviceSEState: typeof DeviceSEState;
5787
+ type messages_DeviceFirmwareImageInfo = DeviceFirmwareImageInfo;
5788
+ type messages_DeviceHardwareInfo = DeviceHardwareInfo;
5789
+ type messages_DeviceMainMcuInfo = DeviceMainMcuInfo;
5790
+ type messages_DeviceCoprocessorInfo = DeviceCoprocessorInfo;
5791
+ type messages_DeviceSEInfo = DeviceSEInfo;
5792
+ type messages_DeviceInfoTargets = DeviceInfoTargets;
5793
+ type messages_DeviceInfoTypes = DeviceInfoTypes;
5794
+ type messages_DeviceInfoGet = DeviceInfoGet;
5269
5795
  type messages_ProtocolV2DeviceInfo = ProtocolV2DeviceInfo;
5270
- type messages_DevFirmwareTargetType = DevFirmwareTargetType;
5271
- declare const messages_DevFirmwareTargetType: typeof DevFirmwareTargetType;
5272
- type messages_DevFirmwareTarget = DevFirmwareTarget;
5273
- type messages_DevFirmwareUpdate = DevFirmwareUpdate;
5274
- type messages_DevFirmwareInstallProgress = DevFirmwareInstallProgress;
5275
- type messages_DevFirmwareUpdateStatusEntry = DevFirmwareUpdateStatusEntry;
5276
- type messages_DevGetFirmwareUpdateStatus = DevGetFirmwareUpdateStatus;
5277
- type messages_DevFirmwareUpdateStatus = DevFirmwareUpdateStatus;
5278
- type messages_FactoryDeviceInfoSettings = FactoryDeviceInfoSettings;
5279
- type messages_FactoryGetDeviceInfo = FactoryGetDeviceInfo;
5280
- type messages_FactoryDeviceInfo = FactoryDeviceInfo;
5281
- type messages_FilesystemFixPermission = FilesystemFixPermission;
5796
+ type messages_DeviceSessionErrorCode = DeviceSessionErrorCode;
5797
+ declare const messages_DeviceSessionErrorCode: typeof DeviceSessionErrorCode;
5798
+ type messages_DeviceSessionGet = DeviceSessionGet;
5799
+ type messages_DeviceSession = DeviceSession;
5800
+ type messages_DeviceSessionPinType = DeviceSessionPinType;
5801
+ declare const messages_DeviceSessionPinType: typeof DeviceSessionPinType;
5802
+ type messages_DeviceSessionAskPin = DeviceSessionAskPin;
5803
+ type messages_DeviceSessionAskPassphrase = DeviceSessionAskPassphrase;
5804
+ type messages_DeviceSessionAskPin_FailureSubCodes = DeviceSessionAskPin_FailureSubCodes;
5805
+ declare const messages_DeviceSessionAskPin_FailureSubCodes: typeof DeviceSessionAskPin_FailureSubCodes;
5806
+ type messages_DeviceStatus = DeviceStatus;
5807
+ type messages_DeviceStatusGet = DeviceStatusGet;
5808
+ type messages_DevOnboardingStep = DevOnboardingStep;
5809
+ declare const messages_DevOnboardingStep: typeof DevOnboardingStep;
5810
+ type messages_DevOnboardingPhase = DevOnboardingPhase;
5811
+ declare const messages_DevOnboardingPhase: typeof DevOnboardingPhase;
5812
+ type messages_DevOnboardingSetupKind = DevOnboardingSetupKind;
5813
+ declare const messages_DevOnboardingSetupKind: typeof DevOnboardingSetupKind;
5814
+ type messages_DevOnboardingSetupMethod = DevOnboardingSetupMethod;
5815
+ declare const messages_DevOnboardingSetupMethod: typeof DevOnboardingSetupMethod;
5816
+ type messages_DevOnboardingSetupStatus = DevOnboardingSetupStatus;
5817
+ type messages_DevGetOnboardingStatus = DevGetOnboardingStatus;
5818
+ type messages_DevOnboardingStatus = DevOnboardingStatus;
5819
+ type messages_FilesystemPermissionFix = FilesystemPermissionFix;
5282
5820
  type messages_FilesystemPathInfo = FilesystemPathInfo;
5283
5821
  type messages_FilesystemPathInfoQuery = FilesystemPathInfoQuery;
5284
5822
  type messages_FilesystemFile = FilesystemFile;
@@ -5290,13 +5828,12 @@ type messages_FilesystemDirList = FilesystemDirList;
5290
5828
  type messages_FilesystemDirMake = FilesystemDirMake;
5291
5829
  type messages_FilesystemDirRemove = FilesystemDirRemove;
5292
5830
  type messages_FilesystemFormat = FilesystemFormat;
5293
- type messages_OnboardingStep = OnboardingStep;
5294
- declare const messages_OnboardingStep: typeof OnboardingStep;
5295
- type messages_GetOnboardingStatus = GetOnboardingStatus;
5296
- type messages_NewDevice = NewDevice;
5297
- type messages_Restore = Restore;
5298
- type messages_Setup = Setup;
5299
- type messages_OnboardingStatus = OnboardingStatus;
5831
+ type messages_PortfolioUpdate = PortfolioUpdate;
5832
+ type messages_ProtocolV2FailureType = ProtocolV2FailureType;
5833
+ declare const messages_ProtocolV2FailureType: typeof ProtocolV2FailureType;
5834
+ type messages_Enum_ProtocolV2Capability = Enum_ProtocolV2Capability;
5835
+ declare const messages_Enum_ProtocolV2Capability: typeof Enum_ProtocolV2Capability;
5836
+ type messages_ProtocolV2Capability = ProtocolV2Capability;
5300
5837
  type messages_MessageType = MessageType;
5301
5838
  type messages_MessageKey = MessageKey;
5302
5839
  type messages_MessageResponse<T extends MessageKey> = MessageResponse<T>;
@@ -5617,6 +6154,21 @@ declare namespace messages {
5617
6154
  messages_KaspaSignTx as KaspaSignTx,
5618
6155
  messages_KaspaTxInputRequest as KaspaTxInputRequest,
5619
6156
  messages_KaspaTxInputAck as KaspaTxInputAck,
6157
+ messages_KaspaOutpoint as KaspaOutpoint,
6158
+ messages_Enum_KaspaInputScriptType as Enum_KaspaInputScriptType,
6159
+ messages_KaspaInputScriptType as KaspaInputScriptType,
6160
+ messages_Enum_KaspaOutputScriptType as Enum_KaspaOutputScriptType,
6161
+ messages_KaspaOutputScriptType as KaspaOutputScriptType,
6162
+ messages_Enum_KaspaRequestType as Enum_KaspaRequestType,
6163
+ messages_KaspaRequestType as KaspaRequestType,
6164
+ messages_KaspaTxRequestSignature as KaspaTxRequestSignature,
6165
+ messages_KaspaTxRequest as KaspaTxRequest,
6166
+ messages_KaspaTxAckInput as KaspaTxAckInput,
6167
+ messages_KaspaTxAckOutput as KaspaTxAckOutput,
6168
+ messages_KaspaTxAckPayloadChunk as KaspaTxAckPayloadChunk,
6169
+ messages_KaspaTxAckPrevMeta as KaspaTxAckPrevMeta,
6170
+ messages_KaspaTxAckPrevInput as KaspaTxAckPrevInput,
6171
+ messages_KaspaTxAckPrevOutput as KaspaTxAckPrevOutput,
5620
6172
  messages_KaspaSignedTx as KaspaSignedTx,
5621
6173
  messages_LnurlAuth as LnurlAuth,
5622
6174
  messages_LnurlAuthResp as LnurlAuthResp,
@@ -5941,8 +6493,9 @@ declare namespace messages {
5941
6493
  messages_CoinPurchaseMemo as CoinPurchaseMemo,
5942
6494
  messages_PaymentRequestMemo as PaymentRequestMemo,
5943
6495
  messages_TxAckPaymentRequest as TxAckPaymentRequest,
5944
- messages_DebugLinkInput as DebugLinkInput,
6496
+ messages_EthereumSignTypedDataQR as EthereumSignTypedDataQR,
5945
6497
  messages_InternalMyAddressRequest as InternalMyAddressRequest,
6498
+ messages_StartSession as StartSession,
5946
6499
  messages_SetBusy as SetBusy,
5947
6500
  messages_GetFirmwareHash as GetFirmwareHash,
5948
6501
  messages_FirmwareHash as FirmwareHash,
@@ -5956,40 +6509,76 @@ declare namespace messages {
5956
6509
  messages_UnlockPath as UnlockPath,
5957
6510
  messages_UnlockedPathRequest as UnlockedPathRequest,
5958
6511
  messages_MoneroNetworkType as MoneroNetworkType,
6512
+ messages_UiAnimationType as UiAnimationType,
6513
+ messages_UiAnimationCommand as UiAnimationCommand,
6514
+ messages_UiAnimationRequest as UiAnimationRequest,
5959
6515
  messages_ViewAmount as ViewAmount,
5960
6516
  messages_ViewDetail as ViewDetail,
5961
6517
  messages_ViewTipType as ViewTipType,
5962
6518
  messages_ViewTip as ViewTip,
6519
+ messages_ViewRawData as ViewRawData,
6520
+ messages_ViewSignLayout as ViewSignLayout,
5963
6521
  messages_ViewSignPage as ViewSignPage,
5964
6522
  messages_ViewVerifyPage as ViewVerifyPage,
5965
- messages_GetProtoVersion as GetProtoVersion,
5966
- messages_ProtoVersion as ProtoVersion,
5967
- messages_DevRebootType as DevRebootType,
5968
- messages_DevReboot as DevReboot,
6523
+ messages_ProtocolInfoRequest as ProtocolInfoRequest,
6524
+ messages_ProtocolInfo as ProtocolInfo,
6525
+ messages_DeviceErrorCode as DeviceErrorCode,
6526
+ messages_DeviceRebootType as DeviceRebootType,
6527
+ messages_DeviceReboot as DeviceReboot,
6528
+ messages_DeviceSettings as DeviceSettings,
6529
+ messages_DeviceSettingsGet as DeviceSettingsGet,
6530
+ messages_DeviceSettingsSet as DeviceSettingsSet,
6531
+ messages_DeviceSettingsPage as DeviceSettingsPage,
6532
+ messages_DeviceSettingsPageShow as DeviceSettingsPageShow,
6533
+ messages_DeviceCertificate as DeviceCertificate,
6534
+ messages_DeviceCertificateWrite as DeviceCertificateWrite,
6535
+ messages_DeviceCertificateRead as DeviceCertificateRead,
6536
+ messages_DeviceCertificateSignature as DeviceCertificateSignature,
6537
+ messages_DeviceCertificateSign as DeviceCertificateSign,
6538
+ messages_DeviceFirmwareTargetType as DeviceFirmwareTargetType,
6539
+ messages_DeviceFirmwareUpdateTaskStatus as DeviceFirmwareUpdateTaskStatus,
6540
+ messages_DeviceFirmwareTarget as DeviceFirmwareTarget,
6541
+ messages_DeviceFirmwareUpdateRequest as DeviceFirmwareUpdateRequest,
6542
+ messages_DeviceFirmwareUpdateRecord as DeviceFirmwareUpdateRecord,
6543
+ messages_DeviceFirmwareUpdateRecordFields as DeviceFirmwareUpdateRecordFields,
6544
+ messages_DeviceFirmwareUpdateStatusGet as DeviceFirmwareUpdateStatusGet,
6545
+ messages_DeviceFirmwareUpdateStatus as DeviceFirmwareUpdateStatus,
6546
+ messages_DeviceFactoryAck as DeviceFactoryAck,
6547
+ messages_DeviceFactoryInfoManufactureTime as DeviceFactoryInfoManufactureTime,
6548
+ messages_DeviceFactoryInfo as DeviceFactoryInfo,
6549
+ messages_DeviceFactoryInfoSet as DeviceFactoryInfoSet,
6550
+ messages_DeviceFactoryInfoGet as DeviceFactoryInfoGet,
6551
+ messages_DeviceFactoryPermanentLock as DeviceFactoryPermanentLock,
6552
+ messages_DeviceFactoryTest as DeviceFactoryTest,
5969
6553
  messages_DeviceType as DeviceType,
5970
- messages_DevSeType as DevSeType,
5971
- messages_DevSEState as DevSEState,
5972
- messages_DevFirmwareImageInfo as DevFirmwareImageInfo,
5973
- messages_DevHardwareInfo as DevHardwareInfo,
5974
- messages_DevMainMcuInfo as DevMainMcuInfo,
5975
- messages_DevBluetoothInfo as DevBluetoothInfo,
5976
- messages_DevSEInfo as DevSEInfo,
5977
- messages_DevInfoTargets as DevInfoTargets,
5978
- messages_DevInfoTypes as DevInfoTypes,
5979
- messages_DevStatus as DevStatus,
5980
- messages_DevGetDeviceInfo as DevGetDeviceInfo,
6554
+ messages_DeviceSeType as DeviceSeType,
6555
+ messages_DeviceSEState as DeviceSEState,
6556
+ messages_DeviceFirmwareImageInfo as DeviceFirmwareImageInfo,
6557
+ messages_DeviceHardwareInfo as DeviceHardwareInfo,
6558
+ messages_DeviceMainMcuInfo as DeviceMainMcuInfo,
6559
+ messages_DeviceCoprocessorInfo as DeviceCoprocessorInfo,
6560
+ messages_DeviceSEInfo as DeviceSEInfo,
6561
+ messages_DeviceInfoTargets as DeviceInfoTargets,
6562
+ messages_DeviceInfoTypes as DeviceInfoTypes,
6563
+ messages_DeviceInfoGet as DeviceInfoGet,
5981
6564
  messages_ProtocolV2DeviceInfo as ProtocolV2DeviceInfo,
5982
- messages_DevFirmwareTargetType as DevFirmwareTargetType,
5983
- messages_DevFirmwareTarget as DevFirmwareTarget,
5984
- messages_DevFirmwareUpdate as DevFirmwareUpdate,
5985
- messages_DevFirmwareInstallProgress as DevFirmwareInstallProgress,
5986
- messages_DevFirmwareUpdateStatusEntry as DevFirmwareUpdateStatusEntry,
5987
- messages_DevGetFirmwareUpdateStatus as DevGetFirmwareUpdateStatus,
5988
- messages_DevFirmwareUpdateStatus as DevFirmwareUpdateStatus,
5989
- messages_FactoryDeviceInfoSettings as FactoryDeviceInfoSettings,
5990
- messages_FactoryGetDeviceInfo as FactoryGetDeviceInfo,
5991
- messages_FactoryDeviceInfo as FactoryDeviceInfo,
5992
- messages_FilesystemFixPermission as FilesystemFixPermission,
6565
+ messages_DeviceSessionErrorCode as DeviceSessionErrorCode,
6566
+ messages_DeviceSessionGet as DeviceSessionGet,
6567
+ messages_DeviceSession as DeviceSession,
6568
+ messages_DeviceSessionPinType as DeviceSessionPinType,
6569
+ messages_DeviceSessionAskPin as DeviceSessionAskPin,
6570
+ messages_DeviceSessionAskPassphrase as DeviceSessionAskPassphrase,
6571
+ messages_DeviceSessionAskPin_FailureSubCodes as DeviceSessionAskPin_FailureSubCodes,
6572
+ messages_DeviceStatus as DeviceStatus,
6573
+ messages_DeviceStatusGet as DeviceStatusGet,
6574
+ messages_DevOnboardingStep as DevOnboardingStep,
6575
+ messages_DevOnboardingPhase as DevOnboardingPhase,
6576
+ messages_DevOnboardingSetupKind as DevOnboardingSetupKind,
6577
+ messages_DevOnboardingSetupMethod as DevOnboardingSetupMethod,
6578
+ messages_DevOnboardingSetupStatus as DevOnboardingSetupStatus,
6579
+ messages_DevGetOnboardingStatus as DevGetOnboardingStatus,
6580
+ messages_DevOnboardingStatus as DevOnboardingStatus,
6581
+ messages_FilesystemPermissionFix as FilesystemPermissionFix,
5993
6582
  messages_FilesystemPathInfo as FilesystemPathInfo,
5994
6583
  messages_FilesystemPathInfoQuery as FilesystemPathInfoQuery,
5995
6584
  messages_FilesystemFile as FilesystemFile,
@@ -6001,12 +6590,10 @@ declare namespace messages {
6001
6590
  messages_FilesystemDirMake as FilesystemDirMake,
6002
6591
  messages_FilesystemDirRemove as FilesystemDirRemove,
6003
6592
  messages_FilesystemFormat as FilesystemFormat,
6004
- messages_OnboardingStep as OnboardingStep,
6005
- messages_GetOnboardingStatus as GetOnboardingStatus,
6006
- messages_NewDevice as NewDevice,
6007
- messages_Restore as Restore,
6008
- messages_Setup as Setup,
6009
- messages_OnboardingStatus as OnboardingStatus,
6593
+ messages_PortfolioUpdate as PortfolioUpdate,
6594
+ messages_ProtocolV2FailureType as ProtocolV2FailureType,
6595
+ messages_Enum_ProtocolV2Capability as Enum_ProtocolV2Capability,
6596
+ messages_ProtocolV2Capability as ProtocolV2Capability,
6010
6597
  messages_MessageType as MessageType,
6011
6598
  messages_MessageKey as MessageKey,
6012
6599
  messages_MessageResponse as MessageResponse,
@@ -6015,10 +6602,22 @@ declare namespace messages {
6015
6602
  };
6016
6603
  }
6017
6604
 
6605
+ declare class ProtocolV2SequenceCursor {
6606
+ private current;
6607
+ next(): number;
6608
+ }
6609
+
6018
6610
  type ProtocolV2Schemas = {
6019
6611
  protocolV1: Root;
6020
6612
  protocolV2: Root;
6021
6613
  };
6614
+ type ProtocolV2CallContext = {
6615
+ messageName: string;
6616
+ timeoutMs?: number;
6617
+ highVolume: boolean;
6618
+ generation: number;
6619
+ signal: AbortSignal;
6620
+ };
6022
6621
  type ProtocolLogger = {
6023
6622
  debug?: (...args: any[]) => void;
6024
6623
  error?: (...args: any[]) => void;
@@ -6027,11 +6626,15 @@ type ProtocolV2SessionOptions = {
6027
6626
  schemas: ProtocolV2Schemas;
6028
6627
  router: number;
6029
6628
  packetSrc?: number;
6030
- writeFrame: (frame: Uint8Array) => Promise<void>;
6031
- readFrame: () => Promise<Uint8Array>;
6629
+ maxFrameBytes?: number;
6630
+ prepareCall?: (context: ProtocolV2CallContext) => Promise<void> | void;
6631
+ writeFrame: (frame: Uint8Array, context: ProtocolV2CallContext) => Promise<void>;
6632
+ readFrame: (context: ProtocolV2CallContext) => Promise<Uint8Array>;
6032
6633
  logger?: ProtocolLogger;
6033
6634
  logPrefix?: string;
6034
6635
  createTimeoutError?: (name: string, timeoutMs: number) => Error;
6636
+ sequenceCursor?: ProtocolV2SequenceCursor;
6637
+ generation?: number;
6035
6638
  };
6036
6639
  type ProtocolV2CallOptions = {
6037
6640
  timeoutMs?: number;
@@ -6043,12 +6646,12 @@ type ProtocolV2CallOptions = {
6043
6646
  declare function hexToBytes(hex: string): Uint8Array;
6044
6647
  declare function bytesToHex(bytes: Uint8Array): string;
6045
6648
  declare function getErrorMessage(error: unknown): string;
6046
- declare function withProtocolTimeout<T>(promise: Promise<T>, timeoutMs: number | undefined, createTimeoutError: () => Error, onTimeout?: () => void): Promise<T>;
6047
- declare const PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS = 30000;
6649
+ declare function withProtocolTimeout<T>(promise: Promise<T>, timeoutMs: number | undefined, createTimeoutError: () => Error, onTimeout?: () => void, abortSignal?: AbortSignal): Promise<T>;
6048
6650
  declare class ProtocolV2Session {
6049
6651
  private readonly options;
6652
+ private readonly sequenceCursor;
6050
6653
  private pendingCall;
6051
- private protoSeq;
6654
+ private lastResponseSequence?;
6052
6655
  constructor(options: ProtocolV2SessionOptions);
6053
6656
  call(name: string, data: Record<string, unknown>, callOptions?: ProtocolV2CallOptions): Promise<MessageFromOneKey>;
6054
6657
  private executeCall;
@@ -6062,6 +6665,72 @@ declare function probeProtocolV2({ call, timeoutMs, logger, logPrefix, onBeforeP
6062
6665
  onProbeFailed?: (error: unknown) => Promise<void> | void;
6063
6666
  }): Promise<boolean>;
6064
6667
 
6668
+ type ProtocolV2LinkErrorClassification = 'link-fatal' | 'recoverable';
6669
+ interface ProtocolV2LinkAdapter {
6670
+ router: number;
6671
+ maxFrameBytes?: number;
6672
+ generation: number;
6673
+ prepareCall(context: ProtocolV2CallContext): Promise<void> | void;
6674
+ writeFrame(frame: Uint8Array, context: ProtocolV2CallContext): Promise<void>;
6675
+ readFrame(context: ProtocolV2CallContext): Promise<Uint8Array>;
6676
+ reset(reason: string): Promise<void> | void;
6677
+ logger?: ProtocolV2SessionOptions['logger'];
6678
+ logPrefix?: string;
6679
+ createTimeoutError?: ProtocolV2SessionOptions['createTimeoutError'];
6680
+ }
6681
+ type ProtocolV2LinkManagerOptions<Key> = {
6682
+ getSchemas: () => ProtocolV2Schemas;
6683
+ classifyError: (error: unknown) => ProtocolV2LinkErrorClassification;
6684
+ onLinkInvalidated?: (key: Key, reason: string) => Promise<void> | void;
6685
+ };
6686
+ declare class ProtocolV2LinkManager<Key> {
6687
+ private readonly links;
6688
+ private readonly sequences;
6689
+ private readonly callQueues;
6690
+ private readonly generations;
6691
+ private readonly invalidationReasons;
6692
+ private readonly options;
6693
+ constructor(options: ProtocolV2LinkManagerOptions<Key>);
6694
+ call(key: Key, createAdapter: () => ProtocolV2LinkAdapter, name: string, data: Record<string, unknown>, options?: TransportCallOptions): Promise<MessageFromOneKey>;
6695
+ invalidateLink(key: Key, reason: string): Promise<void>;
6696
+ invalidateAllLinks(reason: string): Promise<void>;
6697
+ dispose(reason: string): Promise<void>;
6698
+ private getOrCreateLink;
6699
+ private executeCall;
6700
+ private clearSettledCallQueue;
6701
+ private assertCallGeneration;
6702
+ }
6703
+
6704
+ type ProtocolV2UsbTransportBaseOptions = {
6705
+ router: number;
6706
+ maxFrameBytes: number;
6707
+ logPrefix: string;
6708
+ };
6709
+ declare abstract class ProtocolV2UsbTransportBase<Key> {
6710
+ private readonly protocolV2UsbLinks;
6711
+ private readonly protocolV2UsbAssemblers;
6712
+ private readonly protocolV2UsbGenerations;
6713
+ private readonly protocolV2UsbCancellations;
6714
+ private readonly protocolV2UsbOptions;
6715
+ protected constructor(options: ProtocolV2UsbTransportBaseOptions);
6716
+ protected abstract getProtocolV2UsbSchemas(): ProtocolV2Schemas;
6717
+ protected abstract getProtocolV2UsbLogger(): ProtocolV2SessionOptions['logger'];
6718
+ protected abstract writeProtocolV2UsbPacket(key: Key, frame: Uint8Array, context: ProtocolV2CallContext): Promise<void>;
6719
+ protected abstract readProtocolV2UsbPacket(key: Key, context: ProtocolV2CallContext): Promise<Uint8Array>;
6720
+ protected abstract resetProtocolV2UsbNativeLink(key: Key, reason: string): Promise<void>;
6721
+ protected abstract createProtocolV2UsbTimeoutError(name: string, timeoutMs: number): Error;
6722
+ protected onProtocolV2UsbLinkInvalidated(_key: Key, _reason: string): Promise<void> | void;
6723
+ protected rotateProtocolV2UsbGeneration(key: Key, reason: string): Promise<number>;
6724
+ protected callProtocolV2Usb(key: Key, name: string, data: Record<string, unknown>, options?: TransportCallOptions): Promise<MessageFromOneKey>;
6725
+ protected invalidateProtocolV2UsbLink(key: Key, reason: string): Promise<void>;
6726
+ protected invalidateAllProtocolV2UsbLinks(reason: string): Promise<void>;
6727
+ protected disposeProtocolV2UsbLinks(reason: string): Promise<void>;
6728
+ private createProtocolV2UsbAdapter;
6729
+ private getProtocolV2UsbAssembler;
6730
+ private createProtocolV2UsbCancellation;
6731
+ private createProtocolV2UsbIoError;
6732
+ }
6733
+
6065
6734
  declare function info(res: any): {
6066
6735
  version: string;
6067
6736
  configured: boolean;
@@ -6088,20 +6757,46 @@ declare namespace check {
6088
6757
 
6089
6758
  declare const LogBlockCommand: Set<string>;
6090
6759
 
6760
+ /** Protocol V1 USB report marker, ASCII `?`. */
6091
6761
  declare const PROTOCOL_V1_REPORT_ID = 63;
6762
+ /** Protocol V1 envelope marker, ASCII `#`. */
6092
6763
  declare const PROTOCOL_V1_HEADER_BYTE = 35;
6764
+ /** Protocol V1 payload bytes per chunk after the report marker. */
6093
6765
  declare const PROTOCOL_V1_CHUNK_PAYLOAD_SIZE = 63;
6766
+ /** Protocol V1 USB packet length: report marker plus chunk payload. */
6094
6767
  declare const PROTOCOL_V1_USB_PACKET_SIZE: number;
6768
+ /** Protocol V1 message metadata: two-byte type plus four-byte payload length. */
6095
6769
  declare const PROTOCOL_V1_MESSAGE_HEADER_SIZE: number;
6770
+ /** Protocol V1 envelope metadata: `##`, message type, and payload length. */
6096
6771
  declare const PROTOCOL_V1_ENVELOPE_HEADER_SIZE: number;
6097
- declare const PROTOCOL_V2_FRAME_MAX_BYTES = 4608;
6098
- declare const PROTOCOL_V2_WEBUSB_FILE_CHUNK_SIZE = 4096;
6772
+ /** Firmware Proto Link runtime limit for a complete V2 frame, including header and CRC. */
6773
+ declare const PROTOCOL_V2_FRAME_MAX_BYTES = 4200;
6774
+ /** FilesystemFileWrite chunk size over WebUSB. */
6775
+ declare const PROTOCOL_V2_WEBUSB_FILE_CHUNK_SIZE = 4000;
6776
+ /** FilesystemFileWrite chunk size over BLE. */
6099
6777
  declare const PROTOCOL_V2_BLE_FILE_CHUNK_SIZE = 1800;
6100
- declare const PROTOCOL_V2_FILE_CHUNK_SIZE = 4096;
6778
+ /** BLE FilesystemFileRead chunk size, limited by the Pro2 1024-byte UART TX buffer. */
6779
+ declare const PROTOCOL_V2_BLE_FILE_READ_CHUNK_SIZE = 900;
6780
+ /** Pro2 BLE/UART RX FIFO must hold a complete Proto Link frame. */
6781
+ declare const PROTOCOL_V2_BLE_FRAME_MAX_BYTES = 2048;
6782
+ /** @deprecated Use the transport-specific WebUSB or BLE file chunk constant. */
6783
+ declare const PROTOCOL_V2_FILE_CHUNK_SIZE = 4000;
6784
+ /**
6785
+ * Protocol V2 routing channel. USB reaches the main MCU directly, while BLE routes
6786
+ * through the BLE coprocessor UART bridge.
6787
+ */
6101
6788
  declare const PROTOCOL_V2_CHANNEL_USB = 0;
6102
6789
  declare const PROTOCOL_V2_CHANNEL_BLE_UART = 1;
6103
6790
  declare const PROTOCOL_V2_CHANNEL_SOCKET = 2;
6791
+ /** packet_src for protobuf commands; firmware routes zero to the protobuf dispatcher. */
6104
6792
  declare const PROTOCOL_V2_PACKET_SRC_COMMAND = 0;
6793
+ /**
6794
+ * Shared upper bound for a Protocol V2 request without a method-specific timeout.
6795
+ * Interactive and signing calls may wait on the device UI, so keep this longer than
6796
+ * ordinary transport timeouts while still preventing a stalled link from blocking
6797
+ * the per-device queue forever.
6798
+ */
6799
+ declare const PROTOCOL_V2_DEFAULT_RESPONSE_TIMEOUT_MS: number;
6105
6800
 
6106
6801
  declare const _default: {
6107
6802
  check: typeof check;
@@ -6119,6 +6814,21 @@ declare const _default: {
6119
6814
  decodeMessage: typeof decodeMessage;
6120
6815
  };
6121
6816
  ProtocolV2: {
6817
+ isAckFrame: typeof isAckFrame;
6818
+ inspectFrameHeader: typeof inspectFrameHeader;
6819
+ inspectFrame(schemas: {
6820
+ protocolV1: protobuf.Root;
6821
+ protocolV2: protobuf.Root;
6822
+ }, frame: Uint8Array): {
6823
+ messageName: string;
6824
+ messageTypeId: number;
6825
+ pbPayload: Uint8Array;
6826
+ seq: number;
6827
+ router: number;
6828
+ packetSrc: number;
6829
+ dataType: number;
6830
+ type: string;
6831
+ };
6122
6832
  encodeFrame(schemas: {
6123
6833
  protocolV1: protobuf.Root;
6124
6834
  protocolV2: protobuf.Root;
@@ -6126,21 +6836,11 @@ declare const _default: {
6126
6836
  packetSrc?: number | undefined;
6127
6837
  router?: number | undefined;
6128
6838
  seq?: number | undefined;
6129
- logger?: ProtocolV2DebugLogger | undefined;
6130
- logPrefix?: string | undefined;
6131
- context?: string | undefined;
6132
6839
  }): Uint8Array;
6133
6840
  decodeFrame(schemas: {
6134
6841
  protocolV1: protobuf.Root;
6135
6842
  protocolV2: protobuf.Root;
6136
- }, frame: Uint8Array, options?: Pick<{
6137
- packetSrc?: number | undefined;
6138
- router?: number | undefined;
6139
- seq?: number | undefined;
6140
- logger?: ProtocolV2DebugLogger | undefined;
6141
- logPrefix?: string | undefined;
6142
- context?: string | undefined;
6143
- }, "logger" | "logPrefix" | "context">): {
6843
+ }, frame: Uint8Array): {
6144
6844
  message: {
6145
6845
  [key: string]: any;
6146
6846
  };
@@ -6153,7 +6853,10 @@ declare const _default: {
6153
6853
  };
6154
6854
  PROTOCOL_V2_SYS_MESSAGE_THRESHOLD: number;
6155
6855
  ProtocolV2FrameAssembler: typeof ProtocolV2FrameAssembler;
6856
+ ProtocolV2LinkManager: typeof ProtocolV2LinkManager;
6857
+ ProtocolV2SequenceCursor: typeof ProtocolV2SequenceCursor;
6156
6858
  ProtocolV2Session: typeof ProtocolV2Session;
6859
+ ProtocolV2UsbTransportBase: typeof ProtocolV2UsbTransportBase;
6157
6860
  bytesToHex: typeof bytesToHex;
6158
6861
  concatUint8Arrays: typeof concatUint8Arrays;
6159
6862
  createMessageFromName: (messages: protobuf.Root, name: string) => {
@@ -6174,4 +6877,4 @@ declare const _default: {
6174
6877
  withProtocolTimeout: typeof withProtocolTimeout;
6175
6878
  };
6176
6879
 
6177
- export { AcquireInput, Address, AlephiumAddress, AlephiumBytecodeAck, AlephiumBytecodeRequest, AlephiumGetAddress, AlephiumMessageSignature, AlephiumSignMessage, AlephiumSignTx, AlephiumSignedTx, AlephiumTxAck, AlephiumTxRequest, AlgorandAddress, AlgorandGetAddress, AlgorandSignTx, AlgorandSignedTx, AmountUnit, ApplyFlags, ApplySettings, AptosAddress, AptosGetAddress, AptosMessagePayload, AptosMessageSignature, AptosSignMessage, AptosSignSIWAMessage, AptosSignTx, AptosSignedTx, AptosTransactionType, AuthorizeCoinJoin, BIP32Address, BackupDevice, BackupType, BatchGetPublickeys, BenfenAddress, BenfenGetAddress, BenfenMessageSignature, BenfenSignMessage, BenfenSignTx, BenfenSignedTx, BenfenTxAck, BenfenTxRequest, BinanceAddress, BinanceCancelMsg, BinanceCoin, BinanceGetAddress, BinanceGetPublicKey, BinanceInputOutput, BinanceOrderMsg, BinanceOrderSide, BinanceOrderType, BinancePublicKey, BinanceSignTx, BinanceSignedTx, BinanceTimeInForce, BinanceTransferMsg, BinanceTxRequest, BixinBackupAck, BixinBackupDevice, BixinBackupDeviceAck, BixinBackupRequest, BixinLoadDevice, BixinMessageSE, BixinOutMessageSE, BixinPinInputOnDevice, BixinRestoreAck, BixinRestoreRequest, BixinSeedOperate, BixinVerifyDeviceAck, BixinVerifyDeviceRequest, BixinWhiteListAck, BixinWhiteListRequest, BlurRequest, ButtonAck, ButtonRequest, ButtonRequestType, Cancel, CancelAuthorization, Capability, CardanoAddress, CardanoAddressParametersType, CardanoAddressType, CardanoAssetGroup, CardanoBlockchainPointerType, CardanoCVoteRegistrationDelegation, CardanoCVoteRegistrationFormat, CardanoCVoteRegistrationParametersType, CardanoCertificateType, CardanoDRep, CardanoDRepType, CardanoDerivationType, CardanoGetAddress, CardanoGetNativeScriptHash, CardanoGetPublicKey, CardanoMessageSignature, CardanoNativeScript, CardanoNativeScriptHash, CardanoNativeScriptHashDisplayFormat, CardanoNativeScriptType, CardanoPoolMetadataType, CardanoPoolOwner, CardanoPoolParametersType, CardanoPoolRelayParameters, CardanoPoolRelayType, CardanoPublicKey, CardanoSignMessage, CardanoSignTxFinished, CardanoSignTxInit, CardanoToken, CardanoTxAuxiliaryData, CardanoTxAuxiliaryDataSupplement, CardanoTxAuxiliaryDataSupplementType, CardanoTxBodyHash, CardanoTxCertificate, CardanoTxCollateralInput, CardanoTxHostAck, CardanoTxInlineDatumChunk, CardanoTxInput, CardanoTxItemAck, CardanoTxMint, CardanoTxOutput, CardanoTxOutputSerializationFormat, CardanoTxReferenceInput, CardanoTxReferenceScriptChunk, CardanoTxRequiredSigner, CardanoTxSigningMode, CardanoTxWithdrawal, CardanoTxWitnessRequest, CardanoTxWitnessResponse, CardanoTxWitnessType, ChangeOutputScriptType, ChangePin, ChangeWipeCode, CipherKeyValue, CipheredKeyValue, CoinJoinRequest, CoinPurchaseMemo, CommandFlags, ConfluxAddress, ConfluxGetAddress, ConfluxMessageSignature, ConfluxSignMessage, ConfluxSignMessageCIP23, ConfluxSignTx, ConfluxTxAck, ConfluxTxRequest, CosmosAddress, CosmosGetAddress, CosmosSignTx, CosmosSignedTx, DebugLinkInput, DecredStakingSpendType, Deprecated_PassphraseStateAck, Deprecated_PassphraseStateRequest, DevBluetoothInfo, DevFirmwareImageInfo, DevFirmwareInstallProgress, DevFirmwareTarget, DevFirmwareTargetType, DevFirmwareUpdate, DevFirmwareUpdateStatus, DevFirmwareUpdateStatusEntry, DevGetDeviceInfo, DevGetFirmwareUpdateStatus, DevHardwareInfo, DevInfoTargets, DevInfoTypes, DevMainMcuInfo, DevReboot, DevRebootType, DevSEInfo, DevSEState, DevSeType, DevStatus, DeviceBackToBoot, DeviceEraseSector, DeviceInfo, DeviceInfoSettings, DeviceType, DnxAddress, DnxComputedKeyImage, DnxGetAddress, DnxInputAck, DnxInputRequest, DnxRTSigsRequest, DnxSignTx, DnxSignedTx, DnxTxKey, DoPreauthorized, ECDHSessionKey, EcdsaPublicKeys, EmmcDir, EmmcDirList, EmmcDirMake, EmmcDirRemove, EmmcFile, EmmcFileDelete, EmmcFileRead, EmmcFileWrite, EmmcFixPermission, EmmcPath, EmmcPathInfo, EndSession, Entropy, EntropyAck, EntropyRequest, Enum_BackupType, Enum_ButtonRequestType, Enum_Capability, Enum_InputScriptType, Enum_OutputScriptType, Enum_PinMatrixRequestType, Enum_RequestType, Enum_SafetyCheckLevel, Enum_WordRequestType, EosActionBuyRam, EosActionBuyRamBytes, EosActionCommon, EosActionDelegate, EosActionDeleteAuth, EosActionLinkAuth, EosActionNewAccount, EosActionRefund, EosActionSellRam, EosActionTransfer, EosActionUndelegate, EosActionUnknown, EosActionUnlinkAuth, EosActionUpdateAuth, EosActionVoteProducer, EosAsset, EosAuthorization, EosAuthorizationAccount, EosAuthorizationKey, EosAuthorizationWait, EosGetPublicKey, EosPermissionLevel, EosPublicKey, EosSignTx, EosSignedTx, EosTxActionAck, EosTxActionRequest, EosTxHeader, EthereumAccessList, EthereumAccessListOneKey, EthereumAddress, EthereumAddressOneKey, EthereumAuthorizationOneKey, EthereumAuthorizationSignature, EthereumDataType, EthereumDataTypeOneKey, EthereumDefinitionType, EthereumDefinitions, EthereumFieldType, EthereumFieldTypeOneKey, EthereumGetAddress, EthereumGetAddressOneKey, EthereumGetPublicKey, EthereumGetPublicKeyOneKey, EthereumGnosisSafeTxAck, EthereumGnosisSafeTxOperation, EthereumGnosisSafeTxRequest, EthereumMessageSignature, EthereumMessageSignatureOneKey, EthereumNetworkInfo, EthereumPublicKey, EthereumPublicKeyOneKey, EthereumSignMessage, EthereumSignMessageEIP712, EthereumSignMessageOneKey, EthereumSignTx, EthereumSignTxEIP1559, EthereumSignTxEIP1559OneKey, EthereumSignTxEIP7702OneKey, EthereumSignTxOneKey, EthereumSignTypedData, EthereumSignTypedDataOneKey, EthereumSignTypedHash, EthereumSignTypedHashOneKey, EthereumStructMember, EthereumStructMemberOneKey, EthereumTokenInfo, EthereumTxAck, EthereumTxAckOneKey, EthereumTxRequest, EthereumTxRequestOneKey, EthereumTypedDataSignature, EthereumTypedDataSignatureOneKey, EthereumTypedDataStructAck, EthereumTypedDataStructAckOneKey, EthereumTypedDataStructRequest, EthereumTypedDataStructRequestOneKey, EthereumTypedDataValueAck, EthereumTypedDataValueAckOneKey, EthereumTypedDataValueRequest, EthereumTypedDataValueRequestOneKey, EthereumVerifyMessage, EthereumVerifyMessageOneKey, ExportType, FactoryDeviceInfo, FactoryDeviceInfoSettings, FactoryGetDeviceInfo, Failure, FailureType, Features, FileInfo, FileInfoList, FilecoinAddress, FilecoinGetAddress, FilecoinSignTx, FilecoinSignedTx, FilesystemDir, FilesystemDirList, FilesystemDirMake, FilesystemDirRemove, FilesystemFile, FilesystemFileDelete, FilesystemFileRead, FilesystemFileWrite, FilesystemFixPermission, FilesystemFormat, FilesystemPathInfo, FilesystemPathInfoQuery, FirmwareErase, FirmwareErase_ex, FirmwareHash, FirmwareRequest, FirmwareUpdateEmmc, FirmwareUpload, GetAddress, GetDeviceInfo, GetECDHSessionKey, GetEntropy, GetFeatures, GetFirmwareHash, GetNextU2FCounter, GetNonce, GetOnboardingStatus, GetOwnershipId, GetOwnershipProof, GetPassphraseState, GetProtoVersion, GetPublicKey, GetPublicKeyMultiple, GetWallpaper, HDNodePathType, HDNodeType, IdentityType, Initialize, InputScriptType, InternalInputScriptType, InternalMyAddressRequest, KaspaAddress, KaspaGetAddress, KaspaSignTx, KaspaSignedTx, KaspaTxInputAck, KaspaTxInputRequest, ListResDir, LnurlAuth, LnurlAuthResp, LockDevice, LogBlockCommand, LowLevelDevice, LowlevelTransportSharedPlugin, MessageFromOneKey, MessageKey, MessageResponse, MessageResponseMap, MessageSignature, MessageType, messages as Messages, MoneroAccountPublicAddress, MoneroAddress, MoneroExportedKeyImage, MoneroGetAddress, MoneroGetTxKeyAck, MoneroGetTxKeyRequest, MoneroGetWatchKey, MoneroKeyImageExportInitAck, MoneroKeyImageExportInitRequest, MoneroKeyImageSyncFinalAck, MoneroKeyImageSyncFinalRequest, MoneroKeyImageSyncStepAck, MoneroKeyImageSyncStepRequest, MoneroLiveRefreshFinalAck, MoneroLiveRefreshFinalRequest, MoneroLiveRefreshStartAck, MoneroLiveRefreshStartRequest, MoneroLiveRefreshStepAck, MoneroLiveRefreshStepRequest, MoneroMultisigKLRki, MoneroNetworkType, MoneroOutputEntry, MoneroRctKeyPublic, MoneroRingCtSig, MoneroSubAddressIndicesList, MoneroTransactionAllInputsSetAck, MoneroTransactionAllInputsSetRequest, MoneroTransactionAllOutSetAck, MoneroTransactionAllOutSetRequest, MoneroTransactionData, MoneroTransactionDestinationEntry, MoneroTransactionFinalAck, MoneroTransactionFinalRequest, MoneroTransactionInitAck, MoneroTransactionInitRequest, MoneroTransactionInputViniAck, MoneroTransactionInputViniRequest, MoneroTransactionInputsPermutationAck, MoneroTransactionInputsPermutationRequest, MoneroTransactionRsigData, MoneroTransactionSetInputAck, MoneroTransactionSetInputRequest, MoneroTransactionSetOutputAck, MoneroTransactionSetOutputRequest, MoneroTransactionSignInputAck, MoneroTransactionSignInputRequest, MoneroTransactionSourceEntry, MoneroTransferDetails, MoneroWatchKey, MultisigRedeemScriptType, NEMAddress, NEMAggregateModification, NEMCosignatoryModification, NEMDecryptMessage, NEMDecryptedMessage, NEMGetAddress, NEMImportanceTransfer, NEMImportanceTransferMode, NEMModificationType, NEMMosaic, NEMMosaicCreation, NEMMosaicDefinition, NEMMosaicLevy, NEMMosaicSupplyChange, NEMProvisionNamespace, NEMSignTx, NEMSignedTx, NEMSupplyChangeType, NEMTransactionCommon, NEMTransfer, NFTWriteData, NFTWriteInfo, NearAddress, NearGetAddress, NearSignTx, NearSignedTx, NeoAddress, NeoGetAddress, NeoSignTx, NeoSignedTx, NervosAddress, NervosGetAddress, NervosSignTx, NervosSignedTx, NervosTxAck, NervosTxRequest, NewDevice, NexaAddress, NexaGetAddress, NexaSignTx, NexaSignedTx, NexaTxInputAck, NexaTxInputRequest, NextU2FCounter, Nonce, NostrDecryptMessage, NostrDecryptedMessage, NostrEncryptMessage, NostrEncryptedMessage, NostrGetPublicKey, NostrPublicKey, NostrSignEvent, NostrSignSchnorr, NostrSignedEvent, NostrSignedSchnorr, OnboardingStatus, OnboardingStep, OneKeyDeviceCommType, OneKeyDeviceInfo, OneKeyDeviceInfoBase, OneKeyDeviceInfoWithSession, OneKeyDeviceType, OneKeyMobileDeviceInfo, OneKeySEState, OneKeySeType, OnekeyFeatures, OnekeyGetFeatures, OutputScriptType, OwnershipId, OwnershipProof, PROTOCOL_V1_CHUNK_PAYLOAD_SIZE, PROTOCOL_V1_ENVELOPE_HEADER_SIZE, PROTOCOL_V1_HEADER_BYTE, PROTOCOL_V1_MESSAGE_HEADER_SIZE, PROTOCOL_V1_REPORT_ID, PROTOCOL_V1_USB_PACKET_SIZE, PROTOCOL_V2_BLE_FILE_CHUNK_SIZE, PROTOCOL_V2_CHANNEL_BLE_UART, PROTOCOL_V2_CHANNEL_SOCKET, PROTOCOL_V2_CHANNEL_USB, PROTOCOL_V2_FILE_CHUNK_SIZE, PROTOCOL_V2_FRAME_MAX_BYTES, PROTOCOL_V2_PACKET_SRC_COMMAND, PROTOCOL_V2_SYS_MESSAGE_THRESHOLD, PROTOCOL_V2_WEBUSB_FILE_CHUNK_SIZE, PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS, PassphraseAck, PassphraseRequest, PassphraseState, Path, PaymentRequestMemo, PinMatrixAck, PinMatrixRequest, PinMatrixRequestType, Ping, PolkadotAddress, PolkadotGetAddress, PolkadotSignTx, PolkadotSignedTx, PreauthorizedRequest, PrevInput, PrevOutput, PrevTx, ProtoVersion, ProtocolType, ProtocolV1, ProtocolV2, ProtocolV2CallOptions, ProtocolV2DeviceInfo, ProtocolV2FrameAssembler, ProtocolV2Schemas, ProtocolV2Session, ProtocolV2SessionOptions, PublicKey, PublicKeyMultiple, ReadSEPublicCert, ReadSEPublicKey, Reboot, RebootToBoardloader, RebootToBootloader, RebootType, RecoveryDevice, RecoveryDeviceType, RefundMemo, RequestType, ResetDevice, ResourceAck, ResourceRequest, ResourceType, ResourceUpdate, ResourceUpload, Restore, RippleAddress, RippleGetAddress, RipplePayment, RippleSignTx, RippleSignedTx, SEMessageSignature, SEPublicCert, SEPublicKey, SESignMessage, SafetyCheckLevel, ScdoAddress, ScdoGetAddress, ScdoSignMessage, ScdoSignTx, ScdoSignedMessage, ScdoSignedTx, ScdoTxAck, SdProtect, SdProtectOperationType, SeedRequestType, SelfTest, SetBusy, SetU2FCounter, SetWallpaper, Setup, SignIdentity, SignMessage, SignPsbt, SignTx, SignedIdentity, SignedPsbt, SolanaAddress, SolanaGetAddress, SolanaMessageSignature, SolanaOffChainMessageFormat, SolanaOffChainMessageVersion, SolanaSignOffChainMessage, SolanaSignTx, SolanaSignUnsafeMessage, SolanaSignedTx, SolanaTxATADetails, SolanaTxExtraInfo, SpiFlashData, SpiFlashRead, SpiFlashWrite, StarcoinAddress, StarcoinGetAddress, StarcoinGetPublicKey, StarcoinMessageSignature, StarcoinPublicKey, StarcoinSignMessage, StarcoinSignTx, StarcoinSignedTx, StarcoinVerifyMessage, StellarAccountMergeOp, StellarAddress, StellarAllowTrustOp, StellarAsset, StellarAssetType, StellarBumpSequenceOp, StellarChangeTrustOp, StellarCreateAccountOp, StellarCreatePassiveSellOfferOp, StellarGetAddress, StellarInvokeHostFunctionOp, StellarManageBuyOfferOp, StellarManageDataOp, StellarManageSellOfferOp, StellarMemoType, StellarPathPaymentStrictReceiveOp, StellarPathPaymentStrictSendOp, StellarPaymentOp, StellarRequestType, StellarSetOptionsOp, StellarSignTx, StellarSignedTx, StellarSignerType, StellarSorobanDataAck, StellarSorobanDataRequest, StellarTxOpRequest, Success, SuiAddress, SuiGetAddress, SuiMessageSignature, SuiSignMessage, SuiSignTx, SuiSignedTx, SuiTxAck, SuiTxRequest, TextMemo, TezosAddress, TezosBallotOp, TezosBallotType, TezosContractID, TezosContractType, TezosDelegationOp, TezosGetAddress, TezosGetPublicKey, TezosManagerTransfer, TezosOriginationOp, TezosParametersManager, TezosProposalOp, TezosPublicKey, TezosRevealOp, TezosSignTx, TezosSignedTx, TezosTransactionOp, TonAddress, TonGetAddress, TonSignData, TonSignDataType, TonSignMessage, TonSignProof, TonSignedData, TonSignedMessage, TonSignedProof, TonTxAck, TonWalletVersion, TonWorkChain, Transport, TransportCallOptions, TronAddress, TronCancelAllUnfreezeV2Contract, TronContract, TronDelegateResourceContract, TronFreezeBalanceContract, TronFreezeBalanceV2Contract, TronGetAddress, TronMessageSignature, TronMessageType, TronResourceCode, TronSignMessage, TronSignTx, TronSignedTx, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceContract, TronUnfreezeBalanceV2Contract, TronVoteWitnessContract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, TxAck, TxAckInput, TxAckInputWrapper, TxAckOutput, TxAckOutputWrapper, TxAckPaymentRequest, TxAckPrevExtraData, TxAckPrevExtraDataWrapper, TxAckPrevInput, TxAckPrevInputWrapper, TxAckPrevMeta, TxAckPrevOutput, TxAckPrevOutputWrapper, TxAckResponse, TxInput, TxInputType, TxOutput, TxOutputBinType, TxOutputType, TxRequest, TxRequestDetailsType, TxRequestSerializedType, TypedCall, UintType, UnLockDevice, UnLockDeviceResponse, UnlockPath, UnlockedPathRequest, UpgradeFileHeader, VerifyMessage, ViewAmount, ViewDetail, ViewSignPage, ViewTip, ViewTipType, ViewVerifyPage, Vote, WL_OperationType, Wallpaper, WallpaperTarget, WipeDevice, WordAck, WordRequest, WordRequestType, WriteSEPrivateKey, WriteSEPublicCert, ZoomRequest, bytesToHex, concatUint8Arrays, _default as default, experimental_field, experimental_message, facotry, getErrorMessage, hexToBytes, probeProtocolV2, index as protocolV1, protocolV2Codec as protocolV2, withProtocolTimeout };
6880
+ export { AcquireInput, Address, AlephiumAddress, AlephiumBytecodeAck, AlephiumBytecodeRequest, AlephiumGetAddress, AlephiumMessageSignature, AlephiumSignMessage, AlephiumSignTx, AlephiumSignedTx, AlephiumTxAck, AlephiumTxRequest, AlgorandAddress, AlgorandGetAddress, AlgorandSignTx, AlgorandSignedTx, AmountUnit, ApplyFlags, ApplySettings, AptosAddress, AptosGetAddress, AptosMessagePayload, AptosMessageSignature, AptosSignMessage, AptosSignSIWAMessage, AptosSignTx, AptosSignedTx, AptosTransactionType, AuthorizeCoinJoin, BIP32Address, BackupDevice, BackupType, BatchGetPublickeys, BenfenAddress, BenfenGetAddress, BenfenMessageSignature, BenfenSignMessage, BenfenSignTx, BenfenSignedTx, BenfenTxAck, BenfenTxRequest, BinanceAddress, BinanceCancelMsg, BinanceCoin, BinanceGetAddress, BinanceGetPublicKey, BinanceInputOutput, BinanceOrderMsg, BinanceOrderSide, BinanceOrderType, BinancePublicKey, BinanceSignTx, BinanceSignedTx, BinanceTimeInForce, BinanceTransferMsg, BinanceTxRequest, BixinBackupAck, BixinBackupDevice, BixinBackupDeviceAck, BixinBackupRequest, BixinLoadDevice, BixinMessageSE, BixinOutMessageSE, BixinPinInputOnDevice, BixinRestoreAck, BixinRestoreRequest, BixinSeedOperate, BixinVerifyDeviceAck, BixinVerifyDeviceRequest, BixinWhiteListAck, BixinWhiteListRequest, BlurRequest, ButtonAck, ButtonRequest, ButtonRequestType, Cancel, CancelAuthorization, Capability, CardanoAddress, CardanoAddressParametersType, CardanoAddressType, CardanoAssetGroup, CardanoBlockchainPointerType, CardanoCVoteRegistrationDelegation, CardanoCVoteRegistrationFormat, CardanoCVoteRegistrationParametersType, CardanoCertificateType, CardanoDRep, CardanoDRepType, CardanoDerivationType, CardanoGetAddress, CardanoGetNativeScriptHash, CardanoGetPublicKey, CardanoMessageSignature, CardanoNativeScript, CardanoNativeScriptHash, CardanoNativeScriptHashDisplayFormat, CardanoNativeScriptType, CardanoPoolMetadataType, CardanoPoolOwner, CardanoPoolParametersType, CardanoPoolRelayParameters, CardanoPoolRelayType, CardanoPublicKey, CardanoSignMessage, CardanoSignTxFinished, CardanoSignTxInit, CardanoToken, CardanoTxAuxiliaryData, CardanoTxAuxiliaryDataSupplement, CardanoTxAuxiliaryDataSupplementType, CardanoTxBodyHash, CardanoTxCertificate, CardanoTxCollateralInput, CardanoTxHostAck, CardanoTxInlineDatumChunk, CardanoTxInput, CardanoTxItemAck, CardanoTxMint, CardanoTxOutput, CardanoTxOutputSerializationFormat, CardanoTxReferenceInput, CardanoTxReferenceScriptChunk, CardanoTxRequiredSigner, CardanoTxSigningMode, CardanoTxWithdrawal, CardanoTxWitnessRequest, CardanoTxWitnessResponse, CardanoTxWitnessType, ChangeOutputScriptType, ChangePin, ChangeWipeCode, CipherKeyValue, CipheredKeyValue, CoinJoinRequest, CoinPurchaseMemo, CommandFlags, ConfluxAddress, ConfluxGetAddress, ConfluxMessageSignature, ConfluxSignMessage, ConfluxSignMessageCIP23, ConfluxSignTx, ConfluxTxAck, ConfluxTxRequest, CosmosAddress, CosmosGetAddress, CosmosSignTx, CosmosSignedTx, DecredStakingSpendType, Deprecated_PassphraseStateAck, Deprecated_PassphraseStateRequest, DevGetOnboardingStatus, DevOnboardingPhase, DevOnboardingSetupKind, DevOnboardingSetupMethod, DevOnboardingSetupStatus, DevOnboardingStatus, DevOnboardingStep, DeviceBackToBoot, DeviceCertificate, DeviceCertificateRead, DeviceCertificateSign, DeviceCertificateSignature, DeviceCertificateWrite, DeviceCoprocessorInfo, DeviceEraseSector, DeviceErrorCode, DeviceFactoryAck, DeviceFactoryInfo, DeviceFactoryInfoGet, DeviceFactoryInfoManufactureTime, DeviceFactoryInfoSet, DeviceFactoryPermanentLock, DeviceFactoryTest, DeviceFirmwareImageInfo, DeviceFirmwareTarget, DeviceFirmwareTargetType, DeviceFirmwareUpdateRecord, DeviceFirmwareUpdateRecordFields, DeviceFirmwareUpdateRequest, DeviceFirmwareUpdateStatus, DeviceFirmwareUpdateStatusGet, DeviceFirmwareUpdateTaskStatus, DeviceHardwareInfo, DeviceInfo, DeviceInfoGet, DeviceInfoSettings, DeviceInfoTargets, DeviceInfoTypes, DeviceMainMcuInfo, DeviceReboot, DeviceRebootType, DeviceSEInfo, DeviceSEState, DeviceSeType, DeviceSession, DeviceSessionAskPassphrase, DeviceSessionAskPin, DeviceSessionAskPin_FailureSubCodes, DeviceSessionErrorCode, DeviceSessionGet, DeviceSessionPinType, DeviceSettings, DeviceSettingsGet, DeviceSettingsPage, DeviceSettingsPageShow, DeviceSettingsSet, DeviceStatus, DeviceStatusGet, DeviceType, DnxAddress, DnxComputedKeyImage, DnxGetAddress, DnxInputAck, DnxInputRequest, DnxRTSigsRequest, DnxSignTx, DnxSignedTx, DnxTxKey, DoPreauthorized, ECDHSessionKey, EcdsaPublicKeys, EmmcDir, EmmcDirList, EmmcDirMake, EmmcDirRemove, EmmcFile, EmmcFileDelete, EmmcFileRead, EmmcFileWrite, EmmcFixPermission, EmmcPath, EmmcPathInfo, EndSession, Entropy, EntropyAck, EntropyRequest, Enum_BackupType, Enum_ButtonRequestType, Enum_Capability, Enum_InputScriptType, Enum_KaspaInputScriptType, Enum_KaspaOutputScriptType, Enum_KaspaRequestType, Enum_OutputScriptType, Enum_PinMatrixRequestType, Enum_ProtocolV2Capability, Enum_RequestType, Enum_SafetyCheckLevel, Enum_WordRequestType, EosActionBuyRam, EosActionBuyRamBytes, EosActionCommon, EosActionDelegate, EosActionDeleteAuth, EosActionLinkAuth, EosActionNewAccount, EosActionRefund, EosActionSellRam, EosActionTransfer, EosActionUndelegate, EosActionUnknown, EosActionUnlinkAuth, EosActionUpdateAuth, EosActionVoteProducer, EosAsset, EosAuthorization, EosAuthorizationAccount, EosAuthorizationKey, EosAuthorizationWait, EosGetPublicKey, EosPermissionLevel, EosPublicKey, EosSignTx, EosSignedTx, EosTxActionAck, EosTxActionRequest, EosTxHeader, EthereumAccessList, EthereumAccessListOneKey, EthereumAddress, EthereumAddressOneKey, EthereumAuthorizationOneKey, EthereumAuthorizationSignature, EthereumDataType, EthereumDataTypeOneKey, EthereumDefinitionType, EthereumDefinitions, EthereumFieldType, EthereumFieldTypeOneKey, EthereumGetAddress, EthereumGetAddressOneKey, EthereumGetPublicKey, EthereumGetPublicKeyOneKey, EthereumGnosisSafeTxAck, EthereumGnosisSafeTxOperation, EthereumGnosisSafeTxRequest, EthereumMessageSignature, EthereumMessageSignatureOneKey, EthereumNetworkInfo, EthereumPublicKey, EthereumPublicKeyOneKey, EthereumSignMessage, EthereumSignMessageEIP712, EthereumSignMessageOneKey, EthereumSignTx, EthereumSignTxEIP1559, EthereumSignTxEIP1559OneKey, EthereumSignTxEIP7702OneKey, EthereumSignTxOneKey, EthereumSignTypedData, EthereumSignTypedDataOneKey, EthereumSignTypedDataQR, EthereumSignTypedHash, EthereumSignTypedHashOneKey, EthereumStructMember, EthereumStructMemberOneKey, EthereumTokenInfo, EthereumTxAck, EthereumTxAckOneKey, EthereumTxRequest, EthereumTxRequestOneKey, EthereumTypedDataSignature, EthereumTypedDataSignatureOneKey, EthereumTypedDataStructAck, EthereumTypedDataStructAckOneKey, EthereumTypedDataStructRequest, EthereumTypedDataStructRequestOneKey, EthereumTypedDataValueAck, EthereumTypedDataValueAckOneKey, EthereumTypedDataValueRequest, EthereumTypedDataValueRequestOneKey, EthereumVerifyMessage, EthereumVerifyMessageOneKey, ExportType, Failure, FailureType, Features, FileInfo, FileInfoList, FilecoinAddress, FilecoinGetAddress, FilecoinSignTx, FilecoinSignedTx, FilesystemDir, FilesystemDirList, FilesystemDirMake, FilesystemDirRemove, FilesystemFile, FilesystemFileDelete, FilesystemFileRead, FilesystemFileWrite, FilesystemFormat, FilesystemPathInfo, FilesystemPathInfoQuery, FilesystemPermissionFix, FirmwareErase, FirmwareErase_ex, FirmwareHash, FirmwareRequest, FirmwareUpdateEmmc, FirmwareUpload, GetAddress, GetDeviceInfo, GetECDHSessionKey, GetEntropy, GetFeatures, GetFirmwareHash, GetNextU2FCounter, GetNonce, GetOwnershipId, GetOwnershipProof, GetPassphraseState, GetPublicKey, GetPublicKeyMultiple, GetWallpaper, HDNodePathType, HDNodeType, IdentityType, Initialize, InputScriptType, InternalInputScriptType, InternalMyAddressRequest, KaspaAddress, KaspaGetAddress, KaspaInputScriptType, KaspaOutpoint, KaspaOutputScriptType, KaspaRequestType, KaspaSignTx, KaspaSignedTx, KaspaTxAckInput, KaspaTxAckOutput, KaspaTxAckPayloadChunk, KaspaTxAckPrevInput, KaspaTxAckPrevMeta, KaspaTxAckPrevOutput, KaspaTxInputAck, KaspaTxInputRequest, KaspaTxRequest, KaspaTxRequestSignature, ListResDir, LnurlAuth, LnurlAuthResp, LockDevice, LogBlockCommand, LowLevelDevice, LowlevelTransportSharedPlugin, MessageFromOneKey, MessageKey, MessageResponse, MessageResponseMap, MessageSignature, MessageType, messages as Messages, MoneroAccountPublicAddress, MoneroAddress, MoneroExportedKeyImage, MoneroGetAddress, MoneroGetTxKeyAck, MoneroGetTxKeyRequest, MoneroGetWatchKey, MoneroKeyImageExportInitAck, MoneroKeyImageExportInitRequest, MoneroKeyImageSyncFinalAck, MoneroKeyImageSyncFinalRequest, MoneroKeyImageSyncStepAck, MoneroKeyImageSyncStepRequest, MoneroLiveRefreshFinalAck, MoneroLiveRefreshFinalRequest, MoneroLiveRefreshStartAck, MoneroLiveRefreshStartRequest, MoneroLiveRefreshStepAck, MoneroLiveRefreshStepRequest, MoneroMultisigKLRki, MoneroNetworkType, MoneroOutputEntry, MoneroRctKeyPublic, MoneroRingCtSig, MoneroSubAddressIndicesList, MoneroTransactionAllInputsSetAck, MoneroTransactionAllInputsSetRequest, MoneroTransactionAllOutSetAck, MoneroTransactionAllOutSetRequest, MoneroTransactionData, MoneroTransactionDestinationEntry, MoneroTransactionFinalAck, MoneroTransactionFinalRequest, MoneroTransactionInitAck, MoneroTransactionInitRequest, MoneroTransactionInputViniAck, MoneroTransactionInputViniRequest, MoneroTransactionInputsPermutationAck, MoneroTransactionInputsPermutationRequest, MoneroTransactionRsigData, MoneroTransactionSetInputAck, MoneroTransactionSetInputRequest, MoneroTransactionSetOutputAck, MoneroTransactionSetOutputRequest, MoneroTransactionSignInputAck, MoneroTransactionSignInputRequest, MoneroTransactionSourceEntry, MoneroTransferDetails, MoneroWatchKey, MultisigRedeemScriptType, NEMAddress, NEMAggregateModification, NEMCosignatoryModification, NEMDecryptMessage, NEMDecryptedMessage, NEMGetAddress, NEMImportanceTransfer, NEMImportanceTransferMode, NEMModificationType, NEMMosaic, NEMMosaicCreation, NEMMosaicDefinition, NEMMosaicLevy, NEMMosaicSupplyChange, NEMProvisionNamespace, NEMSignTx, NEMSignedTx, NEMSupplyChangeType, NEMTransactionCommon, NEMTransfer, NFTWriteData, NFTWriteInfo, NearAddress, NearGetAddress, NearSignTx, NearSignedTx, NeoAddress, NeoGetAddress, NeoSignTx, NeoSignedTx, NervosAddress, NervosGetAddress, NervosSignTx, NervosSignedTx, NervosTxAck, NervosTxRequest, NexaAddress, NexaGetAddress, NexaSignTx, NexaSignedTx, NexaTxInputAck, NexaTxInputRequest, NextU2FCounter, Nonce, NostrDecryptMessage, NostrDecryptedMessage, NostrEncryptMessage, NostrEncryptedMessage, NostrGetPublicKey, NostrPublicKey, NostrSignEvent, NostrSignSchnorr, NostrSignedEvent, NostrSignedSchnorr, OneKeyDeviceCommType, OneKeyDeviceInfo, OneKeyDeviceInfoBase, OneKeyDeviceInfoWithSession, OneKeyDeviceType, OneKeyMobileDeviceInfo, OneKeySEState, OneKeySeType, OnekeyFeatures, OnekeyGetFeatures, OutputScriptType, OwnershipId, OwnershipProof, PROTOCOL_V1_CHUNK_PAYLOAD_SIZE, PROTOCOL_V1_ENVELOPE_HEADER_SIZE, PROTOCOL_V1_HEADER_BYTE, PROTOCOL_V1_MESSAGE_HEADER_SIZE, PROTOCOL_V1_REPORT_ID, PROTOCOL_V1_USB_PACKET_SIZE, PROTOCOL_V2_BLE_FILE_CHUNK_SIZE, PROTOCOL_V2_BLE_FILE_READ_CHUNK_SIZE, PROTOCOL_V2_BLE_FRAME_MAX_BYTES, PROTOCOL_V2_CHANNEL_BLE_UART, PROTOCOL_V2_CHANNEL_SOCKET, PROTOCOL_V2_CHANNEL_USB, PROTOCOL_V2_DEFAULT_RESPONSE_TIMEOUT_MS, PROTOCOL_V2_FILE_CHUNK_SIZE, PROTOCOL_V2_FRAME_MAX_BYTES, PROTOCOL_V2_PACKET_SRC_COMMAND, PROTOCOL_V2_SYS_MESSAGE_THRESHOLD, PROTOCOL_V2_WEBUSB_FILE_CHUNK_SIZE, PassphraseAck, PassphraseRequest, PassphraseState, Path, PaymentRequestMemo, PinMatrixAck, PinMatrixRequest, PinMatrixRequestType, Ping, PolkadotAddress, PolkadotGetAddress, PolkadotSignTx, PolkadotSignedTx, PortfolioUpdate, PreauthorizedRequest, PrevInput, PrevOutput, PrevTx, ProtocolInfo, ProtocolInfoRequest, ProtocolType, ProtocolV1, ProtocolV2, ProtocolV2BleFrameWriterOptions, ProtocolV2CallContext, ProtocolV2CallOptions, ProtocolV2Capability, ProtocolV2DeviceInfo, ProtocolV2FailureType, ProtocolV2FrameAssembler, ProtocolV2LinkAdapter, ProtocolV2LinkError, ProtocolV2LinkErrorClassification, ProtocolV2LinkErrorCode, ProtocolV2LinkManager, ProtocolV2LinkManagerOptions, ProtocolV2Schemas, ProtocolV2SequenceCursor, ProtocolV2Session, ProtocolV2SessionOptions, ProtocolV2UsbTransportBase, ProtocolV2UsbTransportBaseOptions, PublicKey, PublicKeyMultiple, ReadSEPublicCert, ReadSEPublicKey, Reboot, RebootToBoardloader, RebootToBootloader, RebootType, RecoveryDevice, RecoveryDeviceType, RefundMemo, RequestType, ResetDevice, ResourceAck, ResourceRequest, ResourceType, ResourceUpdate, ResourceUpload, RippleAddress, RippleGetAddress, RipplePayment, RippleSignTx, RippleSignedTx, SEMessageSignature, SEPublicCert, SEPublicKey, SESignMessage, SafetyCheckLevel, ScdoAddress, ScdoGetAddress, ScdoSignMessage, ScdoSignTx, ScdoSignedMessage, ScdoSignedTx, ScdoTxAck, SdProtect, SdProtectOperationType, SeedRequestType, SelfTest, SetBusy, SetU2FCounter, SetWallpaper, SignIdentity, SignMessage, SignPsbt, SignTx, SignedIdentity, SignedPsbt, SolanaAddress, SolanaGetAddress, SolanaMessageSignature, SolanaOffChainMessageFormat, SolanaOffChainMessageVersion, SolanaSignOffChainMessage, SolanaSignTx, SolanaSignUnsafeMessage, SolanaSignedTx, SolanaTxATADetails, SolanaTxExtraInfo, SpiFlashData, SpiFlashRead, SpiFlashWrite, StarcoinAddress, StarcoinGetAddress, StarcoinGetPublicKey, StarcoinMessageSignature, StarcoinPublicKey, StarcoinSignMessage, StarcoinSignTx, StarcoinSignedTx, StarcoinVerifyMessage, StartSession, StellarAccountMergeOp, StellarAddress, StellarAllowTrustOp, StellarAsset, StellarAssetType, StellarBumpSequenceOp, StellarChangeTrustOp, StellarCreateAccountOp, StellarCreatePassiveSellOfferOp, StellarGetAddress, StellarInvokeHostFunctionOp, StellarManageBuyOfferOp, StellarManageDataOp, StellarManageSellOfferOp, StellarMemoType, StellarPathPaymentStrictReceiveOp, StellarPathPaymentStrictSendOp, StellarPaymentOp, StellarRequestType, StellarSetOptionsOp, StellarSignTx, StellarSignedTx, StellarSignerType, StellarSorobanDataAck, StellarSorobanDataRequest, StellarTxOpRequest, Success, SuiAddress, SuiGetAddress, SuiMessageSignature, SuiSignMessage, SuiSignTx, SuiSignedTx, SuiTxAck, SuiTxRequest, TRANSPORT_EVENT, TextMemo, TezosAddress, TezosBallotOp, TezosBallotType, TezosContractID, TezosContractType, TezosDelegationOp, TezosGetAddress, TezosGetPublicKey, TezosManagerTransfer, TezosOriginationOp, TezosParametersManager, TezosProposalOp, TezosPublicKey, TezosRevealOp, TezosSignTx, TezosSignedTx, TezosTransactionOp, TonAddress, TonGetAddress, TonSignData, TonSignDataType, TonSignMessage, TonSignProof, TonSignedData, TonSignedMessage, TonSignedProof, TonTxAck, TonWalletVersion, TonWorkChain, Transport, TransportCallOptions, TransportDeviceDisconnectEvent, TronAddress, TronCancelAllUnfreezeV2Contract, TronContract, TronDelegateResourceContract, TronFreezeBalanceContract, TronFreezeBalanceV2Contract, TronGetAddress, TronMessageSignature, TronMessageType, TronResourceCode, TronSignMessage, TronSignTx, TronSignedTx, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceContract, TronUnfreezeBalanceV2Contract, TronVoteWitnessContract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, TxAck, TxAckInput, TxAckInputWrapper, TxAckOutput, TxAckOutputWrapper, TxAckPaymentRequest, TxAckPrevExtraData, TxAckPrevExtraDataWrapper, TxAckPrevInput, TxAckPrevInputWrapper, TxAckPrevMeta, TxAckPrevOutput, TxAckPrevOutputWrapper, TxAckResponse, TxInput, TxInputType, TxOutput, TxOutputBinType, TxOutputType, TxRequest, TxRequestDetailsType, TxRequestSerializedType, TypedCall, UiAnimationCommand, UiAnimationRequest, UiAnimationType, UintType, UnLockDevice, UnLockDeviceResponse, UnlockPath, UnlockedPathRequest, UpgradeFileHeader, VerifyMessage, ViewAmount, ViewDetail, ViewRawData, ViewSignLayout, ViewSignPage, ViewTip, ViewTipType, ViewVerifyPage, Vote, WL_OperationType, Wallpaper, WallpaperTarget, WipeDevice, WordAck, WordRequest, WordRequestType, WriteSEPrivateKey, WriteSEPublicCert, ZoomRequest, bytesToHex, concatUint8Arrays, _default as default, experimental_field, experimental_message, facotry, getErrorMessage, hexToBytes, isProtocolV2LinkError, probeProtocolV2, index as protocolV1, protocolV2Codec as protocolV2, withProtocolTimeout, writeProtocolV2BleFrame };