@onekeyfe/hwk-trezor-adapter 1.2.8-alpha.1 → 1.2.8-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { IHardwareWallet, IConnector, TransportType, SearchDevicesOptions, DeviceInfo, DeviceSearchTarget, ConnectionTarget, BindBleDeviceParams, Response, AllNetworkGetAddressParams, AllNetworkAddressResponse, IDeviceManagerOperationContext, DeviceAuthenticityParams, DeviceAuthenticityResult, TrezorDeviceSettingsParams, TrezorBrightnessParams, TrezorChangePinParams, UiResponseEvent, ChainForFingerprint, ICommonCallParams, EvmGetAddressParams, EvmAddress, EvmSignTxTrezorParams, EvmSignedTx, EvmSignMsgParams, EvmSignature, EvmSignTypedDataParams, BtcGetAddressParams, BtcAddress, BtcGetPublicKeyParams, BtcPublicKey, BtcSignTxParams, BtcSignedTx, BtcSignPsbtParams, BtcSignedPsbt, BtcSignMsgParams, BtcSignature, SolGetAddressParams, SolAddress, SolSignTxParams, SolSignedTx, SolSignMsgParams, SolSignature, TronGetAddressParams, TronAddress, TronSignTxParams, TronSignedTx, TronSignMsgParams, TronSignature, HardwareEventMap, DeviceEventListener, EvmEthereumDefinitions, ConnectorDevice } from '@onekeyfe/hwk-adapter-core';
1
+ import { IHardwareWallet, IConnector, TransportType, DeviceInfo, Response, ChainCapability, AllNetworkGetAddressParams, AllNetworkAddressResponse, DeviceAuthenticityParams, DeviceAuthenticityResult, TrezorDeviceSettingsParams, TrezorBrightnessParams, TrezorChangePinParams, UiResponseEvent, ChainForFingerprint, ICommonCallParams, EvmGetAddressParams, EvmAddress, EvmSignTxTrezorParams, EvmSignedTx, EvmSignMsgParams, EvmSignature, EvmSignTypedDataParams, BtcGetAddressParams, BtcAddress, BtcGetPublicKeyParams, BtcPublicKey, BtcSignTxParams, BtcSignedTx, BtcSignPsbtParams, BtcSignedPsbt, BtcSignMsgParams, BtcSignature, SolGetAddressParams, SolAddress, SolSignTxParams, SolSignedTx, SolSignMsgParams, SolSignature, TronGetAddressParams, TronAddress, TronSignTxParams, TronSignedTx, TronSignMsgParams, TronSignature, HardwareEventMap, DeviceEventListener, EvmEthereumDefinitions, ConnectorDevice } from '@onekeyfe/hwk-adapter-core';
2
2
 
