@onekeyfe/hwk-adapter-core 1.2.8-alpha.11 → 1.2.8-alpha.111

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.
Files changed (37) hide show
  1. package/dist/{chunk-BAGEFFFY.js → chunk-AYS7A7Z3.js} +45 -13
  2. package/dist/chunk-AYS7A7Z3.js.map +1 -0
  3. package/dist/chunk-DB4JOPZO.mjs +74 -0
  4. package/dist/chunk-DB4JOPZO.mjs.map +1 -0
  5. package/dist/{chunk-U63HTLGJ.mjs → chunk-G5EU7VRW.mjs} +44 -12
  6. package/dist/chunk-G5EU7VRW.mjs.map +1 -0
  7. package/dist/{chunk-YA4BWFTZ.mjs → chunk-KTRQZ5AJ.mjs} +155 -55
  8. package/dist/chunk-KTRQZ5AJ.mjs.map +1 -0
  9. package/dist/{chunk-SZZF623R.js → chunk-T5HIQPNG.js} +155 -55
  10. package/dist/chunk-T5HIQPNG.js.map +1 -0
  11. package/dist/chunk-YLCHSNXO.js +74 -0
  12. package/dist/chunk-YLCHSNXO.js.map +1 -0
  13. package/dist/errors-BgJ4kzRx.d.mts +276 -0
  14. package/dist/errors-BgJ4kzRx.d.ts +276 -0
  15. package/dist/errors.d.mts +1 -207
  16. package/dist/errors.d.ts +1 -207
  17. package/dist/errors.js +8 -2
  18. package/dist/errors.js.map +1 -1
  19. package/dist/errors.mjs +9 -3
  20. package/dist/index.d.mts +651 -104
  21. package/dist/index.d.ts +651 -104
  22. package/dist/index.js +1105 -87
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +1097 -79
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/{ui-events-Cb7haAeE.d.ts → ui-events-C61GTilK.d.mts} +67 -3
  27. package/dist/{ui-events-Cb7haAeE.d.mts → ui-events-C61GTilK.d.ts} +67 -3
  28. package/dist/ui-events.d.mts +1 -1
  29. package/dist/ui-events.d.ts +1 -1
  30. package/dist/ui-events.js +3 -2
  31. package/dist/ui-events.js.map +1 -1
  32. package/dist/ui-events.mjs +2 -1
  33. package/package.json +2 -2
  34. package/dist/chunk-BAGEFFFY.js.map +0 -1
  35. package/dist/chunk-SZZF623R.js.map +0 -1
  36. package/dist/chunk-U63HTLGJ.mjs.map +0 -1
  37. package/dist/chunk-YA4BWFTZ.mjs.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { HardwareErrorCode } from './errors.js';
2
- export { HwkError, IHwkErrorPayload, ORPHAN_ELIGIBLE_ERROR_CODES, createHwkError, enrichErrorMessage } from './errors.js';
3
- import { U as UiResponseEvent, a as UI_REQUEST, Q as QrDisplayData } from './ui-events-Cb7haAeE.js';
4
- export { D as DevicePermissionDeniedReason, b as DevicePermissionResponse, c as QrResponseData, d as UI_EVENT, e as UI_REQUEST_CANCELLED_TAG, f as UI_REQUEST_DEFAULT_TIMEOUT_MS, g as UI_REQUEST_PREEMPTED_TAG, h as UI_REQUEST_TIMEOUT_TAG, i as UI_RESPONSE, j as UiRequestRegistry } from './ui-events-Cb7haAeE.js';
1
+ import { H as HardwareErrorCode, a as HwkErrorOrigin, b as HwkRecoveryHint } from './errors-BgJ4kzRx.js';
2
+ export { c as HwkError, d as HwkRecoveryScope, I as IHwkErrorPayload, e as IOperationMayHaveCompletedParams, O as ORPHAN_ELIGIBLE_ERROR_CODES, f as createHwkError, g as defaultOriginForCode, h as defaultRecoveryForCode, i as enrichErrorMessage, j as isHwkRecoveryHint, o as operationMayHaveCompletedParams } from './errors-BgJ4kzRx.js';
3
+ import { U as UiResponseEvent, E as ExportedAccountKey, a as UiRequestOperationAttribution, b as UI_REQUEST, Q as QrDisplayData, c as UiRequestRegistry, S as SaveDeviceBindingDeclineReason } from './ui-events-C61GTilK.js';
4
+ export { D as DevicePermissionDeniedReason, d as DevicePermissionResponse, e as QrResponseData, f as UI_EVENT, g as UI_REQUEST_CANCELLED_TAG, h as UI_REQUEST_DEFAULT_TIMEOUT_MS, i as UI_REQUEST_PREEMPTED_TAG, j as UI_REQUEST_TIMEOUT_TAG, k as UI_RESPONSE } from './ui-events-C61GTilK.js';
5
5
 
6
6
  interface Success<T> {
7
7
  success: true;
@@ -12,16 +12,51 @@ interface Failure {
12
12
  payload: {
13
13
  error: string;
14
14
  code: HardwareErrorCode;
15
+ /** See HwkErrorOrigin, who the failure came from. Optional so an
16
+ * unclassified failure degrades to code-based handling, never a guess. */
17
+ origin?: HwkErrorOrigin;
18
+ /** Connection-lifecycle recovery semantics. Optional for wire compatibility
19
+ * with SDK versions that predate this field. SDK failure helpers populate it. */
20
+ recovery?: HwkRecoveryHint;
15
21
  params?: Record<string, unknown>;
16
22
  };
17
23
  }
18
24
  type Response<T> = Success<T> | Failure;
19
25
  declare function success<T>(payload: T): Success<T>;
20
- declare function failure(code: HardwareErrorCode, error: string, params?: Record<string, unknown>): Failure;
26
+ declare function failure(code: HardwareErrorCode, error: string, params?: Record<string, unknown>, origin?: HwkErrorOrigin, recovery?: HwkRecoveryHint): Failure;
21
27
 
22
- type VendorType = 'trezor' | 'ledger';
23
- type ConnectionType = 'usb' | 'ble';
24
- type TransportType = 'usb' | 'ble' | 'hid' | 'bridge';
28
+ /**
29
+ * Fixed derivation paths used to generate chain fingerprints.
30
+ * Uses standard index 0 — Ledger firmware shows device confirmation for
31
+ * non-standard paths (e.g., index=100), which would interrupt wallet creation.
32
+ * The address is hashed into a 16-char fingerprint, not exposed directly.
33
+ * - EVM: cointype 60 (Ledger ETH App only supports 60)
34
+ * - BTC: cointype 1 (testnet)
35
+ * - SOL: cointype 501, standard 3-level hardened
36
+ */
37
+ declare const CHAIN_FINGERPRINT_PATHS: Record<ChainForFingerprint, string>;
38
+ type ChainForFingerprint = 'evm' | 'btc' | 'sol' | 'tron' | 'zcash';
39
+ /**
40
+ * Parses the complete BIP32 master fingerprint wire value: 4 bytes encoded
41
+ * as exactly 8 hexadecimal characters. This is protocol metadata, not a
42
+ * collision-resistant wallet identity.
43
+ */
44
+ declare function parseBip32MasterFingerprint(value: unknown): string | undefined;
45
+ /** Four zero bytes is how a missing master fingerprint is encoded; never a wallet identity. */
46
+ declare const MISSING_BIP32_MASTER_FINGERPRINT = "00000000";
47
+ /** A master fingerprint usable as a wallet identity: well-formed and not the missing marker. */
48
+ declare function parseWalletMasterFingerprint(value: unknown): string | undefined;
49
+ /**
50
+ * 16-char SHA-256 fingerprint for device-identity verification.
51
+ * Callers must canonicalize input (e.g. EVM address → lowercase) —
52
+ * encoding variations otherwise cause false DeviceMismatch.
53
+ */
54
+ declare function deriveDeviceFingerprint(value: string): string;
55
+
56
+ type VendorType = 'trezor' | 'ledger' | 'keystone';
57
+ /** 'qr' is a virtual channel: UR payloads travel via app-rendered/scanned QR codes. */
58
+ type ConnectionType = 'usb' | 'ble' | 'qr';
59
+ type TransportType = 'usb' | 'ble' | 'hid' | 'bridge' | 'qr';
25
60
  /**
26
61
  * Device capabilities — describes what a specific device/connection
27
62
  * combination can or cannot do. Varies by vendor, model, and connection type.
@@ -31,12 +66,8 @@ type TransportType = 'usb' | 'ble' | 'hid' | 'bridge';
31
66
  */
32
67
  interface DeviceCapabilities {
33
68
  /**
34
- * Whether connectId/deviceId persist across sessions.
35
- *
36
- * - `true`: IDs are stable (e.g., OneKey USB, Trezor USB).
37
- * Business logic can match devices by stored connectId/deviceId.
38
- * - `false`: IDs are ephemeral, regenerated each session (e.g., Ledger WebHID).
39
- * Business logic should NOT rely on stored connectId/deviceId for matching.
69
+ * Whether the discovery handle can be reused to reconnect; `false` requires rediscovery. Says
70
+ * nothing about identity (Trezor BLE is false yet its device_id is stable); verify it separately.
40
71
  */
41
72
  persistentDeviceIdentity: boolean;
42
73
  }
@@ -73,6 +104,46 @@ interface DeviceTarget {
73
104
  connectId: string;
74
105
  deviceId: string;
75
106
  }
107
+ /**
108
+ * How long a discovery handle remains safe to use for a new connection.
109
+ * This is deliberately separate from post-connect device identity.
110
+ */
111
+ type SearchTargetReusePolicy = 'current-discovery' | 'reconnectable' | 'rediscover';
112
+ declare function resolveSearchTargetReusePolicy(device: Pick<DeviceInfo, 'connectionType' | 'capabilities'>): SearchTargetReusePolicy;
113
+ /** Search target for a physical device whose connectId is the discovery handle. */
114
+ declare function toPhysicalDeviceSearchTarget(vendor: VendorType, device: DeviceInfo): DeviceSearchTarget;
115
+ /**
116
+ * A selectable result from hardware discovery. It may represent a physical
117
+ * transport endpoint or an interactive entry such as Keystone QR; it is not a
118
+ * physical-device or wallet identity.
119
+ */
120
+ interface DeviceSearchTarget {
121
+ /** Opaque handle scoped to the adapter's current discovery state. */
122
+ searchTargetId: string;
123
+ /** Whether the handle itself may be retried; never inferred from a stored connectId. */
124
+ searchTargetReusePolicy?: SearchTargetReusePolicy;
125
+ vendor: VendorType;
126
+ connectionType: ConnectionType;
127
+ kind: 'physical' | 'interactive';
128
+ label?: string;
129
+ model?: string;
130
+ modelName?: string;
131
+ serialNumber?: string;
132
+ }
133
+ type WalletIdentity = {
134
+ vendor: 'ledger';
135
+ type: 'chainFingerprint';
136
+ chain: ChainForFingerprint;
137
+ value: string;
138
+ } | {
139
+ vendor: 'trezor';
140
+ type: 'deviceId';
141
+ value: string;
142
+ } | {
143
+ vendor: 'keystone';
144
+ type: 'walletId';
145
+ value: string;
146
+ };
76
147
 
77
148
  /**
78
149
  * Mixin for chain-operation params that can be pinned to a specific passphrase
@@ -133,6 +204,15 @@ interface ConnectorSession {
133
204
  sessionId: string;
134
205
  deviceInfo: DeviceInfo;
135
206
  }
207
+ type ConnectorConnectTarget = {
208
+ type: 'default';
209
+ } | {
210
+ type: 'search-target';
211
+ searchTargetId: string;
212
+ } | {
213
+ type: 'expected-device-identity';
214
+ deviceIdentity: string;
215
+ };
136
216
  /**
137
217
  * Vendor-agnostic bag of extra error fields. Known keys are documented for
138
218
  * discoverability; the index signature keeps it open so any connector can
@@ -245,6 +325,8 @@ interface ConnectorEventMap {
245
325
  connectId: string;
246
326
  deviceId?: string;
247
327
  credentials: Record<string, unknown>[];
328
+ /** Credentials the device rejected; a list kept for several devices drops these. */
329
+ removed?: Record<string, unknown>[];
248
330
  };
