@onekeyfe/hwk-adapter-core 1.2.8-alpha.12 → 1.2.8-alpha.121

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-DB4JOPZO.mjs +74 -0
  2. package/dist/chunk-DB4JOPZO.mjs.map +1 -0
  3. package/dist/{chunk-BAGEFFFY.js → chunk-PY5FNLTS.js} +49 -13
  4. package/dist/chunk-PY5FNLTS.js.map +1 -0
  5. package/dist/{chunk-SZZF623R.js → chunk-UFNTICCX.js} +158 -55
  6. package/dist/chunk-UFNTICCX.js.map +1 -0
  7. package/dist/{chunk-YA4BWFTZ.mjs → chunk-V2OHL2JS.mjs} +158 -55
  8. package/dist/chunk-V2OHL2JS.mjs.map +1 -0
  9. package/dist/{chunk-U63HTLGJ.mjs → chunk-Y7NVGPPY.mjs} +48 -12
  10. package/dist/chunk-Y7NVGPPY.mjs.map +1 -0
  11. package/dist/chunk-YLCHSNXO.js +74 -0
  12. package/dist/chunk-YLCHSNXO.js.map +1 -0
  13. package/dist/errors-DednD9bG.d.mts +281 -0
  14. package/dist/errors-DednD9bG.d.ts +281 -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 +969 -401
  21. package/dist/index.d.ts +969 -401
  22. package/dist/index.js +1103 -87
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +1095 -79
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/{ui-events-Cb7haAeE.d.ts → ui-events-D_lCGgCk.d.mts} +80 -3
  27. package/dist/{ui-events-Cb7haAeE.d.mts → ui-events-D_lCGgCk.d.ts} +80 -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.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { HardwareErrorCode } from './errors.mjs';
2
- export { HwkError, IHwkErrorPayload, ORPHAN_ELIGIBLE_ERROR_CODES, createHwkError, enrichErrorMessage } from './errors.mjs';
3
- import { U as UiResponseEvent, a as UI_REQUEST, Q as QrDisplayData } from './ui-events-Cb7haAeE.mjs';
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.mjs';
1
+ import { H as HardwareErrorCode, a as HwkErrorOrigin, b as HwkRecoveryHint } from './errors-DednD9bG.mjs';
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-DednD9bG.mjs';
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-D_lCGgCk.mjs';
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-D_lCGgCk.mjs';
5
5
 
6
6
  interface Success<T> {
7
7
  success: true;
@@ -12,85 +12,46 @@ 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';
25
28
  /**
26
- * Device capabilities — describes what a specific device/connection
27
- * combination can or cannot do. Varies by vendor, model, and connection type.
28
- *
29
- * This enables business logic to check capabilities instead of hard-coding
30
- * vendor-specific conditions (e.g., `if (vendor === 'ledger')`).
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
31
36
  */
32
- interface DeviceCapabilities {
33
- /**
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.
40
- */
41
- persistentDeviceIdentity: boolean;
42
- }
43
- interface DeviceInfo {
44
- vendor: VendorType;
45
- /** Machine model id (e.g. "nanoX"). */
46
- model: string;
47
- /** Human-readable model name (e.g. "Ledger Nano X"). */
48
- modelName?: string;
49
- firmwareVersion: string;
50
- deviceId: string;
51
- connectId: string;
52
- label?: string;
53
- connectionType: ConnectionType;
54
- battery?: number;
55
- /** BLE signal strength (BLE only). */
56
- rssi?: number | null;
57
- /** BLE connectable flag (BLE only). */
58
- isConnectable?: boolean | null;
59
- /** USB serial number (USB only). */
60
- serialNumber?: string;
61
- /** Device capabilities — varies by vendor, model, and connection type */
62
- capabilities?: DeviceCapabilities;
63
- /**
64
- * Vendor-specific raw payload from the post-handshake `Features` (Trezor)
65
- * or device-info call. Populated by the connector with `{ transport,
66
- * descriptor, features }` so the app layer can read fields we haven't
67
- * promoted to the typed surface yet. Treat as informational — promote
68
- * any consumed field above.
69
- */
70
- raw?: Record<string, unknown>;
71
- }
72
- interface DeviceTarget {
73
- connectId: string;
74
- deviceId: string;
75
- }
76
-
37
+ declare const CHAIN_FINGERPRINT_PATHS: Record<ChainForFingerprint, string>;
38
+ type ChainForFingerprint = 'evm' | 'btc' | 'sol' | 'tron' | 'zcash';
77
39
  /**
78
- * Mixin for chain-operation params that can be pinned to a specific passphrase
79
- * wallet.
80
- *
81
- * Trezor-only. `passphraseState` is the wallet identity returned by
82
- * `getPassphraseState`: today this is the compressed public key derived at
83
- * `m/44'/0'/0'`, not the 4-byte master fingerprint. When present, the adapter
84
- * creates a fresh wallet session (THP application session, or v1 device
85
- * session) and verifies the derived state before issuing the call, so the
86
- * address/signature comes from the intended passphrase wallet.
87
- *
88
- * Ledger has no equivalent and ignores the field — it never reaches the
89
- * protobuf layer (the adapter strips it before forwarding to the connector).
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.
90
43
  */
91
- interface PassphraseStateAware {
92
- passphraseState?: string;
93
- }
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;
94
55
 
95
56
  /**
96
57
  * Minimal device info returned during discovery (searchDevices).
@@ -133,6 +94,15 @@ interface ConnectorSession {
133
94
  sessionId: string;
134
95
  deviceInfo: DeviceInfo;
135
96
  }
97
+ type ConnectorConnectTarget = {
98
+ type: 'default';
99
+ } | {
100
+ type: 'search-target';
101
+ searchTargetId: string;
102
+ } | {
103
+ type: 'expected-device-identity';
104
+ deviceIdentity: string;
105
+ };
136
106
  /**
137
107
  * Vendor-agnostic bag of extra error fields. Known keys are documented for
138
108
  * discoverability; the index signature keeps it open so any connector can
@@ -197,6 +167,8 @@ declare enum EConnectorInteraction {
197
167
  AppInstallProgress = "app-install-progress"
198
168
  }
199
169
  type ConnectorUiEvent = {
170
+ operationId?: string;
171
+ } & ({
200
172
  type: EConnectorInteraction.Searching;
201
173
  payload: {
202
174
  sessionId: string;
@@ -205,6 +177,7 @@ type ConnectorUiEvent = {
205
177
  type: EConnectorInteraction.ConfirmOpenApp;
206
178
  payload: {
207
179
  sessionId: string;
180
+ appName?: string;
208
181
  };
209
182
  } | {
210
183
  type: EConnectorInteraction.UnlockDevice;
@@ -228,7 +201,7 @@ type ConnectorUiEvent = {
228
201
  appName: string;
229
202
  progress: number;
230
203
  };
231
- };
204
+ });
232
205
  interface ConnectorEventMap {
233
206
  'device-connect': {
234
207
  device: ConnectorDevice;
@@ -245,6 +218,8 @@ interface ConnectorEventMap {
245
218
  connectId: string;
246
219
  deviceId?: string;
247
220
  credentials: Record<string, unknown>[];
221
+ /** Credentials the device rejected; a list kept for several devices drops these. */
222
+ removed?: Record<string, unknown>[];
248
223
  };
