@trezor/connect 9.0.0 → 9.0.2

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @trezor/connect
2
2
 
3
- API version 9.0.0
3
+ API version 9.0.2
4
4
 
5
5
  [![Build Status](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml/badge.svg)](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml)
6
6
  [![NPM](https://img.shields.io/npm/v/@trezor/connect.svg)](https://www.npmjs.org/package/@trezor/connect)
@@ -34,18 +34,18 @@ import TrezorConnect from '@trezor/connect';
34
34
 
35
35
  For more instructions [refer to this document](../../docs/packages/connect/index.md)
36
36
 
37
- ## Version 9+ (experimental)
37
+ ## Version 9 (stable)
38
38
 
39
39
  Since version 9 we are adopting a new versioning strategy. With every release, we are going to update two urls
40
40
 
41
- - A] The latest release will always be available on https://connect.trezor.io/9/trezor-connect.js.
42
- - B] For those who like to have more control over their dependencies, there will be also a new url created in form of https://connect.trezor.io/9.1../trezor-connect.js. Please note that these endpoints will not receive any further updates including security updates.
41
+ - A) The latest release will always be available on https://connect.trezor.io/9/trezor-connect.js.
42
+ - B) For those who like to have more control over their dependencies, there will be also a new url created in form of https://connect.trezor.io/9.1../trezor-connect.js. Please note that these endpoints will not receive any further updates including security updates.
43
43
 
44
- Version 9+ will be available as `@trezor/connect` and `@trezor/connect-web` npm packages.
44
+ Version 9 is available as `@trezor/connect` and `@trezor/connect-web` npm packages.
45
45
 
46
- ## Version 8 (stable)
46
+ ## Version 8 (legacy)
47
47
 
48
- Currently, we are at version 8, which has an url https://connect.trezor.io/8/trezor-connect.js.
48
+ Legacy version 8 is accessible from url https://connect.trezor.io/8/trezor-connect.js.
49
49
 
50
50
  Version 8 is available as `trezor-connect` npm package.
51
51
 
@@ -0,0 +1,10 @@
1
+ import { AbstractMethod } from '../core/AbstractMethod';
2
+ export default class CheckFirmwareAuthenticity extends AbstractMethod<'checkFirmwareAuthenticity'> {
3
+ init(): void;
4
+ run(): Promise<{
5
+ expectedFirmwareHash: string;
6
+ actualFirmwareHash: string;
7
+ valid: boolean;
8
+ }>;
9
+ }
10
+ //# sourceMappingURL=checkFirmwareAuthenticity.d.ts.map
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const randombytes_1 = tslib_1.__importDefault(require("randombytes"));
5
+ const AbstractMethod_1 = require("../core/AbstractMethod");
6
+ const firmware_1 = require("./firmware");
7
+ const firmwareInfo_1 = require("../data/firmwareInfo");
8
+ const constants_1 = require("../constants");
9
+ const assets_1 = require("../utils/assets");
10
+ class CheckFirmwareAuthenticity extends AbstractMethod_1.AbstractMethod {
11
+ init() {
12
+ this.useEmptyPassphrase = true;
13
+ this.requiredPermissions = ['management'];
14
+ this.useDeviceState = false;
15
+ }
16
+ async run() {
17
+ const { device } = this;
18
+ const deviceVersion = `${device.features.major_version}.${device.features.minor_version}.${device.features.patch_version}`;
19
+ const releases = (0, firmwareInfo_1.getReleases)(device.features.major_version);
20
+ const release = releases.find(release => release.version.join('.') === deviceVersion);
21
+ if (!release) {
22
+ throw constants_1.ERRORS.TypedError('Runtime', 'checkFirmwareAuthenticity: No release found for device firmware');
23
+ }
24
+ const baseUrl = `https://data.trezor.io/firmware/${device.features.major_version}`;
25
+ const fwUrl = `${baseUrl}/trezor-${deviceVersion}${device.firmwareType === 'bitcoin-only' ? '-bitcoinonly.bin' : '.bin'}`;
26
+ const fw = await (0, assets_1.httpRequest)(fwUrl, 'binary');
27
+ if (!fw) {
28
+ throw constants_1.ERRORS.TypedError('Runtime', 'checkFirmwareAuthenticity: firmware binary not found');
29
+ }
30
+ const { hash: expectedFirmwareHash, challenge } = (0, firmware_1.calculateFirmwareHash)(device.features.major_version, (0, firmware_1.stripFwHeaders)(fw), (0, randombytes_1.default)(32));
31
+ const result = await this.device.commands.typedCall('GetFirmwareHash', 'FirmwareHash', {
32
+ challenge,
33
+ });
34
+ const { message } = result;
35
+ const { hash: actualFirmwareHash } = message;
36
+ return {
37
+ expectedFirmwareHash,
38
+ actualFirmwareHash,
39
+ valid: actualFirmwareHash === expectedFirmwareHash,
40
+ };
41
+ }
42
+ }
43
+ exports.default = CheckFirmwareAuthenticity;
44
+ //# sourceMappingURL=checkFirmwareAuthenticity.js.map
@@ -61,4 +61,5 @@ export { default as tezosGetPublicKey } from './tezosGetPublicKey';
61
61
  export { default as tezosSignTransaction } from './tezosSignTransaction';
