diff --git a/app/scripts/background.js b/app/scripts/background.js index 1f8badfda..c63c4ade0 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -19,6 +19,12 @@ import extension from 'extensionizer' import { storeAsStream, storeTransformStream } from '@metamask/obs-store' import PortStream from 'extension-port-stream' import { captureException } from '@sentry/browser' + +import { + ENVIRONMENT_TYPE_POPUP, + ENVIRONMENT_TYPE_NOTIFICATION, + ENVIRONMENT_TYPE_FULLSCREEN, +} from '../../shared/constants/app' import migrations from './migrations' import Migrator from './lib/migrator' import ExtensionPlatform from './platforms/extension' @@ -31,12 +37,6 @@ import rawFirstTimeState from './first-time-state' import getFirstPreferredLangCode from './lib/get-first-preferred-lang-code' import getObjStructure from './lib/getObjStructure' import setupEnsIpfsResolver from './lib/ens-ipfs/setup' - -import { - ENVIRONMENT_TYPE_POPUP, - ENVIRONMENT_TYPE_NOTIFICATION, - ENVIRONMENT_TYPE_FULLSCREEN, -} from './lib/enums' /* eslint-enable import/first */ const { sentry } = global diff --git a/app/scripts/controllers/network/contract-addresses.js b/app/scripts/constants/contracts.js similarity index 100% rename from app/scripts/controllers/network/contract-addresses.js rename to app/scripts/constants/contracts.js diff --git a/app/scripts/controllers/detect-tokens.js b/app/scripts/controllers/detect-tokens.js index 1ad46193d..d91fdb989 100644 --- a/app/scripts/controllers/detect-tokens.js +++ b/app/scripts/controllers/detect-tokens.js @@ -2,12 +2,11 @@ import Web3 from 'web3' import contracts from '@metamask/contract-metadata' import { warn } from 'loglevel' import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi' -import { MAINNET_CHAIN_ID } from './network/enums' +import { MAINNET_CHAIN_ID } from '../../../shared/constants/network' +import { SINGLE_CALL_BALANCES_ADDRESS } from '../constants/contracts' // By default, poll every 3 minutes const DEFAULT_INTERVAL = 180 * 1000 -const SINGLE_CALL_BALANCES_ADDRESS = - '0xb1f8e55c7f64d203c1400b9d8555d050f94adf39' /** * A controller that polls for token exchange diff --git a/app/scripts/controllers/incoming-transactions.js b/app/scripts/controllers/incoming-transactions.js index 625272740..e1ff68895 100644 --- a/app/scripts/controllers/incoming-transactions.js +++ b/app/scripts/controllers/incoming-transactions.js @@ -22,7 +22,7 @@ import { RINKEBY_CHAIN_ID, ROPSTEN, ROPSTEN_CHAIN_ID, -} from './network/enums' +} from '../../../shared/constants/network' const fetchWithTimeout = getFetchWithTimeout(30000) diff --git a/app/scripts/controllers/metametrics.js b/app/scripts/controllers/metametrics.js index 3ae74cbf8..2c84ee78c 100644 --- a/app/scripts/controllers/metametrics.js +++ b/app/scripts/controllers/metametrics.js @@ -1,7 +1,7 @@ import { merge, omit } from 'lodash' import { ObservableStore } from '@metamask/obs-store' import { bufferToHex, sha3 } from 'ethereumjs-util' -import { ENVIRONMENT_TYPE_BACKGROUND } from '../lib/enums' +import { ENVIRONMENT_TYPE_BACKGROUND } from '../../../shared/constants/app' import { METAMETRICS_ANONYMOUS_ID, METAMETRICS_BACKGROUND_PAGE_OBJECT, diff --git a/app/scripts/controllers/network/createInfuraClient.js b/app/scripts/controllers/network/createInfuraClient.js index 2a26c9b75..0f37ea4ca 100644 --- a/app/scripts/controllers/network/createInfuraClient.js +++ b/app/scripts/controllers/network/createInfuraClient.js @@ -8,7 +8,7 @@ import providerFromMiddleware from 'eth-json-rpc-middleware/providerFromMiddlewa import createInfuraMiddleware from 'eth-json-rpc-infura' import BlockTracker from 'eth-block-tracker' -import { NETWORK_TYPE_TO_ID_MAP } from './enums' +import { NETWORK_TYPE_TO_ID_MAP } from '../../../../shared/constants/network' export default function createInfuraClient({ network, projectId }) { const infuraMiddleware = createInfuraMiddleware({ diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index 9bfc0fc07..d7683618e 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -9,10 +9,6 @@ import { createEventEmitterProxy, } from 'swappable-obj-proxy' import EthQuery from 'eth-query' -import createMetamaskMiddleware from './createMetamaskMiddleware' -import createInfuraClient from './createInfuraClient' -import createJsonRpcClient from './createJsonRpcClient' - import { RINKEBY, MAINNET, @@ -20,7 +16,10 @@ import { NETWORK_TYPE_TO_ID_MAP, MAINNET_CHAIN_ID, RINKEBY_CHAIN_ID, -} from './enums' +} from '../../../../shared/constants/network' +import createMetamaskMiddleware from './createMetamaskMiddleware' +import createInfuraClient from './createInfuraClient' +import createJsonRpcClient from './createJsonRpcClient' const env = process.env.METAMASK_ENV diff --git a/app/scripts/controllers/network/util.js b/app/scripts/controllers/network/util.js index 958a1d4dd..9c80db551 100644 --- a/app/scripts/controllers/network/util.js +++ b/app/scripts/controllers/network/util.js @@ -1,4 +1,4 @@ -import { NETWORK_TO_NAME_MAP } from './enums' +import { NETWORK_TO_NAME_MAP } from '../../../../shared/constants/network' export const getNetworkDisplayName = (key) => NETWORK_TO_NAME_MAP[key] diff --git a/app/scripts/controllers/permissions/enums.js b/app/scripts/controllers/permissions/enums.js index 510fad1b3..21356804f 100644 --- a/app/scripts/controllers/permissions/enums.js +++ b/app/scripts/controllers/permissions/enums.js @@ -10,11 +10,6 @@ export const METADATA_STORE_KEY = 'domainMetadata' export const METADATA_CACHE_MAX_SIZE = 100 -export const CAVEAT_NAMES = { - exposedAccounts: 'exposedAccounts', - primaryAccountOnly: 'primaryAccountOnly', -} - export const CAVEAT_TYPES = { limitResponseLength: 'limitResponseLength', filterResponse: 'filterResponse', diff --git a/app/scripts/controllers/permissions/index.js b/app/scripts/controllers/permissions/index.js index c4ffd14fb..515741a7e 100644 --- a/app/scripts/controllers/permissions/index.js +++ b/app/scripts/controllers/permissions/index.js @@ -6,10 +6,7 @@ import { CapabilitiesController as RpcCap } from 'rpc-cap' import { ethErrors } from 'eth-json-rpc-errors' import { cloneDeep } from 'lodash' -import createPermissionsMethodMiddleware from './permissionsMethodMiddleware' -import PermissionsLogController from './permissionsLog' - -// Methods that do not require any permissions to use: +import { CAVEAT_NAMES } from '../../../../shared/constants/permissions' import { APPROVAL_TYPE, SAFE_METHODS, // methods that do not require any permissions to use @@ -18,11 +15,13 @@ import { METADATA_CACHE_MAX_SIZE, LOG_STORE_KEY, HISTORY_STORE_KEY, - CAVEAT_NAMES, NOTIFICATION_NAMES, CAVEAT_TYPES, } from './enums' +import createPermissionsMethodMiddleware from './permissionsMethodMiddleware' +import PermissionsLogController from './permissionsLog' + // instanbul ignore next const noop = () => undefined diff --git a/app/scripts/controllers/permissions/permissionsLog.js b/app/scripts/controllers/permissions/permissionsLog.js index e1a37f0c8..28c87af6b 100644 --- a/app/scripts/controllers/permissions/permissionsLog.js +++ b/app/scripts/controllers/permissions/permissionsLog.js @@ -1,6 +1,6 @@ import { cloneDeep } from 'lodash' +import { CAVEAT_NAMES } from '../../../../shared/constants/permissions' import { - CAVEAT_NAMES, HISTORY_STORE_KEY, LOG_IGNORE_METHODS, LOG_LIMIT, diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 7445be65b..d8ea05856 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -7,7 +7,7 @@ import ethers from 'ethers' import log from 'loglevel' import { isPrefixedFormattedHexString } from '../lib/util' import { LISTED_CONTRACT_ADDRESSES } from '../../../shared/constants/tokens' -import { NETWORK_TYPE_TO_ID_MAP } from './network/enums' +import { NETWORK_TYPE_TO_ID_MAP } from '../../../shared/constants/network' export default class PreferencesController { /** diff --git a/app/scripts/lib/account-tracker.js b/app/scripts/lib/account-tracker.js index 850c39291..6b78081f0 100644 --- a/app/scripts/lib/account-tracker.js +++ b/app/scripts/lib/account-tracker.js @@ -19,14 +19,14 @@ import { RINKEBY_CHAIN_ID, ROPSTEN_CHAIN_ID, KOVAN_CHAIN_ID, -} from '../controllers/network/enums' +} from '../../../shared/constants/network' import { SINGLE_CALL_BALANCES_ADDRESS, SINGLE_CALL_BALANCES_ADDRESS_RINKEBY, SINGLE_CALL_BALANCES_ADDRESS_ROPSTEN, SINGLE_CALL_BALANCES_ADDRESS_KOVAN, -} from '../controllers/network/contract-addresses' +} from '../constants/contracts' import { bnToHex } from './util' /** diff --git a/app/scripts/lib/decrypt-message-manager.js b/app/scripts/lib/decrypt-message-manager.js index fc8ce03ce..e84397d42 100644 --- a/app/scripts/lib/decrypt-message-manager.js +++ b/app/scripts/lib/decrypt-message-manager.js @@ -3,9 +3,9 @@ import { ObservableStore } from '@metamask/obs-store' import ethUtil from 'ethereumjs-util' import { ethErrors } from 'eth-json-rpc-errors' import log from 'loglevel' +import { MESSAGE_TYPE } from '../../../shared/constants/app' import { addHexPrefix } from './util' import createId from './random-id' -import { MESSAGE_TYPE } from './enums' const hexRe = /^[0-9A-Fa-f]+$/gu diff --git a/app/scripts/lib/encryption-public-key-manager.js b/app/scripts/lib/encryption-public-key-manager.js index d563cae0b..48f2ab701 100644 --- a/app/scripts/lib/encryption-public-key-manager.js +++ b/app/scripts/lib/encryption-public-key-manager.js @@ -2,8 +2,8 @@ import EventEmitter from 'events' import { ObservableStore } from '@metamask/obs-store' import { ethErrors } from 'eth-json-rpc-errors' import log from 'loglevel' +import { MESSAGE_TYPE } from '../../../shared/constants/app' import createId from './random-id' -import { MESSAGE_TYPE } from './enums' /** * Represents, and contains data about, an 'eth_getEncryptionPublicKey' type request. These are created when diff --git a/app/scripts/lib/message-manager.js b/app/scripts/lib/message-manager.js index 872f97b0d..a3f0dee58 100644 --- a/app/scripts/lib/message-manager.js +++ b/app/scripts/lib/message-manager.js @@ -2,8 +2,8 @@ import EventEmitter from 'events' import { ObservableStore } from '@metamask/obs-store' import ethUtil from 'ethereumjs-util' import { ethErrors } from 'eth-json-rpc-errors' +import { MESSAGE_TYPE } from '../../../shared/constants/app' import createId from './random-id' -import { MESSAGE_TYPE } from './enums' /** * Represents, and contains data about, an 'eth_sign' type signature request. These are created when a signature for diff --git a/app/scripts/lib/personal-message-manager.js b/app/scripts/lib/personal-message-manager.js index 52d20588f..c08dddbb2 100644 --- a/app/scripts/lib/personal-message-manager.js +++ b/app/scripts/lib/personal-message-manager.js @@ -3,9 +3,9 @@ import { ObservableStore } from '@metamask/obs-store' import ethUtil from 'ethereumjs-util' import { ethErrors } from 'eth-json-rpc-errors' import log from 'loglevel' +import { MESSAGE_TYPE } from '../../../shared/constants/app' import { addHexPrefix } from './util' import createId from './random-id' -import { MESSAGE_TYPE } from './enums' const hexRe = /^[0-9A-Fa-f]+$/gu diff --git a/app/scripts/lib/rpc-method-middleware/handlers/get-provider-state.js b/app/scripts/lib/rpc-method-middleware/handlers/get-provider-state.js index 32b3c18c6..760517e10 100644 --- a/app/scripts/lib/rpc-method-middleware/handlers/get-provider-state.js +++ b/app/scripts/lib/rpc-method-middleware/handlers/get-provider-state.js @@ -1,4 +1,4 @@ -import { MESSAGE_TYPE } from '../../enums' +import { MESSAGE_TYPE } from '../../../../../shared/constants/app' /** * This RPC method gets background state relevant to the provider. diff --git a/app/scripts/lib/rpc-method-middleware/handlers/log-web3-shim-usage.js b/app/scripts/lib/rpc-method-middleware/handlers/log-web3-shim-usage.js index 21e908000..3fb5a5743 100644 --- a/app/scripts/lib/rpc-method-middleware/handlers/log-web3-shim-usage.js +++ b/app/scripts/lib/rpc-method-middleware/handlers/log-web3-shim-usage.js @@ -1,4 +1,4 @@ -import { MESSAGE_TYPE } from '../../enums' +import { MESSAGE_TYPE } from '../../../../../shared/constants/app' /** * This RPC method is called by the inpage provider whenever it detects the diff --git a/app/scripts/lib/rpc-method-middleware/handlers/watch-asset.js b/app/scripts/lib/rpc-method-middleware/handlers/watch-asset.js index 1c5f4c1db..60c8ad6da 100644 --- a/app/scripts/lib/rpc-method-middleware/handlers/watch-asset.js +++ b/app/scripts/lib/rpc-method-middleware/handlers/watch-asset.js @@ -1,4 +1,4 @@ -import { MESSAGE_TYPE } from '../../enums' +import { MESSAGE_TYPE } from '../../../../../shared/constants/app' const watchAsset = { methodNames: [MESSAGE_TYPE.WATCH_ASSET, MESSAGE_TYPE.WATCH_ASSET_LEGACY], diff --git a/app/scripts/lib/typed-message-manager.js b/app/scripts/lib/typed-message-manager.js index 6bcfe846b..1dce10bc8 100644 --- a/app/scripts/lib/typed-message-manager.js +++ b/app/scripts/lib/typed-message-manager.js @@ -6,8 +6,8 @@ import { typedSignatureHash, TYPED_MESSAGE_SCHEMA } from 'eth-sig-util' import { isValidAddress } from 'ethereumjs-util' import log from 'loglevel' import jsonschema from 'jsonschema' +import { MESSAGE_TYPE } from '../../../shared/constants/app' import createId from './random-id' -import { MESSAGE_TYPE } from './enums' /** * Represents, and contains data about, an 'eth_signTypedData' type signature request. These are created when a diff --git a/app/scripts/lib/util.js b/app/scripts/lib/util.js index 1816d04ab..6750d8b43 100644 --- a/app/scripts/lib/util.js +++ b/app/scripts/lib/util.js @@ -14,7 +14,7 @@ import { PLATFORM_CHROME, PLATFORM_EDGE, PLATFORM_BRAVE, -} from './enums' +} from '../../../shared/constants/app' /** * @see {@link getEnvironmentType} diff --git a/app/scripts/migrations/051.js b/app/scripts/migrations/051.js index 0128dd656..4c024458d 100644 --- a/app/scripts/migrations/051.js +++ b/app/scripts/migrations/051.js @@ -1,5 +1,5 @@ import { cloneDeep } from 'lodash' -import { NETWORK_TYPE_TO_ID_MAP } from '../controllers/network/enums' +import { NETWORK_TYPE_TO_ID_MAP } from '../../../shared/constants/network' const version = 51 diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 3644e02cb..88117700d 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -1,7 +1,7 @@ import extension from 'extensionizer' import { createExplorerLink as explorerLink } from '@metamask/etherscan-link' import { getEnvironmentType, checkForError } from '../lib/util' -import { ENVIRONMENT_TYPE_BACKGROUND } from '../lib/enums' +import { ENVIRONMENT_TYPE_BACKGROUND } from '../../../shared/constants/app' import { TRANSACTION_STATUSES } from '../../../shared/constants/transaction' export default class ExtensionPlatform { diff --git a/app/scripts/ui.js b/app/scripts/ui.js index f1f4a7b78..7aca1b724 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -12,12 +12,12 @@ import EthQuery from 'eth-query' import StreamProvider from 'web3-stream-provider' import log from 'loglevel' import launchMetaMaskUi from '../../ui' -import ExtensionPlatform from './platforms/extension' -import { setupMultiplex } from './lib/stream-utils' import { ENVIRONMENT_TYPE_FULLSCREEN, ENVIRONMENT_TYPE_POPUP, -} from './lib/enums' +} from '../../shared/constants/app' +import ExtensionPlatform from './platforms/extension' +import { setupMultiplex } from './lib/stream-utils' import { getEnvironmentType } from './lib/util' start().catch(log.error) diff --git a/app/scripts/lib/enums.js b/shared/constants/app.js similarity index 59% rename from app/scripts/lib/enums.js rename to shared/constants/app.js index a6b7a99de..90e4726b0 100644 --- a/app/scripts/lib/enums.js +++ b/shared/constants/app.js @@ -6,19 +6,18 @@ * background - The background process that powers the extension * @typedef {'popup' | 'notification' | 'fullscreen' | 'background'} EnvironmentType */ +export const ENVIRONMENT_TYPE_POPUP = 'popup' +export const ENVIRONMENT_TYPE_NOTIFICATION = 'notification' +export const ENVIRONMENT_TYPE_FULLSCREEN = 'fullscreen' +export const ENVIRONMENT_TYPE_BACKGROUND = 'background' -const ENVIRONMENT_TYPE_POPUP = 'popup' -const ENVIRONMENT_TYPE_NOTIFICATION = 'notification' -const ENVIRONMENT_TYPE_FULLSCREEN = 'fullscreen' -const ENVIRONMENT_TYPE_BACKGROUND = 'background' +export const PLATFORM_BRAVE = 'Brave' +export const PLATFORM_CHROME = 'Chrome' +export const PLATFORM_EDGE = 'Edge' +export const PLATFORM_FIREFOX = 'Firefox' +export const PLATFORM_OPERA = 'Opera' -const PLATFORM_BRAVE = 'Brave' -const PLATFORM_CHROME = 'Chrome' -const PLATFORM_EDGE = 'Edge' -const PLATFORM_FIREFOX = 'Firefox' -const PLATFORM_OPERA = 'Opera' - -const MESSAGE_TYPE = { +export const MESSAGE_TYPE = { ETH_DECRYPT: 'eth_decrypt', ETH_GET_ENCRYPTION_PUBLIC_KEY: 'eth_getEncryptionPublicKey', ETH_SIGN: 'eth_sign', @@ -29,16 +28,3 @@ const MESSAGE_TYPE = { WATCH_ASSET: 'wallet_watchAsset', WATCH_ASSET_LEGACY: 'metamask_watchAsset', } - -export { - ENVIRONMENT_TYPE_POPUP, - ENVIRONMENT_TYPE_NOTIFICATION, - ENVIRONMENT_TYPE_FULLSCREEN, - ENVIRONMENT_TYPE_BACKGROUND, - MESSAGE_TYPE, - PLATFORM_BRAVE, - PLATFORM_CHROME, - PLATFORM_EDGE, - PLATFORM_FIREFOX, - PLATFORM_OPERA, -} diff --git a/shared/constants/metametrics.js b/shared/constants/metametrics.js index 7bd2c4c5e..edb37a2a1 100644 --- a/shared/constants/metametrics.js +++ b/shared/constants/metametrics.js @@ -1,6 +1,6 @@ // Type Imports /** - * @typedef {import('../../app/scripts/lib/enums').EnvironmentType} EnvironmentType + * @typedef {import('../../shared/constants/app').EnvironmentType} EnvironmentType */ // Type Declarations diff --git a/app/scripts/controllers/network/enums.js b/shared/constants/network.js similarity index 100% rename from app/scripts/controllers/network/enums.js rename to shared/constants/network.js diff --git a/shared/constants/permissions.js b/shared/constants/permissions.js new file mode 100644 index 000000000..f396fbeba --- /dev/null +++ b/shared/constants/permissions.js @@ -0,0 +1,4 @@ +export const CAVEAT_NAMES = { + exposedAccounts: 'exposedAccounts', + primaryAccountOnly: 'primaryAccountOnly', +} diff --git a/test/unit/app/controllers/detect-tokens-test.js b/test/unit/app/controllers/detect-tokens-test.js index 6039a943c..d76906d26 100644 --- a/test/unit/app/controllers/detect-tokens-test.js +++ b/test/unit/app/controllers/detect-tokens-test.js @@ -7,10 +7,7 @@ import BigNumber from 'bignumber.js' import DetectTokensController from '../../../../app/scripts/controllers/detect-tokens' import NetworkController from '../../../../app/scripts/controllers/network/network' import PreferencesController from '../../../../app/scripts/controllers/preferences' -import { - MAINNET, - ROPSTEN, -} from '../../../../app/scripts/controllers/network/enums' +import { MAINNET, ROPSTEN } from '../../../../shared/constants/network' describe('DetectTokensController', function () { const sandbox = sinon.createSandbox() diff --git a/test/unit/app/controllers/incoming-transactions-test.js b/test/unit/app/controllers/incoming-transactions-test.js index 61768cee8..af8ac1084 100644 --- a/test/unit/app/controllers/incoming-transactions-test.js +++ b/test/unit/app/controllers/incoming-transactions-test.js @@ -14,7 +14,7 @@ import { ROPSTEN, ROPSTEN_CHAIN_ID, ROPSTEN_NETWORK_ID, -} from '../../../../app/scripts/controllers/network/enums' +} from '../../../../shared/constants/network' import { TRANSACTION_CATEGORIES, TRANSACTION_STATUSES, diff --git a/test/unit/app/controllers/metametrics-test.js b/test/unit/app/controllers/metametrics-test.js index 4e66fec4a..11c012bfc 100644 --- a/test/unit/app/controllers/metametrics-test.js +++ b/test/unit/app/controllers/metametrics-test.js @@ -1,7 +1,7 @@ import { strict as assert } from 'assert' import sinon from 'sinon' import MetaMetricsController from '../../../../app/scripts/controllers/metametrics' -import { ENVIRONMENT_TYPE_BACKGROUND } from '../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_BACKGROUND } from '../../../../shared/constants/app' import { createSegmentMock } from '../../../../app/scripts/lib/segment' import { METAMETRICS_ANONYMOUS_ID, diff --git a/test/unit/app/controllers/permissions/mocks.js b/test/unit/app/controllers/permissions/mocks.js index 48937faf2..8d7d75e75 100644 --- a/test/unit/app/controllers/permissions/mocks.js +++ b/test/unit/app/controllers/permissions/mocks.js @@ -5,8 +5,8 @@ import { ApprovalController } from '@metamask/controllers' import _getRestrictedMethods from '../../../../../app/scripts/controllers/permissions/restrictedMethods' +import { CAVEAT_NAMES } from '../../../../../shared/constants/permissions' import { - CAVEAT_NAMES, CAVEAT_TYPES, NOTIFICATION_NAMES, } from '../../../../../app/scripts/controllers/permissions/enums' diff --git a/test/unit/app/controllers/swaps-test.js b/test/unit/app/controllers/swaps-test.js index 38f948088..2622d04eb 100644 --- a/test/unit/app/controllers/swaps-test.js +++ b/test/unit/app/controllers/swaps-test.js @@ -8,7 +8,7 @@ import { ObservableStore } from '@metamask/obs-store' import { ROPSTEN_NETWORK_ID, MAINNET_NETWORK_ID, -} from '../../../../app/scripts/controllers/network/enums' +} from '../../../../shared/constants/network' import { ETH_SWAPS_TOKEN_ADDRESS } from '../../../../ui/app/helpers/constants/swaps' import { createTestProviderTools } from '../../../stub/provider' import SwapsController, { diff --git a/test/unit/app/util-test.js b/test/unit/app/util-test.js index f2372576f..802ae93c9 100644 --- a/test/unit/app/util-test.js +++ b/test/unit/app/util-test.js @@ -10,7 +10,7 @@ import { ENVIRONMENT_TYPE_NOTIFICATION, ENVIRONMENT_TYPE_FULLSCREEN, ENVIRONMENT_TYPE_BACKGROUND, -} from '../../../app/scripts/lib/enums' +} from '../../../shared/constants/app' describe('app utils', function () { describe('getEnvironmentType', function () { diff --git a/test/unit/migrations/051-test.js b/test/unit/migrations/051-test.js index d692e5773..ae0a78afe 100644 --- a/test/unit/migrations/051-test.js +++ b/test/unit/migrations/051-test.js @@ -3,7 +3,7 @@ import migration51 from '../../../app/scripts/migrations/051' import { INFURA_PROVIDER_TYPES, NETWORK_TYPE_TO_ID_MAP, -} from '../../../app/scripts/controllers/network/enums' +} from '../../../shared/constants/network' describe('migration #51', function () { it('should update the version metadata', async function () { diff --git a/ui/app/components/app/account-menu/account-menu.component.js b/ui/app/components/app/account-menu/account-menu.component.js index 00c889a94..f16cb41a4 100644 --- a/ui/app/components/app/account-menu/account-menu.component.js +++ b/ui/app/components/app/account-menu/account-menu.component.js @@ -4,7 +4,7 @@ import { debounce } from 'lodash' import Fuse from 'fuse.js' import InputAdornment from '@material-ui/core/InputAdornment' import classnames from 'classnames' -import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_POPUP } from '../../../../../shared/constants/app' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import Identicon from '../../ui/identicon' import SiteIcon from '../../ui/site-icon' diff --git a/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js b/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js index 72e741a6b..bdc6295d6 100644 --- a/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js +++ b/ui/app/components/app/confirm-page-container/confirm-page-container-header/confirm-page-container-header.component.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import { ENVIRONMENT_TYPE_POPUP, ENVIRONMENT_TYPE_NOTIFICATION, -} from '../../../../../../app/scripts/lib/enums' +} from '../../../../../../shared/constants/app' import { getEnvironmentType } from '../../../../../../app/scripts/lib/util' import NetworkDisplay from '../../network-display' import Identicon from '../../../ui/identicon' diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index e55f77afc..4f2c2bdc2 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -9,7 +9,7 @@ import { NETWORKS_ROUTE, NETWORKS_FORM_ROUTE, } from '../../../helpers/constants/routes' -import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../shared/constants/app' import { getEnvironmentType, isPrefixedFormattedHexString, diff --git a/ui/app/components/app/menu-bar/account-options-menu.js b/ui/app/components/app/menu-bar/account-options-menu.js index 60ca1c598..d3c9723e7 100644 --- a/ui/app/components/app/menu-bar/account-options-menu.js +++ b/ui/app/components/app/menu-bar/account-options-menu.js @@ -16,7 +16,7 @@ import { import { useI18nContext } from '../../../hooks/useI18nContext' import { useMetricEvent } from '../../../hooks/useMetricEvent' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' -import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../shared/constants/app' export default function AccountOptionsMenu({ anchorElement, onClose }) { const t = useI18nContext() diff --git a/ui/app/components/app/menu-bar/menu-bar.js b/ui/app/components/app/menu-bar/menu-bar.js index d9d13fcb1..f6c70a43e 100644 --- a/ui/app/components/app/menu-bar/menu-bar.js +++ b/ui/app/components/app/menu-bar/menu-bar.js @@ -5,7 +5,7 @@ import { useSelector } from 'react-redux' import SelectedAccount from '../selected-account' import ConnectedStatusIndicator from '../connected-status-indicator' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' -import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_POPUP } from '../../../../../shared/constants/app' import { CONNECTED_ACCOUNTS_ROUTE } from '../../../helpers/constants/routes' import { useI18nContext } from '../../../hooks/useI18nContext' import { useMetricEvent } from '../../../hooks/useMetricEvent' diff --git a/ui/app/components/app/modals/modal.js b/ui/app/components/app/modals/modal.js index 46f915b16..5ad7d3470 100644 --- a/ui/app/components/app/modals/modal.js +++ b/ui/app/components/app/modals/modal.js @@ -6,7 +6,7 @@ import * as actions from '../../../store/actions' import { resetCustomData as resetCustomGasData } from '../../../ducks/gas/gas.duck' import isMobileView from '../../../../lib/is-mobile-view' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' -import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_POPUP } from '../../../../../shared/constants/app' // Modal Components import ConfirmCustomizeGasModal from '../gas-customization/gas-modal-page-container' diff --git a/ui/app/components/app/modals/qr-scanner/qr-scanner.component.js b/ui/app/components/app/modals/qr-scanner/qr-scanner.component.js index 54556f630..2f82ce65f 100644 --- a/ui/app/components/app/modals/qr-scanner/qr-scanner.component.js +++ b/ui/app/components/app/modals/qr-scanner/qr-scanner.component.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types' import log from 'loglevel' import { BrowserQRCodeReader } from '@zxing/library' import { getEnvironmentType } from '../../../../../../app/scripts/lib/util' -import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../../shared/constants/app' import Spinner from '../../../ui/spinner' import WebcamUtils from '../../../../../lib/webcam-utils' import PageContainerFooter from '../../../ui/page-container/page-container-footer/page-container-footer.component' diff --git a/ui/app/components/app/network-display/network-display.component.js b/ui/app/components/app/network-display/network-display.component.js index 0838ddc57..de2fd18f5 100644 --- a/ui/app/components/app/network-display/network-display.component.js +++ b/ui/app/components/app/network-display/network-display.component.js @@ -7,7 +7,7 @@ import { RINKEBY_NETWORK_ID, KOVAN_NETWORK_ID, GOERLI_NETWORK_ID, -} from '../../../../../app/scripts/controllers/network/enums' +} from '../../../../../shared/constants/network' const networkIdToTypeMap = { [MAINNET_NETWORK_ID]: 'mainnet', diff --git a/ui/app/components/app/signature-request-original/signature-request-original.component.js b/ui/app/components/app/signature-request-original/signature-request-original.component.js index b961f4def..f20933ad9 100644 --- a/ui/app/components/app/signature-request-original/signature-request-original.component.js +++ b/ui/app/components/app/signature-request-original/signature-request-original.component.js @@ -7,7 +7,7 @@ import { ObjectInspector } from 'react-inspector' import { ENVIRONMENT_TYPE_NOTIFICATION, MESSAGE_TYPE, -} from '../../../../../app/scripts/lib/enums' +} from '../../../../../shared/constants/app' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import Identicon from '../../ui/identicon' import AccountListItem from '../account-list-item' diff --git a/ui/app/components/app/signature-request-original/signature-request-original.container.js b/ui/app/components/app/signature-request-original/signature-request-original.container.js index 9a421aa67..7c1749fd5 100644 --- a/ui/app/components/app/signature-request-original/signature-request-original.container.js +++ b/ui/app/components/app/signature-request-original/signature-request-original.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { compose } from 'redux' import { withRouter } from 'react-router-dom' -import { MESSAGE_TYPE } from '../../../../../app/scripts/lib/enums' +import { MESSAGE_TYPE } from '../../../../../shared/constants/app' import { goHome } from '../../../store/actions' import { accountsWithSendEtherInfoSelector, diff --git a/ui/app/components/app/signature-request/signature-request.constants.js b/ui/app/components/app/signature-request/signature-request.constants.js index 9cf241928..7311a7a18 100644 --- a/ui/app/components/app/signature-request/signature-request.constants.js +++ b/ui/app/components/app/signature-request/signature-request.constants.js @@ -1,3 +1,3 @@ -import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../../shared/constants/app' export { ENVIRONMENT_TYPE_NOTIFICATION } diff --git a/ui/app/components/app/signature-request/signature-request.container.js b/ui/app/components/app/signature-request/signature-request.container.js index 0a521db4b..0c69f1c7a 100644 --- a/ui/app/components/app/signature-request/signature-request.container.js +++ b/ui/app/components/app/signature-request/signature-request.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { clearConfirmTransaction } from '../../../ducks/confirm-transaction/confirm-transaction.duck' import { accountsWithSendEtherInfoSelector } from '../../../selectors' import { getAccountByAddress } from '../../../helpers/utils/util' -import { MESSAGE_TYPE } from '../../../../../app/scripts/lib/enums' +import { MESSAGE_TYPE } from '../../../../../shared/constants/app' import SignatureRequest from './signature-request.component' function mapStateToProps(state) { diff --git a/ui/app/components/app/wallet-overview/eth-overview.js b/ui/app/components/app/wallet-overview/eth-overview.js index 4a550fcef..69aef6382 100644 --- a/ui/app/components/app/wallet-overview/eth-overview.js +++ b/ui/app/components/app/wallet-overview/eth-overview.js @@ -34,7 +34,7 @@ import { setSwapsFromToken, } from '../../../ducks/swaps/swaps' import IconButton from '../../ui/icon-button' -import { MAINNET_CHAIN_ID } from '../../../../../app/scripts/controllers/network/enums' +import { MAINNET_CHAIN_ID } from '../../../../../shared/constants/network' import WalletOverview from './wallet-overview' const EthOverview = ({ className }) => { diff --git a/ui/app/components/app/wallet-overview/token-overview.js b/ui/app/components/app/wallet-overview/token-overview.js index 3a2cfab90..58b5673db 100644 --- a/ui/app/components/app/wallet-overview/token-overview.js +++ b/ui/app/components/app/wallet-overview/token-overview.js @@ -27,7 +27,7 @@ import { getCurrentKeyring, getCurrentChainId, } from '../../../selectors/selectors' -import { MAINNET_CHAIN_ID } from '../../../../../app/scripts/controllers/network/enums' +import { MAINNET_CHAIN_ID } from '../../../../../shared/constants/network' import SwapIcon from '../../ui/icon/swap-icon.component' import SendIcon from '../../ui/icon/overview-send-icon.component' diff --git a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js index 2ef4e0ea3..b65af863b 100644 --- a/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js +++ b/ui/app/pages/confirm-add-suggested-token/confirm-add-suggested-token.component.js @@ -4,7 +4,7 @@ import Button from '../../components/ui/button' import Identicon from '../../components/ui/identicon' import TokenBalance from '../../components/ui/token-balance' import { getEnvironmentType } from '../../../../app/scripts/lib/util' -import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../shared/constants/app' export default class ConfirmAddSuggestedToken extends Component { static contextTypes = { diff --git a/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.component.js b/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.component.js index a9f68d388..bb5366bfd 100644 --- a/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.component.js +++ b/ui/app/pages/confirm-decrypt-message/confirm-decrypt-message.component.js @@ -9,7 +9,7 @@ import Identicon from '../../components/ui/identicon' import Tooltip from '../../components/ui/tooltip' import Copy from '../../components/ui/icon/copy-icon.component' -import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../shared/constants/app' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import { conversionUtil } from '../../helpers/utils/conversion-util' diff --git a/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js b/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js index c3d1dfaa2..a1c1178f7 100644 --- a/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js +++ b/ui/app/pages/confirm-encryption-public-key/confirm-encryption-public-key.component.js @@ -5,7 +5,7 @@ import AccountListItem from '../../components/app/account-list-item' import Button from '../../components/ui/button' import Identicon from '../../components/ui/identicon' -import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../shared/constants/app' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import { conversionUtil } from '../../helpers/utils/conversion-util' diff --git a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js index 24f452182..0b7d82ae0 100644 --- a/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/app/pages/confirm-transaction-base/confirm-transaction-base.component.js @@ -1,7 +1,7 @@ import ethUtil from 'ethereumjs-util' import React, { Component } from 'react' import PropTypes from 'prop-types' -import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../shared/constants/app' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import ConfirmPageContainer, { ConfirmDetailRow, diff --git a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js index 88dd10084..0de4f2951 100644 --- a/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js +++ b/ui/app/pages/confirm-transaction-switch/confirm-transaction-switch.component.js @@ -14,7 +14,7 @@ import { DECRYPT_MESSAGE_REQUEST_PATH, ENCRYPTION_PUBLIC_KEY_REQUEST_PATH, } from '../../helpers/constants/routes' -import { MESSAGE_TYPE } from '../../../../app/scripts/lib/enums' +import { MESSAGE_TYPE } from '../../../../shared/constants/app' import { TRANSACTION_CATEGORIES } from '../../../../shared/constants/transaction' export default class ConfirmTransactionSwitch extends Component { diff --git a/ui/app/pages/confirm-transaction/conf-tx.js b/ui/app/pages/confirm-transaction/conf-tx.js index cbf700548..3298baae6 100644 --- a/ui/app/pages/confirm-transaction/conf-tx.js +++ b/ui/app/pages/confirm-transaction/conf-tx.js @@ -10,7 +10,7 @@ import SignatureRequest from '../../components/app/signature-request' import SignatureRequestOriginal from '../../components/app/signature-request-original' import Loading from '../../components/ui/loading-screen' import { getMostRecentOverviewPage } from '../../ducks/history/history' -import { MESSAGE_TYPE } from '../../../../app/scripts/lib/enums' +import { MESSAGE_TYPE } from '../../../../shared/constants/app' import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction' function mapStateToProps(state) { diff --git a/ui/app/pages/error/error.component.js b/ui/app/pages/error/error.component.js index d3fe6f756..e7e9ff6ed 100644 --- a/ui/app/pages/error/error.component.js +++ b/ui/app/pages/error/error.component.js @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { getEnvironmentType } from '../../../../app/scripts/lib/util' -import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_POPUP } from '../../../../shared/constants/app' class ErrorPage extends PureComponent { static contextTypes = { diff --git a/ui/app/pages/home/home.container.js b/ui/app/pages/home/home.container.js index fedebf4ad..ba4b9e6d4 100644 --- a/ui/app/pages/home/home.container.js +++ b/ui/app/pages/home/home.container.js @@ -33,7 +33,7 @@ import { getEnvironmentType } from '../../../../app/scripts/lib/util' import { ENVIRONMENT_TYPE_NOTIFICATION, ENVIRONMENT_TYPE_POPUP, -} from '../../../../app/scripts/lib/enums' +} from '../../../../shared/constants/app' import { ALERT_TYPES, WEB3_SHIM_USAGE_ALERT_STATES, diff --git a/ui/app/pages/permissions-connect/permissions-connect.component.js b/ui/app/pages/permissions-connect/permissions-connect.component.js index bb16d1425..06a4f136c 100644 --- a/ui/app/pages/permissions-connect/permissions-connect.component.js +++ b/ui/app/pages/permissions-connect/permissions-connect.component.js @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import React, { Component } from 'react' import { Switch, Route } from 'react-router-dom' import { getEnvironmentType } from '../../../../app/scripts/lib/util' -import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../../shared/constants/app' import { DEFAULT_ROUTE } from '../../helpers/constants/routes' import PermissionPageContainer from '../../components/app/permission-page-container' import ChooseAccount from './choose-account' diff --git a/ui/app/pages/routes/routes.component.js b/ui/app/pages/routes/routes.component.js index 04db4f0e9..5aaf80124 100644 --- a/ui/app/pages/routes/routes.component.js +++ b/ui/app/pages/routes/routes.component.js @@ -58,7 +58,7 @@ import { import { ENVIRONMENT_TYPE_NOTIFICATION, ENVIRONMENT_TYPE_POPUP, -} from '../../../../app/scripts/lib/enums' +} from '../../../../shared/constants/app' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import { TRANSACTION_STATUSES } from '../../../../shared/constants/transaction' diff --git a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js index e8c498060..a1d884e79 100644 --- a/ui/app/pages/send/send-content/add-recipient/ens-input.component.js +++ b/ui/app/pages/send/send-content/add-recipient/ens-input.component.js @@ -13,7 +13,7 @@ import { isValidAddress, isValidAddressHead, } from '../../../../helpers/utils/util' -import { MAINNET_NETWORK_ID } from '../../../../../../app/scripts/controllers/network/enums' +import { MAINNET_NETWORK_ID } from '../../../../../../shared/constants/network' // Local Constants const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' diff --git a/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js b/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js index 5d9139014..101daf7ab 100644 --- a/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js +++ b/ui/app/pages/settings/contact-list-tab/contact-list-tab.container.js @@ -2,7 +2,7 @@ import { compose } from 'redux' import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { getAddressBook } from '../../../selectors' -import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_POPUP } from '../../../../../shared/constants/app' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import { diff --git a/ui/app/pages/settings/networks-tab/networks-tab.constants.js b/ui/app/pages/settings/networks-tab/networks-tab.constants.js index 0271abcfc..9a9eb9699 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.constants.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.constants.js @@ -9,7 +9,7 @@ import { RINKEBY_CHAIN_ID, ROPSTEN, ROPSTEN_CHAIN_ID, -} from '../../../../../app/scripts/controllers/network/enums' +} from '../../../../../shared/constants/network' const defaultNetworksData = [ { diff --git a/ui/app/pages/settings/networks-tab/networks-tab.container.js b/ui/app/pages/settings/networks-tab/networks-tab.container.js index 94fcddc81..61fc03836 100644 --- a/ui/app/pages/settings/networks-tab/networks-tab.container.js +++ b/ui/app/pages/settings/networks-tab/networks-tab.container.js @@ -10,7 +10,7 @@ import { showModal, } from '../../../store/actions' import { NETWORKS_FORM_ROUTE } from '../../../helpers/constants/routes' -import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../shared/constants/app' import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import NetworksTab from './networks-tab.component' import { defaultNetworksData } from './networks-tab.constants' diff --git a/ui/app/pages/settings/settings.container.js b/ui/app/pages/settings/settings.container.js index ffade71da..d35fbbe6d 100644 --- a/ui/app/pages/settings/settings.container.js +++ b/ui/app/pages/settings/settings.container.js @@ -3,7 +3,7 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { getAddressBookEntryName } from '../../selectors' import { isValidAddress } from '../../helpers/utils/util' -import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_POPUP } from '../../../../shared/constants/app' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import { getMostRecentOverviewPage } from '../../ducks/history/history' diff --git a/ui/app/pages/swaps/index.js b/ui/app/pages/swaps/index.js index 01c1f8f78..ca720910d 100644 --- a/ui/app/pages/swaps/index.js +++ b/ui/app/pages/swaps/index.js @@ -48,7 +48,7 @@ import { SWAP_FAILED_ERROR, OFFLINE_FOR_MAINTENANCE, } from '../../helpers/constants/swaps' -import { MAINNET_CHAIN_ID } from '../../../../app/scripts/controllers/network/enums' +import { MAINNET_CHAIN_ID } from '../../../../shared/constants/network' import { resetBackgroundSwapsState, diff --git a/ui/app/pages/unlock-page/unlock-page.container.js b/ui/app/pages/unlock-page/unlock-page.container.js index 222d8b04a..9284ebeba 100644 --- a/ui/app/pages/unlock-page/unlock-page.container.js +++ b/ui/app/pages/unlock-page/unlock-page.container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux' import { withRouter } from 'react-router-dom' import { compose } from 'redux' import { getEnvironmentType } from '../../../../app/scripts/lib/util' -import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_POPUP } from '../../../../shared/constants/app' import { DEFAULT_ROUTE, RESTORE_VAULT_ROUTE, diff --git a/ui/app/selectors/permissions.js b/ui/app/selectors/permissions.js index a463d09d0..e6dfa4db5 100644 --- a/ui/app/selectors/permissions.js +++ b/ui/app/selectors/permissions.js @@ -1,5 +1,5 @@ import { forOwn } from 'lodash' -import { CAVEAT_NAMES } from '../../../app/scripts/controllers/permissions/enums' +import { CAVEAT_NAMES } from '../../../shared/constants/permissions' import { getMetaMaskAccountsOrdered, getOriginOfCurrentTab, diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index 780bb81c1..0dd31dc9f 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -12,7 +12,7 @@ import { import { getMethodDataAsync } from '../helpers/utils/transactions.util' import { fetchSymbolAndDecimals } from '../helpers/utils/token-util' import switchDirection from '../helpers/utils/switch-direction' -import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../shared/constants/app' import { hasUnconfirmedTransactions } from '../helpers/utils/confirm-tx.util' import { setCustomGasLimit } from '../ducks/gas/gas.duck' import txHelper from '../../lib/tx-helper' diff --git a/ui/index.js b/ui/index.js index 6c4541f17..3f0e172f8 100644 --- a/ui/index.js +++ b/ui/index.js @@ -6,7 +6,7 @@ import { render } from 'react-dom' import { getEnvironmentType } from '../app/scripts/lib/util' import { ALERT_TYPES } from '../shared/constants/alerts' import { SENTRY_STATE } from '../app/scripts/lib/setupSentry' -import { ENVIRONMENT_TYPE_POPUP } from '../app/scripts/lib/enums' +import { ENVIRONMENT_TYPE_POPUP } from '../shared/constants/app' import Root from './app/pages' import * as actions from './app/store/actions' import configureStore from './app/store/store' diff --git a/ui/lib/etherscan-prefix-for-network.js b/ui/lib/etherscan-prefix-for-network.js index 32183d1bc..82e92f3b1 100644 --- a/ui/lib/etherscan-prefix-for-network.js +++ b/ui/lib/etherscan-prefix-for-network.js @@ -1,4 +1,4 @@ -import * as networkEnums from '../../app/scripts/controllers/network/enums' +import * as networkEnums from '../../shared/constants/network' /** * Gets the etherscan.io URL prefix for a given network ID. diff --git a/ui/lib/webcam-utils.js b/ui/lib/webcam-utils.js index a242186df..6c451fd21 100644 --- a/ui/lib/webcam-utils.js +++ b/ui/lib/webcam-utils.js @@ -4,7 +4,7 @@ import { ENVIRONMENT_TYPE_POPUP, PLATFORM_BRAVE, PLATFORM_FIREFOX, -} from '../../app/scripts/lib/enums' +} from '../../shared/constants/app' import { getEnvironmentType, getPlatform } from '../../app/scripts/lib/util' class WebcamUtils {