249
331
  'ui-request': {
250
332
  type: string;
@@ -253,12 +335,16 @@ interface ConnectorEventMap {
253
335
  'ui-event': ConnectorUiEvent;
254
336
  }
255
337
  interface ConnectorSearchDevicesOptions {
338
+ /** Select a child transport without waking/scanning the others. */
339
+ transportType?: ConnectionType;
256
340
  /**
257
341
  * Wait for every child transport in a fused connector. Default discovery can
258
342
  * return shortly after USB appears so BLE does not slow down USB flows;
259
343
  * binding pickers can opt in when they need BLE candidates too.
260
344
  */
261
345
  waitForAll?: boolean;
346
+ /** Availability probes must not invalidate user-selectable discovery targets. */
347
+ purpose?: 'selection' | 'availability';
262
348
  }
263
349
  interface ConnectorConfig {
264
350
  /**
@@ -273,8 +359,16 @@ interface ConnectorConfig {
273
359
  interface IConnector {
274
360
  /** Physical connection type this connector uses. Fixed at construction. */
275
361
  readonly connectionType: ConnectionType;
362
+ readonly availableTransports?: readonly ConnectionType[];
276
363
  searchDevices(options?: ConnectorSearchDevicesOptions): Promise<ConnectorDevice[]>;
277
- connect(deviceId?: string): Promise<ConnectorSession>;
364
+ connect(deviceId?: string, options?: {
365
+ transportType: ConnectionType;
366
+ }): Promise<ConnectorSession>;
367
+ /**
368
+ * Structured form for connectors where a discovery handle and a stable device identity are
369
+ * different concepts. The string form remains for bridge and legacy compatibility.
370
+ */
371
+ connectTarget?(target: ConnectorConnectTarget): Promise<ConnectorSession>;
278
372
  disconnect(sessionId: string): Promise<void>;
279
373
  call(sessionId: string, method: string, params: unknown): Promise<ConnectorCallResult>;
280
374
  cancel(sessionId: string): Promise<void>;
@@ -299,6 +393,9 @@ interface IHardwareBridge {
299
393
  connect(params: {
300
394
  vendor: VendorType;
301
395
  deviceId?: string;
396
+ options?: {
397
+ transportType: ConnectionType;
398
+ };
302
399
  }): Promise<ConnectorSession>;
303
400
  disconnect(params: {
304
401
  vendor: VendorType;
@@ -400,6 +497,10 @@ interface BtcGetAddressParams extends PassphraseStateAware {
400
497
  path: string;
401
498
  coin?: string;
402
499
  showOnDevice?: boolean;
500
+ /**
501
+ * Trezor only. Ledger and Keystone ignore it and derive the script of the path's purpose
502
+ * (44' P2PKH, 49' P2SH-P2WPKH, 84' P2WPKH, 86' P2TR; Keystone does not support 86' yet).
503
+ */
403
504
  scriptType?: 'p2pkh' | 'p2sh' | 'p2wpkh' | 'p2wsh' | 'p2tr';
404
505
  addressIndex?: number;
405
506
  change?: boolean;
@@ -407,6 +508,8 @@ interface BtcGetAddressParams extends PassphraseStateAware {
407
508
  interface BtcAddress {
408
509
  address: string;
409
510
  path: string;
511
+ /** Set by air-gapped wallets (Keystone): the exported key this address derives from. */
512
+ accountKey?: ExportedAccountKey;
410
513
  }
411
514
  interface BtcGetPublicKeyParams extends PassphraseStateAware {
412
515
  path: string;
@@ -421,6 +524,8 @@ interface BtcPublicKey {
421
524
  chainCode: string;
422
525
  path: string;
423
526
  depth: number;
527
+ /** Set by air-gapped wallets (Keystone): the exported key, for pinning by the host. */
528
+ accountKey?: ExportedAccountKey;
424
529
  }
425
530
  interface BtcSignTxParams extends PassphraseStateAware {
426
531
  psbt?: string;
@@ -561,6 +666,8 @@ interface SolAddress {
561
666
  /** Base58-encoded Solana address — this is also the Ed25519 public key. */
562
667
  address: string;
563
668
  path: string;
669
+ /** Set by air-gapped wallets (Keystone): the exported key this address derives from. */
670
+ accountKey?: ExportedAccountKey;
564
671
  }
565
672
  interface SolSignTxParams extends PassphraseStateAware {
566
673
  path: string;
@@ -581,11 +688,21 @@ interface SolSignedTx {
581
688
  /** Hex-encoded Ed25519 signature (no 0x prefix) */
582
689
  signature: string;
583
690
  }
584
- interface SolSignMsgParams extends PassphraseStateAware {
691
+ interface SolSignMessageBaseParams extends PassphraseStateAware {
585
692
  path: string;
586
693
  /** Message bytes as hex string (no 0x prefix) */
587
694
  message: string;
588
695
  }
696
+ interface SolOffchainMessageV1Params {
697
+ /** Finalized Solana off-chain message format. */
698
+ messageVersion: 1;
699
+ /** Complete signer set as 32-byte hex public keys. */
700
+ requiredSigners: string[];
701
+ }
702
+ type SolSignMsgParams = SolSignMessageBaseParams & ({
703
+ messageVersion?: undefined;
704
+ requiredSigners?: undefined;
705
+ } | SolOffchainMessageV1Params);
589
706
  interface SolSignature {
590
707
  /** Hex-encoded Ed25519 signature (no 0x prefix) */
591
708
  signature: string;
@@ -604,6 +721,8 @@ interface TronAddress {
604
721
  /** Base58check-encoded TRON address (starts with 'T') */
605
722
  address: string;
606
723
  path: string;
724
+ /** Set by air-gapped wallets (Keystone): the exported key this address derives from. */
725
+ accountKey?: ExportedAccountKey;
607
726
  }
608
727
  /** TRON network resource, used by freeze/unfreeze contracts. */
609
728
  type TronResource = 'BANDWIDTH' | 'ENERGY';
@@ -712,6 +831,12 @@ interface TronSignMsgParams extends PassphraseStateAware {
712
831
  path: string;
713
832
  /** Message hex (no 0x prefix) */
714
833
  messageHex: string;
834
+ /**
835
+ * TRON message scheme: 'V1' = legacy signMessage (prefix + 32-byte hash),
836
+ * 'V2' = TIP-191 signMessageV2 (prefix + byte length + message). Adapters
837
+ * that only implement one scheme reject the other with MethodNotSupported.
838
+ */
839
+ messageType?: 'V1' | 'V2';
715
840
  }
716
841
  interface TronSignature {
717
842
  /** 65-byte hex-encoded signature (no 0x prefix) */
@@ -723,100 +848,167 @@ interface ITronMethods {
723
848
  tronSignMessage(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<TronSignMsgParams>>): Promise<Response<TronSignature>>;
724
849
  }
725
850
 
726
- /**
727
- * Fixed derivation paths used to generate chain fingerprints.
728
- * Uses standard index 0 — Ledger firmware shows device confirmation for
729
- * non-standard paths (e.g., index=100), which would interrupt wallet creation.
730
- * The address is hashed into a 16-char fingerprint, not exposed directly.
731
- * - EVM: cointype 60 (Ledger ETH App only supports 60)
732
- * - BTC: cointype 1 (testnet)
733
- * - SOL: cointype 501, standard 3-level hardened
734
- */
735
- declare const CHAIN_FINGERPRINT_PATHS: Record<ChainForFingerprint, string>;
736
- type ChainForFingerprint = 'evm' | 'btc' | 'sol' | 'tron';
737
- /**
738
- * 16-char SHA-256 fingerprint for device-identity verification.
739
- * Callers must canonicalize input (e.g. EVM address → lowercase) —
740
- * encoding variations otherwise cause false DeviceMismatch.
741
- */
742
- declare function deriveDeviceFingerprint(value: string): string;
743
-
744
851
  /** Events generated by SDK internal detection (not from hardware directly). */
745
852
  declare const SDK: {
746
853
  readonly DEVICE_STUCK: "device-stuck";
747
854
  readonly DEVICE_UNRESPONSIVE: "device-unresponsive";
748
855
  readonly DEVICE_RECOVERED: "device-recovered";
749
856
  readonly DEVICE_INTERACTION: "device-interaction";
857
+ readonly OPERATION_ENDED: "operation-ended";
750
858
  };
751
859
 
860
+ declare const OPERATION_DEFAULT_TTL_MS = 600000;
861
+ type OperationEndReason = 'explicit' | 'disconnect' | 'timeout' | 'runtime-reset';
862
+ type HardwareOperation = {
863
+ operationId: string;
864
+ connectId: string;
865
+ device: DeviceInfo;
866
+ /**
867
+ * The channel this operation runs on, set by the adapter that picked it. Never read it off
868
+ * `device`: a combined connector fills that snapshot with a nominal value.
869
+ */
870
+ connectionType: ConnectionType;
871
+ connectionKeys: string[];
872
+ };
873
+ type OperationRegistryOptions = {
874
+ vendor: VendorType;
875
+ ttlMs?: number;
876
+ onEnded?: (operation: HardwareOperation, reason: OperationEndReason) => void;
877
+ };
878
+ /** Runtime-only association between a public operation id and one live target. */
879
+ declare class OperationRegistry {
880
+ private readonly _vendor;
881
+ private readonly _ttlMs;
882
+ private readonly _onEnded?;
883
+ private readonly _active;
884
+ private readonly _ended;
885
+ constructor(options: OperationRegistryOptions);
886
+ create(params: {
887
+ searchTargetId: string;
888
+ connectId: string;
889
+ device: DeviceInfo;
890
+ connectionType: ConnectionType;
891
+ connectionKeys?: string[];
892
+ }): HardwareOperation;
893
+ resolve(operationId: string): HardwareOperation;
894
+ /** Keep an operation alive while one device job is actively using it. */
895
+ retain(operationId: string): () => void;
896
+ /** Return a live operation without refreshing its TTL; ended and unknown ids give undefined. */
897
+ findActive(operationId: string): HardwareOperation | undefined;
898
+ /** Return active or tombstoned binding data without refreshing its TTL. */
899
+ find(operationId: string): HardwareOperation | undefined;
900
+ findActiveByConnectionKey(connectionKey: string): HardwareOperation | undefined;
901
+ /** Map a job queue key (an operation id or a connection key) to its live operation id. */
902
+ findOperationIdByJobKey(jobKey: string | undefined): string | undefined;
903
+ /**
904
+ * End an operation on the caller's explicit release. Throws for an unknown id; returns undefined
905
+ * when it had already ended.
906
+ */
907
+ release(operationId: string): HardwareOperation | undefined;
908
+ end(operationId: string, reason: OperationEndReason): HardwareOperation | undefined;
909
+ endByConnectionKey(connectionKey: string, reason: OperationEndReason, exceptOperationId?: string): void;
910
+ endAll(reason: OperationEndReason, exceptOperationId?: string): void;
911
+ private _touch;
912
+ private _createTimer;
913
+ private _rememberEnded;
914
+ }
915
+
752
916
  type HardwareMethodMetadata = {
753
917
  chain: ChainForFingerprint;
754
918
  allNetwork: boolean;
919
+ /** Whether repeating the method after an ambiguous transport failure is safe. */
920
+ replayAfterTransportFailure: 'safe' | 'unsafe';
755
921
  };
756
922
  declare const HARDWARE_METHOD_CATALOG: {
757
923
  readonly evmGetAddress: {
758
924
  readonly chain: "evm";
759
925
  readonly allNetwork: true;
926
+ readonly replayAfterTransportFailure: "safe";
760
927
  };
761
928
  readonly evmSignTransaction: {
762
929
  readonly chain: "evm";
763
930
  readonly allNetwork: false;
931
+ readonly replayAfterTransportFailure: "unsafe";
764
932
  };
765
933
  readonly evmSignMessage: {
766
934
  readonly chain: "evm";
767
935
  readonly allNetwork: false;
936
+ readonly replayAfterTransportFailure: "unsafe";
768
937
  };
769
938
  readonly evmSignTypedData: {
770
939
  readonly chain: "evm";
771
940
  readonly allNetwork: false;
941
+ readonly replayAfterTransportFailure: "unsafe";
772
942
  };
773
943
  readonly btcGetAddress: {
774
944
  readonly chain: "btc";
775
945
  readonly allNetwork: true;
946
+ readonly replayAfterTransportFailure: "safe";
776
947
  };
777
948
  readonly btcGetPublicKey: {
778
949
  readonly chain: "btc";
779
950
  readonly allNetwork: true;
951
+ readonly replayAfterTransportFailure: "safe";
780
952
  };
781
953
  readonly btcSignTransaction: {
782
954
  readonly chain: "btc";
783
955
  readonly allNetwork: false;
956
+ readonly replayAfterTransportFailure: "unsafe";
784
957
  };
785
958
  readonly btcSignPsbt: {
786
959
  readonly chain: "btc";
787
960
  readonly allNetwork: false;
961
+ readonly replayAfterTransportFailure: "unsafe";
788
962
  };
789
963
  readonly btcSignMessage: {
790
964
  readonly chain: "btc";
791
965
  readonly allNetwork: false;
966
+ readonly replayAfterTransportFailure: "unsafe";
792
967
  };
793
968
  readonly btcGetMasterFingerprint: {
794
969
  readonly chain: "btc";
795
970
  readonly allNetwork: false;
971
+ readonly replayAfterTransportFailure: "safe";
796
972
  };
797
973
  readonly solGetAddress: {
798
974
  readonly chain: "sol";
799
975
  readonly allNetwork: true;
976
+ readonly replayAfterTransportFailure: "safe";
800
977
  };
801
978
  readonly solSignTransaction: {
802
979
  readonly chain: "sol";
803
980
  readonly allNetwork: false;
981
+ readonly replayAfterTransportFailure: "unsafe";
804
982
  };
805
983
  readonly solSignMessage: {
806
984
  readonly chain: "sol";
807
985
  readonly allNetwork: false;
986
+ readonly replayAfterTransportFailure: "unsafe";
808
987
  };
809
988
  readonly tronGetAddress: {
810
989
  readonly chain: "tron";
811
990
  readonly allNetwork: true;
991
+ readonly replayAfterTransportFailure: "safe";
812
992
  };
813
993
  readonly tronSignTransaction: {
814
994
  readonly chain: "tron";
815
995
  readonly allNetwork: false;
996
+ readonly replayAfterTransportFailure: "unsafe";
816
997
  };
817
998
  readonly tronSignMessage: {
818
999
  readonly chain: "tron";
819
1000
  readonly allNetwork: false;
1001
+ readonly replayAfterTransportFailure: "unsafe";
1002
+ };
1003
+ readonly zcashGetFullViewingKey: {
1004
+ readonly chain: "zcash";
1005
+ readonly allNetwork: false;
1006
+ readonly replayAfterTransportFailure: "safe";
1007
+ };
1008
+ readonly zcashGetShieldedAddress: {
1009
+ readonly chain: "zcash";
1010
+ readonly allNetwork: false;
1011
+ readonly replayAfterTransportFailure: "safe";
820
1012
  };
821
1013
  };
822
1014
  type HardwareMethodName = keyof typeof HARDWARE_METHOD_CATALOG;
@@ -825,6 +1017,11 @@ type AllNetworkMethodName = {
825
1017
  }[HardwareMethodName];
826
1018
  declare const ALL_NETWORK_METHOD_NAMES: AllNetworkMethodName[];
827
1019
  declare function getHardwareMethodMetadata(method: string): HardwareMethodMetadata | undefined;
1020
+ /**
1021
+ * Conservative replay gate used only after a call may have reached hardware.
1022
+ * Unknown methods and device mutations are unsafe by default.
1023
+ */
1024
+ declare function canReplayHardwareMethodAfterTransportFailure(method: string): boolean;
828
1025
  declare function isAllNetworkMethodName(method: string): method is AllNetworkMethodName;
829
1026
  declare function getAllNetworkMethodChain(method: AllNetworkMethodName): ChainForFingerprint;
830
1027
 
@@ -843,7 +1040,7 @@ type HardwareUiEvent = Exclude<ConnectorUiEvent, {
843
1040
  progress: number;
844
1041
  };
845
1042
  };
846
- type ChainCapability = 'evm' | 'btc' | 'sol' | 'tron';
1043
+ type ChainCapability = 'evm' | 'btc' | 'sol' | 'tron' | 'zcash';
847
1044
  type TrezorDisplayRotation = 'North' | 'East' | 'South' | 'West';
848
1045
  type TrezorSafetyCheckLevel = 'Strict' | 'PromptAlways' | 'PromptTemporarily';
849
1046
  type TrezorDeviceSettingsParams = {
@@ -914,19 +1111,83 @@ type DeviceAuthenticityResult = {
914
1111
  };
915
1112
  };
916
1113
  };
1114
+ /** Persisted connection hints, never proof of device or wallet identity. */
1115
+ type KnownDeviceConnection = {
1116
+ transport: 'usb' | 'ble';
1117
+ connectId: string;
1118
+ } | {
1119
+ transport: 'qr';
1120
+ };
1121
+ /** Opaque host lookup identifiers. Never forward these to firmware or logs. */
1122
+ type HardwareCallExtra = Readonly<Record<string, string>>;
1123
+ interface IHardwareConnectionContext {
1124
+ knownConnections?: readonly KnownDeviceConnection[];
1125
+ extra?: HardwareCallExtra;
1126
+ /** False makes discovery fail instead of asking the user to select a new endpoint. */
1127
+ allowDeviceSelection?: boolean;
1128
+ /** Transports the host's model table allows; discovery never opens others. Omitted = any. */
1129
+ supportedTransports?: readonly ('usb' | 'ble')[];
1130
+ }
1131
+ type DeviceSelectionContext = {
1132
+ kind: 'select-device';
1133
+ transport: 'usb';
1134
+ reason: 'multiple-candidates';
1135
+ } | {
1136
+ kind: 'bind-connection';
1137
+ transport: 'ble';
1138
+ reason: 'missing-binding' | 'known-connection-unavailable' | 'manual-rebind';
1139
+ };
1140
+ interface DeviceSelectionRequest extends UiRequestOperationAttribution {
1141
+ devices: DeviceInfo[];
1142
+ /** Echo this in the `RECEIVE_SELECT_DEVICE` answer; an answer without it is ignored. */
1143
+ requestId: string;
1144
+ context: DeviceSelectionContext;
1145
+ extra?: HardwareCallExtra;
1146
+ /** Repeated snapshots with this requestId update one SDK-owned binding scan. */
1147
+ scanning?: boolean;
1148
+ bindingSessionId?: string;
1149
+ /** A candidate rejected by SDK identity verification in this binding session. */
1150
+ rejectedConnectId?: string;
1151
+ }
1152
+ /** The host must persist this endpoint before acknowledging. */
1153
+ interface SaveDeviceBindingRequest extends UiRequestOperationAttribution {
1154
+ requestId: string;
1155
+ selectionRequestId: string;
1156
+ connection: {
1157
+ transport: 'ble';
1158
+ connectId: string;
1159
+ };
1160
+ /** Omitted when the vendor binds the selected BLE endpoint without checking its wallet (Ledger). */
1161
+ identity?: Extract<WalletIdentity, {
1162
+ vendor: 'ledger' | 'trezor';
1163
+ }>;
1164
+ extra?: HardwareCallExtra;
1165
+ }
1166
+ type BindBleDeviceParams = Pick<SaveDeviceBindingRequest, 'identity' | 'extra'> & {
1167
+ /** Ledger: other recorded chains, tried in order only when the previous chain's app is missing. */
1168
+ fallbackIdentities?: Extract<WalletIdentity, {
1169
+ vendor: 'ledger';
1170
+ }>[];
1171
+ };
1172
+ interface DeviceBindingStatus {
1173
+ selectionRequestId: string;
1174
+ status: 'verifying' | 'saved' | 'failed' | 'cancelled';
1175
+ }
917
1176
  /**
918
1177
  * Cross-chain / cross-vendor options passed alongside any chain method's
919
1178
  * own params (the optional last argument). Holds operation-level switches
920
1179
  * that aren't specific to one chain. Vendor-specific options can be added
921
1180
  * as typed sub-fields here when a vendor actually needs them.
922
1181
  */
923
- interface ICommonCallParams {
1182
+ interface ICommonCallParams extends IHardwareConnectionContext {
924
1183
  /**
925
1184
  * When the required device app is missing, prompt the user (UI request)
926
1185
  * to install it, stream install progress, then retry the operation once.
927
1186
  * Off by default — preserves the plain "app not installed" failure.
928
1187
  */
929
1188
  autoInstallApp?: boolean;
1189
+ /** Runtime-only id from connectDevice(); when present, discovery and fallback are disabled. */
1190
+ operationId?: string;
930
1191
  }
931
1192
  type NullableCallArg<T> = T | null | undefined;
932
1193
  interface IPassphraseCallParams {
@@ -935,6 +1196,14 @@ interface IPassphraseCallParams {
935
1196
  }
936
1197
  type IHardwareCommonCallParams = ICommonCallParams & IPassphraseCallParams;
937
1198
  type IHardwareCallParams<T> = T & IHardwareCommonCallParams;
1199
+ /**
1200
+ * Runtime-only device-manager context, never forwarded to firmware. The expected identity lets an
1201
+ * adapter fail closed before replaying a read or mutation after a reconnect.
1202
+ */
1203
+ interface IDeviceManagerOperationContext extends IHardwareConnectionContext {
1204
+ operationId?: string;
1205
+ expectedDeviceIdentity?: WalletIdentity;
1206
+ }
938
1207
  interface AllNetworkAddressParams {
939
1208
  network: string;
940
1209
  path: string;
@@ -945,16 +1214,7 @@ interface AllNetworkAddressParams {
945
1214
  interface AllNetworkGetAddressParams extends IHardwareCommonCallParams {
946
1215
  bundle: AllNetworkAddressParams[];
947
1216
  }
948
- type AllNetworkDeviceIdentity = {
949
- vendor: 'ledger';
950
- type: 'chainFingerprint';
951
- chain: ChainForFingerprint;
952
- value: string;
953
- } | {
954
- vendor: 'trezor';
955
- type: 'deviceId';
956
- value: string;
957
- };
1217
+ type AllNetworkDeviceIdentity = WalletIdentity;
958
1218
  type AllNetworkAddressResponsePayload = Record<string, unknown> & {
959
1219
  error?: string;
960
1220
  code?: HardwareErrorCode | number;
@@ -962,6 +1222,7 @@ type AllNetworkAddressResponsePayload = Record<string, unknown> & {
962
1222
  connectId?: string;
963
1223
  deviceId?: string;
964
1224
  deviceIdentity?: AllNetworkDeviceIdentity;
1225
+ rootFingerprint?: number;
965
1226
  chainFingerprint?: string;
966
1227
  chainFingerprintChain?: ChainForFingerprint;
967
1228
  params?: Record<string, unknown>;
@@ -1002,6 +1263,7 @@ type DeviceEvent = {
1002
1263
  connectId: string;
1003
1264
  deviceId?: string;
1004
1265
  credentials: Record<string, unknown>[];
1266
+ removed?: Record<string, unknown>[];
1005
1267
  };
1006
1268
  };
1007
1269
  type UiRequestEvent = {
@@ -1010,46 +1272,50 @@ type UiRequestEvent = {
1010
1272
  device?: DeviceInfo;
1011
1273
  connectId?: string;
1012
1274
  type?: string;
1013
- };
1275
+ } & UiRequestOperationAttribution;
1014
1276
  } | {
1015
1277
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
1016
1278
  payload: {
1017
1279
  device: DeviceInfo;
1018
- };
1280
+ } & UiRequestOperationAttribution;
1019
1281
  } | {
1020
1282
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
1021
1283
  payload: {
1022
1284
  device: DeviceInfo;
1023
- };
1285
+ } & UiRequestOperationAttribution;
1024
1286
  } | {
1025
1287
  type: typeof UI_REQUEST.REQUEST_BUTTON;
1026
1288
  payload: {
1027
1289
  device: DeviceInfo;
1028
1290
  code?: string;
1029
- };
1291
+ } & UiRequestOperationAttribution;
1030
1292
  } | {
1031
1293
  type: typeof UI_REQUEST.REQUEST_QR_DISPLAY;
1032
1294
  payload: {
1033
1295
  device: DeviceInfo;
1034
1296
  data: QrDisplayData;
1035
- };
1297
+ } & UiRequestOperationAttribution;
1036
1298
  } | {
1037
1299
  type: typeof UI_REQUEST.REQUEST_QR_SCAN;
1038
1300
  payload: {
1039
1301
  device: DeviceInfo;
1040
- };
1302
+ } & UiRequestOperationAttribution;
1041
1303
  } | {
1042
1304
  type: typeof UI_REQUEST.REQUEST_DEVICE_PERMISSION;
1043
1305
  payload: {
1044
1306
  transportType: TransportType;
1045
1307
  connectId?: string;
1046
1308
  deviceId?: string;
1047
- };
1309
+ } & UiRequestOperationAttribution;
1048
1310
  } | {
1049
1311
  type: typeof UI_REQUEST.REQUEST_SELECT_DEVICE;
1050
- payload: {
1051
- devices: DeviceInfo[];
1052
- };
1312
+ payload: DeviceSelectionRequest;
1313
+ } | {
1314
+ type: typeof UI_REQUEST.REQUEST_SAVE_DEVICE_BINDING;
1315
+ payload: SaveDeviceBindingRequest;
1316
+ } | {
1317
+ type: typeof UI_REQUEST.DEVICE_BINDING_STATUS;
1318
+ payload: DeviceBindingStatus;
1053
1319
  } | {
1054
1320
  type: typeof UI_REQUEST.REQUEST_DEVICE_CONNECT;
1055
1321
  payload: {
@@ -1069,13 +1335,13 @@ type UiRequestEvent = {
1069
1335
  * isn't recognized.
1070
1336
  */
1071
1337
  message: string;
1072
- };
1338
+ } & UiRequestOperationAttribution;
1073
1339
  } | {
1074
1340
  type: typeof UI_REQUEST.REQUEST_INSTALL_APP;
1075
1341
  payload: {
1076
1342
  vendor: string;
1077
1343
  appName: string;
1078
- };
1344
+ } & UiRequestOperationAttribution;
1079
1345
  } | {
1080
1346
  type: typeof UI_REQUEST.REQUEST_TREZOR_THP_PAIRING;
1081
1347
  payload: {
@@ -1083,10 +1349,10 @@ type UiRequestEvent = {
1083
1349
  availableMethods: number[];
1084
1350
  selectedMethod: number;
1085
1351
  nfcData?: string;
1086
- };
1352
+ } & UiRequestOperationAttribution;
1087
1353
  } | {
1088
1354
  type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
1089
- payload: Record<string, never>;
1355
+ payload: UiRequestOperationAttribution;
1090
1356
  };
1091
1357
  type SdkEvent = {
1092
1358
  type: typeof SDK.DEVICE_INTERACTION;
@@ -1109,6 +1375,12 @@ type SdkEvent = {
1109
1375
  payload: {
1110
1376
  connectId: string;
1111
1377
  };
1378
+ } | {
1379
+ type: typeof SDK.OPERATION_ENDED;
1380
+ payload: {
1381
+ operationId: string;
1382
+ reason: OperationEndReason;
1383
+ };
1112
1384
  };
1113
1385
  type HardwareEvent = DeviceEvent | UiRequestEvent | SdkEvent | HardwareUiEvent;
1114
1386
  type DeviceEventListener = (event: HardwareEvent) => void;
@@ -1119,6 +1391,14 @@ type DeviceEventListener = (event: HardwareEvent) => void;
1119
1391
  * and the value is the narrowed event object the listener will receive.
1120
1392
  */
1121
1393
  interface HardwareEventMap {
1394
+ [UI_REQUEST.DEVICE_BINDING_STATUS]: {
1395
+ type: typeof UI_REQUEST.DEVICE_BINDING_STATUS;
1396
+ payload: DeviceBindingStatus;
1397
+ };
1398
+ [UI_REQUEST.REQUEST_SAVE_DEVICE_BINDING]: {
1399
+ type: typeof UI_REQUEST.REQUEST_SAVE_DEVICE_BINDING;
1400
+ payload: SaveDeviceBindingRequest;
1401
+ };
1122
1402
  'ui-event': HardwareUiEvent;
1123
1403
  [DEVICE.CONNECT]: {
1124
1404
  type: typeof DEVICE.CONNECT;
@@ -1151,6 +1431,8 @@ interface HardwareEventMap {
1151
1431
  connectId: string;
1152
1432
  deviceId?: string;
1153
1433
  credentials: Record<string, unknown>[];
1434
+ /** Credentials the device rejected; a list kept for several devices drops these. */
1435
+ removed?: Record<string, unknown>[];
1154
1436
  };
1155
1437
  };
1156
1438
  [UI_REQUEST.REQUEST_PIN]: {
@@ -1159,7 +1441,7 @@ interface HardwareEventMap {
1159
1441
  device?: DeviceInfo;
1160
1442
  connectId?: string;
1161
1443
  type?: string;
1162
- };
1444
+ } & UiRequestOperationAttribution;
1163
1445
  };
1164
1446
  [UI_REQUEST.REQUEST_PASSPHRASE]: {
1165
1447
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
@@ -1168,33 +1450,33 @@ interface HardwareEventMap {
1168
1450
  connectId?: string;
1169
1451
  passphraseState?: string;
1170
1452
  useEmptyPassphrase?: boolean;
1171
- };
1453
+ } & UiRequestOperationAttribution;
1172
1454
  };
1173
1455
  [UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE]: {
1174
1456
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
1175
1457
  payload: {
1176
1458
  device: DeviceInfo;
1177
- };
1459
+ } & UiRequestOperationAttribution;
1178
1460
  };
1179
1461
  [UI_REQUEST.REQUEST_BUTTON]: {
1180
1462
  type: typeof UI_REQUEST.REQUEST_BUTTON;
1181
1463
  payload: {
1182
1464
  device: DeviceInfo;
1183
1465
  code?: string;
1184
- };
1466
+ } & UiRequestOperationAttribution;
1185
1467
  };
1186
1468
  [UI_REQUEST.REQUEST_QR_DISPLAY]: {
1187
1469
  type: typeof UI_REQUEST.REQUEST_QR_DISPLAY;
1188
1470
  payload: {
1189
1471
  device: DeviceInfo;
1190
1472
  data: QrDisplayData;
1191
- };
1473
+ } & UiRequestOperationAttribution;
1192
1474
  };
1193
1475
  [UI_REQUEST.REQUEST_QR_SCAN]: {
1194
1476
  type: typeof UI_REQUEST.REQUEST_QR_SCAN;
1195
1477
  payload: {
1196
1478
  device: DeviceInfo;
1197
- };
1479
+ } & UiRequestOperationAttribution;
1198
1480
  };
1199
1481
  [UI_REQUEST.REQUEST_DEVICE_PERMISSION]: {
1200
1482
  type: typeof UI_REQUEST.REQUEST_DEVICE_PERMISSION;
@@ -1202,13 +1484,11 @@ interface HardwareEventMap {
1202
1484
  transportType: TransportType;
1203
1485
  connectId?: string;
1204
1486
  deviceId?: string;
1205
- };
1487
+ } & UiRequestOperationAttribution;
1206
1488
  };
1207
1489
  [UI_REQUEST.REQUEST_SELECT_DEVICE]: {
1208
1490
  type: typeof UI_REQUEST.REQUEST_SELECT_DEVICE;
1209
- payload: {
1210
- devices: DeviceInfo[];
1211
- };
1491
+ payload: DeviceSelectionRequest;
1212
1492
  };
1213
1493
  [UI_REQUEST.REQUEST_DEVICE_CONNECT]: {
1214
1494
  type: typeof UI_REQUEST.REQUEST_DEVICE_CONNECT;
@@ -1216,7 +1496,7 @@ interface HardwareEventMap {
1216
1496
  vendor: string;
1217
1497
  reason: string;
1218
1498
  message: string;
1219
- };
1499
+ } & UiRequestOperationAttribution;
1220
1500
  };
1221
1501
  [UI_REQUEST.REQUEST_BTC_HIGH_INDEX_CONFIRM]: {
1222
1502
  type: typeof UI_REQUEST.REQUEST_BTC_HIGH_INDEX_CONFIRM;
@@ -1224,14 +1504,14 @@ interface HardwareEventMap {
1224
1504
  vendor: string;
1225
1505
  path: string;
1226
1506
  accountIndex: number;
1227
- };
1507
+ } & UiRequestOperationAttribution;
1228
1508
  };
1229
1509
  [UI_REQUEST.REQUEST_INSTALL_APP]: {
1230
1510
  type: typeof UI_REQUEST.REQUEST_INSTALL_APP;
1231
1511
  payload: {
1232
1512
  vendor: string;
1233
1513
  appName: string;
1234
- };
1514
+ } & UiRequestOperationAttribution;
1235
1515
  };