249
224
  'ui-request': {
250
225
  type: string;
@@ -253,12 +228,16 @@ interface ConnectorEventMap {
253
228
  'ui-event': ConnectorUiEvent;
254
229
  }
255
230
  interface ConnectorSearchDevicesOptions {
231
+ /** Select a child transport without waking/scanning the others. */
232
+ transportType?: ConnectionType;
256
233
  /**
257
234
  * Wait for every child transport in a fused connector. Default discovery can
258
235
  * return shortly after USB appears so BLE does not slow down USB flows;
259
236
  * binding pickers can opt in when they need BLE candidates too.
260
237
  */
261
238
  waitForAll?: boolean;
239
+ /** Availability probes must not invalidate user-selectable discovery targets. */
240
+ purpose?: 'selection' | 'availability';
262
241
  }
263
242
  interface ConnectorConfig {
264
243
  /**
@@ -273,8 +252,16 @@ interface ConnectorConfig {
273
252
  interface IConnector {
274
253
  /** Physical connection type this connector uses. Fixed at construction. */
275
254
  readonly connectionType: ConnectionType;
255
+ readonly availableTransports?: readonly ConnectionType[];
276
256
  searchDevices(options?: ConnectorSearchDevicesOptions): Promise<ConnectorDevice[]>;
277
- connect(deviceId?: string): Promise<ConnectorSession>;
257
+ connect(deviceId?: string, options?: {
258
+ transportType: ConnectionType;
259
+ }): Promise<ConnectorSession>;
260
+ /**
261
+ * Structured form for connectors where a discovery handle and a stable device identity are
262
+ * different concepts. The string form remains for bridge and legacy compatibility.
263
+ */
264
+ connectTarget?(target: ConnectorConnectTarget): Promise<ConnectorSession>;
278
265
  disconnect(sessionId: string): Promise<void>;
279
266
  call(sessionId: string, method: string, params: unknown): Promise<ConnectorCallResult>;
280
267
  cancel(sessionId: string): Promise<void>;
@@ -299,6 +286,9 @@ interface IHardwareBridge {
299
286
  connect(params: {
300
287
  vendor: VendorType;
301
288
  deviceId?: string;
289
+ options?: {
290
+ transportType: ConnectionType;
291
+ };
302
292
  }): Promise<ConnectorSession>;
303
293
  disconnect(params: {
304
294
  vendor: VendorType;
@@ -396,73 +386,87 @@ declare const DEVICE: {
396
386
  readonly TREZOR_THP_CREDENTIALS_CHANGED: "device-trezor-thp-credentials-changed";
397
387
  };
398
388
 
399
- interface BtcGetAddressParams extends PassphraseStateAware {
389
+ /**
390
+ * Mixin for chain-operation params that can be pinned to a specific passphrase
391
+ * wallet.
392
+ *
393
+ * Trezor-only. `passphraseState` is the wallet identity returned by
394
+ * `getPassphraseState`: today this is the compressed public key derived at
395
+ * `m/44'/0'/0'`, not the 4-byte master fingerprint. When present, the adapter
396
+ * creates a fresh wallet session (THP application session, or v1 device
397
+ * session) and verifies the derived state before issuing the call, so the
398
+ * address/signature comes from the intended passphrase wallet.
399
+ *
400
+ * Ledger has no equivalent and ignores the field — it never reaches the
401
+ * protobuf layer (the adapter strips it before forwarding to the connector).
402
+ */
403
+ interface PassphraseStateAware {
404
+ passphraseState?: string;
405
+ }
406
+
407
+ interface EvmGetAddressParams extends PassphraseStateAware {
400
408
  path: string;
401
- coin?: string;
402
409
  showOnDevice?: boolean;
403
- scriptType?: 'p2pkh' | 'p2sh' | 'p2wpkh' | 'p2wsh' | 'p2tr';
404
- addressIndex?: number;
405
- change?: boolean;
410
+ chainId?: number;
411
+ ethereumDefinitions?: EvmEthereumDefinitions;
406
412
  }
407
- interface BtcAddress {
413
+ interface EvmAddress {
408
414
  address: string;
409
415
  path: string;
416
+ /** Device-reported secp256k1 public key; populated when the transport exposes it. */
417
+ publicKey?: string;
418
+ /** Set by air-gapped wallets (Keystone): the exported key this address derives from. */
419
+ accountKey?: ExportedAccountKey;
410
420
  }
411
- interface BtcGetPublicKeyParams extends PassphraseStateAware {
412
- path: string;
413
- coin?: string;
414
- showOnDevice?: boolean;
415
- }
416
- interface BtcPublicKey {
417
- xpub: string;
418
- publicKey: string;
419
- /** Parent key fingerprint (BIP-32), not the master fingerprint. */
420
- fingerprint: number;
421
- chainCode: string;
421
+ interface EvmSignTxBaseParams extends PassphraseStateAware {
422
422
  path: string;
423
- depth: number;
423
+ chainId?: number;
424
424
  }
425
- interface BtcSignTxParams extends PassphraseStateAware {
426
- psbt?: string;
427
- inputs?: BtcTxInput[];
428
- outputs?: BtcTxOutput[];
429
- paymentRequests?: BtcPaymentRequest[];
430
- refTxs?: BtcRefTransaction[];
431
- coin: string;
432
- locktime?: number;
433
- version?: number;
434
- timestamp?: number;
435
- expiry?: number;
436
- versionGroupId?: number;
437
- branchId?: number;
438
- /** Account-level derivation path (e.g. "84'/0'/0'") for wallet template. */
439
- path?: string;
425
+ /** Ledger shape: the whole RLP-serialized tx (0x-prefixed or plain hex); structured fields forbidden. */
426
+ interface EvmSignTxLedgerParams extends EvmSignTxBaseParams {
427
+ serializedTx: string;
428
+ to?: never;
429
+ value?: never;
430
+ nonce?: never;
431
+ gasLimit?: never;
432
+ gasPrice?: never;
433
+ txType?: never;
434
+ maxFeePerGas?: never;
435
+ maxPriorityFeePerGas?: never;
436
+ accessList?: never;
437
+ data?: never;
438
+ paymentRequest?: never;
439
+ ethereumDefinitions?: never;
440
440
  }
441
- interface BtcTxInput {
442
- path: string;
443
- prevHash: string;
444
- prevIndex: number;
445
- amount: string;
446
- scriptType?: 'p2pkh' | 'p2sh' | 'p2wpkh' | 'p2wsh' | 'p2tr';
447
- sequence?: number;
448
- origHash?: string;
449
- origIndex?: number;
450
- scriptSig?: string;
451
- witness?: string;
452
- ownershipProof?: string;
453
- commitmentData?: string;
441
+ /** Trezor shape: structured EthereumSignTx protobuf fields; serializedTx forbidden. */
442
+ interface EvmSignTxTrezorParams extends EvmSignTxBaseParams {
443
+ serializedTx?: never;
444
+ /** Contract address or recipient. Optional for contract deployment transactions. */
445
+ to?: string;
446
+ value?: string;
447
+ nonce?: string;
448
+ gasLimit?: string;
449
+ gasPrice?: string;
450
+ txType?: number;
451
+ maxFeePerGas?: string;
452
+ maxPriorityFeePerGas?: string;
453
+ accessList?: Array<{
454
+ address: string;
455
+ storageKeys: string[];
456
+ }>;
457
+ data?: string;
458
+ paymentRequest?: EvmPaymentRequest;
459
+ ethereumDefinitions?: EvmEthereumDefinitions;
454
460
  }
455
- interface BtcTxOutput {
456
- address?: string;
457
- path?: string;
458
- opReturnData?: string;
459
- amount: string;
460
- scriptType?: 'p2pkh' | 'p2sh' | 'p2wpkh' | 'p2wsh' | 'p2tr';
461
- paymentReqIndex?: number;
462
- origHash?: string;
463
- origIndex?: number;
461
+ /** Mutually exclusive vendor shapes; each adapter narrows to its own. */
462
+ type EvmSignTxParams = EvmSignTxLedgerParams | EvmSignTxTrezorParams;
463
+ interface EvmEthereumDefinitions {
464
+ /** Trezor Ethereum network definition bytes as a hex string. */
465
+ encodedNetwork?: string;
466
+ /** Trezor Ethereum token definition bytes as a hex string. */
467
+ encodedToken?: string;
464
468
  }
465
- interface BtcPaymentRequestMemo {
469
+ interface EvmPaymentRequestMemo {
466
470
  textMemo?: {
467
471
  text: string;
468
472
  };
@@ -483,46 +487,224 @@ interface BtcPaymentRequestMemo {
483
487
  mac: string;
484
488
  };
485
489
  }
486
- interface BtcPaymentRequest {
490
+ interface EvmPaymentRequest {
487
491
  nonce?: string;
488
492
  recipientName: string;
489
- memos?: BtcPaymentRequestMemo[];
490
- /** Decimal string in satoshis/subunits; SDK encodes it as SLIP-24 uint64 LE hex. */
493
+ memos?: EvmPaymentRequestMemo[];
494
+ /** Decimal string in subunits; SDK encodes it as SLIP-24 uint256 LE hex. */
491
495
  amount?: string;
492
496
  signature: string;
493
497
  }
494
- interface BtcRefTransaction {
495
- hash: string;
496
- version: number;
497
- inputs: Array<{
498
- prevHash: string;
499
- prevIndex: number;
500
- script: string;
501
- sequence: number;
502
- }>;
503
- outputs: Array<{
504
- amount: string;
505
- scriptPubKey: string;
506
- }>;
507
- locktime: number;
508
- /** Original transaction inputs used by Trezor RBF verification (TXORIGINPUT). */
509
- origInputs?: BtcTxInput[];
510
- /** Original transaction outputs used by Trezor RBF verification (TXORIGOUTPUT). */
511
- origOutputs?: BtcTxOutput[];
512
- extraData?: string;
513
- timestamp?: number;
514
- expiry?: number;
515
- versionGroupId?: number;
516
- branchId?: number;
498
+ interface EvmSignedTx {
499
+ /** Recovery id as `0x`-prefixed hex string. */
500
+ v: string;
501
+ /** ECDSA `r` value as `0x`-prefixed, zero-padded 64-char hex string (32 bytes). */
502
+ r: string;
503
+ /** ECDSA `s` value as `0x`-prefixed, zero-padded 64-char hex string (32 bytes). */
504
+ s: string;
505
+ serializedTx?: string;
517
506
  }
518
- interface BtcSignedTx {
519
- serializedTx: string;
520
- /** Present when the wallet returns per-input sigs separately (e.g. Trezor). */
521
- signatures?: string[];
522
- txid?: string;
507
+ interface EvmSignMsgParams extends PassphraseStateAware {
508
+ path: string;
509
+ message: string;
510
+ chainId?: number;
511
+ hex?: boolean;
512
+ ethereumDefinitions?: EvmEthereumDefinitions;
523
513
  }
524
- interface BtcSignPsbtParams extends PassphraseStateAware {
525
- psbt: string;
514
+ type EvmSignTypedDataParams = EvmSignTypedDataFull | EvmSignTypedDataHash;
515
+ interface EvmSignTypedDataFull extends PassphraseStateAware {
516
+ path: string;
517
+ chainId?: number;
518
+ /** Defaults to `'full'` when omitted. */
519
+ mode?: 'full';
520
+ ethereumDefinitions?: EvmEthereumDefinitions;
521
+ data: {
522
+ domain: EIP712Domain;
523
+ types: Record<string, Array<{
524
+ name: string;
525
+ type: string;
526
+ }>>;
527
+ primaryType: string;
528
+ message: Record<string, unknown>;
529
+ };
530
+ /**
531
+ * The dApp's original EIP-712 JSON, byte for byte. Serializing vendors (Keystone) must prefer it:
532
+ * re-stringifying `data` rewrites integers wider than 2^53 and exponent forms.
533
+ */
534
+ dataJson?: string;
535
+ metamaskV4Compat?: boolean;
536
+ showMessageHash?: boolean;
537
+ /**
538
+ * Optional host-computed hashes. Core Trezor models still use full typed-data
539
+ * signing for display, while Trezor One can fall back to typed-hash signing
540
+ * when firmware cannot compute the hashes itself.
541
+ */
542
+ domainSeparatorHash?: string;
543
+ messageHash?: string;
544
+ }
545
+ interface EvmSignTypedDataHash extends PassphraseStateAware {
546
+ path: string;
547
+ chainId?: number;
548
+ mode: 'hash';
549
+ domainSeparatorHash: string;
550
+ messageHash: string;
551
+ ethereumDefinitions?: EvmEthereumDefinitions;
552
+ }
553
+ interface EIP712Domain {
554
+ name?: string;
555
+ version?: string;
556
+ chainId?: number;
557
+ verifyingContract?: string;
558
+ salt?: string;
559
+ [key: string]: unknown;
560
+ }
561
+ interface EvmSignature {
562
+ /** `0x`-prefixed hex string (r + s + v). */
563
+ signature: string;
564
+ address?: string;
565
+ }
566
+ interface IEvmMethods {
567
+ evmGetAddress(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<EvmGetAddressParams>>): Promise<Response<EvmAddress>>;
568
+ evmSignTransaction(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<EvmSignTxParams>>): Promise<Response<EvmSignedTx>>;
569
+ evmSignMessage(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<EvmSignMsgParams>>): Promise<Response<EvmSignature>>;
570
+ evmSignTypedData(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<EvmSignTypedDataParams>>): Promise<Response<EvmSignature>>;
571
+ }
572
+
573
+ interface BtcGetAddressParams extends PassphraseStateAware {
574
+ path: string;
575
+ coin?: string;
576
+ showOnDevice?: boolean;
577
+ /**
578
+ * Trezor only. Ledger and Keystone ignore it and derive the script of the path's purpose
579
+ * (44' P2PKH, 49' P2SH-P2WPKH, 84' P2WPKH, 86' P2TR; Keystone does not support 86' yet).
580
+ */
581
+ scriptType?: 'p2pkh' | 'p2sh' | 'p2wpkh' | 'p2wsh' | 'p2tr';
582
+ addressIndex?: number;
583
+ change?: boolean;
584
+ }
585
+ interface BtcAddress {
586
+ address: string;
587
+ path: string;
588
+ /** Set by air-gapped wallets (Keystone): the exported key this address derives from. */
589
+ accountKey?: ExportedAccountKey;
590
+ }
591
+ interface BtcGetPublicKeyParams extends PassphraseStateAware {
592
+ path: string;
593
+ coin?: string;
594
+ showOnDevice?: boolean;
595
+ }
596
+ interface BtcPublicKey {
597
+ xpub: string;
598
+ publicKey: string;
599
+ /** Parent key fingerprint (BIP-32), not the master fingerprint. */
600
+ fingerprint: number;
601
+ chainCode: string;
602
+ path: string;
603
+ depth: number;
604
+ /** Set by air-gapped wallets (Keystone): the exported key, for pinning by the host. */
605
+ accountKey?: ExportedAccountKey;
606
+ }
607
+ interface BtcSignTxParams extends PassphraseStateAware {
608
+ psbt?: string;
609
+ inputs?: BtcTxInput[];
610
+ outputs?: BtcTxOutput[];
611
+ paymentRequests?: BtcPaymentRequest[];
612
+ refTxs?: BtcRefTransaction[];
613
+ coin: string;
614
+ locktime?: number;
615
+ version?: number;
616
+ timestamp?: number;
617
+ expiry?: number;
618
+ versionGroupId?: number;
619
+ branchId?: number;
620
+ /** Account-level derivation path (e.g. "84'/0'/0'") for wallet template. */
621
+ path?: string;
622
+ }
623
+ interface BtcTxInput {
624
+ path: string;
625
+ prevHash: string;
626
+ prevIndex: number;
627
+ amount: string;
628
+ scriptType?: 'p2pkh' | 'p2sh' | 'p2wpkh' | 'p2wsh' | 'p2tr';
629
+ sequence?: number;
630
+ origHash?: string;
631
+ origIndex?: number;
632
+ scriptSig?: string;
633
+ witness?: string;
634
+ ownershipProof?: string;
635
+ commitmentData?: string;
636
+ }
637
+ interface BtcTxOutput {
638
+ address?: string;
639
+ path?: string;
640
+ opReturnData?: string;
641
+ amount: string;
642
+ scriptType?: 'p2pkh' | 'p2sh' | 'p2wpkh' | 'p2wsh' | 'p2tr';
643
+ paymentReqIndex?: number;
644
+ origHash?: string;
645
+ origIndex?: number;
646
+ }
647
+ interface BtcPaymentRequestMemo {
648
+ textMemo?: {
649
+ text: string;
650
+ };
651
+ textDetailsMemo?: {
652
+ title: string;
653
+ text: string;
654
+ };
655
+ refundMemo?: {
656
+ address: string;
657
+ addressN?: number[];
658
+ mac: string;
659
+ };
660
+ coinPurchaseMemo?: {
661
+ coinType: number;
662
+ amount: string;
663
+ address: string;
664
+ addressN?: number[];
665
+ mac: string;
666
+ };
667
+ }
668
+ interface BtcPaymentRequest {
669
+ nonce?: string;
670
+ recipientName: string;
671
+ memos?: BtcPaymentRequestMemo[];
672
+ /** Decimal string in satoshis/subunits; SDK encodes it as SLIP-24 uint64 LE hex. */
673
+ amount?: string;
674
+ signature: string;
675
+ }
676
+ interface BtcRefTransaction {
677
+ hash: string;
678
+ version: number;
679
+ inputs: Array<{
680
+ prevHash: string;
681
+ prevIndex: number;
682
+ script: string;
683
+ sequence: number;
684
+ }>;
685
+ outputs: Array<{
686
+ amount: string;
687
+ scriptPubKey: string;
688
+ }>;
689
+ locktime: number;
690
+ /** Original transaction inputs used by Trezor RBF verification (TXORIGINPUT). */
691
+ origInputs?: BtcTxInput[];
692
+ /** Original transaction outputs used by Trezor RBF verification (TXORIGOUTPUT). */
693
+ origOutputs?: BtcTxOutput[];
694
+ extraData?: string;
695
+ timestamp?: number;
696
+ expiry?: number;
697
+ versionGroupId?: number;
698
+ branchId?: number;
699
+ }
700
+ interface BtcSignedTx {
701
+ serializedTx: string;
702
+ /** Present when the wallet returns per-input sigs separately (e.g. Trezor). */
703
+ signatures?: string[];
704
+ txid?: string;
705
+ }
706
+ interface BtcSignPsbtParams extends PassphraseStateAware {
707
+ psbt: string;
526
708
  coin?: string;
527
709
  /** Account-level derivation path (e.g. "84'/0'/0'") for wallet template. */
528
710
  path?: string;
@@ -561,6 +743,8 @@ interface SolAddress {
561
743
  /** Base58-encoded Solana address — this is also the Ed25519 public key. */
562
744
  address: string;
563
745
  path: string;
746
+ /** Set by air-gapped wallets (Keystone): the exported key this address derives from. */
747
+ accountKey?: ExportedAccountKey;
564
748
  }
565
749
  interface SolSignTxParams extends PassphraseStateAware {
566
750
  path: string;
@@ -581,11 +765,21 @@ interface SolSignedTx {
581
765
  /** Hex-encoded Ed25519 signature (no 0x prefix) */
582
766
  signature: string;
583
767
  }
584
- interface SolSignMsgParams extends PassphraseStateAware {
768
+ interface SolSignMessageBaseParams extends PassphraseStateAware {
585
769
  path: string;
586
770
  /** Message bytes as hex string (no 0x prefix) */
587
771
  message: string;
588
772
  }
773
+ interface SolOffchainMessageV1Params {
774
+ /** Finalized Solana off-chain message format. */
775
+ messageVersion: 1;
776
+ /** Complete signer set as 32-byte hex public keys. */
777
+ requiredSigners: string[];
778
+ }
779
+ type SolSignMsgParams = SolSignMessageBaseParams & ({
780
+ messageVersion?: undefined;
781
+ requiredSigners?: undefined;
782
+ } | SolOffchainMessageV1Params);
589
783
  interface SolSignature {
590
784
  /** Hex-encoded Ed25519 signature (no 0x prefix) */
591
785
  signature: string;
@@ -604,6 +798,8 @@ interface TronAddress {
604
798
  /** Base58check-encoded TRON address (starts with 'T') */
605
799
  address: string;
606
800
  path: string;
801
+ /** Set by air-gapped wallets (Keystone): the exported key this address derives from. */
802
+ accountKey?: ExportedAccountKey;
607
803
  }
608
804
  /** TRON network resource, used by freeze/unfreeze contracts. */
609
805
  type TronResource = 'BANDWIDTH' | 'ENERGY';
@@ -712,6 +908,12 @@ interface TronSignMsgParams extends PassphraseStateAware {
712
908
  path: string;
713
909
  /** Message hex (no 0x prefix) */
714
910
  messageHex: string;
911
+ /**
912
+ * TRON message scheme: 'V1' = legacy signMessage (prefix + 32-byte hash),
913
+ * 'V2' = TIP-191 signMessageV2 (prefix + byte length + message). Adapters
914
+ * that only implement one scheme reject the other with MethodNotSupported.
915
+ */
916
+ messageType?: 'V1' | 'V2';
715
917
  }
716
918
  interface TronSignature {
717
919
  /** 65-byte hex-encoded signature (no 0x prefix) */
@@ -723,100 +925,167 @@ interface ITronMethods {
723
925
  tronSignMessage(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<TronSignMsgParams>>): Promise<Response<TronSignature>>;
724
926
  }
725
927
 
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
928
  /** Events generated by SDK internal detection (not from hardware directly). */
745
929
  declare const SDK: {
746
930
  readonly DEVICE_STUCK: "device-stuck";
747
931
  readonly DEVICE_UNRESPONSIVE: "device-unresponsive";
748
932
  readonly DEVICE_RECOVERED: "device-recovered";
749
933
  readonly DEVICE_INTERACTION: "device-interaction";
934
+ readonly OPERATION_ENDED: "operation-ended";
935
+ };
936
+
937
+ declare const OPERATION_DEFAULT_TTL_MS = 600000;
938
+ type OperationEndReason = 'explicit' | 'disconnect' | 'timeout' | 'runtime-reset';
939
+ type HardwareOperation = {
940
+ operationId: string;
941
+ connectId: string;
942
+ device: DeviceInfo;
943
+ /**
944
+ * The channel this operation runs on, set by the adapter that picked it. Never read it off
945
+ * `device`: a combined connector fills that snapshot with a nominal value.
946
+ */
947
+ connectionType: ConnectionType;
948
+ connectionKeys: string[];
949
+ };
950
+ type OperationRegistryOptions = {
951
+ vendor: VendorType;
952
+ ttlMs?: number;
953
+ onEnded?: (operation: HardwareOperation, reason: OperationEndReason) => void;
750
954
  };
955
+ /** Runtime-only association between a public operation id and one live target. */
956
+ declare class OperationRegistry {
957
+ private readonly _vendor;
958
+ private readonly _ttlMs;
959
+ private readonly _onEnded?;
960
+ private readonly _active;
961
+ private readonly _ended;
962
+ constructor(options: OperationRegistryOptions);
963
+ create(params: {
964
+ searchTargetId: string;
965
+ connectId: string;
966
+ device: DeviceInfo;
967
+ connectionType: ConnectionType;
968
+ connectionKeys?: string[];
969
+ }): HardwareOperation;
970
+ resolve(operationId: string): HardwareOperation;
971
+ /** Keep an operation alive while one device job is actively using it. */
972
+ retain(operationId: string): () => void;
973
+ /** Return a live operation without refreshing its TTL; ended and unknown ids give undefined. */
974
+ findActive(operationId: string): HardwareOperation | undefined;
975
+ /** Return active or tombstoned binding data without refreshing its TTL. */
976
+ find(operationId: string): HardwareOperation | undefined;
977
+ findActiveByConnectionKey(connectionKey: string): HardwareOperation | undefined;
978
+ /** Only an explicitly supplied operation job key owns the call's UI requests. */
979
+ findOperationIdByJobKey(jobKey: string | undefined): string | undefined;
980
+ /**
981
+ * End an operation on the caller's explicit release. Throws for an unknown id; returns undefined
982
+ * when it had already ended.
983
+ */
984
+ release(operationId: string): HardwareOperation | undefined;
985
+ end(operationId: string, reason: OperationEndReason): HardwareOperation | undefined;
986
+ endByConnectionKey(connectionKey: string, reason: OperationEndReason, exceptOperationId?: string): void;
987
+ endAll(reason: OperationEndReason, exceptOperationId?: string): void;
988
+ private _touch;
989
+ private _createTimer;
990
+ private _rememberEnded;
991
+ }
751
992
 
752
993
  type HardwareMethodMetadata = {
753
994
  chain: ChainForFingerprint;
754
995
  allNetwork: boolean;
996
+ /** Whether repeating the method after an ambiguous transport failure is safe. */
997
+ replayAfterTransportFailure: 'safe' | 'unsafe';
755
998
  };
756
999
  declare const HARDWARE_METHOD_CATALOG: {
757
1000
  readonly evmGetAddress: {
758
1001
  readonly chain: "evm";
759
1002
  readonly allNetwork: true;
1003
+ readonly replayAfterTransportFailure: "safe";
760
1004
  };
761
1005
  readonly evmSignTransaction: {
762
1006
  readonly chain: "evm";
763
1007
  readonly allNetwork: false;
1008
+ readonly replayAfterTransportFailure: "unsafe";
764
1009
  };
765
1010
  readonly evmSignMessage: {
766
1011
  readonly chain: "evm";
767
1012
  readonly allNetwork: false;
1013
+ readonly replayAfterTransportFailure: "unsafe";
768
1014
  };
769
1015
  readonly evmSignTypedData: {
770
1016
  readonly chain: "evm";
771
1017
  readonly allNetwork: false;
1018
+ readonly replayAfterTransportFailure: "unsafe";
772
1019
  };
773
1020
  readonly btcGetAddress: {
774
1021
  readonly chain: "btc";
775
1022
  readonly allNetwork: true;
1023
+ readonly replayAfterTransportFailure: "safe";
776
1024
  };
777
1025
  readonly btcGetPublicKey: {
778
1026
  readonly chain: "btc";
779
1027
  readonly allNetwork: true;
1028
+ readonly replayAfterTransportFailure: "safe";
780
1029
  };
781
1030
  readonly btcSignTransaction: {
782
1031
  readonly chain: "btc";
783
1032
  readonly allNetwork: false;
1033
+ readonly replayAfterTransportFailure: "unsafe";
784
1034
  };
785
1035
  readonly btcSignPsbt: {
786
1036
  readonly chain: "btc";
787
1037
  readonly allNetwork: false;
1038
+ readonly replayAfterTransportFailure: "unsafe";
788
1039
  };
789
1040
  readonly btcSignMessage: {
790
1041
  readonly chain: "btc";
791
1042
  readonly allNetwork: false;
1043
+ readonly replayAfterTransportFailure: "unsafe";
792
1044
  };
793
1045
  readonly btcGetMasterFingerprint: {
794
1046
  readonly chain: "btc";
795
1047
  readonly allNetwork: false;
1048
+ readonly replayAfterTransportFailure: "safe";
796
1049
  };
797
1050
  readonly solGetAddress: {
798
1051
  readonly chain: "sol";
799
1052
  readonly allNetwork: true;
1053
+ readonly replayAfterTransportFailure: "safe";
800
1054
  };
801
1055
  readonly solSignTransaction: {
802
1056
  readonly chain: "sol";
803
1057
  readonly allNetwork: false;
1058
+ readonly replayAfterTransportFailure: "unsafe";
804
1059
  };
805
1060
  readonly solSignMessage: {
806
1061
  readonly chain: "sol";
807
1062
  readonly allNetwork: false;
1063
+ readonly replayAfterTransportFailure: "unsafe";
808
1064
  };
809
1065
  readonly tronGetAddress: {
810
1066
  readonly chain: "tron";
811
1067
  readonly allNetwork: true;
1068
+ readonly replayAfterTransportFailure: "safe";
812
1069
  };
813
1070
  readonly tronSignTransaction: {
814
1071
  readonly chain: "tron";
815
1072
  readonly allNetwork: false;
1073
+ readonly replayAfterTransportFailure: "unsafe";
816
1074
  };
817
1075
  readonly tronSignMessage: {
818
1076
  readonly chain: "tron";
819
1077
  readonly allNetwork: false;
1078
+ readonly replayAfterTransportFailure: "unsafe";
1079
+ };
1080
+ readonly zcashGetFullViewingKey: {
1081
+ readonly chain: "zcash";
1082
+ readonly allNetwork: false;
1083
+ readonly replayAfterTransportFailure: "safe";
1084
+ };
1085
+ readonly zcashGetShieldedAddress: {
1086
+ readonly chain: "zcash";
1087
+ readonly allNetwork: false;
1088
+ readonly replayAfterTransportFailure: "safe";
820
1089
  };
821
1090
  };
822
1091
  type HardwareMethodName = keyof typeof HARDWARE_METHOD_CATALOG;
@@ -825,6 +1094,11 @@ type AllNetworkMethodName = {
825
1094
  }[HardwareMethodName];
826
1095
  declare const ALL_NETWORK_METHOD_NAMES: AllNetworkMethodName[];
827
1096
  declare function getHardwareMethodMetadata(method: string): HardwareMethodMetadata | undefined;
1097
+ /**
1098
+ * Conservative replay gate used only after a call may have reached hardware.
1099
+ * Unknown methods and device mutations are unsafe by default.
1100
+ */
1101
+ declare function canReplayHardwareMethodAfterTransportFailure(method: string): boolean;
828
1102
  declare function isAllNetworkMethodName(method: string): method is AllNetworkMethodName;
829
1103
  declare function getAllNetworkMethodChain(method: AllNetworkMethodName): ChainForFingerprint;
830
1104
 
@@ -837,13 +1111,14 @@ type HardwareUiEvent = Exclude<ConnectorUiEvent, {
837
1111
  type: EConnectorInteraction.AppInstallProgress;
838
1112
  }> | {
839
1113
  type: EConnectorInteraction.AppInstallProgress;
1114
+ operationId?: string;
840
1115
  payload: {
841
1116
  connectId: string;
842
1117
  appName: string;
843
1118
  progress: number;
844
1119
  };
845
1120
  };
846
- type ChainCapability = 'evm' | 'btc' | 'sol' | 'tron';
1121
+ type ChainCapability = 'evm' | 'btc' | 'sol' | 'tron' | 'zcash';
847
1122
  type TrezorDisplayRotation = 'North' | 'East' | 'South' | 'West';
848
1123
  type TrezorSafetyCheckLevel = 'Strict' | 'PromptAlways' | 'PromptTemporarily';
849
1124
  type TrezorDeviceSettingsParams = {
@@ -914,19 +1189,83 @@ type DeviceAuthenticityResult = {
914
1189
  };
915
1190
  };
916
1191
  };
1192
+ /** Persisted connection hints, never proof of device or wallet identity. */
1193
+ type KnownDeviceConnection = {
1194
+ transport: 'usb' | 'ble';
1195
+ connectId: string;
1196
+ } | {
1197
+ transport: 'qr';
1198
+ };
1199
+ /** Opaque host lookup identifiers. Never forward these to firmware or logs. */
1200
+ type HardwareCallExtra = Readonly<Record<string, string>>;
1201
+ interface IHardwareConnectionContext {
1202
+ knownConnections?: readonly KnownDeviceConnection[];
1203
+ extra?: HardwareCallExtra;
1204
+ /** False makes discovery fail instead of asking the user to select a new endpoint. */
1205
+ allowDeviceSelection?: boolean;
1206
+ /** Transports the host's model table allows; discovery never opens others. Omitted = any. */
1207
+ supportedTransports?: readonly ('usb' | 'ble')[];
1208
+ }
1209
+ type DeviceSelectionContext = {
1210
+ kind: 'select-device';
1211
+ transport: 'usb';
1212
+ reason: 'multiple-candidates';
1213
+ } | {
1214
+ kind: 'bind-connection';
1215
+ transport: 'ble';
1216
+ reason: 'missing-binding' | 'known-connection-unavailable' | 'manual-rebind';
1217
+ };
1218
+ interface DeviceSelectionRequest extends UiRequestOperationAttribution {
1219
+ devices: DeviceInfo[];
1220
+ /** Echo this in the `RECEIVE_SELECT_DEVICE` answer; an answer without it is ignored. */
1221
+ requestId: string;
1222
+ context: DeviceSelectionContext;
1223
+ extra?: HardwareCallExtra;
1224
+ /** Repeated snapshots with this requestId update one SDK-owned binding scan. */
1225
+ scanning?: boolean;
1226
+ bindingSessionId?: string;
1227
+ /** A candidate rejected by SDK identity verification in this binding session. */
1228
+ rejectedConnectId?: string;
1229
+ }
1230
+ /** The host must persist this endpoint before acknowledging. */
1231
+ interface SaveDeviceBindingRequest extends UiRequestOperationAttribution {
1232
+ requestId: string;
1233
+ selectionRequestId: string;
1234
+ connection: {
1235
+ transport: 'ble';
1236
+ connectId: string;
1237
+ };
1238
+ /** Omitted when the vendor binds the selected BLE endpoint without checking its wallet (Ledger). */
1239
+ identity?: Extract<WalletIdentity, {
1240
+ vendor: 'ledger' | 'trezor';
1241
+ }>;
1242
+ extra?: HardwareCallExtra;
1243
+ }
1244
+ type BindBleDeviceParams = Pick<SaveDeviceBindingRequest, 'identity' | 'extra'> & {
1245
+ /** Ledger: other recorded chains, tried in order only when the previous chain's app is missing. */
1246
+ fallbackIdentities?: Extract<WalletIdentity, {
1247
+ vendor: 'ledger';
1248
+ }>[];
1249
+ };
1250
+ interface DeviceBindingStatus {
1251
+ selectionRequestId: string;
1252
+ status: 'verifying' | 'saved' | 'failed' | 'cancelled';
1253
+ }
917
1254
  /**
918
1255
  * Cross-chain / cross-vendor options passed alongside any chain method's
919
1256
  * own params (the optional last argument). Holds operation-level switches
920
1257
  * that aren't specific to one chain. Vendor-specific options can be added
921
1258
  * as typed sub-fields here when a vendor actually needs them.
922
1259
  */
923
- interface ICommonCallParams {
1260
+ interface ICommonCallParams extends IHardwareConnectionContext {
924
1261
  /**
925
1262
  * When the required device app is missing, prompt the user (UI request)
926
1263
  * to install it, stream install progress, then retry the operation once.
927
1264
  * Off by default — preserves the plain "app not installed" failure.
928
1265
  */
929
1266
  autoInstallApp?: boolean;
1267
+ /** Runtime-only id from connectDevice(); when present, discovery and fallback are disabled. */
1268
+ operationId?: string;
930
1269
  }
931
1270
  type NullableCallArg<T> = T | null | undefined;
932
1271
  interface IPassphraseCallParams {
@@ -935,6 +1274,14 @@ interface IPassphraseCallParams {
935
1274
  }
936
1275
  type IHardwareCommonCallParams = ICommonCallParams & IPassphraseCallParams;
937
1276
  type IHardwareCallParams<T> = T & IHardwareCommonCallParams;
1277
+ /**
1278
+ * Runtime-only device-manager context, never forwarded to firmware. The expected identity lets an
1279
+ * adapter fail closed before replaying a read or mutation after a reconnect.
1280
+ */
1281
+ interface IDeviceManagerOperationContext extends IHardwareConnectionContext {
1282
+ operationId?: string;
1283
+ expectedDeviceIdentity?: WalletIdentity;
1284
+ }
938
1285
  interface AllNetworkAddressParams {
939
1286
  network: string;
940
1287
  path: string;
@@ -945,23 +1292,17 @@ interface AllNetworkAddressParams {
945
1292
  interface AllNetworkGetAddressParams extends IHardwareCommonCallParams {
946
1293
  bundle: AllNetworkAddressParams[];
947
1294
  }
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
- };
1295
+ type AllNetworkDeviceIdentity = WalletIdentity;
958
1296
  type AllNetworkAddressResponsePayload = Record<string, unknown> & {
1297
+ /** This account came from the user's explicit device-export scan. */
1298
+ accountExport?: boolean;
959
1299
  error?: string;
960
1300
  code?: HardwareErrorCode | number;
961
1301
  errorCode?: string | number;
962
1302
  connectId?: string;
963
1303
  deviceId?: string;
964
1304
  deviceIdentity?: AllNetworkDeviceIdentity;
1305
+ rootFingerprint?: number;
965
1306
  chainFingerprint?: string;
966
1307
  chainFingerprintChain?: ChainForFingerprint;
967
1308
  params?: Record<string, unknown>;
@@ -1002,6 +1343,7 @@ type DeviceEvent = {
1002
1343
  connectId: string;
1003
1344
  deviceId?: string;
1004
1345
  credentials: Record<string, unknown>[];
1346
+ removed?: Record<string, unknown>[];
1005
1347
  };
1006
1348
  };
1007
1349
  type UiRequestEvent = {
@@ -1010,46 +1352,50 @@ type UiRequestEvent = {
1010
1352
  device?: DeviceInfo;
1011
1353
  connectId?: string;
1012
1354
  type?: string;
1013
- };
1355
+ } & UiRequestOperationAttribution;
1014
1356
  } | {
1015
1357
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
1016
1358
  payload: {
1017
1359
  device: DeviceInfo;
1018
- };
1360
+ } & UiRequestOperationAttribution;
1019
1361
  } | {
1020
1362
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
1021
1363
  payload: {
1022
1364
  device: DeviceInfo;
1023
- };
1365
+ } & UiRequestOperationAttribution;
1024
1366
  } | {
1025
1367
  type: typeof UI_REQUEST.REQUEST_BUTTON;
1026
1368
  payload: {
1027
1369
  device: DeviceInfo;
1028
1370
  code?: string;
1029
- };
1371
+ } & UiRequestOperationAttribution;
1030
1372
  } | {
1031
1373
  type: typeof UI_REQUEST.REQUEST_QR_DISPLAY;
1032
1374
  payload: {
1033
1375
  device: DeviceInfo;
1034
1376
  data: QrDisplayData;
1035
- };
1377
+ } & UiRequestOperationAttribution;
1036
1378
  } | {
1037
1379
  type: typeof UI_REQUEST.REQUEST_QR_SCAN;
1038
1380
  payload: {
1039
1381
  device: DeviceInfo;
1040
- };
1382
+ } & UiRequestOperationAttribution;
1041
1383
  } | {
1042
1384
  type: typeof UI_REQUEST.REQUEST_DEVICE_PERMISSION;
1043
1385
  payload: {
1044
1386
  transportType: TransportType;
1045
1387
  connectId?: string;
1046
1388
  deviceId?: string;
1047
- };
1389
+ } & UiRequestOperationAttribution;
1048
1390
  } | {
1049
1391
  type: typeof UI_REQUEST.REQUEST_SELECT_DEVICE;
1050
- payload: {
1051
- devices: DeviceInfo[];
1052
- };
1392
+ payload: DeviceSelectionRequest;
1393
+ } | {
1394
+ type: typeof UI_REQUEST.REQUEST_SAVE_DEVICE_BINDING;
1395
+ payload: SaveDeviceBindingRequest;
1396
+ } | {
1397
+ type: typeof UI_REQUEST.DEVICE_BINDING_STATUS;
1398
+ payload: DeviceBindingStatus;
1053
1399
  } | {
1054
1400
  type: typeof UI_REQUEST.REQUEST_DEVICE_CONNECT;
1055
1401
  payload: {
@@ -1069,13 +1415,19 @@ type UiRequestEvent = {
1069
1415
  * isn't recognized.
1070
1416
  */
1071
1417
  message: string;
1072
- };
1418
+ } & UiRequestOperationAttribution;
1073
1419
  } | {
1074
1420
  type: typeof UI_REQUEST.REQUEST_INSTALL_APP;
1075
1421
  payload: {
1076
1422
  vendor: string;
1077
1423
  appName: string;
1078
- };
1424
+ } & UiRequestOperationAttribution;
1425
+ } | {
1426
+ type: typeof UI_REQUEST.REQUEST_QR_FALLBACK_CONFIRM;
1427
+ payload: {
1428
+ vendor: string;
1429
+ requestId: string;
1430
+ } & UiRequestOperationAttribution;
1079
1431
  } | {
1080
1432
  type: typeof UI_REQUEST.REQUEST_TREZOR_THP_PAIRING;
1081
1433
  payload: {
@@ -1083,10 +1435,10 @@ type UiRequestEvent = {
1083
1435
  availableMethods: number[];
1084
1436
  selectedMethod: number;
1085
1437
  nfcData?: string;
1086
- };
1438
+ } & UiRequestOperationAttribution;
1087
1439
  } | {
1088
1440
  type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
1089
- payload: Record<string, never>;
1441
+ payload: UiRequestOperationAttribution;
1090
1442
  };
1091
1443
  type SdkEvent = {
1092
1444
  type: typeof SDK.DEVICE_INTERACTION;
@@ -1109,6 +1461,12 @@ type SdkEvent = {
1109
1461
  payload: {
1110
1462
  connectId: string;
1111
1463
  };
1464
+ } | {
1465
+ type: typeof SDK.OPERATION_ENDED;
1466
+ payload: {
1467
+ operationId: string;
1468
+ reason: OperationEndReason;
1469
+ };
1112
1470
  };
1113
1471
  type HardwareEvent = DeviceEvent | UiRequestEvent | SdkEvent | HardwareUiEvent;
1114
1472
  type DeviceEventListener = (event: HardwareEvent) => void;
@@ -1119,6 +1477,14 @@ type DeviceEventListener = (event: HardwareEvent) => void;
1119
1477
  * and the value is the narrowed event object the listener will receive.
1120
1478
  */
1121
1479
  interface HardwareEventMap {
1480
+ [UI_REQUEST.DEVICE_BINDING_STATUS]: {
1481
+ type: typeof UI_REQUEST.DEVICE_BINDING_STATUS;
1482
+ payload: DeviceBindingStatus;
1483
+ };
1484
+ [UI_REQUEST.REQUEST_SAVE_DEVICE_BINDING]: {
1485
+ type: typeof UI_REQUEST.REQUEST_SAVE_DEVICE_BINDING;
1486
+ payload: SaveDeviceBindingRequest;
1487
+ };
1122
1488
  'ui-event': HardwareUiEvent;
1123
1489
  [DEVICE.CONNECT]: {
1124
1490
  type: typeof DEVICE.CONNECT;
@@ -1151,6 +1517,8 @@ interface HardwareEventMap {
1151
1517
  connectId: string;
1152
1518
  deviceId?: string;
1153
1519
  credentials: Record<string, unknown>[];
1520
+ /** Credentials the device rejected; a list kept for several devices drops these. */
1521
+ removed?: Record<string, unknown>[];
1154
1522
  };
1155
1523
  };
1156
1524
  [UI_REQUEST.REQUEST_PIN]: {
@@ -1159,7 +1527,7 @@ interface HardwareEventMap {
1159
1527
  device?: DeviceInfo;
1160
1528
  connectId?: string;
1161
1529
  type?: string;
1162
- };
1530
+ } & UiRequestOperationAttribution;
1163
1531
  };
1164
1532
  [UI_REQUEST.REQUEST_PASSPHRASE]: {
1165
1533
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
@@ -1168,33 +1536,33 @@ interface HardwareEventMap {
1168
1536
  connectId?: string;
1169
1537
  passphraseState?: string;
1170
1538
  useEmptyPassphrase?: boolean;
1171
- };
1539
+ } & UiRequestOperationAttribution;
1172
1540
  };
1173
1541
  [UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE]: {
1174
1542
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
1175
1543
  payload: {
1176
1544
  device: DeviceInfo;
1177
- };
1545
+ } & UiRequestOperationAttribution;
1178
1546
  };
1179
1547
  [UI_REQUEST.REQUEST_BUTTON]: {
1180
1548
  type: typeof UI_REQUEST.REQUEST_BUTTON;
1181
1549
  payload: {
1182
1550
  device: DeviceInfo;
1183
1551
  code?: string;
1184
- };
1552
+ } & UiRequestOperationAttribution;
1185
1553
  };
1186
1554
  [UI_REQUEST.REQUEST_QR_DISPLAY]: {
1187
1555
  type: typeof UI_REQUEST.REQUEST_QR_DISPLAY;
1188
1556
  payload: {
1189
1557
  device: DeviceInfo;
1190
1558
  data: QrDisplayData;
1191
- };
1559
+ } & UiRequestOperationAttribution;
1192
1560
  };
1193
1561
  [UI_REQUEST.REQUEST_QR_SCAN]: {
1194
1562
  type: typeof UI_REQUEST.REQUEST_QR_SCAN;
1195
1563
  payload: {
1196
1564
  device: DeviceInfo;
1197
- };
1565
+ } & UiRequestOperationAttribution;
1198
1566
  };
1199
1567
  [UI_REQUEST.REQUEST_DEVICE_PERMISSION]: {
1200
1568
  type: typeof UI_REQUEST.REQUEST_DEVICE_PERMISSION;
@@ -1202,13 +1570,11 @@ interface HardwareEventMap {
1202
1570
  transportType: TransportType;
1203
1571
  connectId?: string;
1204
1572
  deviceId?: string;
1205
- };
1573
+ } & UiRequestOperationAttribution;
1206
1574
  };
1207
1575
  [UI_REQUEST.REQUEST_SELECT_DEVICE]: {
1208
1576
  type: typeof UI_REQUEST.REQUEST_SELECT_DEVICE;
1209
- payload: {
1210
- devices: DeviceInfo[];
1211
- };
1577
+ payload: DeviceSelectionRequest;
1212
1578
  };
1213
1579
  [UI_REQUEST.REQUEST_DEVICE_CONNECT]: {
1214
1580
  type: typeof UI_REQUEST.REQUEST_DEVICE_CONNECT;
@@ -1216,7 +1582,7 @@ interface HardwareEventMap {
1216
1582
  vendor: string;
1217
1583
  reason: string;
1218
1584
  message: string;
1219
- };
1585
+ } & UiRequestOperationAttribution;
1220
1586
  };
1221
1587
  [UI_REQUEST.REQUEST_BTC_HIGH_INDEX_CONFIRM]: {
1222
1588
  type: typeof UI_REQUEST.REQUEST_BTC_HIGH_INDEX_CONFIRM;
@@ -1224,14 +1590,21 @@ interface HardwareEventMap {
1224
1590
  vendor: string;
1225
1591
  path: string;
1226
1592
  accountIndex: number;
1227
- };
1593
+ } & UiRequestOperationAttribution;
1228
1594
  };
1229
1595
  [UI_REQUEST.REQUEST_INSTALL_APP]: {
1230
1596
  type: typeof UI_REQUEST.REQUEST_INSTALL_APP;
1231
1597
  payload: {
1232
1598
  vendor: string;
1233
1599
  appName: string;
1234
- };
1600
+ } & UiRequestOperationAttribution;
1601
+ };
1602
+ [UI_REQUEST.REQUEST_QR_FALLBACK_CONFIRM]: {
1603
+ type: typeof UI_REQUEST.REQUEST_QR_FALLBACK_CONFIRM;
1604
+ payload: {
1605
+ vendor: string;
1606
+ requestId: string;
1607
+ } & UiRequestOperationAttribution;
1235
1608
  };
1236
1609
  [UI_REQUEST.REQUEST_TREZOR_THP_PAIRING]: {
1237
1610
  type: typeof UI_REQUEST.REQUEST_TREZOR_THP_PAIRING;
@@ -1240,11 +1613,11 @@ interface HardwareEventMap {
1240
1613
  availableMethods: number[];
1241
1614
  selectedMethod: number;
1242
1615
  nfcData?: string;
1243
- };
1616
+ } & UiRequestOperationAttribution;
1244
1617
  };
1245
1618
  [UI_REQUEST.CLOSE_UI_WINDOW]: {
1246
1619
  type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
1247
- payload: Record<string, never>;
1620
+ payload: UiRequestOperationAttribution;
1248
1621
  };
1249
1622
  [SDK.DEVICE_INTERACTION]: {
1250
1623
  type: typeof SDK.DEVICE_INTERACTION;
@@ -1271,16 +1644,23 @@ interface HardwareEventMap {
1271
1644
  connectId: string;
1272
1645
  };
1273
1646
  };
1647
+ [SDK.OPERATION_ENDED]: {
1648
+ type: typeof SDK.OPERATION_ENDED;
1649
+ payload: {
1650
+ operationId: string;
1651
+ reason: OperationEndReason;
1652
+ };
1653
+ };
1274
1654
  }
1275
1655
  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>>>;
1656
+ getFeatures?(connectId: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1657
+ deviceSettings?(connectId: string, params: TrezorDeviceSettingsParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1658
+ setBrightness?(connectId: string, params?: TrezorBrightnessParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1659
+ changePin?(connectId: string, params?: TrezorChangePinParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1660
+ wipeDevice?(connectId: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1281
1661
  authenticateDevice?(connectId: string, params: {
1282
1662
  challenge: string;
1283
- }): Promise<Response<Record<string, unknown>>>;
1663
+ }, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
1284
1664
  }
1285
1665
  interface IWalletStateMethods {
1286
1666
  /**
@@ -1307,20 +1687,35 @@ interface IWalletStateMethods {
1307
1687
  * Optional: vendors without host-managed passphrase sessions (Ledger) omit
1308
1688
  * it. Implemented by `TrezorAdapter`.
1309
1689
  */
1310
- getPassphraseState?(connectId: string, passphraseState?: string): Promise<Response<string | null>>;
1690
+ getPassphraseState?(connectId: string, passphraseState?: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<string | null>>;
1311
1691
  }
1692
+ /**
1693
+ * `stops-waiting`: an on-device confirmation stays up until answered or timed out.
1694
+ * `interrupts-device`: the command on the wire is withdrawn. No vendor reports it, so hosts
1695
+ * should say "stopped waiting, answer on the device", not "cancelled".
1696
+ */
1697
+ type CancelCapability = 'interrupts-device' | 'stops-waiting';
1312
1698
  interface IHardwareWallet<TConfig = unknown> extends IEvmMethods, IBtcMethods, ISolMethods, ITronMethods, IDeviceManagerMethods, IWalletStateMethods {
1313
1699
  readonly vendor: string;
1314
1700
  readonly activeTransport: TransportType | null;
1701
+ /** What `cancel()` reaches on this vendor. Declared, never inferred. */
1702
+ readonly cancelCapability: CancelCapability;
1315
1703
  init(config: TConfig): Promise<void>;
1316
1704
  dispose(): Promise<void>;
1317
1705
  getAvailableTransports(): TransportType[];
1318
1706
  switchTransport(type: TransportType): Promise<void>;
1319
1707
  searchDevices(options?: SearchDevicesOptions): Promise<DeviceInfo[]>;
1320
- connectDevice(connectId: string): Promise<Response<string>>;
1321
- disconnectDevice(connectId: string): Promise<void>;
1708
+ /** Discover selectable hardware entries without claiming identified devices or wallets. */
1709
+ searchDeviceTargets(options?: SearchDevicesOptions): Promise<DeviceSearchTarget[]>;
1710
+ /** Connect or logically bind a selected search result and return a runtime-only operation id. */
1711
+ connectDevice(searchTargetId: string): Promise<Response<string>>;
1712
+ /** Device Manager rebind: verify the existing identity before replacing its BLE locator. */
1713
+ bindBleDevice?(params: BindBleDeviceParams): Promise<Response<string>>;
1714
+ /** Resolve and pin operation routing; the caller verifies wallet identity before business calls. */
1715
+ acquireOperation?(connectId: string, context: IHardwareConnectionContext): Promise<Response<string>>;
1716
+ /** Release a caller-owned operation. Disconnect events end matching operations automatically. */
1717
+ releaseOperation(operationId: string): Promise<void>;
1322
1718
  getDeviceInfo(connectId: string, deviceId: string): Promise<Response<DeviceInfo>>;
1323
- getSupportedChains(): ChainCapability[];
1324
1719
  /** Abort the in-flight call. Omit connectId to cancel whatever is active. */
1325
1720
  cancel(connectId?: string): void;
1326
1721
  allNetworkGetAddress(connectId: string, deviceId: string, params: AllNetworkGetAddressParams): Promise<Response<AllNetworkAddressResponse[]>>;
@@ -1357,165 +1752,132 @@ interface SearchDevicesOptions {
1357
1752
  * was discovered first.
1358
1753
  */
1359
1754
  waitForAllTransports?: boolean;
1755
+ /**
1756
+ * Restrict discovery to one transport. A virtual target (Keystone QR) must not start any wallet
1757
+ * interaction during discovery; `connectDevice()` resolves it.
1758
+ */
1759
+ transportType?: ConnectionType;
1360
1760
  }
1361
1761
 
1362
- interface EvmGetAddressParams extends PassphraseStateAware {
1363
- path: string;
1364
- showOnDevice?: boolean;
1365
- chainId?: number;
1366
- ethereumDefinitions?: EvmEthereumDefinitions;
1367
- }
1368
- interface EvmAddress {
1369
- address: string;
1370
- path: string;
1371
- /** Device-reported secp256k1 public key; populated when the transport exposes it. */
1372
- publicKey?: string;
1373
- }
1374
- interface EvmSignTxBaseParams extends PassphraseStateAware {
1375
- path: string;
1376
- chainId?: number;
1377
- }
1378
- /** Ledger shape: the whole RLP-serialized tx (0x-prefixed or plain hex); structured fields forbidden. */
1379
- interface EvmSignTxLedgerParams extends EvmSignTxBaseParams {
1380
- serializedTx: string;
1381
- to?: never;
1382
- value?: never;
1383
- nonce?: never;
1384
- gasLimit?: never;
1385
- gasPrice?: never;
1386
- txType?: never;
1387
- maxFeePerGas?: never;
1388
- maxPriorityFeePerGas?: never;
1389
- accessList?: never;
1390
- data?: never;
1391
- paymentRequest?: never;
1392
- ethereumDefinitions?: never;
1393
- }
1394
- /** Trezor shape: structured EthereumSignTx protobuf fields; serializedTx forbidden. */
1395
- interface EvmSignTxTrezorParams extends EvmSignTxBaseParams {
1396
- serializedTx?: never;
1397
- /** Contract address or recipient. Optional for contract deployment transactions. */
1398
- to?: string;
1399
- value?: string;
1400
- nonce?: string;
1401
- gasLimit?: string;
1402
- gasPrice?: string;
1403
- txType?: number;
1404
- maxFeePerGas?: string;
1405
- maxPriorityFeePerGas?: string;
1406
- accessList?: Array<{
1407
- address: string;
1408
- storageKeys: string[];
1409
- }>;
1410
- data?: string;
1411
- paymentRequest?: EvmPaymentRequest;
1412
- ethereumDefinitions?: EvmEthereumDefinitions;
1413
- }
1414
- /** Mutually exclusive vendor shapes; each adapter narrows to its own. */
1415
- type EvmSignTxParams = EvmSignTxLedgerParams | EvmSignTxTrezorParams;
1416
- interface EvmEthereumDefinitions {
1417
- /** Trezor Ethereum network definition bytes as a hex string. */
1418
- encodedNetwork?: string;
1419
- /** Trezor Ethereum token definition bytes as a hex string. */
1420
- encodedToken?: string;
1762
+ type VendorType = 'trezor' | 'ledger' | 'keystone';
1763
+ /** 'qr' is a virtual channel: UR payloads travel via app-rendered/scanned QR codes. */
1764
+ type ConnectionType = 'usb' | 'ble' | 'qr';
1765
+ type TransportType = 'usb' | 'ble' | 'hid' | 'bridge' | 'qr';
1766
+ /**
1767
+ * Device capabilities — describes what a specific device/connection
1768
+ * combination can or cannot do. Varies by vendor, model, and connection type.
1769
+ *
1770
+ * This enables business logic to check capabilities instead of hard-coding
1771
+ * vendor-specific conditions (e.g., `if (vendor === 'ledger')`).
1772
+ */
1773
+ interface DeviceCapabilities {
1774
+ /** Chains usable through this adapter on the connected firmware; absent means not advertised. */
1775
+ supportedChains?: ChainCapability[];
1776
+ /**
1777
+ * Whether the discovery handle can be reused to reconnect; `false` requires rediscovery. Says
1778
+ * nothing about identity (Trezor BLE is false yet its device_id is stable); verify it separately.
1779
+ */
1780
+ persistentDeviceIdentity: boolean;
1421
1781
  }
1422
- interface EvmPaymentRequestMemo {
1423
- textMemo?: {
1424
- text: string;
1425
- };
1426
- textDetailsMemo?: {
1427
- title: string;
1428
- text: string;
1429
- };
1430
- refundMemo?: {
1431
- address: string;
1432
- addressN?: number[];
1433
- mac: string;
1434
- };
1435
- coinPurchaseMemo?: {
1436
- coinType: number;
1437
- amount: string;
1438
- address: string;
1439
- addressN?: number[];
1440
- mac: string;
1441
- };
1782
+ interface DeviceInfo {
1783
+ vendor: VendorType;
1784
+ /** Machine model id (e.g. "nanoX"). */
1785
+ model: string;
1786
+ /** Human-readable model name (e.g. "Ledger Nano X"). */
1787
+ modelName?: string;
1788
+ firmwareVersion: string;
1789
+ deviceId: string;
1790
+ connectId: string;
1791
+ label?: string;
1792
+ connectionType: ConnectionType;
1793
+ battery?: number;
1794
+ /** BLE signal strength (BLE only). */
1795
+ rssi?: number | null;
1796
+ /** BLE connectable flag (BLE only). */
1797
+ isConnectable?: boolean | null;
1798
+ /** USB serial number (USB only). */
1799
+ serialNumber?: string;
1800
+ /** Device capabilities — varies by vendor, model, and connection type */
1801
+ capabilities?: DeviceCapabilities;
1802
+ /**
1803
+ * Vendor-specific raw payload from the post-handshake `Features` (Trezor)
1804
+ * or device-info call. Populated by the connector with `{ transport,
1805
+ * descriptor, features }` so the app layer can read fields we haven't
1806
+ * promoted to the typed surface yet. Treat as informational — promote
1807
+ * any consumed field above.
1808
+ */
1809
+ raw?: Record<string, unknown>;
1442
1810
  }
1443
- interface EvmPaymentRequest {
1444
- nonce?: string;
1445
- recipientName: string;
1446
- memos?: EvmPaymentRequestMemo[];
1447
- /** Decimal string in subunits; SDK encodes it as SLIP-24 uint256 LE hex. */
1448
- amount?: string;
1449
- signature: string;
1811
+ interface DeviceTarget {
1812
+ connectId: string;
1813
+ deviceId: string;
1450
1814
  }
1451
- interface EvmSignedTx {
1452
- /** Recovery id as `0x`-prefixed hex string. */
1453
- v: string;
1454
- /** ECDSA `r` value as `0x`-prefixed, zero-padded 64-char hex string (32 bytes). */
1455
- r: string;
1456
- /** ECDSA `s` value as `0x`-prefixed, zero-padded 64-char hex string (32 bytes). */
1457
- s: string;
1458
- serializedTx?: string;
1815
+ /**
1816
+ * How long a discovery handle remains safe to use for a new connection.
1817
+ * This is deliberately separate from post-connect device identity.
1818
+ */
1819
+ type SearchTargetReusePolicy = 'current-discovery' | 'reconnectable' | 'rediscover';
1820
+ declare function resolveSearchTargetReusePolicy(device: Pick<DeviceInfo, 'connectionType' | 'capabilities'>): SearchTargetReusePolicy;
1821
+ /** Search target for a physical device whose connectId is the discovery handle. */
1822
+ declare function toPhysicalDeviceSearchTarget(vendor: VendorType, device: DeviceInfo): DeviceSearchTarget;
1823
+ /**
1824
+ * A selectable result from hardware discovery. It may represent a physical
1825
+ * transport endpoint or an interactive entry such as Keystone QR; it is not a
1826
+ * physical-device or wallet identity.
1827
+ */
1828
+ interface DeviceSearchTarget {
1829
+ /** Opaque handle scoped to the adapter's current discovery state. */
1830
+ searchTargetId: string;
1831
+ /** Whether the handle itself may be retried; never inferred from a stored connectId. */
1832
+ searchTargetReusePolicy?: SearchTargetReusePolicy;
1833
+ vendor: VendorType;
1834
+ connectionType: ConnectionType;
1835
+ kind: 'physical' | 'interactive';
1836
+ label?: string;
1837
+ model?: string;
1838
+ modelName?: string;
1839
+ serialNumber?: string;
1459
1840
  }
1460
- interface EvmSignMsgParams extends PassphraseStateAware {
1841
+ type WalletIdentity = {
1842
+ vendor: 'ledger';
1843
+ type: 'chainFingerprint';
1844
+ chain: ChainForFingerprint;
1845
+ value: string;
1846
+ } | {
1847
+ vendor: 'trezor';
1848
+ type: 'deviceId';
1849
+ value: string;
1850
+ } | {
1851
+ vendor: 'keystone';
1852
+ type: 'walletId';
1853
+ value: string;
1854
+ };
1855
+
1856
+ /** Which `GET_VK` encoding the Ledger Zcash app should return. */
1857
+ type ZcashFullViewingKeyMode = 'ufvk' | 'orchardFvk';
1858
+ interface ZcashGetFullViewingKeyParams extends PassphraseStateAware {
1859
+ /** BIP44 account path `m/44'/133'/a'`; a deeper transparent path is accepted, only `a'` is used. */
1461
1860
  path: string;
1462
- message: string;
1463
- chainId?: number;
1464
- hex?: boolean;
1465
- ethereumDefinitions?: EvmEthereumDefinitions;
1861
+ /** Default `ufvk`. */
1862
+ mode?: ZcashFullViewingKeyMode;
1466
1863
  }
1467
- type EvmSignTypedDataParams = EvmSignTypedDataFull | EvmSignTypedDataHash;
1468
- interface EvmSignTypedDataFull extends PassphraseStateAware {
1864
+ interface ZcashFullViewingKey {
1469
1865
  path: string;
1470
- chainId?: number;
1471
- /** Defaults to `'full'` when omitted. */
1472
- mode?: 'full';
1473
- ethereumDefinitions?: EvmEthereumDefinitions;
1474
- data: {
1475
- domain: EIP712Domain;
1476
- types: Record<string, Array<{
1477
- name: string;
1478
- type: string;
1479
- }>>;
1480
- primaryType: string;
1481
- message: Record<string, unknown>;
1482
- };
1483
- metamaskV4Compat?: boolean;
1484
- showMessageHash?: boolean;
1485
- /**
1486
- * Optional host-computed hashes. Core Trezor models still use full typed-data
1487
- * signing for display, while Trezor One can fall back to typed-hash signing
1488
- * when firmware cannot compute the hashes itself.
1489
- */
1490
- domainSeparatorHash?: string;
1491
- messageHash?: string;
1492
- }
1493
- interface EvmSignTypedDataHash extends PassphraseStateAware {
1866
+ mode: ZcashFullViewingKeyMode;
1867
+ /** ZIP-316 bech32m UFVK string (mode `ufvk`). */
1868
+ ufvk?: string;
1869
+ /** 96-byte raw Orchard FVK as hex (mode `orchardFvk`). */
1870
+ orchardFvk?: string;
1871
+ }
1872
+ interface ZcashGetShieldedAddressParams extends PassphraseStateAware {
1873
+ /** Full 5-level transparent path `m/44'/133'/a'/0/i`; the Orchard path is derived from it. */
1494
1874
  path: string;
1495
- chainId?: number;
1496
- mode: 'hash';
1497
- domainSeparatorHash: string;
1498
- messageHash: string;
1499
- ethereumDefinitions?: EvmEthereumDefinitions;
1500
- }
1501
- interface EIP712Domain {
1502
- name?: string;
1503
- version?: string;
1504
- chainId?: number;
1505
- verifyingContract?: string;
1506
- salt?: string;
1507
- [key: string]: unknown;
1508
- }
1509
- interface EvmSignature {
1510
- /** `0x`-prefixed hex string (r + s + v). */
1511
- signature: string;
1512
- address?: string;
1875
+ showOnDevice?: boolean;
1513
1876
  }
1514
- interface IEvmMethods {
1515
- evmGetAddress(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<EvmGetAddressParams>>): Promise<Response<EvmAddress>>;
1516
- evmSignTransaction(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<EvmSignTxParams>>): Promise<Response<EvmSignedTx>>;
1517
- evmSignMessage(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<EvmSignMsgParams>>): Promise<Response<EvmSignature>>;
1518
- evmSignTypedData(connectId?: NullableCallArg<string>, deviceId?: NullableCallArg<string>, params?: NullableCallArg<IHardwareCallParams<EvmSignTypedDataParams>>): Promise<Response<EvmSignature>>;
1877
+ interface ZcashShieldedAddress {
1878
+ /** Unified address with a single Orchard receiver. */
1879
+ address: string;
1880
+ path: string;
1519
1881
  }
1520
1882
 
1521
1883
  /**
@@ -1563,14 +1925,13 @@ interface DeviceDisconnectEvent {
1563
1925
  type DeviceChangeEvent = DeviceConnectEvent | DeviceDisconnectEvent;
1564
1926
 
1565
1927
  /**
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.
1928
+ * Serializes every device call and gives callers one handle to cancel them. Ordering is already
1929
+ * guaranteed by awaiting callers, so what this adds is an AbortController per job, a busy check
1930
+ * that rejects double-submits, and generation tracking so a job queued before a teardown doesn't
1931
+ * start after it; these races exist even for a sequential caller because cleanup is async.
1932
+ *
1933
+ * Interrupt-or-ask policy belongs to the caller; `getActiveJob()` is synchronous so a UI handler
1934
+ * can look, decide, and submit in one turn without racing an in-flight enqueue.
1574
1935
  */
1575
1936
  interface JobOptions {
1576
1937
  label?: string;
@@ -1582,10 +1943,15 @@ interface ActiveJobInfo {
1582
1943
  label?: string;
1583
1944
  startedAt: number;
1584
1945
  }
1946
+ interface CancelScopeHandle {
1947
+ signal: AbortSignal;
1948
+ release: () => void;
1949
+ }
1585
1950
  declare class DeviceJobQueue {
1586
1951
  private _tail;
1587
1952
  private _active;
1588
1953
  private readonly _jobs;
1954
+ private readonly _cancelScopes;
1589
1955
  /** Incremented on clear() so queued-but-not-yet-running jobs detect invalidation. */
1590
1956
  private _generation;
1591
1957
  private readonly _generationCancelReasons;
@@ -1594,21 +1960,64 @@ declare class DeviceJobQueue {
1594
1960
  * `deviceId` is a label only — used by inspection / cancellation routing.
1595
1961
  */
1596
1962
  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. */
1963
+ /**
1964
+ * Holds a cancel across the gaps between a bundle's per-item jobs, when the queue is empty.
1965
+ * Callers must `release()` when the bundle ends.
1966
+ */
1967
+ createCancelScope(deviceId: string): CancelScopeHandle;
1968
+ /**
1969
+ * Cancels the running job only; `reason` becomes signal.reason. Adapters use
1970
+ * `cancelActiveAndPending`; this stays for a connector layer that stops only what is on the wire.
1971
+ */
1972
+ cancelActive(deviceId?: string, reason?: Error): boolean;
1973
+ /**
1974
+ * Cancels the active job and unstarted queued jobs; returns whether anything was reached. Only
1975
+ * `undefined` means everything: an empty key matches nothing instead of tearing the queue down.
1976
+ */
1604
1977
  cancelActiveAndPending(deviceId?: string, reason?: Error): boolean;
1605
1978
  /** Get info about the currently active job, or null if idle. */
1606
1979
  getActiveJob(deviceId?: string): ActiveJobInfo | null;
1607
- /** True if any job is currently running. */
1608
- isBusy(): boolean;
1609
1980
  clear(reason?: Error): void;
1610
1981
  }
1611
1982
 
1983
+ declare const HARDWARE_RUNTIME_ID_PREFIX = "hwk:runtime";
1984
+ /**
1985
+ * `search-target`: one device in one discovery snapshot, dead on the next search of that kind.
1986
+ * `link`: one open transport. `operation`: one business operation.
1987
+ */
1988
+ type HardwareRuntimeIdKind = 'operation' | 'search-target' | 'link';
1989
+ type HardwareRuntimeId = {
1990
+ kind: HardwareRuntimeIdKind;
1991
+ vendor: VendorType;
1992
+ };
1993
+ /** Runtime ids are opaque and must never be persisted as device identity. */
1994
+ declare function createHardwareOperationId(vendor: VendorType): string;
1995
+ /** Search targets are valid only for the adapter's current discovery snapshot. */
1996
+ declare function createHardwareSearchTargetId(vendor: VendorType): string;
1997
+ declare function createHardwareLinkId(vendor: VendorType): string;
1998
+ declare function hasHardwareRuntimeIdPrefix(value: unknown): value is string;
1999
+ declare function parseHardwareRuntimeId(value: unknown): HardwareRuntimeId | undefined;
2000
+ declare function isHardwareOperationId(value: unknown): value is string;
2001
+
2002
+ interface HardwareOperationTarget {
2003
+ /** Effective target accepted by existing adapter/connector call paths. */
2004
+ targetId: string | undefined;
2005
+ /** Present when this operation is pinned to a live operation. */
2006
+ operationId: string | undefined;
2007
+ }
2008
+ /**
2009
+ * Normalizes the transitional positional operation id and the canonical
2010
+ * common-params field. All vendors must reject conflicting bindings.
2011
+ */
2012
+ declare function resolveHardwareOperationTarget(positionalTargetId: string | null | undefined, commonOperationId: string | null | undefined, expectedVendor?: VendorType): Response<HardwareOperationTarget>;
2013
+ /** Narrow the connection-context fields of untyped call params. */
2014
+ declare function pickConnectionContext(params: {
2015
+ knownConnections?: unknown;
2016
+ extra?: unknown;
2017
+ allowDeviceSelection?: unknown;
2018
+ supportedTransports?: unknown;
2019
+ }): IHardwareConnectionContext;
2020
+
1612
2021
  /**
1613
2022
  * Minimal typed event emitter using Map<string, Set<listener>>.
1614
2023
  * Each adapter uses this for device events (connect, disconnect, pin, etc.).
@@ -1635,6 +2044,104 @@ declare class TypedEventEmitter<TMap extends Record<string, any> = Record<string
1635
2044
  listenerCount(event: string): number;
1636
2045
  }
1637
2046
 
2047
+ /** Serializable BLE transport data shared by Electron main and renderer runtimes. */
2048
+ interface ElectronBleDeviceInfo {
2049
+ id: string;
2050
+ name?: string;
2051
+ rssi?: number;
2052
+ advertisedServiceUuids?: string[];
2053
+ }
2054
+ /**
2055
+ * IPC-safe peripheral match: advertises one of `serviceUuids`, or its local name matches every
2056
+ * `namePatterns` entry (case-insensitive regex sources). The desktop noble-ble host treats this
2057
+ * as a hint only: its vendor allowlist decides, `serviceUuids` can only narrow it, and
2058
+ * `namePatterns` are never compiled.
2059
+ */
2060
+ interface ElectronBleMatch {
2061
+ serviceUuids?: string[];
2062
+ namePatterns?: string[];
2063
+ }
2064
+ interface ElectronBleScanOptions {
2065
+ /** Opaque partition key: results and connected devices never mix across it. */
2066
+ vendor?: string;
2067
+ match?: ElectronBleMatch;
2068
+ /** @deprecated Superseded by `match.serviceUuids`. */
2069
+ serviceUuids?: string[];
2070
+ durationMs?: number;
2071
+ }
2072
+ /** GATT profile plus the write framing this vendor's firmware expects. */
2073
+ interface ElectronBleConnectOptions {
2074
+ vendor: string;
2075
+ serviceUuid: string;
2076
+ writeUuid: string;
2077
+ notifyUuid: string;
2078
+ /**
2079
+ * `padded`: fixed `chunkSize` packets, last zero-filled (Trezor firmware drops short packets).
2080
+ * `raw`: the buffer as given, for self-length-framed protocols (Ledger).
2081
+ */
2082
+ write?: {
2083
+ mode: 'padded' | 'raw';
2084
+ chunkSize?: number;
2085
+ chunkDelayMs?: number;
2086
+ maxLength?: number;
2087
+ };
2088
+ }
2089
+ /** Native code handles GATT only; framing, identity checks and wallet calls stay in the SDK. */
2090
+ interface ElectronBleApi {
2091
+ scan(options?: ElectronBleScanOptions): Promise<ElectronBleDeviceInfo[]>;
2092
+ stopScan(vendor?: string): Promise<void>;
2093
+ connect(id: string, options?: ElectronBleConnectOptions): Promise<{
2094
+ id: string;
2095
+ name?: string;
2096
+ }>;
2097
+ disconnect(id: string): Promise<void>;
2098
+ subscribe(id: string): Promise<void>;
2099
+ unsubscribe(id: string): Promise<void>;
2100
+ write(id: string, hexData: string): Promise<void>;
2101
+ checkAvailability(): Promise<{
2102
+ available: boolean;
2103
+ state: string;
2104
+ initialized: boolean;
2105
+ }>;
2106
+ getDevice(id: string): Promise<ElectronBleDeviceInfo | null>;
2107
+ onNotification(handler: (id: string, hexData: string) => void): () => void;
2108
+ onDeviceDisconnected(handler: (id: string) => void): () => void;
2109
+ /** Abandon an in-flight connect in the main process. Optional for hosts that cannot cancel. */
2110
+ cancelPairing?(options?: {
2111
+ vendor: string;
2112
+ id?: string;
2113
+ }): Promise<void>;
2114
+ }
2115
+
2116
+ declare function emitDeviceBindingStatus(emitter: TypedEventEmitter<HardwareEventMap>, selectionRequestId: string, status: DeviceBindingStatus['status']): void;
2117
+ /**
2118
+ * A host refusal is reported, never thrown: the device is already connected, so a lost binding
2119
+ * is worth a warning and a retry, not failing the user's work.
2120
+ */
2121
+ type SaveDeviceBindingOutcome = {
2122
+ saved: true;
2123
+ } | {
2124
+ saved: false;
2125
+ reason: SaveDeviceBindingDeclineReason;
2126
+ };
2127
+ /** Persist a binding through the host. Only a user abort throws. */
2128
+ declare function requestSaveDeviceBinding(emitter: TypedEventEmitter<HardwareEventMap>, registry: UiRequestRegistry, binding: Omit<SaveDeviceBindingRequest, 'requestId'>, signal?: AbortSignal): Promise<SaveDeviceBindingOutcome>;
2129
+
2130
+ /** Discovery and selection share one owner; never connect until the last scan has drained. */
2131
+ declare function requestBleDeviceSelection({ emitter, registry, request, scan, signal, allowUsbFallback, pollIntervalMs, }: {
2132
+ emitter: TypedEventEmitter<HardwareEventMap>;
2133
+ registry: UiRequestRegistry;
2134
+ request: Omit<DeviceSelectionRequest, 'requestId' | 'scanning'>;
2135
+ scan: () => Promise<DeviceInfo[]>;
2136
+ signal: AbortSignal;
2137
+ /** The adapter must verify a returned USB candidate before dispatching any business call. */
2138
+ allowUsbFallback?: boolean;
2139
+ pollIntervalMs?: number;
2140
+ }): Promise<{
2141
+ device: DeviceInfo;
2142
+ requestId: string;
2143
+ }>;
2144
+
1638
2145
  /**
1639
2146
  * Compare two semver strings (e.g. "2.1.0" vs "2.3.1").
1640
2147
  * Returns -1 if a < b, 0 if equal, 1 if a > b.
@@ -1655,7 +2162,57 @@ declare function hexToBytes(hex: string): Uint8Array;
1655
2162
  /** Convert a Uint8Array to a hex string (no 0x prefix). */
1656
2163
  declare function bytesToHex(bytes: Uint8Array): string;
1657
2164
 
1658
- type DetectableHardwareVendor = 'onekey' | 'trezor' | 'ledger';
2165
+ /**
2166
+ * Walks CBOR from an untrusted source (a scanned QR code, a device reply) before a third-party
2167
+ * decoder sees it. Those decoders read past the end as zero and trust declared lengths, so one
2168
+ * indefinite-length header or a huge declared count exhausts memory. This walk accepts only
2169
+ * definite lengths that fit in the bytes actually present, bounded nesting, and no trailing bytes.
2170
+ */
2171
+ declare function assertBoundedCbor(input: Uint8Array, maxBytes?: number): void;
2172
+ /** Hex from an untrusted source, checked as such and then as bounded CBOR. */
2173
+ declare function boundedCborFromHex(hex: string, maxBytes?: number): Buffer;
2174
+
2175
+ interface PrepareSolanaOffchainMessageV1Params {
2176
+ message: Uint8Array;
2177
+ requiredSigners: readonly string[];
2178
+ }
2179
+ interface PreparedSolanaOffchainMessageV1 {
2180
+ messageText: string;
2181
+ requiredSigners: string[];
2182
+ serializedMessage: Uint8Array;
2183
+ }
2184
+ declare function prepareSolanaOffchainMessageV1({ message, requiredSigners, }: PrepareSolanaOffchainMessageV1Params): PreparedSolanaOffchainMessageV1;
2185
+
2186
+ type LogSummaryContext = {
2187
+ /** Method name from the options, or '' when none was given. */
2188
+ method: string;
2189
+ role: 'params' | 'result';
2190
+ };
2191
+ /**
2192
+ * Returns extra space-separated hints for a payload field (e.g. PSBT input/output counts), or
2193
+ * undefined to add nothing. `key` is normalized: lower-case with `_` and `-` removed. Hints are
2194
+ * appended verbatim, so they must not contain payload contents. A throwing describer is ignored.
2195
+ */
2196
+ type LogPayloadDescriber = (key: string, value: string | Uint8Array, context: LogSummaryContext) => string | undefined;
2197
+ type LogSummaryOptions = {
2198
+ /** Public or connector method name; enables chain-specific hints (EVM tx type). */
2199
+ method?: string;
2200
+ /** In results, transaction fields hold signed transactions rather than requests. */
2201
+ role?: 'params' | 'result';
2202
+ /** Chain-specific payload hints that need a decoder adapter-core does not ship. */
2203
+ describePayload?: LogPayloadDescriber;
2204
+ };
2205
+ /**
2206
+ * JSON-safe, log-safe summary of `value`. Never throws.
2207
+ *
2208
+ * Paths, chain ids, flags and error fields stay readable; payloads become
2209
+ * `<hex|str|json len=N sha256=16hex [hints]>`, addresses `first6…last4`, xpubs `xpub… len=N`,
2210
+ * public keys and chain codes `… len=N`, signatures `<signature len=N>` and secrets
2211
+ * `<redacted len=N>`.
2212
+ */
2213
+ declare function summarizeForLog(value: unknown, options?: LogSummaryOptions): unknown;
2214
+
2215
+ type DetectableHardwareVendor = 'onekey' | 'trezor' | 'ledger' | 'keystone';
1659
2216
  type HardwareDeviceIdentityInput = {
1660
2217
  name?: string | null;
1661
2218
  localName?: string | null;
@@ -1718,8 +2275,19 @@ type RunAllNetworkGetAddressOptions = {
1718
2275
  buildTopLevelFailure?: (response: AllNetworkAddressResponse, context: AllNetworkResponseContext) => Response<AllNetworkAddressResponse[]>;
1719
2276
  };
1720
2277
  declare function runAllNetworkGetAddress({ connectId, deviceId, params, getMethodChain, normalizeItem, buildUnsupportedNetworkResponse, callItem, attachIdentity, shouldAbortBundle, buildTopLevelFailure, }: RunAllNetworkGetAddressOptions): Promise<Response<AllNetworkAddressResponse[]>>;
2278
+ /** An SDK-dialog cancel or on-device reject ends the bundle; the user already answered "no". */
2279
+ declare function isUserRefusal(code: HardwareErrorCode | number | undefined): boolean;
2280
+ /**
2281
+ * The device or wallet could not be shown to be the one asked for: another wallet, a locked
2282
+ * device, a wrong PIN or passphrase. No later item may derive on it, and a PIN is not retried.
2283
+ */
2284
+ declare function isWalletSafetyFailure(code: HardwareErrorCode | number | undefined): boolean;
2285
+ /** The bundle's session is gone, so the remaining items have nothing to run against. */
2286
+ declare function isConnectionLost(code: HardwareErrorCode | number | undefined): boolean;
2287
+ /** UserAborted is a top-level abort code, so this ends the bundle. */
2288
+ declare function buildAllNetworkCancelledFailure<T>(signal: AbortSignal): Response<T>;
1721
2289
  declare function buildUnsupportedMethodResponse(item: AllNetworkAddressParams): AllNetworkAddressResponse;
1722
2290
 
1723
2291
  declare const DEVICE_CONNECT_RETRY_DELAY_MS = 1000;
1724
2292
 
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 };
2293
+ 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 };