diff --git a/.flowconfig b/.flowconfig index 4e6d5a8ad8..078643a666 100755 --- a/.flowconfig +++ b/.flowconfig @@ -13,7 +13,8 @@ [untyped] .*/node_modules/trezor-connect/lib/utils/networkUtils.js -.*/node_modules/trezor-connect/lib/index.js +.*/node_modules/trezor-connect/lib/env/browser/index.js +.*/node_modules/trezor-connect/lib/popup/PopupManager.js .*/node_modules/react-polymorph/source/components/HOC/withTheme.js .*/node_modules/react-polymorph/source/components/layout/Flex.js diff --git a/app/api/ada/index.js b/app/api/ada/index.js index fe7775265c..aeecd32437 100644 --- a/app/api/ada/index.js +++ b/app/api/ada/index.js @@ -109,7 +109,7 @@ import type { LedgerSignTxPayload, } from '../../domain/HWSignTx'; import Notice from '../../domain/Notice'; -import type { $CardanoSignTransaction } from 'trezor-connect/lib/types/cardano'; +import type { CardanoSignTransaction } from 'trezor-connect/lib/types/networks/cardano'; import { createTrezorSignTxPayload, broadcastTrezorSignedTx, @@ -327,7 +327,7 @@ export type CreateTrezorSignTxDataRequest = {| |}; export type CreateTrezorSignTxDataResponse = {| // https://github.com/trezor/connect/blob/develop/docs/methods/cardanoSignTransaction.md - trezorSignTxPayload: $CardanoSignTransaction, + trezorSignTxPayload: $Exact, |}; export type CreateTrezorSignTxDataFunc = ( request: CreateTrezorSignTxDataRequest diff --git a/app/api/ada/transactions/byron/hwTransactions.js b/app/api/ada/transactions/byron/hwTransactions.js index ec8fd252e9..15abe51226 100644 --- a/app/api/ada/transactions/byron/hwTransactions.js +++ b/app/api/ada/transactions/byron/hwTransactions.js @@ -34,10 +34,10 @@ import type { } from '@cardano-foundation/ledgerjs-hw-app-cardano'; import { toDerivationPathString } from '@emurgo/ledger-connect-handler'; import type { - $CardanoSignTransaction, + CardanoSignTransaction, CardanoInput, CardanoOutput, -} from 'trezor-connect/lib/types/cardano'; +} from 'trezor-connect/lib/types/networks/cardano'; import type { Address, Value, Addressing, } from '../../lib/storage/models/PublicDeriver/interfaces'; @@ -53,7 +53,7 @@ declare var CONFIG: ConfigType; export async function createTrezorSignTxPayload( signRequest: BaseSignRequest, getTxsBodiesForUTXOs: TxBodiesFunc, -): Promise<$CardanoSignTransaction> { +): Promise<$Exact> { const txJson = signRequest.unsignedTx.to_json(); const utxoMap = utxosToLookupMap( diff --git a/app/stores/ada/TrezorConnectStore.js b/app/stores/ada/TrezorConnectStore.js index bdcb1b9e5e..f3bd67a075 100644 --- a/app/stores/ada/TrezorConnectStore.js +++ b/app/stores/ada/TrezorConnectStore.js @@ -4,10 +4,11 @@ import { observable, action } from 'mobx'; import TrezorConnect, { UI_EVENT, DEVICE_EVENT } from 'trezor-connect'; -import type { DeviceMessage, UiMessage } from 'trezor-connect'; -import type { CardanoGetPublicKey$ } from 'trezor-connect/lib/types/cardano'; +import type { DeviceEvent } from 'trezor-connect/lib/types/trezor/device'; +import type { UiEvent } from 'trezor-connect/lib/types/events'; +import type { CardanoPublicKey } from 'trezor-connect/lib/types/networks/cardano'; +import type { Success, Unsuccessful, } from 'trezor-connect/lib/types/params'; -import Config from '../../config'; import environment from '../../environment'; import Store from '../base/Store'; @@ -17,7 +18,7 @@ import globalMessages from '../../i18n/global-messages'; import LocalizableError, { UnexpectedError } from '../../i18n/LocalizableError'; import { CheckAdressesInUseApiError } from '../../api/ada/errors'; import { derivePathPrefix } from '../../api/ada/transactions/utils'; -import { wrapWithFrame, wrapWithoutFrame } from '../lib/TrezorWrapper'; +import { getTrezorManifest, wrapWithFrame, wrapWithoutFrame } from '../lib/TrezorWrapper'; // This is actually just an interface import { @@ -41,8 +42,8 @@ import { PublicDeriver } from '../../api/ada/lib/storage/models/PublicDeriver'; import { HARD_DERIVATION_START } from '../../config/numbersConfig'; type TrezorConnectionResponse = {| - trezorResp: CardanoGetPublicKey$, - trezorEventDevice: DeviceMessage, + trezorResp: Success | Unsuccessful, + trezorEventDevice: DeviceEvent, |}; @@ -78,7 +79,7 @@ export default class TrezorConnectStore /** holds Trezor device DeviceMessage event object, device features will be fetched * from this object and will be converted to TrezorDeviceInfo object */ - trezorEventDevice: ?DeviceMessage; + trezorEventDevice: ?DeviceEvent; // =================== VIEW RELATED =================== // // =================== API RELATED =================== // @@ -102,21 +103,7 @@ export default class TrezorConnectStore trezorConnectAction.submitSave.listen(this._submitSave); try { - /** Starting from v7 Trezor Connect Manifest has been made mandatory - * https://github.com/trezor/connect/blob/develop/docs/index.md#trezor-connect-manifest */ - const { manifest } = Config.wallets.hardwareWallet.trezorT; - - const trezorManifest = {}; - trezorManifest.email = manifest.EMAIL; - if (environment.userAgentInfo.isFirefox) { - // Set appUrl for `moz-extension:` protocol using browser (like Firefox) - trezorManifest.appUrl = manifest.appURL.FIREFOX; - } else { - // For all other browser supported that uses `chrome-extension:` protocol - // In future if other non chrome like browser is supported them we can consider updating - trezorManifest.appUrl = manifest.appURL.CHROME; - } - + const trezorManifest = getTrezorManifest(); wrapWithoutFrame(trezor => trezor.manifest(trezorManifest)); } catch (error) { Logger.error(`TrezorConnectStore::setup:error: ${stringifyError(error)}`); @@ -124,7 +111,7 @@ export default class TrezorConnectStore } /** setup() is called when stores are being created - * _init() is called when connect dailog is about to show */ + * _init() is called when connect dialog is about to show */ _init: void => void = () => { Logger.debug(`${nameof(TrezorConnectStore)}::${nameof(this._init)} called`); } @@ -196,7 +183,10 @@ export default class TrezorConnectStore path: derivePathPrefix(this.derivationIndex) })); - const trezorEventDevice: DeviceMessage = { ...this.trezorEventDevice }; + if (this.trezorEventDevice == null) { + throw new Error(`${nameof(this._checkAndStoreHWDeviceInfo)} no ${nameof(this.trezorEventDevice)}`); + } + const trezorEventDevice = this.trezorEventDevice; /** Converts a valid hardware wallet response to a common storable format * later the same format will be used to create wallet */ @@ -225,21 +215,20 @@ export default class TrezorConnectStore const { trezorResp, trezorEventDevice } = resp; /** This check already done in _validateHWResponse but flow needs this */ - if (trezorEventDevice == null - || trezorEventDevice.payload == null - || trezorEventDevice.payload.features == null) { + const device = trezorEventDevice.payload; + const { features } = device; + if (features == null) { throw new Error('Trezor device hardware info not valid'); } - const deviceFeatures = trezorEventDevice.payload.features; return { publicMasterKey: trezorResp.payload.publicKey, hwFeatures: { - Vendor: deviceFeatures.vendor, - Model: deviceFeatures.model, - DeviceId: deviceFeatures.device_id, + Vendor: features.vendor, + Model: features.model, + DeviceId: features.device_id || '', }, - defaultName: deviceFeatures.label || '', + defaultName: device.label || '', }; } @@ -310,12 +299,12 @@ export default class TrezorConnectStore } }; - _onTrezorDeviceEvent: DeviceMessage => void = (event) => { + _onTrezorDeviceEvent: DeviceEvent => void = (event) => { Logger.debug(`TrezorConnectStore:: DEVICE_EVENT: ${event.type}`); this.trezorEventDevice = event; }; - _onTrezorUIEvent: UiMessage => void = (event) => { + _onTrezorUIEvent: UiEvent => void = (event) => { Logger.debug(`TrezorConnectStore:: UI_EVENT: ${event.type}`); // TODO: [TREZOR] https://github.com/Emurgo/yoroi-frontend/issues/126 // if(event.type === CLOSE_UI_WINDOW && diff --git a/app/stores/ada/TrezorSendStore.js b/app/stores/ada/TrezorSendStore.js index e480de1cd2..890a38f198 100644 --- a/app/stores/ada/TrezorSendStore.js +++ b/app/stores/ada/TrezorSendStore.js @@ -1,6 +1,7 @@ // @flow import { action, observable } from 'mobx'; -import type { CardanoSignTransaction$ } from 'trezor-connect/lib/types/cardano'; +import type { CardanoSignedTx } from 'trezor-connect/lib/types/networks/cardano'; +import type { Success, Unsuccessful } from 'trezor-connect/lib/types/params'; import Store from '../base/Store'; import environment from '../../environment'; @@ -105,7 +106,7 @@ export default class TrezorSendStore extends Store { }; _brodcastSignedTx: ( - CardanoSignTransaction$, + Success | Unsuccessful, PublicDeriver<>, ) => Promise = async ( trezorSignTxResp, diff --git a/app/stores/lib/TrezorWrapper.js b/app/stores/lib/TrezorWrapper.js index 84710ed4cf..0df24aa417 100644 --- a/app/stores/lib/TrezorWrapper.js +++ b/app/stores/lib/TrezorWrapper.js @@ -1,15 +1,50 @@ // @flow +import Config from '../../config'; +import environment from '../../environment'; import TrezorConnect from 'trezor-connect'; +import type { Manifest } from 'trezor-connect'; /* eslint-disable no-restricted-properties */ -// TODO: explain why we want this file +/* + * Trezor needs to embed an iframe inside Yoroi to function (created by TrezorConnect.init) + * Some TrezorConnect functions depend on this iframe existing, while others don't + * Goal: want to only keep the Trezor iframe open for the least amount of time for safety & privacy + * + * To do this safely, do this, we disallow the usage of TrezorConnect in the whole codebase + * except for this function that exposes to wrapper functions + * that forces the user to explicitly decide to initialize the iframe or not +*/ + +export function getTrezorManifest(): Manifest { + /** Starting from v7 Trezor Connect Manifest has been made mandatory + * https://github.com/trezor/connect/blob/develop/docs/index.md#trezor-connect-manifest */ + const { manifest } = Config.wallets.hardwareWallet.trezorT; + + const trezorManifest: Manifest = { + email: manifest.EMAIL, + appUrl: (() => { + if (environment.userAgentInfo.isFirefox) { + // Set appUrl for `moz-extension:` protocol using browser (like Firefox) + return manifest.appURL.FIREFOX; + } + // For all other browser supported that uses `chrome-extension:` protocol + // In future if other non chrome like browser is supported them we can consider updating + return manifest.appURL.CHROME; + })(), + }; + + return trezorManifest; +} export async function wrapWithFrame( func: (typeof TrezorConnect) => Promise ): Promise { - await TrezorConnect.init({}); + const trezorManifest = getTrezorManifest(); + await TrezorConnect.init({ + manifest: trezorManifest, + }); const result = await func(TrezorConnect); await TrezorConnect.dispose(); return result; diff --git a/app/utils/tabManager.js b/app/utils/tabManager.js index 3e67169577..863c91c471 100644 --- a/app/utils/tabManager.js +++ b/app/utils/tabManager.js @@ -47,7 +47,7 @@ export function addCloseListener() { /** * Notify any other Yoroi tabs to close before we initialize - * Note: for the listner to fire, the key much change values + * Note: for the listener to fire, the key much change values * To generate a new value every time, we use the current time * * The precision of the clock may be of concern. Let's look at two scenarios: @@ -60,7 +60,7 @@ export function addCloseListener() { * * 2) Manually entering the Yoroi URL into a page multiple times * This bypasses above-mentioned restriction of only one copy loading at once - * Emperically, this doesn't seem to be an issue though. + * Empirically, this doesn't seem to be an issue though. * * WARNING: You should only call this AFTER the wasm bindings have loaded * closing a different copy of Yoroi while loading WASM causes the load to hang diff --git a/chrome/content-scripts/3rd-party-trezor/trezor-content-script.js b/chrome/content-scripts/3rd-party-trezor/trezor-content-script.js index f92d5fc2f6..151a0a4846 100644 --- a/chrome/content-scripts/3rd-party-trezor/trezor-content-script.js +++ b/chrome/content-scripts/3rd-party-trezor/trezor-content-script.js @@ -22,6 +22,6 @@ Passing messages from popup to background script window.addEventListener('message', event => { if (port && event.source === window && event.data) { - port.postMessage(event.data); + port.postMessage({ data: event.data }); } }); diff --git a/chrome/content-scripts/3rd-party-trezor/trezor-usb-permissions.html b/chrome/content-scripts/3rd-party-trezor/trezor-usb-permissions.html index b5698690b2..105885e12a 100644 --- a/chrome/content-scripts/3rd-party-trezor/trezor-usb-permissions.html +++ b/chrome/content-scripts/3rd-party-trezor/trezor-usb-permissions.html @@ -28,6 +28,5 @@ - diff --git a/chrome/content-scripts/3rd-party-trezor/trezor-usb-permissions.js b/chrome/content-scripts/3rd-party-trezor/trezor-usb-permissions.js index 6f9b6bcfd7..9a77a20fa4 100644 --- a/chrome/content-scripts/3rd-party-trezor/trezor-usb-permissions.js +++ b/chrome/content-scripts/3rd-party-trezor/trezor-usb-permissions.js @@ -7,39 +7,37 @@ Handling messages from usb permissions iframe declare var chrome; */ -const switchToPopupTab = (event) => { +const VERSION = '8.1.5'; +const versionN = VERSION.split('.').map(s => parseInt(s)); +const DIRECTORY = `${ versionN[0] }${ (versionN[1] > 0 ? `.${versionN[1]}` : '') }/`; +const url = 'https://connect.trezor.io/' + 8; + +/* Handling messages from usb permissions iframe */ +function switchToPopupTab(event) { window.removeEventListener('beforeunload', switchToPopupTab); if (!event) { // triggered from 'usb-permissions-close' message - // switch tab to previous index and close current + // close current tab chrome.tabs.query({ currentWindow: true, active: true, }, (current) => { if (current.length < 0) return; - chrome.tabs.query({ - index: current[0].index - 1, - }, popup => { - if (popup.length < 0) return; - chrome.tabs.update(popup[0].id, { active: true }); - }); chrome.tabs.remove(current[0].id); }); - return; } - // triggered from 'beforeunload' event // find tab by popup pattern and switch to it chrome.tabs.query({ - url: '*://connect.trezor.io/*/popup.html', + url: url + 'popup.html', }, (tabs) => { if (tabs.length < 0) return; chrome.tabs.update(tabs[0].id, { active: true }); }); -}; +} -window.addEventListener('message', event => { +window.addEventListener('message', function (event) { if (event.data === 'usb-permissions-init') { const iframe = document.getElementById('trezor-usb-permissions'); if (!iframe || !(iframe instanceof HTMLIFrameElement)) { @@ -55,3 +53,19 @@ window.addEventListener('message', event => { }); window.addEventListener('beforeunload', switchToPopupTab); +window.addEventListener('load', function () { + const instance = document.createElement('iframe'); + instance.id = 'trezor-usb-permissions'; + instance.frameBorder = '0'; + instance.width = '100%'; + instance.height = '100%'; + instance.style.border = '0px'; + instance.style.width = '100%'; + instance.style.height = '100%'; + instance.setAttribute('src', url + 'extension-permissions.html'); + instance.setAttribute('allow', 'usb'); + + if (document.body) { + document.body.appendChild(instance); + } +}); \ No newline at end of file diff --git a/features/mock-trezor-connect/index.js b/features/mock-trezor-connect/index.js index 6082d0f7d3..6bdc89bd8a 100644 --- a/features/mock-trezor-connect/index.js +++ b/features/mock-trezor-connect/index.js @@ -1,83 +1,87 @@ // @flow +import type { DeviceEvent, KnownDevice } from 'trezor-connect/lib/types/trezor/device'; +import type { UiEvent } from 'trezor-connect/lib/types/events'; import type { - CardanoGetAddress, - CardanoGetPublicKey, - CardanoSignTransaction, - EventListener, - Settings, - DeviceMessage, UiMessage, -} from 'trezor-connect/lib/types'; + API +} from 'trezor-connect/lib/types/api'; import type { - CardanoGetAddress$, - CardanoGetPublicKey$, - CardanoSignTransaction$, -} from 'trezor-connect/lib/types/cardano'; + CardanoAddress, + CardanoPublicKey, + CardanoSignedTx, +} from 'trezor-connect/lib/types/networks/cardano'; +import type { Success, } from 'trezor-connect/lib/types/params'; const UI_EVENT: 'UI_EVENT' = 'UI_EVENT'; const DEVICE_EVENT: 'DEVICE_EVENT' = 'DEVICE_EVENT'; class MockTrezorConnect { - static deviceEventListeners: Array void> = []; - static uiEventListeners: Array void> = []; + static deviceEventListeners: Array void> = []; + static uiEventListeners: Array void> = []; - static cardanoGetAddress: CardanoGetAddress = async (_params) => { + static cardanoGetAddress: $PropertyType = async (params) => { MockTrezorConnect.mockConnectDevice(); + + const payload = { + path: [2147483692, 2147485463, 2147483648, 0, 8], + serializedPath: `m/44'/1815'/0'/0/8`, + address: 'Ae2tdPwUPEZAVDjkPPpwDhXMSAjH53CDmd2xMwuR9tZMAZWxLhFphrHKHXe', + }; const result = ({ success: (true: true), - payload: { - path: [2147483692, 2147485463, 2147483648, 0, 8], - serializedPath: `m/44'/1815'/0'/0/8`, - address: 'Ae2tdPwUPEZAVDjkPPpwDhXMSAjH53CDmd2xMwuR9tZMAZWxLhFphrHKHXe', - }, - }: CardanoGetAddress$); - return (result: any); + id: 0, + payload: params.bundle != null ? [payload] : payload, + }: Success | CardanoAddress>); + return (result: Success); }; - static cardanoGetPublicKey: CardanoGetPublicKey = async (_params) => { + static cardanoGetPublicKey: $PropertyType = async (params) => { MockTrezorConnect.mockConnectDevice(); + + const payload = { + path: [2147483692, 2147485463, 2147483648], + serializedPath: `m/44'/1815'/0'`, + publicKey: 'd79d217e4dda6bd6ded1ae91221ab49752ae29906a2551bfb829b21187797a285a9b9c083feb3c6411779928d4264776c46065c46507f416a771ce39ecab4a9b', + node: { + depth: 3, + fingerprint: 3586099367, + child_num: 2147483648, + chain_code: '5a9b9c083feb3c6411779928d4264776c46065c46507f416a771ce39ecab4a9b', + private_key: null, + public_key: 'd79d217e4dda6bd6ded1ae91221ab49752ae29906a2551bfb829b21187797a28' + } + }; const result = ({ success: (true: true), - payload: { - path: [2147483692, 2147485463, 2147483648], - serializedPath: `m/44'/1815'/0'`, - publicKey: 'd79d217e4dda6bd6ded1ae91221ab49752ae29906a2551bfb829b21187797a285a9b9c083feb3c6411779928d4264776c46065c46507f416a771ce39ecab4a9b', - node: { - depth: 3, - fingerprint: 3586099367, - child_num: 2147483648, - chain_code: '5a9b9c083feb3c6411779928d4264776c46065c46507f416a771ce39ecab4a9b', - private_key: null, - public_key: 'd79d217e4dda6bd6ded1ae91221ab49752ae29906a2551bfb829b21187797a28' - } - }, - }: CardanoGetPublicKey$); - return (result: any); + id: 0, + payload: params.bundle != null ? [payload] : payload, + }: Success | CardanoPublicKey>); + return (result: Success); }; - static cardanoSignTransaction: CardanoSignTransaction = async (_params) => { + static cardanoSignTransaction: $PropertyType = async (_params) => { MockTrezorConnect.mockConnectDevice(); const result = ({ success: (true: true), + id: 0, payload: { hash: '969a4a0f5753e726405eb1883bf9cf755faec84308bca600a70f97315ee2a10b', body: '82839f8200d8185824825820058405892f66075d83abd1b7fe341d2d5bfd2f6122b2f874700039e5078e0dd5018200d81858248258203677e75c7ba699bfdc6cd57d42f246f86f69aefd76025006ac78313fad2bba20018200d81858248258201029eef5bb0f06979ab0b9530a62bac11e180797d08cab980fe39389d42b365700ff9f8282d818582183581c891ac9abaac999b097c81ea3c0450b0fbb693d0bd232bebc0f4a391fa0001af2ff7e211a004e7f41ffa0838200d81858858258406e270ca44caaad7e2e4ec8c61e246f94c822d869c939c0b18894d129db8519567d65825edc57e2c6da24312e09c3305266acdfb18609de937eda9cc1cb2d14265840c9209de12ec1aa608571ed3902974b01d3ef1b5d781cd750c27da2bd6451589b735d2fbb58a6ef011e1a97841e2035d63110dd03cbe362a2f0f00da7367bf0058200d8185885825840fcecc9147c4f94c2850d6f441719983d55603d5cee81011e24a8bc1ba679dd2035792712c2caabe905db7495ef847decd2d6720767f4953dbb5a16e81d35b10d58408142ee83e227e67daaeb624fa835e44f12c4d52879f84de7ea9d9e388d9625d5193dfa944d4b942cc464ba2b7a0c35734b9096eaff250231894f2697e6c8c9008200d8185885825840ef6876bb0c32bae4ef4e676d51b9156657a2e0b3901f14f151e300c88abbe15bdbaf8579574f8937610077cadeac6b1441503178abe476ae2c56b3afb0267d6a584098cedb0f6143daad1b4486d07c214236bd34c3f16181cdd3fc569d8754ee84689fa356739bf2fa5eaa6dbe9ca025981d83d97dd085730911e793517378951709', }, - }: CardanoSignTransaction$); - return (result: any); + }: Success); + return result; }; - static manifest: Object => void = (_data) => { + static manifest: $PropertyType = (_data) => { } - static init: Settings => Promise = async (_settings) => { + static init: $PropertyType = async (_settings) => { } - - static dispose: void => void = () => { + static dispose: $PropertyType = (): void => { } - static on: EventListener = (type, fn): void => { + static on: $PropertyType = (type, fn): void => { if (type === DEVICE_EVENT) { this.deviceEventListeners.push((fn: any)); } @@ -86,7 +90,7 @@ class MockTrezorConnect { } } - static off: EventListener = (type, fn): void => { + static off: $PropertyType = (type, fn): void => { if (type === DEVICE_EVENT) { this.deviceEventListeners = this.deviceEventListeners.filter(event => event !== fn); } @@ -99,8 +103,9 @@ class MockTrezorConnect { this.deviceEventListeners.forEach(func => func({ event: DEVICE_EVENT, type: 'device-changed', - payload: { + payload: ({ type: 'acquired', + id: null, path: '5', label: 'My Trezor', state: '6dac00bf532594194beaf682e5fc5659ffcf131466455cd9fb4e964a3a47c983', @@ -108,6 +113,7 @@ class MockTrezorConnect { mode: 'normal', firmware: 'valid', firmwareRelease: undefined, + unavailableCapabilities: {}, features: { vendor: 'trezor.io', major_version: 2, @@ -137,7 +143,7 @@ class MockTrezorConnect { unfinished_backup: false, no_backup: false } - } + }: KnownDevice) })); } } diff --git a/package-lock.json b/package-lock.json index 22b4654391..72c5092a29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12573,7 +12573,8 @@ "events": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", - "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==" + "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==", + "dev": true }, "eventsource": { "version": "1.0.7", @@ -26684,13 +26685,20 @@ "dev": true }, "trezor-connect": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/trezor-connect/-/trezor-connect-7.0.5.tgz", - "integrity": "sha512-cGHcNuO/kGVF6b1mp5VB/RwXcXwqZJDPLp3opx7vM+BQ8xB4oDAUdL+T8aCKRbDv6HwP/wvGwoaok/+9kYOPfA==", + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/trezor-connect/-/trezor-connect-8.1.5.tgz", + "integrity": "sha512-QcOeHr7FitkaBtsI4zEIk4yb/dOUmXZKsp/jqgyO3unCCq6i+on6lJAuNUKwzxpIv4YWGl9rLiWj1ndKNyuPmw==", "requires": { - "@babel/runtime": "^7.3.1", - "events": "^3.0.0", + "@babel/runtime": "^7.9.2", + "events": "^3.1.0", "whatwg-fetch": "^3.0.0" + }, + "dependencies": { + "events": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.1.0.tgz", + "integrity": "sha512-Rv+u8MLHNOdMjTAFeT3nCjHn2aGlx435FP/sDHNaRhDEMwyI/aB22Kj2qIN8R0cw3z28psEQLYwxVKLsKrMgWg==" + } } }, "trim": { diff --git a/package.json b/package.json index e846e8aba7..62e26278f4 100644 --- a/package.json +++ b/package.json @@ -193,7 +193,7 @@ "route-parser": "0.0.5", "semver": "7.3.2", "tinycolor2": "1.4.1", - "trezor-connect": "7.0.5", + "trezor-connect": "8.1.5", "ua-parser-js": "0.7.21", "unorm": "1.6.0", "validator": "13.0.0" diff --git a/webpack/commonConfig.js b/webpack/commonConfig.js index 3437be3065..a94f60486e 100644 --- a/webpack/commonConfig.js +++ b/webpack/commonConfig.js @@ -173,7 +173,6 @@ const resolve = (networkName /*: string */) /*: * */ => ({ extensions: ['*', '.js', '.wasm'], alias: (networkName === 'test') ? { - // todo: make conditional 'trezor-connect': path.resolve(__dirname, '../features/mock-trezor-connect/'), } : {},