1236
1516
  [UI_REQUEST.REQUEST_TREZOR_THP_PAIRING]: {
1237
1517
  type: typeof UI_REQUEST.REQUEST_TREZOR_THP_PAIRING;
@@ -1240,11 +1520,11 @@ interface HardwareEventMap {
1240
1520
  availableMethods: number[];
1241
1521
  selectedMethod: number;
1242
1522
  nfcData?: string;
1243
- };
1523
+ } & UiRequestOperationAttribution;
1244
1524
  };
1245
1525
  [UI_REQUEST.CLOSE_UI_WINDOW]: {
1246
1526
  type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
1247
- payload: Record<string, never>;
1527
+ payload: UiRequestOperationAttribution;
1248
1528
  };
1249
1529
  [SDK.DEVICE_INTERACTION]: {
1250
1530
  type: typeof SDK.DEVICE_INTERACTION;
@@ -1271,16 +1551,23 @@ interface HardwareEventMap {
1271
1551
  connectId: string;
1272
1552
  };
1273
1553
  };
1554
+ [SDK.OPERATION_ENDED]: {
1555
+ type: typeof SDK.OPERATION_ENDED;
1556
+ payload: {
1557
+ operationId: string;
1558
+ reason: OperationEndReason;
1559
+ };
1560
+ };
1274
1561
  }
