@onekeyfe/hwk-trezor-adapter 1.1.34-alpha.2 → 1.1.34-alpha.4
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 +98 -9
- package/dist/index.d.ts +98 -9
- package/dist/index.js +814 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +789 -47
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IHardwareWallet, IConnector, TransportType, DeviceInfo, Response, ChainCapability, AllNetworkGetAddressParams, AllNetworkAddressResponse, 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;
|
|
@@ -45,6 +45,7 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
45
45
|
private static _isStaleSessionError;
|
|
46
46
|
private static _errorCode;
|
|
47
47
|
private static _isConnectionUnavailableError;
|
|
48
|
+
private static _isRecoverableProtocolResidueError;
|
|
48
49
|
/**
|
|
49
50
|
* Race a promise against an abort signal. Copied from LedgerAdapter:
|
|
50
51
|
* IConnector.call() can't actually be cancelled at the protocol level, but
|
|
@@ -73,6 +74,21 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
73
74
|
getSupportedChains(): ChainCapability[];
|
|
74
75
|
allNetworkGetAddress(connectId: string, deviceId: string, params: AllNetworkGetAddressParams): Promise<Response<AllNetworkAddressResponse[]>>;
|
|
75
76
|
getFeatures(connectId: string): Promise<Response<Record<string, unknown>>>;
|
|
77
|
+
/**
|
|
78
|
+
* Device authenticity attestation. Sends a host-generated challenge, has the
|
|
79
|
+
* device sign it with its secure-element key, then verifies the returned
|
|
80
|
+
* certificate chain up to a trusted Trezor root CA. On success returns a
|
|
81
|
+
* `deviceId` that uniquely identifies the physical device, survives wipe, and
|
|
82
|
+
* cannot be forged from a seed. Only trust the result when `verified` is true
|
|
83
|
+
* (and `usedDebugKey` is false in production).
|
|
84
|
+
*
|
|
85
|
+
* Requires a secure-element model (Safe 3 = T2B1/T3B1, Safe 5 = T3T1, T3W1)
|
|
86
|
+
* and an on-device confirmation. Older models (T1B1, T2T1) will fail.
|
|
87
|
+
*
|
|
88
|
+
* `dangerouslyAllowDebugKeys` accepts simulator / development root keys — NEVER
|
|
89
|
+
* enable it in a production accounting flow, it lets an emulator mint any id.
|
|
90
|
+
*/
|
|
91
|
+
verifyDeviceAuthenticity(connectId: string, params?: DeviceAuthenticityParams): Promise<Response<DeviceAuthenticityResult>>;
|
|
76
92
|
deviceSettings(connectId: string, params: TrezorDeviceSettingsParams): Promise<Response<Record<string, unknown>>>;
|
|
77
93
|
setBrightness(connectId: string, params?: TrezorBrightnessParams): Promise<Response<Record<string, unknown>>>;
|
|
78
94
|
changePin(connectId: string, params?: TrezorChangePinParams): Promise<Response<Record<string, unknown>>>;
|
|
@@ -87,13 +103,14 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
87
103
|
*/
|
|
88
104
|
uiResponse(response: UiResponseEvent): void;
|
|
89
105
|
/**
|
|
90
|
-
* Returns
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
106
|
+
* Returns a stable per-seed identifier suitable for device-match verification.
|
|
107
|
+
*
|
|
108
|
+
* Trezor exposes `device_id` in Features — a server-generated UUID written
|
|
109
|
+
* during `wipe_device` and stable for the life of the seed. Unlike Ledger
|
|
110
|
+
* (no native id, so a per-chain address is hashed), Trezor's id is global
|
|
111
|
+
* across chains, so the `chain` argument is accepted for API parity but
|
|
112
|
+
* ignored. For unsupported chains we still surface the id (since it would
|
|
113
|
+
* be the same value anyway).
|
|
97
114
|
*/
|
|
98
115
|
getChainFingerprint(connectId: string, _deviceId: string, _chain: ChainForFingerprint): Promise<Response<string>>;
|
|
99
116
|
/**
|
|
@@ -189,6 +206,78 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
189
206
|
private _ensureDevicePermission;
|
|
190
207
|
}
|
|
191
208
|
|
|
209
|
+
type CertPubKeys = {
|
|
210
|
+
rootPubKeysOptiga: string[];
|
|
211
|
+
rootPubKeysTropic?: string[];
|
|
212
|
+
};
|
|
213
|
+
type ModelPubKeys = CertPubKeys & {
|
|
214
|
+
debug?: CertPubKeys;
|
|
215
|
+
};
|
|
216
|
+
interface DeviceAuthenticityConfig {
|
|
217
|
+
version: number;
|
|
218
|
+
[model: string]: ModelPubKeys | number | undefined;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** Raw fields taken from a Trezor `AuthenticityProof` message. */
|
|
222
|
+
type AuthenticityProof = {
|
|
223
|
+
optiga_certificates: string[];
|
|
224
|
+
optiga_signature: string;
|
|
225
|
+
tropic_certificates?: string[];
|
|
226
|
+
tropic_signature?: string;
|
|
227
|
+
mcu_certificates?: string[];
|
|
228
|
+
mcu_signature?: string;
|
|
229
|
+
};
|
|
230
|
+
type AuthenticateDeviceResult = {
|
|
231
|
+
/**
|
|
232
|
+
* True only when every layer implemented by this verifier and required by
|
|
233
|
+
* the explicit model policy verified up to a trusted Trezor root CA AND the
|
|
234
|
+
* device signed our challenge:
|
|
235
|
+
* - Optiga (all secure-element models), and
|
|
236
|
+
* - Tropic (T3W1 / Safe 7).
|
|
237
|
+
* This mirrors Trezor Connect's production authenticity policy. The raw MCU
|
|
238
|
+
* fields remain in the returned proof but are not a client-side pass/fail
|
|
239
|
+
* condition.
|
|
240
|
+
* The reward backend must independently verify the same raw proof under its
|
|
241
|
+
* own versioned policy; this client result is only a UX preview.
|
|
242
|
+
*/
|
|
243
|
+
verified: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Stable per-device identifier: the X.509 serial number (OID 2.5.4.5) when
|
|
246
|
+
* present (T3W1+), otherwise the SHA-256 of the device attestation public key.
|
|
247
|
+
* Survives wipe/recovery and cannot be forged from a seed. Do NOT trust when
|
|
248
|
+
* `verified` is false — it is then attacker-controlled.
|
|
249
|
+
*/
|
|
250
|
+
deviceId?: string;
|
|
251
|
+
/** Raw device attestation public key (hex) from the Optiga device certificate. */
|
|
252
|
+
deviceCertPubKey?: string;
|
|
253
|
+
/** X.509 subject serial number (hex), only present on T3W1 and above. */
|
|
254
|
+
serialNumber?: string;
|
|
255
|
+
rootPubKey?: string;
|
|
256
|
+
caPubKey?: string;
|
|
257
|
+
/**
|
|
258
|
+
* True when the chain matched a DEBUG/staging root key (simulator / dev
|
|
259
|
+
* device). A production accounting flow must reject verified results that
|
|
260
|
+
* have `usedDebugKey === true`.
|
|
261
|
+
*/
|
|
262
|
+
usedDebugKey?: boolean;
|
|
263
|
+
/** Failure reason when `verified` is false. */
|
|
264
|
+
error?: string;
|
|
265
|
+
};
|
|
266
|
+
declare const getRequiredDeviceAuthenticityLayers: (deviceModel: string) => readonly ('optiga' | 'tropic')[];
|
|
267
|
+
/**
|
|
268
|
+
* Verify a Trezor `AuthenticityProof` against a challenge and derive a stable
|
|
269
|
+
* per-device id. `challenge` must be the exact random bytes sent in the
|
|
270
|
+
* `AuthenticateDevice` request. Never throws — malformed input from a malicious
|
|
271
|
+
* device is folded into `{ verified: false }`.
|
|
272
|
+
*/
|
|
273
|
+
declare const authenticateDeviceFromProof: ({ proof, challenge, deviceModel, config, allowDebugKeys, }: {
|
|
274
|
+
proof: AuthenticityProof;
|
|
275
|
+
challenge: Buffer;
|
|
276
|
+
deviceModel: string;
|
|
277
|
+
config?: DeviceAuthenticityConfig | undefined;
|
|
278
|
+
allowDebugKeys?: boolean | undefined;
|
|
279
|
+
}) => AuthenticateDeviceResult;
|
|
280
|
+
|
|
192
281
|
/**
|
|
193
282
|
* Opt-in helpers for fetching Trezor Ethereum "definitions" — the SatoshiLabs-
|
|
194
283
|
* signed network/token metadata a Trezor device uses to render friendly names
|
|
@@ -323,4 +412,4 @@ declare function isTrezorBleServiceUuid(uuid: string): boolean;
|
|
|
323
412
|
declare function isTrezorBleDescriptor(descriptor: TrezorBleDescriptor): boolean;
|
|
324
413
|
declare function resolveTrezorBleConnectId(descriptor: TrezorBleDescriptor): string;
|
|
325
414
|
|
|
326
|
-
export { 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, buildEthereumDefinitionsForPath, buildEthereumDefinitionsForSignTx, fetchEthereumDefinitions, fetchSolanaTokenDefinition, getSlip44FromPath, isTrezorBleDescriptor, isTrezorBleServiceUuid, isTrezorBleSupportedModel, isTrezorSafe7BleDescriptor, isTrezorSafe7BleName, normalizeTrezorBleUuid, offSdkEvent, onSdkEvent, resolveTrezorBleConnectId };
|
|
415
|
+
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, DeviceInfo, Response, ChainCapability, AllNetworkGetAddressParams, AllNetworkAddressResponse, 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;
|
|
@@ -45,6 +45,7 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
45
45
|
private static _isStaleSessionError;
|
|
46
46
|
private static _errorCode;
|
|
47
47
|
private static _isConnectionUnavailableError;
|
|
48
|
+
private static _isRecoverableProtocolResidueError;
|
|
48
49
|
/**
|
|
49
50
|
* Race a promise against an abort signal. Copied from LedgerAdapter:
|
|
50
51
|
* IConnector.call() can't actually be cancelled at the protocol level, but
|
|
@@ -73,6 +74,21 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
73
74
|
getSupportedChains(): ChainCapability[];
|
|
74
75
|
allNetworkGetAddress(connectId: string, deviceId: string, params: AllNetworkGetAddressParams): Promise<Response<AllNetworkAddressResponse[]>>;
|
|
75
76
|
getFeatures(connectId: string): Promise<Response<Record<string, unknown>>>;
|
|
77
|
+
/**
|
|
78
|
+
* Device authenticity attestation. Sends a host-generated challenge, has the
|
|
79
|
+
* device sign it with its secure-element key, then verifies the returned
|
|
80
|
+
* certificate chain up to a trusted Trezor root CA. On success returns a
|
|
81
|
+
* `deviceId` that uniquely identifies the physical device, survives wipe, and
|
|
82
|
+
* cannot be forged from a seed. Only trust the result when `verified` is true
|
|
83
|
+
* (and `usedDebugKey` is false in production).
|
|
84
|
+
*
|
|
85
|
+
* Requires a secure-element model (Safe 3 = T2B1/T3B1, Safe 5 = T3T1, T3W1)
|
|
86
|
+
* and an on-device confirmation. Older models (T1B1, T2T1) will fail.
|
|
87
|
+
*
|
|
88
|
+
* `dangerouslyAllowDebugKeys` accepts simulator / development root keys — NEVER
|
|
89
|
+
* enable it in a production accounting flow, it lets an emulator mint any id.
|
|
90
|
+
*/
|
|
91
|
+
verifyDeviceAuthenticity(connectId: string, params?: DeviceAuthenticityParams): Promise<Response<DeviceAuthenticityResult>>;
|
|
76
92
|
deviceSettings(connectId: string, params: TrezorDeviceSettingsParams): Promise<Response<Record<string, unknown>>>;
|
|
77
93
|
setBrightness(connectId: string, params?: TrezorBrightnessParams): Promise<Response<Record<string, unknown>>>;
|
|
78
94
|
changePin(connectId: string, params?: TrezorChangePinParams): Promise<Response<Record<string, unknown>>>;
|
|
@@ -87,13 +103,14 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
87
103
|
*/
|
|
88
104
|
uiResponse(response: UiResponseEvent): void;
|
|
89
105
|
/**
|
|
90
|
-
* Returns
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
106
|
+
* Returns a stable per-seed identifier suitable for device-match verification.
|
|
107
|
+
*
|
|
108
|
+
* Trezor exposes `device_id` in Features — a server-generated UUID written
|
|
109
|
+
* during `wipe_device` and stable for the life of the seed. Unlike Ledger
|
|
110
|
+
* (no native id, so a per-chain address is hashed), Trezor's id is global
|
|
111
|
+
* across chains, so the `chain` argument is accepted for API parity but
|
|
112
|
+
* ignored. For unsupported chains we still surface the id (since it would
|
|
113
|
+
* be the same value anyway).
|
|
97
114
|
*/
|
|
98
115
|
getChainFingerprint(connectId: string, _deviceId: string, _chain: ChainForFingerprint): Promise<Response<string>>;
|
|
99
116
|
/**
|
|
@@ -189,6 +206,78 @@ declare class TrezorAdapter implements IHardwareWallet {
|
|
|
189
206
|
private _ensureDevicePermission;
|
|
190
207
|
}
|
|
191
208
|
|
|
209
|
+
type CertPubKeys = {
|
|
210
|
+
rootPubKeysOptiga: string[];
|
|
211
|
+
rootPubKeysTropic?: string[];
|
|
212
|
+
};
|
|
213
|
+
type ModelPubKeys = CertPubKeys & {
|
|
214
|
+
debug?: CertPubKeys;
|
|
215
|
+
};
|
|
216
|
+
interface DeviceAuthenticityConfig {
|
|
217
|
+
version: number;
|
|
218
|
+
[model: string]: ModelPubKeys | number | undefined;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** Raw fields taken from a Trezor `AuthenticityProof` message. */
|
|
222
|
+
type AuthenticityProof = {
|
|
223
|
+
optiga_certificates: string[];
|
|
224
|
+
optiga_signature: string;
|
|
225
|
+
tropic_certificates?: string[];
|
|
226
|
+
tropic_signature?: string;
|
|
227
|
+
mcu_certificates?: string[];
|
|
228
|
+
mcu_signature?: string;
|
|
229
|
+
};
|
|
230
|
+
type AuthenticateDeviceResult = {
|
|
231
|
+
/**
|
|
232
|
+
* True only when every layer implemented by this verifier and required by
|
|
233
|
+
* the explicit model policy verified up to a trusted Trezor root CA AND the
|
|
234
|
+
* device signed our challenge:
|
|
235
|
+
* - Optiga (all secure-element models), and
|
|
236
|
+
* - Tropic (T3W1 / Safe 7).
|
|
237
|
+
* This mirrors Trezor Connect's production authenticity policy. The raw MCU
|
|
238
|
+
* fields remain in the returned proof but are not a client-side pass/fail
|
|
239
|
+
* condition.
|
|
240
|
+
* The reward backend must independently verify the same raw proof under its
|
|
241
|
+
* own versioned policy; this client result is only a UX preview.
|
|
242
|
+
*/
|
|
243
|
+
verified: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Stable per-device identifier: the X.509 serial number (OID 2.5.4.5) when
|
|
246
|
+
* present (T3W1+), otherwise the SHA-256 of the device attestation public key.
|
|
247
|
+
* Survives wipe/recovery and cannot be forged from a seed. Do NOT trust when
|
|
248
|
+
* `verified` is false — it is then attacker-controlled.
|
|
249
|
+
*/
|
|
250
|
+
deviceId?: string;
|
|
251
|
+
/** Raw device attestation public key (hex) from the Optiga device certificate. */
|
|
252
|
+
deviceCertPubKey?: string;
|
|
253
|
+
/** X.509 subject serial number (hex), only present on T3W1 and above. */
|
|
254
|
+
serialNumber?: string;
|
|
255
|
+
rootPubKey?: string;
|
|
256
|
+
caPubKey?: string;
|
|
257
|
+
/**
|
|
258
|
+
* True when the chain matched a DEBUG/staging root key (simulator / dev
|
|
259
|
+
* device). A production accounting flow must reject verified results that
|
|
260
|
+
* have `usedDebugKey === true`.
|
|
261
|
+
*/
|
|
262
|
+
usedDebugKey?: boolean;
|
|
263
|
+
/** Failure reason when `verified` is false. */
|
|
264
|
+
error?: string;
|
|
265
|
+
};
|
|
266
|
+
declare const getRequiredDeviceAuthenticityLayers: (deviceModel: string) => readonly ('optiga' | 'tropic')[];
|
|
267
|
+
/**
|
|
268
|
+
* Verify a Trezor `AuthenticityProof` against a challenge and derive a stable
|
|
269
|
+
* per-device id. `challenge` must be the exact random bytes sent in the
|
|
270
|
+
* `AuthenticateDevice` request. Never throws — malformed input from a malicious
|
|
271
|
+
* device is folded into `{ verified: false }`.
|
|
272
|
+
*/
|
|
273
|
+
declare const authenticateDeviceFromProof: ({ proof, challenge, deviceModel, config, allowDebugKeys, }: {
|
|
274
|
+
proof: AuthenticityProof;
|
|
275
|
+
challenge: Buffer;
|
|
276
|
+
deviceModel: string;
|
|
277
|
+
config?: DeviceAuthenticityConfig | undefined;
|
|
278
|
+
allowDebugKeys?: boolean | undefined;
|
|
279
|
+
}) => AuthenticateDeviceResult;
|
|
280
|
+
|
|
192
281
|
/**
|
|
193
282
|
* Opt-in helpers for fetching Trezor Ethereum "definitions" — the SatoshiLabs-
|
|
194
283
|
* signed network/token metadata a Trezor device uses to render friendly names
|
|
@@ -323,4 +412,4 @@ declare function isTrezorBleServiceUuid(uuid: string): boolean;
|
|
|
323
412
|
declare function isTrezorBleDescriptor(descriptor: TrezorBleDescriptor): boolean;
|
|
324
413
|
declare function resolveTrezorBleConnectId(descriptor: TrezorBleDescriptor): string;
|
|
325
414
|
|
|
326
|
-
export { 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, buildEthereumDefinitionsForPath, buildEthereumDefinitionsForSignTx, fetchEthereumDefinitions, fetchSolanaTokenDefinition, getSlip44FromPath, isTrezorBleDescriptor, isTrezorBleServiceUuid, isTrezorBleSupportedModel, isTrezorSafe7BleDescriptor, isTrezorSafe7BleName, normalizeTrezorBleUuid, offSdkEvent, onSdkEvent, resolveTrezorBleConnectId };
|
|
415
|
+
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 };
|