62
62
  export { default as verifyMessage } from './verifyMessage';
63
63
  export { default as wipeDevice } from './wipeDevice';
64
+ export { default as checkFirmwareAuthenticity } from './checkFirmwareAuthenticity';
64
65
  //# sourceMappingURL=index.d.ts.map
package/lib/api/index.js CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.requestLogin = exports.recoveryDevice = exports.rebootToBootloader = exports.pushTransaction = exports.nemSignTransaction = exports.nemGetAddress = exports.getSettings = exports.getPublicKey = exports.getOwnershipProof = exports.getOwnershipId = exports.getFirmwareHash = exports.getFeatures = exports.getDeviceState = exports.getCoinInfo = exports.getAddress = exports.getAccountInfo = exports.firmwareUpdate = exports.ethereumVerifyMessage = exports.ethereumSignTypedData = exports.ethereumSignTransaction = exports.ethereumSignMessage = exports.ethereumGetPublicKey = exports.ethereumGetAddress = exports.eosSignTransaction = exports.eosGetPublicKey = exports.composeTransaction = exports.cipherKeyValue = exports.changePin = exports.cardanoSignTransaction = exports.cardanoGetPublicKey = exports.cardanoGetNativeScriptHash = exports.cardanoGetAddress = exports.blockchainUnsubscribeFiatRates = exports.blockchainUnsubscribe = exports.blockchainSubscribeFiatRates = exports.blockchainSubscribe = exports.blockchainSetCustomBackend = exports.blockchainGetTransactions = exports.blockchainGetFiatRatesForTimestamps = exports.blockchainGetCurrentFiatRates = exports.blockchainGetAccountBalanceHistory = exports.blockchainEstimateFee = exports.blockchainDisconnect = exports.binanceSignTransaction = exports.binanceGetPublicKey = exports.binanceGetAddress = exports.backupDevice = exports.authorizeCoinJoin = exports.applySettings = exports.applyFlags = void 0;
7
- exports.wipeDevice = exports.verifyMessage = exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = exports.stellarSignTransaction = exports.stellarGetAddress = exports.signTransaction = exports.signMessage = exports.setProxy = exports.rippleSignTransaction = exports.rippleGetAddress = exports.resetDevice = void 0;
7
+ exports.checkFirmwareAuthenticity = exports.wipeDevice = exports.verifyMessage = exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = exports.stellarSignTransaction = exports.stellarGetAddress = exports.signTransaction = exports.signMessage = exports.setProxy = exports.rippleSignTransaction = exports.rippleGetAddress = exports.resetDevice = void 0;
8
8
  var applyFlags_1 = require("./applyFlags");
9
9
  Object.defineProperty(exports, "applyFlags", { enumerable: true, get: function () { return __importDefault(applyFlags_1).default; } });
10
10
  var applySettings_1 = require("./applySettings");
@@ -131,4 +131,6 @@ var verifyMessage_1 = require("./verifyMessage");
131
131
  Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return __importDefault(verifyMessage_1).default; } });
132
132
  var wipeDevice_1 = require("./wipeDevice");
133
133
  Object.defineProperty(exports, "wipeDevice", { enumerable: true, get: function () { return __importDefault(wipeDevice_1).default; } });