1275
1562
  interface IDeviceManagerMethods {
1276
- getFeatures?(connectId: string): Promise<Response<Record<string, unknown>>>;
1277
- deviceSettings?(connectId: string, params: TrezorDeviceSettingsParams): Promise<Response<Record<string, unknown>>>;
1278
- setBrightness?(connectId: string, params?: TrezorBrightnessParams): Promise<Response<Record<string, unknown>>>;
1279
- changePin?(connectId: string, params?: TrezorChangePinParams): Promise<Response<Record<string, unknown>>>;
1280
- wipeDevice?(connectId: string): Promise<Response<Record<string, unknown>>>;
1563
+ getFeatures?(connectId: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1564
+ deviceSettings?(connectId: string, params: TrezorDeviceSettingsParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1565
+ setBrightness?(connectId: string, params?: TrezorBrightnessParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1566
+ changePin?(connectId: string, params?: TrezorChangePinParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1567
+ wipeDevice?(connectId: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1281
1568
  authenticateDevice?(connectId: string, params: {
1282
1569
  challenge: string;
1283
- }): Promise<Response<Record<string, unknown>>>;
1570
+ }, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1284
1571
  }
1285
1572
  interface IWalletStateMethods {
1286
1573
  /**
@@ -1307,20 +1594,35 @@ interface IWalletStateMethods {
1307
1594
  * Optional: vendors without host-managed passphrase sessions (Ledger) omit
1308
1595
  * it. Implemented by `TrezorAdapter`.
1309
1596
  */
1310
- getPassphraseState?(connectId: string, passphraseState?: string): Promise<Response<string | null>>;
1597
+ getPassphraseState?(connectId: string, passphraseState?: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<string | null>>;
1311
1598
  }
1599
+ /**
1600
+ * `stops-waiting`: an on-device confirmation stays up until answered or timed out.
1601
+ * `interrupts-device`: the command on the wire is withdrawn. No vendor reports it, so hosts
1602
+ * should say "stopped waiting, answer on the device", not "cancelled".
1603
+ */
1604
+ type CancelCapability = 'interrupts-device' | 'stops-waiting';
1312
1605
  interface IHardwareWallet<TConfig = unknown> extends IEvmMethods, IBtcMethods, ISolMethods, ITronMethods, IDeviceManagerMethods, IWalletStateMethods {
1313
1606
  readonly vendor: string;
1314
1607
  readonly activeTransport: TransportType | null;
1608
+ /** What `cancel()` reaches on this vendor. Declared, never inferred. */
1609
+ readonly cancelCapability: CancelCapability;
1315
1610
  init(config: TConfig): Promise<void>;
1316
1611
  dispose(): Promise<void>;
1317
1612
  getAvailableTransports(): TransportType[];
1318
1613
  switchTransport(type: TransportType): Promise<void>;
1319
1614
  searchDevices(options?: SearchDevicesOptions): Promise<DeviceInfo[]>;
1320
- connectDevice(connectId: string): Promise<Response<string>>;
1321
- disconnectDevice(connectId: string): Promise<void>;
1615
+ /** Discover selectable hardware entries without claiming identified devices or wallets. */
1616
+ searchDeviceTargets(options?: SearchDevicesOptions): Promise<DeviceSearchTarget[]>;
1617
+ /** Connect or logically bind a selected search result and return a runtime-only operation id. */
1618
+ connectDevice(searchTargetId: string): Promise<Response<string>>;
1619
+ /** Device Manager rebind: verify the existing identity before replacing its BLE locator. */
1620
+ bindBleDevice?(params: BindBleDeviceParams): Promise<Response<string>>;
1621
+ /** Resolve and pin operation routing; the caller verifies wallet identity before business calls. */
1622
+ acquireOperation?(connectId: string, context: IHardwareConnectionContext): Promise<Response<string>>;
1623
+ /** Release a caller-owned operation. Disconnect events end matching operations automatically. */
1624
+ releaseOperation(operationId: string): Promise<void>;
1322
1625
  getDeviceInfo(connectId: string, deviceId: string): Promise<Response<DeviceInfo>>;
1323
- getSupportedChains(): ChainCapability[];
1324
1626
  /** Abort the in-flight call. Omit connectId to cancel whatever is active. */
1325
1627
  cancel(connectId?: string): void;
1326
1628
  allNetworkGetAddress(connectId: string, deviceId: string, params: AllNetworkGetAddressParams): Promise<Response<AllNetworkAddressResponse[]>>;
@@ -1357,6 +1659,11 @@ interface SearchDevicesOptions {
1357
1659
  * was discovered first.
1358
1660
  */
1359
1661
  waitForAllTransports?: boolean;
1662
+ /**
1663
+ * Restrict discovery to one transport. A virtual target (Keystone QR) must not start any wallet
1664
+ * interaction during discovery; `connectDevice()` resolves it.
1665
+ */
1666
+ transportType?: ConnectionType;
1360
1667
  }
1361
1668
 
1362
1669
  interface EvmGetAddressParams extends PassphraseStateAware {
@@ -1370,6 +1677,8 @@ interface EvmAddress {
1370
1677
  path: string;
1371
1678
  /** Device-reported secp256k1 public key; populated when the transport exposes it. */
1372
1679
  publicKey?: string;
1680
+ /** Set by air-gapped wallets (Keystone): the exported key this address derives from. */
1681
+ accountKey?: ExportedAccountKey;
1373
1682
  }
1374
1683
  interface EvmSignTxBaseParams extends PassphraseStateAware {
1375
1684
  path: string;
@@ -1480,6 +1789,11 @@ interface EvmSignTypedDataFull extends PassphraseStateAware {
1480
1789
  primaryType: string;
1481
1790
  message: Record<string, unknown>;
1482
1791
  };
1792
+ /**
1793
+ * The dApp's original EIP-712 JSON, byte for byte. Serializing vendors (Keystone) must prefer it:
1794
+ * re-stringifying `data` rewrites integers wider than 2^53 and exponent forms.
1795
+ */
1796
+ dataJson?: string;
1483
1797
  metamaskV4Compat?: boolean;
1484
1798
  showMessageHash?: boolean;
1485
1799
  /**
@@ -1518,6 +1832,33 @@ interface IEvmMethods {
1518
1832
  evmSignTypedData(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<EvmSignTypedDataParams>>): Promise<Response<EvmSignature>>;
1519
1833
  }
1520
1834
 
1835
+ /** Which `GET_VK` encoding the Ledger Zcash app should return. */
1836
+ type ZcashFullViewingKeyMode = 'ufvk' | 'orchardFvk';
1837
+ interface ZcashGetFullViewingKeyParams extends PassphraseStateAware {
1838
+ /** BIP44 account path `m/44'/133'/a'`; a deeper transparent path is accepted, only `a'` is used. */
1839
+ path: string;
1840
+ /** Default `ufvk`. */
1841
+ mode?: ZcashFullViewingKeyMode;
1842
+ }
1843
+ interface ZcashFullViewingKey {
1844
+ path: string;
1845
+ mode: ZcashFullViewingKeyMode;
1846
+ /** ZIP-316 bech32m UFVK string (mode `ufvk`). */
1847
+ ufvk?: string;
1848
+ /** 96-byte raw Orchard FVK as hex (mode `orchardFvk`). */
1849
+ orchardFvk?: string;
1850
+ }
1851
+ interface ZcashGetShieldedAddressParams extends PassphraseStateAware {
1852
+ /** Full 5-level transparent path `m/44'/133'/a'/0/i`; the Orchard path is derived from it. */
1853
+ path: string;
1854
+ showOnDevice?: boolean;
1855
+ }
1856
+ interface ZcashShieldedAddress {
1857
+ /** Unified address with a single Orchard receiver. */
1858
+ address: string;
1859
+ path: string;
1860
+ }
1861
+
1521
1862
  /**
1522
1863
  * Low-level device descriptor from Transport layer.
1523
1864
  * Represents a physical device detected by USB/BLE scanning.
@@ -1563,14 +1904,13 @@ interface DeviceDisconnectEvent {
1563
1904
  type DeviceChangeEvent = DeviceConnectEvent | DeviceDisconnectEvent;
1564
1905
 
1565
1906
  /**
1566
- * Pure FIFO job queue. Every enqueue chains onto the tail; jobs run one at
1567
- * a time across all devices. The queue is intentionally passive — it does
1568
- * NOT decide whether to interrupt or ask the user. Those are application-
1569
- * layer concerns owned by the caller (e.g. a UI button handler that wants
1570
- * to ask "device is busy, interrupt current?" before submitting). The
1571
- * queue exposes inspection (`getActiveJob`) and explicit cancellation
1572
- * (`cancelActive` / `cancelAll`) so callers can implement those policies
1573
- * synchronously, without racing against in-flight enqueues.
1907
+ * Serializes every device call and gives callers one handle to cancel them. Ordering is already
1908
+ * guaranteed by awaiting callers, so what this adds is an AbortController per job, a busy check
1909
+ * that rejects double-submits, and generation tracking so a job queued before a teardown doesn't
1910
+ * start after it; these races exist even for a sequential caller because cleanup is async.
1911
+ *
1912
+ * Interrupt-or-ask policy belongs to the caller; `getActiveJob()` is synchronous so a UI handler
1913
+ * can look, decide, and submit in one turn without racing an in-flight enqueue.
1574
1914
  */
1575
1915
  interface JobOptions {
1576
1916
  label?: string;
@@ -1582,10 +1922,15 @@ interface ActiveJobInfo {
1582
1922
  label?: string;
1583
1923
  startedAt: number;
1584
1924
  }
1925
+ interface CancelScopeHandle {
1926
+ signal: AbortSignal;
1927
+ release: () => void;
1928
+ }
1585
1929
  declare class DeviceJobQueue {
1586
1930
  private _tail;
1587
1931
  private _active;
1588
1932
  private readonly _jobs;
1933
+ private readonly _cancelScopes;
1589
1934
  /** Incremented on clear() so queued-but-not-yet-running jobs detect invalidation. */
1590
1935
  private _generation;
1591
1936
  private readonly _generationCancelReasons;
@@ -1594,21 +1939,64 @@ declare class DeviceJobQueue {
1594
1939
  * `deviceId` is a label only — used by inspection / cancellation routing.
1595
1940
  */
1596
1941
  enqueue<T>(deviceId: string, job: (signal: AbortSignal) => Promise<T>, options?: JobOptions): Promise<T>;
1597
- /** Cancel the active job. If `deviceId` is given, only cancels when it matches. */
1598
- cancelActive(deviceId?: string): boolean;
1599
- /** Force cancel the active job. `reason` becomes signal.reason. */
1600
- forceCancelActive(deviceId?: string, reason?: Error): boolean;
1601
- /** Cancel the active job (alias for callers that previously needed multi-device cancel). */
1602
- cancelAllActive(reason?: Error): void;
1603
- /** Cancel the active job and invalidate queued jobs that have not started. */
1942
+ /**
1943
+ * Holds a cancel across the gaps between a bundle's per-item jobs, when the queue is empty.
1944
+ * Callers must `release()` when the bundle ends.
1945
+ */
1946
+ createCancelScope(deviceId: string): CancelScopeHandle;
1947
+ /**
1948
+ * Cancels the running job only; `reason` becomes signal.reason. Adapters use
1949
+ * `cancelActiveAndPending`; this stays for a connector layer that stops only what is on the wire.
1950
+ */
1951
+ cancelActive(deviceId?: string, reason?: Error): boolean;
1952
+ /**
1953
+ * Cancels the active job and unstarted queued jobs; returns whether anything was reached. Only
1954
+ * `undefined` means everything: an empty key matches nothing instead of tearing the queue down.
1955
+ */
1604
1956
  cancelActiveAndPending(deviceId?: string, reason?: Error): boolean;
1605
1957
  /** Get info about the currently active job, or null if idle. */
1606
1958
  getActiveJob(deviceId?: string): ActiveJobInfo | null;
1607
- /** True if any job is currently running. */
1608
- isBusy(): boolean;
1609
1959
  clear(reason?: Error): void;
1610
1960
  }
1611
1961
 
1962
+ declare const HARDWARE_RUNTIME_ID_PREFIX = "hwk:runtime";
1963
+ /**
1964
+ * `search-target`: one device in one discovery snapshot, dead on the next search of that kind.
1965
+ * `link`: one open transport. `operation`: one business operation.
1966
+ */
1967
+ type HardwareRuntimeIdKind = 'operation' | 'search-target' | 'link';
1968
+ type HardwareRuntimeId = {
1969
+ kind: HardwareRuntimeIdKind;
1970
+ vendor: VendorType;
1971
+ };
1972
+ /** Runtime ids are opaque and must never be persisted as device identity. */
1973
+ declare function createHardwareOperationId(vendor: VendorType): string;
1974
+ /** Search targets are valid only for the adapter's current discovery snapshot. */
1975
+ declare function createHardwareSearchTargetId(vendor: VendorType): string;
1976
+ declare function createHardwareLinkId(vendor: VendorType): string;
1977
+ declare function hasHardwareRuntimeIdPrefix(value: unknown): value is string;
1978
+ declare function parseHardwareRuntimeId(value: unknown): HardwareRuntimeId | undefined;
1979
+ declare function isHardwareOperationId(value: unknown): value is string;
1980
+
1981
+ interface HardwareOperationTarget {
1982
+ /** Effective target accepted by existing adapter/connector call paths. */
1983
+ targetId: string | undefined;
1984
+ /** Present when this operation is pinned to a live operation. */
1985
+ operationId: string | undefined;
1986
+ }
1987
+ /**
1988
+ * Normalizes the transitional positional operation id and the canonical
1989
+ * common-params field. All vendors must reject conflicting bindings.
1990
+ */
1991
+ declare function resolveHardwareOperationTarget(positionalTargetId: string | null | undefined, commonOperationId: string | null | undefined, expectedVendor?: VendorType): Response<HardwareOperationTarget>;
1992
+ /** Narrow the connection-context fields of untyped call params. */
1993
+ declare function pickConnectionContext(params: {
1994
+ knownConnections?: unknown;
1995
+ extra?: unknown;
1996
+ allowDeviceSelection?: unknown;
1997
+ supportedTransports?: unknown;
1998
+ }): IHardwareConnectionContext;
1999
+
1612
2000
  /**
1613
2001
  * Minimal typed event emitter using Map<string, Set<listener>>.
1614
2002
  * Each adapter uses this for device events (connect, disconnect, pin, etc.).
@@ -1635,6 +2023,104 @@ declare class TypedEventEmitter<TMap extends Record<string, any> = Record<string
1635
2023
  listenerCount(event: string): number;
1636
2024
  }
1637
2025
 
2026
+ /** Serializable BLE transport data shared by Electron main and renderer runtimes. */
2027
+ interface ElectronBleDeviceInfo {
2028
+ id: string;
2029
+ name?: string;
2030
+ rssi?: number;
2031
+ advertisedServiceUuids?: string[];
2032
+ }
2033
+ /**
2034
+ * IPC-safe peripheral match: advertises one of `serviceUuids`, or its local name matches every
2035
+ * `namePatterns` entry (case-insensitive regex sources). The desktop noble-ble host treats this
2036
+ * as a hint only: its vendor allowlist decides, `serviceUuids` can only narrow it, and
2037
+ * `namePatterns` are never compiled.
2038
+ */
2039
+ interface ElectronBleMatch {
2040
+ serviceUuids?: string[];
2041
+ namePatterns?: string[];
2042
+ }
2043
+ interface ElectronBleScanOptions {
2044
+ /** Opaque partition key: results and connected devices never mix across it. */
2045
+ vendor?: string;
2046
+ match?: ElectronBleMatch;
2047
+ /** @deprecated Superseded by `match.serviceUuids`. */
2048
+ serviceUuids?: string[];
2049
+ durationMs?: number;
2050
+ }
2051
+ /** GATT profile plus the write framing this vendor's firmware expects. */
2052
+ interface ElectronBleConnectOptions {
2053
+ vendor: string;
2054
+ serviceUuid: string;
2055
+ writeUuid: string;
2056
+ notifyUuid: string;
2057
+ /**
2058
+ * `padded`: fixed `chunkSize` packets, last zero-filled (Trezor firmware drops short packets).
2059
+ * `raw`: the buffer as given, for self-length-framed protocols (Ledger).
2060
+ */
2061
+ write?: {
2062
+ mode: 'padded' | 'raw';
2063
+ chunkSize?: number;
2064
+ chunkDelayMs?: number;
2065
+ maxLength?: number;
2066
+ };
2067
+ }
2068
+ /** Native code handles GATT only; framing, identity checks and wallet calls stay in the SDK. */
2069
+ interface ElectronBleApi {
2070
+ scan(options?: ElectronBleScanOptions): Promise<ElectronBleDeviceInfo[]>;
2071
+ stopScan(vendor?: string): Promise<void>;
2072
+ connect(id: string, options?: ElectronBleConnectOptions): Promise<{
2073
+ id: string;
2074
+ name?: string;
2075
+ }>;
2076
+ disconnect(id: string): Promise<void>;
2077
+ subscribe(id: string): Promise<void>;
2078
+ unsubscribe(id: string): Promise<void>;
2079
+ write(id: string, hexData: string): Promise<void>;
2080
+ checkAvailability(): Promise<{
2081
+ available: boolean;
2082
+ state: string;
2083
+ initialized: boolean;
2084
+ }>;
2085
+ getDevice(id: string): Promise<ElectronBleDeviceInfo | null>;
2086
+ onNotification(handler: (id: string, hexData: string) => void): () => void;
2087
+ onDeviceDisconnected(handler: (id: string) => void): () => void;
2088
+ /** Abandon an in-flight connect in the main process. Optional for hosts that cannot cancel. */
2089
+ cancelPairing?(options?: {
2090
+ vendor: string;
2091
+ id?: string;
2092
+ }): Promise<void>;
2093
+ }
2094
+
2095
+ declare function emitDeviceBindingStatus(emitter: TypedEventEmitter<HardwareEventMap>, selectionRequestId: string, status: DeviceBindingStatus['status']): void;
2096
+ /**
2097
+ * A host refusal is reported, never thrown: the device is already connected, so a lost binding
2098
+ * is worth a warning and a retry, not failing the user's work.
2099
+ */
2100
+ type SaveDeviceBindingOutcome = {
2101
+ saved: true;
2102
+ } | {
2103
+ saved: false;
2104
+ reason: SaveDeviceBindingDeclineReason;
2105
+ };
2106
+ /** Persist a binding through the host. Only a user abort throws. */
2107
+ declare function requestSaveDeviceBinding(emitter: TypedEventEmitter<HardwareEventMap>, registry: UiRequestRegistry, binding: Omit<SaveDeviceBindingRequest, 'requestId'>, signal?: AbortSignal): Promise<SaveDeviceBindingOutcome>;
2108
+
2109
+ /** Discovery and selection share one owner; never connect until the last scan has drained. */
2110
+ declare function requestBleDeviceSelection({ emitter, registry, request, scan, signal, allowUsbFallback, pollIntervalMs, }: {
2111
+ emitter: TypedEventEmitter<HardwareEventMap>;
2112
+ registry: UiRequestRegistry;
2113
+ request: Omit<DeviceSelectionRequest, 'requestId' | 'scanning'>;
2114
+ scan: () => Promise<DeviceInfo[]>;
2115
+ signal: AbortSignal;
2116
+ /** The adapter must verify a returned USB candidate before dispatching any business call. */
2117
+ allowUsbFallback?: boolean;
2118
+ pollIntervalMs?: number;
2119
+ }): Promise<{
2120
+ device: DeviceInfo;
2121
+ requestId: string;
2122
+ }>;
2123
+
1638
2124
  /**
1639
2125
  * Compare two semver strings (e.g. "2.1.0" vs "2.3.1").
1640
2126
  * Returns -1 if a < b, 0 if equal, 1 if a > b.
@@ -1655,7 +2141,57 @@ declare function hexToBytes(hex: string): Uint8Array;
1655
2141
  /** Convert a Uint8Array to a hex string (no 0x prefix). */
1656
2142
  declare function bytesToHex(bytes: Uint8Array): string;
1657
2143
 
1658
- type DetectableHardwareVendor = 'onekey' | 'trezor' | 'ledger';
2144
+ /**
2145
+ * Walks CBOR from an untrusted source (a scanned QR code, a device reply) before a third-party
2146
+ * decoder sees it. Those decoders read past the end as zero and trust declared lengths, so one
2147
+ * indefinite-length header or a huge declared count exhausts memory. This walk accepts only
2148
+ * definite lengths that fit in the bytes actually present, bounded nesting, and no trailing bytes.
2149
+ */
2150
+ declare function assertBoundedCbor(input: Uint8Array, maxBytes?: number): void;
2151
+ /** Hex from an untrusted source, checked as such and then as bounded CBOR. */
2152
+ declare function boundedCborFromHex(hex: string, maxBytes?: number): Buffer;
2153
+
2154
+ interface PrepareSolanaOffchainMessageV1Params {
2155
+ message: Uint8Array;
2156
+ requiredSigners: readonly string[];
2157
+ }
2158
+ interface PreparedSolanaOffchainMessageV1 {
2159
+ messageText: string;
2160
+ requiredSigners: string[];
2161
+ serializedMessage: Uint8Array;
2162
+ }
2163
+ declare function prepareSolanaOffchainMessageV1({ message, requiredSigners, }: PrepareSolanaOffchainMessageV1Params): PreparedSolanaOffchainMessageV1;
2164
+
2165
+ type LogSummaryContext = {
2166
+ /** Method name from the options, or '' when none was given. */
2167
+ method: string;
2168
+ role: 'params' | 'result';
2169
+ };
2170
+ /**
2171
+ * Returns extra space-separated hints for a payload field (e.g. PSBT input/output counts), or
2172
+ * undefined to add nothing. `key` is normalized: lower-case with `_` and `-` removed. Hints are
2173
+ * appended verbatim, so they must not contain payload contents. A throwing describer is ignored.
2174
+ */
2175
+ type LogPayloadDescriber = (key: string, value: string | Uint8Array, context: LogSummaryContext) => string | undefined;
2176
+ type LogSummaryOptions = {
2177
+ /** Public or connector method name; enables chain-specific hints (EVM tx type). */
2178
+ method?: string;
2179
+ /** In results, transaction fields hold signed transactions rather than requests. */
2180
+ role?: 'params' | 'result';
2181
+ /** Chain-specific payload hints that need a decoder adapter-core does not ship. */
2182
+ describePayload?: LogPayloadDescriber;
2183
+ };
2184
+ /**
2185
+ * JSON-safe, log-safe summary of `value`. Never throws.
2186
+ *
2187
+ * Paths, chain ids, flags and error fields stay readable; payloads become
2188
+ * `<hex|str|json len=N sha256=16hex [hints]>`, addresses `first6…last4`, xpubs `xpub… len=N`,
2189
+ * public keys and chain codes `… len=N`, signatures `<signature len=N>` and secrets
2190
+ * `<redacted len=N>`.
2191
+ */
2192
+ declare function summarizeForLog(value: unknown, options?: LogSummaryOptions): unknown;
2193
+
2194
+ type DetectableHardwareVendor = 'onekey' | 'trezor' | 'ledger' | 'keystone';
1659
2195
  type HardwareDeviceIdentityInput = {
1660
2196
  name?: string | null;
1661
2197
  localName?: string | null;
@@ -1718,8 +2254,19 @@ type RunAllNetworkGetAddressOptions = {
1718
2254
  buildTopLevelFailure?: (response: AllNetworkAddressResponse, context: AllNetworkResponseContext) => Response<AllNetworkAddressResponse[]>;
1719
2255
  };
1720
2256
  declare function runAllNetworkGetAddress({ connectId, deviceId, params, getMethodChain, normalizeItem, buildUnsupportedNetworkResponse, callItem, attachIdentity, shouldAbortBundle, buildTopLevelFailure, }: RunAllNetworkGetAddressOptions): Promise<Response<AllNetworkAddressResponse[]>>;
2257
+ /** An SDK-dialog cancel or on-device reject ends the bundle; the user already answered "no". */
2258
+ declare function isUserRefusal(code: HardwareErrorCode | number | undefined): boolean;
2259
+ /**
2260
+ * The device or wallet could not be shown to be the one asked for: another wallet, a locked
2261
+ * device, a wrong PIN or passphrase. No later item may derive on it, and a PIN is not retried.
2262
+ */
2263
+ declare function isWalletSafetyFailure(code: HardwareErrorCode | number | undefined): boolean;
2264
+ /** The bundle's session is gone, so the remaining items have nothing to run against. */
2265
+ declare function isConnectionLost(code: HardwareErrorCode | number | undefined): boolean;
2266
+ /** UserAborted is a top-level abort code, so this ends the bundle. */
2267
+ declare function buildAllNetworkCancelledFailure<T>(signal: AbortSignal): Response<T>;
1721
2268
  declare function buildUnsupportedMethodResponse(item: AllNetworkAddressParams): AllNetworkAddressResponse;
1722
2269
 
1723
2270
  declare const DEVICE_CONNECT_RETRY_DELAY_MS = 1000;
1724
2271
 
1725
- export { ALL_NETWORK_METHOD_NAMES, type ActiveJobInfo, type AllNetworkAddressParams, type AllNetworkAddressResponse, type AllNetworkAddressResponsePayload, type AllNetworkAttachIdentityContext, type AllNetworkCallItemContext, type AllNetworkGetAddressParams, type AllNetworkMethodName, type AllNetworkResponseContext, type BtcAddress, type BtcGetAddressParams, type BtcGetPublicKeyParams, type BtcPaymentRequest, type BtcPaymentRequestMemo, 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 ConnectorCallResult, type ConnectorConfig, type ConnectorDevice, type ConnectorErrorParams, type ConnectorEventMap, type ConnectorEventType, type ConnectorSerializedError, type ConnectorSession, type ConnectorUiEvent, DEVICE, DEVICE_CONNECT_RETRY_DELAY_MS, DEVICE_EVENT, type DetectableHardwareVendor, type DeviceAuthenticityParams, type DeviceAuthenticityResult, 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 EvmEthereumDefinitions, type EvmGetAddressParams, type EvmPaymentRequest, type EvmPaymentRequestMemo, type EvmSignMsgParams, type EvmSignTxLedgerParams, type EvmSignTxParams, type EvmSignTxTrezorParams, type EvmSignTypedDataFull, type EvmSignTypedDataHash, type EvmSignTypedDataParams, type EvmSignature, type EvmSignedTx, type Failure, HARDWARE_METHOD_CATALOG, type HardwareDeviceIdentityInput, HardwareErrorCode, type HardwareEvent, type HardwareEventMap, type HardwareMethodMetadata, type HardwareMethodName, type HardwareUiEvent, type IBtcMethods, type ICommonCallParams, type IConnector, type IDeviceManagerMethods, type IEvmMethods, type IHardwareBridge, type IHardwareCallParams, type IHardwareCommonCallParams, type IHardwareWallet, type IPassphraseCallParams, type ISolMethods, type ITronMethods, type IWalletStateMethods, type JobOptions, type NullableCallArg, type PassphraseResponse, type PassphraseStateAware, QrDisplayData, type Response, type RunAllNetworkGetAddressOptions, SDK, type SdkEvent, type SearchDevicesOptions, type SolAddress, type SolGetAddressParams, type SolSignMsgParams, type SolSignTxParams, type SolSignature, type SolSignedTx, type Success, type TransportType, type TrezorBrightnessParams, type TrezorChangePinParams, type TrezorDeviceSettingsParams, type TrezorDisplayRotation, type TrezorSafetyCheckLevel, type TronAddress, type TronContract, type TronFreezeBalanceV2Contract, type TronGetAddressParams, type TronResource, type TronSignMsgParams, type TronSignTxParams, type TronSignature, type TronSignedTx, type TronTransferContract, type TronTriggerSmartContract, type TronUnfreezeBalanceV2Contract, type TronVote, type TronVoteWitnessContract, type TronWithdrawExpireUnfreezeContract, TypedEventEmitter, UI_REQUEST, type UiRequestEvent, UiResponseEvent, type VendorType, batchCall, buildUnsupportedMethodResponse, bytesToHex, compareSemver, createBridgedConnector, createCombinedConnector, deriveDeviceFingerprint, detectHardwareVendorFromDescriptor, ensure0x, failure, getAllNetworkMethodChain, getHardwareMethodMetadata, hexToBytes, isAllNetworkMethodName, isKnownNonTargetHardwareVendor, padHex64, rehydrateConnectorError, runAllNetworkGetAddress, serializeConnectorError, stripHex, success };
2272
+ export { ALL_NETWORK_METHOD_NAMES, type ActiveJobInfo, type AllNetworkAddressParams, type AllNetworkAddressResponse, type AllNetworkAddressResponsePayload, type AllNetworkAttachIdentityContext, type AllNetworkCallItemContext, type AllNetworkDeviceIdentity, type AllNetworkGetAddressParams, type AllNetworkMethodName, type AllNetworkResponseContext, type BindBleDeviceParams, type BtcAddress, type BtcGetAddressParams, type BtcGetPublicKeyParams, type BtcPaymentRequest, type BtcPaymentRequestMemo, type BtcPublicKey, type BtcRefTransaction, type BtcSignMsgParams, type BtcSignPsbtParams, type BtcSignTxParams, type BtcSignature, type BtcSignedPsbt, type BtcSignedTx, type BtcTxInput, type BtcTxOutput, CHAIN_FINGERPRINT_PATHS, type CancelCapability, type CancelScopeHandle, type ChainCapability, type ChainForFingerprint, type ConnectionType, type ConnectorCallResult, type ConnectorConfig, type ConnectorConnectTarget, type ConnectorDevice, type ConnectorErrorParams, type ConnectorEventMap, type ConnectorEventType, type ConnectorSearchDevicesOptions, type ConnectorSerializedError, type ConnectorSession, type ConnectorUiEvent, DEVICE, DEVICE_CONNECT_RETRY_DELAY_MS, DEVICE_EVENT, type DetectableHardwareVendor, type DeviceAuthenticityParams, type DeviceAuthenticityResult, type DeviceBindingStatus, type DeviceCapabilities, type DeviceChangeEvent, type DeviceConnectEvent, type DeviceDescriptor, type DeviceDisconnectEvent, type DeviceEvent, type DeviceEventListener, type DeviceInfo, DeviceJobQueue, type DeviceSearchTarget, type DeviceSelectionContext, type DeviceSelectionRequest, type DeviceTarget, EConnectorInteraction, type EIP712Domain, type ElectronBleApi, type ElectronBleConnectOptions, type ElectronBleDeviceInfo, type ElectronBleMatch, type ElectronBleScanOptions, type EvmAddress, type EvmEthereumDefinitions, type EvmGetAddressParams, type EvmPaymentRequest, type EvmPaymentRequestMemo, type EvmSignMsgParams, type EvmSignTxLedgerParams, type EvmSignTxParams, type EvmSignTxTrezorParams, type EvmSignTypedDataFull, type EvmSignTypedDataHash, type EvmSignTypedDataParams, type EvmSignature, type EvmSignedTx, ExportedAccountKey, type Failure, HARDWARE_METHOD_CATALOG, HARDWARE_RUNTIME_ID_PREFIX, type HardwareCallExtra, type HardwareDeviceIdentityInput, HardwareErrorCode, type HardwareEvent, type HardwareEventMap, type HardwareMethodMetadata, type HardwareMethodName, type HardwareOperation, type HardwareOperationTarget, type HardwareRuntimeId, type HardwareRuntimeIdKind, type HardwareUiEvent, HwkErrorOrigin, HwkRecoveryHint, type IBtcMethods, type ICommonCallParams, type IConnector, type IDeviceManagerMethods, type IDeviceManagerOperationContext, type IEvmMethods, type IHardwareBridge, type IHardwareCallParams, type IHardwareCommonCallParams, type IHardwareConnectionContext, type IHardwareWallet, type IPassphraseCallParams, type ISolMethods, type ITronMethods, type IWalletStateMethods, type JobOptions, type KnownDeviceConnection, type LogPayloadDescriber, type LogSummaryContext, type LogSummaryOptions, MISSING_BIP32_MASTER_FINGERPRINT, type NullableCallArg, OPERATION_DEFAULT_TTL_MS, type OperationEndReason, OperationRegistry, type PassphraseResponse, type PassphraseStateAware, type PrepareSolanaOffchainMessageV1Params, type PreparedSolanaOffchainMessageV1, QrDisplayData, type Response, type RunAllNetworkGetAddressOptions, SDK, SaveDeviceBindingDeclineReason, type SaveDeviceBindingRequest, type SdkEvent, type SearchDevicesOptions, type SearchTargetReusePolicy, type SolAddress, type SolGetAddressParams, type SolOffchainMessageV1Params, type SolSignMsgParams, type SolSignTxParams, type SolSignature, type SolSignedTx, type Success, type TransportType, type TrezorBrightnessParams, type TrezorChangePinParams, type TrezorDeviceSettingsParams, type TrezorDisplayRotation, type TrezorSafetyCheckLevel, type TronAddress, type TronContract, type TronFreezeBalanceV2Contract, type TronGetAddressParams, type TronResource, type TronSignMsgParams, type TronSignTxParams, type TronSignature, type TronSignedTx, type TronTransferContract, type TronTriggerSmartContract, type TronUnfreezeBalanceV2Contract, type TronVote, type TronVoteWitnessContract, type TronWithdrawExpireUnfreezeContract, TypedEventEmitter, UI_REQUEST, type UiRequestEvent, UiRequestOperationAttribution, UiRequestRegistry, UiResponseEvent, type VendorType, type WalletIdentity, type ZcashFullViewingKey, type ZcashFullViewingKeyMode, type ZcashGetFullViewingKeyParams, type ZcashGetShieldedAddressParams, type ZcashShieldedAddress, assertBoundedCbor, batchCall, boundedCborFromHex, buildAllNetworkCancelledFailure, buildUnsupportedMethodResponse, bytesToHex, canReplayHardwareMethodAfterTransportFailure, compareSemver, createBridgedConnector, createCombinedConnector, createHardwareLinkId, createHardwareOperationId, createHardwareSearchTargetId, deriveDeviceFingerprint, detectHardwareVendorFromDescriptor, emitDeviceBindingStatus, ensure0x, failure, getAllNetworkMethodChain, getHardwareMethodMetadata, hasHardwareRuntimeIdPrefix, hexToBytes, isAllNetworkMethodName, isConnectionLost, isHardwareOperationId, isKnownNonTargetHardwareVendor, isUserRefusal, isWalletSafetyFailure, padHex64, parseBip32MasterFingerprint, parseHardwareRuntimeId, parseWalletMasterFingerprint, pickConnectionContext, prepareSolanaOffchainMessageV1, rehydrateConnectorError, requestBleDeviceSelection, requestSaveDeviceBinding, resolveHardwareOperationTarget, resolveSearchTargetReusePolicy, runAllNetworkGetAddress, serializeConnectorError, stripHex, success, summarizeForLog, toPhysicalDeviceSearchTarget };