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

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.
@@ -3,9 +3,10 @@ const {
3
3
  createMessageFromType,
4
4
  parseConfigure,
5
5
  } = require('../src/serialization/protobuf/messages');
6
- const v1Messages = require('../messages.json');
6
+ const v1Messages = require('../../core/src/data/messages/messages.json');
7
7
  const v2Messages = require('../messages-protocol-v2.json');
8
8
  const coreV2Messages = require('../../core/src/data/messages/messages-protocol-v2.json');
9
+ const generatedTypes = require('../src/types/messages');
9
10
 
10
11
  // const json = require('./data/messages.json');
11
12
 
@@ -62,11 +63,12 @@ const json = {
62
63
  };
63
64
 
64
65
  describe('messages', () => {
65
- test('V1 GetPassphraseState includes attach-to-pin request flags', () => {
66
+ test('V1 GetPassphraseState matches the current firmware schema', () => {
66
67
  const { fields } = v1Messages.nested.GetPassphraseState;
67
68
 
68
- expect(fields._only_main_pin).toMatchObject({ id: 2, type: 'bool' });
69
- expect(fields.allow_create_attach_pin).toMatchObject({ id: 3, type: 'bool' });
69
+ expect(fields.passphrase_state).toMatchObject({ id: 1, type: 'string' });
70
+ expect(fields).not.toHaveProperty('_only_main_pin');
71
+ expect(fields).not.toHaveProperty('allow_create_attach_pin');
70
72
  });
71
73
 
72
74
  test('Protocol V2 firmware targets match the current firmware-pro2 enum', () => {
@@ -85,6 +87,16 @@ describe('messages', () => {
85
87
  });
86
88
  });
87
89
 
90
+ test('Protocol V2 conflicting enums keep their own wire values', () => {
91
+ expect(generatedTypes.ProtocolV2FailureType).toMatchObject({
92
+ Failure_DataError: 4,
93
+ Failure_ProcessError: 5,
94
+ });
95
+ expect(generatedTypes.Enum_ProtocolV2Capability).toMatchObject({
96
+ Capability_AttachToPin: 18,
97
+ });
98
+ });
99
+
88
100
  test('Protocol V2 device status and session messages match firmware-pro2', () => {
89
101
  expect(v2Messages.nested.MessageType.values).toMatchObject({
90
102
  MessageType_DeviceStatusGet: 60602,
@@ -92,7 +104,6 @@ describe('messages', () => {
92
104
  MessageType_DeviceSessionGet: 60606,
93
105
  MessageType_DeviceSession: 60607,
94
106
  MessageType_DeviceSessionAskPin: 60608,
95
- MessageType_DeviceSessionPinResult: 60609,
96
107
  });
97
108
  expect(v2Messages.nested.DeviceStatusGet).toEqual({ fields: {} });
98
109
  expect(v2Messages.nested.DeviceSessionGet.fields.session_id).toMatchObject({
@@ -104,11 +115,12 @@ describe('messages', () => {
104
115
  btc_test_address: { id: 2, type: 'string' },
105
116
  });
106
117
  expect(v2Messages.nested.DeviceSessionAskPin).toEqual({ fields: {} });
107
- expect(v2Messages.nested.DeviceSessionPinResult.fields).toMatchObject({
108
- unlocked: { id: 1, type: 'bool' },
109
- unlocked_attach_pin: { id: 2, type: 'bool' },
110
- passphrase_protection: { id: 3, type: 'bool' },
118
+ expect(v2Messages.nested.DeviceSessionAskPin_FailureSubCodes.values).toEqual({
119
+ UserCancel: 1,
111
120
  });
121
+ expect(v2Messages.nested.MessageType.values).not.toHaveProperty(
122
+ 'MessageType_DeviceSessionPinResult'
123
+ );
112
124
  });
113
125
 
114
126
  test('Protocol V2 does not restore retired unlock or passphrase ids', () => {
@@ -95,6 +95,22 @@ const protocolV2Messages = parseConfigure({
95
95
  },
96
96
  },
97
97
  },
98
+ Failure: {
99
+ fields: {
100
+ code: {
101
+ type: 'uint32',
102
+ id: 1,
103
+ },
104
+ subcode: {
105
+ type: 'uint32',
106
+ id: 2,
107
+ },
108
+ message: {
109
+ type: 'string',
110
+ id: 3,
111
+ },
112
+ },
113
+ },
98
114
  DeviceFirmwareTarget: {
99
115
  fields: {
100
116
  target_id: {
@@ -174,6 +190,7 @@ const protocolV2Messages = parseConfigure({
174
190
  MessageType_ProtocolInfo: 60201,
175
191
  MessageType_Ping: 60206,
176
192
  MessageType_Success: 60207,
193
+ MessageType_Failure: 60208,
177
194
  MessageType_FileWrite: 60805,
178
195
  MessageType_DeviceFirmwareUpdateRequest: 61000,
179
196
  MessageType_DeviceFirmwareUpdateStatus: 61002,
@@ -318,6 +335,76 @@ describe('Protocol V2 framing and session', () => {
318
335
  });
319
336
  });
320
337
 
338
+ test('session logs Protocol V2 TX and RX frame metadata without payloads', async () => {
339
+ const written = [];
340
+ const logger = { debug: jest.fn() };
341
+ const response = ProtocolV2.encodeFrame(schemas, 'ProtocolInfo', {
342
+ version: 2,
343
+ supported_messages: [60206],
344
+ protobuf_definition: 'sensitive-schema',
345
+ });
346
+ const session = new ProtocolV2Session({
347
+ schemas,
348
+ router: 1,
349
+ logger,
350
+ logPrefix: 'ProtocolV2 Test',
351
+ writeFrame: frame => {
352
+ written.push(frame);
353
+ return Promise.resolve();
354
+ },
355
+ readFrame: () =>
356
+ Promise.resolve(rewriteSeq(response, protocolV2.decodeFrame(written[0]).seq)),
357
+ });
358
+
359
+ await session.call('ProtocolInfoRequest', {});
360
+
361
+ const tx = protocolV2.decodeFrame(written[0]);
362
+ const rx = protocolV2.decodeFrame(rewriteSeq(response, tx.seq));
363
+ expect(logger.debug).toHaveBeenCalledWith('[ProtocolV2 Test] TX', {
364
+ method: 'ProtocolInfoRequest',
365
+ type: 'ProtocolInfoRequest',
366
+ typeId: tx.messageTypeId,
367
+ seq: tx.seq,
368
+ bytes: written[0].length,
369
+ });
370
+ expect(logger.debug).toHaveBeenCalledWith('[ProtocolV2 Test] RX', {
371
+ method: 'ProtocolInfoRequest',
372
+ type: 'ProtocolInfo',
373
+ typeId: rx.messageTypeId,
374
+ seq: rx.seq,
375
+ bytes: response.length,
376
+ });
377
+ expect(JSON.stringify(logger.debug.mock.calls)).not.toContain('sensitive-schema');
378
+ expect(JSON.stringify(logger.debug.mock.calls)).not.toContain('supported_messages');
379
+ });
380
+
381
+ test('session logs RX frame metadata before protobuf payload decoding fails', async () => {
382
+ const logger = { debug: jest.fn() };
383
+ const response = protocolV2.encodeProtobufFrame(
384
+ 60208,
385
+ hexToBytes('0801121648616e646c6572206e6f742072656769737465726564')
386
+ );
387
+ const session = new ProtocolV2Session({
388
+ schemas,
389
+ router: 1,
390
+ logger,
391
+ logPrefix: 'ProtocolV2 Test',
392
+ writeFrame: () => Promise.resolve(),
393
+ readFrame: () => Promise.resolve(response),
394
+ });
395
+
396
+ await expect(session.call('Ping', { message: 'hello' })).rejects.toThrow();
397
+
398
+ const rx = protocolV2.decodeFrame(response);
399
+ expect(logger.debug).toHaveBeenCalledWith('[ProtocolV2 Test] RX', {
400
+ method: 'Ping',
401
+ type: 'Failure',
402
+ typeId: rx.messageTypeId,
403
+ seq: rx.seq,
404
+ bytes: response.length,
405
+ });
406
+ });
407
+
321
408
  test('session skips Proto Link ACK frames before decoding the protobuf response', async () => {
322
409
  const ack = new Uint8Array(8);
323
410
  ack[0] = 0x5a;
@@ -392,7 +479,7 @@ describe('Protocol V2 framing and session', () => {
392
479
  });
393
480
  });
394
481
 
395
- test('session accepts response frames with a device-owned seq without logging frame details', async () => {
482
+ test('session logs a device-owned response seq without rejecting the frame', async () => {
396
483
  const response = ProtocolV2.encodeFrame(schemas, 'ProtocolInfo', {
397
484
  version: 2,
398
485
  supported_messages: [],
@@ -416,7 +503,13 @@ describe('Protocol V2 framing and session', () => {
416
503
  protobuf_definition: null,
417
504
  },
418
505
  });
419
- expect(logger.debug).not.toHaveBeenCalled();
506
+ expect(logger.debug).toHaveBeenCalledWith('[ProtocolV2] RX', {
507
+ method: 'ProtocolInfoRequest',
508
+ type: 'ProtocolInfo',
509
+ typeId: 60201,
510
+ seq: 200,
511
+ bytes: response.length,
512
+ });
420
513
  });
421
514
 
422
515
  test('session does not log transmit or receive payload details', async () => {
@@ -442,7 +535,10 @@ describe('Protocol V2 framing and session', () => {
442
535
  },
443
536
  });
444
537
 
445
- expect(logger.debug).not.toHaveBeenCalled();
538
+ expect(logger.debug).toHaveBeenCalledTimes(2);
539
+ const logs = JSON.stringify(logger.debug.mock.calls);
540
+ expect(logs).not.toContain('hello');
541
+ expect(logs).not.toContain('accepted');
446
542
  });
447
543
 
448
544
  test('session suppresses debug logs for file transfer calls', async () => {
package/dist/index.d.ts CHANGED
@@ -152,6 +152,13 @@ declare const ProtocolV1: {
152
152
  };
153
153
  declare const ProtocolV2: {
154
154
  isAckFrame: typeof isAckFrame;
155
+ inspectFrame(schemas: ProtocolV2Schemas$1, frame: Uint8Array): {
156
+ messageName: string;
157
+ messageTypeId: number;
158
+ pbPayload: Uint8Array;
159
+ seq: number;
160
+ type: string;
161
+ };
155
162
  encodeFrame(schemas: ProtocolV2Schemas$1, name: string, data: Record<string, unknown>, options?: ProtocolV2FrameOptions): Uint8Array;
156
163
  decodeFrame(schemas: ProtocolV2Schemas$1, frame: Uint8Array): {
157
164
  message: {
@@ -2067,6 +2074,19 @@ type Features = {
2067
2074
  onekey_se04_state?: string | null;
2068
2075
  attach_to_pin_user?: boolean;
2069
2076
  unlocked_attach_pin?: boolean;
2077
+ coprocessor_bt_name?: string;
2078
+ coprocessor_version?: string;
2079
+ coprocessor_bt_enable?: boolean;
2080
+ romloader_version?: string;
2081
+ onekey_romloader_version?: string;
2082
+ onekey_romloader_hash?: string;
2083
+ onekey_bootloader_version?: string;
2084
+ onekey_bootloader_hash?: string;
2085
+ onekey_bootloader_build_id?: string;
2086
+ onekey_coprocessor_bt_name?: string;
2087
+ onekey_coprocessor_version?: string;
2088
+ onekey_coprocessor_build_id?: string;
2089
+ onekey_coprocessor_hash?: string;
2070
2090
  };
2071
2091
  type OnekeyFeatures = {
2072
2092
  onekey_device_type?: OneKeyDeviceType;
@@ -3680,7 +3700,10 @@ type ViewRawData = {
3680
3700
  };
3681
3701
  declare enum ViewSignLayout {
3682
3702
  LayoutDefault = 0,
3683
- LayoutSafeTxCreate = 1
3703
+ LayoutSafeTxCreate = 1,
3704
+ LayoutFinalConfirm = 2,
3705
+ Layout7702 = 3,
3706
+ LayoutFlat = 4
3684
3707
  }
3685
3708
  type ViewSignPage = {
3686
3709
  title: string;
@@ -3936,11 +3959,9 @@ type DeviceSession = {
3936
3959
  btc_test_address?: string;
3937
3960
  };
3938
3961
  type DeviceSessionAskPin = {};
3939
- type DeviceSessionPinResult = {
3940
- unlocked?: boolean;
3941
- unlocked_attach_pin?: boolean;
3942
- passphrase_protection?: boolean;
3943
- };
3962
+ declare enum DeviceSessionAskPin_FailureSubCodes {
3963
+ UserCancel = 1
3964
+ }
3944
3965
  type DeviceStatus = {
3945
3966
  device_id?: string;
3946
3967
  unlocked?: boolean;
@@ -4033,6 +4054,35 @@ type FilesystemFormat = {
4033
4054
  user: boolean;
4034
4055
  };
4035
4056
  type PortfolioUpdate = {};
4057
+ declare enum ProtocolV2FailureType {
4058
+ Failure_InvalidMessage = 1,
4059
+ Failure_UndefinedError = 2,
4060
+ Failure_UsageError = 3,
4061
+ Failure_DataError = 4,
4062
+ Failure_ProcessError = 5
4063
+ }
4064
+ declare enum Enum_ProtocolV2Capability {
4065
+ Capability_Bitcoin = 1,
4066
+ Capability_Bitcoin_like = 2,
4067
+ Capability_Binance = 3,
4068
+ Capability_Cardano = 4,
4069
+ Capability_Crypto = 5,
4070
+ Capability_EOS = 6,
4071
+ Capability_Ethereum = 7,
4072
+ Capability_Lisk = 8,
4073
+ Capability_Monero = 9,
4074
+ Capability_NEM = 10,
4075
+ Capability_Ripple = 11,
4076
+ Capability_Stellar = 12,
4077
+ Capability_Tezos = 13,
4078
+ Capability_U2F = 14,
4079
+ Capability_Shamir = 15,
4080
+ Capability_ShamirGroups = 16,
4081
+ Capability_PassphraseEntry = 17,
4082
+ Capability_AttachToPin = 18,
4083
+ Capability_EthereumTypedData = 1000
4084
+ }
4085
+ type ProtocolV2Capability = keyof typeof Enum_ProtocolV2Capability;
4036
4086
  type MessageType = {
4037
4087
  AlephiumGetAddress: AlephiumGetAddress;
4038
4088
  AlephiumAddress: AlephiumAddress;
@@ -4651,7 +4701,6 @@ type MessageType = {
4651
4701
  DeviceSessionGet: DeviceSessionGet;
4652
4702
  DeviceSession: DeviceSession;
4653
4703
  DeviceSessionAskPin: DeviceSessionAskPin;
4654
- DeviceSessionPinResult: DeviceSessionPinResult;
4655
4704
  DeviceStatus: DeviceStatus;
4656
4705
  DeviceStatusGet: DeviceStatusGet;
4657
4706
  DevGetOnboardingStatus: DevGetOnboardingStatus;
@@ -5462,7 +5511,8 @@ type messages_ProtocolV2DeviceInfo = ProtocolV2DeviceInfo;
5462
5511
  type messages_DeviceSessionGet = DeviceSessionGet;
5463
5512
  type messages_DeviceSession = DeviceSession;
5464
5513
  type messages_DeviceSessionAskPin = DeviceSessionAskPin;
5465
- type messages_DeviceSessionPinResult = DeviceSessionPinResult;
5514
+ type messages_DeviceSessionAskPin_FailureSubCodes = DeviceSessionAskPin_FailureSubCodes;
5515
+ declare const messages_DeviceSessionAskPin_FailureSubCodes: typeof DeviceSessionAskPin_FailureSubCodes;
5466
5516
  type messages_DeviceStatus = DeviceStatus;
5467
5517
  type messages_DeviceStatusGet = DeviceStatusGet;
5468
5518
  type messages_DevOnboardingStage = DevOnboardingStage;
@@ -5482,6 +5532,11 @@ type messages_FilesystemDirMake = FilesystemDirMake;
5482
5532
  type messages_FilesystemDirRemove = FilesystemDirRemove;
5483
5533
  type messages_FilesystemFormat = FilesystemFormat;
5484
5534
  type messages_PortfolioUpdate = PortfolioUpdate;
5535
+ type messages_ProtocolV2FailureType = ProtocolV2FailureType;
5536
+ declare const messages_ProtocolV2FailureType: typeof ProtocolV2FailureType;
5537
+ type messages_Enum_ProtocolV2Capability = Enum_ProtocolV2Capability;
5538
+ declare const messages_Enum_ProtocolV2Capability: typeof Enum_ProtocolV2Capability;
5539
+ type messages_ProtocolV2Capability = ProtocolV2Capability;
5485
5540
  type messages_MessageType = MessageType;
5486
5541
  type messages_MessageKey = MessageKey;
5487
5542
  type messages_MessageResponse<T extends MessageKey> = MessageResponse<T>;
@@ -6195,7 +6250,7 @@ declare namespace messages {
6195
6250
  messages_DeviceSessionGet as DeviceSessionGet,
6196
6251
  messages_DeviceSession as DeviceSession,
6197
6252
  messages_DeviceSessionAskPin as DeviceSessionAskPin,
6198
- messages_DeviceSessionPinResult as DeviceSessionPinResult,
6253
+ messages_DeviceSessionAskPin_FailureSubCodes as DeviceSessionAskPin_FailureSubCodes,
6199
6254
  messages_DeviceStatus as DeviceStatus,
6200
6255
  messages_DeviceStatusGet as DeviceStatusGet,
6201
6256
  messages_DevOnboardingStage as DevOnboardingStage,
@@ -6214,6 +6269,9 @@ declare namespace messages {
6214
6269
  messages_FilesystemDirRemove as FilesystemDirRemove,
6215
6270
  messages_FilesystemFormat as FilesystemFormat,
6216
6271
  messages_PortfolioUpdate as PortfolioUpdate,
6272
+ messages_ProtocolV2FailureType as ProtocolV2FailureType,
6273
+ messages_Enum_ProtocolV2Capability as Enum_ProtocolV2Capability,
6274
+ messages_ProtocolV2Capability as ProtocolV2Capability,
6217
6275
  messages_MessageType as MessageType,
6218
6276
  messages_MessageKey as MessageKey,
6219
6277
  messages_MessageResponse as MessageResponse,
@@ -6406,6 +6464,16 @@ declare const _default: {
6406
6464
  };
6407
6465
  ProtocolV2: {
6408
6466
  isAckFrame: typeof isAckFrame;
6467
+ inspectFrame(schemas: {
6468
+ protocolV1: protobuf.Root;
6469
+ protocolV2: protobuf.Root;
6470
+ }, frame: Uint8Array): {
6471
+ messageName: string;
6472
+ messageTypeId: number;
6473
+ pbPayload: Uint8Array;
6474
+ seq: number;
6475
+ type: string;
6476
+ };
6409
6477
  encodeFrame(schemas: {
6410
6478
  protocolV1: protobuf.Root;
6411
6479
  protocolV2: protobuf.Root;
@@ -6454,4 +6522,4 @@ declare const _default: {
6454
6522
  withProtocolTimeout: typeof withProtocolTimeout;
6455
6523
  };
6456
6524
 
6457
- 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, DevOnboardingStage, DevOnboardingStatus, 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, DeviceSessionAskPin, DeviceSessionGet, DeviceSessionPinResult, 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_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, 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, 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, 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_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, PortfolioUpdate, PreauthorizedRequest, PrevInput, PrevOutput, PrevTx, ProtocolInfo, ProtocolInfoRequest, ProtocolType, ProtocolV1, ProtocolV2, ProtocolV2CallContext, ProtocolV2CallOptions, ProtocolV2DeviceInfo, ProtocolV2FrameAssembler, ProtocolV2LinkAdapter, ProtocolV2LinkErrorClassification, 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, 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, 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, probeProtocolV2, index as protocolV1, protocolV2Codec as protocolV2, withProtocolTimeout };
6525
+ 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, DevOnboardingStage, DevOnboardingStatus, 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, DeviceSessionAskPin, DeviceSessionAskPin_FailureSubCodes, DeviceSessionGet, 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_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, 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, 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_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, PortfolioUpdate, PreauthorizedRequest, PrevInput, PrevOutput, PrevTx, ProtocolInfo, ProtocolInfoRequest, ProtocolType, ProtocolV1, ProtocolV2, ProtocolV2CallContext, ProtocolV2CallOptions, ProtocolV2Capability, ProtocolV2DeviceInfo, ProtocolV2FailureType, ProtocolV2FrameAssembler, ProtocolV2LinkAdapter, ProtocolV2LinkErrorClassification, 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, 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, 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, probeProtocolV2, index as protocolV1, protocolV2Codec as protocolV2, withProtocolTimeout };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EAKL,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,eAAe,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAEL,wBAAwB,EACxB,iBAAiB,EACjB,UAAU,EAEV,eAAe,EACf,UAAU,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO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ACjB,oBAAoB,EACpB,6BAA6B,EAC7B,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,GACb,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,UAAU,MAAM,gBAAgB,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElD,wBAsBE"}
package/dist/index.js CHANGED
@@ -634,6 +634,17 @@ const ProtocolV1 = {
634
634
  };
635
635
  const ProtocolV2 = {
636
636
  isAckFrame,
637
+ inspectFrame(schemas, frame) {
638
+ const { messageTypeId, pbPayload, seq } = decodeFrame(frame);
639
+ const { messageName } = createProtocolV2MessageFromType(messageTypeId, schemas);
640
+ return {
641
+ messageName,
642
+ messageTypeId,
643
+ pbPayload,
644
+ seq,
645
+ type: messageName,
646
+ };
647
+ },
637
648
  encodeFrame(schemas, name, data, options = {}) {
638
649
  const encodeMessages = resolveProtocolV2EncodeSchema(name, schemas);
639
650
  const { Message, messageTypeId } = createMessageFromName(encodeMessages, name);
@@ -644,8 +655,8 @@ const ProtocolV2 = {
644
655
  return encodeProtobufFrame(messageTypeId, pbBytes, options.packetSrc, options.router, options.seq);
645
656
  },
646
657
  decodeFrame(schemas, frame) {
647
- const { messageTypeId, pbPayload, seq } = decodeFrame(frame);
648
- const { Message, messageName } = createProtocolV2MessageFromType(messageTypeId, schemas);
658
+ const { messageTypeId, pbPayload, seq, messageName } = this.inspectFrame(schemas, frame);
659
+ const { Message } = createProtocolV2MessageFromType(messageTypeId, schemas);
649
660
  const rxByteBuffer = ByteBuffer__default["default"].wrap(Buffer.from(pbPayload));
650
661
  const message = decode(Message, rxByteBuffer);
651
662
  return {
@@ -867,6 +878,7 @@ class ProtocolV2Session {
867
878
  return result;
868
879
  }
869
880
  executeCall(name, data, callOptions) {
881
+ var _a;
870
882
  return __awaiter(this, void 0, void 0, function* () {
871
883
  const { schemas, router, packetSrc = PROTOCOL_V2_PACKET_SRC_COMMAND, maxFrameBytes, prepareCall, writeFrame, readFrame, logger, logPrefix = 'ProtocolV2', createTimeoutError, generation = 0, } = this.options;
872
884
  const shouldReduceDebug = shouldReduceProtocolV2Debug(name);
@@ -883,13 +895,23 @@ class ProtocolV2Session {
883
895
  router,
884
896
  seq: protoSeq,
885
897
  });
898
+ const txMetadata = ProtocolV2.inspectFrame(schemas, frame);
886
899
  if (maxFrameBytes !== undefined && frame.length > maxFrameBytes) {
887
900
  throw new Error(`Protocol V2 frame too large for transport: ${frame.length} > ${maxFrameBytes}`);
888
901
  }
902
+ if (!shouldReduceDebug) {
903
+ (_a = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _a === void 0 ? void 0 : _a.call(logger, `[${logPrefix}] TX`, {
904
+ method: name,
905
+ type: name,
906
+ typeId: txMetadata.messageTypeId,
907
+ seq: txMetadata.seq,
908
+ bytes: frame.length,
909
+ });
910
+ }
889
911
  yield withProtocolTimeout(writeFrame(frame, callContext), PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS, () => new Error(`Protocol V2 write timeout after ${PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS}ms for ${name}`));
890
912
  const cancellation = { cancelled: false };
891
913
  const readResponse = () => __awaiter(this, void 0, void 0, function* () {
892
- var _a, _b, _c, _d;
914
+ var _b, _c, _d, _e, _f;
893
915
  while (!cancellation.cancelled) {
894
916
  const rxFrame = yield readFrame(callContext);
895
917
  if (cancellation.cancelled) {
@@ -897,16 +919,26 @@ class ProtocolV2Session {
897
919
  }
898
920
  const isAck = ProtocolV2.isAckFrame(rxFrame);
899
921
  if (!isAck) {
922
+ const rxMetadata = ProtocolV2.inspectFrame(schemas, rxFrame);
923
+ if (!shouldReduceDebug) {
924
+ (_b = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _b === void 0 ? void 0 : _b.call(logger, `[${logPrefix}] RX`, {
925
+ method: name,
926
+ type: rxMetadata.type,
927
+ typeId: rxMetadata.messageTypeId,
928
+ seq: rxMetadata.seq,
929
+ bytes: rxFrame.length,
930
+ });
931
+ }
900
932
  const decoded = ProtocolV2.decodeFrame(schemas, rxFrame);
901
933
  const response = call(decoded);
902
- if ((_a = callOptions.intermediateTypes) === null || _a === void 0 ? void 0 : _a.includes(response.type)) {
903
- (_b = callOptions.onIntermediateResponse) === null || _b === void 0 ? void 0 : _b.call(callOptions, response);
934
+ if ((_c = callOptions.intermediateTypes) === null || _c === void 0 ? void 0 : _c.includes(response.type)) {
935
+ (_d = callOptions.onIntermediateResponse) === null || _d === void 0 ? void 0 : _d.call(callOptions, response);
904
936
  }
905
937
  else if (isExpectedTerminalResponse(response, callOptions.expectedTypes)) {
906
938
  return response;
907
939
  }
908
940
  else if (!shouldReduceDebug) {
909
- (_c = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _c === void 0 ? void 0 : _c.call(logger, `[${logPrefix}] skip unexpected response for ${name}: expected=${(_d = callOptions.expectedTypes) === null || _d === void 0 ? void 0 : _d.join('|')} got=${response.type}`);
941
+ (_e = logger === null || logger === void 0 ? void 0 : logger.debug) === null || _e === void 0 ? void 0 : _e.call(logger, `[${logPrefix}] skip unexpected response for ${name}: expected=${(_f = callOptions.expectedTypes) === null || _f === void 0 ? void 0 : _f.join('|')} got=${response.type}`);
910
942
  }
911
943
  }
912
944
  }
@@ -1648,6 +1680,9 @@ exports.ViewSignLayout = void 0;
1648
1680
  (function (ViewSignLayout) {
1649
1681
  ViewSignLayout[ViewSignLayout["LayoutDefault"] = 0] = "LayoutDefault";
1650
1682
  ViewSignLayout[ViewSignLayout["LayoutSafeTxCreate"] = 1] = "LayoutSafeTxCreate";
1683
+ ViewSignLayout[ViewSignLayout["LayoutFinalConfirm"] = 2] = "LayoutFinalConfirm";
1684
+ ViewSignLayout[ViewSignLayout["Layout7702"] = 3] = "Layout7702";
1685
+ ViewSignLayout[ViewSignLayout["LayoutFlat"] = 4] = "LayoutFlat";
1651
1686
  })(exports.ViewSignLayout || (exports.ViewSignLayout = {}));
1652
1687
  exports.DeviceErrorCode = void 0;
1653
1688
  (function (DeviceErrorCode) {
@@ -1730,6 +1765,10 @@ exports.DeviceSEState = void 0;
1730
1765
  DeviceSEState[DeviceSEState["APP_FACTORY"] = 51] = "APP_FACTORY";
1731
1766
  DeviceSEState[DeviceSEState["APP"] = 85] = "APP";
1732
1767
  })(exports.DeviceSEState || (exports.DeviceSEState = {}));
1768
+ exports.DeviceSessionAskPin_FailureSubCodes = void 0;
1769
+ (function (DeviceSessionAskPin_FailureSubCodes) {
1770
+ DeviceSessionAskPin_FailureSubCodes[DeviceSessionAskPin_FailureSubCodes["UserCancel"] = 1] = "UserCancel";
1771
+ })(exports.DeviceSessionAskPin_FailureSubCodes || (exports.DeviceSessionAskPin_FailureSubCodes = {}));
1733
1772
  exports.DevOnboardingStage = void 0;
1734
1773
  (function (DevOnboardingStage) {
1735
1774
  DevOnboardingStage[DevOnboardingStage["DEV_ONBOARDING_STAGE_UNKNOWN"] = 0] = "DEV_ONBOARDING_STAGE_UNKNOWN";
@@ -1746,6 +1785,36 @@ exports.DevOnboardingStage = void 0;
1746
1785
  DevOnboardingStage[DevOnboardingStage["DEV_ONBOARDING_STAGE_SEEDCARD_BACKUP"] = 11] = "DEV_ONBOARDING_STAGE_SEEDCARD_BACKUP";
1747
1786
  DevOnboardingStage[DevOnboardingStage["DEV_ONBOARDING_STAGE_DONE"] = 12] = "DEV_ONBOARDING_STAGE_DONE";
1748
1787
  })(exports.DevOnboardingStage || (exports.DevOnboardingStage = {}));
1788
+ exports.ProtocolV2FailureType = void 0;
1789
+ (function (ProtocolV2FailureType) {
1790
+ ProtocolV2FailureType[ProtocolV2FailureType["Failure_InvalidMessage"] = 1] = "Failure_InvalidMessage";
1791
+ ProtocolV2FailureType[ProtocolV2FailureType["Failure_UndefinedError"] = 2] = "Failure_UndefinedError";
1792
+ ProtocolV2FailureType[ProtocolV2FailureType["Failure_UsageError"] = 3] = "Failure_UsageError";
1793
+ ProtocolV2FailureType[ProtocolV2FailureType["Failure_DataError"] = 4] = "Failure_DataError";
1794
+ ProtocolV2FailureType[ProtocolV2FailureType["Failure_ProcessError"] = 5] = "Failure_ProcessError";
1795
+ })(exports.ProtocolV2FailureType || (exports.ProtocolV2FailureType = {}));
1796
+ exports.Enum_ProtocolV2Capability = void 0;
1797
+ (function (Enum_ProtocolV2Capability) {
1798
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Bitcoin"] = 1] = "Capability_Bitcoin";
1799
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Bitcoin_like"] = 2] = "Capability_Bitcoin_like";
1800
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Binance"] = 3] = "Capability_Binance";
1801
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Cardano"] = 4] = "Capability_Cardano";
1802
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Crypto"] = 5] = "Capability_Crypto";
1803
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_EOS"] = 6] = "Capability_EOS";
1804
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Ethereum"] = 7] = "Capability_Ethereum";
1805
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Lisk"] = 8] = "Capability_Lisk";
1806
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Monero"] = 9] = "Capability_Monero";
1807
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_NEM"] = 10] = "Capability_NEM";
1808
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Ripple"] = 11] = "Capability_Ripple";
1809
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Stellar"] = 12] = "Capability_Stellar";
1810
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Tezos"] = 13] = "Capability_Tezos";
1811
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_U2F"] = 14] = "Capability_U2F";
1812
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_Shamir"] = 15] = "Capability_Shamir";
1813
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_ShamirGroups"] = 16] = "Capability_ShamirGroups";
1814
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_PassphraseEntry"] = 17] = "Capability_PassphraseEntry";
1815
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_AttachToPin"] = 18] = "Capability_AttachToPin";
1816
+ Enum_ProtocolV2Capability[Enum_ProtocolV2Capability["Capability_EthereumTypedData"] = 1000] = "Capability_EthereumTypedData";
1817
+ })(exports.Enum_ProtocolV2Capability || (exports.Enum_ProtocolV2Capability = {}));
1749
1818
 
1750
1819
  var messages = /*#__PURE__*/Object.freeze({
1751
1820
  __proto__: null,
@@ -1822,7 +1891,10 @@ var messages = /*#__PURE__*/Object.freeze({
1822
1891
  get DeviceType () { return exports.DeviceType; },
1823
1892
  get DeviceSeType () { return exports.DeviceSeType; },
1824
1893
  get DeviceSEState () { return exports.DeviceSEState; },
1825
- get DevOnboardingStage () { return exports.DevOnboardingStage; }
1894
+ get DeviceSessionAskPin_FailureSubCodes () { return exports.DeviceSessionAskPin_FailureSubCodes; },
1895
+ get DevOnboardingStage () { return exports.DevOnboardingStage; },
1896
+ get ProtocolV2FailureType () { return exports.ProtocolV2FailureType; },
1897
+ get Enum_ProtocolV2Capability () { return exports.Enum_ProtocolV2Capability; }
1826
1898
  });
1827
1899
 
1828
1900
  protobuf__namespace.util.Long = Long__default["default"];
@@ -27,6 +27,13 @@ export declare const ProtocolV1: {
27
27
  };
28
28
  export declare const ProtocolV2: {
29
29
  isAckFrame: typeof isAckFrame;
30
+ inspectFrame(schemas: ProtocolV2Schemas, frame: Uint8Array): {
31
+ messageName: string;
32
+ messageTypeId: number;
33
+ pbPayload: Uint8Array;
34
+ seq: number;
35
+ type: string;
36
+ };
30
37
  encodeFrame(schemas: ProtocolV2Schemas, name: string, data: Record<string, unknown>, options?: ProtocolV2FrameOptions): Uint8Array;
31
38
  decodeFrame(schemas: ProtocolV2Schemas, frame: Uint8Array): {
32
39
  message: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocols/index.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAA+C,MAAM,cAAc,CAAC;AAElG,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAIhE,OAAO,EAAqD,UAAU,EAAE,MAAM,MAAM,CAAC;AAErF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,eAAO,MAAM,iCAAiC,QAAQ,CAAC;AAEvD,KAAK,iBAAiB,GAAG;IACvB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAsCF,eAAO,MAAM,UAAU;;;;;;;;;;CAOtB,CAAC;AAEF,eAAO,MAAM,UAAU;;yBAIV,iBAAiB,QACpB,MAAM,QACN,OAAO,MAAM,EAAE,OAAO,CAAC,YACpB,sBAAsB;yBAkBZ,iBAAiB,SAAS,UAAU;;;;;;;;;;CAe1D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocols/index.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAA+C,MAAM,cAAc,CAAC;AAElG,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAIhE,OAAO,EAAqD,UAAU,EAAE,MAAM,MAAM,CAAC;AAErF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,eAAO,MAAM,iCAAiC,QAAQ,CAAC;AAEvD,KAAK,iBAAiB,GAAG;IACvB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAsCF,eAAO,MAAM,UAAU;;;;;;;;;;CAOtB,CAAC;AAEF,eAAO,MAAM,UAAU;;0BAGC,iBAAiB,SAAS,UAAU;;;;;;;yBAa/C,iBAAiB,QACpB,MAAM,QACN,OAAO,MAAM,EAAE,OAAO,CAAC,YACpB,sBAAsB;yBAkBZ,iBAAiB,SAAS,UAAU;;;;;;;;;;CAe1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAK7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAA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