@onekeyfe/hd-transport 1.2.0-alpha.20 → 1.2.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/protocol-v2-link-manager.test.js +0 -25
- package/__tests__/protocol-v2.test.js +41 -53
- package/dist/index.d.ts +2 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -55
- package/dist/protocols/index.d.ts +1 -2
- package/dist/protocols/index.d.ts.map +1 -1
- package/dist/protocols/v2/decode.d.ts +0 -1
- package/dist/protocols/v2/decode.d.ts.map +1 -1
- package/dist/protocols/v2/link-manager.d.ts +0 -1
- package/dist/protocols/v2/link-manager.d.ts.map +1 -1
- package/dist/protocols/v2/session.d.ts +0 -4
- package/dist/protocols/v2/session.d.ts.map +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/messages.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/protocols/index.ts +13 -8
- package/src/protocols/v2/decode.ts +0 -7
- package/src/protocols/v2/link-manager.ts +0 -2
- package/src/protocols/v2/session.ts +4 -59
- package/src/types/messages.ts +1 -1
|
@@ -158,31 +158,6 @@ describe('ProtocolV2LinkManager', () => {
|
|
|
158
158
|
expect(sentSeqs).toEqual([1, 2]);
|
|
159
159
|
});
|
|
160
160
|
|
|
161
|
-
test('times out a stalled write and resets the link before releasing the call queue', async () => {
|
|
162
|
-
const adapter = {
|
|
163
|
-
router: 1,
|
|
164
|
-
generation: 1,
|
|
165
|
-
prepareCall: jest.fn(),
|
|
166
|
-
writeFrame: jest.fn(() => new Promise(() => {})),
|
|
167
|
-
readFrame: jest.fn(),
|
|
168
|
-
reset: jest.fn(() => Promise.resolve()),
|
|
169
|
-
writeTimeoutMs: 10,
|
|
170
|
-
};
|
|
171
|
-
const manager = new ProtocolV2LinkManager({
|
|
172
|
-
getSchemas: () => schemas,
|
|
173
|
-
classifyError: error =>
|
|
174
|
-
String(error).includes('write timeout') ? 'link-fatal' : 'recoverable',
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
await expect(
|
|
178
|
-
manager.call('device-a', () => adapter, 'Ping', { message: 'pending' })
|
|
179
|
-
).rejects.toThrow('Protocol V2 write timeout after 10ms for Ping');
|
|
180
|
-
|
|
181
|
-
expect(adapter.reset).toHaveBeenCalledWith(expect.stringContaining('write timeout'));
|
|
182
|
-
expect(adapter.readFrame).not.toHaveBeenCalled();
|
|
183
|
-
expect(manager.callQueues.size).toBe(0);
|
|
184
|
-
});
|
|
185
|
-
|
|
186
161
|
test('invalidates every active link while retaining per-device cursors', async () => {
|
|
187
162
|
const sentSeqs = [];
|
|
188
163
|
const { adapters, createAdapter } = createAdapterFactory(sentSeqs);
|
|
@@ -162,6 +162,18 @@ const protocolV2Messages = parseConfigure({
|
|
|
162
162
|
},
|
|
163
163
|
},
|
|
164
164
|
},
|
|
165
|
+
DeviceSession: {
|
|
166
|
+
fields: {
|
|
167
|
+
session_id: {
|
|
168
|
+
type: 'bytes',
|
|
169
|
+
id: 1,
|
|
170
|
+
},
|
|
171
|
+
btc_test_address: {
|
|
172
|
+
type: 'string',
|
|
173
|
+
id: 2,
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
165
177
|
FileWrite: {
|
|
166
178
|
fields: {},
|
|
167
179
|
},
|
|
@@ -195,6 +207,7 @@ const protocolV2Messages = parseConfigure({
|
|
|
195
207
|
MessageType_FileWrite: 60805,
|
|
196
208
|
MessageType_DeviceFirmwareUpdateRequest: 61000,
|
|
197
209
|
MessageType_DeviceFirmwareUpdateStatus: 61002,
|
|
210
|
+
MessageType_DeviceSession: 60607,
|
|
198
211
|
MessageType_PartialNested: 62000,
|
|
199
212
|
},
|
|
200
213
|
},
|
|
@@ -259,6 +272,34 @@ describe('Protocol V2 framing and session', () => {
|
|
|
259
272
|
expect(decoded.message).toEqual({ message: 'ok' });
|
|
260
273
|
});
|
|
261
274
|
|
|
275
|
+
test('round-trips a DeviceSession response with a 32-byte session id', () => {
|
|
276
|
+
const sessionId = '01'.repeat(32);
|
|
277
|
+
const frame = ProtocolV2.encodeFrame(schemas, 'DeviceSession', {
|
|
278
|
+
session_id: sessionId,
|
|
279
|
+
btc_test_address: 'tb1qwallet',
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
const decoded = ProtocolV2.decodeFrame(schemas, frame);
|
|
283
|
+
|
|
284
|
+
expect(decoded.type).toBe('DeviceSession');
|
|
285
|
+
expect(decoded.message).toEqual({
|
|
286
|
+
session_id: sessionId,
|
|
287
|
+
btc_test_address: 'tb1qwallet',
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
test('reports malformed DeviceSession protobuf as a schema-compatible transport error', () => {
|
|
292
|
+
const malformedPayload = new Uint8Array(32);
|
|
293
|
+
malformedPayload[0] = 0x0a;
|
|
294
|
+
malformedPayload[1] = 101;
|
|
295
|
+
const frame = protocolV2.encodeProtobufFrame(60607, malformedPayload);
|
|
296
|
+
|
|
297
|
+
expect(() => ProtocolV2.decodeFrame(schemas, frame)).toThrow(
|
|
298
|
+
'Protocol V2 protobuf decode failed for "DeviceSession" (60607, 32-byte payload); ' +
|
|
299
|
+
'the payload is malformed or incompatible with the active SDK schema.'
|
|
300
|
+
);
|
|
301
|
+
});
|
|
302
|
+
|
|
262
303
|
test('decodes missing optional nested messages as null', () => {
|
|
263
304
|
const frame = ProtocolV2.encodeFrame(schemas, 'PartialNested', {
|
|
264
305
|
label: 'only label',
|
|
@@ -427,59 +468,6 @@ describe('Protocol V2 framing and session', () => {
|
|
|
427
468
|
expect(readFrame).toHaveBeenCalledTimes(2);
|
|
428
469
|
});
|
|
429
470
|
|
|
430
|
-
test('session ignores an ACK whose sequence does not match the request', async () => {
|
|
431
|
-
const mismatchedAck = new Uint8Array(8);
|
|
432
|
-
mismatchedAck[0] = 0x5a;
|
|
433
|
-
mismatchedAck[1] = 8;
|
|
434
|
-
mismatchedAck[4] = 1;
|
|
435
|
-
mismatchedAck[5] = 1;
|
|
436
|
-
mismatchedAck[6] = 2;
|
|
437
|
-
mismatchedAck[3] = protocolV2.crc8(mismatchedAck, 3);
|
|
438
|
-
mismatchedAck[7] = protocolV2.crc8(mismatchedAck, 7);
|
|
439
|
-
const readFrame = jest
|
|
440
|
-
.fn()
|
|
441
|
-
.mockResolvedValueOnce(mismatchedAck)
|
|
442
|
-
.mockImplementation(() => new Promise(() => {}));
|
|
443
|
-
const session = new ProtocolV2Session({
|
|
444
|
-
schemas,
|
|
445
|
-
router: 1,
|
|
446
|
-
deliveryTimeoutMs: 10,
|
|
447
|
-
writeFrame: () => Promise.resolve(),
|
|
448
|
-
readFrame,
|
|
449
|
-
});
|
|
450
|
-
|
|
451
|
-
await expect(session.call('Ping', { message: 'hello' })).rejects.toThrow(
|
|
452
|
-
'Protocol V2 delivery timeout after 10ms for Ping'
|
|
453
|
-
);
|
|
454
|
-
expect(readFrame).toHaveBeenCalledTimes(2);
|
|
455
|
-
});
|
|
456
|
-
|
|
457
|
-
test('session keeps waiting for a response after a matching delivery ACK', async () => {
|
|
458
|
-
const ack = new Uint8Array(8);
|
|
459
|
-
ack[0] = 0x5a;
|
|
460
|
-
ack[1] = 8;
|
|
461
|
-
ack[4] = 1;
|
|
462
|
-
ack[5] = 1;
|
|
463
|
-
ack[6] = 1;
|
|
464
|
-
ack[3] = protocolV2.crc8(ack, 3);
|
|
465
|
-
ack[7] = protocolV2.crc8(ack, 7);
|
|
466
|
-
const readFrame = jest
|
|
467
|
-
.fn()
|
|
468
|
-
.mockResolvedValueOnce(ack)
|
|
469
|
-
.mockImplementation(() => new Promise(() => {}));
|
|
470
|
-
const session = new ProtocolV2Session({
|
|
471
|
-
schemas,
|
|
472
|
-
router: 1,
|
|
473
|
-
deliveryTimeoutMs: 10,
|
|
474
|
-
writeFrame: () => Promise.resolve(),
|
|
475
|
-
readFrame,
|
|
476
|
-
});
|
|
477
|
-
|
|
478
|
-
await expect(session.call('Ping', { message: 'hello' }, { timeoutMs: 25 })).rejects.toThrow(
|
|
479
|
-
'Protocol V2 response timeout after 25ms for Ping'
|
|
480
|
-
);
|
|
481
|
-
});
|
|
482
|
-
|
|
483
471
|
test('session rejects BLE frames above its configured frame limit before writing', async () => {
|
|
484
472
|
const writeFrame = jest.fn().mockResolvedValue(undefined);
|
|
485
473
|
const response = ProtocolV2.encodeFrame(schemas, 'Success', {
|
package/dist/index.d.ts
CHANGED
|
@@ -105,7 +105,6 @@ interface ProtoV2Frame {
|
|
|
105
105
|
seq: number;
|
|
106
106
|
}
|
|
107
107
|
declare function isAckFrame(data: Uint8Array): boolean;
|
|
108
|
-
declare function getAckSequence(data: Uint8Array): number | undefined;
|
|
109
108
|
/**
|
|
110
109
|
* Parse and validate a Protocol V2 response frame.
|
|
111
110
|
*
|
|
@@ -149,7 +148,6 @@ declare const protocolV2Codec_encodeFrame: typeof encodeFrame;
|
|
|
149
148
|
declare const protocolV2Codec_encodeProtobufFrame: typeof encodeProtobufFrame;
|
|
150
149
|
type protocolV2Codec_ProtoV2Frame = ProtoV2Frame;
|
|
151
150
|
declare const protocolV2Codec_isAckFrame: typeof isAckFrame;
|
|
152
|
-
declare const protocolV2Codec_getAckSequence: typeof getAckSequence;
|
|
153
151
|
declare const protocolV2Codec_decodeFrame: typeof decodeFrame;
|
|
154
152
|
declare const protocolV2Codec_concatUint8Arrays: typeof concatUint8Arrays;
|
|
155
153
|
type protocolV2Codec_ProtocolV2FrameAssembler = ProtocolV2FrameAssembler;
|
|
@@ -170,7 +168,6 @@ declare namespace protocolV2Codec {
|
|
|
170
168
|
protocolV2Codec_encodeProtobufFrame as encodeProtobufFrame,
|
|
171
169
|
protocolV2Codec_ProtoV2Frame as ProtoV2Frame,
|
|
172
170
|
protocolV2Codec_isAckFrame as isAckFrame,
|
|
173
|
-
protocolV2Codec_getAckSequence as getAckSequence,
|
|
174
171
|
protocolV2Codec_decodeFrame as decodeFrame,
|
|
175
172
|
protocolV2Codec_concatUint8Arrays as concatUint8Arrays,
|
|
176
173
|
protocolV2Codec_ProtocolV2FrameAssembler as ProtocolV2FrameAssembler,
|
|
@@ -201,7 +198,6 @@ declare const ProtocolV1: {
|
|
|
201
198
|
};
|
|
202
199
|
declare const ProtocolV2: {
|
|
203
200
|
isAckFrame: typeof isAckFrame;
|
|
204
|
-
getAckSequence: typeof getAckSequence;
|
|
205
201
|
inspectFrame(schemas: ProtocolV2Schemas$1, frame: Uint8Array): {
|
|
206
202
|
messageName: string;
|
|
207
203
|
messageTypeId: number;
|
|
@@ -2064,7 +2060,7 @@ declare enum Enum_SafetyCheckLevel {
|
|
|
2064
2060
|
PromptAlways = 1,
|
|
2065
2061
|
PromptTemporarily = 2
|
|
2066
2062
|
}
|
|
2067
|
-
type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel;
|
|
2063
|
+
type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel | Enum_SafetyCheckLevel;
|
|
2068
2064
|
type Initialize = {
|
|
2069
2065
|
session_id?: string;
|
|
2070
2066
|
_skip_passphrase?: boolean;
|
|
@@ -6522,8 +6518,6 @@ type ProtocolV2SessionOptions = {
|
|
|
6522
6518
|
createTimeoutError?: (name: string, timeoutMs: number) => Error;
|
|
6523
6519
|
sequenceCursor?: ProtocolV2SequenceCursor;
|
|
6524
6520
|
generation?: number;
|
|
6525
|
-
writeTimeoutMs?: number;
|
|
6526
|
-
deliveryTimeoutMs?: number;
|
|
6527
6521
|
};
|
|
6528
6522
|
type ProtocolV2CallOptions = {
|
|
6529
6523
|
timeoutMs?: number;
|
|
@@ -6536,8 +6530,6 @@ declare function hexToBytes(hex: string): Uint8Array;
|
|
|
6536
6530
|
declare function bytesToHex(bytes: Uint8Array): string;
|
|
6537
6531
|
declare function getErrorMessage(error: unknown): string;
|
|
6538
6532
|
declare function withProtocolTimeout<T>(promise: Promise<T>, timeoutMs: number | undefined, createTimeoutError: () => Error, onTimeout?: () => void): Promise<T>;
|
|
6539
|
-
declare const PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS = 30000;
|
|
6540
|
-
declare const PROTOCOL_V2_DELIVERY_WATCHDOG_TIMEOUT_MS = 5000;
|
|
6541
6533
|
declare class ProtocolV2Session {
|
|
6542
6534
|
private readonly options;
|
|
6543
6535
|
private readonly sequenceCursor;
|
|
@@ -6567,7 +6559,6 @@ interface ProtocolV2LinkAdapter {
|
|
|
6567
6559
|
logger?: ProtocolV2SessionOptions['logger'];
|
|
6568
6560
|
logPrefix?: string;
|
|
6569
6561
|
createTimeoutError?: ProtocolV2SessionOptions['createTimeoutError'];
|
|
6570
|
-
writeTimeoutMs?: number;
|
|
6571
6562
|
}
|
|
6572
6563
|
type ProtocolV2LinkManagerOptions<Key> = {
|
|
6573
6564
|
getSchemas: () => ProtocolV2Schemas;
|
|
@@ -6695,7 +6686,6 @@ declare const _default: {
|
|
|
6695
6686
|
};
|
|
6696
6687
|
ProtocolV2: {
|
|
6697
6688
|
isAckFrame: typeof isAckFrame;
|
|
6698
|
-
getAckSequence: typeof getAckSequence;
|
|
6699
6689
|
inspectFrame(schemas: {
|
|
6700
6690
|
protocolV1: protobuf.Root;
|
|
6701
6691
|
protocolV2: protobuf.Root;
|
|
@@ -6754,4 +6744,4 @@ declare const _default: {
|
|
|
6754
6744
|
withProtocolTimeout: typeof withProtocolTimeout;
|
|
6755
6745
|
};
|
|
6756
6746
|
|
|
6757
|
-
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, 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_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_DELIVERY_WATCHDOG_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, 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 };
|
|
6747
|
+
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, 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_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_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, 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 };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,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
|
|
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,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
|
@@ -485,12 +485,6 @@ function isAckFrame(data) {
|
|
|
485
485
|
}
|
|
486
486
|
return true;
|
|
487
487
|
}
|
|
488
|
-
function getAckSequence(data) {
|
|
489
|
-
if (!isAckFrame(data)) {
|
|
490
|
-
return undefined;
|
|
491
|
-
}
|
|
492
|
-
return data[6];
|
|
493
|
-
}
|
|
494
488
|
function decodeFrame(data) {
|
|
495
489
|
const frameLen = validateFrame(data);
|
|
496
490
|
const seq = data[6];
|
|
@@ -589,7 +583,6 @@ var protocolV2Codec = /*#__PURE__*/Object.freeze({
|
|
|
589
583
|
encodeFrame: encodeFrame,
|
|
590
584
|
encodeProtobufFrame: encodeProtobufFrame,
|
|
591
585
|
isAckFrame: isAckFrame,
|
|
592
|
-
getAckSequence: getAckSequence,
|
|
593
586
|
decodeFrame: decodeFrame,
|
|
594
587
|
concatUint8Arrays: concatUint8Arrays,
|
|
595
588
|
ProtocolV2FrameAssembler: ProtocolV2FrameAssembler
|
|
@@ -641,7 +634,6 @@ const ProtocolV1 = {
|
|
|
641
634
|
};
|
|
642
635
|
const ProtocolV2 = {
|
|
643
636
|
isAckFrame,
|
|
644
|
-
getAckSequence,
|
|
645
637
|
inspectFrame(schemas, frame) {
|
|
646
638
|
const { messageTypeId, pbPayload, seq } = decodeFrame(frame);
|
|
647
639
|
const { messageName } = createProtocolV2MessageFromType(messageTypeId, schemas);
|
|
@@ -666,7 +658,17 @@ const ProtocolV2 = {
|
|
|
666
658
|
const { messageTypeId, pbPayload, seq, messageName } = this.inspectFrame(schemas, frame);
|
|
667
659
|
const { Message } = createProtocolV2MessageFromType(messageTypeId, schemas);
|
|
668
660
|
const rxByteBuffer = ByteBuffer__default["default"].wrap(Buffer.from(pbPayload));
|
|
669
|
-
|
|
661
|
+
let message;
|
|
662
|
+
try {
|
|
663
|
+
message = decode(Message, rxByteBuffer);
|
|
664
|
+
}
|
|
665
|
+
catch (cause) {
|
|
666
|
+
const error = new Error(`Protocol V2 protobuf decode failed for "${messageName}" ` +
|
|
667
|
+
`(${messageTypeId}, ${pbPayload.length}-byte payload); ` +
|
|
668
|
+
'the payload is malformed or incompatible with the active SDK schema.');
|
|
669
|
+
error.cause = cause;
|
|
670
|
+
throw error;
|
|
671
|
+
}
|
|
670
672
|
return {
|
|
671
673
|
message,
|
|
672
674
|
messageName,
|
|
@@ -871,8 +873,6 @@ function withProtocolTimeout(promise, timeoutMs, createTimeoutError, onTimeout)
|
|
|
871
873
|
}
|
|
872
874
|
});
|
|
873
875
|
}
|
|
874
|
-
const PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS = 30000;
|
|
875
|
-
const PROTOCOL_V2_DELIVERY_WATCHDOG_TIMEOUT_MS = 5000;
|
|
876
876
|
class ProtocolV2Session {
|
|
877
877
|
constructor(options) {
|
|
878
878
|
var _a;
|
|
@@ -888,7 +888,7 @@ class ProtocolV2Session {
|
|
|
888
888
|
}
|
|
889
889
|
executeCall(name, data, callOptions) {
|
|
890
890
|
return __awaiter(this, void 0, void 0, function* () {
|
|
891
|
-
const { schemas, router, packetSrc = PROTOCOL_V2_PACKET_SRC_COMMAND, maxFrameBytes, prepareCall, writeFrame, readFrame, logger, logPrefix = 'ProtocolV2', createTimeoutError, generation = 0,
|
|
891
|
+
const { schemas, router, packetSrc = PROTOCOL_V2_PACKET_SRC_COMMAND, maxFrameBytes, prepareCall, writeFrame, readFrame, logger, logPrefix = 'ProtocolV2', createTimeoutError, generation = 0, } = this.options;
|
|
892
892
|
const shouldReduceDebug = shouldReduceProtocolV2Debug(name);
|
|
893
893
|
const callContext = {
|
|
894
894
|
messageName: name,
|
|
@@ -906,18 +906,8 @@ class ProtocolV2Session {
|
|
|
906
906
|
if (maxFrameBytes !== undefined && frame.length > maxFrameBytes) {
|
|
907
907
|
throw new Error(`Protocol V2 frame too large for transport: ${frame.length} > ${maxFrameBytes}`);
|
|
908
908
|
}
|
|
909
|
-
yield
|
|
909
|
+
yield writeFrame(frame, callContext);
|
|
910
910
|
const cancellation = { cancelled: false };
|
|
911
|
-
let resolveDelivery = () => undefined;
|
|
912
|
-
let deliveryConfirmed = false;
|
|
913
|
-
const deliveryPromise = new Promise(resolve => {
|
|
914
|
-
resolveDelivery = () => {
|
|
915
|
-
if (deliveryConfirmed)
|
|
916
|
-
return;
|
|
917
|
-
deliveryConfirmed = true;
|
|
918
|
-
resolve();
|
|
919
|
-
};
|
|
920
|
-
});
|
|
921
911
|
const readResponse = () => __awaiter(this, void 0, void 0, function* () {
|
|
922
912
|
var _a, _b, _c, _d;
|
|
923
913
|
while (!cancellation.cancelled) {
|
|
@@ -925,14 +915,8 @@ class ProtocolV2Session {
|
|
|
925
915
|
if (cancellation.cancelled) {
|
|
926
916
|
break;
|
|
927
917
|
}
|
|
928
|
-
const
|
|
929
|
-
if (
|
|
930
|
-
if (ackSequence === protoSeq) {
|
|
931
|
-
resolveDelivery();
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
else {
|
|
935
|
-
resolveDelivery();
|
|
918
|
+
const isAck = ProtocolV2.isAckFrame(rxFrame);
|
|
919
|
+
if (!isAck) {
|
|
936
920
|
const decoded = ProtocolV2.decodeFrame(schemas, rxFrame);
|
|
937
921
|
const response = call(decoded);
|
|
938
922
|
if ((_a = callOptions.intermediateTypes) === null || _a === void 0 ? void 0 : _a.includes(response.type)) {
|
|
@@ -948,7 +932,7 @@ class ProtocolV2Session {
|
|
|
948
932
|
}
|
|
949
933
|
throw new Error(`Protocol V2 read loop cancelled after timeout for ${name}`);
|
|
950
934
|
});
|
|
951
|
-
|
|
935
|
+
return withProtocolTimeout(readResponse(), callOptions.timeoutMs, () => {
|
|
952
936
|
var _a;
|
|
953
937
|
return createTimeoutError
|
|
954
938
|
? createTimeoutError(name, (_a = callOptions.timeoutMs) !== null && _a !== void 0 ? _a : 0)
|
|
@@ -956,26 +940,6 @@ class ProtocolV2Session {
|
|
|
956
940
|
}, () => {
|
|
957
941
|
cancellation.cancelled = true;
|
|
958
942
|
});
|
|
959
|
-
const deliverySignal = Promise.race([deliveryPromise, responsePromise.then(() => undefined)]);
|
|
960
|
-
const deliveryWatchdog = withProtocolTimeout(deliverySignal, deliveryTimeoutMs, () => new Error(`Protocol V2 delivery timeout after ${deliveryTimeoutMs}ms for ${name}`), () => {
|
|
961
|
-
cancellation.cancelled = true;
|
|
962
|
-
});
|
|
963
|
-
try {
|
|
964
|
-
const firstResult = yield Promise.race([
|
|
965
|
-
deliveryWatchdog.then(() => ({ kind: 'delivered' })),
|
|
966
|
-
responsePromise.then(response => ({ kind: 'response', response })),
|
|
967
|
-
]);
|
|
968
|
-
if (firstResult.kind === 'response') {
|
|
969
|
-
return firstResult.response;
|
|
970
|
-
}
|
|
971
|
-
return yield responsePromise;
|
|
972
|
-
}
|
|
973
|
-
catch (error) {
|
|
974
|
-
cancellation.cancelled = true;
|
|
975
|
-
deliveryWatchdog.catch(() => undefined);
|
|
976
|
-
responsePromise.catch(() => undefined);
|
|
977
|
-
throw error;
|
|
978
|
-
}
|
|
979
943
|
});
|
|
980
944
|
}
|
|
981
945
|
}
|
|
@@ -1084,7 +1048,6 @@ class ProtocolV2LinkManager {
|
|
|
1084
1048
|
logger: adapter.logger,
|
|
1085
1049
|
logPrefix: adapter.logPrefix,
|
|
1086
1050
|
createTimeoutError: adapter.createTimeoutError,
|
|
1087
|
-
writeTimeoutMs: adapter.writeTimeoutMs,
|
|
1088
1051
|
});
|
|
1089
1052
|
const link = { adapter, session, state };
|
|
1090
1053
|
this.links.set(key, link);
|
|
@@ -2010,13 +1973,11 @@ exports.PROTOCOL_V2_BLE_FRAME_MAX_BYTES = PROTOCOL_V2_BLE_FRAME_MAX_BYTES;
|
|
|
2010
1973
|
exports.PROTOCOL_V2_CHANNEL_BLE_UART = PROTOCOL_V2_CHANNEL_BLE_UART;
|
|
2011
1974
|
exports.PROTOCOL_V2_CHANNEL_SOCKET = PROTOCOL_V2_CHANNEL_SOCKET;
|
|
2012
1975
|
exports.PROTOCOL_V2_CHANNEL_USB = PROTOCOL_V2_CHANNEL_USB;
|
|
2013
|
-
exports.PROTOCOL_V2_DELIVERY_WATCHDOG_TIMEOUT_MS = PROTOCOL_V2_DELIVERY_WATCHDOG_TIMEOUT_MS;
|
|
2014
1976
|
exports.PROTOCOL_V2_FILE_CHUNK_SIZE = PROTOCOL_V2_FILE_CHUNK_SIZE;
|
|
2015
1977
|
exports.PROTOCOL_V2_FRAME_MAX_BYTES = PROTOCOL_V2_FRAME_MAX_BYTES;
|
|
2016
1978
|
exports.PROTOCOL_V2_PACKET_SRC_COMMAND = PROTOCOL_V2_PACKET_SRC_COMMAND;
|
|
2017
1979
|
exports.PROTOCOL_V2_SYS_MESSAGE_THRESHOLD = PROTOCOL_V2_SYS_MESSAGE_THRESHOLD;
|
|
2018
1980
|
exports.PROTOCOL_V2_WEBUSB_FILE_CHUNK_SIZE = PROTOCOL_V2_WEBUSB_FILE_CHUNK_SIZE;
|
|
2019
|
-
exports.PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS = PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS;
|
|
2020
1981
|
exports.ProtocolV1 = ProtocolV1;
|
|
2021
1982
|
exports.ProtocolV2 = ProtocolV2;
|
|
2022
1983
|
exports.ProtocolV2FrameAssembler = ProtocolV2FrameAssembler;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import ByteBuffer from 'bytebuffer';
|
|
3
3
|
import { encodeEnvelopeMessage } from './v1/packets';
|
|
4
4
|
import { decodeMessage as decodeV1Message } from './v1/receive';
|
|
5
|
-
import {
|
|
5
|
+
import { isAckFrame } from './v2';
|
|
6
6
|
import type { Root } from 'protobufjs/light';
|
|
7
7
|
export declare const PROTOCOL_V2_SYS_MESSAGE_THRESHOLD = 60000;
|
|
8
8
|
type ProtocolV2Schemas = {
|
|
@@ -27,7 +27,6 @@ export declare const ProtocolV1: {
|
|
|
27
27
|
};
|
|
28
28
|
export declare const ProtocolV2: {
|
|
29
29
|
isAckFrame: typeof isAckFrame;
|
|
30
|
-
getAckSequence: typeof getAckSequence;
|
|
31
30
|
inspectFrame(schemas: ProtocolV2Schemas, frame: Uint8Array): {
|
|
32
31
|
messageName: string;
|
|
33
32
|
messageTypeId: number;
|
|
@@ -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,
|
|
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;;;;;;;;;;CA0B1D,CAAC"}
|
|
@@ -4,6 +4,5 @@ export interface ProtoV2Frame {
|
|
|
4
4
|
seq: number;
|
|
5
5
|
}
|
|
6
6
|
export declare function isAckFrame(data: Uint8Array): boolean;
|
|
7
|
-
export declare function getAckSequence(data: Uint8Array): number | undefined;
|
|
8
7
|
export declare function decodeFrame(data: Uint8Array): ProtoV2Frame;
|
|
9
8
|
//# sourceMappingURL=decode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/decode.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAE3B,aAAa,EAAE,MAAM,CAAC;IAEtB,SAAS,EAAE,UAAU,CAAC;IAEtB,GAAG,EAAE,MAAM,CAAC;CACb;AAwCD,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAWpD;
|
|
1
|
+
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../../src/protocols/v2/decode.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAE3B,aAAa,EAAE,MAAM,CAAC;IAEtB,SAAS,EAAE,UAAU,CAAC;IAEtB,GAAG,EAAE,MAAM,CAAC;CACb;AAwCD,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAWpD;AAYD,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAe1D"}
|
|
@@ -12,7 +12,6 @@ export interface ProtocolV2LinkAdapter {
|
|
|
12
12
|
logger?: ProtocolV2SessionOptions['logger'];
|
|
13
13
|
logPrefix?: string;
|
|
14
14
|
createTimeoutError?: ProtocolV2SessionOptions['createTimeoutError'];
|
|
15
|
-
writeTimeoutMs?: number;
|
|
16
15
|
}
|
|
17
16
|
export type ProtocolV2LinkManagerOptions<Key> = {
|
|
18
17
|
getSchemas: () => ProtocolV2Schemas;
|
|
@@ -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,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UvD,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjD,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5C,OAAO,CAAC,eAAe;YA+CT,WAAW;IAkBzB,OAAO,CAAC,qBAAqB;CAK9B"}
|
|
@@ -29,8 +29,6 @@ export type ProtocolV2SessionOptions = {
|
|
|
29
29
|
createTimeoutError?: (name: string, timeoutMs: number) => Error;
|
|
30
30
|
sequenceCursor?: ProtocolV2SequenceCursor;
|
|
31
31
|
generation?: number;
|
|
32
|
-
writeTimeoutMs?: number;
|
|
33
|
-
deliveryTimeoutMs?: number;
|
|
34
32
|
};
|
|
35
33
|
export type ProtocolV2CallOptions = {
|
|
36
34
|
timeoutMs?: number;
|
|
@@ -44,8 +42,6 @@ export declare function hexToBytes(hex: string): Uint8Array;
|
|
|
44
42
|
export declare function bytesToHex(bytes: Uint8Array): string;
|
|
45
43
|
export declare function getErrorMessage(error: unknown): string;
|
|
46
44
|
export declare function withProtocolTimeout<T>(promise: Promise<T>, timeoutMs: number | undefined, createTimeoutError: () => Error, onTimeout?: () => void): Promise<T>;
|
|
47
|
-
export declare const PROTOCOL_V2_WRITE_WATCHDOG_TIMEOUT_MS = 30000;
|
|
48
|
-
export declare const PROTOCOL_V2_DELIVERY_WATCHDOG_TIMEOUT_MS = 5000;
|
|
49
45
|
export declare class ProtocolV2Session {
|
|
50
46
|
private readonly options;
|
|
51
47
|
private readonly sequenceCursor;
|
|
@@ -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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CAAC,EAC7B,WAAW,GAAE,qBAA0B,GACtC,OAAO,CAAC,iBAAiB,CAAC;YASf,WAAW;CA0H1B;AAED,wBAAsB,eAAe,CAAC,EACpC,IAAI,EACJ,SAAS,EACT,MAAM,EACN,SAAwB,EACxB,aAAa,EACb,aAAa,GACd,EAAE;IACD,IAAI,EAAE,CACJ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,qBAAqB,KAC5B,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC3C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC1D,oBAoBA"}
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1765,7 +1765,7 @@ export declare enum Enum_SafetyCheckLevel {
|
|
|
1765
1765
|
PromptAlways = 1,
|
|
1766
1766
|
PromptTemporarily = 2
|
|
1767
1767
|
}
|
|
1768
|
-
export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel;
|
|
1768
|
+
export type SafetyCheckLevel = keyof typeof Enum_SafetyCheckLevel | Enum_SafetyCheckLevel;
|
|
1769
1769
|
export type Initialize = {
|
|
1770
1770
|
session_id?: string;
|
|
1771
1771
|
_skip_passphrase?: boolean;
|