134
+ var checkFirmwareAuthenticity_1 = require("./checkFirmwareAuthenticity");
135
+ Object.defineProperty(exports, "checkFirmwareAuthenticity", { enumerable: true, get: function () { return __importDefault(checkFirmwareAuthenticity_1).default; } });
134
136
  //# sourceMappingURL=index.js.map
@@ -7,7 +7,7 @@ export declare const onCall: (message: CoreMessage) => Promise<void>;
7
7
  export declare class Core extends EventEmitter {
8
8
  handleMessage(message: any, isTrustedOrigin: boolean): void;
9
9
  dispose(): void;
10
- getCurrentMethod(): (import("../api").applyFlags | import("../api").applySettings | import("../api").authorizeCoinJoin | import("../api").backupDevice | import("../api").binanceGetAddress | import("../api").binanceGetPublicKey | import("../api").binanceSignTransaction | import("../api").blockchainDisconnect | import("../api").blockchainEstimateFee | import("../api").blockchainGetAccountBalanceHistory | import("../api").blockchainGetCurrentFiatRates | import("../api").blockchainGetFiatRatesForTimestamps | import("../api").blockchainGetTransactions | import("../api").blockchainSetCustomBackend | import("../api").blockchainSubscribe | import("../api").blockchainSubscribeFiatRates | import("../api").blockchainUnsubscribe | import("../api").blockchainUnsubscribeFiatRates | import("../api").cardanoGetAddress | import("../api").cardanoGetNativeScriptHash | import("../api").cardanoGetPublicKey | import("../api").cardanoSignTransaction | import("../api").changePin | import("../api").cipherKeyValue | import("../api").composeTransaction | import("../api").eosGetPublicKey | import("../api").eosSignTransaction | import("../api").ethereumGetAddress | import("../api").ethereumGetPublicKey | import("../api").ethereumSignMessage | import("../api").ethereumSignTransaction | import("../api").ethereumSignTypedData | import("../api").ethereumVerifyMessage | import("../api").firmwareUpdate | import("../api").getAccountInfo | import("../api").getAddress | import("../api").getCoinInfo | import("../api").getDeviceState | import("../api").getFeatures | import("../api").getFirmwareHash | import("../api").getOwnershipId | import("../api").getOwnershipProof | import("../api").getPublicKey | import("../api").getSettings | import("../api").nemGetAddress | import("../api").nemSignTransaction | import("../api").pushTransaction | import("../api").rebootToBootloader | import("../api").recoveryDevice | import("../api").requestLogin | import("../api").resetDevice | import("../api").rippleGetAddress | import("../api").rippleSignTransaction | import("../api").setProxy | import("../api").signMessage | import("../api").signTransaction | import("../api").stellarGetAddress | import("../api").stellarSignTransaction | import("../api").tezosGetAddress | import("../api").tezosGetPublicKey | import("../api").tezosSignTransaction | import("../api").verifyMessage | import("../api").wipeDevice)[];
10
+ getCurrentMethod(): (import("../api").applyFlags | import("../api").applySettings | import("../api").authorizeCoinJoin | import("../api").backupDevice | import("../api").binanceGetAddress | import("../api").binanceGetPublicKey | import("../api").binanceSignTransaction | import("../api").blockchainDisconnect | import("../api").blockchainEstimateFee | import("../api").blockchainGetAccountBalanceHistory | import("../api").blockchainGetCurrentFiatRates | import("../api").blockchainGetFiatRatesForTimestamps | import("../api").blockchainGetTransactions | import("../api").blockchainSetCustomBackend | import("../api").blockchainSubscribe | import("../api").blockchainSubscribeFiatRates | import("../api").blockchainUnsubscribe | import("../api").blockchainUnsubscribeFiatRates | import("../api").cardanoGetAddress | import("../api").cardanoGetNativeScriptHash | import("../api").cardanoGetPublicKey | import("../api").cardanoSignTransaction | import("../api").changePin | import("../api").cipherKeyValue | import("../api").composeTransaction | import("../api").eosGetPublicKey | import("../api").eosSignTransaction | import("../api").ethereumGetAddress | import("../api").ethereumGetPublicKey | import("../api").ethereumSignMessage | import("../api").ethereumSignTransaction | import("../api").ethereumSignTypedData | import("../api").ethereumVerifyMessage | import("../api").firmwareUpdate | import("../api").getAccountInfo | import("../api").getAddress | import("../api").getCoinInfo | import("../api").getDeviceState | import("../api").getFeatures | import("../api").getFirmwareHash | import("../api").getOwnershipId | import("../api").getOwnershipProof | import("../api").getPublicKey | import("../api").getSettings | import("../api").nemGetAddress | import("../api").nemSignTransaction | import("../api").pushTransaction | import("../api").rebootToBootloader | import("../api").recoveryDevice | import("../api").requestLogin | import("../api").resetDevice | import("../api").rippleGetAddress | import("../api").rippleSignTransaction | import("../api").setProxy | import("../api").signMessage | import("../api").signTransaction | import("../api").stellarGetAddress | import("../api").stellarSignTransaction | import("../api").tezosGetAddress | import("../api").tezosGetPublicKey | import("../api").tezosSignTransaction | import("../api").verifyMessage | import("../api").wipeDevice | import("../api").checkFirmwareAuthenticity)[];
11
11
  getTransportInfo(): TransportInfo;
12
12
  }
