@onekeyfe/hd-transport 1.2.0-alpha.23 → 1.2.0-alpha.25

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.
@@ -140,7 +140,14 @@ describe('messages', () => {
140
140
  id: 1,
141
141
  type: 'DeviceSessionPinType',
142
142
  });
143
- expect(v2Messages.nested.DeviceSessionAskPassphrase).toEqual({ fields: {} });
143
+ expect(v2Messages.nested.DeviceSessionAskPassphrase).toEqual({
144
+ fields: {
145
+ passphrase: {
146
+ type: 'string',
147
+ id: 1,
148
+ },
149
+ },
150
+ });
144
151
  expect(v2Messages.nested.DeviceSessionAskPin_FailureSubCodes.values).toEqual({
145
152
  UserCancel: 1,
146
153
  });
@@ -341,4 +341,49 @@ describe('ProtocolV2LinkManager', () => {
341
341
  await expect(call).rejects.toThrow('device disconnected');
342
342
  expect(adapter.readFrame).not.toHaveBeenCalled();
343
343
  });
344
+
345
+ test('rejects calls queued before their link generation is invalidated', async () => {
346
+ let releaseWrite;
347
+ let markWriteStarted;
348
+ const writeStarted = new Promise(resolve => {
349
+ markWriteStarted = resolve;
350
+ });
351
+ const writeBlocked = new Promise(resolve => {
352
+ releaseWrite = resolve;
353
+ });
354
+ const success = ProtocolV2.encodeFrame(
355
+ schemas,
356
+ 'Success',
357
+ { message: 'ok' },
358
+ { router: 1, packetSrc: 0, seq: 1 }
359
+ );
360
+ const adapter = {
361
+ router: 1,
362
+ generation: 1,
363
+ prepareCall: jest.fn(),
364
+ writeFrame: jest.fn(async () => {
365
+ markWriteStarted();
366
+ await writeBlocked;
367
+ }),
368
+ readFrame: jest.fn(() => Promise.resolve(success)),
369
+ reset: jest.fn(),
370
+ };
371
+ const createAdapter = jest.fn(() => adapter);
372
+ const manager = new ProtocolV2LinkManager({
373
+ getSchemas: () => schemas,
374
+ classifyError: () => 'recoverable',
375
+ });
376
+
377
+ const activeCall = manager.call('device-a', createAdapter, 'Ping', { message: 'active' });
378
+ await writeStarted;
379
+ const queuedCall = manager.call('device-a', createAdapter, 'Ping', { message: 'queued' });
380
+ await manager.invalidateLink('device-a', 'device released');
381
+ releaseWrite();
382
+
383
+ await expect(activeCall).rejects.toThrow('device released');
384
+ await expect(queuedCall).rejects.toThrow('device released');
385
+ expect(createAdapter).toHaveBeenCalledTimes(1);
386
+ expect(adapter.writeFrame).toHaveBeenCalledTimes(1);
387
+ expect(adapter.readFrame).not.toHaveBeenCalled();
388
+ });
344
389
  });
@@ -65,6 +65,7 @@ class FakeUsbTransport extends ProtocolV2UsbTransportBase {
65
65
  this.nextReadError = undefined;
66
66
  this.writeBlock = undefined;
67
67
  this.readBlock = undefined;
68
+ this.coalesceNextResponses = false;
68
69
  }
69
70
 
70
71
  callDevice(key, message, timeoutMs) {
@@ -118,6 +119,10 @@ class FakeUsbTransport extends ProtocolV2UsbTransportBase {
118
119
  return { started, release };
119
120
  }
120
121
 
122
+ coalesceNextTwoResponses() {
123
+ this.coalesceNextResponses = true;
124
+ }
125
+
121
126
  getProtocolV2UsbSchemas() {
122
127
  return schemas;
123
128
  }
@@ -135,8 +140,22 @@ class FakeUsbTransport extends ProtocolV2UsbTransportBase {
135
140
  { message: 'ok' },
136
141
  { router: PROTOCOL_V2_CHANNEL_USB, seq }
137
142
  );
138
- const splitAt = Math.min(4, response.length);
139
- this.packetQueues.set(key, [response.slice(0, splitAt), response.slice(splitAt)]);
143
+ if (this.coalesceNextResponses) {
144
+ this.coalesceNextResponses = false;
145
+ const nextResponse = ProtocolV2.encodeFrame(
146
+ schemas,
147
+ 'Success',
148
+ { message: 'ok' },
149
+ { router: PROTOCOL_V2_CHANNEL_USB, seq: Number(seq) + 1 }
150
+ );
151
+ const packet = new Uint8Array(response.length + nextResponse.length);
152
+ packet.set(response);
153
+ packet.set(nextResponse, response.length);
154
+ this.packetQueues.set(key, [packet]);
155
+ } else {
156
+ const splitAt = Math.min(4, response.length);
157
+ this.packetQueues.set(key, [response.slice(0, splitAt), response.slice(splitAt)]);
158
+ }
140
159
 
141
160
  const block = this.writeBlock;
142
161
  if (block) {
@@ -215,6 +234,21 @@ describe('ProtocolV2UsbTransportBase', () => {
215
234
  ]);
216
235
  });
