@trezor/connect 9.3.0 → 9.3.1-beta.1

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 (54) hide show
  1. package/CHANGELOG.md +63 -8
  2. package/README.md +1 -1
  3. package/lib/api/checkFirmwareAuthenticity.d.ts +2 -1
  4. package/lib/api/checkFirmwareAuthenticity.js +34 -26
  5. package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +1 -0
  6. package/lib/api/ethereum/ethereumDefinitions.js +1 -0
  7. package/lib/api/firmware/getBinary.d.ts +4 -4
  8. package/lib/api/firmware/getBinary.js +4 -15
  9. package/lib/api/firmware/getBinaryForFirmwareUpgrade.d.ts +11 -0
  10. package/lib/api/firmware/getBinaryForFirmwareUpgrade.js +32 -0
  11. package/lib/api/firmware/index.d.ts +1 -0
  12. package/lib/api/firmware/index.js +3 -1
  13. package/lib/api/firmware/verifyAuthenticityProof.d.ts +1 -1
  14. package/lib/api/firmware/verifyAuthenticityProof.js +37 -2
  15. package/lib/api/firmware/x509certificate.d.ts +20 -6
  16. package/lib/api/firmware/x509certificate.js +82 -13
  17. package/lib/api/getCoinInfo.d.ts +3 -0
  18. package/lib/api/getFeatures.d.ts +1 -0
  19. package/lib/backend/Blockchain.js +10 -1
  20. package/lib/core/AbstractMethod.js +1 -0
  21. package/lib/core/index.d.ts +3 -3
  22. package/lib/core/index.js +23 -6
  23. package/lib/core/onCallFirmwareUpdate.js +25 -14
  24. package/lib/data/DataManager.d.ts +11 -0
  25. package/lib/data/DataManager.js +1 -1
  26. package/lib/data/coinInfo.d.ts +14 -0
  27. package/lib/data/config.d.ts +11 -0
  28. package/lib/data/config.js +17 -1
  29. package/lib/data/connectSettings.js +3 -2
  30. package/lib/data/deviceAuthenticityConfig.d.ts +1 -28
  31. package/lib/data/deviceAuthenticityConfig.js +25 -24
  32. package/lib/data/deviceAuthenticityConfigTypes.d.ts +38 -0
  33. package/lib/data/deviceAuthenticityConfigTypes.js +28 -0
  34. package/lib/data/models.d.ts +10 -0
  35. package/lib/data/models.js +12 -10
  36. package/lib/data/version.d.ts +1 -1
  37. package/lib/data/version.js +1 -1
  38. package/lib/device/Device.d.ts +1 -3
  39. package/lib/device/Device.js +7 -21
  40. package/lib/device/DeviceCommands.js +1 -26
  41. package/lib/events/core.d.ts +2 -2
  42. package/lib/events/transport.d.ts +5 -0
  43. package/lib/index.js +20 -20
  44. package/lib/types/api/authenticateDevice.d.ts +9 -0
  45. package/lib/types/api/authenticateDevice.js +2 -2
  46. package/lib/types/api/checkFirmwareAuthenticity.d.ts +4 -1
  47. package/lib/types/api/init.d.ts +2 -2
  48. package/lib/types/coinInfo.d.ts +7 -0
  49. package/lib/types/firmware.d.ts +2 -2
  50. package/lib/types/settings.d.ts +7 -3
  51. package/lib/utils/assetUtils.js +1 -0
  52. package/package.json +9 -10
  53. package/lib/core/coreManager.d.ts +0 -16
  54. package/lib/core/coreManager.js +0 -55
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeviceAuthenticityConfig = void 0;
4
+ const schema_utils_1 = require("@trezor/schema-utils");
5
+ const constants_1 = require("../constants");
6
+ const CertPubKeys = schema_utils_1.Type.Object({
7
+ rootPubKeys: schema_utils_1.Type.Array(schema_utils_1.Type.String()),
8
+ caPubKeys: schema_utils_1.Type.Array(schema_utils_1.Type.String()),
9
+ });
10
+ const ModelsWithKeys = schema_utils_1.Type.Exclude(schema_utils_1.Type.KeyOfEnum(constants_1.PROTO.DeviceModelInternal), schema_utils_1.Type.Union([schema_utils_1.Type.Literal('T1B1'), schema_utils_1.Type.Literal('T2T1')]));
11
+ const ModelsWithoutKeys = schema_utils_1.Type.Extract(schema_utils_1.Type.KeyOfEnum(constants_1.PROTO.DeviceModelInternal), schema_utils_1.Type.Union([schema_utils_1.Type.Literal('T1B1'), schema_utils_1.Type.Literal('T2T1')]));
12
+ const ModelPubKeys = schema_utils_1.Type.Intersect([
13
+ schema_utils_1.Type.Record(ModelsWithKeys, schema_utils_1.Type.Intersect([
14
+ CertPubKeys,
15
+ schema_utils_1.Type.Object({
16
+ debug: schema_utils_1.Type.Optional(CertPubKeys),
17
+ }),
18
+ ])),
19
+ schema_utils_1.Type.Partial(schema_utils_1.Type.Record(ModelsWithoutKeys, schema_utils_1.Type.Undefined())),
20
+ ]);
21
+ exports.DeviceAuthenticityConfig = schema_utils_1.Type.Intersect([
22
+ ModelPubKeys,
23
+ schema_utils_1.Type.Object({
24
+ version: schema_utils_1.Type.Number(),
25
+ timestamp: schema_utils_1.Type.String(),
26
+ }),
27
+ ]);
28
+ //# sourceMappingURL=deviceAuthenticityConfigTypes.js.map
@@ -17,6 +17,16 @@ export declare const models: {
17
17
  '5': string;
18
18
  };