13
13
  export declare const initCore: () => Core;
@@ -2,5 +2,5 @@ import * as Methods from '../api';
2
2
  import type { IFrameCallMessage } from '../events';
3
3
  export declare const getMethod: (message: IFrameCallMessage & {
4
4
  id?: number;
5
- }) => Methods.applyFlags | Methods.applySettings | Methods.authorizeCoinJoin | Methods.backupDevice | Methods.binanceGetAddress | Methods.binanceGetPublicKey | Methods.binanceSignTransaction | Methods.blockchainDisconnect | Methods.blockchainEstimateFee | Methods.blockchainGetAccountBalanceHistory | Methods.blockchainGetCurrentFiatRates | Methods.blockchainGetFiatRatesForTimestamps | Methods.blockchainGetTransactions | Methods.blockchainSetCustomBackend | Methods.blockchainSubscribe | Methods.blockchainSubscribeFiatRates | Methods.blockchainUnsubscribe | Methods.blockchainUnsubscribeFiatRates | Methods.cardanoGetAddress | Methods.cardanoGetNativeScriptHash | Methods.cardanoGetPublicKey | Methods.cardanoSignTransaction | Methods.changePin | Methods.cipherKeyValue | Methods.composeTransaction | Methods.eosGetPublicKey | Methods.eosSignTransaction | Methods.ethereumGetAddress | Methods.ethereumGetPublicKey | Methods.ethereumSignMessage | Methods.ethereumSignTransaction | Methods.ethereumSignTypedData | Methods.ethereumVerifyMessage | Methods.firmwareUpdate | Methods.getAccountInfo | Methods.getAddress | Methods.getCoinInfo | Methods.getDeviceState | Methods.getFeatures | Methods.getFirmwareHash | Methods.getOwnershipId | Methods.getOwnershipProof | Methods.getPublicKey | Methods.getSettings | Methods.nemGetAddress | Methods.nemSignTransaction | Methods.pushTransaction | Methods.rebootToBootloader | Methods.recoveryDevice | Methods.requestLogin | Methods.resetDevice | Methods.rippleGetAddress | Methods.rippleSignTransaction | Methods.setProxy | Methods.signMessage | Methods.signTransaction | Methods.stellarGetAddress | Methods.stellarSignTransaction | Methods.tezosGetAddress | Methods.tezosGetPublicKey | Methods.tezosSignTransaction | Methods.verifyMessage | Methods.wipeDevice;
5
+ }) => Methods.applyFlags | Methods.applySettings | Methods.authorizeCoinJoin | Methods.backupDevice | Methods.binanceGetAddress | Methods.binanceGetPublicKey | Methods.binanceSignTransaction | Methods.blockchainDisconnect | Methods.blockchainEstimateFee | Methods.blockchainGetAccountBalanceHistory | Methods.blockchainGetCurrentFiatRates | Methods.blockchainGetFiatRatesForTimestamps | Methods.blockchainGetTransactions | Methods.blockchainSetCustomBackend | Methods.blockchainSubscribe | Methods.blockchainSubscribeFiatRates | Methods.blockchainUnsubscribe | Methods.blockchainUnsubscribeFiatRates | Methods.cardanoGetAddress | Methods.cardanoGetNativeScriptHash | Methods.cardanoGetPublicKey | Methods.cardanoSignTransaction | Methods.changePin | Methods.cipherKeyValue | Methods.composeTransaction | Methods.eosGetPublicKey | Methods.eosSignTransaction | Methods.ethereumGetAddress | Methods.ethereumGetPublicKey | Methods.ethereumSignMessage | Methods.ethereumSignTransaction | Methods.ethereumSignTypedData | Methods.ethereumVerifyMessage | Methods.firmwareUpdate | Methods.getAccountInfo | Methods.getAddress | Methods.getCoinInfo | Methods.getDeviceState | Methods.getFeatures | Methods.getFirmwareHash | Methods.getOwnershipId | Methods.getOwnershipProof | Methods.getPublicKey | Methods.getSettings | Methods.nemGetAddress | Methods.nemSignTransaction | Methods.pushTransaction | Methods.rebootToBootloader | Methods.recoveryDevice | Methods.requestLogin | Methods.resetDevice | Methods.rippleGetAddress | Methods.rippleSignTransaction | Methods.setProxy | Methods.signMessage | Methods.signTransaction | Methods.stellarGetAddress | Methods.stellarSignTransaction | Methods.tezosGetAddress | Methods.tezosGetPublicKey | Methods.tezosSignTransaction | Methods.verifyMessage | Methods.wipeDevice | Methods.checkFirmwareAuthenticity;
6
6
  //# sourceMappingURL=method.d.ts.map
