@onekeyfe/hwk-adapter-core 1.1.26-alpha.101 → 1.1.26-alpha.104
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 +165 -124
- package/dist/index.d.ts +165 -124
- package/dist/index.js +156 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +151 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -50,9 +50,9 @@ type Response<T> = Success<T> | Failure;
|
|
|
50
50
|
declare function success<T>(payload: T): Success<T>;
|
|
51
51
|
declare function failure(code: HardwareErrorCode, error: string, appName?: string): Failure;
|
|
52
52
|
|
|
53
|
-
type VendorType = 'trezor' | 'ledger'
|
|
54
|
-
type ConnectionType = 'usb' | 'ble'
|
|
55
|
-
type TransportType = 'usb' | 'ble' | 'hid' | 'bridge'
|
|
53
|
+
type VendorType = 'trezor' | 'ledger';
|
|
54
|
+
type ConnectionType = 'usb' | 'ble';
|
|
55
|
+
type TransportType = 'usb' | 'ble' | 'hid' | 'bridge';
|
|
56
56
|
/**
|
|
57
57
|
* Device capabilities — describes what a specific device/connection
|
|
58
58
|
* combination can or cannot do. Varies by vendor, model, and connection type.
|
|
@@ -96,14 +96,8 @@ interface EvmGetAddressParams {
|
|
|
96
96
|
interface EvmAddress {
|
|
97
97
|
address: string;
|
|
98
98
|
path: string;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
path: string;
|
|
102
|
-
showOnDevice?: boolean;
|
|
103
|
-
}
|
|
104
|
-
interface EvmPublicKey {
|
|
105
|
-
publicKey: string;
|
|
106
|
-
path: string;
|
|
99
|
+
/** Device-reported secp256k1 public key; populated when the transport exposes it. */
|
|
100
|
+
publicKey?: string;
|
|
107
101
|
}
|
|
108
102
|
interface EvmSignTxParams {
|
|
109
103
|
path: string;
|
|
@@ -184,7 +178,6 @@ type ProgressCallback = (progress: {
|
|
|
184
178
|
interface IEvmMethods {
|
|
185
179
|
evmGetAddress(connectId: string, deviceId: string, params: EvmGetAddressParams): Promise<Response<EvmAddress>>;
|
|
186
180
|
evmGetAddresses(connectId: string, deviceId: string, params: EvmGetAddressParams[], onProgress?: ProgressCallback): Promise<Response<EvmAddress[]>>;
|
|
187
|
-
evmGetPublicKey(connectId: string, deviceId: string, params: EvmGetPublicKeyParams): Promise<Response<EvmPublicKey>>;
|
|
188
181
|
evmSignTransaction(connectId: string, deviceId: string, params: EvmSignTxParams): Promise<Response<EvmSignedTx>>;
|
|
189
182
|
evmSignMessage(connectId: string, deviceId: string, params: EvmSignMsgParams): Promise<Response<EvmSignature>>;
|
|
190
183
|
evmSignTypedData(connectId: string, deviceId: string, params: EvmSignTypedDataParams): Promise<Response<EvmSignature>>;
|
|
@@ -297,19 +290,10 @@ interface SolGetAddressParams {
|
|
|
297
290
|
showOnDevice?: boolean;
|
|
298
291
|
}
|
|
299
292
|
interface SolAddress {
|
|
300
|
-
/** Base58-encoded Solana address */
|
|
293
|
+
/** Base58-encoded Solana address — this is also the Ed25519 public key. */
|
|
301
294
|
address: string;
|
|
302
295
|
path: string;
|
|
303
296
|
}
|
|
304
|
-
interface SolGetPublicKeyParams {
|
|
305
|
-
path: string;
|
|
306
|
-
showOnDevice?: boolean;
|
|
307
|
-
}
|
|
308
|
-
interface SolPublicKey {
|
|
309
|
-
/** Base58-encoded Ed25519 public key (same as the Solana address) */
|
|
310
|
-
publicKey: string;
|
|
311
|
-
path: string;
|
|
312
|
-
}
|
|
313
297
|
interface SolSignTxParams {
|
|
314
298
|
path: string;
|
|
315
299
|
/** Hex-encoded serialized transaction bytes (no 0x prefix) */
|
|
@@ -339,7 +323,6 @@ interface SolSignature {
|
|
|
339
323
|
interface ISolMethods {
|
|
340
324
|
solGetAddress(connectId: string, deviceId: string, params: SolGetAddressParams): Promise<Response<SolAddress>>;
|
|
341
325
|
solGetAddresses(connectId: string, deviceId: string, params: SolGetAddressParams[], onProgress?: ProgressCallback): Promise<Response<SolAddress[]>>;
|
|
342
|
-
solGetPublicKey(connectId: string, deviceId: string, params: SolGetPublicKeyParams): Promise<Response<SolPublicKey>>;
|
|
343
326
|
solSignTransaction(connectId: string, deviceId: string, params: SolSignTxParams): Promise<Response<SolSignedTx>>;
|
|
344
327
|
solSignMessage(connectId: string, deviceId: string, params: SolSignMsgParams): Promise<Response<SolSignature>>;
|
|
345
328
|
}
|
|
@@ -415,17 +398,87 @@ type ChainForFingerprint = 'evm' | 'btc' | 'sol' | 'tron';
|
|
|
415
398
|
*/
|
|
416
399
|
declare function deriveDeviceFingerprint(address: string): string;
|
|
417
400
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
declare const
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
401
|
+
/** 10 min — every UI request is human-in-the-loop; bias toward "wait long". */
|
|
402
|
+
declare const UI_REQUEST_DEFAULT_TIMEOUT_MS = 600000;
|
|
403
|
+
declare const UI_REQUEST_PREEMPTED_TAG = "UiRequestPreempted";
|
|
404
|
+
declare const UI_REQUEST_CANCELLED_TAG = "UiRequestCancelled";
|
|
405
|
+
declare const UI_REQUEST_TIMEOUT_TAG = "UiRequestTimeout";
|
|
406
|
+
/**
|
|
407
|
+
* Per-type single-slot registry for adapter-level UI requests. A new `wait`
|
|
408
|
+
* of the same type preempts (rejects) the prior one. Unknown response types
|
|
409
|
+
* are dropped silently so the public `uiResponse` entry never throws.
|
|
410
|
+
*/
|
|
411
|
+
declare class UiRequestRegistry {
|
|
412
|
+
private pending;
|
|
413
|
+
wait<T = unknown>(requestType: string, options?: {
|
|
414
|
+
timeoutMs?: number;
|
|
415
|
+
}): Promise<T>;
|
|
416
|
+
resolve(responseType: string, payload: unknown): void;
|
|
417
|
+
cancel(requestType?: string): void;
|
|
418
|
+
reset(): void;
|
|
419
|
+
hasPending(requestType: string): boolean;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Per-device serial job queue with preemption support and stuck recovery.
|
|
424
|
+
* Ensures that only one operation runs at a time per device, with intelligent
|
|
425
|
+
* handling of conflicting operations.
|
|
426
|
+
*
|
|
427
|
+
* The 'confirm' level uses the standard UI request/response flow:
|
|
428
|
+
* emits REQUEST_PREEMPTION → waits for RECEIVE_PREEMPTION via UiRequestRegistry.
|
|
429
|
+
*/
|
|
430
|
+
|
|
431
|
+
type Interruptibility = 'none' | 'safe' | 'confirm';
|
|
432
|
+
type PreemptionDecision = 'cancel-current' | 'wait' | 'reject-new';
|
|
433
|
+
interface JobOptions {
|
|
434
|
+
interruptibility?: Interruptibility;
|
|
435
|
+
label?: string;
|
|
436
|
+
}
|
|
437
|
+
interface ActiveJobInfo {
|
|
438
|
+
label?: string;
|
|
439
|
+
interruptibility: Interruptibility;
|
|
440
|
+
startedAt: number;
|
|
441
|
+
}
|
|
442
|
+
interface PreemptionEvent {
|
|
443
|
+
deviceId: string;
|
|
444
|
+
currentJob: ActiveJobInfo;
|
|
445
|
+
newJob: {
|
|
446
|
+
label?: string;
|
|
447
|
+
interruptibility: Interruptibility;
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
interface DeviceJobQueueDeps {
|
|
451
|
+
/** Emit a UI request event to the frontend. */
|
|
452
|
+
emit: (event: string, data: unknown) => void;
|
|
453
|
+
/** Registry for waiting on UI responses. */
|
|
454
|
+
uiRegistry: UiRequestRegistry;
|
|
455
|
+
}
|
|
456
|
+
declare class DeviceJobQueue {
|
|
457
|
+
private readonly _queues;
|
|
458
|
+
private readonly _active;
|
|
459
|
+
private readonly _deps;
|
|
460
|
+
constructor(deps?: DeviceJobQueueDeps);
|
|
461
|
+
/**
|
|
462
|
+
* Enqueue a job for a specific device.
|
|
463
|
+
* If a job is already running for this device, behavior depends on interruptibility:
|
|
464
|
+
* - 'none': new job queues silently (no preemption possible)
|
|
465
|
+
* - 'safe': current job is auto-cancelled, new job runs immediately after
|
|
466
|
+
* - 'confirm': emits REQUEST_PREEMPTION and waits for UI response
|
|
467
|
+
*/
|
|
468
|
+
enqueue<T>(deviceId: string, job: (signal: AbortSignal) => Promise<T>, options?: JobOptions): Promise<T>;
|
|
469
|
+
/** Manually cancel the active job on a device. Returns false if job is non-interruptible. */
|
|
470
|
+
cancelActive(deviceId: string): boolean;
|
|
471
|
+
/** Force cancel regardless of interruptibility. Use for device stuck recovery. */
|
|
472
|
+
forceCancelActive(deviceId: string): boolean;
|
|
473
|
+
/** Get info about the currently active job for a device, or null if idle. */
|
|
474
|
+
getActiveJob(deviceId: string): ActiveJobInfo | null;
|
|
475
|
+
clear(): void;
|
|
476
|
+
/**
|
|
477
|
+
* Request preemption decision via UI request/response flow.
|
|
478
|
+
* Falls back to 'wait' if deps are not provided.
|
|
479
|
+
*/
|
|
480
|
+
private _requestPreemptionDecision;
|
|
481
|
+
}
|
|
429
482
|
|
|
430
483
|
declare const UI_EVENT = "UI_EVENT";
|
|
431
484
|
declare const UI_REQUEST: {
|
|
@@ -438,6 +491,7 @@ declare const UI_REQUEST: {
|
|
|
438
491
|
readonly REQUEST_DEVICE_PERMISSION: "ui-request-device-permission";
|
|
439
492
|
readonly REQUEST_SELECT_DEVICE: "ui-request-select-device";
|
|
440
493
|
readonly REQUEST_DEVICE_CONNECT: "ui-request-device-connect";
|
|
494
|
+
readonly REQUEST_PREEMPTION: "ui-request-preemption";
|
|
441
495
|
readonly CLOSE_UI_WINDOW: "ui-close";
|
|
442
496
|
readonly DEVICE_PROGRESS: "ui-device_progress";
|
|
443
497
|
readonly FIRMWARE_PROGRESS: "ui-firmware-progress";
|
|
@@ -449,8 +503,57 @@ declare const UI_RESPONSE: {
|
|
|
449
503
|
readonly RECEIVE_PASSPHRASE_ON_DEVICE: "receive-passphrase-on-device";
|
|
450
504
|
readonly RECEIVE_QR_RESPONSE: "receive-qr-response";
|
|
451
505
|
readonly RECEIVE_SELECT_DEVICE: "receive-select-device";
|
|
506
|
+
readonly RECEIVE_DEVICE_CONNECT: "receive-device-connect";
|
|
507
|
+
readonly RECEIVE_PREEMPTION: "receive-preemption";
|
|
452
508
|
readonly CANCEL: "cancel";
|
|
453
509
|
};
|
|
510
|
+
type UiResponseEvent = {
|
|
511
|
+
type: typeof UI_RESPONSE.RECEIVE_PIN;
|
|
512
|
+
payload: string;
|
|
513
|
+
} | {
|
|
514
|
+
type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE;
|
|
515
|
+
payload: {
|
|
516
|
+
value: string;
|
|
517
|
+
passphraseOnDevice?: boolean;
|
|
518
|
+
save?: boolean;
|
|
519
|
+
};
|
|
520
|
+
} | {
|
|
521
|
+
type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE_ON_DEVICE;
|
|
522
|
+
payload?: undefined;
|
|
523
|
+
} | {
|
|
524
|
+
type: typeof UI_RESPONSE.RECEIVE_QR_RESPONSE;
|
|
525
|
+
payload: QrResponseData;
|
|
526
|
+
} | {
|
|
527
|
+
type: typeof UI_RESPONSE.RECEIVE_SELECT_DEVICE;
|
|
528
|
+
payload: {
|
|
529
|
+
sdkConnectId: string;
|
|
530
|
+
};
|
|
531
|
+
} | {
|
|
532
|
+
type: typeof UI_RESPONSE.RECEIVE_DEVICE_CONNECT;
|
|
533
|
+
payload: {
|
|
534
|
+
confirmed: boolean;
|
|
535
|
+
};
|
|
536
|
+
} | {
|
|
537
|
+
type: typeof UI_RESPONSE.RECEIVE_PREEMPTION;
|
|
538
|
+
payload: {
|
|
539
|
+
decision: PreemptionDecision;
|
|
540
|
+
};
|
|
541
|
+
} | {
|
|
542
|
+
type: typeof UI_RESPONSE.CANCEL;
|
|
543
|
+
payload?: undefined;
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
declare const DEVICE_EVENT = "DEVICE_EVENT";
|
|
547
|
+
/** Events originating from the hardware device. */
|
|
548
|
+
declare const DEVICE: {
|
|
549
|
+
readonly CONNECT: "device-connect";
|
|
550
|
+
readonly DISCONNECT: "device-disconnect";
|
|
551
|
+
readonly CHANGED: "device-changed";
|
|
552
|
+
readonly ACQUIRE: "device-acquire";
|
|
553
|
+
readonly RELEASE: "device-release";
|
|
554
|
+
readonly FEATURES: "features";
|
|
555
|
+
readonly SUPPORT_FEATURES: "support_features";
|
|
556
|
+
};
|
|
454
557
|
|
|
455
558
|
/** Events generated by SDK internal detection (not from hardware directly). */
|
|
456
559
|
declare const SDK: {
|
|
@@ -525,6 +628,16 @@ type UiRequestEvent = {
|
|
|
525
628
|
retryCount: number;
|
|
526
629
|
maxRetries: number;
|
|
527
630
|
};
|
|
631
|
+
} | {
|
|
632
|
+
type: typeof UI_REQUEST.REQUEST_PREEMPTION;
|
|
633
|
+
payload: {
|
|
634
|
+
deviceId: string;
|
|
635
|
+
currentJob: ActiveJobInfo;
|
|
636
|
+
newJob: {
|
|
637
|
+
label?: string;
|
|
638
|
+
interruptibility: Interruptibility;
|
|
639
|
+
};
|
|
640
|
+
};
|
|
528
641
|
} | {
|
|
529
642
|
type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
|
|
530
643
|
payload: Record<string, never>;
|
|
@@ -630,6 +743,17 @@ interface HardwareEventMap {
|
|
|
630
743
|
maxRetries: number;
|
|
631
744
|
};
|
|
632
745
|
};
|
|
746
|
+
[UI_REQUEST.REQUEST_PREEMPTION]: {
|
|
747
|
+
type: typeof UI_REQUEST.REQUEST_PREEMPTION;
|
|
748
|
+
payload: {
|
|
749
|
+
deviceId: string;
|
|
750
|
+
currentJob: ActiveJobInfo;
|
|
751
|
+
newJob: {
|
|
752
|
+
label?: string;
|
|
753
|
+
interruptibility: Interruptibility;
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
};
|
|
633
757
|
[UI_REQUEST.CLOSE_UI_WINDOW]: {
|
|
634
758
|
type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
|
|
635
759
|
payload: Record<string, never>;
|
|
@@ -661,15 +785,13 @@ interface HardwareEventMap {
|
|
|
661
785
|
};
|
|
662
786
|
}
|
|
663
787
|
/**
|
|
664
|
-
*
|
|
665
|
-
*
|
|
666
|
-
* Pure notifications (button confirm, progress) go through events instead.
|
|
788
|
+
* Same-process callbacks for prompts and OS-level permission.
|
|
789
|
+
* Cross-process flows use events + `uiResponse` + `UiRequestRegistry` instead.
|
|
667
790
|
*/
|
|
668
791
|
interface IUiHandler {
|
|
669
792
|
onPinRequest(device: DeviceInfo): Promise<string>;
|
|
670
793
|
onPassphraseRequest(device: DeviceInfo): Promise<string | PassphraseResponse>;
|
|
671
794
|
onQrDisplay(device: DeviceInfo, data: QrDisplayData): Promise<QrResponseData>;
|
|
672
|
-
onSelectDevice(devices: DeviceInfo[]): Promise<string>;
|
|
673
795
|
/**
|
|
674
796
|
* Check if device access permission is already granted.
|
|
675
797
|
* Returns { granted, context? }.
|
|
@@ -716,12 +838,8 @@ interface IHardwareWallet<TConfig = unknown> extends IEvmMethods, IBtcMethods, I
|
|
|
716
838
|
getDeviceInfo(connectId: string, deviceId: string): Promise<Response<DeviceInfo>>;
|
|
717
839
|
getSupportedChains(): ChainCapability[];
|
|
718
840
|
cancel(connectId: string): void;
|
|
719
|
-
/**
|
|
720
|
-
|
|
721
|
-
* Call with 'confirm' after the user connects/unlocks the device to retry,
|
|
722
|
-
* or 'cancel' to abort the operation.
|
|
723
|
-
*/
|
|
724
|
-
deviceConnectResponse(type: 'confirm' | 'cancel'): void;
|
|
841
|
+
/** Respond to any pending `ui-request-*`. */
|
|
842
|
+
uiResponse(response: UiResponseEvent): void;
|
|
725
843
|
/**
|
|
726
844
|
* Derive a chain-specific fingerprint for the connected device.
|
|
727
845
|
*
|
|
@@ -767,77 +885,6 @@ interface DeviceDisconnectEvent {
|
|
|
767
885
|
}
|
|
768
886
|
type DeviceChangeEvent = DeviceConnectEvent | DeviceDisconnectEvent;
|
|
769
887
|
|
|
770
|
-
/**
|
|
771
|
-
* Per-device serial job queue with preemption support and stuck recovery.
|
|
772
|
-
* Ensures that only one operation runs at a time per device, with intelligent
|
|
773
|
-
* handling of conflicting operations.
|
|
774
|
-
*/
|
|
775
|
-
type Interruptibility = 'none' | 'safe' | 'confirm';
|
|
776
|
-
type PreemptionDecision = 'cancel-current' | 'wait' | 'reject-new';
|
|
777
|
-
interface JobOptions {
|
|
778
|
-
interruptibility?: Interruptibility;
|
|
779
|
-
label?: string;
|
|
780
|
-
}
|
|
781
|
-
interface ActiveJobInfo {
|
|
782
|
-
label?: string;
|
|
783
|
-
interruptibility: Interruptibility;
|
|
784
|
-
startedAt: number;
|
|
785
|
-
}
|
|
786
|
-
interface PreemptionEvent {
|
|
787
|
-
deviceId: string;
|
|
788
|
-
currentJob: ActiveJobInfo;
|
|
789
|
-
newJob: {
|
|
790
|
-
label?: string;
|
|
791
|
-
interruptibility: Interruptibility;
|
|
792
|
-
};
|
|
793
|
-
}
|
|
794
|
-
declare class DeviceJobQueue {
|
|
795
|
-
private readonly _queues;
|
|
796
|
-
private readonly _active;
|
|
797
|
-
/**
|
|
798
|
-
* Called when a new job conflicts with an active 'confirm'-level job.
|
|
799
|
-
* UI should show a dialog and return the user's decision.
|
|
800
|
-
* If not set, defaults to 'wait' (queue behind current job).
|
|
801
|
-
*/
|
|
802
|
-
onPreemptionRequest?: (event: PreemptionEvent) => Promise<PreemptionDecision>;
|
|
803
|
-
/**
|
|
804
|
-
* Enqueue a job for a specific device.
|
|
805
|
-
* If a job is already running for this device, behavior depends on interruptibility:
|
|
806
|
-
* - 'none': new job queues silently (no preemption possible)
|
|
807
|
-
* - 'safe': current job is auto-cancelled, new job runs immediately after
|
|
808
|
-
* - 'confirm': onPreemptionRequest is called to ask user
|
|
809
|
-
*/
|
|
810
|
-
enqueue<T>(deviceId: string, job: (signal: AbortSignal) => Promise<T>, options?: JobOptions): Promise<T>;
|
|
811
|
-
/** Manually cancel the active job on a device. Returns false if job is non-interruptible. */
|
|
812
|
-
cancelActive(deviceId: string): boolean;
|
|
813
|
-
/** Force cancel regardless of interruptibility. Use for device stuck recovery. */
|
|
814
|
-
forceCancelActive(deviceId: string): boolean;
|
|
815
|
-
/** Get info about the currently active job for a device, or null if idle. */
|
|
816
|
-
getActiveJob(deviceId: string): ActiveJobInfo | null;
|
|
817
|
-
clear(): void;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
/**
|
|
821
|
-
* Abstraction for UI communication during device interactions.
|
|
822
|
-
* Implementations handle different execution contexts:
|
|
823
|
-
* - DirectUiBridge: same-process event emitter (default)
|
|
824
|
-
* - IframeUiBridge: postMessage-based (future)
|
|
825
|
-
* - ExtensionUiBridge: chrome.runtime.sendMessage (future)
|
|
826
|
-
*/
|
|
827
|
-
interface IUiBridge {
|
|
828
|
-
/** Ask the user for PIN entry. Returns the PIN string. */
|
|
829
|
-
requestPin(device: DeviceInfo, signal?: AbortSignal): Promise<string>;
|
|
830
|
-
/** Ask the user for passphrase entry. Returns the passphrase string. */
|
|
831
|
-
requestPassphrase(device: DeviceInfo, signal?: AbortSignal): Promise<string>;
|
|
832
|
-
/** Notify the UI about a button press request on the device. */
|
|
833
|
-
notifyButton(device: DeviceInfo, code?: string): void;
|
|
834
|
-
/**
|
|
835
|
-
* Ask the user whether to preempt the current device operation.
|
|
836
|
-
* Only called for 'confirm'-level operations.
|
|
837
|
-
*/
|
|
838
|
-
requestPreemption(device: DeviceInfo, activeLabel: string, newLabel: string): Promise<PreemptionDecision>;
|
|
839
|
-
}
|
|
840
|
-
|
|
841
888
|
/**
|
|
842
889
|
* Minimal device info returned during discovery (searchDevices).
|
|
843
890
|
* At scan time, full DeviceInfo fields like firmwareVersion are not yet available.
|
|
@@ -910,10 +957,7 @@ interface IConnector {
|
|
|
910
957
|
call(sessionId: string, method: string, params: unknown): Promise<unknown>;
|
|
911
958
|
cancel(sessionId: string): Promise<void>;
|
|
912
959
|
/** Send a UI response (e.g. PIN, passphrase) to the device. */
|
|
913
|
-
uiResponse(response:
|
|
914
|
-
type: string;
|
|
915
|
-
payload: unknown;
|
|
916
|
-
}): void;
|
|
960
|
+
uiResponse(response: UiResponseEvent): void;
|
|
917
961
|
on<K extends ConnectorEventType>(event: K, handler: (data: ConnectorEventMap[K]) => void): void;
|
|
918
962
|
off<K extends ConnectorEventType>(event: K, handler: (data: ConnectorEventMap[K]) => void): void;
|
|
919
963
|
reset(): void;
|
|
@@ -942,10 +986,7 @@ interface IHardwareBridge {
|
|
|
942
986
|
}): Promise<void>;
|
|
943
987
|
uiResponse(params: {
|
|
944
988
|
vendor: VendorType;
|
|
945
|
-
response:
|
|
946
|
-
type: string;
|
|
947
|
-
payload: unknown;
|
|
948
|
-
};
|
|
989
|
+
response: UiResponseEvent;
|
|
949
990
|
}): void;
|
|
950
991
|
reset(params: {
|
|
951
992
|
vendor: VendorType;
|
|
@@ -1031,4 +1072,4 @@ declare function batchCall<TParam, TResult>(params: TParam[], callFn: (p: TParam
|
|
|
1031
1072
|
total: number;
|
|
1032
1073
|
}) => void): Promise<Response<TResult[]>>;
|
|
1033
1074
|
|
|
1034
|
-
export { type ActiveJobInfo, type BtcAddress, type BtcGetAddressParams, type BtcGetPublicKeyParams, type BtcPublicKey, type BtcRefTransaction, type BtcSignMsgParams, type BtcSignPsbtParams, type BtcSignTxParams, type BtcSignature, type BtcSignedPsbt, type BtcSignedTx, type BtcTxInput, type BtcTxOutput, CHAIN_FINGERPRINT_PATHS, type ChainCapability, type ChainForFingerprint, type ConnectionType, type ConnectorDevice, type ConnectorEventMap, type ConnectorEventType, type ConnectorSession, DEVICE, DEVICE_EVENT, type DeviceCapabilities, type DeviceChangeEvent, type DeviceConnectEvent, type DeviceDescriptor, type DeviceDisconnectEvent, type DeviceEvent, type DeviceEventListener, type DeviceInfo, DeviceJobQueue, type DeviceTarget, EConnectorInteraction, type EIP712Domain, type EvmAddress, type EvmGetAddressParams, type
|
|
1075
|
+
export { type ActiveJobInfo, type BtcAddress, type BtcGetAddressParams, type BtcGetPublicKeyParams, type BtcPublicKey, type BtcRefTransaction, type BtcSignMsgParams, type BtcSignPsbtParams, type BtcSignTxParams, type BtcSignature, type BtcSignedPsbt, type BtcSignedTx, type BtcTxInput, type BtcTxOutput, CHAIN_FINGERPRINT_PATHS, type ChainCapability, type ChainForFingerprint, type ConnectionType, type ConnectorDevice, type ConnectorEventMap, type ConnectorEventType, type ConnectorSession, DEVICE, DEVICE_EVENT, type DeviceCapabilities, type DeviceChangeEvent, type DeviceConnectEvent, type DeviceDescriptor, type DeviceDisconnectEvent, type DeviceEvent, type DeviceEventListener, type DeviceInfo, DeviceJobQueue, type DeviceJobQueueDeps, type DeviceTarget, EConnectorInteraction, type EIP712Domain, type EvmAddress, type EvmGetAddressParams, type EvmSignMsgParams, type EvmSignTxParams, type EvmSignTypedDataFull, type EvmSignTypedDataHash, type EvmSignTypedDataParams, type EvmSignature, type EvmSignedTx, type Failure, HardwareErrorCode, type HardwareEvent, type HardwareEventMap, type IBtcMethods, type IConnector, type IEvmMethods, type IHardwareBridge, type IHardwareWallet, type ISolMethods, type ITronMethods, type IUiHandler, type Interruptibility, type JobOptions, type PassphraseResponse, type PreemptionDecision, type PreemptionEvent, type ProgressCallback, type QrDisplayData, type QrResponseData, type Response, SDK, type SdkEvent, type SolAddress, type SolGetAddressParams, type SolSignMsgParams, type SolSignTxParams, type SolSignature, type SolSignedTx, type Success, type TransportType, type TronAddress, type TronGetAddressParams, type TronSignMsgParams, type TronSignTxParams, type TronSignature, type TronSignedTx, TypedEventEmitter, UI_EVENT, UI_REQUEST, UI_REQUEST_CANCELLED_TAG, UI_REQUEST_DEFAULT_TIMEOUT_MS, UI_REQUEST_PREEMPTED_TAG, UI_REQUEST_TIMEOUT_TAG, UI_RESPONSE, type UiRequestEvent, UiRequestRegistry, type UiResponseEvent, type VendorType, batchCall, bytesToHex, compareSemver, createBridgedConnector, deriveDeviceFingerprint, enrichErrorMessage, ensure0x, failure, hexToBytes, padHex64, stripHex, success };
|