217
236
 
237
+ test('keeps a coalesced response buffered for the next call', async () => {
238
+ const transport = new FakeUsbTransport();
239
+ await transport.rotate('device-a');
240
+ transport.coalesceNextTwoResponses();
241
+
242
+ await transport.callDevice('device-a', 'first');
243
+ await transport.callDevice('device-a', 'second');
244
+
245
+ expect(transport.readCounts.get('device-a')).toBe(1);
246
+ expect(transport.sentSeqs).toEqual([
247
+ ['device-a', 1],
248
+ ['device-a', 2],
249
+ ]);
250
+ });
251
+
218
252
  test('does not block a different USB path', async () => {
219
253
  const transport = new FakeUsbTransport();
220
254
  await transport.rotate('device-a');
package/dist/index.d.ts CHANGED
@@ -131,7 +131,7 @@ declare function isAckFrame(data: Uint8Array): boolean;
131
131
  */
132
132
  declare function decodeFrame(data: Uint8Array): ProtoV2Frame;
133
133
 
134
- type ProtocolV2LinkErrorCode = 'response-timeout' | 'router' | 'packet-source' | 'ack-sequence' | 'response-sequence' | 'frame';
134
+ type ProtocolV2LinkErrorCode = 'response-timeout' | 'io' | 'generation' | 'router' | 'packet-source' | 'ack-sequence' | 'response-sequence' | 'frame';
135
135
  declare class ProtocolV2LinkError extends Error {
136
136
  readonly code: ProtocolV2LinkErrorCode;
137
137
  readonly cause?: unknown;
@@ -255,6 +255,14 @@ declare const ProtocolV2: {
255
255
  };
256
256
  };
257
257
 
258
+ declare const TRANSPORT_EVENT: {
259
+ readonly DEVICE_DISCONNECT: "transport-device-disconnect";
260
+ };
261
+ type TransportDeviceDisconnectEvent = {
262
+ id: string;
263
+ connectId: string;
264
+ name: string | null;
265
+ };
258
266
  type ProtocolType = 'V1' | 'V2';
259
267
  type OneKeyDeviceCommType = 'usb' | 'webusb' | 'ble' | 'webble' | 'electron-ble' | 'bridge' | 'emulator';
260
268
  type OneKeyUsbDeviceInfo = {
@@ -3833,6 +3841,20 @@ declare enum MoneroNetworkType {
3833
3841
  STAGENET = 2,
3834
3842
  FAKECHAIN = 3
3835
3843
  }
3844
+ declare enum UiAnimationType {
3845
+ Unknown = 0,
3846
+ Signing = 1
3847
+ }
3848
+ declare enum UiAnimationCommand {
3849
+ CommandUnknown = 0,
3850
+ Start = 1,
3851
+ Stop = 2,
3852
+ Refresh = 3
3853
+ }
3854
+ type UiAnimationRequest = {
3855
+ command: UiAnimationCommand;
3856
+ type?: UiAnimationType;
3857
+ };
3836
3858
  type ViewAmount = {
3837
3859
  is_unlimited: boolean;
3838
3860
  num: string;
@@ -4139,7 +4161,9 @@ declare enum DeviceSessionPinType {
4139
4161
  type DeviceSessionAskPin = {
4140
4162
  type?: DeviceSessionPinType;
4141
4163
  };
4142
- type DeviceSessionAskPassphrase = {};
4164
+ type DeviceSessionAskPassphrase = {
4165
+ passphrase?: string;
4166
+ };
4143
4167
  declare enum DeviceSessionAskPin_FailureSubCodes {
4144
4168
  UserCancel = 1
4145
4169
  }
@@ -4876,6 +4900,7 @@ type MessageType = {
4876
4900
  Wallpaper: Wallpaper;
4877
4901
  UnlockPath: UnlockPath;
4878
4902
  UnlockedPathRequest: UnlockedPathRequest;
4903
+ UiAnimationRequest: UiAnimationRequest;
4879
4904
  ViewAmount: ViewAmount;
4880
4905
  ViewDetail: ViewDetail;
4881
4906
  ViewTip: ViewTip;
@@ -5683,6 +5708,11 @@ type messages_UnlockPath = UnlockPath;
5683
5708
  type messages_UnlockedPathRequest = UnlockedPathRequest;
5684
5709
  type messages_MoneroNetworkType = MoneroNetworkType;
5685
5710
  declare const messages_MoneroNetworkType: typeof MoneroNetworkType;
5711
+ type messages_UiAnimationType = UiAnimationType;
5712
+ declare const messages_UiAnimationType: typeof UiAnimationType;
5713
+ type messages_UiAnimationCommand = UiAnimationCommand;
5714
+ declare const messages_UiAnimationCommand: typeof UiAnimationCommand;
5715
+ type messages_UiAnimationRequest = UiAnimationRequest;
5686
5716
  type messages_ViewAmount = ViewAmount;
5687
5717
  type messages_ViewDetail = ViewDetail;
5688
5718
  type messages_ViewTipType = ViewTipType;
@@ -6460,6 +6490,9 @@ declare namespace messages {
6460
6490
  messages_UnlockPath as UnlockPath,
6461
6491
  messages_UnlockedPathRequest as UnlockedPathRequest,
6462
6492
  messages_MoneroNetworkType as MoneroNetworkType,
6493
+ messages_UiAnimationType as UiAnimationType,
6494
+ messages_UiAnimationCommand as UiAnimationCommand,
6495
+ messages_UiAnimationRequest as UiAnimationRequest,
6463
6496
  messages_ViewAmount as ViewAmount,
6464
6497
  messages_ViewDetail as ViewDetail,
6465
6498
  messages_ViewTipType as ViewTipType,
@@ -6635,6 +6668,8 @@ declare class ProtocolV2LinkManager<Key> {
6635
6668
  private readonly links;
6636
6669
  private readonly sequences;
6637
6670
  private readonly callQueues;
6671
+ private readonly generations;
6672
+ private readonly invalidationReasons;
6638
6673
  private readonly options;
6639
6674
  constructor(options: ProtocolV2LinkManagerOptions<Key>);
6640
6675
  call(key: Key, createAdapter: () => ProtocolV2LinkAdapter, name: string, data: Record<string, unknown>, options?: TransportCallOptions): Promise<MessageFromOneKey>;
@@ -6644,6 +6679,7 @@ declare class ProtocolV2LinkManager<Key> {
6644
6679
  private getOrCreateLink;
6645
6680
  private executeCall;
6646
6681
  private clearSettledCallQueue;
6682
+ private assertCallGeneration;
6647
6683
  }
6648
6684
 
6649
6685
  type ProtocolV2UsbTransportBaseOptions = {
@@ -6673,6 +6709,7 @@ declare abstract class ProtocolV2UsbTransportBase<Key> {
6673
6709
  private createProtocolV2UsbAdapter;
6674
6710
  private getProtocolV2UsbAssembler;
6675
6711
  private createProtocolV2UsbCancellation;
6712
+ private createProtocolV2UsbIoError;
6676
6713
  }
6677
6714
 
6678
6715
  declare function info(res: any): {
@@ -6821,4 +6858,4 @@ declare const _default: {
6821
6858
  withProtocolTimeout: typeof withProtocolTimeout;
6822
6859
  };
6823
6860
 
6824
- 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, 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, 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, isProtocolV2LinkError, probeProtocolV2, index as protocolV1, protocolV2Codec as protocolV2, withProtocolTimeout };
6861
+ 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, 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 };
@@ -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,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAKlD,YAAY,EACV,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,cAAc,EACd,oB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AAE,MAAM,SAAS,CAAC;AACpD,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
@@ -1055,12 +1055,18 @@ class ProtocolV2LinkManager {
1055
1055
  this.links = new Map();
1056
1056
  this.sequences = new Map();
1057
1057
  this.callQueues = new Map();
1058
+ this.generations = new Map();
1059
+ this.invalidationReasons = new Map();
1058
1060
  this.options = options;
1059
1061
  }
1060
1062
  call(key, createAdapter, name, data, options) {
1061
- var _a;
1062
- const run = () => this.executeCall(key, createAdapter, name, data, options);
1063
- const previous = (_a = this.callQueues.get(key)) !== null && _a !== void 0 ? _a : Promise.resolve();
1063
+ var _a, _b;
1064
+ const generation = (_a = this.generations.get(key)) !== null && _a !== void 0 ? _a : 0;
1065
+ const run = () => {
1066
+ this.assertCallGeneration(key, generation);
1067
+ return this.executeCall(key, createAdapter, name, data, options);
1068
+ };
1069
+ const previous = (_b = this.callQueues.get(key)) !== null && _b !== void 0 ? _b : Promise.resolve();
1064
1070
  const result = previous.then(run, run);
1065
1071
  const queue = result.catch(() => undefined);
1066
1072
  this.callQueues.set(key, queue);
@@ -1070,20 +1076,24 @@ class ProtocolV2LinkManager {
1070
1076
  return result;
1071
1077
  }
1072
1078
  invalidateLink(key, reason) {
1073
- var _a, _b;
1079
+ var _a, _b, _c;
1074
1080
  return __awaiter(this, void 0, void 0, function* () {
1081
+ const generation = ((_a = this.generations.get(key)) !== null && _a !== void 0 ? _a : 0) + 1;
1082
+ this.generations.set(key, generation);
1083
+ this.invalidationReasons.set(key, { generation, reason });
1075
1084
  const link = this.links.get(key);
1076
1085
  if (!link)
1077
1086
  return;
1078
1087
  this.links.delete(key);
1079
1088
  link.state.invalidatedReason = reason;
1080
1089
  yield link.adapter.reset(reason);
1081
- yield ((_b = (_a = this.options).onLinkInvalidated) === null || _b === void 0 ? void 0 : _b.call(_a, key, reason));
1090
+ yield ((_c = (_b = this.options).onLinkInvalidated) === null || _c === void 0 ? void 0 : _c.call(_b, key, reason));
1082
1091
  });
1083
1092
  }
1084
1093
  invalidateAllLinks(reason) {
1085
1094
  return __awaiter(this, void 0, void 0, function* () {
1086
- yield Promise.all(Array.from(this.links.keys(), key => this.invalidateLink(key, reason)));
1095
+ const keys = new Set([...this.links.keys(), ...this.callQueues.keys()]);
1096
+ yield Promise.all(Array.from(keys, key => this.invalidateLink(key, reason)));
1087
1097
  });
1088
1098
  }
1089
1099
  dispose(reason) {
@@ -1158,6 +1168,17 @@ class ProtocolV2LinkManager {
1158
1168
  this.callQueues.delete(key);
1159
1169
  }
1160
1170
  }
1171
+ assertCallGeneration(key, generation) {
1172
+ var _a;
1173
+ const currentGeneration = (_a = this.generations.get(key)) !== null && _a !== void 0 ? _a : 0;
1174
+ if (currentGeneration === generation)
1175
+ return;
1176
+ const invalidation = this.invalidationReasons.get(key);
1177
+ const reason = (invalidation === null || invalidation === void 0 ? void 0 : invalidation.generation) === currentGeneration
1178
+ ? invalidation.reason
1179
+ : 'Protocol V2 link generation changed';
1180
+ throw new ProtocolV2LinkError('generation', reason);
1181
+ }
1161
1182
  }
1162
1183
 
1163
1184
  class ProtocolV2UsbTransportBase {
@@ -1168,7 +1189,7 @@ class ProtocolV2UsbTransportBase {
1168
1189
  this.protocolV2UsbOptions = options;
1169
1190
  this.protocolV2UsbLinks = new ProtocolV2LinkManager({
1170
1191
  getSchemas: () => this.getProtocolV2UsbSchemas(),
1171
- classifyError: () => 'link-fatal',
1192
+ classifyError: error => (isProtocolV2LinkError(error) ? 'link-fatal' : 'recoverable'),
1172
1193
  onLinkInvalidated: (key, reason) => __awaiter(this, void 0, void 0, function* () {
1173
1194
  var _a;
1174
1195
  (_a = this.protocolV2UsbAssemblers.get(key)) === null || _a === void 0 ? void 0 : _a.reset();
@@ -1218,10 +1239,10 @@ class ProtocolV2UsbTransportBase {
1218
1239
  }
1219
1240
  const assertCurrentGeneration = () => {
1220
1241
  if (cancellation.reason) {
1221
- throw new Error(cancellation.reason);
1242
+ throw new ProtocolV2LinkError('generation', cancellation.reason);
1222
1243
  }
1223
1244
  if (this.protocolV2UsbGenerations.get(key) !== generation) {
1224
- throw new Error('Protocol V2 USB connection generation changed');
1245
+ throw new ProtocolV2LinkError('generation', 'Protocol V2 USB connection generation changed');
1225
1246
  }
1226
1247
  };
1227
1248
  return {
@@ -1230,11 +1251,15 @@ class ProtocolV2UsbTransportBase {
1230
1251
  generation,
1231
1252
  prepareCall: () => {
1232
1253
  assertCurrentGeneration();
1233
- this.getProtocolV2UsbAssembler(key).reset();
1234
1254
  },
1235
1255
  writeFrame: (frame, context) => __awaiter(this, void 0, void 0, function* () {
1236
1256
  assertCurrentGeneration();
1237
- yield this.writeProtocolV2UsbPacket(key, frame, context);
1257
+ try {
1258
+ yield this.writeProtocolV2UsbPacket(key, frame, context);
1259
+ }
1260
+ catch (error) {
1261
+ throw this.createProtocolV2UsbIoError('write', error);
1262
+ }
1238
1263
  assertCurrentGeneration();
1239
1264
  }),
1240
1265
  readFrame: (context) => __awaiter(this, void 0, void 0, function* () {
@@ -1242,13 +1267,15 @@ class ProtocolV2UsbTransportBase {
1242
1267
  const assembler = this.getProtocolV2UsbAssembler(key);
1243
1268
  let frame = assembler.push(new Uint8Array(0));
1244
1269
  while (!frame) {
1245
- const packetRead = this.readProtocolV2UsbPacket(key, context).then(packet => ({
1246
- packet,
1247
- }));
1270
+ const packetRead = this.readProtocolV2UsbPacket(key, context)
1271
+ .then(packet => ({ packet }))
1272
+ .catch(error => {
1273
+ throw this.createProtocolV2UsbIoError('read', error);
1274
+ });
1248
1275
  const cancelled = cancellation.promise.then(reason => ({ reason }));
1249
1276
  const result = yield Promise.race([packetRead, cancelled]);
1250
1277
  if ('reason' in result) {
1251
- throw new Error(result.reason);
1278
+ throw new ProtocolV2LinkError('generation', result.reason);
1252
1279
  }
1253
1280
  assertCurrentGeneration();
1254
1281
  frame = assembler.push(result.packet);
@@ -1289,8 +1316,17 @@ class ProtocolV2UsbTransportBase {
1289
1316
  };
1290
1317
  return cancellation;
1291
1318
  }
1319
+ createProtocolV2UsbIoError(operation, error) {
1320
+ if (isProtocolV2LinkError(error))
1321
+ return error;
1322
+ return new ProtocolV2LinkError('io', `Protocol V2 USB ${operation} failed: ${getErrorMessage(error) || 'unknown error'}`, error);
1323
+ }
1292
1324
  }
1293
1325
 
1326
+ const TRANSPORT_EVENT = {
1327
+ DEVICE_DISCONNECT: 'transport-device-disconnect',
1328
+ };
1329
+
1294
1330
  exports.AptosTransactionType = void 0;
1295
1331
  (function (AptosTransactionType) {
1296
1332
  AptosTransactionType[AptosTransactionType["STANDARD"] = 0] = "STANDARD";
@@ -1760,6 +1796,18 @@ exports.MoneroNetworkType = void 0;
1760
1796
  MoneroNetworkType[MoneroNetworkType["STAGENET"] = 2] = "STAGENET";
1761
1797
  MoneroNetworkType[MoneroNetworkType["FAKECHAIN"] = 3] = "FAKECHAIN";
1762
1798
  })(exports.MoneroNetworkType || (exports.MoneroNetworkType = {}));
1799
+ exports.UiAnimationType = void 0;
1800
+ (function (UiAnimationType) {
1801
+ UiAnimationType[UiAnimationType["Unknown"] = 0] = "Unknown";
1802
+ UiAnimationType[UiAnimationType["Signing"] = 1] = "Signing";
1803
+ })(exports.UiAnimationType || (exports.UiAnimationType = {}));
1804
+ exports.UiAnimationCommand = void 0;
1805
+ (function (UiAnimationCommand) {
1806
+ UiAnimationCommand[UiAnimationCommand["CommandUnknown"] = 0] = "CommandUnknown";
1807
+ UiAnimationCommand[UiAnimationCommand["Start"] = 1] = "Start";
1808
+ UiAnimationCommand[UiAnimationCommand["Stop"] = 2] = "Stop";
1809
+ UiAnimationCommand[UiAnimationCommand["Refresh"] = 3] = "Refresh";
1810
+ })(exports.UiAnimationCommand || (exports.UiAnimationCommand = {}));
1763
1811
  exports.ViewTipType = void 0;
1764
1812
  (function (ViewTipType) {
1765
1813
  ViewTipType[ViewTipType["Default"] = 0] = "Default";
@@ -2014,6 +2062,8 @@ var messages = /*#__PURE__*/Object.freeze({
2014
2062
  get CommandFlags () { return exports.CommandFlags; },
2015
2063
  get WallpaperTarget () { return exports.WallpaperTarget; },
2016
2064
  get MoneroNetworkType () { return exports.MoneroNetworkType; },
2065
+ get UiAnimationType () { return exports.UiAnimationType; },
2066
+ get UiAnimationCommand () { return exports.UiAnimationCommand; },
2017
2067
  get ViewTipType () { return exports.ViewTipType; },
2018
2068
  get ViewSignLayout () { return exports.ViewSignLayout; },
2019
2069
  get DeviceErrorCode () { return exports.DeviceErrorCode; },
@@ -2090,6 +2140,7 @@ exports.ProtocolV2LinkManager = ProtocolV2LinkManager;
2090
2140
  exports.ProtocolV2SequenceCursor = ProtocolV2SequenceCursor;
2091
2141
  exports.ProtocolV2Session = ProtocolV2Session;
2092
2142
  exports.ProtocolV2UsbTransportBase = ProtocolV2UsbTransportBase;
2143
+ exports.TRANSPORT_EVENT = TRANSPORT_EVENT;
2093
2144
  exports.bytesToHex = bytesToHex;
2094
2145
  exports.concatUint8Arrays = concatUint8Arrays;
2095
2146
  exports["default"] = index;
@@ -1,4 +1,4 @@
1
- export type ProtocolV2LinkErrorCode = 'response-timeout' | 'router' | 'packet-source' | 'ack-sequence' | 'response-sequence' | 'frame';
1
+ export type ProtocolV2LinkErrorCode = 'response-timeout' | 'io' | 'generation' | 'router' | 'packet-source' | 'ack-sequence' | 'response-sequence' | 'frame';
2
2
  export declare class ProtocolV2LinkError extends Error {
3
3
  readonly code: ProtocolV2LinkErrorCode;
4
4
  readonly cause?: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAC/B,kBAAkB,GAClB,QAAQ,GACR,eAAe,GACf,cAAc,GACd,mBAAmB,GACnB,OAAO,CAAC;AAEZ,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IAEvC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEb,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAM5E;AAED,eAAO,MAAM,qBAAqB,UAAW,OAAO,iCACd,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAC/B,kBAAkB,GAClB,IAAI,GACJ,YAAY,GACZ,QAAQ,GACR,eAAe,GACf,cAAc,GACd,mBAAmB,GACnB,OAAO,CAAC;AAEZ,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IAEvC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEb,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAM5E;AAED,eAAO,MAAM,qBAAqB,UAAW,OAAO,iCACd,CAAC"}
@@ -22,6 +22,8 @@ export declare class ProtocolV2LinkManager<Key> {
22
22
  private readonly links;
23
23
  private readonly sequences;
24
24
  private readonly callQueues;
25
+ private readonly generations;
26
+ private readonly invalidationReasons;
25
27
  private readonly options;
26
28
  constructor(options: ProtocolV2LinkManagerOptions<Key>);
27
29
  call(key: Key, createAdapter: () => ProtocolV2LinkAdapter, name: string, data: Record<string, unknown>, options?: TransportCallOptions): Promise<MessageFromOneKey>;
@@ -31,5 +33,6 @@ export declare class ProtocolV2LinkManager<Key> {
31
33
  private getOrCreateLink;
32
34
  private executeCall;
33
35
  private clearSettledCallQueue;
36
+ private assertCallGeneration;
34
37
  }
35
38
  //# sourceMappingURL=link-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"link-manager.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/link-manager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAEpG,MAAM,MAAM,iCAAiC,GAAG,YAAY,GAAG,aAAa,CAAC;AAE7E,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAClE,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E,SAAS,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/D,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC5C,MAAM,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,wBAAwB,CAAC,oBAAoB,CAAC,CAAC;CACrE;AAED,MAAM,MAAM,4BAA4B,CAAC,GAAG,IAAI;IAC9C,UAAU,EAAE,MAAM,iBAAiB,CAAC;IACpC,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KA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,EAAE,4BAA4B,CAAC,GAAG,CAAC;IAItD,IAAI,CACF,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,MAAM,qBAAqB,EAC1C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,iBAAiB,CAAC;IAmBvB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcvD,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKjD,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5C,OAAO,CAAC,eAAe;YA+CT,WAAW;IAkBzB,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,oBAAoB;CAW7B"}
@@ -27,5 +27,6 @@ export declare abstract class ProtocolV2UsbTransportBase<Key> {
27
27
  private createProtocolV2UsbAdapter;
28
28
  private getProtocolV2UsbAssembler;
29
29
  private createProtocolV2UsbCancellation;
30
+ private createProtocolV2UsbIoError;
30
31
  }
31
32
  //# sourceMappingURL=usb-transport-base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usb-transport-base.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/usb-transport-base.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAEpG,MAAM,MAAM,iCAAiC,GAAG;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AASF,8BAAsB,0BAA0B,CAAC,GAAG;IAClD,OAAO,CAAC,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vC,OAAO,CAAC,0BAA0B;CAQnC"}
@@ -3501,6 +3501,20 @@ export declare enum MoneroNetworkType {
3501
3501
  STAGENET = 2,
3502
3502
  FAKECHAIN = 3
3503
3503
  }
3504
+ export declare enum UiAnimationType {
3505
+ Unknown = 0,
3506
+ Signing = 1
3507
+ }
3508
+ export declare enum UiAnimationCommand {
3509
+ CommandUnknown = 0,
3510
+ Start = 1,
3511
+ Stop = 2,
3512
+ Refresh = 3
3513
+ }
3514
+ export type UiAnimationRequest = {
3515
+ command: UiAnimationCommand;
3516
+ type?: UiAnimationType;
3517
+ };
3504
3518
  export type ViewAmount = {
3505
3519
  is_unlimited: boolean;
3506
3520
  num: string;
@@ -3807,7 +3821,9 @@ export declare enum DeviceSessionPinType {
3807
3821
  export type DeviceSessionAskPin = {
3808
3822
  type?: DeviceSessionPinType;
3809
3823
  };
3810
- export type DeviceSessionAskPassphrase = {};
3824
+ export type DeviceSessionAskPassphrase = {
3825
+ passphrase?: string;
3826
+ };
3811
3827
  export declare enum DeviceSessionAskPin_FailureSubCodes {
3812
3828
  UserCancel = 1
3813
3829
  }
@@ -4544,6 +4560,7 @@ export type MessageType = {
4544
4560
  Wallpaper: Wallpaper;
4545
4561
  UnlockPath: UnlockPath;
4546
4562
  UnlockedPathRequest: UnlockedPathRequest;
4563
+ UiAnimationRequest: UiAnimationRequest;
4547
4564
  ViewAmount: ViewAmount;
4548
4565
  ViewDetail: ViewDetail;
4549
4566
  ViewTip: ViewTip;