@@ -1,3 +1,3 @@
1
- export declare const VERSION = "9.0.0";
1
+ export declare const VERSION = "9.0.2";
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.0.0';
4
+ exports.VERSION = '9.0.2';
5
5
  const versionN = exports.VERSION.split('.').map(s => parseInt(s, 10));
6
6
  exports.DEFAULT_DOMAIN = `https://connect.trezor.io/${versionN[0]}/`;
7
7
  //# sourceMappingURL=version.js.map
@@ -51,6 +51,7 @@ export declare class Device extends EventEmitter {
51
51
  externalState: string[];
52
52
  unavailableCapabilities: UnavailableCapabilities;
53
53
  networkTypeState: NETWORK.NetworkType[];
54
+ firmwareType: 'regular' | 'bitcoin-only';
54
55
  constructor(transport: Transport, descriptor: DeviceDescriptor);
55
56
  static fromDescriptor(transport: Transport, originalDescriptor: DeviceDescriptor): Device;
56
57
  static createUnacquired(transport: Transport, descriptor: DeviceDescriptor, unreadableError?: string): Device;
@@ -31,6 +31,7 @@ class Device extends events_1.default {
31
31
  this.externalState = [];
32
32
  this.unavailableCapabilities = {};
33
33
  this.networkTypeState = [];
34
+ this.firmwareType = 'regular';
34
35
  this.transport = transport;
35
36
  this.originalDescriptor = descriptor;
36
37
  this.firstRunPromise = (0, deferred_1.create)();
@@ -305,6 +306,12 @@ class Device extends events_1.default {
305
306
  feat.revision = revision;
306
307
  this.features = feat;
307
308
  this.featuresNeedsReload = false;
309
+ this.firmwareType =
310
+ feat.capabilities &&
311
+ feat.capabilities.length > 0 &&
312
+ !feat.capabilities.includes('Capability_Bitcoin_like')
313
+ ? 'bitcoin-only'
314
+ : 'regular';
308
315
  }
309
316
  isUnacquired() {
310
317
  return this.features === undefined;
@@ -482,6 +489,7 @@ class Device extends events_1.default {
482
489
  mode: this.getMode(),
483
490
  firmware: this.firmwareStatus,
484
491
  firmwareRelease: this.firmwareRelease,
492
+ firmwareType: this.firmwareType,
485
493
  features: this.features,
486
494
  unavailableCapabilities: this.unavailableCapabilities,
487
495
  };
@@ -43,10 +43,28 @@ export declare const UI_REQUEST: {
43
43
  readonly ADDRESS_VALIDATION: "ui-address_validation";
44
44
  readonly IFRAME_FAILURE: "ui-iframe_failure";
45
45
  };
46
- export interface UiRequestWithoutPayload {
47
- type: typeof UI_REQUEST.LOADING | typeof UI_REQUEST.REQUEST_UI_WINDOW | typeof UI_REQUEST.IFRAME_FAILURE | typeof UI_REQUEST.TRANSPORT | typeof UI_REQUEST.INSUFFICIENT_FUNDS | typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.LOGIN_CHALLENGE_REQUEST;
46
+ export declare type UiRequestWithoutPayload = {
47
+ type: typeof UI_REQUEST.LOADING;
48
48
  payload?: typeof undefined;
49
- }
49
+ } | {
50
+ type: typeof UI_REQUEST.REQUEST_UI_WINDOW;
51
+ payload?: typeof undefined;
52
+ } | {
53
+ type: typeof UI_REQUEST.IFRAME_FAILURE;
54
+ payload?: typeof undefined;
55
+ } | {
56
+ type: typeof UI_REQUEST.TRANSPORT;
57
+ payload?: typeof undefined;
58
+ } | {
59
+ type: typeof UI_REQUEST.INSUFFICIENT_FUNDS;
60
+ payload?: typeof undefined;
61
+ } | {
62
+ type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
63
+ payload?: typeof undefined;
64
+ } | {
65
+ type: typeof UI_REQUEST.LOGIN_CHALLENGE_REQUEST;
66
+ payload?: typeof undefined;
67
+ };
50
68
  export declare type UiRequestDeviceAction = {
51
69
  type: typeof UI_REQUEST.REQUEST_PIN;
52
70
  payload: {
@@ -60,7 +78,25 @@ export declare type UiRequestDeviceAction = {
60
78
  type: PROTO.WordRequestType;
61
79
  };
62
80
  } | {
63
- type: typeof UI_REQUEST.INVALID_PIN | typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE | typeof UI_REQUEST.REQUEST_PASSPHRASE | typeof UI_REQUEST.INVALID_PASSPHRASE;
81
+ type: typeof UI_REQUEST.INVALID_PIN;
82
+ payload: {
83
+ device: Device;
84
+ type?: typeof undefined;
85
+ };
86
+ } | {
87
+ type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
88
+ payload: {
89
+ device: Device;
90
+ type?: typeof undefined;
91
+ };
92
+ } | {
93
+ type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
94
+ payload: {
95
+ device: Device;
96
+ type?: typeof undefined;
97
+ };
98
+ } | {
99
+ type: typeof UI_REQUEST.INVALID_PASSPHRASE;
64
100
  payload: {
65
101
  device: Device;
66
102
  type?: typeof undefined;
package/lib/factory.js CHANGED
@@ -106,6 +106,7 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
106
106
  verifyMessage: params => call({ ...params, method: 'verifyMessage' }),
107
107
  resetDevice: params => call({ ...params, method: 'resetDevice' }),
108
108
  wipeDevice: params => call({ ...params, method: 'wipeDevice' }),
109
+ checkFirmwareAuthenticity: params => call({ ...params, method: 'checkFirmwareAuthenticity' }),
109
110
  applyFlags: params => call({ ...params, method: 'applyFlags' }),
110
111
  applySettings: params => call({ ...params, method: 'applySettings' }),
111
112
  authorizeCoinJoin: params => call({ ...params, method: 'authorizeCoinJoin' }),
@@ -0,0 +1,8 @@
1
+ import type { Response, CommonParams } from '../params';
2
+ export interface CheckFirmwareAuthenticityResponse {
3
+ expectedFirmwareHash: string;
4
+ actualFirmwareHash: string;
5
+ valid: boolean;
6
+ }
7
+ export declare function checkFirmwareAuthenticity(params: CommonParams): Response<CheckFirmwareAuthenticityResponse>;
8
+ //# sourceMappingURL=checkFirmwareAuthenticity.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=checkFirmwareAuthenticity.js.map
@@ -71,6 +71,7 @@ import { tezosSignTransaction } from './tezosSignTransaction';
71
71
  import { uiResponse } from './uiResponse';
72
72
  import { verifyMessage } from './verifyMessage';
73
73
  import { wipeDevice } from './wipeDevice';
74
+ import { checkFirmwareAuthenticity } from './checkFirmwareAuthenticity';
74
75
  export interface TrezorConnect {
75
76
  applyFlags: typeof applyFlags;
76
77
  applySettings: typeof applySettings;
@@ -145,5 +146,6 @@ export interface TrezorConnect {
145
146
  uiResponse: typeof uiResponse;
146
147
  verifyMessage: typeof verifyMessage;
147
148
  wipeDevice: typeof wipeDevice;
149
+ checkFirmwareAuthenticity: typeof checkFirmwareAuthenticity;
148
150
  }
149
151
  //# sourceMappingURL=index.d.ts.map
@@ -4,6 +4,7 @@ export declare type DeviceStatus = 'available' | 'occupied' | 'used';
4
4
  export declare type DeviceMode = 'normal' | 'bootloader' | 'initialize' | 'seedless';
5
5
  export declare type DeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'none';
6
6
  export declare type UnavailableCapability = 'no-capability' | 'no-support' | 'update-required' | 'trezor-connect-outdated';
7
+ export declare type FirmwareType = 'bitcoin-only' | 'regular';
7
8
  export declare type UnavailableCapabilities = {
8
9
  [key: string]: UnavailableCapability;
9
10
  };
@@ -15,6 +16,7 @@ export declare type KnownDevice = {
15
16
  error?: typeof undefined;
16
17
  firmware: DeviceFirmwareStatus;
17
18
  firmwareRelease?: ReleaseInfo | null;
19
+ firmwareType?: FirmwareType;
18
20
  status: DeviceStatus;
19
21
  mode: DeviceMode;
20
22
  state?: string;
@@ -30,6 +32,7 @@ export declare type UnknownDevice = {
30
32
  features?: typeof undefined;
31
33
  firmware?: typeof undefined;
32
34
  firmwareRelease?: typeof undefined;
35
+ firmwareType?: typeof undefined;
33
36
  status?: typeof undefined;
34
37
  mode?: typeof undefined;
35
38
  state?: typeof undefined;
@@ -44,6 +47,7 @@ export declare type UnreadableDevice = {
44
47
  features?: typeof undefined;
45
48
  firmware?: typeof undefined;
46
49
  firmwareRelease?: typeof undefined;
50
+ firmwareType?: typeof undefined;
47
51
  status?: typeof undefined;
48
52
  mode?: typeof undefined;
49
53
  state?: typeof undefined;
@@ -1,2 +1,2 @@
1
- export declare const httpRequest: (url: string, _type: string) => any;
1
+ export declare const httpRequest: (url: string, type: string) => any;
2
2
  //# sourceMappingURL=assets.d.ts.map
@@ -9,10 +9,10 @@ const assetUtils_1 = require("./assetUtils");
9
9
  if (global && typeof global.fetch !== 'function') {
10
10
  global.fetch = cross_fetch_1.default;
11
11
  }
12
- const httpRequest = (url, _type) => {
12
+ const httpRequest = (url, type) => {
13
13
  const asset = (0, assetUtils_1.getAssetByUrl)(url);
14
14
  if (!asset) {
15
- return /^https?/.test(url) ? (0, assets_browser_1.httpRequest)(url) : fs_1.promises.readFile(url);
15
+ return /^https?/.test(url) ? (0, assets_browser_1.httpRequest)(url, type) : fs_1.promises.readFile(url);
16
16
  }
17
17
  return asset;
18
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trezor/connect",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
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.",
@@ -34,7 +34,7 @@
34
34
  "!**/*.map"
35
35
  ],
36
36
  "scripts": {
37
- "lint": "eslint '**/*.{ts,tsx,js}'",
37
+ "lint:js": "yarn g:eslint '**/*.{ts,tsx,js}'",
38
38
  "test:unit": "jest",
39
39
  "type-check": "tsc --build",
40
40
  "build:lib": "rimraf ./lib && yarn tsc --build tsconfig.lib.json",
@@ -44,7 +44,7 @@
44
44
  "version:major": "tsx scripts/bump-version.ts major"
45
45
  },
46
46
  "dependencies": {
47
- "@trezor/blockchain-link": "^2.1.3",
47
+ "@trezor/blockchain-link": "^2.1.4",
48
48
  "@trezor/connect-common": "0.0.9",
49
49
  "@trezor/transport": "^1.1.4",
50
50
  "@trezor/utils": "^9.0.2",
@@ -1,3 +0,0 @@
1
- declare const _default: string[];
2
- export default _default;
3
- //# sourceMappingURL=bip39.d.ts.map