mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
Merge remote-tracking branch 'origin/develop' into master-sync
This commit is contained in:
commit
2f9f187d7e
@ -391,7 +391,7 @@ jobs:
|
||||
destination: test-artifacts
|
||||
|
||||
test-e2e-firefox:
|
||||
executor: node-browsers
|
||||
executor: node-browsers-medium-plus
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
|
@ -11,7 +11,7 @@ BUILD_DEST="./build-artifacts/build-viz/"
|
||||
mkdir -p "${BUILD_DEST}"
|
||||
|
||||
# generate lavamoat debug config
|
||||
yarn lavamoat:debug
|
||||
yarn lavamoat:debug:build
|
||||
|
||||
# generate viz
|
||||
npx lavamoat-viz --dest "${BUILD_DEST}"
|
@ -6,7 +6,7 @@ set -o pipefail
|
||||
|
||||
yarn allow-scripts auto
|
||||
|
||||
if git diff --exit-code --quiet
|
||||
if git diff --exit-code
|
||||
then
|
||||
echo "allow-scripts configuration is up-to-date"
|
||||
else
|
||||
|
@ -6,7 +6,7 @@ set -o pipefail
|
||||
|
||||
yarn lavamoat:auto
|
||||
|
||||
if git diff --exit-code --quiet
|
||||
if git diff --exit-code
|
||||
then
|
||||
echo "LavaMoat policy is up-to-date"
|
||||
else
|
||||
|
@ -183,6 +183,7 @@ module.exports = {
|
||||
'nyc.config.js',
|
||||
'stylelint.config.js',
|
||||
'app/scripts/lockdown-run.js',
|
||||
'app/scripts/lockdown-more.js',
|
||||
'development/**/*.js',
|
||||
'test/e2e/**/*.js',
|
||||
'test/lib/wait-until-called.js',
|
||||
@ -197,6 +198,7 @@ module.exports = {
|
||||
{
|
||||
files: [
|
||||
'app/scripts/lockdown-run.js',
|
||||
'app/scripts/lockdown-more.js',
|
||||
'test/unit-global/protect-intrinsics.test.js',
|
||||
],
|
||||
globals: {
|
||||
|
9
.storybook/actions/sb-send-action.js
Normal file
9
.storybook/actions/sb-send-action.js
Normal file
@ -0,0 +1,9 @@
|
||||
export const updateSendAsset = (type) => ({
|
||||
type: 'send/updateSendAsset',
|
||||
payload: type,
|
||||
});
|
||||
|
||||
export const updateSendStage = (stage) => ({
|
||||
type: 'send/updateSendStage',
|
||||
payload: stage,
|
||||
});
|
@ -1,65 +1,83 @@
|
||||
export const suggestedTokens = {
|
||||
"0x6b175474e89094c44da98b954eedeac495271d0f": {
|
||||
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
|
||||
"symbol": "META",
|
||||
"decimals": 18,
|
||||
"image": "metamark.svg",
|
||||
"unlisted": false
|
||||
export const suggestedAssets = [
|
||||
{
|
||||
asset: {
|
||||
address: '0x6b175474e89094c44da98b954eedeac495271d0f',
|
||||
symbol: 'META',
|
||||
decimals: 18,
|
||||
image: 'metamark.svg',
|
||||
unlisted: false
|
||||
},
|
||||
"0xB8c77482e45F1F44dE1745F52C74426C631bDD52": {
|
||||
"address": "0xB8c77482e45F1F44dE1745F52C74426C631bDD52",
|
||||
"symbol": "0X",
|
||||
"decimals": 18,
|
||||
"image": "0x.svg",
|
||||
"unlisted": false
|
||||
},
|
||||
{
|
||||
asset: {
|
||||
'address': '0xB8c77482e45F1F44dE1745F52C74426C631bDD52',
|
||||
'symbol': '0X',
|
||||
'decimals': 18,
|
||||
'image': '0x.svg',
|
||||
'unlisted': false
|
||||
},
|
||||
"0x1f9840a85d5af5bf1d1762f925bdaddc4201f984": {
|
||||
"address": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
|
||||
"symbol": "AST",
|
||||
"decimals": 18,
|
||||
"image": "ast.png",
|
||||
"unlisted": false
|
||||
},
|
||||
{
|
||||
asset: {
|
||||
'address': '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984',
|
||||
'symbol': 'AST',
|
||||
'decimals': 18,
|
||||
'image': 'ast.png',
|
||||
'unlisted': false
|
||||
},
|
||||
"0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2": {
|
||||
"address": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
|
||||
"symbol": "BAT",
|
||||
"decimals": 18,
|
||||
"image": "BAT_icon.svg",
|
||||
"unlisted": false
|
||||
},
|
||||
{
|
||||
asset: {
|
||||
'address': '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2',
|
||||
'symbol': 'BAT',
|
||||
'decimals': 18,
|
||||
'image': 'BAT_icon.svg',
|
||||
'unlisted': false
|
||||
},
|
||||
"0xe83cccfabd4ed148903bf36d4283ee7c8b3494d1": {
|
||||
"address": "0xe83cccfabd4ed148903bf36d4283ee7c8b3494d1",
|
||||
"symbol": "CVL",
|
||||
"decimals": 18,
|
||||
"image": "CVL_token.svg",
|
||||
"unlisted": false
|
||||
},
|
||||
{
|
||||
asset: {
|
||||
'address': '0xe83cccfabd4ed148903bf36d4283ee7c8b3494d1',
|
||||
'symbol': 'CVL',
|
||||
'decimals': 18,
|
||||
'image': 'CVL_token.svg',
|
||||
'unlisted': false
|
||||
},
|
||||
"0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e": {
|
||||
"address": "0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e",
|
||||
"symbol": "GLA",
|
||||
"decimals": 18,
|
||||
"image": "gladius.svg",
|
||||
"unlisted": false
|
||||
},
|
||||
{
|
||||
asset: {
|
||||
'address': '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e',
|
||||
'symbol': 'GLA',
|
||||
'decimals': 18,
|
||||
'image': 'gladius.svg',
|
||||
'unlisted': false
|
||||
},
|
||||
"0x467Bccd9d29f223BcE8043b84E8C8B282827790F": {
|
||||
"address": "0x467Bccd9d29f223BcE8043b84E8C8B282827790F",
|
||||
"symbol": "GNO",
|
||||
"decimals": 18,
|
||||
"image": "gnosis.svg",
|
||||
"unlisted": false
|
||||
},
|
||||
{
|
||||
asset: {
|
||||
'address': '0x467Bccd9d29f223BcE8043b84E8C8B282827790F',
|
||||
'symbol': 'GNO',
|
||||
'decimals': 18,
|
||||
'image': 'gnosis.svg',
|
||||
'unlisted': false
|
||||
},
|
||||
"0xff20817765cb7f73d4bde2e66e067e58d11095c2": {
|
||||
"address": "0xff20817765cb7f73d4bde2e66e067e58d11095c2",
|
||||
"symbol": "OMG",
|
||||
"decimals": 18,
|
||||
"image": "omg.jpg",
|
||||
"unlisted": false
|
||||
},
|
||||
{
|
||||
asset: {
|
||||
'address': '0xff20817765cb7f73d4bde2e66e067e58d11095c2',
|
||||
'symbol': 'OMG',
|
||||
'decimals': 18,
|
||||
'image': 'omg.jpg',
|
||||
'unlisted': false
|
||||
},
|
||||
"0x8e870d67f660d95d5be530380d0ec0bd388289e1": {
|
||||
"address": "0x8e870d67f660d95d5be530380d0ec0bd388289e1",
|
||||
"symbol": "WED",
|
||||
"decimals": 18,
|
||||
"image": "wed.png",
|
||||
"unlisted": false
|
||||
},
|
||||
{
|
||||
asset: {
|
||||
'address': '0x8e870d67f660d95d5be530380d0ec0bd388289e1',
|
||||
'symbol': 'WED',
|
||||
'decimals': 18,
|
||||
'image': 'wed.png',
|
||||
'unlisted': false
|
||||
},
|
||||
}
|
||||
},
|
||||
]
|
||||
|
9
.storybook/reducers/sb-history-reducer.js
Normal file
9
.storybook/reducers/sb-history-reducer.js
Normal file
@ -0,0 +1,9 @@
|
||||
import testData from '../test-data';
|
||||
|
||||
const initialState = { ...testData.history };
|
||||
export default function historySBReducer(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
19
.storybook/reducers/sb-send-reducer.js
Normal file
19
.storybook/reducers/sb-send-reducer.js
Normal file
@ -0,0 +1,19 @@
|
||||
import testData from '../test-data';
|
||||
|
||||
const initialState = { ...testData.send };
|
||||
export default function sendSBReducer(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case 'send/updateSendStage':
|
||||
return {
|
||||
...state,
|
||||
stage: action.payload,
|
||||
};
|
||||
case 'send/updateSendAsset':
|
||||
return {
|
||||
...state,
|
||||
asset: { ...state.asset, type: action.payload },
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
@ -1,5 +1,3 @@
|
||||
import { TRANSACTION_STATUSES } from '../shared/constants/transaction';
|
||||
|
||||
const state = {
|
||||
invalidCustomNetwork: {
|
||||
state: 'CLOSED',
|
||||
@ -21,6 +19,39 @@ const state = {
|
||||
1559: true,
|
||||
},
|
||||
},
|
||||
gasFeeEstimates: '0x5208',
|
||||
swapsState: {
|
||||
quotes: {},
|
||||
fetchParams: null,
|
||||
tokens: null,
|
||||
tradeTxId: null,
|
||||
approveTxId: null,
|
||||
quotesLastFetched: null,
|
||||
customMaxGas: '',
|
||||
customGasPrice: null,
|
||||
selectedAggId: null,
|
||||
customApproveTxData: '',
|
||||
errorKey: '',
|
||||
topAggId: null,
|
||||
routeState: '',
|
||||
swapsFeatureIsLive: false,
|
||||
swapsQuoteRefreshTime: 60000,
|
||||
},
|
||||
accountArray: [
|
||||
{
|
||||
name: 'This is a Really Long Account Name',
|
||||
address: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4',
|
||||
index: 0,
|
||||
balance: '0x176e5b6f173ebe66',
|
||||
},
|
||||
{
|
||||
name: 'Account 2',
|
||||
address: '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e',
|
||||
index: 1,
|
||||
balance: '0x2d3142f5000',
|
||||
},
|
||||
],
|
||||
connectedAccounts: ['0x64a845a5b02460acf8a3d84503b0d68d028b4bb4'],
|
||||
isInitialized: true,
|
||||
isUnlocked: true,
|
||||
isAccountMenuOpen: false,
|
||||
@ -103,24 +134,6 @@ const state = {
|
||||
},
|
||||
},
|
||||
},
|
||||
recipient: {
|
||||
address: '0x39a4e4Af7cCB654dB9500F258c64781c8FbD39F0',
|
||||
nickname: 'John Doe',
|
||||
error: '',
|
||||
warning: '',
|
||||
},
|
||||
addresses: [
|
||||
{
|
||||
address: '0x39a4e4Af7cCB654dB9500F258c64781c8FbD39F0',
|
||||
name: 'DAI',
|
||||
isEns: false,
|
||||
},
|
||||
{
|
||||
address: '1x39a4e4Af7cCB654dB9500F258c64781c8FbD39F0',
|
||||
name: 'ETH',
|
||||
isEns: true,
|
||||
},
|
||||
],
|
||||
contractExchangeRates: {
|
||||
'0xaD6D458402F60fD3Bd25163575031ACDce07538D': 0,
|
||||
},
|
||||
@ -366,6 +379,15 @@ const state = {
|
||||
value: '0x9c2686',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
note: 'txStateManager: setting status to confirmed',
|
||||
op: 'replace',
|
||||
path: '/status',
|
||||
timestamp: 1629582721178,
|
||||
value: 'confirmed',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
note: 'txStateManager: setting status to confirmed',
|
||||
@ -794,7 +816,7 @@ const state = {
|
||||
'0xaD6D458402F60fD3Bd25163575031ACDce07538D': './sai.svg',
|
||||
},
|
||||
hiddenTokens: [],
|
||||
suggestedTokens: {},
|
||||
suggestedAssets: {},
|
||||
useNonceField: false,
|
||||
usePhishDetect: true,
|
||||
lostIdentities: {},
|
||||
@ -1165,6 +1187,11 @@ const state = {
|
||||
balance: '0x0',
|
||||
details: null,
|
||||
},
|
||||
stage: 'ADD_RECIPIENT',
|
||||
amount: '3782dace9d900000',
|
||||
gas: {
|
||||
price: null,
|
||||
},
|
||||
},
|
||||
confirmTransaction: {
|
||||
txData: {
|
||||
|
@ -1124,15 +1124,6 @@
|
||||
"viewContact": {
|
||||
"message": "ዕውቂያን ይመልከቱ"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "በ $1ይመልከቱ"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "በ Etherscan ላይ ይመልከቱ"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "በኤክስፕሎረር ተመልከት"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "ድረ ገጻችንን ይጎብኙ"
|
||||
},
|
||||
|
@ -1120,15 +1120,6 @@
|
||||
"viewContact": {
|
||||
"message": "عرض جهة الاتصال"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "عرض في $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "عرضه على Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "عرض في متصفح Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "قم بزيارة موقعنا على الإنترنت"
|
||||
},
|
||||
|
@ -1123,15 +1123,6 @@
|
||||
"viewContact": {
|
||||
"message": "Преглед на контакта"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Преглед на $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Преглед на Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Преглед в Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Посетете нашият уеб сайт"
|
||||
},
|
||||
|
@ -1127,15 +1127,6 @@
|
||||
"viewContact": {
|
||||
"message": "পরিচিতি দেখুন"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "$1 এ দেখুন"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Etherscan দেখুন"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "এক্সপ্লোরারে দেখুন"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "আমাদের ওয়েবসাইট দেখুন"
|
||||
},
|
||||
|
@ -1096,15 +1096,6 @@
|
||||
"viewContact": {
|
||||
"message": "Veure Contacte"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Mostra a $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Veure a Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Mostra a Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Visita el nostre lloc web"
|
||||
},
|
||||
|
@ -1096,15 +1096,6 @@
|
||||
"viewContact": {
|
||||
"message": "Vis kontakt"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Se på $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Se på Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Vis i stifinder"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Besøg vores webside"
|
||||
},
|
||||
|
@ -1087,15 +1087,6 @@
|
||||
"viewContact": {
|
||||
"message": "Kontakt anzeigen"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Für $1 ansehen"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Auf Etherscan ansehen"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Im Explorer anzeigen"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Gehe zu unserer Webseite"
|
||||
},
|
||||
|
@ -1121,15 +1121,6 @@
|
||||
"viewContact": {
|
||||
"message": "Εμφάνιση Επαφής"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Προβολή σε $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Προβολή στο Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Προβολή στον Εξερευνητή"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Επισκεφθείτε τον ιστότοπό μας"
|
||||
},
|
||||
|
@ -259,6 +259,22 @@
|
||||
"betaWelcome": {
|
||||
"message": "Welcome to MetaMask Beta"
|
||||
},
|
||||
"blockExplorerAccountAction": {
|
||||
"message": "Account",
|
||||
"description": "This is used with viewOnEtherscan and viewInExplorer e.g View Account in Explorer"
|
||||
},
|
||||
"blockExplorerAssetAction": {
|
||||
"message": "Asset",
|
||||
"description": "This is used with viewOnEtherscan and viewInExplorer e.g View Asset in Explorer"
|
||||
},
|
||||
"blockExplorerSwapAction": {
|
||||
"message": "Swap",
|
||||
"description": "This is used with viewOnEtherscan e.g View Swap on Etherscan"
|
||||
},
|
||||
"blockExplorerTransactionAction": {
|
||||
"message": "Transaction",
|
||||
"description": "This is used with viewOnCustomBlockExplorer and viewOnEtherscan e.g View Transaction on Etherscan"
|
||||
},
|
||||
"blockExplorerUrl": {
|
||||
"message": "Block Explorer URL"
|
||||
},
|
||||
@ -405,7 +421,7 @@
|
||||
"message": "You have 1 account connected to this site."
|
||||
},
|
||||
"connectedAccountsEmptyDescription": {
|
||||
"message": "MetaMask is not connected this site. To connect to a web3 site, find the connect button on their site."
|
||||
"message": "MetaMask is not connected to this site. To connect to a web3 site, find and click the connect button."
|
||||
},
|
||||
"connectedSites": {
|
||||
"message": "Connected sites"
|
||||
@ -2784,13 +2800,16 @@
|
||||
"message": "View More"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "View at $1"
|
||||
"message": "View $1 at $2",
|
||||
"description": "$1 is the action type. e.g (Account, Transaction, Swap) and $2 is the Custom Block Exporer URL"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "View on Etherscan"
|
||||
"message": "View $1 on Etherscan",
|
||||
"description": "$1 is the action type. e.g (Account, Transaction, Swap)"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "View in Explorer"
|
||||
"message": "View $1 in Explorer",
|
||||
"description": "$1 is the action type. e.g (Account, Transaction, Swap)"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Visit our web site"
|
||||
|
@ -2386,15 +2386,6 @@
|
||||
"viewMore": {
|
||||
"message": "Ver más"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Ver en $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Ver en Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Ver en el explorador"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Visite nuestro sitio web"
|
||||
},
|
||||
|
@ -2386,15 +2386,6 @@
|
||||
"viewMore": {
|
||||
"message": "Ver más"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Ver en $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Ver en Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Ver en el explorador"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Visite nuestro sitio web"
|
||||
},
|
||||
|
@ -1117,15 +1117,6 @@
|
||||
"viewContact": {
|
||||
"message": "Kuva kontakt"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Vaata $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Kuva Etherscanil"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Kuva Exploreris"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Külastage meie veebilehte"
|
||||
},
|
||||
|
@ -1127,15 +1127,6 @@
|
||||
"viewContact": {
|
||||
"message": "مشاهده تماس"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "مشاهده در 1$1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "مشاهده در ایترسکن"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "مشاهده در براوزر"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "از وب سایت ما دیدن نمایید"
|
||||
},
|
||||
|
@ -1124,15 +1124,6 @@
|
||||
"viewContact": {
|
||||
"message": "Näytä yhteyshenkilö"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Tarkastele kohdassa $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Näytä Etherscanissa"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Tarkastele Explorerissa"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Vieraile verkkosivustollamme"
|
||||
},
|
||||
|
@ -1021,15 +1021,6 @@
|
||||
"viewContact": {
|
||||
"message": "Tingnan ang Contact"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Tingnan sa $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Tingnan sa Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Tingnan sa Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Bisitahin ang aming web site"
|
||||
},
|
||||
|
@ -1103,15 +1103,6 @@
|
||||
"viewContact": {
|
||||
"message": "Voir contact"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Afficher sur $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Voir sur Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Afficher dans Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Visitez notre site web"
|
||||
},
|
||||
|
@ -1121,15 +1121,6 @@
|
||||
"viewContact": {
|
||||
"message": "הצג איש קשר"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "הצג ב- $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "הצג ב-Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "הצג באקספלורר"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "בקר/י באתר שלנו"
|
||||
},
|
||||
|
@ -2386,15 +2386,6 @@
|
||||
"viewMore": {
|
||||
"message": "और देखें"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "$1 पर देखें"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Etherscan पर देखें"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "एक्सप्लोरर में देखें"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "हमारी वेबसाइट पर जाएँ"
|
||||
},
|
||||
|
@ -1117,15 +1117,6 @@
|
||||
"viewContact": {
|
||||
"message": "Prikaži kontakt"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Prikaži u $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Prikaži na Etherscanu"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Prikaži u Exploreru"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Posjetite naše mrežno mjesto"
|
||||
},
|
||||
|
@ -688,9 +688,6 @@
|
||||
"viewAccount": {
|
||||
"message": "Wè Kont"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Wè sou Etherscan"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Vizite sit entènèt nou an"
|
||||
},
|
||||
|
@ -1117,15 +1117,6 @@
|
||||
"viewContact": {
|
||||
"message": "Névjegy megtekintése"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Megtekintés $1-kor"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Nézze meg Etherscanen"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Megtekintés Explorerben"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Látogass el weboldalunkra"
|
||||
},
|
||||
|
@ -2386,15 +2386,6 @@
|
||||
"viewMore": {
|
||||
"message": "Lihat Selengkapnya"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Lihat di $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Lihat di Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Lihat di Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Kunjungi situs web kami"
|
||||
},
|
||||
|
@ -1947,15 +1947,6 @@
|
||||
"viewContact": {
|
||||
"message": "Visualizza contatto"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Vedi su $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Vedi su Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Vista in Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Visita il nostro sito web"
|
||||
},
|
||||
|
@ -2386,15 +2386,6 @@
|
||||
"viewMore": {
|
||||
"message": "詳細を表示"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "$1 に表示"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Etherscan で表示"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Explorer で表示"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "当社の Web サイトにアクセス"
|
||||
},
|
||||
|
@ -1127,15 +1127,6 @@
|
||||
"viewContact": {
|
||||
"message": "ಸಂಪರ್ಕವನ್ನು ವೀಕ್ಷಿಸಿ"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "$1 ನಲ್ಲಿ ವೀಕ್ಷಿಸಿ"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "ಎಥೆರ್ಸ್ಕ್ಯಾನ್ನಲ್ಲಿ ವೀಕ್ಷಿಸಿ"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "ಎಕ್ಸ್ಪ್ಲೋರರ್ನಲ್ಲಿ ವೀಕ್ಷಿಸಿ"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "ನಮ್ಮ ವೆಬ್ ಸೈಟ್ ಅನ್ನು ಭೇಟಿ ಮಾಡಿ"
|
||||
},
|
||||
|
@ -2386,15 +2386,6 @@
|
||||
"viewMore": {
|
||||
"message": "더 보기"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "$1에서 보기"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Etherscan에서 보기"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "탐색기에서 보기"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "당사 웹사이트 방문하기"
|
||||
},
|
||||
|
@ -1127,15 +1127,6 @@
|
||||
"viewContact": {
|
||||
"message": "Peržiūrėti kontaktą"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Peržiūrėti $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Peržiūrėti „Etherscan“"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Peržiūrėti naršyklėje"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Apsilankykite mūsų svetainėje"
|
||||
},
|
||||
|
@ -1123,15 +1123,6 @@
|
||||
"viewContact": {
|
||||
"message": "Skatīt līgumu"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Skatīt $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Skatīt Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Skatīt Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Apmeklējiet mūsu tīmekļa vietni"
|
||||
},
|
||||
|
@ -1101,15 +1101,6 @@
|
||||
"viewContact": {
|
||||
"message": "Lihat Kenalan"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Lihat pada $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Lihat di Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Lihat di Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Kunjungi laman web kami"
|
||||
},
|
||||
|
@ -1102,15 +1102,6 @@
|
||||
"viewContact": {
|
||||
"message": "Se kontrakt"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Vis ved $1 "
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Vis på Etherscan "
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Se i Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Besøk nettsiden vår "
|
||||
},
|
||||
|
@ -2386,15 +2386,6 @@
|
||||
"viewMore": {
|
||||
"message": "Tumingin Pa"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Tingnan sa $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Tingnan sa Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Tingnan sa Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Bisitahin ang aming website"
|
||||
},
|
||||
|
@ -1115,15 +1115,6 @@
|
||||
"viewContact": {
|
||||
"message": "Wyświetl kontakt"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Wyświetl w $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Zobacz na Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Wyświetl w przeglądarce"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Odwiedź naszą stronę"
|
||||
},
|
||||
|
@ -2386,15 +2386,6 @@
|
||||
"viewMore": {
|
||||
"message": "Exibir Mais"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Exibir em $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Exibir no Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Exibir no Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Visite nosso website"
|
||||
},
|
||||
|
@ -1108,15 +1108,6 @@
|
||||
"viewContact": {
|
||||
"message": "Vizualizare contact"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Vizualizați la $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Vizualizați pe Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Vizualizare în Explorator"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Accesați site-ul nostru"
|
||||
},
|
||||
|
@ -2386,15 +2386,6 @@
|
||||
"viewMore": {
|
||||
"message": "Посмотреть больше"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Посмотреть на $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Посмотреть на Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Проводник в проводнике"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Посетите наш веб-сайт"
|
||||
},
|
||||
|
@ -1084,15 +1084,6 @@
|
||||
"viewContact": {
|
||||
"message": "Zobraziť kontakt"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Zobraziť na $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Zobraziť na Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Zobraziť v Exploreri"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Navštivte naši stránku"
|
||||
},
|
||||
|
@ -1112,15 +1112,6 @@
|
||||
"viewContact": {
|
||||
"message": "Ogled stika"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Ogled na $1 "
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Poglej na Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Ogled v Explorerju"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Obiščite našo spletno stran"
|
||||
},
|
||||
|
@ -1112,15 +1112,6 @@
|
||||
"viewContact": {
|
||||
"message": "Pogledaj kontakt"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Pogledaj na $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Pogledaj na Etherscan-u"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Pogledati u Explorer-u"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Posetite našu veb lokaciju"
|
||||
},
|
||||
|
@ -1102,15 +1102,6 @@
|
||||
"viewContact": {
|
||||
"message": "Visa kontakt"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Visa vid $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Visa på Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Visa i Utforskaren"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Besök vår hemsida"
|
||||
},
|
||||
|
@ -1105,15 +1105,6 @@
|
||||
"viewContact": {
|
||||
"message": "Tazama Mawasiliano"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Tazama kwenye $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Tazama kwenye Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Tazama kwenye Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Tembelea Tovuti yetu"
|
||||
},
|
||||
|
@ -1900,15 +1900,6 @@
|
||||
"viewContact": {
|
||||
"message": "Tingnan ang Contact"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Tingnan sa $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Tingnan sa Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Tingnan sa Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Bisitahin ang aming website"
|
||||
},
|
||||
|
@ -1127,15 +1127,6 @@
|
||||
"viewContact": {
|
||||
"message": "Переглянути контакт"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Дивитись на $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Дивитись на Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Дивитись в Explorer"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Відвідайте наш веб-сайт"
|
||||
},
|
||||
|
@ -2386,15 +2386,6 @@
|
||||
"viewMore": {
|
||||
"message": "Xem thêm"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "Xem tại $1"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "Xem trên Etherscan"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "Xem trên trình khám phá"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "Truy cập trang web của chúng tôi"
|
||||
},
|
||||
|
@ -1924,15 +1924,6 @@
|
||||
"viewContact": {
|
||||
"message": "查看联系人"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "在 $1 查看"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "在 Etherscan(以太坊浏览器)上查看"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "在浏览器中查看"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "访问我们的网站"
|
||||
},
|
||||
|
@ -1115,15 +1115,6 @@
|
||||
"viewContact": {
|
||||
"message": "觀看聯絡資訊"
|
||||
},
|
||||
"viewOnCustomBlockExplorer": {
|
||||
"message": "在 $1 瀏覽"
|
||||
},
|
||||
"viewOnEtherscan": {
|
||||
"message": "在 Etherscan 上瀏覽"
|
||||
},
|
||||
"viewinExplorer": {
|
||||
"message": "在 Explorer 上瀏覽"
|
||||
},
|
||||
"visitWebSite": {
|
||||
"message": "造訪我們的網站"
|
||||
},
|
||||
|
@ -8,6 +8,7 @@
|
||||
<script src="./sentry-install.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-install.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-run.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-more.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./runtime-cjs.js" type="text/javascript" charset="utf-8"></script>
|
||||
{{@each(it.jsBundles) => val}}
|
||||
<script src="{{val}}" type="text/javascript" charset="utf-8"></script>
|
||||
|
@ -14,6 +14,7 @@
|
||||
<script src="./sentry-install.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-install.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-run.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-more.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./runtime-cjs.js" type="text/javascript" charset="utf-8"></script>
|
||||
{{@each(it.jsBundles) => val}}
|
||||
<script src="{{val}}" type="text/javascript" charset="utf-8"></script>
|
||||
|
@ -35,6 +35,7 @@
|
||||
"globalthis.js",
|
||||
"lockdown-install.js",
|
||||
"lockdown-run.js",
|
||||
"lockdown-more.js",
|
||||
"contentscript.js"
|
||||
],
|
||||
"run_at": "document_start",
|
||||
|
@ -37,6 +37,7 @@
|
||||
<script src="./sentry-install.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-install.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-run.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-more.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./runtime-cjs.js" type="text/javascript" charset="utf-8"></script>
|
||||
{{@each(it.jsBundles) => val}}
|
||||
<script src="{{val}}" type="text/javascript" charset="utf-8"></script>
|
||||
|
@ -5,6 +5,7 @@
|
||||
<script src="./globalthis.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-install.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-run.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-more.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./phishing-detect.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="./index.css" title="ltr">
|
||||
<link rel="stylesheet" type="text/css" href="./index-rtl.css" title="rtl" disabled>
|
||||
|
@ -14,6 +14,7 @@
|
||||
<script src="./sentry-install.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-install.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-run.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./lockdown-more.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="./runtime-cjs.js" type="text/javascript" charset="utf-8"></script>
|
||||
{{@each(it.jsBundles) => val}}
|
||||
<script src="{{val}}" type="text/javascript" charset="utf-8"></script>
|
||||
|
91
app/scripts/lockdown-more.js
Normal file
91
app/scripts/lockdown-more.js
Normal file
@ -0,0 +1,91 @@
|
||||
// Make all "object" and "function" own properties of globalThis
|
||||
// non-configurable and non-writable, when possible.
|
||||
// We call a property that is non-configurable and non-writable,
|
||||
// "non-modifiable".
|
||||
try {
|
||||
/**
|
||||
* `lockdown` only hardens the properties enumerated by the
|
||||
* universalPropertyNames constant specified in 'ses/src/whitelist'. This
|
||||
* function makes all function and object properties on the start compartment
|
||||
* global non-configurable and non-writable, unless they are already
|
||||
* non-configurable.
|
||||
*
|
||||
* It is critical that this function runs at the right time during
|
||||
* initialization, which should always be immediately after `lockdown` has been
|
||||
* called. At the time of writing, the modifications this function makes to the
|
||||
* runtime environment appear to be non-breaking, but that could change with
|
||||
* the addition of dependencies, or the order of our scripts in our HTML files.
|
||||
* Exercise caution.
|
||||
*
|
||||
* See inline comments for implementation details.
|
||||
*
|
||||
* We write this function in IIFE format to avoid polluting global scope.
|
||||
*/
|
||||
(function protectIntrinsics() {
|
||||
const namedIntrinsics = Reflect.ownKeys(new Compartment().globalThis);
|
||||
|
||||
// These named intrinsics are not automatically hardened by `lockdown`
|
||||
const shouldHardenManually = new Set(['eval', 'Function']);
|
||||
|
||||
const globalProperties = new Set([
|
||||
// universalPropertyNames is a constant added by lockdown to global scope
|
||||
// at the time of writing, it is initialized in 'ses/src/whitelist'.
|
||||
// These properties tend to be non-enumerable.
|
||||
...namedIntrinsics,
|
||||
|
||||
// TODO: Also include the named platform globals
|
||||
// This grabs every enumerable property on globalThis.
|
||||
// ...Object.keys(globalThis),
|
||||
]);
|
||||
|
||||
globalProperties.forEach((propertyName) => {
|
||||
const descriptor = Reflect.getOwnPropertyDescriptor(
|
||||
globalThis,
|
||||
propertyName,
|
||||
);
|
||||
|
||||
if (descriptor) {
|
||||
if (descriptor.configurable) {
|
||||
// If the property on globalThis is configurable, make it
|
||||
// non-configurable. If it has no accessor properties, also make it
|
||||
// non-writable.
|
||||
if (hasAccessor(descriptor)) {
|
||||
Object.defineProperty(globalThis, propertyName, {
|
||||
configurable: false,
|
||||
});
|
||||
} else {
|
||||
Object.defineProperty(globalThis, propertyName, {
|
||||
configurable: false,
|
||||
writable: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldHardenManually.has(propertyName)) {
|
||||
harden(globalThis[propertyName]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Checks whether the given propertyName descriptor has any accessors, i.e. the
|
||||
* properties `get` or `set`.
|
||||
*
|
||||
* We want to make globals non-writable, and we can't set the `writable`
|
||||
* property and accessor properties at the same time.
|
||||
*
|
||||
* @param {Object} descriptor - The propertyName descriptor to check.
|
||||
* @returns {boolean} Whether the propertyName descriptor has any accessors.
|
||||
*/
|
||||
function hasAccessor(descriptor) {
|
||||
return 'set' in descriptor || 'get' in descriptor;
|
||||
}
|
||||
})();
|
||||
} catch (error) {
|
||||
console.error('Protecting intrinsics failed:', error);
|
||||
if (globalThis?.sentry.captureException) {
|
||||
globalThis.sentry.captureException(
|
||||
new Error(`Protecting intrinsics failed: ${error.message}`),
|
||||
);
|
||||
}
|
||||
}
|
@ -20,95 +20,3 @@ try {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Make all "object" and "function" own properties of globalThis
|
||||
// non-configurable and non-writable, when possible.
|
||||
// We call the a property that is non-configurable and non-writable,
|
||||
// "non-modifiable".
|
||||
try {
|
||||
/**
|
||||
* `lockdown` only hardens the properties enumerated by the
|
||||
* universalPropertyNames constant specified in 'ses/src/whitelist'. This
|
||||
* function makes all function and object properties on the start compartment
|
||||
* global non-configurable and non-writable, unless they are already
|
||||
* non-configurable.
|
||||
*
|
||||
* It is critical that this function runs at the right time during
|
||||
* initialization, which should always be immediately after `lockdown` has been
|
||||
* called. At the time of writing, the modifications this function makes to the
|
||||
* runtime environment appear to be non-breaking, but that could change with
|
||||
* the addition of dependencies, or the order of our scripts in our HTML files.
|
||||
* Exercise caution.
|
||||
*
|
||||
* See inline comments for implementation details.
|
||||
*
|
||||
* We write this function in IIFE format to avoid polluting global scope.
|
||||
*/
|
||||
(function protectIntrinsics() {
|
||||
const namedIntrinsics = Reflect.ownKeys(new Compartment().globalThis);
|
||||
|
||||
// These named intrinsics are not automatically hardened by `lockdown`
|
||||
const shouldHardenManually = new Set(['eval', 'Function']);
|
||||
|
||||
const globalProperties = new Set([
|
||||
// universalPropertyNames is a constant added by lockdown to global scope
|
||||
// at the time of writing, it is initialized in 'ses/src/whitelist'.
|
||||
// These properties tend to be non-enumerable.
|
||||
...namedIntrinsics,
|
||||
|
||||
// TODO: Also include the named platform globals
|
||||
// This grabs every enumerable property on globalThis.
|
||||
// ...Object.keys(globalThis),
|
||||
]);
|
||||
|
||||
globalProperties.forEach((propertyName) => {
|
||||
const descriptor = Reflect.getOwnPropertyDescriptor(
|
||||
globalThis,
|
||||
propertyName,
|
||||
);
|
||||
|
||||
if (descriptor) {
|
||||
if (descriptor.configurable) {
|
||||
// If the property on globalThis is configurable, make it
|
||||
// non-configurable. If it has no accessor properties, also make it
|
||||
// non-writable.
|
||||
if (hasAccessor(descriptor)) {
|
||||
Object.defineProperty(globalThis, propertyName, {
|
||||
configurable: false,
|
||||
});
|
||||
} else {
|
||||
Object.defineProperty(globalThis, propertyName, {
|
||||
configurable: false,
|
||||
writable: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldHardenManually.has(propertyName)) {
|
||||
harden(globalThis[propertyName]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Checks whether the given propertyName descriptor has any accessors, i.e. the
|
||||
* properties `get` or `set`.
|
||||
*
|
||||
* We want to make globals non-writable, and we can't set the `writable`
|
||||
* property and accessor properties at the same time.
|
||||
*
|
||||
* @param {Object} descriptor - The propertyName descriptor to check.
|
||||
* @returns {boolean} Whether the propertyName descriptor has any accessors.
|
||||
*/
|
||||
function hasAccessor(descriptor) {
|
||||
return 'set' in descriptor || 'get' in descriptor;
|
||||
}
|
||||
})();
|
||||
} catch (error) {
|
||||
console.error('Protecting intrinsics failed:', error);
|
||||
if (globalThis.sentry && globalThis.sentry.captureException) {
|
||||
globalThis.sentry.captureException(
|
||||
new Error(`Protecting intrinsics failed: ${error.message}`),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ import { TRANSACTION_STATUSES } from '../../shared/constants/transaction';
|
||||
import {
|
||||
GAS_API_BASE_URL,
|
||||
GAS_DEV_API_BASE_URL,
|
||||
SWAPS_CLIENT_ID,
|
||||
} from '../../shared/constants/swaps';
|
||||
import { MAINNET_CHAIN_ID } from '../../shared/constants/network';
|
||||
import { KEYRING_TYPES } from '../../shared/constants/hardware-wallets';
|
||||
@ -201,6 +202,7 @@ export default class MetamaskController extends EventEmitter {
|
||||
this.gasFeeController = new GasFeeController({
|
||||
interval: 10000,
|
||||
messenger: gasFeeMessenger,
|
||||
clientId: SWAPS_CLIENT_ID,
|
||||
getProvider: () =>
|
||||
this.networkController.getProviderAndBlockTracker().provider,
|
||||
onNetworkStateChange: this.networkController.on.bind(
|
||||
|
@ -7,13 +7,14 @@ const pump = pify(require('pump'));
|
||||
const { version } = require('../../package.json');
|
||||
|
||||
const { createTask, composeParallel } = require('./task');
|
||||
const { BuildTypes } = require('./utils');
|
||||
|
||||
module.exports = createEtcTasks;
|
||||
|
||||
function createEtcTasks({
|
||||
betaVersionsMap,
|
||||
browserPlatforms,
|
||||
isBeta,
|
||||
buildType,
|
||||
livereload,
|
||||
}) {
|
||||
const clean = createTask('clean', async function clean() {
|
||||
@ -34,7 +35,10 @@ function createEtcTasks({
|
||||
'zip',
|
||||
composeParallel(
|
||||
...browserPlatforms.map((platform) =>
|
||||
createZipTask(platform, isBeta ? betaVersionsMap[platform] : undefined),
|
||||
createZipTask(
|
||||
platform,
|
||||
buildType === BuildTypes.beta ? betaVersionsMap[platform] : undefined,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -37,7 +37,6 @@ function defineAndRunBuildTasks() {
|
||||
betaVersion,
|
||||
buildType,
|
||||
entryTask,
|
||||
isBeta,
|
||||
isLavaMoat,
|
||||
shouldIncludeLockdown,
|
||||
shouldLintFenceFiles,
|
||||
@ -47,7 +46,7 @@ function defineAndRunBuildTasks() {
|
||||
const browserPlatforms = ['firefox', 'chrome', 'brave', 'opera'];
|
||||
|
||||
let betaVersionsMap;
|
||||
if (isBeta) {
|
||||
if (buildType === BuildTypes.beta) {
|
||||
betaVersionsMap = getNextBetaVersionMap(
|
||||
version,
|
||||
betaVersion,
|
||||
@ -59,13 +58,13 @@ function defineAndRunBuildTasks() {
|
||||
livereload,
|
||||
browserPlatforms,
|
||||
shouldIncludeLockdown,
|
||||
isBeta,
|
||||
buildType,
|
||||
});
|
||||
|
||||
const manifestTasks = createManifestTasks({
|
||||
browserPlatforms,
|
||||
betaVersionsMap,
|
||||
isBeta,
|
||||
buildType,
|
||||
});
|
||||
|
||||
const styleTasks = createStyleTasks({ livereload });
|
||||
@ -82,7 +81,7 @@ function defineAndRunBuildTasks() {
|
||||
livereload,
|
||||
browserPlatforms,
|
||||
betaVersionsMap,
|
||||
isBeta,
|
||||
buildType,
|
||||
});
|
||||
|
||||
// build for development (livereload)
|
||||
@ -201,7 +200,6 @@ function parseArgv() {
|
||||
betaVersion: String(betaVersion),
|
||||
buildType,
|
||||
entryTask,
|
||||
isBeta: argv[NamedArgs.BuildType] === BuildTypes.beta,
|
||||
isLavaMoat: process.argv[0].includes('lavamoat'),
|
||||
shouldIncludeLockdown: argv[NamedArgs.OmitLockdown],
|
||||
shouldLintFenceFiles,
|
||||
|
@ -7,10 +7,11 @@ const { version } = require('../../package.json');
|
||||
const betaManifestModifications = require('../../app/manifest/_beta_modifications.json');
|
||||
|
||||
const { createTask, composeSeries } = require('./task');
|
||||
const { BuildTypes } = require('./utils');
|
||||
|
||||
module.exports = createManifestTasks;
|
||||
|
||||
function createManifestTasks({ betaVersionsMap, browserPlatforms, isBeta }) {
|
||||
function createManifestTasks({ betaVersionsMap, browserPlatforms, buildType }) {
|
||||
// merge base manifest with per-platform manifests
|
||||
const prepPlatforms = async () => {
|
||||
return Promise.all(
|
||||
@ -28,7 +29,7 @@ function createManifestTasks({ betaVersionsMap, browserPlatforms, isBeta }) {
|
||||
const result = merge(
|
||||
cloneDeep(baseManifest),
|
||||
platformModifications,
|
||||
isBeta
|
||||
buildType === BuildTypes.beta
|
||||
? getBetaModifications(platform, betaVersionsMap)
|
||||
: { version },
|
||||
);
|
||||
|
@ -27,6 +27,7 @@ const bifyModuleGroups = require('bify-module-groups');
|
||||
|
||||
const metamaskrc = require('rc')('metamask', {
|
||||
INFURA_PROJECT_ID: process.env.INFURA_PROJECT_ID,
|
||||
ONBOARDING_V2: process.env.ONBOARDING_V2,
|
||||
SEGMENT_HOST: process.env.SEGMENT_HOST,
|
||||
SEGMENT_WRITE_KEY: process.env.SEGMENT_WRITE_KEY,
|
||||
SEGMENT_LEGACY_WRITE_KEY: process.env.SEGMENT_LEGACY_WRITE_KEY,
|
||||
@ -612,6 +613,7 @@ function getEnvironmentVariables({ buildType, devMode, testing }) {
|
||||
? process.env.SEGMENT_PROD_LEGACY_WRITE_KEY
|
||||
: metamaskrc.SEGMENT_LEGACY_WRITE_KEY,
|
||||
SWAPS_USE_DEV_APIS: process.env.SWAPS_USE_DEV_APIS === '1',
|
||||
ONBOARDING_V2: metamaskrc.ONBOARDING_V2 === '1',
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ const glob = require('fast-glob');
|
||||
const locales = require('../../app/_locales/index.json');
|
||||
|
||||
const { createTask, composeSeries } = require('./task');
|
||||
const { BuildTypes } = require('./utils');
|
||||
|
||||
const EMPTY_JS_FILE = './development/empty.js';
|
||||
|
||||
@ -13,26 +14,30 @@ module.exports = function createStaticAssetTasks({
|
||||
livereload,
|
||||
browserPlatforms,
|
||||
shouldIncludeLockdown = true,
|
||||
isBeta,
|
||||
buildType,
|
||||
}) {
|
||||
const [copyTargetsProd, copyTargetsDev] = getCopyTargets(
|
||||
shouldIncludeLockdown,
|
||||
);
|
||||
|
||||
const copyTargetsBeta = [
|
||||
...copyTargetsProd,
|
||||
{
|
||||
src: './app/build-types/beta/',
|
||||
dest: `images`,
|
||||
},
|
||||
];
|
||||
const additionalBuildTargets = {
|
||||
[BuildTypes.beta]: [
|
||||
{
|
||||
src: './app/build-types/beta/',
|
||||
dest: `images`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const targets = isBeta ? copyTargetsBeta : copyTargetsProd;
|
||||
if (Object.keys(additionalBuildTargets).includes(buildType)) {
|
||||
copyTargetsProd.push(...additionalBuildTargets[buildType]);
|
||||
copyTargetsDev.push(...additionalBuildTargets[buildType]);
|
||||
}
|
||||
|
||||
const prod = createTask(
|
||||
'static:prod',
|
||||
composeSeries(
|
||||
...targets.map((target) => {
|
||||
...copyTargetsProd.map((target) => {
|
||||
return async function copyStaticAssets() {
|
||||
await performCopy(target);
|
||||
};
|
||||
@ -143,6 +148,12 @@ function getCopyTargets(shouldIncludeLockdown) {
|
||||
: EMPTY_JS_FILE,
|
||||
dest: `lockdown-run.js`,
|
||||
},
|
||||
{
|
||||
src: shouldIncludeLockdown
|
||||
? `./app/scripts/lockdown-more.js`
|
||||
: EMPTY_JS_FILE,
|
||||
dest: `lockdown-more.js`,
|
||||
},
|
||||
{
|
||||
// eslint-disable-next-line node/no-extraneous-require
|
||||
src: require.resolve('@lavamoat/lavapack/src/runtime-cjs.js'),
|
||||
|
@ -824,8 +824,8 @@
|
||||
"@gulp-sourcemaps/identity-map": {
|
||||
"packages": {
|
||||
"acorn": true,
|
||||
"css": true,
|
||||
"normalize-path": true,
|
||||
"postcss": true,
|
||||
"source-map": true,
|
||||
"through2": true
|
||||
}
|
||||
@ -962,15 +962,6 @@
|
||||
"uri-js": true
|
||||
}
|
||||
},
|
||||
"amdefine": {
|
||||
"builtin": {
|
||||
"path.dirname": true
|
||||
},
|
||||
"globals": {
|
||||
"__filename": true,
|
||||
"process.nextTick": true
|
||||
}
|
||||
},
|
||||
"ansi-colors": {
|
||||
"packages": {
|
||||
"ansi-wrap": true
|
||||
@ -1481,7 +1472,7 @@
|
||||
"path.resolve": true
|
||||
},
|
||||
"globals": {
|
||||
"Buffer": true
|
||||
"Buffer.from": true
|
||||
},
|
||||
"packages": {
|
||||
"safe-buffer": true
|
||||
@ -1540,13 +1531,13 @@
|
||||
"css": {
|
||||
"builtin": {
|
||||
"fs.readFileSync": true,
|
||||
"path.dirname": true
|
||||
"path.dirname": true,
|
||||
"path.sep": true
|
||||
},
|
||||
"packages": {
|
||||
"inherits": true,
|
||||
"source-map": true,
|
||||
"source-map-resolve": true,
|
||||
"urix": true
|
||||
"source-map-resolve": true
|
||||
}
|
||||
},
|
||||
"d": {
|
||||
@ -2436,7 +2427,8 @@
|
||||
"path.sep": true
|
||||
},
|
||||
"globals": {
|
||||
"Buffer": true
|
||||
"Buffer.concat": true,
|
||||
"Buffer.from": true
|
||||
},
|
||||
"packages": {
|
||||
"@gulp-sourcemaps/identity-map": true,
|
||||
@ -2595,7 +2587,7 @@
|
||||
},
|
||||
"inline-source-map": {
|
||||
"globals": {
|
||||
"Buffer": true
|
||||
"Buffer.from": true
|
||||
},
|
||||
"packages": {
|
||||
"source-map": true
|
||||
@ -3816,16 +3808,15 @@
|
||||
"console.time": true,
|
||||
"console.timeEnd": true,
|
||||
"fetch": true
|
||||
},
|
||||
"packages": {
|
||||
"amdefine": true
|
||||
}
|
||||
},
|
||||
"source-map-resolve": {
|
||||
"builtin": {
|
||||
"path.sep": true,
|
||||
"url.resolve": true
|
||||
},
|
||||
"globals": {
|
||||
"TextDecoder": true,
|
||||
"setImmediate": true
|
||||
},
|
||||
"packages": {
|
||||
|
@ -65,10 +65,11 @@
|
||||
"update-changelog": "auto-changelog update",
|
||||
"generate:migration": "./development/generate-migration.sh",
|
||||
"lavamoat:auto": "lavamoat ./development/build/index.js --writeAutoPolicy",
|
||||
"lavamoat:debug": "lavamoat ./development/build/index.js --writeAutoPolicyDebug"
|
||||
"lavamoat:debug:build": "lavamoat ./development/build/index.js --writeAutoPolicyDebug"
|
||||
},
|
||||
"resolutions": {
|
||||
"**/regenerator-runtime": "^0.13.7",
|
||||
"**/caniuse-lite": "1.0.30001260",
|
||||
"**/configstore/dot-prop": "^5.1.1",
|
||||
"**/ethers/elliptic": "^6.5.4",
|
||||
"**/knex/minimist": "^1.2.5",
|
||||
@ -102,7 +103,7 @@
|
||||
"@fortawesome/fontawesome-free": "^5.13.0",
|
||||
"@material-ui/core": "^4.11.0",
|
||||
"@metamask/contract-metadata": "^1.28.0",
|
||||
"@metamask/controllers": "^16.0.0",
|
||||
"@metamask/controllers": "^17.0.0",
|
||||
"@metamask/eth-ledger-bridge-keyring": "^0.7.0",
|
||||
"@metamask/eth-token-tracker": "^3.0.1",
|
||||
"@metamask/etherscan-link": "^2.1.0",
|
||||
@ -278,7 +279,7 @@
|
||||
"gulp-livereload": "4.0.0",
|
||||
"gulp-rename": "^2.0.0",
|
||||
"gulp-rtlcss": "^1.4.0",
|
||||
"gulp-sourcemaps": "^2.6.0",
|
||||
"gulp-sourcemaps": "^3.0.0",
|
||||
"gulp-stylelint": "^13.0.0",
|
||||
"gulp-watch": "^5.0.1",
|
||||
"gulp-zip": "^4.0.0",
|
||||
@ -286,7 +287,7 @@
|
||||
"jest": "^26.6.3",
|
||||
"jsdom": "^11.2.0",
|
||||
"koa": "^2.7.0",
|
||||
"lavamoat": "^5.3.1",
|
||||
"lavamoat": "^5.3.4",
|
||||
"lavamoat-viz": "^6.0.9",
|
||||
"lockfile-lint": "^4.0.0",
|
||||
"loose-envify": "^1.4.0",
|
||||
|
18
patches/abort-controller+3.0.0.patch
Normal file
18
patches/abort-controller+3.0.0.patch
Normal file
@ -0,0 +1,18 @@
|
||||
diff --git a/node_modules/abort-controller/browser.js b/node_modules/abort-controller/browser.js
|
||||
index b0c5ec3..c8c8018 100644
|
||||
--- a/node_modules/abort-controller/browser.js
|
||||
+++ b/node_modules/abort-controller/browser.js
|
||||
@@ -2,12 +2,7 @@
|
||||
"use strict"
|
||||
|
||||
/*eslint-disable @mysticatea/prettier */
|
||||
-const { AbortController, AbortSignal } =
|
||||
- typeof self !== "undefined" ? self :
|
||||
- typeof window !== "undefined" ? window :
|
||||
- /* otherwise */ undefined
|
||||
+const { AbortController } = globalThis;
|
||||
/*eslint-enable @mysticatea/prettier */
|
||||
|
||||
module.exports = AbortController
|
||||
-module.exports.AbortSignal = AbortSignal
|
||||
-module.exports.default = AbortController
|
22
patches/combine-source-map++convert-source-map+1.1.3.patch
Normal file
22
patches/combine-source-map++convert-source-map+1.1.3.patch
Normal file
@ -0,0 +1,22 @@
|
||||
diff --git a/node_modules/combine-source-map/node_modules/convert-source-map/index.js b/node_modules/combine-source-map/node_modules/convert-source-map/index.js
|
||||
index bfe92d1..bee1ffe 100644
|
||||
--- a/node_modules/combine-source-map/node_modules/convert-source-map/index.js
|
||||
+++ b/node_modules/combine-source-map/node_modules/convert-source-map/index.js
|
||||
@@ -9,7 +9,7 @@ var mapFileCommentRx =
|
||||
/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg
|
||||
|
||||
function decodeBase64(base64) {
|
||||
- return new Buffer(base64, 'base64').toString();
|
||||
+ return Buffer.from(base64, 'base64').toString();
|
||||
}
|
||||
|
||||
function stripComment(sm) {
|
||||
@@ -60,7 +60,7 @@ Converter.prototype.toJSON = function (space) {
|
||||
|
||||
Converter.prototype.toBase64 = function () {
|
||||
var json = this.toJSON();
|
||||
- return new Buffer(json).toString('base64');
|
||||
+ return Buffer.from(json).toString('base64');
|
||||
};
|
||||
|
||||
Converter.prototype.toComment = function (options) {
|
44
patches/gulp-sourcemaps+3.0.0.patch
Normal file
44
patches/gulp-sourcemaps+3.0.0.patch
Normal file
@ -0,0 +1,44 @@
|
||||
diff --git a/node_modules/gulp-sourcemaps/src/init/index.internals.js b/node_modules/gulp-sourcemaps/src/init/index.internals.js
|
||||
index 7104555..7dfe218 100644
|
||||
--- a/node_modules/gulp-sourcemaps/src/init/index.internals.js
|
||||
+++ b/node_modules/gulp-sourcemaps/src/init/index.internals.js
|
||||
@@ -72,7 +72,7 @@ module.exports = function(options, file, fileContent) {
|
||||
|
||||
});
|
||||
// remove source map comment from source
|
||||
- file.contents = new Buffer(sources.content, 'utf8');
|
||||
+ file.contents = Buffer.from(sources.content, 'utf8');
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/node_modules/gulp-sourcemaps/src/write/index.internals.js b/node_modules/gulp-sourcemaps/src/write/index.internals.js
|
||||
index 89cee60..adfe8d1 100644
|
||||
--- a/node_modules/gulp-sourcemaps/src/write/index.internals.js
|
||||
+++ b/node_modules/gulp-sourcemaps/src/write/index.internals.js
|
||||
@@ -99,7 +99,7 @@ module.exports = function(destPath, options) {
|
||||
|
||||
if (destPath === undefined || destPath === null) {
|
||||
// encode source map into comment
|
||||
- var base64Map = new Buffer(JSON.stringify(sourceMap)).toString('base64');
|
||||
+ var base64Map = Buffer.from(JSON.stringify(sourceMap)).toString('base64');
|
||||
comment = commentFormatter('data:application/json;charset=' + options.charset + ';base64,' + base64Map);
|
||||
} else {
|
||||
var mapFile = path.join(destPath, file.relative) + '.map';
|
||||
@@ -130,7 +130,7 @@ module.exports = function(destPath, options) {
|
||||
|
||||
var sourceMapFile = file.clone(options.clone || { deep: false, contents: false });
|
||||
sourceMapFile.path = sourceMapPath;
|
||||
- sourceMapFile.contents = new Buffer(JSON.stringify(sourceMap));
|
||||
+ sourceMapFile.contents = Buffer.from(JSON.stringify(sourceMap));
|
||||
sourceMapFile.stat = {
|
||||
isFile: function() { return true; },
|
||||
isDirectory: function() { return false; },
|
||||
@@ -164,7 +164,7 @@ module.exports = function(destPath, options) {
|
||||
|
||||
// append source map comment
|
||||
if (options.addComment) {
|
||||
- file.contents = Buffer.concat([file.contents, new Buffer(comment)]);
|
||||
+ file.contents = Buffer.concat([file.contents, Buffer.from(comment)]);
|
||||
}
|
||||
}
|
||||
|
13
patches/inline-source-map+0.6.2.patch
Normal file
13
patches/inline-source-map+0.6.2.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/node_modules/inline-source-map/index.js b/node_modules/inline-source-map/index.js
|
||||
index df74d61..7641aad 100644
|
||||
--- a/node_modules/inline-source-map/index.js
|
||||
+++ b/node_modules/inline-source-map/index.js
|
||||
@@ -91,7 +91,7 @@ Generator.prototype.addSourceContent = function (sourceFile, sourcesContent) {
|
||||
*/
|
||||
Generator.prototype.base64Encode = function () {
|
||||
var map = this.toString();
|
||||
- return new Buffer(map).toString('base64');
|
||||
+ return Buffer.from(map).toString('base64');
|
||||
};
|
||||
|
||||
/**
|
@ -1,5 +1,5 @@
|
||||
diff --git a/node_modules/regenerator-runtime/runtime.js b/node_modules/regenerator-runtime/runtime.js
|
||||
index 547b8c6..c53a471 100644
|
||||
index 547b8c6..885626e 100644
|
||||
--- a/node_modules/regenerator-runtime/runtime.js
|
||||
+++ b/node_modules/regenerator-runtime/runtime.js
|
||||
@@ -5,7 +5,7 @@
|
||||
@ -65,3 +65,12 @@ index 547b8c6..c53a471 100644
|
||||
|
||||
function pushTryEntry(locs) {
|
||||
var entry = { tryLoc: locs[0] };
|
||||
@@ -733,7 +734,7 @@ var runtime = (function (exports) {
|
||||
));
|
||||
|
||||
try {
|
||||
- regeneratorRuntime = runtime;
|
||||
+ globalThis.regeneratorRuntime = runtime;
|
||||
} catch (accidentalStrictMode) {
|
||||
// This module should not be running in strict mode, so the above
|
||||
// assignment should always work unless something is misconfigured. Just
|
||||
|
@ -177,3 +177,5 @@ export const ETHEREUM = 'ethereum';
|
||||
export const POLYGON = 'polygon';
|
||||
export const BSC = 'bsc';
|
||||
export const RINKEBY = 'rinkeby';
|
||||
|
||||
export const SWAPS_CLIENT_ID = 'extension';
|
||||
|
@ -31,6 +31,11 @@
|
||||
"name": "Test Account 2"
|
||||
}
|
||||
},
|
||||
"networkDetails": {
|
||||
"EIPS": {
|
||||
"1559": true
|
||||
}
|
||||
},
|
||||
"cachedBalances": {},
|
||||
"incomingTransactions": {},
|
||||
"unapprovedTxs": {
|
||||
|
@ -130,7 +130,7 @@ async function withFixtures(options, testSuite) {
|
||||
if (webDriver) {
|
||||
await webDriver.quit();
|
||||
}
|
||||
if (dappServer) {
|
||||
if (dappServer && dappServer.listening) {
|
||||
await new Promise((resolve, reject) => {
|
||||
dappServer.close((error) => {
|
||||
if (error) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
const { strict: assert } = require('assert');
|
||||
const { withFixtures } = require('../helpers');
|
||||
const { withFixtures, regularDelayMs } = require('../helpers');
|
||||
|
||||
describe('Deploy contract and call contract methods', function () {
|
||||
let windowHandles;
|
||||
@ -91,6 +91,7 @@ describe('Deploy contract and call contract methods', function () {
|
||||
'MetaMask Notification',
|
||||
windowHandles,
|
||||
);
|
||||
await driver.delay(regularDelayMs);
|
||||
await driver.clickElement({ text: 'Confirm', tag: 'button' });
|
||||
await driver.waitUntilXWindowHandles(2);
|
||||
await driver.switchToWindow(extension);
|
||||
|
@ -16,13 +16,10 @@ class ChromeDriver {
|
||||
.setChromeOptions(options);
|
||||
const service = new chrome.ServiceBuilder();
|
||||
|
||||
// Enables Chrome logging.
|
||||
// Enables Chrome logging. Default: enabled
|
||||
// Especially useful for discovering why Chrome has crashed, but can also
|
||||
// be useful for revealing console errors (from the page or background).
|
||||
if (
|
||||
process.env.ENABLE_CHROME_LOGGING &&
|
||||
process.env.ENABLE_CHROME_LOGGING !== 'false'
|
||||
) {
|
||||
if (process.env.ENABLE_CHROME_LOGGING !== 'false') {
|
||||
service.setStdio('inherit').enableChromeLogging();
|
||||
}
|
||||
if (port) {
|
||||
|
@ -277,13 +277,13 @@ class Driver {
|
||||
|
||||
async switchToWindowWithTitle(
|
||||
title,
|
||||
windowHandles,
|
||||
initialWindowHandles,
|
||||
delayStep = 1000,
|
||||
timeout = 5000,
|
||||
) {
|
||||
let windowHandles =
|
||||
initialWindowHandles || (await this.driver.getAllWindowHandles());
|
||||
let timeElapsed = 0;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
windowHandles = windowHandles || (await this.driver.getAllWindowHandles());
|
||||
while (timeElapsed <= timeout) {
|
||||
for (const handle of windowHandles) {
|
||||
await this.driver.switchTo().window(handle);
|
||||
@ -294,6 +294,8 @@ class Driver {
|
||||
}
|
||||
await this.delay(delayStep);
|
||||
timeElapsed += delayStep;
|
||||
// refresh the window handles
|
||||
windowHandles = await this.driver.getAllWindowHandles();
|
||||
}
|
||||
|
||||
throw new Error(`No window with title: ${title}`);
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'ses/lockdown';
|
||||
import '../../app/scripts/lockdown-run';
|
||||
import '../../app/scripts/lockdown-more';
|
||||
import { strict as assert } from 'assert';
|
||||
|
||||
// These are Agoric inventions, and we don't care about them.
|
||||
|
@ -1,31 +1,89 @@
|
||||
import React from 'react';
|
||||
import { Provider } from 'react-redux';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { boolean } from '@storybook/addon-knobs';
|
||||
import { decGWEIToHexWEI } from '../../../helpers/utils/conversions.util';
|
||||
import configureStore from '../../../store/store';
|
||||
import testData from '../../../../.storybook/test-data';
|
||||
import { EDIT_GAS_MODES } from '../../../../shared/constants/gas';
|
||||
import EditGasPopover from '.';
|
||||
|
||||
const store = configureStore(testData);
|
||||
|
||||
export default {
|
||||
title: 'Edit Gas Display Popover',
|
||||
decorators: [(story) => <Provider store={store}>{story()}</Provider>],
|
||||
id: __filename,
|
||||
};
|
||||
|
||||
export const basic = () => {
|
||||
export const Basic = () => {
|
||||
return (
|
||||
<div style={{ width: '600px' }}>
|
||||
<EditGasPopover />
|
||||
<EditGasPopover
|
||||
transaction={{
|
||||
userFeeLevel: 'medium',
|
||||
txParams: {
|
||||
maxFeePerGas: decGWEIToHexWEI('10000'),
|
||||
maxPriorityFeePerGas: '0x5600',
|
||||
gas: `0x5600`,
|
||||
gasPrice: '0x5600',
|
||||
},
|
||||
}}
|
||||
defaultEstimateToUse="high"
|
||||
mode={EDIT_GAS_MODES.SWAPS}
|
||||
confirmButtonText="Submit"
|
||||
onClose={() => action(`Close Edit Gas Popover`)()}
|
||||
minimumGasLimit="5700"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const basicWithDifferentButtonText = () => {
|
||||
export const BasicWithDifferentButtonText = () => {
|
||||
return (
|
||||
<div style={{ width: '600px' }}>
|
||||
<EditGasPopover confirmButtonText="Custom Value" />
|
||||
<EditGasPopover
|
||||
confirmButtonText="Custom Value"
|
||||
transaction={{
|
||||
userFeeLevel: 'medium',
|
||||
txParams: {
|
||||
maxFeePerGas: decGWEIToHexWEI('10000'),
|
||||
maxPriorityFeePerGas: '0x5600',
|
||||
gas: `0x5600`,
|
||||
gasPrice: '0x5600',
|
||||
},
|
||||
}}
|
||||
defaultEstimateToUse="high"
|
||||
mode={EDIT_GAS_MODES.SWAPS}
|
||||
onClose={() => action(`Close Edit Gas Popover`)()}
|
||||
minimumGasLimit="5700"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const educationalContentFlow = () => {
|
||||
export const EducationalContentFlow = () => {
|
||||
return (
|
||||
<div style={{ width: '600px' }}>
|
||||
<EditGasPopover editGasDisplayProps={{ showEducationButton: true }} />
|
||||
<EditGasPopover
|
||||
editGasDisplayProps={{
|
||||
showEducationButton: boolean('Show Education Button', true),
|
||||
}}
|
||||
transaction={{
|
||||
userFeeLevel: 'medium',
|
||||
txParams: {
|
||||
maxFeePerGas: decGWEIToHexWEI('10000'),
|
||||
maxPriorityFeePerGas: '0x5600',
|
||||
gas: `0x5600`,
|
||||
gasPrice: '0x5600',
|
||||
},
|
||||
}}
|
||||
defaultEstimateToUse="high"
|
||||
mode={EDIT_GAS_MODES.SWAPS}
|
||||
confirmButtonText="Submit"
|
||||
onClose={() => action(`Close Edit Gas Popover`)()}
|
||||
minimumGasLimit="5700"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
@ -117,7 +117,9 @@ export default function AccountOptionsMenu({ anchorElement, onClose }) {
|
||||
}
|
||||
iconClassName="fas fa-external-link-alt"
|
||||
>
|
||||
{rpcPrefs.blockExplorerUrl ? t('viewinExplorer') : t('viewOnEtherscan')}
|
||||
{rpcPrefs.blockExplorerUrl
|
||||
? t('viewinExplorer', [t('blockExplorerAccountAction')])
|
||||
: t('viewOnEtherscan', [t('blockExplorerAccountAction')])}
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
data-testid="account-options-menu__connected-sites"
|
||||
|
@ -81,9 +81,11 @@ export default class AccountDetailsModal extends Component {
|
||||
>
|
||||
{rpcPrefs.blockExplorerUrl
|
||||
? this.context.t('blockExplorerView', [
|
||||
rpcPrefs.blockExplorerUrl.match(/^https?:\/\/(.+)/u)[1],
|
||||
getURLHostName(rpcPrefs.blockExplorerUrl),
|
||||
])
|
||||
: this.context.t('viewOnEtherscan')}
|
||||
: this.context.t('viewOnEtherscan', [
|
||||
this.context.t('blockExplorerAccountAction'),
|
||||
])}
|
||||
</Button>
|
||||
|
||||
{exportPrivateKeyFeatureEnabled ? (
|
||||
|
@ -181,8 +181,13 @@ export default class TransactionListItemDetails extends PureComponent {
|
||||
containerClassName="transaction-list-item-details__header-button-tooltip-container"
|
||||
title={
|
||||
blockExplorerUrl
|
||||
? t('viewOnCustomBlockExplorer', [blockExplorerUrl])
|
||||
: t('viewOnEtherscan')
|
||||
? t('viewOnCustomBlockExplorer', [
|
||||
t('blockExplorerTransactionAction'),
|
||||
blockExplorerUrl,
|
||||
])
|
||||
: t('viewOnEtherscan', [
|
||||
t('blockExplorerTransactionAction'),
|
||||
])
|
||||
}
|
||||
>
|
||||
<Button
|
||||
|
3
ui/components/ui/slider/index.js
Normal file
3
ui/components/ui/slider/index.js
Normal file
@ -0,0 +1,3 @@
|
||||
import Slider from './slider.component';
|
||||
|
||||
export default Slider;
|
48
ui/components/ui/slider/index.scss
Normal file
48
ui/components/ui/slider/index.scss
Normal file
@ -0,0 +1,48 @@
|
||||
.slider {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
|
||||
&__heading,
|
||||
&__footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
&__heading-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
> p {
|
||||
margin-left: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
&__heading-detail > p {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
&__footer-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
> p {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
&__footer-edit > button {
|
||||
border: none;
|
||||
background: none;
|
||||
font-size: 12px;
|
||||
color: $Blue-500;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
h6 {
|
||||
margin-inline-end: 6px;
|
||||
}
|
||||
}
|
135
ui/components/ui/slider/slider.component.js
Normal file
135
ui/components/ui/slider/slider.component.js
Normal file
@ -0,0 +1,135 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import MaterialSlider from '@material-ui/core/Slider';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
|
||||
import {
|
||||
COLORS,
|
||||
FONT_WEIGHT,
|
||||
TYPOGRAPHY,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
|
||||
import InfoTooltip from '../info-tooltip/info-tooltip';
|
||||
import Typography from '../typography/typography';
|
||||
|
||||
const styles = {
|
||||
root: {
|
||||
height: 6,
|
||||
padding: '6px 0',
|
||||
},
|
||||
rail: {
|
||||
borderRadius: 50,
|
||||
background: '#D6D9DC',
|
||||
height: 6,
|
||||
},
|
||||
track: {
|
||||
borderRadius: 50,
|
||||
background: '#037DD6',
|
||||
height: 6,
|
||||
},
|
||||
thumb: {
|
||||
'height': 20,
|
||||
'width': 20,
|
||||
'marginTop': -7,
|
||||
'marginLeft': -7,
|
||||
'backgroundColor': '#037DD6',
|
||||
'border': '1px solid #EAF6FF',
|
||||
'boxSizing': 'border-box',
|
||||
'boxShadow': '0px 0px 14px 0px rgba(0, 0, 0, 0.18)',
|
||||
'&:focus, &$active': {
|
||||
height: 20,
|
||||
width: 20,
|
||||
marginTop: -7,
|
||||
marginLeft: -7,
|
||||
boxShadow: '0px 0px 14px 0px rgba(0, 0, 0, 0.18)',
|
||||
},
|
||||
'&:hover': {
|
||||
height: 22,
|
||||
width: 22,
|
||||
marginTop: -8,
|
||||
marginLeft: -8,
|
||||
border: 'none',
|
||||
boxShadow: '0px 0px 14px 0px rgba(0, 0, 0, 0.18)',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const Slider = ({
|
||||
editText,
|
||||
infoText,
|
||||
onEdit,
|
||||
titleDetail,
|
||||
titleText,
|
||||
tooltipText,
|
||||
valueText,
|
||||
...rest
|
||||
}) => (
|
||||
<div className="slider">
|
||||
<div className="slider__heading">
|
||||
<div className="slider__heading-title">
|
||||
{titleText && (
|
||||
<Typography
|
||||
tag={TYPOGRAPHY.H6}
|
||||
fontWeight={FONT_WEIGHT.BOLD}
|
||||
variant={TYPOGRAPHY.H6}
|
||||
>
|
||||
{titleText}
|
||||
</Typography>
|
||||
)}
|
||||
{tooltipText && (
|
||||
<InfoTooltip position="top" contentText={tooltipText} />
|
||||
)}
|
||||
{valueText && (
|
||||
<Typography tag={TYPOGRAPHY.Paragraph} color={COLORS.UI4}>
|
||||
{valueText}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
{titleDetail && (
|
||||
<div className="slider__heading-detail">
|
||||
<Typography tag={TYPOGRAPHY.Paragraph} color={COLORS.UI4}>
|
||||
{titleDetail}
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<MaterialSlider {...rest} />
|
||||
<div className="slider__footer">
|
||||
<div className="slider__footer-info">
|
||||
{infoText && (
|
||||
<Typography tag={TYPOGRAPHY.Paragraph} color={COLORS.UI4}>
|
||||
{infoText}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
<div className="slider__footer-edit">
|
||||
{onEdit && (
|
||||
<button onClick={onEdit} aria-label="edit as numeric input">
|
||||
{editText}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Slider.defaultProps = {
|
||||
editText: 'Edit',
|
||||
};
|
||||
|
||||
Slider.propTypes = {
|
||||
editText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||
infoText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||
titleDetail: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||
titleText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||
tooltipText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||
valueText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
||||
max: PropTypes.number,
|
||||
min: PropTypes.number,
|
||||
onChange: PropTypes.func,
|
||||
onEdit: PropTypes.func,
|
||||
step: PropTypes.number,
|
||||
value: PropTypes.number,
|
||||
};
|
||||
|
||||
export default withStyles(styles)(Slider);
|
58
ui/components/ui/slider/slider.component.test.js
Normal file
58
ui/components/ui/slider/slider.component.test.js
Normal file
@ -0,0 +1,58 @@
|
||||
import React from 'react';
|
||||
import { fireEvent, render } from '@testing-library/react';
|
||||
|
||||
import Slider from './slider.component';
|
||||
|
||||
describe('Slider Component', () => {
|
||||
describe('rendering', () => {
|
||||
it('should render properly', () => {
|
||||
expect(() => {
|
||||
render(<Slider />);
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
it('should contain passed header props', () => {
|
||||
const wrapper = render(
|
||||
<Slider
|
||||
titleText="Slider Title Text"
|
||||
tooltipText="Slider Tooltip Text"
|
||||
valueText="$ 00.00"
|
||||
titleDetail="100 GWEI"
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(wrapper.getAllByText('Slider Title Text')).toBeDefined();
|
||||
expect(wrapper.getAllByText('$ 00.00')).toBeDefined();
|
||||
expect(wrapper.getAllByText('100 GWEI')).toBeDefined();
|
||||
});
|
||||
|
||||
it('should contain passed footer props', () => {
|
||||
const wrapper = render(
|
||||
<Slider
|
||||
infoText="Footer Info Text"
|
||||
editText="Edit GWEI"
|
||||
onEdit={() => {
|
||||
console.log('on edit click');
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(wrapper.getAllByText('Footer Info Text')).toBeDefined();
|
||||
expect(
|
||||
wrapper.getByRole('button', { name: 'edit as numeric input' }),
|
||||
).toBeDefined();
|
||||
expect(wrapper.getAllByText('Edit GWEI')).toBeDefined();
|
||||
});
|
||||
|
||||
it('should call onEdit callback when edit button is clicked', () => {
|
||||
const mockEditFn = jest.fn();
|
||||
const wrapper = render(
|
||||
<Slider infoText="Footer Info Text" onEdit={mockEditFn} />,
|
||||
);
|
||||
|
||||
const editButton = wrapper.getByRole('button');
|
||||
fireEvent.click(editButton);
|
||||
expect(mockEditFn).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
});
|
33
ui/components/ui/slider/slider.stories.js
Normal file
33
ui/components/ui/slider/slider.stories.js
Normal file
@ -0,0 +1,33 @@
|
||||
import React from 'react';
|
||||
import Slider from '.';
|
||||
|
||||
export default {
|
||||
title: 'Slider',
|
||||
id: __filename,
|
||||
};
|
||||
|
||||
export const slider = () => <Slider />;
|
||||
|
||||
export const sliderWithSteps = () => <Slider step={10} />;
|
||||
|
||||
export const sliderWithHeader = () => (
|
||||
<Slider
|
||||
titleText="Slider Title Text"
|
||||
tooltipText="Slider Tooltip Text"
|
||||
valueText="$ 00.00"
|
||||
titleDetail="100 GWEI"
|
||||
/>
|
||||
);
|
||||
|
||||
export const sliderWithFooter = () => (
|
||||
<Slider
|
||||
titleText="Slider Title Text"
|
||||
tooltipText="Slider Tooltip Text"
|
||||
valueText="$ 00.00"
|
||||
titleDetail="100 GWEI"
|
||||
infoText="Footer Info Text"
|
||||
onEdit={() => {
|
||||
console.log('on edit click');
|
||||
}}
|
||||
/>
|
||||
);
|
@ -45,6 +45,7 @@
|
||||
@import 'readonly-input/index';
|
||||
@import 'sender-to-recipient/index';
|
||||
@import 'snackbar/index';
|
||||
@import 'slider/index';
|
||||
@import 'tabs/index';
|
||||
@import 'toggle-button/index';
|
||||
@import 'token-balance/index';
|
||||
|
@ -279,6 +279,16 @@ export function getUnapprovedTxs(state) {
|
||||
return state.metamask.unapprovedTxs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function returns true if network details are fetched and it is found to not support EIP-1559
|
||||
*/
|
||||
export function isNotEIP1559Network(state) {
|
||||
return state.metamask.networkDetails?.EIPS[1559] === false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function returns true if network details are fetched and it is found to support EIP-1559
|
||||
*/
|
||||
export function isEIP1559Network(state) {
|
||||
return state.metamask.networkDetails?.EIPS[1559] === true;
|
||||
}
|
||||
@ -315,3 +325,18 @@ export function getIsGasEstimatesLoading(state) {
|
||||
|
||||
return isGasEstimatesLoading;
|
||||
}
|
||||
|
||||
export function getCompletedOnboarding(state) {
|
||||
return state.metamask.completedOnboarding;
|
||||
}
|
||||
export function getIsInitialized(state) {
|
||||
return state.metamask.isInitialized;
|
||||
}
|
||||
|
||||
export function getIsUnlocked(state) {
|
||||
return state.metamask.isUnlocked;
|
||||
}
|
||||
|
||||
export function getSeedPhraseBackedUp(state) {
|
||||
return state.metamask.seedPhraseBackedUp;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import reduceMetamask, {
|
||||
getSendHexDataFeatureFlagState,
|
||||
getSendToAccounts,
|
||||
getUnapprovedTxs,
|
||||
isNotEIP1559Network,
|
||||
} from './metamask';
|
||||
|
||||
describe('MetaMask Reducers', () => {
|
||||
@ -99,6 +100,9 @@ describe('MetaMask Reducers', () => {
|
||||
gasPrice: '4a817c800',
|
||||
},
|
||||
},
|
||||
networkDetails: {
|
||||
EIPS: { 1559: true },
|
||||
},
|
||||
},
|
||||
{},
|
||||
),
|
||||
@ -378,4 +382,36 @@ describe('MetaMask Reducers', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('isNotEIP1559Network()', () => {
|
||||
it('should return true if network does not supports EIP-1559', () => {
|
||||
expect(
|
||||
isNotEIP1559Network({
|
||||
...mockState,
|
||||
metamask: {
|
||||
...mockState.metamask,
|
||||
networkDetails: {
|
||||
EIPS: { 1559: false },
|
||||
},
|
||||
},
|
||||
}),
|
||||
).toStrictEqual(true);
|
||||
});
|
||||
|
||||
it('should return false if networkDetails.EIPS.1559 is not false', () => {
|
||||
expect(isNotEIP1559Network(mockState)).toStrictEqual(false);
|
||||
|
||||
expect(
|
||||
isNotEIP1559Network({
|
||||
...mockState,
|
||||
metamask: {
|
||||
...mockState.metamask,
|
||||
networkDetails: {
|
||||
EIPS: { 1559: undefined },
|
||||
},
|
||||
},
|
||||
}),
|
||||
).toStrictEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -45,7 +45,7 @@ export const TYPOGRAPHY = {
|
||||
H7: 'h7',
|
||||
H8: 'h8',
|
||||
H9: 'h9',
|
||||
Paragraph: 'paragraph',
|
||||
Paragraph: 'p',
|
||||
};
|
||||
|
||||
const NONE = 'none';
|
||||
|
@ -52,6 +52,21 @@ const INITIALIZE_END_OF_FLOW_ROUTE = '/initialize/end-of-flow';
|
||||
const INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE = '/initialize/seed-phrase/confirm';
|
||||
const INITIALIZE_METAMETRICS_OPT_IN_ROUTE = '/initialize/metametrics-opt-in';
|
||||
|
||||
const ONBOARDING_ROUTE = '/onboarding';
|
||||
const ONBOARDING_REVIEW_SRP_ROUTE = '/onboarding/review-srp';
|
||||
const ONBOARDING_CONFIRM_SRP_ROUTE = '/onboarding/confirm-srp';
|
||||
const ONBOARDING_CREATE_PASSWORD_ROUTE = '/onboarding/create-password';
|
||||
const ONBOARDING_COMPLETION_ROUTE = '/onboarding/completion';
|
||||
const ONBOARDING_UNLOCK_ROUTE = '/onboarding/unlock';
|
||||
const ONBOARDING_GET_STARTED_ROUTE = '/onboarding/get-started';
|
||||
const ONBOARDING_HELP_US_IMPROVE_ROUTE = '/onboarding/help-us-improve';
|
||||
const ONBOARDING_IMPORT_WITH_SRP_ROUTE =
|
||||
'/onboarding/create-password/import-with-sre';
|
||||
const ONBOARDING_IMPORT_MOBILE_ROUTE = '/onboarding/create-password';
|
||||
const ONBOARDING_SECURE_YOUR_WALLET_ROUTE = '/onboarding/secure-your-wallet';
|
||||
const ONBOARDING_PRIVACY_SETTINGS_ROUTE = '/onboarding/privacy-settings';
|
||||
const ONBOARDING_PIN_EXTENSION_ROUTE = '/onboarding/pin-extension';
|
||||
|
||||
const CONFIRM_TRANSACTION_ROUTE = '/confirm-transaction';
|
||||
const CONFIRM_SEND_ETHER_PATH = '/send-ether';
|
||||
const CONFIRM_SEND_TOKEN_PATH = '/send-token';
|
||||
@ -199,4 +214,17 @@ export {
|
||||
AWAITING_SIGNATURES_ROUTE,
|
||||
SWAPS_ERROR_ROUTE,
|
||||
SWAPS_MAINTENANCE_ROUTE,
|
||||
ONBOARDING_ROUTE,
|
||||
ONBOARDING_GET_STARTED_ROUTE,
|
||||
ONBOARDING_HELP_US_IMPROVE_ROUTE,
|
||||
ONBOARDING_CREATE_PASSWORD_ROUTE,
|
||||
ONBOARDING_IMPORT_WITH_SRP_ROUTE,
|
||||
ONBOARDING_IMPORT_MOBILE_ROUTE,
|
||||
ONBOARDING_SECURE_YOUR_WALLET_ROUTE,
|
||||
ONBOARDING_REVIEW_SRP_ROUTE,
|
||||
ONBOARDING_CONFIRM_SRP_ROUTE,
|
||||
ONBOARDING_PRIVACY_SETTINGS_ROUTE,
|
||||
ONBOARDING_COMPLETION_ROUTE,
|
||||
ONBOARDING_UNLOCK_ROUTE,
|
||||
ONBOARDING_PIN_EXTENSION_ROUTE,
|
||||
};
|
||||
|
@ -1,16 +1,32 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Redirect, Route } from 'react-router-dom';
|
||||
import { UNLOCK_ROUTE, INITIALIZE_ROUTE } from '../../constants/routes';
|
||||
import {
|
||||
UNLOCK_ROUTE,
|
||||
INITIALIZE_ROUTE,
|
||||
ONBOARDING_ROUTE,
|
||||
} from '../../constants/routes';
|
||||
|
||||
export default function Authenticated(props) {
|
||||
const { isUnlocked, completedOnboarding } = props;
|
||||
|
||||
switch (true) {
|
||||
// For ONBOARDING_V2 dev purposes,
|
||||
// Remove when ONBOARDING_V2 dev complete
|
||||
case process.env.ONBOARDING_V2 === true:
|
||||
return <Redirect to={{ pathname: ONBOARDING_ROUTE }} />;
|
||||
|
||||
case isUnlocked && completedOnboarding:
|
||||
return <Route {...props} />;
|
||||
case !completedOnboarding:
|
||||
return <Redirect to={{ pathname: INITIALIZE_ROUTE }} />;
|
||||
return (
|
||||
<Redirect
|
||||
to={{
|
||||
pathname: process.env.ONBOARDING_V2
|
||||
? ONBOARDING_ROUTE
|
||||
: INITIALIZE_ROUTE,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
return <Redirect to={{ pathname: UNLOCK_ROUTE }} />;
|
||||
}
|
||||
|
@ -1,13 +1,19 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Redirect, Route } from 'react-router-dom';
|
||||
import { INITIALIZE_ROUTE } from '../../constants/routes';
|
||||
import { INITIALIZE_ROUTE, ONBOARDING_ROUTE } from '../../constants/routes';
|
||||
|
||||
export default function Initialized(props) {
|
||||
return props.completedOnboarding ? (
|
||||
<Route {...props} />
|
||||
) : (
|
||||
<Redirect to={{ pathname: INITIALIZE_ROUTE }} />
|
||||
<Redirect
|
||||
to={{
|
||||
pathname: process.env.ONBOARDING_V2
|
||||
? ONBOARDING_ROUTE
|
||||
: INITIALIZE_ROUTE,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,9 @@ const AssetOptions = ({
|
||||
onClickBlockExplorer();
|
||||
}}
|
||||
>
|
||||
{isEthNetwork ? t('viewOnEtherscan') : t('viewinExplorer')}
|
||||
{isEthNetwork
|
||||
? t('viewOnEtherscan', [t('blockExplorerAssetAction')])
|
||||
: t('viewinExplorer', [t('blockExplorerAssetAction')])}
|
||||
</MenuItem>
|
||||
{isNativeAsset ? null : (
|
||||
<MenuItem
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user