3
3
  type TrezorPassphraseCallParams = {
4
4
  passphraseState?: string;
@@ -6,21 +6,10 @@ type TrezorPassphraseCallParams = {
6
6
  };
7
7
  type TrezorCallParams<T> = (T & ICommonCallParams & TrezorPassphraseCallParams) | null | undefined;
8
8
  type TrezorCommonParams = (ICommonCallParams & TrezorPassphraseCallParams) | null | undefined;
9
- interface TrezorKnownDeviceConnection {
10
- deviceId: string;
11
- usbConnectId?: string;
12
- bleConnectId?: string;
13
- }
14
- interface TrezorAdapterOptions {
15
- /** Persisted endpoints are routing hints, never proof of device identity. */
16
- knownDeviceConnections?: readonly TrezorKnownDeviceConnection[];
17
- }
18
9
  declare class TrezorAdapter implements IHardwareWallet {
19
10
  readonly vendor: "trezor";
20
- readonly cancelCapability: "stops-waiting";
21
11
  private readonly _connector;
22
12
  private readonly _emitter;
23
- private readonly _operations;
24
13
  private readonly _devices;
25
14
  private readonly _sessions;
26
15
  private readonly _connectingPromises;
@@ -28,16 +17,8 @@ declare class TrezorAdapter implements IHardwareWallet {
28
17
  private readonly _uiRegistry;
29
18
  private readonly _passphraseRequestContextByConnectId;
30
19
  private readonly _verifiedPassphraseSessionsByConnectId;
31
- /** Raw connector calls that outlive an aborted caller, keyed by session. */
32
- private readonly _unsettledConnectorOperations;
33
- private readonly _connectorIdleWaiters;
34
- private _resetPromise;
35
- private _connectorTeardownTail;
36
- private _pendingConnectorTeardowns;
37
- private _stateGeneration;
38
20
  private readonly _jobQueue;
39
- private readonly _knownDeviceConnections;
40
- constructor(connector: IConnector, options?: TrezorAdapterOptions);
21
+ constructor(connector: IConnector);
41
22
  private static _createDeviceBusyError;
42
23
  /**
43
24
  * Split a Trezor-only `passphraseState` routing hint off the chain params so
@@ -60,17 +41,19 @@ declare class TrezorAdapter implements IHardwareWallet {
60
41
  * selected is gone (the device evicted it from its limited slot pool). The
61
42
  * caller drops the stale cache entry and recreates from scratch.
62
43
  *
63
- * Match only the protocol's explicit unallocated-channel code. Guessing from
64
- * an error message could replay a request after an unrelated business error.
44
+ * NOTE: the exact eviction code still needs real-device confirmation — match
45
+ * conservatively so a genuine error isn't mistaken for an evicted session
46
+ * (which would silently re-prompt the passphrase).
65
47
  */
66
48
  private static _isStaleSessionError;
67
49
  private static _errorCode;
68
50
  private static _isConnectionUnavailableError;
69
51
  private static _isRecoverableProtocolResidueError;
70
52
  /**
71
- * Race a promise against an abort signal. IConnector.call() can't actually
72
- * be cancelled at the protocol level, so the caller gets the abort while the
73
- * adapter keeps the transport exclusively reserved until the raw call drains.
53
+ * Race a promise against an abort signal. Copied from LedgerAdapter:
54
+ * IConnector.call() can't actually be cancelled at the protocol level, but
55
+ * the caller gets the abort immediately and the underlying work completes
56
+ * uselessly in the background.
74
57
  */
75
58
  private static _abortable;
76
59
  private _connectSession;
@@ -83,20 +66,17 @@ declare class TrezorAdapter implements IHardwareWallet {
83
66
  * error flows. Aborts active jobs and releases UI waits.
84
67
  */
85
68
  resetState(): void;
86
- private _resetStateAndDisconnectSessions;
87
69
  getAvailableTransports(): TransportType[];
88
70
  switchTransport(_type: TransportType): Promise<void>;
89
- searchDevices(options?: SearchDevicesOptions): Promise<DeviceInfo[]>;
90
- private _searchDevices;
91
- searchDeviceTargets(options?: SearchDevicesOptions): Promise<DeviceSearchTarget[]>;
92
- listConnectionTargets(options?: SearchDevicesOptions): Promise<ConnectionTarget[]>;
93
- bindBleDevice(params: BindBleDeviceParams): Promise<Response<string>>;
94
- connectDevice(searchTargetId: string): Promise<Response<string>>;
95
- releaseOperation(operationId: string): Promise<void>;
96
- private _releaseOperationConnection;
97
- getDeviceInfo(connectIdOrOperationId: string, deviceId: string): Promise<Response<DeviceInfo>>;
71
+ searchDevices(options?: {
72
+ waitForAllTransports?: boolean;
73
+ }): Promise<DeviceInfo[]>;
74
+ connectDevice(connectId: string): Promise<Response<string>>;
75
+ disconnectDevice(connectId: string): Promise<void>;
76
+ getDeviceInfo(connectId: string, deviceId: string): Promise<Response<DeviceInfo>>;
77
+ getSupportedChains(): ChainCapability[];
98
78
  allNetworkGetAddress(connectId: string, deviceId: string, params: AllNetworkGetAddressParams): Promise<Response<AllNetworkAddressResponse[]>>;
99
- getFeatures(connectId: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
79
+ getFeatures(connectId: string): Promise<Response<Record<string, unknown>>>;
100
80
  /**
101
81
  * Device authenticity attestation. Sends a host-generated challenge, has the
102
82
  * device sign it with its secure-element key, then verifies the returned
@@ -112,17 +92,12 @@ declare class TrezorAdapter implements IHardwareWallet {
112
92
  * enable it in a production accounting flow, it lets an emulator mint any id.
113
93
  */
114
94
  verifyDeviceAuthenticity(connectId: string, params?: DeviceAuthenticityParams): Promise<Response<DeviceAuthenticityResult>>;
115
- deviceSettings(connectId: string, params: TrezorDeviceSettingsParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
116
- setBrightness(connectId: string, params?: TrezorBrightnessParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
117
- changePin(connectId: string, params?: TrezorChangePinParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
118
- wipeDevice(connectId: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
95
+ deviceSettings(connectId: string, params: TrezorDeviceSettingsParams): Promise<Response<Record<string, unknown>>>;
96
+ setBrightness(connectId: string, params?: TrezorBrightnessParams): Promise<Response<Record<string, unknown>>>;
97
+ changePin(connectId: string, params?: TrezorChangePinParams): Promise<Response<Record<string, unknown>>>;
98
+ wipeDevice(connectId: string): Promise<Response<Record<string, unknown>>>;
119
99
  private _getTrezorDeviceId;
120
100
  cancel(connectId?: string): void;
121
- /**
122
- * Operation owning the running job: its queue key when pinned, else the live
123
- * operation of its connectId, so a mid-call UI request can name it.
124
- */
125
- private _activeOperationId;
126
101
  /**
127
102
  * Routes to BOTH the adapter's local UI registry (preemption decisions,
128
103
  * future SELECT_DEVICE / DEVICE_PERMISSION) AND the connector's registry
@@ -139,7 +114,7 @@ declare class TrezorAdapter implements IHardwareWallet {
139
114
  * Unlike Ledger (which hashes a per-chain address), it is chain-global, so
140
115
  * `chain` is accepted for API parity but ignored.
141
116
  */
142
- getChainFingerprint(connectId: string, deviceId: string, _chain: ChainForFingerprint): Promise<Response<string>>;
117
+ getChainFingerprint(connectId: string, _deviceId: string, _chain: ChainForFingerprint): Promise<Response<string>>;
143
118
  /**
144
119
  * Resolve the active passphrase wallet identity (`passphraseState`).
145
120
  * See {@link IHardwareWallet.getPassphraseState} for the discover/verify
@@ -148,7 +123,7 @@ declare class TrezorAdapter implements IHardwareWallet {
148
123
  * can't interleave with a chain call on the same device (which would desync
149
124
  * the THP session selection).
150
125
  */
151
- getPassphraseState(connectId: string, passphraseState?: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<string | null>>;
126
+ getPassphraseState(connectId: string, passphraseState?: string): Promise<Response<string | null>>;
152
127
  evmGetAddress(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmGetAddressParams>): Promise<Response<EvmAddress>>;
153
128
  evmSignTransaction(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmSignTxTrezorParams>): Promise<Response<EvmSignedTx>>;
154
129
  evmSignMessage(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmSignMsgParams>): Promise<Response<EvmSignature>>;
@@ -168,18 +143,9 @@ declare class TrezorAdapter implements IHardwareWallet {
168
143
  tronSignTransaction(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<TronSignTxParams>): Promise<Response<TronSignedTx>>;
169
144
  tronSignMessage(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<TronSignMsgParams>): Promise<Response<TronSignature>>;
170
145
  private static _unwrapConnectorResult;
171
- private _callConnector;
172
- private _assertConnectorIdle;
173
- private _runConnectorTeardown;
174
- private _disconnectSession;
175
- private _availableTransports;
176
- private _releaseProvisionalConnection;
177
- private _waitForConnectorOperationsToDrain;
178
- private _retainConnectorOperation;
146
+ private static _callConnector;
179
147
  private static _normalizeAllNetworkItem;
180
148
  private static _getItemDeviceId;
181
- /** UserAborted is a top-level abort code, so this ends the bundle. */
182
- private static _buildCancelledFailure;
183
149
  private _callAllNetworkMethod;
184
150
  on<K extends keyof HardwareEventMap>(event: K, listener: (event: HardwareEventMap[K]) => void): void;
185
151
  on(event: string, listener: DeviceEventListener): void;
@@ -190,13 +156,6 @@ declare class TrezorAdapter implements IHardwareWallet {
190
156
  private _callMethod;
191
157
  private _callWithRetry;
192
158
  private _ensureSession;
193
- /** An identity probe tears down only a session it opened; another caller's stays up. */
194
- private _hasSessionOrConnect;
195
- private _resolveExpectedDeviceConnectId;
196
- private _selectBleDeviceForBinding;
197
- private _emitBindingStatus;
198
- private _rememberVerifiedConnection;
199
- private _emitVerifiedBinding;
200
159
  /**
201
160
  * Pin the device's active wallet session to `passphraseState` (the target
202
161
  * wallet identity) before a wallet-bound op. THP has an app-session id; v1
@@ -454,4 +413,4 @@ declare function isTrezorBleServiceUuid(uuid: string): boolean;
454
413
  declare function isTrezorBleDescriptor(descriptor: TrezorBleDescriptor): boolean;
455
414
  declare function resolveTrezorBleConnectId(descriptor: TrezorBleDescriptor): string;
456
415
 
457
- export { type AuthenticateDeviceResult, type AuthenticityProof, type BuildEthereumDefinitionsForPathParams, type BuildEthereumDefinitionsForSignTxParams, DEFAULT_ETHEREUM_DEFINITIONS_BASE_URL, DEFAULT_SOLANA_TOKEN_DEFINITION_BASE_URL, type FetchEthereumDefinitionsParams, type FetchLike, type FetchSolanaTokenDefinitionParams, type SdkEvent, type SdkEventListener, type SdkLogEvent, TREZOR_BLE_PACKET_SIZE, TREZOR_BLE_SUPPORTED_MODELS, TREZOR_BLE_UUIDS, TREZOR_SAFE_7_MODEL, TrezorAdapter, type TrezorAdapterOptions, type TrezorBleDescriptor, type TrezorBleTransport, type TrezorBleTransportFactory, type TrezorConnectedDevice, type TrezorConnectorDevice, type TrezorKnownDeviceConnection, authenticateDeviceFromProof, buildEthereumDefinitionsForPath, buildEthereumDefinitionsForSignTx, fetchEthereumDefinitions, fetchSolanaTokenDefinition, getRequiredDeviceAuthenticityLayers, getSlip44FromPath, isTrezorBleDescriptor, isTrezorBleServiceUuid, isTrezorBleSupportedModel, isTrezorSafe7BleDescriptor, isTrezorSafe7BleName, normalizeTrezorBleUuid, offSdkEvent, onSdkEvent, resolveTrezorBleConnectId };
416
+ export { type AuthenticateDeviceResult, type AuthenticityProof, type BuildEthereumDefinitionsForPathParams, type BuildEthereumDefinitionsForSignTxParams, DEFAULT_ETHEREUM_DEFINITIONS_BASE_URL, DEFAULT_SOLANA_TOKEN_DEFINITION_BASE_URL, type FetchEthereumDefinitionsParams, type FetchLike, type FetchSolanaTokenDefinitionParams, type SdkEvent, type SdkEventListener, type SdkLogEvent, TREZOR_BLE_PACKET_SIZE, TREZOR_BLE_SUPPORTED_MODELS, TREZOR_BLE_UUIDS, TREZOR_SAFE_7_MODEL, TrezorAdapter, type TrezorBleDescriptor, type TrezorBleTransport, type TrezorBleTransportFactory, type TrezorConnectedDevice, type TrezorConnectorDevice, authenticateDeviceFromProof, buildEthereumDefinitionsForPath, buildEthereumDefinitionsForSignTx, fetchEthereumDefinitions, fetchSolanaTokenDefinition, getRequiredDeviceAuthenticityLayers, getSlip44FromPath, isTrezorBleDescriptor, isTrezorBleServiceUuid, isTrezorBleSupportedModel, isTrezorSafe7BleDescriptor, isTrezorSafe7BleName, normalizeTrezorBleUuid, offSdkEvent, onSdkEvent, resolveTrezorBleConnectId };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IHardwareWallet, IConnector, TransportType, SearchDevicesOptions, DeviceInfo, DeviceSearchTarget, ConnectionTarget, BindBleDeviceParams, Response, AllNetworkGetAddressParams, AllNetworkAddressResponse, IDeviceManagerOperationContext, DeviceAuthenticityParams, DeviceAuthenticityResult, TrezorDeviceSettingsParams, TrezorBrightnessParams, TrezorChangePinParams, UiResponseEvent, ChainForFingerprint, ICommonCallParams, EvmGetAddressParams, EvmAddress, EvmSignTxTrezorParams, EvmSignedTx, EvmSignMsgParams, EvmSignature, EvmSignTypedDataParams, BtcGetAddressParams, BtcAddress, BtcGetPublicKeyParams, BtcPublicKey, BtcSignTxParams, BtcSignedTx, BtcSignPsbtParams, BtcSignedPsbt, BtcSignMsgParams, BtcSignature, SolGetAddressParams, SolAddress, SolSignTxParams, SolSignedTx, SolSignMsgParams, SolSignature, TronGetAddressParams, TronAddress, TronSignTxParams, TronSignedTx, TronSignMsgParams, TronSignature, HardwareEventMap, DeviceEventListener, EvmEthereumDefinitions, ConnectorDevice } from '@onekeyfe/hwk-adapter-core';
1
+ import { IHardwareWallet, IConnector, TransportType, DeviceInfo, Response, ChainCapability, AllNetworkGetAddressParams, AllNetworkAddressResponse, DeviceAuthenticityParams, DeviceAuthenticityResult, TrezorDeviceSettingsParams, TrezorBrightnessParams, TrezorChangePinParams, UiResponseEvent, ChainForFingerprint, ICommonCallParams, EvmGetAddressParams, EvmAddress, EvmSignTxTrezorParams, EvmSignedTx, EvmSignMsgParams, EvmSignature, EvmSignTypedDataParams, BtcGetAddressParams, BtcAddress, BtcGetPublicKeyParams, BtcPublicKey, BtcSignTxParams, BtcSignedTx, BtcSignPsbtParams, BtcSignedPsbt, BtcSignMsgParams, BtcSignature, SolGetAddressParams, SolAddress, SolSignTxParams, SolSignedTx, SolSignMsgParams, SolSignature, TronGetAddressParams, TronAddress, TronSignTxParams, TronSignedTx, TronSignMsgParams, TronSignature, HardwareEventMap, DeviceEventListener, EvmEthereumDefinitions, ConnectorDevice } from '@onekeyfe/hwk-adapter-core';
2
2
 
3
3
  type TrezorPassphraseCallParams = {
4
4
  passphraseState?: string;
@@ -6,21 +6,10 @@ type TrezorPassphraseCallParams = {
6
6
  };
7
7
  type TrezorCallParams<T> = (T & ICommonCallParams & TrezorPassphraseCallParams) | null | undefined;
8
8
  type TrezorCommonParams = (ICommonCallParams & TrezorPassphraseCallParams) | null | undefined;
9
- interface TrezorKnownDeviceConnection {
10
- deviceId: string;
11
- usbConnectId?: string;
12
- bleConnectId?: string;
13
- }
14
- interface TrezorAdapterOptions {
15
- /** Persisted endpoints are routing hints, never proof of device identity. */
16
- knownDeviceConnections?: readonly TrezorKnownDeviceConnection[];
17
- }
18
9
  declare class TrezorAdapter implements IHardwareWallet {
19
10
  readonly vendor: "trezor";
20
- readonly cancelCapability: "stops-waiting";
21
11
  private readonly _connector;
22
12
  private readonly _emitter;
23
- private readonly _operations;
24
13
  private readonly _devices;
25
14
  private readonly _sessions;
26
15
  private readonly _connectingPromises;
@@ -28,16 +17,8 @@ declare class TrezorAdapter implements IHardwareWallet {
28
17
  private readonly _uiRegistry;
29
18
  private readonly _passphraseRequestContextByConnectId;
30
19
  private readonly _verifiedPassphraseSessionsByConnectId;
31
- /** Raw connector calls that outlive an aborted caller, keyed by session. */
32
- private readonly _unsettledConnectorOperations;
33
- private readonly _connectorIdleWaiters;
34
- private _resetPromise;
35
- private _connectorTeardownTail;
36
- private _pendingConnectorTeardowns;
37
- private _stateGeneration;
38
20
  private readonly _jobQueue;
39
- private readonly _knownDeviceConnections;
40
- constructor(connector: IConnector, options?: TrezorAdapterOptions);
21
+ constructor(connector: IConnector);
41
22
  private static _createDeviceBusyError;
42
23
  /**
43
24
  * Split a Trezor-only `passphraseState` routing hint off the chain params so
@@ -60,17 +41,19 @@ declare class TrezorAdapter implements IHardwareWallet {
60
41
  * selected is gone (the device evicted it from its limited slot pool). The
61
42
  * caller drops the stale cache entry and recreates from scratch.
62
43
  *
63
- * Match only the protocol's explicit unallocated-channel code. Guessing from
64
- * an error message could replay a request after an unrelated business error.
44
+ * NOTE: the exact eviction code still needs real-device confirmation — match
45
+ * conservatively so a genuine error isn't mistaken for an evicted session
46
+ * (which would silently re-prompt the passphrase).
65
47
  */
66
48
  private static _isStaleSessionError;
67
49
  private static _errorCode;
68
50
  private static _isConnectionUnavailableError;
69
51
  private static _isRecoverableProtocolResidueError;
70
52
  /**
71
- * Race a promise against an abort signal. IConnector.call() can't actually
72
- * be cancelled at the protocol level, so the caller gets the abort while the
73
- * adapter keeps the transport exclusively reserved until the raw call drains.
53
+ * Race a promise against an abort signal. Copied from LedgerAdapter:
54
+ * IConnector.call() can't actually be cancelled at the protocol level, but
55
+ * the caller gets the abort immediately and the underlying work completes
56
+ * uselessly in the background.
74
57
  */
75
58
  private static _abortable;
76
59
  private _connectSession;
@@ -83,20 +66,17 @@ declare class TrezorAdapter implements IHardwareWallet {
83
66
  * error flows. Aborts active jobs and releases UI waits.
84
67
  */
85
68
  resetState(): void;
86
- private _resetStateAndDisconnectSessions;
87
69
  getAvailableTransports(): TransportType[];
88
70
  switchTransport(_type: TransportType): Promise<void>;
89
- searchDevices(options?: SearchDevicesOptions): Promise<DeviceInfo[]>;
90
- private _searchDevices;
91
- searchDeviceTargets(options?: SearchDevicesOptions): Promise<DeviceSearchTarget[]>;
92
- listConnectionTargets(options?: SearchDevicesOptions): Promise<ConnectionTarget[]>;
93
- bindBleDevice(params: BindBleDeviceParams): Promise<Response<string>>;
94
- connectDevice(searchTargetId: string): Promise<Response<string>>;
95
- releaseOperation(operationId: string): Promise<void>;
96
- private _releaseOperationConnection;
97
- getDeviceInfo(connectIdOrOperationId: string, deviceId: string): Promise<Response<DeviceInfo>>;
71
+ searchDevices(options?: {
72
+ waitForAllTransports?: boolean;
73
+ }): Promise<DeviceInfo[]>;
74
+ connectDevice(connectId: string): Promise<Response<string>>;
75
+ disconnectDevice(connectId: string): Promise<void>;
76
+ getDeviceInfo(connectId: string, deviceId: string): Promise<Response<DeviceInfo>>;
77
+ getSupportedChains(): ChainCapability[];
98
78
  allNetworkGetAddress(connectId: string, deviceId: string, params: AllNetworkGetAddressParams): Promise<Response<AllNetworkAddressResponse[]>>;
99
- getFeatures(connectId: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
79
+ getFeatures(connectId: string): Promise<Response<Record<string, unknown>>>;
100
80
  /**
101
81
  * Device authenticity attestation. Sends a host-generated challenge, has the
102
82
  * device sign it with its secure-element key, then verifies the returned
@@ -112,17 +92,12 @@ declare class TrezorAdapter implements IHardwareWallet {
112
92
  * enable it in a production accounting flow, it lets an emulator mint any id.
113
93
  */
114
94
  verifyDeviceAuthenticity(connectId: string, params?: DeviceAuthenticityParams): Promise<Response<DeviceAuthenticityResult>>;
115
- deviceSettings(connectId: string, params: TrezorDeviceSettingsParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
116
- setBrightness(connectId: string, params?: TrezorBrightnessParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
117
- changePin(connectId: string, params?: TrezorChangePinParams, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
118
- wipeDevice(connectId: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<Record<string, unknown>>>;
95
+ deviceSettings(connectId: string, params: TrezorDeviceSettingsParams): Promise<Response<Record<string, unknown>>>;
96
+ setBrightness(connectId: string, params?: TrezorBrightnessParams): Promise<Response<Record<string, unknown>>>;
97
+ changePin(connectId: string, params?: TrezorChangePinParams): Promise<Response<Record<string, unknown>>>;
98
+ wipeDevice(connectId: string): Promise<Response<Record<string, unknown>>>;
119
99
  private _getTrezorDeviceId;
120
100
  cancel(connectId?: string): void;
121
- /**
122
- * Operation owning the running job: its queue key when pinned, else the live
123
- * operation of its connectId, so a mid-call UI request can name it.
124
- */
125
- private _activeOperationId;
126
101
  /**
127
102
  * Routes to BOTH the adapter's local UI registry (preemption decisions,
128
103
  * future SELECT_DEVICE / DEVICE_PERMISSION) AND the connector's registry
@@ -139,7 +114,7 @@ declare class TrezorAdapter implements IHardwareWallet {
139
114
  * Unlike Ledger (which hashes a per-chain address), it is chain-global, so
140
115
  * `chain` is accepted for API parity but ignored.
141
116
  */
142
- getChainFingerprint(connectId: string, deviceId: string, _chain: ChainForFingerprint): Promise<Response<string>>;
117
+ getChainFingerprint(connectId: string, _deviceId: string, _chain: ChainForFingerprint): Promise<Response<string>>;
143
118
  /**
144
119
  * Resolve the active passphrase wallet identity (`passphraseState`).
145
120
  * See {@link IHardwareWallet.getPassphraseState} for the discover/verify
@@ -148,7 +123,7 @@ declare class TrezorAdapter implements IHardwareWallet {
148
123
  * can't interleave with a chain call on the same device (which would desync
149
124
  * the THP session selection).
150
125
  */
151
- getPassphraseState(connectId: string, passphraseState?: string, operationContext?: IDeviceManagerOperationContext): Promise<Response<string | null>>;
126
+ getPassphraseState(connectId: string, passphraseState?: string): Promise<Response<string | null>>;
152
127
  evmGetAddress(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmGetAddressParams>): Promise<Response<EvmAddress>>;
153
128
  evmSignTransaction(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmSignTxTrezorParams>): Promise<Response<EvmSignedTx>>;
154
129
  evmSignMessage(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmSignMsgParams>): Promise<Response<EvmSignature>>;
@@ -168,18 +143,9 @@ declare class TrezorAdapter implements IHardwareWallet {
168
143
  tronSignTransaction(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<TronSignTxParams>): Promise<Response<TronSignedTx>>;
169
144
  tronSignMessage(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<TronSignMsgParams>): Promise<Response<TronSignature>>;
170
145
  private static _unwrapConnectorResult;
171
- private _callConnector;
172
- private _assertConnectorIdle;
173
- private _runConnectorTeardown;
174
- private _disconnectSession;
175
- private _availableTransports;
176
- private _releaseProvisionalConnection;
177
- private _waitForConnectorOperationsToDrain;
178
- private _retainConnectorOperation;
146
+ private static _callConnector;
179
147
  private static _normalizeAllNetworkItem;
180
148
  private static _getItemDeviceId;
181
- /** UserAborted is a top-level abort code, so this ends the bundle. */
182
- private static _buildCancelledFailure;
183
149
  private _callAllNetworkMethod;
184
150
  on<K extends keyof HardwareEventMap>(event: K, listener: (event: HardwareEventMap[K]) => void): void;
185
151
  on(event: string, listener: DeviceEventListener): void;
@@ -190,13 +156,6 @@ declare class TrezorAdapter implements IHardwareWallet {
190
156
  private _callMethod;
191
157
  private _callWithRetry;
192
158
  private _ensureSession;
193
- /** An identity probe tears down only a session it opened; another caller's stays up. */
194
- private _hasSessionOrConnect;
195
- private _resolveExpectedDeviceConnectId;
196
- private _selectBleDeviceForBinding;
197
- private _emitBindingStatus;
198
- private _rememberVerifiedConnection;
199
- private _emitVerifiedBinding;
200
159
  /**
201
160
  * Pin the device's active wallet session to `passphraseState` (the target
202
161
  * wallet identity) before a wallet-bound op. THP has an app-session id; v1
@@ -454,4 +413,4 @@ declare function isTrezorBleServiceUuid(uuid: string): boolean;
454
413
  declare function isTrezorBleDescriptor(descriptor: TrezorBleDescriptor): boolean;
455
414
  declare function resolveTrezorBleConnectId(descriptor: TrezorBleDescriptor): string;
456
415
 
457
- export { type AuthenticateDeviceResult, type AuthenticityProof, type BuildEthereumDefinitionsForPathParams, type BuildEthereumDefinitionsForSignTxParams, DEFAULT_ETHEREUM_DEFINITIONS_BASE_URL, DEFAULT_SOLANA_TOKEN_DEFINITION_BASE_URL, type FetchEthereumDefinitionsParams, type FetchLike, type FetchSolanaTokenDefinitionParams, type SdkEvent, type SdkEventListener, type SdkLogEvent, TREZOR_BLE_PACKET_SIZE, TREZOR_BLE_SUPPORTED_MODELS, TREZOR_BLE_UUIDS, TREZOR_SAFE_7_MODEL, TrezorAdapter, type TrezorAdapterOptions, type TrezorBleDescriptor, type TrezorBleTransport, type TrezorBleTransportFactory, type TrezorConnectedDevice, type TrezorConnectorDevice, type TrezorKnownDeviceConnection, authenticateDeviceFromProof, buildEthereumDefinitionsForPath, buildEthereumDefinitionsForSignTx, fetchEthereumDefinitions, fetchSolanaTokenDefinition, getRequiredDeviceAuthenticityLayers, getSlip44FromPath, isTrezorBleDescriptor, isTrezorBleServiceUuid, isTrezorBleSupportedModel, isTrezorSafe7BleDescriptor, isTrezorSafe7BleName, normalizeTrezorBleUuid, offSdkEvent, onSdkEvent, resolveTrezorBleConnectId };
416
+ export { type AuthenticateDeviceResult, type AuthenticityProof, type BuildEthereumDefinitionsForPathParams, type BuildEthereumDefinitionsForSignTxParams, DEFAULT_ETHEREUM_DEFINITIONS_BASE_URL, DEFAULT_SOLANA_TOKEN_DEFINITION_BASE_URL, type FetchEthereumDefinitionsParams, type FetchLike, type FetchSolanaTokenDefinitionParams, type SdkEvent, type SdkEventListener, type SdkLogEvent, TREZOR_BLE_PACKET_SIZE, TREZOR_BLE_SUPPORTED_MODELS, TREZOR_BLE_UUIDS, TREZOR_SAFE_7_MODEL, TrezorAdapter, type TrezorBleDescriptor, type TrezorBleTransport, type TrezorBleTransportFactory, type TrezorConnectedDevice, type TrezorConnectorDevice, authenticateDeviceFromProof, buildEthereumDefinitionsForPath, buildEthereumDefinitionsForSignTx, fetchEthereumDefinitions, fetchSolanaTokenDefinition, getRequiredDeviceAuthenticityLayers, getSlip44FromPath, isTrezorBleDescriptor, isTrezorBleServiceUuid, isTrezorBleSupportedModel, isTrezorSafe7BleDescriptor, isTrezorSafe7BleName, normalizeTrezorBleUuid, offSdkEvent, onSdkEvent, resolveTrezorBleConnectId };