@onekeyfe/hwk-trezor-adapter 1.2.3-alpha.4 → 1.2.3-alpha.6
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 +25 -53
- package/dist/index.d.ts +25 -53
- package/dist/index.js +207 -1044
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +190 -1027
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IHardwareWallet, IConnector, TransportType,
|
|
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,20 +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
11
|
private readonly _connector;
|
|
21
12
|
private readonly _emitter;
|
|
22
|
-
private readonly _operations;
|
|
23
13
|
private readonly _devices;
|
|
24
14
|
private readonly _sessions;
|
|
25
15
|
private readonly _connectingPromises;
|
|
@@ -27,16 +17,8 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
27
17
|
private readonly _uiRegistry;
|
|
28
18
|
private readonly _passphraseRequestContextByConnectId;
|
|
29
19
|
private readonly _verifiedPassphraseSessionsByConnectId;
|
|
30
|
-
/** Raw connector calls that outlive an aborted caller, keyed by session. */
|
|
31
|
-
private readonly _unsettledConnectorOperations;
|
|
32
|
-
private readonly _connectorIdleWaiters;
|
|
33
|
-
private _resetPromise;
|
|
34
|
-
private _connectorTeardownTail;
|
|
35
|
-
private _pendingConnectorTeardowns;
|
|
36
|
-
private _stateGeneration;
|
|
37
20
|
private readonly _jobQueue;
|
|
38
|
-
|
|
39
|
-
constructor(connector: IConnector, options?: TrezorAdapterOptions);
|
|
21
|
+
constructor(connector: IConnector);
|
|
40
22
|
private static _createDeviceBusyError;
|
|
41
23
|
/**
|
|
42
24
|
* Split a Trezor-only `passphraseState` routing hint off the chain params so
|
|
@@ -59,17 +41,19 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
59
41
|
* selected is gone (the device evicted it from its limited slot pool). The
|
|
60
42
|
* caller drops the stale cache entry and recreates from scratch.
|
|
61
43
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
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).
|
|
64
47
|
*/
|
|
65
48
|
private static _isStaleSessionError;
|
|
66
49
|
private static _errorCode;
|
|
67
50
|
private static _isConnectionUnavailableError;
|
|
68
51
|
private static _isRecoverableProtocolResidueError;
|
|
69
52
|
/**
|
|
70
|
-
* Race a promise against an abort signal.
|
|
71
|
-
* be cancelled at the protocol level,
|
|
72
|
-
*
|
|
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.
|
|
73
57
|
*/
|
|
74
58
|
private static _abortable;
|
|
75
59
|
private _connectSession;
|
|
@@ -82,20 +66,17 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
82
66
|
* error flows. Aborts active jobs and releases UI waits.
|
|
83
67
|
*/
|
|
84
68
|
resetState(): void;
|
|
85
|
-
private _resetStateAndDisconnectSessions;
|
|
86
69
|
getAvailableTransports(): TransportType[];
|
|
87
70
|
switchTransport(_type: TransportType): Promise<void>;
|
|
88
|
-
searchDevices(options?:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
private _releaseOperationConnection;
|
|
96
|
-
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[];
|
|
97
78
|
allNetworkGetAddress(connectId: string, deviceId: string, params: AllNetworkGetAddressParams): Promise<Response<AllNetworkAddressResponse[]>>;
|
|
98
|
-
getFeatures(connectId: string
|
|
79
|
+
getFeatures(connectId: string): Promise<Response<Record<string, unknown>>>;
|
|
99
80
|
/**
|
|
100
81
|
* Device authenticity attestation. Sends a host-generated challenge, has the
|
|
101
82
|
* device sign it with its secure-element key, then verifies the returned
|
|
@@ -111,10 +92,10 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
111
92
|
* enable it in a production accounting flow, it lets an emulator mint any id.
|
|
112
93
|
*/
|
|
113
94
|
verifyDeviceAuthenticity(connectId: string, params?: DeviceAuthenticityParams): Promise<Response<DeviceAuthenticityResult>>;
|
|
114
|
-
deviceSettings(connectId: string, params: TrezorDeviceSettingsParams
|
|
115
|
-
setBrightness(connectId: string, params?: TrezorBrightnessParams
|
|
116
|
-
changePin(connectId: string, params?: TrezorChangePinParams
|
|
117
|
-
wipeDevice(connectId: string
|
|
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>>>;
|
|
118
99
|
private _getTrezorDeviceId;
|
|
119
100
|
cancel(connectId?: string): void;
|
|
120
101
|
/**
|
|
@@ -133,7 +114,7 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
133
114
|
* Unlike Ledger (which hashes a per-chain address), it is chain-global, so
|
|
134
115
|
* `chain` is accepted for API parity but ignored.
|
|
135
116
|
*/
|
|
136
|
-
getChainFingerprint(connectId: string,
|
|
117
|
+
getChainFingerprint(connectId: string, _deviceId: string, _chain: ChainForFingerprint): Promise<Response<string>>;
|
|
137
118
|
/**
|
|
138
119
|
* Resolve the active passphrase wallet identity (`passphraseState`).
|
|
139
120
|
* See {@link IHardwareWallet.getPassphraseState} for the discover/verify
|
|
@@ -142,7 +123,7 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
142
123
|
* can't interleave with a chain call on the same device (which would desync
|
|
143
124
|
* the THP session selection).
|
|
144
125
|
*/
|
|
145
|
-
getPassphraseState(connectId: string, passphraseState?: string
|
|
126
|
+
getPassphraseState(connectId: string, passphraseState?: string): Promise<Response<string | null>>;
|
|
146
127
|
evmGetAddress(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmGetAddressParams>): Promise<Response<EvmAddress>>;
|
|
147
128
|
evmSignTransaction(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmSignTxTrezorParams>): Promise<Response<EvmSignedTx>>;
|
|
148
129
|
evmSignMessage(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmSignMsgParams>): Promise<Response<EvmSignature>>;
|
|
@@ -162,12 +143,7 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
162
143
|
tronSignTransaction(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<TronSignTxParams>): Promise<Response<TronSignedTx>>;
|
|
163
144
|
tronSignMessage(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<TronSignMsgParams>): Promise<Response<TronSignature>>;
|
|
164
145
|
private static _unwrapConnectorResult;
|
|
165
|
-
private _callConnector;
|
|
166
|
-
private _assertConnectorIdle;
|
|
167
|
-
private _runConnectorTeardown;
|
|
168
|
-
private _releaseProvisionalConnection;
|
|
169
|
-
private _waitForConnectorOperationsToDrain;
|
|
170
|
-
private _retainConnectorOperation;
|
|
146
|
+
private static _callConnector;
|
|
171
147
|
private static _normalizeAllNetworkItem;
|
|
172
148
|
private static _getItemDeviceId;
|
|
173
149
|
private _callAllNetworkMethod;
|
|
@@ -180,10 +156,6 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
180
156
|
private _callMethod;
|
|
181
157
|
private _callWithRetry;
|
|
182
158
|
private _ensureSession;
|
|
183
|
-
private _resolveExpectedDeviceConnectId;
|
|
184
|
-
private _selectBleDeviceForBinding;
|
|
185
|
-
private _rememberVerifiedConnection;
|
|
186
|
-
private _emitVerifiedBinding;
|
|
187
159
|
/**
|
|
188
160
|
* Pin the device's active wallet session to `passphraseState` (the target
|
|
189
161
|
* wallet identity) before a wallet-bound op. THP has an app-session id; v1
|
|
@@ -441,4 +413,4 @@ declare function isTrezorBleServiceUuid(uuid: string): boolean;
|
|
|
441
413
|
declare function isTrezorBleDescriptor(descriptor: TrezorBleDescriptor): boolean;
|
|
442
414
|
declare function resolveTrezorBleConnectId(descriptor: TrezorBleDescriptor): string;
|
|
443
415
|
|
|
444
|
-
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
|
|
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,
|
|
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,20 +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
11
|
private readonly _connector;
|
|
21
12
|
private readonly _emitter;
|
|
22
|
-
private readonly _operations;
|
|
23
13
|
private readonly _devices;
|
|
24
14
|
private readonly _sessions;
|
|
25
15
|
private readonly _connectingPromises;
|
|
@@ -27,16 +17,8 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
27
17
|
private readonly _uiRegistry;
|
|
28
18
|
private readonly _passphraseRequestContextByConnectId;
|
|
29
19
|
private readonly _verifiedPassphraseSessionsByConnectId;
|
|
30
|
-
/** Raw connector calls that outlive an aborted caller, keyed by session. */
|
|
31
|
-
private readonly _unsettledConnectorOperations;
|
|
32
|
-
private readonly _connectorIdleWaiters;
|
|
33
|
-
private _resetPromise;
|
|
34
|
-
private _connectorTeardownTail;
|
|
35
|
-
private _pendingConnectorTeardowns;
|
|
36
|
-
private _stateGeneration;
|
|
37
20
|
private readonly _jobQueue;
|
|
38
|
-
|
|
39
|
-
constructor(connector: IConnector, options?: TrezorAdapterOptions);
|
|
21
|
+
constructor(connector: IConnector);
|
|
40
22
|
private static _createDeviceBusyError;
|
|
41
23
|
/**
|
|
42
24
|
* Split a Trezor-only `passphraseState` routing hint off the chain params so
|
|
@@ -59,17 +41,19 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
59
41
|
* selected is gone (the device evicted it from its limited slot pool). The
|
|
60
42
|
* caller drops the stale cache entry and recreates from scratch.
|
|
61
43
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
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).
|
|
64
47
|
*/
|
|
65
48
|
private static _isStaleSessionError;
|
|
66
49
|
private static _errorCode;
|
|
67
50
|
private static _isConnectionUnavailableError;
|
|
68
51
|
private static _isRecoverableProtocolResidueError;
|
|
69
52
|
/**
|
|
70
|
-
* Race a promise against an abort signal.
|
|
71
|
-
* be cancelled at the protocol level,
|
|
72
|
-
*
|
|
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.
|
|
73
57
|
*/
|
|
74
58
|
private static _abortable;
|
|
75
59
|
private _connectSession;
|
|
@@ -82,20 +66,17 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
82
66
|
* error flows. Aborts active jobs and releases UI waits.
|
|
83
67
|
*/
|
|
84
68
|
resetState(): void;
|
|
85
|
-
private _resetStateAndDisconnectSessions;
|
|
86
69
|
getAvailableTransports(): TransportType[];
|
|
87
70
|
switchTransport(_type: TransportType): Promise<void>;
|
|
88
|
-
searchDevices(options?:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
private _releaseOperationConnection;
|
|
96
|
-
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[];
|
|
97
78
|
allNetworkGetAddress(connectId: string, deviceId: string, params: AllNetworkGetAddressParams): Promise<Response<AllNetworkAddressResponse[]>>;
|
|
98
|
-
getFeatures(connectId: string
|
|
79
|
+
getFeatures(connectId: string): Promise<Response<Record<string, unknown>>>;
|
|
99
80
|
/**
|
|
100
81
|
* Device authenticity attestation. Sends a host-generated challenge, has the
|
|
101
82
|
* device sign it with its secure-element key, then verifies the returned
|
|
@@ -111,10 +92,10 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
111
92
|
* enable it in a production accounting flow, it lets an emulator mint any id.
|
|
112
93
|
*/
|
|
113
94
|
verifyDeviceAuthenticity(connectId: string, params?: DeviceAuthenticityParams): Promise<Response<DeviceAuthenticityResult>>;
|
|
114
|
-
deviceSettings(connectId: string, params: TrezorDeviceSettingsParams
|
|
115
|
-
setBrightness(connectId: string, params?: TrezorBrightnessParams
|
|
116
|
-
changePin(connectId: string, params?: TrezorChangePinParams
|
|
117
|
-
wipeDevice(connectId: string
|
|
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>>>;
|
|
118
99
|
private _getTrezorDeviceId;
|
|
119
100
|
cancel(connectId?: string): void;
|
|
120
101
|
/**
|
|
@@ -133,7 +114,7 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
133
114
|
* Unlike Ledger (which hashes a per-chain address), it is chain-global, so
|
|
134
115
|
* `chain` is accepted for API parity but ignored.
|
|
135
116
|
*/
|
|
136
|
-
getChainFingerprint(connectId: string,
|
|
117
|
+
getChainFingerprint(connectId: string, _deviceId: string, _chain: ChainForFingerprint): Promise<Response<string>>;
|
|
137
118
|
/**
|
|
138
119
|
* Resolve the active passphrase wallet identity (`passphraseState`).
|
|
139
120
|
* See {@link IHardwareWallet.getPassphraseState} for the discover/verify
|
|
@@ -142,7 +123,7 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
142
123
|
* can't interleave with a chain call on the same device (which would desync
|
|
143
124
|
* the THP session selection).
|
|
144
125
|
*/
|
|
145
|
-
getPassphraseState(connectId: string, passphraseState?: string
|
|
126
|
+
getPassphraseState(connectId: string, passphraseState?: string): Promise<Response<string | null>>;
|
|
146
127
|
evmGetAddress(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmGetAddressParams>): Promise<Response<EvmAddress>>;
|
|
147
128
|
evmSignTransaction(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmSignTxTrezorParams>): Promise<Response<EvmSignedTx>>;
|
|
148
129
|
evmSignMessage(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<EvmSignMsgParams>): Promise<Response<EvmSignature>>;
|
|
@@ -162,12 +143,7 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
162
143
|
tronSignTransaction(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<TronSignTxParams>): Promise<Response<TronSignedTx>>;
|
|
163
144
|
tronSignMessage(connectId?: string | null, deviceId?: string | null, params?: TrezorCallParams<TronSignMsgParams>): Promise<Response<TronSignature>>;
|
|
164
145
|
private static _unwrapConnectorResult;
|
|
165
|
-
private _callConnector;
|
|
166
|
-
private _assertConnectorIdle;
|
|
167
|
-
private _runConnectorTeardown;
|
|
168
|
-
private _releaseProvisionalConnection;
|
|
169
|
-
private _waitForConnectorOperationsToDrain;
|
|
170
|
-
private _retainConnectorOperation;
|
|
146
|
+
private static _callConnector;
|
|
171
147
|
private static _normalizeAllNetworkItem;
|
|
172
148
|
private static _getItemDeviceId;
|
|
173
149
|
private _callAllNetworkMethod;
|
|
@@ -180,10 +156,6 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
180
156
|
private _callMethod;
|
|
181
157
|
private _callWithRetry;
|
|
182
158
|
private _ensureSession;
|
|
183
|
-
private _resolveExpectedDeviceConnectId;
|
|
184
|
-
private _selectBleDeviceForBinding;
|
|
185
|
-
private _rememberVerifiedConnection;
|
|
186
|
-
private _emitVerifiedBinding;
|
|
187
159
|
/**
|
|
188
160
|
* Pin the device's active wallet session to `passphraseState` (the target
|
|
189
161
|
* wallet identity) before a wallet-bound op. THP has an app-session id; v1
|
|
@@ -441,4 +413,4 @@ declare function isTrezorBleServiceUuid(uuid: string): boolean;
|
|
|
441
413
|
declare function isTrezorBleDescriptor(descriptor: TrezorBleDescriptor): boolean;
|
|
442
414
|
declare function resolveTrezorBleConnectId(descriptor: TrezorBleDescriptor): string;
|
|
443
415
|
|
|
444
|
-
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
|
|
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 };
|