19
19
  };
20
+ T3B1: {
21
+ name: string;
22
+ colors: {
23
+ '1': string;
24
+ '2': string;
25
+ '3': string;
26
+ '4': string;
27
+ '5': string;
28
+ };
29
+ };
20
30
  T3T1: {
21
31
  name: string;
22
32
  colors: {
@@ -1,6 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.models = void 0;
4
+ const t2b1 = {
5
+ name: 'Trezor Safe 3',
6
+ colors: {
7
+ '1': 'Cosmic Black',
8
+ '2': 'Stellar Silver',
9
+ '3': 'Solar Gold',
10
+ '4': 'Galactic Rose',
11
+ '5': 'Bitcoin Orange',
12
+ },
13
+ };
4
14
  exports.models = {
5
15
  T1B1: {
6
16
  name: 'Trezor Model One',
@@ -10,16 +20,8 @@ exports.models = {
10
20
  name: 'Trezor Model T',
11
21
  colors: {},
12
22
  },
13
- T2B1: {
14
- name: 'Trezor Safe 3',
15
- colors: {
16
- '1': 'Cosmic Black',
17
- '2': 'Stellar Silver',
18
- '3': 'Solar Gold',
19
- '4': 'Galactic Rose',
20
- '5': 'Bitcoin Orange',
21
- },
22
- },
23
+ T2B1: t2b1,
24
+ T3B1: t2b1,
23
25
  T3T1: {
24
26
  name: 'Trezor Safe 5',
25
27
  colors: {
@@ -1,3 +1,3 @@
1
- export declare const VERSION = "9.3.0";
1
+ export declare const VERSION = "9.3.1-beta.1";
2
2
  export declare const DEFAULT_DOMAIN: string;
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_DOMAIN = exports.VERSION = void 0;
4
- exports.VERSION = '9.3.0';
4
+ exports.VERSION = '9.3.1-beta.1';
5
5
  const versionN = exports.VERSION.split('.').map(s => parseInt(s, 10));
6
6
  const isBeta = exports.VERSION.includes('beta');
7
7
  exports.DEFAULT_DOMAIN = isBeta
@@ -12,7 +12,6 @@ export type RunOptions = {
12
12
  onlyOneActivity?: boolean;
13
13
  cancelPopupRequest?: () => any;
14
14
  keepSession?: boolean;
15
- useEmptyPassphrase?: boolean;
16
15
  useCardanoDerivation?: boolean;
17
16
  };
18
17
  export declare const GET_FEATURES_TIMEOUT = 3000;
@@ -71,8 +70,7 @@ export declare class Device extends TypedEmitter<DeviceEvents> {
71
70
  setExternalState(state?: string): void;
72
71
  getExternalState(): string;
73
72
  validateState(preauthorized?: boolean): Promise<string | undefined>;
74
- useLegacyPassphrase(): boolean;
75
- initialize(useEmptyPassphrase: boolean, useCardanoDerivation: boolean): Promise<void>;
73
+ initialize(useCardanoDerivation: boolean): Promise<void>;
76
74
  getFeatures(): Promise<void>;
77
75
  changeLanguage({ language, binary, }: {
78
76
  language?: undefined;
@@ -172,7 +172,7 @@ class Device extends utils_1.TypedEmitter {
172
172
  await this.acquire();
173
173
  try {
174
174
  if (fn) {
175
- await this.initialize(!!options.useEmptyPassphrase, !!options.useCardanoDerivation);
175
+ await this.initialize(!!options.useCardanoDerivation);
176
176
  }
177
177
  else {
178
178
  await Promise.race([
@@ -232,9 +232,6 @@ class Device extends utils_1.TypedEmitter {
232
232
  this.activitySessionID = null;
233
233
  this.keepSession = false;
234
234
  }
235
- if (this.isT1() && this.useLegacyPassphrase()) {
236
- this.setInternalState(undefined);
237
- }
238
235
  }
239
236
  this.instance = instance;
240
237
  }
@@ -247,9 +244,6 @@ class Device extends utils_1.TypedEmitter {
247
244
  }
248
245
  else if (state !== this.internalState[this.instance]) {
249
246
  this.internalState[this.instance] = state;
250
- if (this.useLegacyPassphrase() && this.isT1()) {
251
- return;
252
- }
253
247
  this.emit(events_1.DEVICE.SAVE_STATE, state);
254
248
  }
255
249
  }
@@ -279,7 +273,7 @@ class Device extends utils_1.TypedEmitter {
279
273
  const expectedState = this.getExternalState();
280
274
  const state = await this.getCommands().getDeviceState();
281
275
  const uniqueState = `${state}@${this.features.device_id || 'device_id'}:${this.instance}`;
282
- if (!this.useLegacyPassphrase() && this.features.session_id) {
276
+ if (this.features.session_id) {
283
277
  this.setInternalState(this.features.session_id);
284
278
  }
285
279
  if (expectedState && expectedState !== uniqueState) {
@@ -289,26 +283,15 @@ class Device extends utils_1.TypedEmitter {
289
283
  this.setExternalState(uniqueState);
290
284
  }
291
285
  }
292
- useLegacyPassphrase() {
293
- return !this.atLeast(['1.9.0', '2.3.0']);
294
- }
295
- async initialize(useEmptyPassphrase, useCardanoDerivation) {
286
+ async initialize(useCardanoDerivation) {
296
287
  let payload;
297
288
  if (this.features) {
298
- const legacy = this.useLegacyPassphrase();
299
289
  const internalState = this.getInternalState();
300
290
  payload = {};
301
291
  payload.derive_cardano = useCardanoDerivation;
302
- if (!legacy && internalState) {
292
+ if (internalState) {
303
293
  payload.session_id = internalState;
304
294
  }
305
- if (legacy && !this.isT1()) {
306
- payload.session_id = internalState;
307
- if (useEmptyPassphrase) {
308
- payload._skip_passphrase = useEmptyPassphrase;
309
- payload.session_id = undefined;
310
- }
311
- }
312
295
  }
313
296
  const { message } = await this.getCommands().typedCall('Initialize', 'Features', payload);
314
297
  this._updateFeatures(message);
@@ -340,6 +323,9 @@ class Device extends utils_1.TypedEmitter {
340
323
  version: this.getVersion(),
341
324
  internal_model: this.features.internal_model,
342
325
  });
326
+ if (!downloadedBinary) {
327
+ throw constants_1.ERRORS.TypedError('Runtime', 'changeLanguage: translation not found');
328
+ }
343
329
  return this._uploadTranslationData(downloadedBinary);
344
330
  }
345
331
  async _uploadTranslationData(payload) {
@@ -260,9 +260,6 @@ class DeviceCommands {
260
260
  }
261
261
  if (res.type === 'ButtonRequest') {
262
262
  this._cancelableRequestBySend = true;
263
- if (res.message.code === '_Deprecated_ButtonRequest_PassphraseType') {
264
- res.message.code = 'ButtonRequest_PassphraseType';
265
- }
266
263
  if (res.message.code === 'ButtonRequest_PassphraseEntry') {
267
264
  this.device.emit(events_1.DEVICE.PASSPHRASE_ON_DEVICE);
268
265
  }
@@ -285,25 +282,8 @@ class DeviceCommands {
285
282
  }), () => this._commonCall('Cancel', {}));
286
283
  }
287
284
  if (res.type === 'PassphraseRequest') {
288
- const state = this.device.getInternalState();
289
- const legacy = this.device.useLegacyPassphrase();
290
- const legacyT1 = legacy && this.device.isT1();
291
- if (legacyT1 && typeof state === 'string') {
292
- return this._commonCall('PassphraseAck', { passphrase: state });
293
- }
294
- if (legacy && res.message._on_device) {
295
- this.device.emit(events_1.DEVICE.PASSPHRASE_ON_DEVICE);
296
- return this._commonCall('PassphraseAck', { _state: state });
297
- }
298
285
  return this._promptPassphrase().then(response => {
299
- const { passphrase, passphraseOnDevice, cache } = response;
300
- if (legacyT1) {
301
- this.device.setInternalState(cache ? passphrase : undefined);
302
- return this._commonCall('PassphraseAck', { passphrase });
303
- }
304
- if (legacy) {
305
- return this._commonCall('PassphraseAck', { passphrase, _state: state });
306
- }
286
+ const { passphrase, passphraseOnDevice } = response;
307
287
  return !passphraseOnDevice
308
288
  ? this._commonCall('PassphraseAck', { passphrase })
309
289
  : this._commonCall('PassphraseAck', { on_device: true });
@@ -311,11 +291,6 @@ class DeviceCommands {
311
291
  throw err || e;
312
292
  }));
313
293
  }
314
- if (res.type === 'Deprecated_PassphraseStateRequest') {
315
- const { state } = res.message;
316
- this.device.setInternalState(state);
317
- return this._commonCall('Deprecated_PassphraseStateAck', {});
318
- }
319
294
  if (res.type === 'WordRequest') {
320
295
  return this._promptWord(res.message.type).then(word => this._commonCall('WordAck', { word }), () => this._commonCall('Cancel', {}));
321
296
  }
@@ -3,12 +3,12 @@ import type { IFrameCallMessage, MethodResponseMessage } from './call';
3
3
  import type { DeviceEventMessage } from './device';
4
4
  import type { IFrameEventMessage, IFrameInit, IFrameLogRequest } from './iframe';
5
5
  import type { PopupAnalyticsResponse, PopupClosedMessage, PopupEventMessage } from './popup';
6
- import type { TransportEventMessage, TransportDisableWebUSB, TransportRequestWebUSBDevice } from './transport';
6
+ import type { TransportEventMessage, TransportDisableWebUSB, TransportRequestWebUSBDevice, TransportGetInfo } from './transport';
7
7
  import type { UiEventMessage } from './ui-request';
8
8
  import type { UiResponseEvent } from './ui-response';
9
9
  import type { Unsuccessful } from '../types/params';
10
10
  export declare const CORE_EVENT = "CORE_EVENT";
11
- export type CoreRequestMessage = PopupClosedMessage | PopupAnalyticsResponse | TransportDisableWebUSB | TransportRequestWebUSBDevice | UiResponseEvent | IFrameInit | IFrameCallMessage | IFrameLogRequest;
11
+ export type CoreRequestMessage = PopupClosedMessage | PopupAnalyticsResponse | TransportDisableWebUSB | TransportRequestWebUSBDevice | TransportGetInfo | UiResponseEvent | IFrameInit | IFrameCallMessage | IFrameLogRequest;
12
12
  export type CoreEventMessage = {
13
13
  success?: boolean;
14
14
  channel?: {
@@ -52,6 +52,11 @@ export interface TransportRequestWebUSBDevice {
52
52
  type: typeof TRANSPORT.REQUEST_DEVICE;
53
53
  payload?: undefined;
54
54
  }
55
+ export interface TransportGetInfo {
56
+ id: number;
57
+ type: typeof TRANSPORT.GET_INFO;
58
+ payload?: undefined;
59
+ }
55
60
  export type TransportEventMessage = TransportEvent & {
56
61
  event: typeof TRANSPORT_EVENT;
57
62
  };
package/lib/index.js CHANGED
@@ -30,7 +30,7 @@ const onCoreEvent = (message) => {
30
30
  var _a;
31
31
  const { event, type, payload } = message;
32
32
  if (type === events_2.UI.REQUEST_UI_WINDOW) {
33
- (_a = coreManager.getCore()) === null || _a === void 0 ? void 0 : _a.handleMessage({ type: events_2.POPUP.HANDSHAKE });
33
+ (_a = coreManager.get()) === null || _a === void 0 ? void 0 : _a.handleMessage({ type: events_2.POPUP.HANDSHAKE });
34
34
  return;
35
35
  }
36
36
  if (type === events_2.POPUP.CANCEL_POPUP_REQUEST)
@@ -64,11 +64,8 @@ const onCoreEvent = (message) => {
64
64
  _log.warn('Undefined message', event, message);
65
65
  }
66
66
  };
67
- const init = async (settings = {}) => {
67
+ const initSettings = (settings = {}) => {
68
68
  var _a;
69
- if (coreManager.getCore() || coreManager.getInitPromise()) {
70
- throw constants_1.ERRORS.TypedError('Init_AlreadyInitialized');
71
- }
72
69
  _settings = (0, connectSettings_1.parseConnectSettings)({ ..._settings, ...settings, popup: false });
73
70
  if (!_settings.manifest) {
74
71
  throw constants_1.ERRORS.TypedError('Init_ManifestMissing');
@@ -76,19 +73,25 @@ const init = async (settings = {}) => {
76
73
  if (!((_a = _settings.transports) === null || _a === void 0 ? void 0 : _a.length)) {
77
74
  _settings.transports = ['BridgeTransport'];
78
75
  }
79
- if (_settings.lazyLoad) {
80
- _settings.lazyLoad = false;
81
- return;
76
+ };
77
+ const init = async (settings = {}) => {
78
+ if (coreManager.get() || coreManager.getPending()) {
79
+ throw constants_1.ERRORS.TypedError('Init_AlreadyInitialized');
80
+ }
81
+ initSettings(settings);
82
+ if (!_settings.lazyLoad) {
83
+ await coreManager.getOrInit(_settings, onCoreEvent);
82
84
  }
83
- await coreManager.getOrInitCore(_settings, onCoreEvent);
85
+ };
86
+ const initCore = () => {
87
+ initSettings({ lazyLoad: false });
88
+ return coreManager.getOrInit(_settings, onCoreEvent);
84
89
  };
85
90
  const call = async (params) => {
91
+ var _a, _b;
86
92
  let core;
87
93
  try {
88
- if (!coreManager.getCore() && !coreManager.getInitPromise()) {
89
- await init();
90
- }
91
- core = await coreManager.getOrInitCore(_settings, onCoreEvent);
94
+ core = (_b = (_a = coreManager.get()) !== null && _a !== void 0 ? _a : (await coreManager.getPending())) !== null && _b !== void 0 ? _b : (await initCore());
92
95
  }
93
96
  catch (error) {
94
97
  return (0, events_2.createErrorMessage)(error);
@@ -101,10 +104,7 @@ const call = async (params) => {
101
104
  id: promiseId,
102
105
  });
103
106
  const response = await promise;
104
- if (response) {
105
- return response;
106
- }
107
- return (0, events_2.createErrorMessage)(constants_1.ERRORS.TypedError('Method_NoResponse'));
107
+ return response !== null && response !== void 0 ? response : (0, events_2.createErrorMessage)(constants_1.ERRORS.TypedError('Method_NoResponse'));
108
108
  }
109
109
  catch (error) {
110
110
  _log.error('call', error);
@@ -112,7 +112,7 @@ const call = async (params) => {
112
112
  }
113
113
  };
114
114
  const uiResponse = (response) => {
115
- const core = coreManager.getCore();
115
+ const core = coreManager.get();
116
116
  if (!core) {
117
117
  throw constants_1.ERRORS.TypedError('Init_NotInitialized');
118
118
  }
@@ -121,7 +121,7 @@ const uiResponse = (response) => {
121
121
  const requestLogin = async (params) => {
122
122
  if (typeof params.callback === 'function') {
123
123
  const { callback } = params;
124
- const core = coreManager.getCore();
124
+ const core = coreManager.get();
125
125
  const loginChallengeListener = async (event) => {
126
126
  const { data } = event;
127
127
  if (data && data.type === events_2.UI.LOGIN_CHALLENGE_REQUEST) {
@@ -153,7 +153,7 @@ const requestLogin = async (params) => {
153
153
  return call({ method: 'requestLogin', ...params });
154
154
  };
155
155
  const cancel = (error) => {
156
- const core = coreManager.getCore();
156
+ const core = coreManager.get();
157
157
  if (!core) {
158
158
  throw constants_1.ERRORS.TypedError('Runtime', 'postMessage: _core not found');
159
159
  }
@@ -12,6 +12,15 @@ export declare const AuthenticateDeviceParams: import("@sinclair/typebox").TObje
12
12
  caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
13
13
  }>>;
14
14
  }>]>;
15
+ T3B1: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
16
+ rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
17
+ caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
18
+ }>, import("@sinclair/typebox").TObject<{
19
+ debug: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
20
+ rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
21
+ caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
22
+ }>>;
23
+ }>]>;
15
24
  T3T1: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
16
25
  rootPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
17
26
  caPubKeys: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthenticateDeviceParams = void 0;
4
4
  const schema_utils_1 = require("@trezor/schema-utils");
5
- const deviceAuthenticityConfig_1 = require("../../data/deviceAuthenticityConfig");
5
+ const deviceAuthenticityConfigTypes_1 = require("../../data/deviceAuthenticityConfigTypes");
6
6
  exports.AuthenticateDeviceParams = schema_utils_1.Type.Object({
7
- config: schema_utils_1.Type.Optional(deviceAuthenticityConfig_1.DeviceAuthenticityConfig),
7
+ config: schema_utils_1.Type.Optional(deviceAuthenticityConfigTypes_1.DeviceAuthenticityConfig),
8
8
  allowDebugKeys: schema_utils_1.Type.Optional(schema_utils_1.Type.Boolean()),
9
9
  });
10
10
  //# sourceMappingURL=authenticateDevice.js.map
@@ -4,5 +4,8 @@ export interface CheckFirmwareAuthenticityResponse {
4
4
  actualFirmwareHash: string;
5
5
  valid: boolean;
6
6
  }
7
- export declare function checkFirmwareAuthenticity(params: CommonParams): Response<CheckFirmwareAuthenticityResponse>;
7
+ export type CheckFirmwareAuthenticityParams = CommonParams & {
8
+ baseUrl?: string;
9
+ };
10
+ export declare function checkFirmwareAuthenticity(params: CheckFirmwareAuthenticityParams): Response<CheckFirmwareAuthenticityResponse>;
8
11
  //# sourceMappingURL=checkFirmwareAuthenticity.d.ts.map
@@ -1,5 +1,5 @@
1
- import type { ConnectSettings, Manifest } from '../settings';
1
+ import type { ConnectSettingsPublic, Manifest } from '../settings';
2
2
  export declare function init(settings: {
3
3
  manifest: Manifest;
4
- } & Partial<ConnectSettings>): Promise<void>;
4
+ } & Partial<ConnectSettingsPublic>): Promise<void>;
5
5
  //# sourceMappingURL=init.d.ts.map
@@ -27,6 +27,7 @@ export declare const CoinSupport: import("@sinclair/typebox").TObject<{
27
27
  T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
28
28
  T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
29
29
  T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
30
+ T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
30
31
  T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
31
32
  connect: import("@sinclair/typebox").TBoolean;
32
33
  }>;
@@ -45,6 +46,7 @@ export declare const BitcoinNetworkInfo: import("@sinclair/typebox").TIntersect<
45
46
  T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
46
47
  T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
47
48
  T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
49
+ T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
48
50
  T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
49
51
  connect: import("@sinclair/typebox").TBoolean;
50
52
  }>;
@@ -103,6 +105,7 @@ export declare const EthereumNetworkInfo: import("@sinclair/typebox").TIntersect
103
105
  T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
104
106
  T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
105
107
  T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
108
+ T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
106
109
  T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
107
110
  connect: import("@sinclair/typebox").TBoolean;
108
111
  }>;
@@ -136,6 +139,7 @@ export declare const MiscNetworkInfo: import("@sinclair/typebox").TIntersect<[im
136
139
  T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
137
140
  T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
138
141
  T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
142
+ T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
139
143
  T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
140
144
  connect: import("@sinclair/typebox").TBoolean;
141
145
  }>;
@@ -169,6 +173,7 @@ export declare const CoinInfo: import("@sinclair/typebox").TUnion<[import("@sinc
169
173
  T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
170
174
  T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
171
175
  T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
176
+ T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
172
177
  T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
173
178
  connect: import("@sinclair/typebox").TBoolean;
174
179
  }>;
@@ -225,6 +230,7 @@ export declare const CoinInfo: import("@sinclair/typebox").TUnion<[import("@sinc
225
230
  T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
226
231
  T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
227
232
  T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
233
+ T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
228
234
  T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
229
235
  connect: import("@sinclair/typebox").TBoolean;
230
236
  }>;
@@ -256,6 +262,7 @@ export declare const CoinInfo: import("@sinclair/typebox").TUnion<[import("@sinc
256
262
  T1B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
257
263
  T2T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
258
264
  T2B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
265
+ T3B1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
259
266
  T3T1: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<false>]>;
260
267
  connect: import("@sinclair/typebox").TBoolean;
261
268
  }>;
@@ -8,14 +8,14 @@ export type FirmwareRelease = {
8
8
  required: boolean;
9
9
  url: string;
10
10
  fingerprint: string;
11
- changelog: string;
11
+ changelog: string | string[];
12
+ changelog_bitcoinonly?: string | string[];
12
13
  version: VersionArray;
13
14
  min_firmware_version: VersionArray;
14
15
  min_bootloader_version: VersionArray;
15
16
  bootloader_version?: VersionArray;
16
17
  url_bitcoinonly?: string;
17
18
  fingerprint_bitcoinonly?: string;
18
- notes?: string;
19
19
  channel?: string;
20
20
  translations?: string[];
21
21
  };
@@ -6,7 +6,7 @@ export interface Manifest {
6
6
  email: string;
7
7
  }
8
8
  export type Proxy = BlockchainSettings['proxy'];
9
- export interface ConnectSettings {
9
+ export interface ConnectSettingsPublic {
10
10
  manifest?: Manifest;
11
11
  connectSrc?: string;
12
12
  debug?: boolean;
@@ -19,6 +19,11 @@ export interface ConnectSettings {
19
19
  pendingTransportEvent?: boolean;
20
20
  lazyLoad?: boolean;
21
21
  interactionTimeout?: number;
22
+ trustedHost: boolean;
23
+ coreMode?: 'auto' | 'popup' | 'iframe';
24
+ _extendWebextensionLifetime?: boolean;
25
+ }
26
+ export interface ConnectSettingsInternal {
22
27
  origin?: string;
23
28
  configSrc: string;
24
29
  iframeSrc: string;
@@ -26,13 +31,12 @@ export interface ConnectSettings {
26
31
  webusbSrc: string;
27
32
  version: string;
28
33
  priority: number;
29
- trustedHost: boolean;
30
34
  extension?: string;
31
35
  env: 'node' | 'web' | 'webextension' | 'electron' | 'react-native';
32
36
  timestamp: number;
33
37
  proxy?: Proxy;
34
38
  sharedLogger?: boolean;
35
39
  useCoreInPopup?: boolean;
36
- _extendWebextensionLifetime?: boolean;
37
40
  }
41
+ export type ConnectSettings = ConnectSettingsPublic & ConnectSettingsInternal;
38
42
  //# sourceMappingURL=settings.d.ts.map
@@ -9,6 +9,7 @@ const firmwareAssets = {
9
9
  [types_1.DeviceModelInternal.T1B1]: require('@trezor/connect-common/files/firmware/t1b1/releases.json'),
10
10
  [types_1.DeviceModelInternal.T2T1]: require('@trezor/connect-common/files/firmware/t2t1/releases.json'),
11
11
  [types_1.DeviceModelInternal.T2B1]: require('@trezor/connect-common/files/firmware/t2b1/releases.json'),
12
+ [types_1.DeviceModelInternal.T3B1]: require('@trezor/connect-common/files/firmware/t2b1/releases.json'),
12
13
  [types_1.DeviceModelInternal.T3T1]: require('@trezor/connect-common/files/firmware/t3t1/releases.json'),
13
14
  };
14
15
  const getAssetByUrl = (url) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trezor/connect",
3
- "version": "9.3.0",
3
+ "version": "9.3.1-beta.1",
4
4
  "author": "Trezor <info@trezor.io>",
5
5
  "homepage": "https://github.com/trezor/trezor-suite/tree/develop/packages/connect",
6
6
  "description": "High-level javascript interface for Trezor hardware wallet.",
@@ -68,18 +68,18 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@babel/preset-typescript": "^7.23.3",
71
- "@ethereumjs/common": "^4.2.0",
72
- "@ethereumjs/tx": "^5.2.1",
71
+ "@ethereumjs/common": "^4.3.0",
72
+ "@ethereumjs/tx": "^5.3.0",
73
73
  "@fivebinaries/coin-selection": "2.2.1",
74
- "@trezor/blockchain-link": "2.2.0",
75
- "@trezor/blockchain-link-types": "1.1.0",
74
+ "@trezor/blockchain-link": "2.2.1-beta.1",
75
+ "@trezor/blockchain-link-types": "1.1.1-beta.1",
76
76
  "@trezor/connect-analytics": "1.1.0",
77
- "@trezor/connect-common": "0.1.0",
78
- "@trezor/protobuf": "1.1.0",
77
+ "@trezor/connect-common": "0.1.1-beta.1",
78
+ "@trezor/protobuf": "1.1.1-beta.1",
79
79
  "@trezor/protocol": "1.1.0",
80
80
  "@trezor/schema-utils": "1.1.0",
81
- "@trezor/transport": "1.2.0",
82
- "@trezor/utils": "9.1.0",
81
+ "@trezor/transport": "1.2.1-beta.1",
82
+ "@trezor/utils": "9.1.1-beta.1",
83
83
  "@trezor/utxo-lib": "2.1.0",
84
84
  "blakejs": "^1.2.1",
85
85
  "bs58": "^5.0.0",
@@ -90,7 +90,6 @@
90
90
  "@trezor/trezor-user-env-link": "1.0.2",
91
91
  "@types/karma": "^6.3.8",
92
92
  "babel-loader": "^9.1.3",
93
- "ethereum-cryptography": "^2.1.3",
94
93
  "jest": "29.7.0",
95
94
  "karma": "^6.4.2",
96
95
  "karma-babel-preprocessor": "^8.0.2",
@@ -1,16 +0,0 @@
1
- /// <reference types="node" />
2
- import { EventEmitter } from 'events';
3
- import { CoreEventMessage } from '../events';
4
- import { ConnectSettings } from '../types';
5
- type CoreInstance = EventEmitter & {
6
- init: (settings: ConnectSettings, onCoreEvent: (message: CoreEventMessage) => void, ...rest: any[]) => Promise<void>;
7
- dispose: () => any;
8
- };
9
- export declare const initCoreManager: <Core extends CoreInstance>(core: Core) => {
10
- getOrInitCore: (...[settings, onCoreEvent, ...rest]: Parameters<Core["init"]>) => Promise<Core>;
11
- getCore: () => Core | undefined;
12
- getInitPromise: () => Promise<Core> | undefined;
13
- dispose: () => void;
14
- };
15
- export {};
16
- //# sourceMappingURL=coreManager.d.ts.map