diff --git a/ui/app/pages/swaps/select-quote-popover/select-quote-popover-constants.js b/ui/pages/swaps/select-quote-popover/select-quote-popover-constants.js
similarity index 100%
rename from ui/app/pages/swaps/select-quote-popover/select-quote-popover-constants.js
rename to ui/pages/swaps/select-quote-popover/select-quote-popover-constants.js
diff --git a/ui/app/pages/swaps/select-quote-popover/select-quote-popover.js b/ui/pages/swaps/select-quote-popover/select-quote-popover.js
similarity index 100%
rename from ui/app/pages/swaps/select-quote-popover/select-quote-popover.js
rename to ui/pages/swaps/select-quote-popover/select-quote-popover.js
diff --git a/ui/app/pages/swaps/select-quote-popover/select-quote-popover.stories.js b/ui/pages/swaps/select-quote-popover/select-quote-popover.stories.js
similarity index 100%
rename from ui/app/pages/swaps/select-quote-popover/select-quote-popover.stories.js
rename to ui/pages/swaps/select-quote-popover/select-quote-popover.stories.js
diff --git a/ui/app/pages/swaps/select-quote-popover/select-quote-popover.test.js b/ui/pages/swaps/select-quote-popover/select-quote-popover.test.js
similarity index 89%
rename from ui/app/pages/swaps/select-quote-popover/select-quote-popover.test.js
rename to ui/pages/swaps/select-quote-popover/select-quote-popover.test.js
index b23a35f68..1eaa99738 100644
--- a/ui/app/pages/swaps/select-quote-popover/select-quote-popover.test.js
+++ b/ui/pages/swaps/select-quote-popover/select-quote-popover.test.js
@@ -1,6 +1,6 @@
import React from 'react';
-import { renderWithProvider } from '../../../../../test/jest';
+import { renderWithProvider } from '../../../../test/jest';
import SelectQuotePopover from '.';
const createProps = (customProps = {}) => {
diff --git a/ui/app/pages/swaps/select-quote-popover/sort-list/__snapshots__/sort-list.test.js.snap b/ui/pages/swaps/select-quote-popover/sort-list/__snapshots__/sort-list.test.js.snap
similarity index 100%
rename from ui/app/pages/swaps/select-quote-popover/sort-list/__snapshots__/sort-list.test.js.snap
rename to ui/pages/swaps/select-quote-popover/sort-list/__snapshots__/sort-list.test.js.snap
diff --git a/ui/app/pages/swaps/select-quote-popover/sort-list/index.js b/ui/pages/swaps/select-quote-popover/sort-list/index.js
similarity index 100%
rename from ui/app/pages/swaps/select-quote-popover/sort-list/index.js
rename to ui/pages/swaps/select-quote-popover/sort-list/index.js
diff --git a/ui/app/pages/swaps/select-quote-popover/sort-list/sort-list.js b/ui/pages/swaps/select-quote-popover/sort-list/sort-list.js
similarity index 100%
rename from ui/app/pages/swaps/select-quote-popover/sort-list/sort-list.js
rename to ui/pages/swaps/select-quote-popover/sort-list/sort-list.js
diff --git a/ui/app/pages/swaps/select-quote-popover/sort-list/sort-list.test.js b/ui/pages/swaps/select-quote-popover/sort-list/sort-list.test.js
similarity index 97%
rename from ui/app/pages/swaps/select-quote-popover/sort-list/sort-list.test.js
rename to ui/pages/swaps/select-quote-popover/sort-list/sort-list.test.js
index 57896b8e0..99e5a19e5 100644
--- a/ui/app/pages/swaps/select-quote-popover/sort-list/sort-list.test.js
+++ b/ui/pages/swaps/select-quote-popover/sort-list/sort-list.test.js
@@ -1,6 +1,6 @@
import React from 'react';
-import { renderWithProvider } from '../../../../../../test/jest';
+import { renderWithProvider } from '../../../../../test/jest';
import SortList from './sort-list';
const createProps = (customProps = {}) => {
diff --git a/ui/app/pages/swaps/slippage-buttons/__snapshots__/slippage-buttons.test.js.snap b/ui/pages/swaps/slippage-buttons/__snapshots__/slippage-buttons.test.js.snap
similarity index 100%
rename from ui/app/pages/swaps/slippage-buttons/__snapshots__/slippage-buttons.test.js.snap
rename to ui/pages/swaps/slippage-buttons/__snapshots__/slippage-buttons.test.js.snap
diff --git a/ui/app/pages/swaps/slippage-buttons/index.js b/ui/pages/swaps/slippage-buttons/index.js
similarity index 100%
rename from ui/app/pages/swaps/slippage-buttons/index.js
rename to ui/pages/swaps/slippage-buttons/index.js
diff --git a/ui/app/pages/swaps/slippage-buttons/index.scss b/ui/pages/swaps/slippage-buttons/index.scss
similarity index 100%
rename from ui/app/pages/swaps/slippage-buttons/index.scss
rename to ui/pages/swaps/slippage-buttons/index.scss
diff --git a/ui/app/pages/swaps/slippage-buttons/slippage-buttons.js b/ui/pages/swaps/slippage-buttons/slippage-buttons.js
similarity index 90%
rename from ui/app/pages/swaps/slippage-buttons/slippage-buttons.js
rename to ui/pages/swaps/slippage-buttons/slippage-buttons.js
index 83b230062..66a11f43b 100644
--- a/ui/app/pages/swaps/slippage-buttons/slippage-buttons.js
+++ b/ui/pages/swaps/slippage-buttons/slippage-buttons.js
@@ -13,8 +13,12 @@ export default function SlippageButtons({
}) {
const t = useContext(I18nContext);
const [customValue, setCustomValue] = useState(() => {
- if (currentSlippage && currentSlippage !== 2 && currentSlippage !== 3) {
- return currentSlippage;
+ if (
+ typeof currentSlippage === 'number' &&
+ currentSlippage !== 2 &&
+ currentSlippage !== 3
+ ) {
+ return currentSlippage.toString();
}
return '';
});
@@ -24,7 +28,7 @@ export default function SlippageButtons({
return 1;
} else if (currentSlippage === 2) {
return 0;
- } else if (currentSlippage) {
+ } else if (typeof currentSlippage === 'number') {
return 2;
}
return 1; // Choose activeButtonIndex = 1 for 3% slippage by default.
@@ -33,9 +37,12 @@ export default function SlippageButtons({
let errorText = '';
if (customValue) {
- if (Number(customValue) <= 0) {
- errorText = t('swapSlippageTooLow');
- } else if (Number(customValue) < 0.5) {
+ // customValue is a string, e.g. '0'
+ if (Number(customValue) < 0) {
+ errorText = t('swapSlippageNegative');
+ } else if (Number(customValue) > 0 && Number(customValue) <= 1) {
+ // We will not show this warning for 0% slippage, because we will only
+ // return non-slippage quotes from off-chain makers.
errorText = t('swapLowSlippageError');
} else if (
Number(customValue) >= 5 &&
@@ -136,10 +143,6 @@ export default function SlippageButtons({
ref={setInputRef}
onBlur={() => {
setEnteringCustomValue(false);
- if (customValue === '0') {
- setCustomValue('');
- setActiveButtonIndex(1);
- }
}}
value={customValue || ''}
/>
diff --git a/ui/app/pages/swaps/slippage-buttons/slippage-buttons.stories.js b/ui/pages/swaps/slippage-buttons/slippage-buttons.stories.js
similarity index 100%
rename from ui/app/pages/swaps/slippage-buttons/slippage-buttons.stories.js
rename to ui/pages/swaps/slippage-buttons/slippage-buttons.stories.js
diff --git a/ui/app/pages/swaps/slippage-buttons/slippage-buttons.test.js b/ui/pages/swaps/slippage-buttons/slippage-buttons.test.js
similarity index 93%
rename from ui/app/pages/swaps/slippage-buttons/slippage-buttons.test.js
rename to ui/pages/swaps/slippage-buttons/slippage-buttons.test.js
index 0108f07d2..60ceeff4c 100644
--- a/ui/app/pages/swaps/slippage-buttons/slippage-buttons.test.js
+++ b/ui/pages/swaps/slippage-buttons/slippage-buttons.test.js
@@ -1,6 +1,6 @@
import React from 'react';
-import { renderWithProvider } from '../../../../../test/jest';
+import { renderWithProvider } from '../../../../test/jest';
import SlippageButtons from '.';
const createProps = (customProps = {}) => {
diff --git a/ui/app/pages/swaps/swaps-footer/__snapshots__/swaps-footer.test.js.snap b/ui/pages/swaps/swaps-footer/__snapshots__/swaps-footer.test.js.snap
similarity index 100%
rename from ui/app/pages/swaps/swaps-footer/__snapshots__/swaps-footer.test.js.snap
rename to ui/pages/swaps/swaps-footer/__snapshots__/swaps-footer.test.js.snap
diff --git a/ui/app/pages/swaps/swaps-footer/index.js b/ui/pages/swaps/swaps-footer/index.js
similarity index 100%
rename from ui/app/pages/swaps/swaps-footer/index.js
rename to ui/pages/swaps/swaps-footer/index.js
diff --git a/ui/app/pages/swaps/swaps-footer/index.scss b/ui/pages/swaps/swaps-footer/index.scss
similarity index 100%
rename from ui/app/pages/swaps/swaps-footer/index.scss
rename to ui/pages/swaps/swaps-footer/index.scss
diff --git a/ui/app/pages/swaps/swaps-footer/swaps-footer.js b/ui/pages/swaps/swaps-footer/swaps-footer.js
similarity index 100%
rename from ui/app/pages/swaps/swaps-footer/swaps-footer.js
rename to ui/pages/swaps/swaps-footer/swaps-footer.js
diff --git a/ui/app/pages/swaps/swaps-footer/swaps-footer.test.js b/ui/pages/swaps/swaps-footer/swaps-footer.test.js
similarity index 91%
rename from ui/app/pages/swaps/swaps-footer/swaps-footer.test.js
rename to ui/pages/swaps/swaps-footer/swaps-footer.test.js
index 4cff41083..17a2b3355 100644
--- a/ui/app/pages/swaps/swaps-footer/swaps-footer.test.js
+++ b/ui/pages/swaps/swaps-footer/swaps-footer.test.js
@@ -1,6 +1,6 @@
import React from 'react';
-import { renderWithProvider } from '../../../../../test/jest';
+import { renderWithProvider } from '../../../../test/jest';
import SwapsFooter from '.';
const createProps = (customProps = {}) => {
diff --git a/ui/app/pages/swaps/swaps-gas-customization-modal/index.js b/ui/pages/swaps/swaps-gas-customization-modal/index.js
similarity index 100%
rename from ui/app/pages/swaps/swaps-gas-customization-modal/index.js
rename to ui/pages/swaps/swaps-gas-customization-modal/index.js
diff --git a/ui/app/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.js b/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.js
similarity index 100%
rename from ui/app/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.js
rename to ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.js
diff --git a/ui/app/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.js b/ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.js
similarity index 100%
rename from ui/app/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.js
rename to ui/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.js
diff --git a/ui/app/pages/swaps/swaps-util-test-constants.js b/ui/pages/swaps/swaps-util-test-constants.js
similarity index 99%
rename from ui/app/pages/swaps/swaps-util-test-constants.js
rename to ui/pages/swaps/swaps-util-test-constants.js
index cf54889b1..54c0b1e34 100644
--- a/ui/app/pages/swaps/swaps-util-test-constants.js
+++ b/ui/pages/swaps/swaps-util-test-constants.js
@@ -1,4 +1,4 @@
-import { ETH_SWAPS_TOKEN_OBJECT } from '../../../../shared/constants/swaps';
+import { ETH_SWAPS_TOKEN_OBJECT } from '../../../shared/constants/swaps';
export const TRADES_BASE_PROD_URL =
'https://api.metaswap.codefi.network/trades?';
diff --git a/ui/app/pages/swaps/swaps.util.js b/ui/pages/swaps/swaps.util.js
similarity index 98%
rename from ui/app/pages/swaps/swaps.util.js
rename to ui/pages/swaps/swaps.util.js
index 968802bb3..e72483f35 100644
--- a/ui/app/pages/swaps/swaps.util.js
+++ b/ui/pages/swaps/swaps.util.js
@@ -6,16 +6,16 @@ import {
METASWAP_CHAINID_API_HOST_MAP,
SWAPS_CHAINID_CONTRACT_ADDRESS_MAP,
ETH_WETH_CONTRACT_ADDRESS,
-} from '../../../../shared/constants/swaps';
+} from '../../../shared/constants/swaps';
import {
isSwapsDefaultTokenAddress,
isSwapsDefaultTokenSymbol,
-} from '../../../../shared/modules/swaps.utils';
+} from '../../../shared/modules/swaps.utils';
import {
ETH_SYMBOL,
WETH_SYMBOL,
MAINNET_CHAIN_ID,
-} from '../../../../shared/constants/network';
+} from '../../../shared/constants/network';
import {
calcTokenValue,
calcTokenAmount,
@@ -34,7 +34,7 @@ import { formatCurrency } from '../../helpers/utils/confirm-tx.util';
import fetchWithCache from '../../helpers/utils/fetch-with-cache';
import { calcGasTotal } from '../send/send.utils';
-import { isValidHexAddress } from '../../../../shared/modules/hexstring-utils';
+import { isValidHexAddress } from '../../../shared/modules/hexstring-utils';
const TOKEN_TRANSFER_LOG_TOPIC_HASH =
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef';
diff --git a/ui/app/pages/swaps/swaps.util.test.js b/ui/pages/swaps/swaps.util.test.js
similarity index 98%
rename from ui/app/pages/swaps/swaps.util.test.js
rename to ui/pages/swaps/swaps.util.test.js
index cc7f6d9fc..936864f0f 100644
--- a/ui/app/pages/swaps/swaps.util.test.js
+++ b/ui/pages/swaps/swaps.util.test.js
@@ -5,11 +5,11 @@ import {
MAINNET_CHAIN_ID,
BSC_CHAIN_ID,
LOCALHOST_CHAIN_ID,
-} from '../../../../shared/constants/network';
+} from '../../../shared/constants/network';
import {
SWAPS_CHAINID_CONTRACT_ADDRESS_MAP,
ETH_WETH_CONTRACT_ADDRESS,
-} from '../../../../shared/constants/swaps';
+} from '../../../shared/constants/swaps';
import {
TOKENS,
EXPECTED_TOKENS_RESULT,
@@ -26,7 +26,7 @@ import {
isContractAddressValid,
} from './swaps.util';
-jest.mock('../../../lib/storage-helpers.js', () => ({
+jest.mock('../../helpers/utils/storage-helpers.js', () => ({
getStorageItem: jest.fn(),
setStorageItem: jest.fn(),
}));
diff --git a/ui/app/pages/swaps/view-quote/index.js b/ui/pages/swaps/view-quote/index.js
similarity index 100%
rename from ui/app/pages/swaps/view-quote/index.js
rename to ui/pages/swaps/view-quote/index.js
diff --git a/ui/app/pages/swaps/view-quote/index.scss b/ui/pages/swaps/view-quote/index.scss
similarity index 77%
rename from ui/app/pages/swaps/view-quote/index.scss
rename to ui/pages/swaps/view-quote/index.scss
index 20c2ea0b4..bdc9bde88 100644
--- a/ui/app/pages/swaps/view-quote/index.scss
+++ b/ui/pages/swaps/view-quote/index.scss
@@ -95,46 +95,53 @@
&-wrapper {
width: 100%;
- &.medium .actionable-message,
- &.fiat-error .actionable-message {
- border-color: $Yellow-500;
- background: $Yellow-100;
+ &.low,
+ &.medium,
+ &.high {
+ .actionable-message {
+ .actionable-message__message {
+ color: inherit;
+ }
- .actionable-message__message {
- color: inherit;
+ button {
+ font-size: $font-size-h8;
+ padding: 4px 12px;
+ border-radius: 42px;
+ }
}
+ }
- button {
- background: $Yellow-500;
- border-radius: 42px;
+ &.low {
+ .actionable-message {
+ button {
+ background: $Blue-500;
+ color: #fff;
+ }
}
}
- &.high {
+ &.medium {
.actionable-message {
- border-color: $Red-500;
- background: $Red-100;
+ border-color: $Yellow-500;
+ background: $Yellow-100;
- .actionable-message__message {
- color: $Red-500;
+ button {
+ background: $Yellow-500;
}
}
+ }
- button {
- background: $Red-500;
- color: #fff;
- border-radius: 42px;
+ &.high {
+ .actionable-message {
+ border-color: $Red-300;
+ background: $Red-000;
- /* Offsets the width of ActionableMessage icon */
- margin-right: -22px;
+ button {
+ background: $Red-500;
+ color: #fff;
+ }
}
}
-
- /* Hides info tooltip if there's a fiat error message */
- &.fiat-error div[data-tooltipped] {
- /* !important overrides style being applied directly to tooltip by component */
- display: none !important;
- }
}
&-contents {
@@ -160,10 +167,9 @@
width: 100%;
align-items: center;
justify-content: center;
- width: intrinsic; /* Safari/WebKit uses a non-standard name */
- width: max-content;
max-width: 340px;
margin-top: 8px;
+ margin-bottom: 28px;
@media screen and (min-width: 576px) {
&--thin {
diff --git a/ui/app/pages/swaps/view-quote/view-quote-price-difference.js b/ui/pages/swaps/view-quote/view-quote-price-difference.js
similarity index 77%
rename from ui/app/pages/swaps/view-quote/view-quote-price-difference.js
rename to ui/pages/swaps/view-quote/view-quote-price-difference.js
index 61d1ad52b..327aaaf49 100644
--- a/ui/app/pages/swaps/view-quote/view-quote-price-difference.js
+++ b/ui/pages/swaps/view-quote/view-quote-price-difference.js
@@ -6,6 +6,11 @@ import { I18nContext } from '../../../contexts/i18n';
import ActionableMessage from '../actionable-message';
import Tooltip from '../../../components/ui/tooltip';
+import Box from '../../../components/ui/box';
+import {
+ JUSTIFY_CONTENT,
+ DISPLAY,
+} from '../../../helpers/constants/design-system';
export default function ViewQuotePriceDifference(props) {
const {
@@ -28,9 +33,10 @@ export default function ViewQuotePriceDifference(props) {
let priceDifferenceAcknowledgementText = '';
if (priceSlippageUnknownFiatValue) {
// A calculation error signals we cannot determine dollar value
- priceDifferenceMessage = t('swapPriceDifferenceUnavailable');
- priceDifferenceClass = 'fiat-error';
- priceDifferenceAcknowledgementText = t('continue');
+ priceDifferenceTitle = t('swapPriceUnavailableTitle');
+ priceDifferenceMessage = t('swapPriceUnavailableDescription');
+ priceDifferenceClass = 'high';
+ priceDifferenceAcknowledgementText = t('tooltipApproveButton');
} else {
priceDifferenceTitle = t('swapPriceDifferenceTitle', [
priceDifferencePercentage,
@@ -44,9 +50,7 @@ export default function ViewQuotePriceDifference(props) {
priceSlippageFromDestination, // Destination tokens total value
]);
priceDifferenceClass = usedQuote.priceSlippage.bucket;
- priceDifferenceAcknowledgementText = t(
- 'swapPriceDifferenceAcknowledgement',
- );
+ priceDifferenceAcknowledgementText = t('tooltipApproveButton');
}
return (
@@ -60,11 +64,22 @@ export default function ViewQuotePriceDifference(props) {
message={
- {priceDifferenceTitle && (
+
{priceDifferenceTitle}
- )}
+
+
+
+
{priceDifferenceMessage}
{!acknowledged && (
@@ -78,13 +93,6 @@ export default function ViewQuotePriceDifference(props) {
)}
-
-
-
}
/>
diff --git a/ui/app/pages/swaps/view-quote/view-quote-price-difference.test.js b/ui/pages/swaps/view-quote/view-quote-price-difference.test.js
similarity index 97%
rename from ui/app/pages/swaps/view-quote/view-quote-price-difference.test.js
rename to ui/pages/swaps/view-quote/view-quote-price-difference.test.js
index c00322959..cd94ab4a0 100644
--- a/ui/app/pages/swaps/view-quote/view-quote-price-difference.test.js
+++ b/ui/pages/swaps/view-quote/view-quote-price-difference.test.js
@@ -2,7 +2,7 @@ import React from 'react';
import { shallow } from 'enzyme';
import { Provider } from 'react-redux';
import configureMockStore from 'redux-mock-store';
-import { NETWORK_TYPE_RPC } from '../../../../../shared/constants/network';
+import { NETWORK_TYPE_RPC } from '../../../../shared/constants/network';
import ViewQuotePriceDifference from './view-quote-price-difference';
describe('View Price Quote Difference', () => {
@@ -144,6 +144,6 @@ describe('View Price Quote Difference', () => {
'Could not determine price.';
renderComponent(props);
- expect(component.html()).toContain('fiat-error');
+ expect(component.html()).toContain('high');
});
});
diff --git a/ui/app/pages/swaps/view-quote/view-quote.js b/ui/pages/swaps/view-quote/view-quote.js
similarity index 96%
rename from ui/app/pages/swaps/view-quote/view-quote.js
rename to ui/pages/swaps/view-quote/view-quote.js
index e20e806a0..c472f1f40 100644
--- a/ui/app/pages/swaps/view-quote/view-quote.js
+++ b/ui/pages/swaps/view-quote/view-quote.js
@@ -39,6 +39,8 @@ import {
getSwapsDefaultToken,
getCurrentChainId,
getNativeCurrency,
+ isHardwareWallet,
+ getHardwareWalletType,
} from '../../../selectors';
import { toPrecisionWithoutTrailingZeros } from '../../../helpers/utils/util';
import { getTokens } from '../../../ducks/metamask/metamask';
@@ -75,7 +77,7 @@ import {
getRenderableNetworkFeesForQuote,
} from '../swaps.util';
import { useTokenTracker } from '../../../hooks/useTokenTracker';
-import { QUOTES_EXPIRED_ERROR } from '../../../../../shared/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';
@@ -330,6 +332,8 @@ export default function ViewQuote() {
available_quotes: numberOfQuotes,
};
+ const hardwareWalletUsed = useSelector(isHardwareWallet);
+ const hardwareWalletType = useSelector(getHardwareWalletType);
const allAvailableQuotesOpened = useNewMetricEvent({
event: 'All Available Quotes Opened',
category: 'swaps',
@@ -340,6 +344,8 @@ export default function ViewQuote() {
usedQuote?.aggregator === topQuote?.aggregator
? null
: usedQuote?.aggregator,
+ is_hardware_wallet: hardwareWalletUsed,
+ hardware_wallet_type: hardwareWalletType,
},
});
const quoteDetailsOpened = useNewMetricEvent({
@@ -352,6 +358,8 @@ export default function ViewQuote() {
usedQuote?.aggregator === topQuote?.aggregator
? null
: usedQuote?.aggregator,
+ is_hardware_wallet: hardwareWalletUsed,
+ hardware_wallet_type: hardwareWalletType,
},
});
const editSpendLimitOpened = useNewMetricEvent({
@@ -362,13 +370,20 @@ export default function ViewQuote() {
custom_spend_limit_set: originalApproveAmount === approveAmount,
custom_spend_limit_amount:
originalApproveAmount === approveAmount ? null : approveAmount,
+ is_hardware_wallet: hardwareWalletUsed,
+ hardware_wallet_type: hardwareWalletType,
},
});
const bestQuoteReviewedEvent = useNewMetricEvent({
event: 'Best Quote Reviewed',
category: 'swaps',
- sensitiveProperties: { ...eventObjectBase, network_fees: feeInFiat },
+ sensitiveProperties: {
+ ...eventObjectBase,
+ network_fees: feeInFiat,
+ is_hardware_wallet: hardwareWalletUsed,
+ hardware_wallet_type: hardwareWalletType,
+ },
});
useEffect(() => {
if (
diff --git a/ui/app/pages/unlock-page/index.js b/ui/pages/unlock-page/index.js
similarity index 100%
rename from ui/app/pages/unlock-page/index.js
rename to ui/pages/unlock-page/index.js
diff --git a/ui/app/pages/unlock-page/index.scss b/ui/pages/unlock-page/index.scss
similarity index 100%
rename from ui/app/pages/unlock-page/index.scss
rename to ui/pages/unlock-page/index.scss
diff --git a/ui/app/pages/unlock-page/unlock-page.component.js b/ui/pages/unlock-page/unlock-page.component.js
similarity index 100%
rename from ui/app/pages/unlock-page/unlock-page.component.js
rename to ui/pages/unlock-page/unlock-page.component.js
diff --git a/ui/app/pages/unlock-page/unlock-page.component.test.js b/ui/pages/unlock-page/unlock-page.component.test.js
similarity index 84%
rename from ui/app/pages/unlock-page/unlock-page.component.test.js
rename to ui/pages/unlock-page/unlock-page.component.test.js
index 412b7dc6f..5029f6a0e 100644
--- a/ui/app/pages/unlock-page/unlock-page.component.test.js
+++ b/ui/pages/unlock-page/unlock-page.component.test.js
@@ -2,7 +2,7 @@ import React from 'react';
import sinon from 'sinon';
import configureMockStore from 'redux-mock-store';
import { fireEvent } from '@testing-library/react';
-import { renderWithProvider } from '../../../../test/lib/render-helpers';
+import { renderWithProvider } from '../../../test/lib/render-helpers';
import UnlockPage from './unlock-page.component';
describe('Unlock Page Component', () => {
@@ -23,7 +23,7 @@ describe('Unlock Page Component', () => {
configureMockStore()({ metamask: { currentLocale: 'en' } }),
);
- fireEvent.click(getByText('import using seed phrase'));
+ fireEvent.click(getByText('import using Secret Recovery Phrase'));
expect(props.onRestore.calledOnce).toStrictEqual(true);
});
});
diff --git a/ui/app/pages/unlock-page/unlock-page.container.js b/ui/pages/unlock-page/unlock-page.container.js
similarity index 92%
rename from ui/app/pages/unlock-page/unlock-page.container.js
rename to ui/pages/unlock-page/unlock-page.container.js
index 56da7e661..eb1be797a 100644
--- a/ui/app/pages/unlock-page/unlock-page.container.js
+++ b/ui/pages/unlock-page/unlock-page.container.js
@@ -1,8 +1,8 @@
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 '../../../../shared/constants/app';
+import { getEnvironmentType } from '../../../app/scripts/lib/util';
+import { ENVIRONMENT_TYPE_POPUP } from '../../../shared/constants/app';
import {
DEFAULT_ROUTE,
RESTORE_VAULT_ROUTE,
diff --git a/ui/app/pages/unlock-page/unlock-page.container.test.js b/ui/pages/unlock-page/unlock-page.container.test.js
similarity index 100%
rename from ui/app/pages/unlock-page/unlock-page.container.test.js
rename to ui/pages/unlock-page/unlock-page.container.test.js
diff --git a/ui/app/selectors/confirm-transaction.js b/ui/selectors/confirm-transaction.js
similarity index 98%
rename from ui/app/selectors/confirm-transaction.js
rename to ui/selectors/confirm-transaction.js
index 2ac609be7..ba837e8ab 100644
--- a/ui/app/selectors/confirm-transaction.js
+++ b/ui/selectors/confirm-transaction.js
@@ -1,5 +1,5 @@
import { createSelector } from 'reselect';
-import txHelper from '../../lib/tx-helper';
+import txHelper from '../helpers/utils/tx-helper';
import { calcTokenAmount } from '../helpers/utils/token-util';
import {
roundExponential,
@@ -10,7 +10,7 @@ import {
addEth,
} from '../helpers/utils/confirm-tx.util';
import { sumHexes } from '../helpers/utils/transactions.util';
-import { transactionMatchesNetwork } from '../../../shared/modules/transaction.utils';
+import { transactionMatchesNetwork } from '../../shared/modules/transaction.utils';
import { getCurrentChainId, deprecatedGetCurrentNetworkId } from './selectors';
import { getNativeCurrency } from '.';
diff --git a/ui/app/selectors/confirm-transaction.test.js b/ui/selectors/confirm-transaction.test.js
similarity index 95%
rename from ui/app/selectors/confirm-transaction.test.js
rename to ui/selectors/confirm-transaction.test.js
index 1f7acf158..9a899a523 100644
--- a/ui/app/selectors/confirm-transaction.test.js
+++ b/ui/selectors/confirm-transaction.test.js
@@ -2,8 +2,8 @@ import {
KOVAN_CHAIN_ID,
KOVAN_NETWORK_ID,
MAINNET_CHAIN_ID,
-} from '../../../shared/constants/network';
-import { TRANSACTION_TYPES } from '../../../shared/constants/transaction';
+} from '../../shared/constants/network';
+import { TRANSACTION_TYPES } from '../../shared/constants/transaction';
import {
unconfirmedTransactionsCountSelector,
sendTokenTokenAmountAndToAddressSelector,
diff --git a/ui/app/selectors/custom-gas.js b/ui/selectors/custom-gas.js
similarity index 89%
rename from ui/app/selectors/custom-gas.js
rename to ui/selectors/custom-gas.js
index c84c48c71..4485c2086 100644
--- a/ui/app/selectors/custom-gas.js
+++ b/ui/selectors/custom-gas.js
@@ -1,4 +1,4 @@
-import { addHexPrefix } from '../../../app/scripts/lib/util';
+import { addHexPrefix } from '../../app/scripts/lib/util';
import {
conversionUtil,
conversionGreaterThan,
@@ -9,6 +9,7 @@ import { formatETHFee } from '../helpers/utils/formatters';
import { calcGasTotal } from '../pages/send/send.utils';
import { GAS_ESTIMATE_TYPES } from '../helpers/constants/common';
+import { BASIC_ESTIMATE_STATES, GAS_SOURCE } from '../ducks/gas/gas.duck';
import {
getCurrentCurrency,
getIsMainnet,
@@ -27,12 +28,14 @@ export function getCustomGasPrice(state) {
}
export function getBasicGasEstimateLoadingStatus(state) {
- return state.gas.basicEstimateIsLoading;
+ return state.gas.basicEstimateStatus === 'LOADING';
}
export function getAveragePriceEstimateInHexWEI(state) {
- const averagePriceEstimate = state.gas.basicEstimates.average;
- return getGasPriceInHexWei(averagePriceEstimate || '0x0');
+ const averagePriceEstimate = state.gas.basicEstimates
+ ? state.gas.basicEstimates.average
+ : '0x0';
+ return getGasPriceInHexWei(averagePriceEstimate);
}
export function getFastPriceEstimateInHexWEI(state) {
@@ -355,3 +358,25 @@ export function getRenderableEstimateDataForSmallButtonsFromGWEI(state) {
},
];
}
+
+export function getIsEthGasPriceFetched(state) {
+ const gasState = state.gas;
+ return Boolean(
+ gasState.estimateSource === GAS_SOURCE.ETHGASPRICE &&
+ gasState.basicEstimateStatus === BASIC_ESTIMATE_STATES.READY &&
+ getIsMainnet(state),
+ );
+}
+
+export function getNoGasPriceFetched(state) {
+ const gasState = state.gas;
+ return Boolean(gasState.basicEstimateStatus === BASIC_ESTIMATE_STATES.FAILED);
+}
+
+export function getIsGasEstimatesFetched(state) {
+ const gasState = state.gas;
+ return Boolean(
+ gasState.estimateSource === GAS_SOURCE.METASWAPS &&
+ gasState.basicEstimateStatus === BASIC_ESTIMATE_STATES.READY,
+ );
+}
diff --git a/ui/app/selectors/custom-gas.test.js b/ui/selectors/custom-gas.test.js
similarity index 100%
rename from ui/app/selectors/custom-gas.test.js
rename to ui/selectors/custom-gas.test.js
diff --git a/ui/app/selectors/first-time-flow.js b/ui/selectors/first-time-flow.js
similarity index 100%
rename from ui/app/selectors/first-time-flow.js
rename to ui/selectors/first-time-flow.js
diff --git a/ui/app/selectors/index.js b/ui/selectors/index.js
similarity index 100%
rename from ui/app/selectors/index.js
rename to ui/selectors/index.js
diff --git a/ui/app/selectors/permissions.js b/ui/selectors/permissions.js
similarity index 99%
rename from ui/app/selectors/permissions.js
rename to ui/selectors/permissions.js
index 8ac46cc96..788275179 100644
--- a/ui/app/selectors/permissions.js
+++ b/ui/selectors/permissions.js
@@ -1,5 +1,5 @@
import { forOwn } from 'lodash';
-import { CAVEAT_NAMES } from '../../../shared/constants/permissions';
+import { CAVEAT_NAMES } from '../../shared/constants/permissions';
import {
getMetaMaskAccountsOrdered,
getOriginOfCurrentTab,
diff --git a/ui/app/selectors/permissions.test.js b/ui/selectors/permissions.test.js
similarity index 99%
rename from ui/app/selectors/permissions.test.js
rename to ui/selectors/permissions.test.js
index 3cebfd1a5..16d3057fc 100644
--- a/ui/app/selectors/permissions.test.js
+++ b/ui/selectors/permissions.test.js
@@ -1,4 +1,4 @@
-import { KOVAN_CHAIN_ID } from '../../../shared/constants/network';
+import { KOVAN_CHAIN_ID } from '../../shared/constants/network';
import {
getConnectedDomainsForSelectedAddress,
getOrderedConnectedAccountsForActiveTab,
diff --git a/ui/app/selectors/selectors.js b/ui/selectors/selectors.js
similarity index 92%
rename from ui/app/selectors/selectors.js
rename to ui/selectors/selectors.js
index eed91f858..5b429c8f7 100644
--- a/ui/app/selectors/selectors.js
+++ b/ui/selectors/selectors.js
@@ -1,17 +1,18 @@
import { stripHexPrefix } from 'ethereumjs-util';
import { createSelector } from 'reselect';
-import { addHexPrefix } from '../../../app/scripts/lib/util';
+import { addHexPrefix } from '../../app/scripts/lib/util';
import {
MAINNET_CHAIN_ID,
+ BSC_CHAIN_ID,
TEST_CHAINS,
NETWORK_TYPE_RPC,
NATIVE_CURRENCY_TOKEN_IMAGE_MAP,
-} from '../../../shared/constants/network';
+} from '../../shared/constants/network';
import {
SWAPS_CHAINID_DEFAULT_TOKEN_MAP,
ALLOWED_SWAPS_CHAIN_IDS,
-} from '../../../shared/constants/swaps';
+} from '../../shared/constants/swaps';
import { shortenAddress, getAccountByAddress } from '../helpers/utils/util';
import {
@@ -21,7 +22,7 @@ import {
import { TEMPLATED_CONFIRMATION_MESSAGE_TYPES } from '../pages/confirmation/templates';
-import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils';
+import { toChecksumHexAddress } from '../../shared/modules/hexstring-utils';
import { getNativeCurrency } from './send';
/**
@@ -75,6 +76,26 @@ export function getCurrentKeyring(state) {
return keyring;
}
+/**
+ * Checks if the current wallet is a hardware wallet.
+ * @param {Object} state
+ * @returns {Boolean}
+ */
+export function isHardwareWallet(state) {
+ const keyring = getCurrentKeyring(state);
+ return keyring.type.includes('Hardware');
+}
+
+/**
+ * Get a HW wallet type, e.g. "Ledger Hardware"
+ * @param {Object} state
+ * @returns {String|undefined}
+ */
+export function getHardwareWalletType(state) {
+ const keyring = getCurrentKeyring(state);
+ return keyring.type.includes('Hardware') ? keyring.type : undefined;
+}
+
export function getAccountType(state) {
const currentKeyring = getCurrentKeyring(state);
const type = currentKeyring && currentKeyring.type;
@@ -496,6 +517,21 @@ export function getShowWhatsNewPopup(state) {
return state.appState.showWhatsNewPopup;
}
+/**
+ * Get an object of notification IDs and if they are allowed or not.
+ * @param {Object} state
+ * @returns {Object}
+ */
+function getAllowedNotificationIds(state) {
+ return {
+ 1: true,
+ 2: true,
+ 3: true,
+ 4: getCurrentChainId(state) === BSC_CHAIN_ID,
+ 5: true,
+ };
+}
+
/**
* @typedef {Object} Notification
* @property {number} id - A unique identifier for the notification
@@ -516,8 +552,10 @@ export function getShowWhatsNewPopup(state) {
export function getSortedNotificationsToShow(state) {
const notifications = Object.values(state.metamask.notifications);
+ const allowedNotificationIds = getAllowedNotificationIds(state);
const notificationsToShow = notifications.filter(
- (notification) => !notification.isShown,
+ (notification) =>
+ !notification.isShown && allowedNotificationIds[notification.id],
);
const notificationsSortedByDate = notificationsToShow.sort(
(a, b) => new Date(b.date) - new Date(a.date),
diff --git a/ui/app/selectors/selectors.test.js b/ui/selectors/selectors.test.js
similarity index 69%
rename from ui/app/selectors/selectors.test.js
rename to ui/selectors/selectors.test.js
index 0b476f727..b83697ab3 100644
--- a/ui/app/selectors/selectors.test.js
+++ b/ui/selectors/selectors.test.js
@@ -1,4 +1,4 @@
-import mockState from '../../../test/data/mock-state.json';
+import mockState from '../../test/data/mock-state.json';
import * as selectors from './selectors';
describe('Selectors', () => {
@@ -15,6 +15,44 @@ describe('Selectors', () => {
});
});
+ describe('#isHardwareWallet', () => {
+ it('returns false if it is not a HW wallet', () => {
+ mockState.metamask.keyrings[0].type = 'Simple Key Pair';
+ expect(selectors.isHardwareWallet(mockState)).toBe(false);
+ });
+
+ it('returns true if it is a Ledger HW wallet', () => {
+ mockState.metamask.keyrings[0].type = 'Ledger Hardware';
+ expect(selectors.isHardwareWallet(mockState)).toBe(true);
+ });
+
+ it('returns true if it is a Trezor HW wallet', () => {
+ mockState.metamask.keyrings[0].type = 'Trezor Hardware';
+ expect(selectors.isHardwareWallet(mockState)).toBe(true);
+ });
+ });
+
+ describe('#getHardwareWalletType', () => {
+ it('returns undefined if it is not a HW wallet', () => {
+ mockState.metamask.keyrings[0].type = 'Simple Key Pair';
+ expect(selectors.getHardwareWalletType(mockState)).toBeUndefined();
+ });
+
+ it('returns "Ledger Hardware" if it is a Ledger HW wallet', () => {
+ mockState.metamask.keyrings[0].type = 'Ledger Hardware';
+ expect(selectors.getHardwareWalletType(mockState)).toBe(
+ 'Ledger Hardware',
+ );
+ });
+
+ it('returns "Trezor Hardware" if it is a Trezor HW wallet', () => {
+ mockState.metamask.keyrings[0].type = 'Trezor Hardware';
+ expect(selectors.getHardwareWalletType(mockState)).toBe(
+ 'Trezor Hardware',
+ );
+ });
+ });
+
it('returns selected identity', () => {
expect(selectors.getSelectedIdentity(mockState)).toStrictEqual({
address: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc',
diff --git a/ui/app/selectors/send-selectors-test-data.js b/ui/selectors/send-selectors-test-data.js
similarity index 98%
rename from ui/app/selectors/send-selectors-test-data.js
rename to ui/selectors/send-selectors-test-data.js
index f6c077798..e6c0d230c 100644
--- a/ui/app/selectors/send-selectors-test-data.js
+++ b/ui/selectors/send-selectors-test-data.js
@@ -1,4 +1,4 @@
-import { TRANSACTION_STATUSES } from '../../../shared/constants/transaction';
+import { TRANSACTION_STATUSES } from '../../shared/constants/transaction';
const state = {
metamask: {
diff --git a/ui/app/selectors/send.js b/ui/selectors/send.js
similarity index 100%
rename from ui/app/selectors/send.js
rename to ui/selectors/send.js
diff --git a/ui/app/selectors/send.test.js b/ui/selectors/send.test.js
similarity index 99%
rename from ui/app/selectors/send.test.js
rename to ui/selectors/send.test.js
index b4f94c56b..bab7b63fe 100644
--- a/ui/app/selectors/send.test.js
+++ b/ui/selectors/send.test.js
@@ -1,5 +1,5 @@
import sinon from 'sinon';
-import { TRANSACTION_STATUSES } from '../../../shared/constants/transaction';
+import { TRANSACTION_STATUSES } from '../../shared/constants/transaction';
import {
getBlockGasLimit,
getConversionRate,
diff --git a/ui/app/selectors/transactions.js b/ui/selectors/transactions.js
similarity index 98%
rename from ui/app/selectors/transactions.js
rename to ui/selectors/transactions.js
index 628b856f0..e05d7f3fa 100644
--- a/ui/app/selectors/transactions.js
+++ b/ui/selectors/transactions.js
@@ -4,12 +4,12 @@ import {
PENDING_STATUS_HASH,
} from '../helpers/constants/transactions';
import { hexToDecimal } from '../helpers/utils/conversions.util';
-import txHelper from '../../lib/tx-helper';
+import txHelper from '../helpers/utils/tx-helper';
import {
TRANSACTION_STATUSES,
TRANSACTION_TYPES,
-} from '../../../shared/constants/transaction';
-import { transactionMatchesNetwork } from '../../../shared/modules/transaction.utils';
+} from '../../shared/constants/transaction';
+import { transactionMatchesNetwork } from '../../shared/modules/transaction.utils';
import { getCurrentChainId, deprecatedGetCurrentNetworkId } from './selectors';
import { getSelectedAddress } from '.';
diff --git a/ui/app/selectors/transactions.test.js b/ui/selectors/transactions.test.js
similarity index 98%
rename from ui/app/selectors/transactions.test.js
rename to ui/selectors/transactions.test.js
index 4493c3e96..4f538e232 100644
--- a/ui/app/selectors/transactions.test.js
+++ b/ui/selectors/transactions.test.js
@@ -1,8 +1,8 @@
import {
KOVAN_CHAIN_ID,
MAINNET_CHAIN_ID,
-} from '../../../shared/constants/network';
-import { TRANSACTION_STATUSES } from '../../../shared/constants/transaction';
+} from '../../shared/constants/network';
+import { TRANSACTION_STATUSES } from '../../shared/constants/transaction';
import {
unapprovedMessagesSelector,
transactionsSelector,
diff --git a/ui/app/store/actionConstants.js b/ui/store/actionConstants.js
similarity index 98%
rename from ui/app/store/actionConstants.js
rename to ui/store/actionConstants.js
index 8613318c8..8a9f5cd84 100644
--- a/ui/app/store/actionConstants.js
+++ b/ui/store/actionConstants.js
@@ -29,7 +29,6 @@ export const HIDE_WARNING = 'HIDE_WARNING';
export const SHOW_ACCOUNT_DETAIL = 'SHOW_ACCOUNT_DETAIL';
export const SHOW_ACCOUNTS_PAGE = 'SHOW_ACCOUNTS_PAGE';
export const SHOW_CONF_TX_PAGE = 'SHOW_CONF_TX_PAGE';
-export const SET_CURRENT_FIAT = 'SET_CURRENT_FIAT';
// account detail screen
export const SHOW_SEND_TOKEN_PAGE = 'SHOW_SEND_TOKEN_PAGE';
export const SHOW_PRIVATE_KEY = 'SHOW_PRIVATE_KEY';
@@ -72,6 +71,7 @@ export const BUY_ETH = 'BUY_ETH';
export const TOGGLE_ACCOUNT_MENU = 'TOGGLE_ACCOUNT_MENU';
+// preferences
export const SET_USE_BLOCKIE = 'SET_USE_BLOCKIE';
export const SET_USE_NONCEFIELD = 'SET_USE_NONCEFIELD';
export const UPDATE_CUSTOM_NONCE = 'UPDATE_CUSTOM_NONCE';
diff --git a/ui/app/store/actionConstants.test.js b/ui/store/actionConstants.test.js
similarity index 96%
rename from ui/app/store/actionConstants.test.js
rename to ui/store/actionConstants.test.js
index 306704aea..7cfef827f 100644
--- a/ui/app/store/actionConstants.test.js
+++ b/ui/store/actionConstants.test.js
@@ -1,6 +1,6 @@
import freeze from 'deep-freeze-strict';
import reducers from '../ducks';
-import { NETWORK_TYPE_RPC } from '../../../shared/constants/network';
+import { NETWORK_TYPE_RPC } from '../../shared/constants/network';
import * as actionConstants from './actionConstants';
describe('Redux actionConstants', () => {
diff --git a/ui/app/store/actions.js b/ui/store/actions.js
similarity index 97%
rename from ui/app/store/actions.js
rename to ui/store/actions.js
index cbd90fe84..d701d20ad 100644
--- a/ui/app/store/actions.js
+++ b/ui/store/actions.js
@@ -2,31 +2,28 @@ import abi from 'human-standard-token-abi';
import pify from 'pify';
import log from 'loglevel';
import { capitalize } from 'lodash';
-import getBuyEthUrl from '../../../app/scripts/lib/buy-eth-url';
+import getBuyEthUrl from '../../app/scripts/lib/buy-eth-url';
import { calcTokenBalance, estimateGasForSend } from '../pages/send/send.utils';
import {
fetchLocale,
loadRelativeTimeFormatLocaleData,
} from '../helpers/utils/i18n-helper';
import { getMethodDataAsync } from '../helpers/utils/transactions.util';
-import { fetchSymbolAndDecimals } from '../helpers/utils/token-util';
+import { getSymbolAndDecimals } from '../helpers/utils/token-util';
import switchDirection from '../helpers/utils/switch-direction';
-import { ENVIRONMENT_TYPE_NOTIFICATION } from '../../../shared/constants/app';
+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';
-import {
- getEnvironmentType,
- addHexPrefix,
-} from '../../../app/scripts/lib/util';
+import txHelper from '../helpers/utils/tx-helper';
+import { getEnvironmentType, addHexPrefix } from '../../app/scripts/lib/util';
import {
getPermittedAccountsForCurrentTab,
getSelectedAddress,
} from '../selectors';
import { switchedToUnconnectedAccount } from '../ducks/alerts/unconnected-account';
import { getUnconnectedAccountAlertEnabledness } from '../ducks/metamask/metamask';
-import { LISTED_CONTRACT_ADDRESSES } from '../../../shared/constants/tokens';
-import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils';
+import { LISTED_CONTRACT_ADDRESSES } from '../../shared/constants/tokens';
+import { toChecksumHexAddress } from '../../shared/modules/hexstring-utils';
import * as actionConstants from './actionConstants';
let background = null;
@@ -473,25 +470,16 @@ export function setCurrentCurrency(currencyCode) {
return async (dispatch) => {
dispatch(showLoadingIndication());
log.debug(`background.setCurrentCurrency`);
- let data;
try {
- data = await promisifiedBackground.setCurrentCurrency(currencyCode);
+ await promisifiedBackground.setCurrentCurrency(currencyCode);
+ await forceUpdateMetamaskState(dispatch);
} catch (error) {
- log.error(error.stack);
+ log.error(error);
dispatch(displayWarning(error.message));
return;
} finally {
dispatch(hideLoadingIndication());
}
-
- dispatch({
- type: actionConstants.SET_CURRENT_FIAT,
- value: {
- currentCurrency: data.currentCurrency,
- conversionRate: data.conversionRate,
- conversionDate: data.conversionDate,
- },
- });
};
}
@@ -2050,8 +2038,9 @@ export function updatePreferences(value) {
}
export function setDefaultHomeActiveTabName(value) {
- return async () => {
+ return async (dispatch) => {
await promisifiedBackground.setDefaultHomeActiveTabName(value);
+ await forceUpdateMetamaskState(dispatch);
};
}
@@ -2262,7 +2251,7 @@ export function setPendingTokens(pendingTokens) {
const { customToken = {}, selectedTokens = {} } = pendingTokens;
const { address, symbol, decimals } = customToken;
const tokens =
- address && symbol && decimals
+ address && symbol && decimals >= 0 <= 36
? {
...selectedTokens,
[address]: {
@@ -2563,6 +2552,14 @@ export function setLastActiveTime() {
};
}
+export function setDismissSeedBackUpReminder(value) {
+ return async (dispatch) => {
+ dispatch(showLoadingIndication());
+ await promisifiedBackground.setDismissSeedBackUpReminder(value);
+ dispatch(hideLoadingIndication());
+ };
+}
+
export function setConnectedStatusPopoverHasBeenShown() {
return () => {
background.setConnectedStatusPopoverHasBeenShown((err) => {
@@ -2656,12 +2653,10 @@ export function getTokenParams(tokenAddress) {
dispatch(loadingTokenParamsStarted());
log.debug(`loadingTokenParams`);
- return fetchSymbolAndDecimals(tokenAddress, existingTokens).then(
- ({ symbol, decimals }) => {
- dispatch(addToken(tokenAddress, symbol, Number(decimals)));
- dispatch(loadingTokenParamsFinished());
- },
- );
+ return getSymbolAndDecimals(tokenAddress).then(({ symbol, decimals }) => {
+ dispatch(addToken(tokenAddress, symbol, Number(decimals)));
+ dispatch(loadingTokenParamsFinished());
+ });
};
}
@@ -2845,12 +2840,20 @@ export function getCurrentWindowTab() {
};
}
+export function setLedgerLivePreference(value) {
+ return async (dispatch) => {
+ dispatch(showLoadingIndication());
+ await promisifiedBackground.setLedgerLivePreference(value);
+ dispatch(hideLoadingIndication());
+ };
+}
+
// MetaMetrics
/**
- * @typedef {import('../../../shared/constants/metametrics').MetaMetricsEventPayload} MetaMetricsEventPayload
- * @typedef {import('../../../shared/constants/metametrics').MetaMetricsEventOptions} MetaMetricsEventOptions
- * @typedef {import('../../../shared/constants/metametrics').MetaMetricsPagePayload} MetaMetricsPagePayload
- * @typedef {import('../../../shared/constants/metametrics').MetaMetricsPageOptions} MetaMetricsPageOptions
+ * @typedef {import('../../shared/constants/metametrics').MetaMetricsEventPayload} MetaMetricsEventPayload
+ * @typedef {import('../../shared/constants/metametrics').MetaMetricsEventOptions} MetaMetricsEventOptions
+ * @typedef {import('../../shared/constants/metametrics').MetaMetricsPagePayload} MetaMetricsPagePayload
+ * @typedef {import('../../shared/constants/metametrics').MetaMetricsPageOptions} MetaMetricsPageOptions
*/
/**
diff --git a/ui/app/store/actions.test.js b/ui/store/actions.test.js
similarity index 98%
rename from ui/app/store/actions.test.js
rename to ui/store/actions.test.js
index d3281701e..73975843d 100644
--- a/ui/app/store/actions.test.js
+++ b/ui/store/actions.test.js
@@ -2,9 +2,9 @@ import sinon from 'sinon';
import configureStore from 'redux-mock-store';
import thunk from 'redux-thunk';
import EthQuery from 'eth-query';
-import enLocale from '../../../app/_locales/en/messages.json';
-import MetaMaskController from '../../../app/scripts/metamask-controller';
-import { TRANSACTION_STATUSES } from '../../../shared/constants/transaction';
+import enLocale from '../../app/_locales/en/messages.json';
+import MetaMaskController from '../../app/scripts/metamask-controller';
+import { TRANSACTION_STATUSES } from '../../shared/constants/transaction';
import * as actions from './actions';
const middleware = [thunk];
@@ -618,28 +618,18 @@ describe('Actions', () => {
it('calls setCurrentCurrency', async () => {
const store = mockStore();
- const setCurrentCurrency = background.setCurrentCurrency.callsFake(
- (_, cb) =>
- cb(null, {
- currentCurrency: 'currency',
- conversionRate: 100,
- conversionDate: 1611839083653,
- }),
- );
-
+ background.setCurrentCurrency = sinon.stub().callsFake((_, cb) => cb());
actions._setBackgroundConnection(background);
await store.dispatch(actions.setCurrentCurrency('jpy'));
- expect(setCurrentCurrency.callCount).toStrictEqual(1);
+ expect(background.setCurrentCurrency.callCount).toStrictEqual(1);
});
it('throws if setCurrentCurrency throws', async () => {
const store = mockStore();
-
- background.setCurrentCurrency.callsFake((_, cb) =>
- cb(new Error('error')),
- );
-
+ background.setCurrentCurrency = sinon
+ .stub()
+ .callsFake((_, cb) => cb(new Error('error')));
actions._setBackgroundConnection(background);
const expectedActions = [
diff --git a/ui/app/store/store.js b/ui/store/store.js
similarity index 100%
rename from ui/app/store/store.js
rename to ui/store/store.js
diff --git a/yarn.lock b/yarn.lock
index c40f5432a..2d0438f7e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2538,11 +2538,12 @@
"@types/yargs" "^15.0.0"
chalk "^4.0.0"
-"@lavamoat/allow-scripts@^1.0.4":
- version "1.0.4"
- resolved "https://registry.yarnpkg.com/@lavamoat/allow-scripts/-/allow-scripts-1.0.4.tgz#1804c552c40e522ad5210879181869030737321a"
- integrity sha512-720ZQn/PGI1kOvO51I4bTknX3jhztbuytHSHh4i9D4fAqz4NHW14vLR6xbvyk8gh+QtbmsLloeulrA81+if1bw==
+"@lavamoat/allow-scripts@^1.0.6":
+ version "1.0.6"
+ resolved "https://registry.yarnpkg.com/@lavamoat/allow-scripts/-/allow-scripts-1.0.6.tgz#fbdf7c35a5c2c2cff05ba002b7bc8f3355bda22c"
+ integrity sha512-bBUN2xuQEXWmWTJrfkwaM8Ige7TNfTTRodyW353VYnzX7kW866Tm/Ag0hdbukFvJfNjRHabVmLKxYYL8l/uyZQ==
dependencies:
+ "@lavamoat/preinstall-always-fail" "^1.0.0"
"@npmcli/run-script" "^1.8.1"
"@yarnpkg/lockfile" "^1.1.0"
npm-logical-tree "^1.2.1"
@@ -2619,7 +2620,17 @@
prop-types "^15.7.2"
react-is "^16.8.0"
-"@metamask/contract-metadata@^1.19.0", "@metamask/contract-metadata@^1.22.0", "@metamask/contract-metadata@^1.23.0":
+"@metamask/auto-changelog@^2.1.0":
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/@metamask/auto-changelog/-/auto-changelog-2.1.0.tgz#5cb546f05b07695476d9489540b8d2744d350eda"
+ integrity sha512-FO1NsgcrHQY6CWlD9wFEWgmxWgam1GqtfFGiRH7lp4aYSGn/43ktBMkZ/rF0//7XvUDXn27nC2CClRUBCrg8Jg==
+ dependencies:
+ cross-spawn "^7.0.3"
+ diff "^5.0.0"
+ semver "^7.3.5"
+ yargs "^17.0.1"
+
+"@metamask/contract-metadata@^1.19.0", "@metamask/contract-metadata@^1.22.0", "@metamask/contract-metadata@^1.25.0":
version "1.25.0"
resolved "https://registry.yarnpkg.com/@metamask/contract-metadata/-/contract-metadata-1.25.0.tgz#442ace91fb40165310764b68d8096d0017bb0492"
integrity sha512-yhmYB9CQPv0dckNcPoWDcgtrdUp0OgK0uvkRE5QIBv4b3qENI1/03BztvK2ijbTuMlORUpjPq7/1MQDUPoRPVw==
@@ -2652,20 +2663,20 @@
web3 "^0.20.7"
web3-provider-engine "^16.0.1"
-"@metamask/controllers@^6.2.1":
- version "6.2.1"
- resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-6.2.1.tgz#b7ca32011c814a3f629911cf455f02c609336dbf"
- integrity sha512-ASysK0IJ/bBvI/C9htaupKYapN+Me7AkbR7xS9WTmoWNyf0mhMLvCtwVcYo34xPmzcnuTNA8huyfVHanEa1rXw==
+"@metamask/controllers@^9.0.0":
+ version "9.1.0"
+ resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-9.1.0.tgz#4434f22eba2522889224b35aa08bc7b67d7248b7"
+ integrity sha512-jn/F0BNbaPsgEevHaPqk0lGAONKom4re1a4yBC67h7Vu6yu26CRi30SJl4xIh3IW4+ySbPhVLaiXFiXr3fESRQ==
dependencies:
- "@metamask/contract-metadata" "^1.23.0"
+ "@metamask/contract-metadata" "^1.25.0"
"@types/uuid" "^8.3.0"
async-mutex "^0.2.6"
babel-runtime "^6.26.0"
eth-ens-namehash "^2.0.8"
eth-json-rpc-infura "^5.1.0"
- eth-keyring-controller "^6.1.0"
+ eth-keyring-controller "^6.2.1"
eth-method-registry "1.1.0"
- eth-phishing-detect "^1.1.13"
+ eth-phishing-detect "^1.1.14"
eth-query "^2.1.2"
eth-rpc-errors "^4.0.0"
eth-sig-util "^3.0.0"
@@ -2679,6 +2690,7 @@
isomorphic-fetch "^3.0.0"
jsonschema "^1.2.4"
nanoid "^3.1.12"
+ punycode "^2.1.1"
single-call-balance-checker-abi "^1.0.0"
uuid "^8.3.2"
web3 "^0.20.7"
@@ -2704,14 +2716,14 @@
resolved "https://registry.yarnpkg.com/@metamask/eslint-config/-/eslint-config-6.0.0.tgz#ec53e8ab278073e882411ed89705bc7d06b78c81"
integrity sha512-LyakGYGwM8UQOGhwWa+5erAI1hXuiTgf/y7USzOomX6H9KiuY09IAUYnPh7ToPG2sedD2F48UF1bUm8yvCoZOw==
-"@metamask/eth-ledger-bridge-keyring@^0.3.0":
- version "0.3.0"
- resolved "https://registry.yarnpkg.com/@metamask/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.3.0.tgz#4fc2a6345199e18f94c098d8c632d3d55add5c36"
- integrity sha512-Iv9fmxPClBohIK6ciy0ZVYNTUodlmrdQt19cZDAicSfFdR2Gcgbq2FDA75o63+fW8TwPEohhDRV/vWQ0MU5esw==
+"@metamask/eth-ledger-bridge-keyring@^0.5.0":
+ version "0.5.0"
+ resolved "https://registry.yarnpkg.com/@metamask/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.5.0.tgz#c1ee89819c493239290a940da6285e6844240383"
+ integrity sha512-p7dvnAQ6n9AFf7JoJFwNsdIKoX5poP0bBwrgmCA/mLAdb5Z+bBAnHMSbKOZrH7rEsj7jExdbmUiJLI5qKnV0zA==
dependencies:
- eth-sig-util "^1.4.2"
+ eth-sig-util "^2.0.0"
ethereumjs-tx "^1.3.4"
- ethereumjs-util "^5.1.5"
+ ethereumjs-util "^7.0.9"
events "^2.0.0"
hdkey "0.8.0"
@@ -2728,30 +2740,16 @@
human-standard-token-abi "^1.0.2"
safe-event-emitter "^1.0.1"
-"@metamask/etherscan-link@^2.0.0":
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-2.0.0.tgz#89035736515a39532ba1142d87b9a8c2b4f920f1"
- integrity sha512-/YS32hS2UTTxs0KyUmAgaDj1w4dzAvOrT+p4TJtpICeH3E/k51r2FO0Or7WJJI/mpzTqNKgcH5yyS2oCtupGiA==
+"@metamask/etherscan-link@^2.1.0":
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-2.1.0.tgz#c0be8e68445b7b83cf85bcc03a56cdf8e256c973"
+ integrity sha512-ADuWlTUkFfN2vXlz81Bg/0BA+XRor+CdK1055p6k7H6BLIPoDKn9SBOFld9haQFuR9cKh/JYHcnlSIv5R4fUEw==
"@metamask/forwarder@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@metamask/forwarder/-/forwarder-1.1.0.tgz#13829d8244bbf19ea658c0b20d21a77b67de0bdd"
integrity sha512-Hggj4y0QIjDzKGTXzarhEPIQyFSB2bi2y6YLJNwaT4JmP30UB5Cj6gqoY0M4pj3QT57fzp0BUuGp7F/AUe28tw==
-"@metamask/inpage-provider@^8.0.4":
- version "8.0.4"
- resolved "https://registry.yarnpkg.com/@metamask/inpage-provider/-/inpage-provider-8.0.4.tgz#6534fbdba4445a3aff639e32db66bb0ab5f0cd79"
- integrity sha512-jdI0gVWW/0wQvKZe6shXl70cU+vIb8GpAimKFU4udc/HKtgp8tLd21ezq74RaMP/lHR+qq0coOQ2KnOnl8iNNg==
- dependencies:
- "@metamask/object-multiplex" "^1.1.0"
- "@metamask/safe-event-emitter" "^2.0.0"
- eth-rpc-errors "^4.0.2"
- fast-deep-equal "^2.0.1"
- is-stream "^2.0.0"
- json-rpc-engine "^6.1.0"
- json-rpc-middleware-stream "^3.0.0"
- pump "^3.0.0"
-
"@metamask/jazzicon@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@metamask/jazzicon/-/jazzicon-2.0.0.tgz#5615528e91c0fc5c9d79202d1f0954a7922525a0"
@@ -2786,6 +2784,31 @@
readable-stream "^2.2.2"
through2 "^2.0.3"
+"@metamask/post-message-stream@^4.0.0":
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/@metamask/post-message-stream/-/post-message-stream-4.0.0.tgz#72f120e562346ca86ccc9b3684023ad44265f0df"
+ integrity sha512-r0JcoWXNuHycProx8ClxiIElJY/GVb/0/WWXTMsZu7qDejLo52VNXlwfydCdVjbMXeoT2nK1Yt3d5gjmHy5BWw==
+ dependencies:
+ readable-stream "2.3.3"
+
+"@metamask/providers@^8.1.1":
+ version "8.1.1"
+ resolved "https://registry.yarnpkg.com/@metamask/providers/-/providers-8.1.1.tgz#7b0dbb54700c949aafba24c9b98e6f4e9d81f325"
+ integrity sha512-CG1sAuD6Mp4MZ5U90anf1FT0moDbStGXT+80TQFYXJbBeTQjhp321WgC/F2IgIJ3mFqOiByC3MQHLuunEVMQOA==
+ dependencies:
+ "@metamask/object-multiplex" "^1.1.0"
+ "@metamask/safe-event-emitter" "^2.0.0"
+ "@types/chrome" "^0.0.136"
+ detect-browser "^5.2.0"
+ eth-rpc-errors "^4.0.2"
+ extension-port-stream "^2.0.1"
+ fast-deep-equal "^2.0.1"
+ is-stream "^2.0.0"
+ json-rpc-engine "^6.1.0"
+ json-rpc-middleware-stream "^3.0.0"
+ pump "^3.0.0"
+ webextension-polyfill-ts "^0.25.0"
+
"@metamask/safe-event-emitter@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@metamask/safe-event-emitter/-/safe-event-emitter-2.0.0.tgz#af577b477c683fad17c619a78208cede06f9605c"
@@ -3655,11 +3678,31 @@
resolved "https://registry.yarnpkg.com/@types/braces/-/braces-3.0.0.tgz#7da1c0d44ff1c7eb660a36ec078ea61ba7eb42cb"
integrity sha512-TbH79tcyi9FHwbyboOKeRachRq63mSuWYXOflsNO9ZyE5ClQ/JaozNKl+aWUq87qPNsXasXxi2AbgfwIJ+8GQw==
+"@types/chrome@^0.0.136":
+ version "0.0.136"
+ resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.136.tgz#7c011b9f997b0156f25a140188a0c5689d3f368f"
+ integrity sha512-XDEiRhLkMd+SB7Iw3ZUIj/fov3wLd4HyTdLltVszkgl1dBfc3Rb7oPMVZ2Mz2TLqnF7Ow+StbR8E7r9lqpb4DA==
+ dependencies:
+ "@types/filesystem" "*"
+ "@types/har-format" "*"
+
"@types/color-name@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
+"@types/filesystem@*":
+ version "0.0.30"
+ resolved "https://registry.yarnpkg.com/@types/filesystem/-/filesystem-0.0.30.tgz#a7373a2edf34d13e298baf7ee1101f738b2efb7e"
+ integrity sha512-NCoRgmGmLpTT9VFL6Bb6z0jQuqI3d0E5FGl7M0JOv/J5RQYo9s5aOItPYnpckx9MbYQk1APLXcF8f20Vqnf2yA==
+ dependencies:
+ "@types/filewriter" "*"
+
+"@types/filewriter@*":
+ version "0.0.29"
+ resolved "https://registry.yarnpkg.com/@types/filewriter/-/filewriter-0.0.29.tgz#a48795ecadf957f6c0d10e0c34af86c098fa5bee"
+ integrity sha512-BsPXH/irW0ht0Ji6iw/jJaK8Lj3FJemon2gvEqHKpCdDCeemHa+rI3WBGq5z7cDMZgoLjY40oninGxqk+8NzNQ==
+
"@types/glob-base@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@types/glob-base/-/glob-base-0.3.0.tgz#a581d688347e10e50dd7c17d6f2880a10354319d"
@@ -3680,6 +3723,11 @@
dependencies:
"@types/node" "*"
+"@types/har-format@*":
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/@types/har-format/-/har-format-1.2.5.tgz#4f6648814d0fdcb6a510e3364a9db439a753c4b1"
+ integrity sha512-IG8AE1m2pWtPqQ7wXhFhy6Q59bwwnLwO36v5Rit2FrbXCIp8Sk8E2PfUCreyrdo17STwFSKDAkitVuVYbpEHvQ==
+
"@types/hast@^2.0.0":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.1.tgz#b16872f2a6144c7025f296fb9636a667ebb79cd9"
@@ -9056,6 +9104,11 @@ destroy@^1.0.4, destroy@~1.0.4:
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=
+detect-browser@^5.2.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/detect-browser/-/detect-browser-5.2.0.tgz#c9cd5afa96a6a19fda0bbe9e9be48a6b6e1e9c97"
+ integrity sha512-tr7XntDAu50BVENgQfajMLzacmSe34D+qZc4zjnniz0ZVuw/TZcLcyxHQjYpJTM36sGEkZZlYLnIM1hH7alTMA==
+
detect-file@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7"
@@ -9178,6 +9231,11 @@ diff@^4.0.2:
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
+diff@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b"
+ integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==
+
diffie-hellman@^5.0.0:
version "5.0.2"
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e"
@@ -10457,20 +10515,6 @@ eth-ens-namehash@^1.0.2:
idna-uts46 "^1.0.1"
js-sha3 "^0.5.7"
-eth-hd-keyring@^3.5.0:
- version "3.5.0"
- resolved "https://registry.yarnpkg.com/eth-hd-keyring/-/eth-hd-keyring-3.5.0.tgz#3976d83a27b24305481c389178f290d9264e839d"
- integrity sha512-Ix1LcWYxHMxCCSIMz+TLXLtt50zF6ZDd/TRVXthdw91IwOk1ajuf7QHg3bCDcfeUpdf9oEpwIPbL3xjDqEEjYw==
- dependencies:
- bip39 "^2.2.0"
- eth-sig-util "^2.4.4"
- eth-simple-keyring "^3.5.0"
- ethereumjs-abi "^0.6.5"
- ethereumjs-util "^5.1.1"
- ethereumjs-wallet "^0.6.0"
- events "^1.1.1"
- xtend "^4.0.1"
-
eth-hd-keyring@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/eth-hd-keyring/-/eth-hd-keyring-3.6.0.tgz#6835d30aa411b8d3ef098e82f6427b5325082abb"
@@ -10551,25 +10595,10 @@ eth-json-rpc-middleware@^6.0.0:
pify "^3.0.0"
safe-event-emitter "^1.0.1"
-eth-keyring-controller@^6.1.0:
- version "6.1.0"
- resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-6.1.0.tgz#dc9313d0b793e085dc1badf84dd4f5e3004e127e"
- integrity sha512-wPxH++98VDBcDv9YkPzxhZC0gF1ixuRbyKR2u/NOT/roBpNQDe4reqyllBRC7jhPehiKnRxzf7r6HEyirRnPxQ==
- dependencies:
- bip39 "^2.4.0"
- bluebird "^3.5.0"
- browser-passworder "^2.0.3"
- eth-hd-keyring "^3.5.0"
- eth-sig-util "^1.4.0"
- eth-simple-keyring "^3.5.0"
- ethereumjs-util "^5.1.2"
- loglevel "^1.5.0"
- obs-store "^4.0.3"
-
-eth-keyring-controller@^6.2.0:
- version "6.2.0"
- resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-6.2.0.tgz#c649e7ced9bc9a11c2a6ab48234fae212569d390"
- integrity sha512-UYYs+hTgrJNqy7xkI56QpekfsPuZw4kLxrFEUkHefCkBv9poSg/Abx4rvBsRwcj7yxXcxfgTNtoltJfR2we4uw==
+eth-keyring-controller@^6.1.0, eth-keyring-controller@^6.2.0, eth-keyring-controller@^6.2.1:
+ version "6.2.1"
+ resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-6.2.1.tgz#61901071fc74059ed37cb5ae93870fdcae6e3781"
+ integrity sha512-x2gTM1iHp2Kbvdtd9Eslysw0qzVZiqOzpVB3AU/ni2Xiit+rlcv2H80zYKjrEwlfWFDj4YILD3bOqlnEMmRJOA==
dependencies:
bip39 "^2.4.0"
bluebird "^3.5.0"
@@ -10646,7 +10675,7 @@ eth-rpc-errors@^4.0.0, eth-rpc-errors@^4.0.2:
dependencies:
fast-safe-stringify "^2.0.6"
-eth-sig-util@^1.4.0, eth-sig-util@^1.4.2:
+eth-sig-util@^1.4.2:
version "1.4.2"
resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-1.4.2.tgz#8d958202c7edbaae839707fba6f09ff327606210"
integrity sha1-jZWCAsftuq6Dlwf7pvCf8ydgYhA=
@@ -10654,7 +10683,7 @@ eth-sig-util@^1.4.0, eth-sig-util@^1.4.2:
ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git"
ethereumjs-util "^5.1.1"
-eth-sig-util@^2.0.0, eth-sig-util@^2.4.4, eth-sig-util@^2.5.0:
+eth-sig-util@^2.0.0:
version "2.5.4"
resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.5.4.tgz#577b01fe491b6bf59b0464be09633e20c1677bc5"
integrity sha512-aCMBwp8q/4wrW4QLsF/HYBOSA7TpLKmkVwP3pYQNkEEseW2Rr8Z5Uxc9/h6HX+OG3tuHo+2bINVSihIeBfym6A==
@@ -10674,18 +10703,6 @@ eth-sig-util@^3.0.0, eth-sig-util@^3.0.1:
tweetnacl "^1.0.3"
tweetnacl-util "^0.15.0"
-eth-simple-keyring@^3.5.0:
- version "3.5.0"
- resolved "https://registry.yarnpkg.com/eth-simple-keyring/-/eth-simple-keyring-3.5.0.tgz#c7fa285ca58d31ef44bc7db678b689f9ffd7b453"
- integrity sha512-z9IPt9aoMWAw5Zc3Jk/HKbWPJNc7ivZ5ECNtl3ZoQUGRnwoWO71W5+liVPJtXFNacGOOGsBfqTqrXL9C4EnYYQ==
- dependencies:
- eth-sig-util "^2.5.0"
- ethereumjs-abi "^0.6.5"
- ethereumjs-util "^5.1.1"
- ethereumjs-wallet "^0.6.0"
- events "^1.1.1"
- xtend "^4.0.1"
-
eth-simple-keyring@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/eth-simple-keyring/-/eth-simple-keyring-4.2.0.tgz#c197a4bd4cce7d701b5f3607d0b843112ddb17e3"
@@ -10776,7 +10793,7 @@ ethereum-ens-network-map@^1.0.0, ethereum-ens-network-map@^1.0.2:
resolved "https://registry.yarnpkg.com/ethereum-ens-network-map/-/ethereum-ens-network-map-1.0.2.tgz#4e27bad18dae7bd95d84edbcac2c9e739fc959b9"
integrity sha512-5qwJ5n3YhjSpE6O/WEBXCAb2nagUgyagJ6C0lGUBWC4LjKp/rRzD+pwtDJ6KCiITFEAoX4eIrWOjRy0Sylq5Hg==
-ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.4, ethereumjs-abi@^0.6.5, ethereumjs-abi@^0.6.8:
+ethereumjs-abi@0.6.8, ethereumjs-abi@^0.6.4, ethereumjs-abi@^0.6.8:
version "0.6.8"
resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae"
integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==
@@ -10899,19 +10916,7 @@ ethereumjs-util@^5.0.0, ethereumjs-util@^5.0.1, ethereumjs-util@^5.1.1, ethereum
safe-buffer "^5.1.1"
secp256k1 "^3.0.1"
-ethereumjs-util@^7.0.2:
- version "7.0.8"
- resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.8.tgz#5258762b7b17e3d828e41834948363ff0a703ffd"
- integrity sha512-JJt7tDpCAmDPw/sGoFYeq0guOVqT3pTE9xlEbBmc/nlCij3JRCoS2c96SQ6kXVHOT3xWUNLDm5QCJLQaUnVAtQ==
- dependencies:
- "@types/bn.js" "^4.11.3"
- bn.js "^5.1.2"
- create-hash "^1.1.2"
- ethereum-cryptography "^0.1.3"
- ethjs-util "0.1.6"
- rlp "^2.2.4"
-
-ethereumjs-util@^7.0.9:
+ethereumjs-util@^7.0.2, ethereumjs-util@^7.0.9:
version "7.0.9"
resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.0.9.tgz#2038baeb30f370a3e576ec175bd70bbbb6807d42"
integrity sha512-cRqvYYKJoitq6vMKMf8pXeVwvTrX+dRD0JwHaYqm8jvogK14tqIoCWH/KUHcRwnVxVXEYF/o6pup5jRG4V0xzg==
@@ -10974,7 +10979,7 @@ ethereumjs-vm@^2.1.0, ethereumjs-vm@^2.3.4, ethereumjs-vm@^2.6.0:
rustbn.js "~0.2.0"
safe-buffer "^5.1.1"
-ethereumjs-wallet@0.6.5, ethereumjs-wallet@^0.6.0, ethereumjs-wallet@^0.6.4:
+ethereumjs-wallet@0.6.5, ethereumjs-wallet@^0.6.4:
version "0.6.5"
resolved "https://registry.yarnpkg.com/ethereumjs-wallet/-/ethereumjs-wallet-0.6.5.tgz#685e9091645cee230ad125c007658833991ed474"
integrity sha512-MDwjwB9VQVnpp/Dc1XzA6J1a3wgHQ4hSvA1uWNatdpOrtCbPVuQSKSyRnjLvS0a+KKMw2pvQ9Ybqpb3+eW8oNA==
@@ -11500,6 +11505,13 @@ extension-port-stream@^2.0.0:
resolved "https://registry.yarnpkg.com/extension-port-stream/-/extension-port-stream-2.0.0.tgz#c52da241eef4643171b7c6d696baa4a3453c5a9a"
integrity sha512-7ju8jisPXY8w8UiUczF61hRN6bpx/YTZYU9J901GnEqu7vQnweMAwS30k+SgXCcY9S38Zno+fhuu1iaxd+0swg==
+extension-port-stream@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/extension-port-stream/-/extension-port-stream-2.0.1.tgz#d374820c581418c2275d3c4439ade0b82c4cfac6"
+ integrity sha512-ltrv4Dh/979I04+D4Te6TFygfRSOc5EBzzlHRldWMS8v73V80qWluxH88hqF0qyUsBXTb8NmzlmSipcre6a+rg==
+ dependencies:
+ webextension-polyfill-ts "^0.22.0"
+
extensionizer@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/extensionizer/-/extensionizer-1.0.1.tgz#504544239a7610ba8404b15c1832091a37768d09"
@@ -11719,9 +11731,9 @@ fetch-ponyfill@^4.0.0:
node-fetch "~1.7.1"
figgy-pudding@^3.5.1:
- version "3.5.1"
- resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790"
- integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==
+ version "3.5.2"
+ resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.2.tgz#b4eee8148abb01dcf1d1ac34367d59e12fa61d6e"
+ integrity sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==
figures@^1.3.5:
version "1.7.0"
@@ -13474,6 +13486,13 @@ history@^4.9.0:
tiny-warning "^1.0.0"
value-equal "^1.0.1"
+history@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/history/-/history-5.0.0.tgz#0cabbb6c4bbf835addb874f8259f6d25101efd08"
+ integrity sha512-3NyRMKIiFSJmIPdq7FxkNMJkQ7ZEtVblOQ38VtKaA0zZMW1Eo6Q6W8oDKEflr1kNNTItSnk4JMCO1deeSgbLLg==
+ dependencies:
+ "@babel/runtime" "^7.7.6"
+
hmac-drbg@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
@@ -13516,9 +13535,9 @@ homedir-polyfill@^1.0.1:
parse-passwd "^1.0.0"
hosted-git-info@^2.1.4:
- version "2.5.0"
- resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c"
- integrity sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==
+ version "2.8.9"
+ resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
+ integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==
html-element-map@^1.0.0:
version "1.2.0"
@@ -20694,13 +20713,6 @@ posix-character-classes@^0.1.0:
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=
-post-message-stream@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/post-message-stream/-/post-message-stream-3.0.0.tgz#90d9f54bd209e6b6f5d74795b87588205b547048"
- integrity sha1-kNn1S9IJ5rb110eVuHWIIFtUcEg=
- dependencies:
- readable-stream "^2.1.4"
-
postcss-flexbugs-fixes@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/postcss-flexbugs-fixes/-/postcss-flexbugs-fixes-4.1.0.tgz#e094a9df1783e2200b7b19f875dcad3b3aff8b20"
@@ -21021,7 +21033,7 @@ probe-image-size@5.0.0:
request "^2.83.0"
stream-parser "~0.3.1"
-process-nextick-args@^1.0.6, process-nextick-args@^1.0.7:
+process-nextick-args@^1.0.6, process-nextick-args@^1.0.7, process-nextick-args@~1.0.6:
version "1.0.7"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=
@@ -22242,7 +22254,7 @@ read-pkg@^5.2.0:
parse-json "^5.0.0"
type-fest "^0.6.0"
-"readable-stream@1 || 2", readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.6, readable-stream@^2.2.8, readable-stream@^2.2.9, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.3, readable-stream@~2.3.5, readable-stream@~2.3.6:
+"readable-stream@1 || 2", readable-stream@2, readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.2.6, readable-stream@^2.2.8, readable-stream@^2.2.9, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.3, readable-stream@~2.3.5, readable-stream@~2.3.6:
version "2.3.7"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
@@ -22274,6 +22286,19 @@ readable-stream@1.1.x, readable-stream@^1.0.33:
string_decoder "^1.1.1"
util-deprecate "^1.0.1"
+readable-stream@2.3.3:
+ version "2.3.3"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c"
+ integrity sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==
+ dependencies:
+ core-util-is "~1.0.0"
+ inherits "~2.0.3"
+ isarray "~1.0.0"
+ process-nextick-args "~1.0.6"
+ safe-buffer "~5.1.1"
+ string_decoder "~1.0.3"
+ util-deprecate "~1.0.1"
+
readable-stream@~1.0.15:
version "1.0.34"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
@@ -24229,9 +24254,9 @@ sshpk@^1.7.0:
tweetnacl "~0.14.0"
ssri@^6.0.1:
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8"
- integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.2.tgz#157939134f20464e7301ddba3e90ffa8f7728ac5"
+ integrity sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==
dependencies:
figgy-pudding "^3.5.1"
@@ -24592,6 +24617,13 @@ string_decoder@^1.0.0, string_decoder@^1.1.1:
dependencies:
safe-buffer "~5.1.0"
+string_decoder@~1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab"
+ integrity sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==
+ dependencies:
+ safe-buffer "~5.1.0"
+
string_decoder@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
@@ -26271,12 +26303,7 @@ uuid@^3.1.0, uuid@^3.2.1, uuid@^3.2.2, uuid@^3.3.2, uuid@^3.3.3:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866"
integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==
-uuid@^8.0.0:
- version "8.3.1"
- resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31"
- integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==
-
-uuid@^8.3.0, uuid@^8.3.2:
+uuid@^8.0.0, uuid@^8.3.0, uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
@@ -26868,6 +26895,25 @@ web3@^0.20.7:
version "0.1.1"
resolved "https://codeload.github.com/dignifiedquire/webcrypto-shim/tar.gz/190bc9ec341375df6025b17ae12ddb2428ea49c8"
+webextension-polyfill-ts@^0.22.0:
+ version "0.22.0"
+ resolved "https://registry.yarnpkg.com/webextension-polyfill-ts/-/webextension-polyfill-ts-0.22.0.tgz#86cfd7bab4d9d779d98c8340983f4b691b2343f3"
+ integrity sha512-3P33ClMwZ/qiAT7UH1ROrkRC1KM78umlnPpRhdC/292UyoTTW9NcjJEqDsv83HbibcTB6qCtpVeuB2q2/oniHQ==
+ dependencies:
+ webextension-polyfill "^0.7.0"
+
+webextension-polyfill-ts@^0.25.0:
+ version "0.25.0"
+ resolved "https://registry.yarnpkg.com/webextension-polyfill-ts/-/webextension-polyfill-ts-0.25.0.tgz#fff041626365dbd0e29c40b197e989a55ec221ca"
+ integrity sha512-ikQhwwHYkpBu00pFaUzIKY26I6L87DeRI+Q6jBT1daZUNuu8dSrg5U9l/ZbqdaQ1M/TTSPKeAa3kolP5liuedw==
+ dependencies:
+ webextension-polyfill "^0.7.0"
+
+webextension-polyfill@^0.7.0:
+ version "0.7.0"
+ resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.7.0.tgz#0df1120ff0266056319ce1a622b09ad8d4a56505"
+ integrity sha512-su48BkMLxqzTTvPSE1eWxKToPS2Tv5DLGxKexLEVpwFd6Po6N8hhSLIvG6acPAg7qERoEaDL+Y5HQJeJeml5Aw==
+
webidl-conversions@^4.0.1, webidl-conversions@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
@@ -27535,6 +27581,19 @@ yargs@^16.0.0, yargs@^16.2.0:
y18n "^5.0.5"
yargs-parser "^20.2.2"
+yargs@^17.0.1:
+ version "17.0.1"
+ resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.0.1.tgz#6a1ced4ed5ee0b388010ba9fd67af83b9362e0bb"
+ integrity sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==
+ dependencies:
+ cliui "^7.0.2"
+ escalade "^3.1.1"
+ get-caller-file "^2.0.5"
+ require-directory "^2.1.1"
+ string-width "^4.2.0"
+ y18n "^5.0.5"
+ yargs-parser "^20.2.2"
+
yargs@^7.1.0:
version "7.1.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.1.tgz#67f0ef52e228d4ee0d6311acede8850f53464df6"