@onekeyfe/hwk-keystone-adapter 1.2.3-alpha.1 → 1.2.3-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +10 -11
- package/dist/index.d.ts +10 -11
- package/dist/index.js +436 -515
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +438 -517
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -260,7 +260,7 @@ interface KeystoneDeviceRecord {
|
|
|
260
260
|
importedAt: number;
|
|
261
261
|
/**
|
|
262
262
|
* Set to the connector's process-local `sessionId` once a live USB session exists for
|
|
263
|
-
* this wallet. Cleared by `
|
|
263
|
+
* this wallet. Cleared by `releaseOperation`. Presence of this field is
|
|
264
264
|
* what `KeystoneAdapter._resolveUr` uses to route a call over USB instead
|
|
265
265
|
* of QR.
|
|
266
266
|
*/
|
|
@@ -306,8 +306,8 @@ declare class KeystoneAdapter implements IHardwareWallet {
|
|
|
306
306
|
readonly vendor: "keystone";
|
|
307
307
|
private readonly urEngine;
|
|
308
308
|
private readonly emitter;
|
|
309
|
-
private readonly
|
|
310
|
-
private readonly
|
|
309
|
+
private readonly _operationRoutes;
|
|
310
|
+
private readonly _operations;
|
|
311
311
|
private readonly _uiRegistry;
|
|
312
312
|
private readonly _jobQueue;
|
|
313
313
|
private readonly _devices;
|
|
@@ -361,10 +361,9 @@ declare class KeystoneAdapter implements IHardwareWallet {
|
|
|
361
361
|
* QR-only (if it was ever QR-synced) or removes it entirely (pure-USB
|
|
362
362
|
* wallet that was never seen over QR) — see §4.2 of the design doc.
|
|
363
363
|
*/
|
|
364
|
-
|
|
365
|
-
private
|
|
366
|
-
getDeviceInfo(
|
|
367
|
-
getSupportedChains(): ChainCapability[];
|
|
364
|
+
releaseOperation(operationId: string): Promise<void>;
|
|
365
|
+
private _releaseOperationConnection;
|
|
366
|
+
getDeviceInfo(connectIdOrOperationId: string, deviceId: string): Promise<Response<DeviceInfo>>;
|
|
368
367
|
cancel(connectId?: string): void;
|
|
369
368
|
getChainFingerprint(connectId: string, deviceId: string, chain: ChainForFingerprint): Promise<Response<string>>;
|
|
370
369
|
uiResponse(response: UiResponseEvent): void;
|
|
@@ -423,7 +422,7 @@ declare class KeystoneAdapter implements IHardwareWallet {
|
|
|
423
422
|
* already has a live session, so this must NOT unconditionally mark
|
|
424
423
|
* `qrSynced`, or a USB-only wallet would wrongly survive a later USB
|
|
425
424
|
* disconnect as a "QR-synced, demote to QR-only" entry instead of being
|
|
426
|
-
* dropped outright (see `
|
|
425
|
+
* dropped outright (see `releaseOperation`).
|
|
427
426
|
*/
|
|
428
427
|
private _upsertDeviceRecord;
|
|
429
428
|
/**
|
|
@@ -442,7 +441,7 @@ declare class KeystoneAdapter implements IHardwareWallet {
|
|
|
442
441
|
* then attach and verify the requested wallet when one is present. This is
|
|
443
442
|
* used both after an adapter restart and after a QR-only period, so plugging
|
|
444
443
|
* USB back in affects the next business call without changing an in-flight
|
|
445
|
-
* QR
|
|
444
|
+
* QR operation.
|
|
446
445
|
*/
|
|
447
446
|
private _tryUsbAttach;
|
|
448
447
|
/**
|
|
@@ -460,8 +459,8 @@ declare class KeystoneAdapter implements IHardwareWallet {
|
|
|
460
459
|
/**
|
|
461
460
|
* Fetch one account's key material from the device for this operation only.
|
|
462
461
|
* `book` lets earlier fetches of the same operation be reused; nothing is
|
|
463
|
-
* retained on the record.
|
|
464
|
-
*
|
|
462
|
+
* retained on the record. A failed USB export ends this operation without
|
|
463
|
+
* replaying the request or switching transports.
|
|
465
464
|
*/
|
|
466
465
|
private _fetchAccount;
|
|
467
466
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -260,7 +260,7 @@ interface KeystoneDeviceRecord {
|
|
|
260
260
|
importedAt: number;
|
|
261
261
|
/**
|
|
262
262
|
* Set to the connector's process-local `sessionId` once a live USB session exists for
|
|
263
|
-
* this wallet. Cleared by `
|
|
263
|
+
* this wallet. Cleared by `releaseOperation`. Presence of this field is
|
|
264
264
|
* what `KeystoneAdapter._resolveUr` uses to route a call over USB instead
|
|
265
265
|
* of QR.
|
|
266
266
|
*/
|
|
@@ -306,8 +306,8 @@ declare class KeystoneAdapter implements IHardwareWallet {
|
|
|
306
306
|
readonly vendor: "keystone";
|
|
307
307
|
private readonly urEngine;
|
|
308
308
|
private readonly emitter;
|
|
309
|
-
private readonly
|
|
310
|
-
private readonly
|
|
309
|
+
private readonly _operationRoutes;
|
|
310
|
+
private readonly _operations;
|
|
311
311
|
private readonly _uiRegistry;
|
|
312
312
|
private readonly _jobQueue;
|
|
313
313
|
private readonly _devices;
|
|
@@ -361,10 +361,9 @@ declare class KeystoneAdapter implements IHardwareWallet {
|
|
|
361
361
|
* QR-only (if it was ever QR-synced) or removes it entirely (pure-USB
|
|
362
362
|
* wallet that was never seen over QR) — see §4.2 of the design doc.
|
|
363
363
|
*/
|
|
364
|
-
|
|
365
|
-
private
|
|
366
|
-
getDeviceInfo(
|
|
367
|
-
getSupportedChains(): ChainCapability[];
|
|
364
|
+
releaseOperation(operationId: string): Promise<void>;
|
|
365
|
+
private _releaseOperationConnection;
|
|
366
|
+
getDeviceInfo(connectIdOrOperationId: string, deviceId: string): Promise<Response<DeviceInfo>>;
|
|
368
367
|
cancel(connectId?: string): void;
|
|
369
368
|
getChainFingerprint(connectId: string, deviceId: string, chain: ChainForFingerprint): Promise<Response<string>>;
|
|
370
369
|
uiResponse(response: UiResponseEvent): void;
|
|
@@ -423,7 +422,7 @@ declare class KeystoneAdapter implements IHardwareWallet {
|
|
|
423
422
|
* already has a live session, so this must NOT unconditionally mark
|
|
424
423
|
* `qrSynced`, or a USB-only wallet would wrongly survive a later USB
|
|
425
424
|
* disconnect as a "QR-synced, demote to QR-only" entry instead of being
|
|
426
|
-
* dropped outright (see `
|
|
425
|
+
* dropped outright (see `releaseOperation`).
|
|
427
426
|
*/
|
|
428
427
|
private _upsertDeviceRecord;
|
|
429
428
|
/**
|
|
@@ -442,7 +441,7 @@ declare class KeystoneAdapter implements IHardwareWallet {
|
|
|
442
441
|
* then attach and verify the requested wallet when one is present. This is
|
|
443
442
|
* used both after an adapter restart and after a QR-only period, so plugging
|
|
444
443
|
* USB back in affects the next business call without changing an in-flight
|
|
445
|
-
* QR
|
|
444
|
+
* QR operation.
|
|
446
445
|
*/
|
|
447
446
|
private _tryUsbAttach;
|
|
448
447
|
/**
|
|
@@ -460,8 +459,8 @@ declare class KeystoneAdapter implements IHardwareWallet {
|
|
|
460
459
|
/**
|
|
461
460
|
* Fetch one account's key material from the device for this operation only.
|
|
462
461
|
* `book` lets earlier fetches of the same operation be reused; nothing is
|
|
463
|
-
* retained on the record.
|
|
464
|
-
*
|
|
462
|
+
* retained on the record. A failed USB export ends this operation without
|
|
463
|
+
* replaying the request or switching transports.
|
|
465
464
|
*/
|
|
466
465
|
private _fetchAccount;
|
|
467
466
|
/**
|