Move swaps constants to the shared constants directory (#10614)

feature/default_network_editable
Dan J Miller 4 years ago committed by GitHub
parent 3d4dfc74a8
commit 153bbc6053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/scripts/controllers/swaps.js
  2. 0
      shared/constants/swaps.js
  3. 2
      test/unit/app/controllers/swaps.test.js
  4. 2
      ui/app/components/app/transaction-list/transaction-list.component.js
  5. 2
      ui/app/ducks/swaps/swaps.js
  6. 2
      ui/app/hooks/useCurrentAsset.js
  7. 2
      ui/app/hooks/useSwappedTokenValue.js
  8. 2
      ui/app/pages/swaps/awaiting-swap/awaiting-swap.js
  9. 2
      ui/app/pages/swaps/build-quote/build-quote.js
  10. 2
      ui/app/pages/swaps/index.js
  11. 2
      ui/app/pages/swaps/swaps-util-test-constants.js
  12. 2
      ui/app/pages/swaps/swaps.util.js
  13. 2
      ui/app/pages/swaps/view-quote/view-quote.js
  14. 2
      ui/app/selectors/selectors.js

@ -13,7 +13,7 @@ import {
QUOTES_EXPIRED_ERROR,
QUOTES_NOT_AVAILABLE_ERROR,
SWAPS_FETCH_ORDER_CONFLICT,
} from '../../../ui/app/helpers/constants/swaps';
} from '../../../shared/constants/swaps';
import {
fetchTradesInfo as defaultFetchTradesInfo,
fetchSwapsFeatureLiveness as defaultFetchSwapsFeatureLiveness,

@ -9,7 +9,7 @@ import {
ROPSTEN_NETWORK_ID,
MAINNET_NETWORK_ID,
} from '../../../../shared/constants/network';
import { ETH_SWAPS_TOKEN_OBJECT } from '../../../../ui/app/helpers/constants/swaps';
import { ETH_SWAPS_TOKEN_OBJECT } from '../../../../shared/constants/swaps';
import { createTestProviderTools } from '../../../stub/provider';
import SwapsController, {
utils,

@ -9,7 +9,7 @@ import { useI18nContext } from '../../../hooks/useI18nContext';
import TransactionListItem from '../transaction-list-item';
import Button from '../../ui/button';
import { TOKEN_CATEGORY_HASH } from '../../../helpers/constants/transactions';
import { SWAPS_CONTRACT_ADDRESS } from '../../../helpers/constants/swaps';
import { SWAPS_CONTRACT_ADDRESS } from '../../../../../shared/constants/swaps';
import { TRANSACTION_TYPES } from '../../../../../shared/constants/transaction';
const PAGE_INCREMENT = 10;

@ -56,7 +56,7 @@ import {
QUOTES_NOT_AVAILABLE_ERROR,
SWAP_FAILED_ERROR,
SWAPS_FETCH_ORDER_CONFLICT,
} from '../../helpers/constants/swaps';
} from '../../../../shared/constants/swaps';
import { TRANSACTION_TYPES } from '../../../../shared/constants/transaction';
const GAS_PRICES_LOADING_STATES = {

@ -2,7 +2,7 @@ import { useSelector } from 'react-redux';
import { useRouteMatch } from 'react-router-dom';
import { getTokens } from '../ducks/metamask/metamask';
import { ASSET_ROUTE } from '../helpers/constants/routes';
import { ETH_SWAPS_TOKEN_OBJECT } from '../helpers/constants/swaps';
import { ETH_SWAPS_TOKEN_OBJECT } from '../../../shared/constants/swaps';
/**
* Returns a token object for the asset that is currently being viewed.

@ -1,5 +1,5 @@
import { TRANSACTION_TYPES } from '../../../shared/constants/transaction';
import { ETH_SWAPS_TOKEN_OBJECT } from '../helpers/constants/swaps';
import { ETH_SWAPS_TOKEN_OBJECT } from '../../../shared/constants/swaps';
import { getSwapsTokensReceivedFromTxMeta } from '../pages/swaps/swaps.util';
import { useTokenFiatAmount } from './useTokenFiatAmount';

@ -30,7 +30,7 @@ import {
ERROR_FETCHING_QUOTES,
QUOTES_NOT_AVAILABLE_ERROR,
OFFLINE_FOR_MAINTENANCE,
} from '../../../helpers/constants/swaps';
} from '../../../../../shared/constants/swaps';
import { ASSET_ROUTE, DEFAULT_ROUTE } from '../../../helpers/constants/routes';
import { getRenderableNetworkFeesForQuote } from '../swaps.util';

@ -36,7 +36,7 @@ import { useTokenTracker } from '../../../hooks/useTokenTracker';
import { useTokenFiatAmount } from '../../../hooks/useTokenFiatAmount';
import { useEthFiatAmount } from '../../../hooks/useEthFiatAmount';
import { ETH_SWAPS_TOKEN_OBJECT } from '../../../helpers/constants/swaps';
import { ETH_SWAPS_TOKEN_OBJECT } from '../../../../../shared/constants/swaps';
import { resetSwapsPostFetchState, removeToken } from '../../../store/actions';
import { fetchTokenPrice, fetchTokenBalance } from '../swaps.util';

@ -44,7 +44,7 @@ import {
QUOTES_NOT_AVAILABLE_ERROR,
SWAP_FAILED_ERROR,
OFFLINE_FOR_MAINTENANCE,
} from '../../helpers/constants/swaps';
} from '../../../../shared/constants/swaps';
import { MAINNET_CHAIN_ID } from '../../../../shared/constants/network';
import {

@ -1,4 +1,4 @@
import { ETH_SWAPS_TOKEN_OBJECT } from '../../helpers/constants/swaps';
import { ETH_SWAPS_TOKEN_OBJECT } from '../../../../shared/constants/swaps';
export const TRADES_BASE_PROD_URL =
'https://api.metaswap.codefi.network/trades?';

@ -5,7 +5,7 @@ import { isValidAddress } from 'ethereumjs-util';
import {
ETH_SWAPS_TOKEN_OBJECT,
METASWAP_API_HOST,
} from '../../helpers/constants/swaps';
} from '../../../../shared/constants/swaps';
import {
calcTokenValue,
calcTokenAmount,

@ -73,7 +73,7 @@ import {
getRenderableNetworkFeesForQuote,
} from '../swaps.util';
import { useTokenTracker } from '../../../hooks/useTokenTracker';
import { QUOTES_EXPIRED_ERROR } from '../../../helpers/constants/swaps';
import { QUOTES_EXPIRED_ERROR } from '../../../../../shared/constants/swaps';
import CountdownTimer from '../countdown-timer';
import SwapsFooter from '../swaps-footer';
import ViewQuotePriceDifference from './view-quote-price-difference';

@ -15,7 +15,7 @@ import {
getValueFromWeiHex,
hexToDecimal,
} from '../helpers/utils/conversions.util';
import { ETH_SWAPS_TOKEN_OBJECT } from '../helpers/constants/swaps';
import { ETH_SWAPS_TOKEN_OBJECT } from '../../../shared/constants/swaps';
/**
* One of the only remaining valid uses of selecting the network subkey of the

Loading…
Cancel
Save