mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
Merge remote-tracking branch 'upstream/develop' into minimal
This commit is contained in:
commit
a83119ba95
@ -13,7 +13,6 @@
|
||||
- tweaked overall typography defaulting to system font Avenir Next on macOS, respective default system font on all other OS
|
||||
- hide all those unneccessary nagging banners, like *Ledger connection instructions* or *network is busy* (it always is)
|
||||
- minimal unlock screen
|
||||
- NFT tab enabled by default
|
||||
- UX improvements around account dropdown when many accounts are in there
|
||||
- UX improvements around network dropdown
|
||||
- remove all the *Buy*, *Swap* etc. buttons, replace remaining *Send* with text only
|
||||
@ -28,6 +27,8 @@ yarn
|
||||
yarn dist
|
||||
```
|
||||
|
||||
Original README follows:
|
||||
|
||||
---
|
||||
|
||||
You can find the latest version of MetaMask on [our official website](https://metamask.io/). For help using MetaMask, visit our [User Support Site](https://metamask.zendesk.com/hc/en-us).
|
||||
|
24
app/_locales/en/messages.json
generated
24
app/_locales/en/messages.json
generated
@ -654,6 +654,12 @@
|
||||
"coingecko": {
|
||||
"message": "CoinGecko"
|
||||
},
|
||||
"complianceActivatedDesc": {
|
||||
"message": "You can now use compliance in MetaMask Institutional. Receiving AML/CFT analysis within the confirmation screen on all the addresses you interact with."
|
||||
},
|
||||
"complianceActivatedTitle": {
|
||||
"message": "Your compliance feature is activated"
|
||||
},
|
||||
"complianceBlurb0": {
|
||||
"message": "DeFi raises AML/CFT risk for institutions, given the decentralised pools and pseudonymous counterparties."
|
||||
},
|
||||
@ -780,6 +786,9 @@
|
||||
"connectingToSepolia": {
|
||||
"message": "Connecting to Sepolia test network"
|
||||
},
|
||||
"connectionError": {
|
||||
"message": "Connection error"
|
||||
},
|
||||
"contactUs": {
|
||||
"message": "Contact us"
|
||||
},
|
||||
@ -1707,6 +1716,9 @@
|
||||
"holdToRevealTitle": {
|
||||
"message": "Keep your SRP safe"
|
||||
},
|
||||
"id": {
|
||||
"message": "Id"
|
||||
},
|
||||
"ignoreAll": {
|
||||
"message": "Ignore all"
|
||||
},
|
||||
@ -1812,6 +1824,9 @@
|
||||
"install": {
|
||||
"message": "Install"
|
||||
},
|
||||
"institutionalFeatures": {
|
||||
"message": "Institutional Features"
|
||||
},
|
||||
"insufficientBalance": {
|
||||
"message": "Insufficient balance."
|
||||
},
|
||||
@ -2141,6 +2156,9 @@
|
||||
"mmiAddToken": {
|
||||
"message": "The page at $1 would like to authorise the following custodian token in MetaMask Institutional"
|
||||
},
|
||||
"mmiAuthenticate": {
|
||||
"message": "The page at $1 would like to authorise the following project’s compliance settings in MetaMask Institutional"
|
||||
},
|
||||
"mobileSyncWarning": {
|
||||
"message": "The 'Sync with extension' feature is temporarily disabled. If you want to use your extension wallet on MetaMask mobile, then on your mobile app: go back to the wallet setup options and select the 'Import with Secret Recovery Phrase' option. Use your extension wallet's secret phrase to then import your wallet into mobile."
|
||||
},
|
||||
@ -3065,6 +3083,12 @@
|
||||
"proceedWithTransaction": {
|
||||
"message": "I want to proceed anyway"
|
||||
},
|
||||
"projectIdInvalid": {
|
||||
"message": "Provided Project ID is invalid"
|
||||
},
|
||||
"projectName": {
|
||||
"message": "Project Name"
|
||||
},
|
||||
"proposedApprovalLimit": {
|
||||
"message": "Proposed approval limit"
|
||||
},
|
||||
|
@ -73,7 +73,6 @@ export default class PreferencesController {
|
||||
this._onInfuraIsUnblocked = opts.onInfuraIsUnblocked;
|
||||
this.store = new ObservableStore(initState);
|
||||
this.store.setMaxListeners(13);
|
||||
this.openPopup = opts.openPopup;
|
||||
this.tokenListController = opts.tokenListController;
|
||||
|
||||
this._subscribeToInfuraAvailability();
|
||||
|
@ -8,7 +8,6 @@ import {
|
||||
OriginalRequest,
|
||||
} from '@metamask/message-manager/dist/AbstractMessageManager';
|
||||
import { MetaMetricsEventCategory } from '../../../shared/constants/metametrics';
|
||||
import { detectSIWE } from '../../../shared/modules/siwe';
|
||||
import SignController, {
|
||||
SignControllerMessenger,
|
||||
SignControllerOptions,
|
||||
@ -20,10 +19,6 @@ jest.mock('@metamask/message-manager', () => ({
|
||||
TypedMessageManager: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.mock('../../../shared/modules/siwe', () => ({
|
||||
detectSIWE: jest.fn(),
|
||||
}));
|
||||
|
||||
const messageIdMock = '123';
|
||||
const messageIdMock2 = '456';
|
||||
const versionMock = '1';
|
||||
@ -69,13 +64,6 @@ const requestMock = {
|
||||
origin: 'http://test2.com',
|
||||
} as OriginalRequest;
|
||||
|
||||
const siweMockFound = {
|
||||
isSIWEMessage: true,
|
||||
parsedMessage: { domain: 'test.com', test: 'value' },
|
||||
};
|
||||
|
||||
const siweMockNotFound = { isSIWEMessage: false };
|
||||
|
||||
const createMessengerMock = () =>
|
||||
({
|
||||
registerActionHandler: jest.fn(),
|
||||
@ -128,7 +116,6 @@ describe('SignController', () => {
|
||||
const messengerMock = createMessengerMock();
|
||||
const preferencesControllerMock = createPreferencesControllerMock();
|
||||
const keyringControllerMock = createKeyringControllerMock();
|
||||
const detectSIWEMock = detectSIWE as jest.MockedFunction<typeof detectSIWE>;
|
||||
const getStateMock = jest.fn();
|
||||
const securityProviderRequestMock = jest.fn();
|
||||
const metricsEventMock = jest.fn();
|
||||
@ -147,8 +134,6 @@ describe('SignController', () => {
|
||||
disabledRpcMethodPreferences: { eth_sign: true },
|
||||
});
|
||||
|
||||
detectSIWEMock.mockReturnValue(siweMockNotFound);
|
||||
|
||||
signController = new SignController({
|
||||
messenger: messengerMock as any,
|
||||
preferencesController: preferencesControllerMock as any,
|
||||
@ -354,29 +339,6 @@ describe('SignController', () => {
|
||||
requestMock,
|
||||
);
|
||||
});
|
||||
|
||||
it('adds message to personal message manager including Ethereum sign in data', async () => {
|
||||
detectSIWEMock.mockReturnValueOnce(siweMockFound);
|
||||
|
||||
await signController.newUnsignedPersonalMessage(
|
||||
messageParamsMock,
|
||||
requestMock,
|
||||
);
|
||||
|
||||
expect(
|
||||
personalMessageManagerMock.addUnapprovedMessageAsync,
|
||||
).toHaveBeenCalledTimes(1);
|
||||
|
||||
expect(
|
||||
personalMessageManagerMock.addUnapprovedMessageAsync,
|
||||
).toHaveBeenCalledWith(
|
||||
{
|
||||
...messageParamsMock,
|
||||
siwe: siweMockFound,
|
||||
},
|
||||
requestMock,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('newUnsignedTypedMessage', () => {
|
||||
|
@ -33,7 +33,6 @@ import {
|
||||
RejectRequest,
|
||||
} from '@metamask/approval-controller';
|
||||
import { MetaMetricsEventCategory } from '../../../shared/constants/metametrics';
|
||||
import { detectSIWE } from '../../../shared/modules/siwe';
|
||||
import PreferencesController from './preferences';
|
||||
|
||||
const controllerName = 'SignController';
|
||||
@ -321,11 +320,8 @@ export default class SignController extends BaseControllerV2<
|
||||
msgParams: PersonalMessageParams,
|
||||
req: OriginalRequest,
|
||||
): Promise<string> {
|
||||
const ethereumSignInData = this._getEthereumSignInData(msgParams);
|
||||
const finalMsgParams = { ...msgParams, siwe: ethereumSignInData };
|
||||
|
||||
return this._personalMessageManager.addUnapprovedMessageAsync(
|
||||
finalMsgParams,
|
||||
msgParams,
|
||||
req,
|
||||
);
|
||||
}
|
||||
@ -618,10 +614,6 @@ export default class SignController extends BaseControllerV2<
|
||||
}[messageId];
|
||||
}
|
||||
|
||||
private _getEthereumSignInData(messgeParams: PersonalMessageParams): any {
|
||||
return detectSIWE(messgeParams);
|
||||
}
|
||||
|
||||
private _requestApproval(
|
||||
msgParams: AbstractMessageParamsMetamask,
|
||||
type: string,
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { errorCodes } from 'eth-rpc-errors';
|
||||
import { detectSIWE } from '@metamask/controller-utils';
|
||||
import { MESSAGE_TYPE, ORIGIN_METAMASK } from '../../../shared/constants/app';
|
||||
import { TransactionStatus } from '../../../shared/constants/transaction';
|
||||
import { SECOND } from '../../../shared/constants/time';
|
||||
import { detectSIWE } from '../../../shared/modules/siwe';
|
||||
|
||||
import {
|
||||
MetaMetricsEventCategory,
|
||||
MetaMetricsEventName,
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { errorCodes } from 'eth-rpc-errors';
|
||||
import { detectSIWE } from '@metamask/controller-utils';
|
||||
import { MESSAGE_TYPE } from '../../../shared/constants/app';
|
||||
import {
|
||||
MetaMetricsEventName,
|
||||
MetaMetricsEventUiCustomization,
|
||||
} from '../../../shared/constants/metametrics';
|
||||
import { SECOND } from '../../../shared/constants/time';
|
||||
import { detectSIWE } from '../../../shared/modules/siwe';
|
||||
import createRPCMethodTrackingMiddleware from './createRPCMethodTrackingMiddleware';
|
||||
|
||||
const trackEvent = jest.fn();
|
||||
@ -56,7 +56,7 @@ function getNext(timeout = 500) {
|
||||
const waitForSeconds = async (seconds) =>
|
||||
await new Promise((resolve) => setTimeout(resolve, SECOND * seconds));
|
||||
|
||||
jest.mock('../../../shared/modules/siwe', () => ({
|
||||
jest.mock('@metamask/controller-utils', () => ({
|
||||
detectSIWE: jest.fn().mockImplementation(() => {
|
||||
return { isSIWEMessage: false };
|
||||
}),
|
||||
|
@ -307,7 +307,6 @@ export default class MetamaskController extends EventEmitter {
|
||||
this.preferencesController = new PreferencesController({
|
||||
initState: initState.PreferencesController,
|
||||
initLangCode: opts.initLangCode,
|
||||
openPopup: opts.openPopup,
|
||||
onInfuraIsBlocked: networkControllerMessenger.subscribe.bind(
|
||||
networkControllerMessenger,
|
||||
NetworkControllerEventTypes.InfuraIsBlocked,
|
||||
|
@ -20,6 +20,7 @@ const configurationPropertyNames = [
|
||||
'DISABLE_WEB_SOCKET_ENCRYPTION',
|
||||
'METAMASK_DEBUG',
|
||||
'SKIP_OTP_PAIRING_FLOW',
|
||||
'ENABLE_MV3',
|
||||
];
|
||||
|
||||
const productionConfigurationPropertyNames = [
|
||||
|
@ -52,7 +52,7 @@ const {
|
||||
} = require('./transforms/remove-fenced-code');
|
||||
|
||||
// map dist files to bag of needed native APIs against LM scuttling
|
||||
const scuttlingConfig = {
|
||||
const scuttlingConfigBase = {
|
||||
'sentry-install.js': {
|
||||
// globals sentry need to function
|
||||
window: '',
|
||||
@ -70,7 +70,6 @@ const scuttlingConfig = {
|
||||
Number: '',
|
||||
Request: '',
|
||||
Date: '',
|
||||
document: '',
|
||||
JSON: '',
|
||||
encodeURIComponent: '',
|
||||
crypto: '',
|
||||
@ -87,6 +86,16 @@ const scuttlingConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
const mv3ScuttlingConfig = { ...scuttlingConfigBase };
|
||||
|
||||
const standardScuttlingConfig = {
|
||||
...scuttlingConfigBase,
|
||||
'sentry-install.js': {
|
||||
...scuttlingConfigBase['sentry-install.js'],
|
||||
document: '',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the appropriate Infura project ID.
|
||||
*
|
||||
@ -932,9 +941,8 @@ function setupBundlerDefaults(
|
||||
|
||||
// Setup source maps
|
||||
setupSourcemaps(buildConfiguration, { buildTarget });
|
||||
|
||||
// Setup wrapping of code against scuttling (before sourcemaps generation)
|
||||
setupScuttlingWrapping(buildConfiguration, applyLavaMoat);
|
||||
setupScuttlingWrapping(buildConfiguration, applyLavaMoat, envVars);
|
||||
}
|
||||
}
|
||||
|
||||
@ -988,7 +996,11 @@ function setupMinification(buildConfiguration) {
|
||||
});
|
||||
}
|
||||
|
||||
function setupScuttlingWrapping(buildConfiguration, applyLavaMoat) {
|
||||
function setupScuttlingWrapping(buildConfiguration, applyLavaMoat, envVars) {
|
||||
const scuttlingConfig =
|
||||
envVars.ENABLE_MV3 === 'true'
|
||||
? mv3ScuttlingConfig
|
||||
: standardScuttlingConfig;
|
||||
const { events } = buildConfiguration;
|
||||
events.on('configurePipeline', ({ pipeline }) => {
|
||||
pipeline.get('scuttle').push(
|
||||
@ -1111,6 +1123,7 @@ async function getEnvironmentVariables({ buildTarget, buildType, version }) {
|
||||
ICON_NAMES: iconNames,
|
||||
MULTICHAIN: config.MULTICHAIN === '1',
|
||||
CONF: devMode ? config : {},
|
||||
ENABLE_MV3: config.ENABLE_MV3,
|
||||
IN_TEST: testing,
|
||||
INFURA_PROJECT_ID: getInfuraProjectId({
|
||||
buildType,
|
||||
|
@ -661,7 +661,7 @@
|
||||
"@metamask/address-book-controller": {
|
||||
"packages": {
|
||||
"@metamask/address-book-controller>@metamask/base-controller": true,
|
||||
"@metamask/controller-utils": true
|
||||
"@metamask/address-book-controller>@metamask/controller-utils": true
|
||||
}
|
||||
},
|
||||
"@metamask/address-book-controller>@metamask/base-controller": {
|
||||
@ -669,6 +669,21 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/address-book-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/announcement-controller": {
|
||||
"packages": {
|
||||
"@metamask/announcement-controller>@metamask/base-controller": true
|
||||
@ -680,6 +695,9 @@
|
||||
}
|
||||
},
|
||||
"@metamask/approval-controller": {
|
||||
"globals": {
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/approval-controller>nanoid": true,
|
||||
"@metamask/base-controller": true,
|
||||
@ -747,7 +765,7 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -791,7 +809,8 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/controller-utils>@metamask/utils": true,
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -799,23 +818,34 @@
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>isomorphic-fetch": {
|
||||
"@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"fetch.bind": true
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch>whatwg-fetch": true
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>isomorphic-fetch>whatwg-fetch": {
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser": {
|
||||
"globals": {
|
||||
"Blob": true,
|
||||
"FileReader": true,
|
||||
"FormData": true,
|
||||
"URLSearchParams.prototype.isPrototypeOf": true,
|
||||
"XMLHttpRequest": true,
|
||||
"define": true,
|
||||
"setTimeout": true
|
||||
"console.error": true,
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": {
|
||||
"globals": {
|
||||
"mode": true
|
||||
},
|
||||
"packages": {
|
||||
"browserify>buffer": true,
|
||||
"browserify>insert-module-globals>is-buffer": true
|
||||
}
|
||||
},
|
||||
"@metamask/controllers>nanoid": {
|
||||
@ -1171,8 +1201,8 @@
|
||||
"setInterval": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/gas-fee-controller>@metamask/base-controller": true,
|
||||
"@metamask/gas-fee-controller>@metamask/controller-utils": true,
|
||||
"eth-query": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true,
|
||||
@ -1184,6 +1214,21 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/gas-fee-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/jazzicon": {
|
||||
"globals": {
|
||||
"document.createElement": true,
|
||||
@ -1282,8 +1327,8 @@
|
||||
},
|
||||
"@metamask/message-manager": {
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/message-manager>@metamask/base-controller": true,
|
||||
"@metamask/message-manager>@metamask/controller-utils": true,
|
||||
"@metamask/message-manager>jsonschema": true,
|
||||
"browserify>buffer": true,
|
||||
"browserify>events": true,
|
||||
@ -1297,34 +1342,6 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/message-manager>@metamask/controller-utils>@metamask/utils": true,
|
||||
"@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>jsonschema": {
|
||||
"packages": {
|
||||
"browserify>url": true
|
||||
@ -1355,8 +1372,8 @@
|
||||
"console.error": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/permission-controller>@metamask/base-controller": true,
|
||||
"@metamask/permission-controller>@metamask/controller-utils": true,
|
||||
"@metamask/permission-controller>nanoid": true,
|
||||
"deep-freeze-strict": true,
|
||||
"eth-rpc-errors": true,
|
||||
@ -1369,34 +1386,6 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": true,
|
||||
"@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>nanoid": {
|
||||
"globals": {
|
||||
"crypto.getRandomValues": true
|
||||
@ -1408,8 +1397,8 @@
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/base-controller": true,
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>@metamask/controller-utils": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"@metamask/phishing-warning>eth-phishing-detect": true,
|
||||
"punycode": true
|
||||
}
|
||||
@ -1421,7 +1410,7 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -1429,6 +1418,25 @@
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-controller>isomorphic-fetch": {
|
||||
"globals": {
|
||||
"fetch.bind": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch>whatwg-fetch": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-controller>isomorphic-fetch>whatwg-fetch": {
|
||||
"globals": {
|
||||
"Blob": true,
|
||||
"FileReader": true,
|
||||
"FormData": true,
|
||||
"URLSearchParams.prototype.isPrototypeOf": true,
|
||||
"XMLHttpRequest": true,
|
||||
"define": true,
|
||||
"setTimeout": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-warning>eth-phishing-detect": {
|
||||
"packages": {
|
||||
"eslint>optionator>fast-levenshtein": true
|
||||
@ -1492,13 +1500,28 @@
|
||||
"@ethersproject/bignumber": true,
|
||||
"@ethersproject/providers": true,
|
||||
"@metamask/base-controller": true,
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"@metamask/smart-transactions-controller>@metamask/controller-utils": true,
|
||||
"@metamask/smart-transactions-controller>bignumber.js": true,
|
||||
"fast-json-patch": true,
|
||||
"lodash": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller>@metamask/controllers>nanoid": {
|
||||
"globals": {
|
||||
"crypto.getRandomValues": true
|
||||
@ -1770,24 +1793,6 @@
|
||||
"define": true
|
||||
}
|
||||
},
|
||||
"@spruceid/siwe-parser": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@spruceid/siwe-parser>apg-js": true
|
||||
}
|
||||
},
|
||||
"@spruceid/siwe-parser>apg-js": {
|
||||
"globals": {
|
||||
"mode": true
|
||||
},
|
||||
"packages": {
|
||||
"browserify>buffer": true,
|
||||
"browserify>insert-module-globals>is-buffer": true
|
||||
}
|
||||
},
|
||||
"@storybook/api>regenerator-runtime": {
|
||||
"globals": {
|
||||
"regeneratorRuntime": "write"
|
||||
|
@ -661,7 +661,7 @@
|
||||
"@metamask/address-book-controller": {
|
||||
"packages": {
|
||||
"@metamask/address-book-controller>@metamask/base-controller": true,
|
||||
"@metamask/controller-utils": true
|
||||
"@metamask/address-book-controller>@metamask/controller-utils": true
|
||||
}
|
||||
},
|
||||
"@metamask/address-book-controller>@metamask/base-controller": {
|
||||
@ -669,6 +669,21 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/address-book-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/announcement-controller": {
|
||||
"packages": {
|
||||
"@metamask/announcement-controller>@metamask/base-controller": true
|
||||
@ -680,6 +695,9 @@
|
||||
}
|
||||
},
|
||||
"@metamask/approval-controller": {
|
||||
"globals": {
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/approval-controller>nanoid": true,
|
||||
"@metamask/base-controller": true,
|
||||
@ -747,7 +765,7 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -791,7 +809,8 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/controller-utils>@metamask/utils": true,
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -799,23 +818,34 @@
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>isomorphic-fetch": {
|
||||
"@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"fetch.bind": true
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch>whatwg-fetch": true
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>isomorphic-fetch>whatwg-fetch": {
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser": {
|
||||
"globals": {
|
||||
"Blob": true,
|
||||
"FileReader": true,
|
||||
"FormData": true,
|
||||
"URLSearchParams.prototype.isPrototypeOf": true,
|
||||
"XMLHttpRequest": true,
|
||||
"define": true,
|
||||
"setTimeout": true
|
||||
"console.error": true,
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": {
|
||||
"globals": {
|
||||
"mode": true
|
||||
},
|
||||
"packages": {
|
||||
"browserify>buffer": true,
|
||||
"browserify>insert-module-globals>is-buffer": true
|
||||
}
|
||||
},
|
||||
"@metamask/controllers>nanoid": {
|
||||
@ -1243,8 +1273,8 @@
|
||||
"setInterval": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/gas-fee-controller>@metamask/base-controller": true,
|
||||
"@metamask/gas-fee-controller>@metamask/controller-utils": true,
|
||||
"eth-query": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true,
|
||||
@ -1256,6 +1286,21 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/gas-fee-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/jazzicon": {
|
||||
"globals": {
|
||||
"document.createElement": true,
|
||||
@ -1354,8 +1399,8 @@
|
||||
},
|
||||
"@metamask/message-manager": {
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/message-manager>@metamask/base-controller": true,
|
||||
"@metamask/message-manager>@metamask/controller-utils": true,
|
||||
"@metamask/message-manager>jsonschema": true,
|
||||
"browserify>buffer": true,
|
||||
"browserify>events": true,
|
||||
@ -1369,34 +1414,6 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/message-manager>@metamask/controller-utils>@metamask/utils": true,
|
||||
"@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>jsonschema": {
|
||||
"packages": {
|
||||
"browserify>url": true
|
||||
@ -1404,8 +1421,8 @@
|
||||
},
|
||||
"@metamask/notification-controller": {
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/notification-controller>@metamask/base-controller": true,
|
||||
"@metamask/notification-controller>@metamask/controller-utils": true,
|
||||
"@metamask/notification-controller>nanoid": true
|
||||
}
|
||||
},
|
||||
@ -1414,6 +1431,21 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/notification-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/notification-controller>nanoid": {
|
||||
"globals": {
|
||||
"crypto.getRandomValues": true
|
||||
@ -1439,8 +1471,8 @@
|
||||
"console.error": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/permission-controller>@metamask/base-controller": true,
|
||||
"@metamask/permission-controller>@metamask/controller-utils": true,
|
||||
"@metamask/permission-controller>nanoid": true,
|
||||
"deep-freeze-strict": true,
|
||||
"eth-rpc-errors": true,
|
||||
@ -1453,34 +1485,6 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": true,
|
||||
"@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>nanoid": {
|
||||
"globals": {
|
||||
"crypto.getRandomValues": true
|
||||
@ -1492,8 +1496,8 @@
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/base-controller": true,
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>@metamask/controller-utils": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"@metamask/phishing-warning>eth-phishing-detect": true,
|
||||
"punycode": true
|
||||
}
|
||||
@ -1505,7 +1509,7 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -1513,6 +1517,25 @@
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-controller>isomorphic-fetch": {
|
||||
"globals": {
|
||||
"fetch.bind": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch>whatwg-fetch": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-controller>isomorphic-fetch>whatwg-fetch": {
|
||||
"globals": {
|
||||
"Blob": true,
|
||||
"FileReader": true,
|
||||
"FormData": true,
|
||||
"URLSearchParams.prototype.isPrototypeOf": true,
|
||||
"XMLHttpRequest": true,
|
||||
"define": true,
|
||||
"setTimeout": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-warning>eth-phishing-detect": {
|
||||
"packages": {
|
||||
"eslint>optionator>fast-levenshtein": true
|
||||
@ -1665,13 +1688,28 @@
|
||||
"@ethersproject/bignumber": true,
|
||||
"@ethersproject/providers": true,
|
||||
"@metamask/base-controller": true,
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"@metamask/smart-transactions-controller>@metamask/controller-utils": true,
|
||||
"@metamask/smart-transactions-controller>bignumber.js": true,
|
||||
"fast-json-patch": true,
|
||||
"lodash": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller>@metamask/controllers>nanoid": {
|
||||
"globals": {
|
||||
"crypto.getRandomValues": true
|
||||
@ -2183,24 +2221,6 @@
|
||||
"define": true
|
||||
}
|
||||
},
|
||||
"@spruceid/siwe-parser": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@spruceid/siwe-parser>apg-js": true
|
||||
}
|
||||
},
|
||||
"@spruceid/siwe-parser>apg-js": {
|
||||
"globals": {
|
||||
"mode": true
|
||||
},
|
||||
"packages": {
|
||||
"browserify>buffer": true,
|
||||
"browserify>insert-module-globals>is-buffer": true
|
||||
}
|
||||
},
|
||||
"@storybook/api>regenerator-runtime": {
|
||||
"globals": {
|
||||
"regeneratorRuntime": "write"
|
||||
|
@ -661,7 +661,7 @@
|
||||
"@metamask/address-book-controller": {
|
||||
"packages": {
|
||||
"@metamask/address-book-controller>@metamask/base-controller": true,
|
||||
"@metamask/controller-utils": true
|
||||
"@metamask/address-book-controller>@metamask/controller-utils": true
|
||||
}
|
||||
},
|
||||
"@metamask/address-book-controller>@metamask/base-controller": {
|
||||
@ -669,6 +669,21 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/address-book-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/announcement-controller": {
|
||||
"packages": {
|
||||
"@metamask/announcement-controller>@metamask/base-controller": true
|
||||
@ -680,6 +695,9 @@
|
||||
}
|
||||
},
|
||||
"@metamask/approval-controller": {
|
||||
"globals": {
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/approval-controller>nanoid": true,
|
||||
"@metamask/base-controller": true,
|
||||
@ -747,7 +765,7 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -791,7 +809,8 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/controller-utils>@metamask/utils": true,
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -799,23 +818,34 @@
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>isomorphic-fetch": {
|
||||
"@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"fetch.bind": true
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch>whatwg-fetch": true
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>isomorphic-fetch>whatwg-fetch": {
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser": {
|
||||
"globals": {
|
||||
"Blob": true,
|
||||
"FileReader": true,
|
||||
"FormData": true,
|
||||
"URLSearchParams.prototype.isPrototypeOf": true,
|
||||
"XMLHttpRequest": true,
|
||||
"define": true,
|
||||
"setTimeout": true
|
||||
"console.error": true,
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": {
|
||||
"globals": {
|
||||
"mode": true
|
||||
},
|
||||
"packages": {
|
||||
"browserify>buffer": true,
|
||||
"browserify>insert-module-globals>is-buffer": true
|
||||
}
|
||||
},
|
||||
"@metamask/controllers>nanoid": {
|
||||
@ -1243,8 +1273,8 @@
|
||||
"setInterval": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/gas-fee-controller>@metamask/base-controller": true,
|
||||
"@metamask/gas-fee-controller>@metamask/controller-utils": true,
|
||||
"eth-query": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true,
|
||||
@ -1256,6 +1286,21 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/gas-fee-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/jazzicon": {
|
||||
"globals": {
|
||||
"document.createElement": true,
|
||||
@ -1354,8 +1399,8 @@
|
||||
},
|
||||
"@metamask/message-manager": {
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/message-manager>@metamask/base-controller": true,
|
||||
"@metamask/message-manager>@metamask/controller-utils": true,
|
||||
"@metamask/message-manager>jsonschema": true,
|
||||
"browserify>buffer": true,
|
||||
"browserify>events": true,
|
||||
@ -1369,34 +1414,6 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/message-manager>@metamask/controller-utils>@metamask/utils": true,
|
||||
"@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>jsonschema": {
|
||||
"packages": {
|
||||
"browserify>url": true
|
||||
@ -1404,8 +1421,8 @@
|
||||
},
|
||||
"@metamask/notification-controller": {
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/notification-controller>@metamask/base-controller": true,
|
||||
"@metamask/notification-controller>@metamask/controller-utils": true,
|
||||
"@metamask/notification-controller>nanoid": true
|
||||
}
|
||||
},
|
||||
@ -1414,6 +1431,21 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/notification-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/notification-controller>nanoid": {
|
||||
"globals": {
|
||||
"crypto.getRandomValues": true
|
||||
@ -1439,8 +1471,8 @@
|
||||
"console.error": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/permission-controller>@metamask/base-controller": true,
|
||||
"@metamask/permission-controller>@metamask/controller-utils": true,
|
||||
"@metamask/permission-controller>nanoid": true,
|
||||
"deep-freeze-strict": true,
|
||||
"eth-rpc-errors": true,
|
||||
@ -1453,34 +1485,6 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": true,
|
||||
"@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>nanoid": {
|
||||
"globals": {
|
||||
"crypto.getRandomValues": true
|
||||
@ -1492,8 +1496,8 @@
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/base-controller": true,
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>@metamask/controller-utils": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"@metamask/phishing-warning>eth-phishing-detect": true,
|
||||
"punycode": true
|
||||
}
|
||||
@ -1505,7 +1509,7 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -1513,6 +1517,25 @@
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-controller>isomorphic-fetch": {
|
||||
"globals": {
|
||||
"fetch.bind": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch>whatwg-fetch": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-controller>isomorphic-fetch>whatwg-fetch": {
|
||||
"globals": {
|
||||
"Blob": true,
|
||||
"FileReader": true,
|
||||
"FormData": true,
|
||||
"URLSearchParams.prototype.isPrototypeOf": true,
|
||||
"XMLHttpRequest": true,
|
||||
"define": true,
|
||||
"setTimeout": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-warning>eth-phishing-detect": {
|
||||
"packages": {
|
||||
"eslint>optionator>fast-levenshtein": true
|
||||
@ -1665,13 +1688,28 @@
|
||||
"@ethersproject/bignumber": true,
|
||||
"@ethersproject/providers": true,
|
||||
"@metamask/base-controller": true,
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"@metamask/smart-transactions-controller>@metamask/controller-utils": true,
|
||||
"@metamask/smart-transactions-controller>bignumber.js": true,
|
||||
"fast-json-patch": true,
|
||||
"lodash": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller>@metamask/controllers>nanoid": {
|
||||
"globals": {
|
||||
"crypto.getRandomValues": true
|
||||
@ -2183,24 +2221,6 @@
|
||||
"define": true
|
||||
}
|
||||
},
|
||||
"@spruceid/siwe-parser": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@spruceid/siwe-parser>apg-js": true
|
||||
}
|
||||
},
|
||||
"@spruceid/siwe-parser>apg-js": {
|
||||
"globals": {
|
||||
"mode": true
|
||||
},
|
||||
"packages": {
|
||||
"browserify>buffer": true,
|
||||
"browserify>insert-module-globals>is-buffer": true
|
||||
}
|
||||
},
|
||||
"@storybook/api>regenerator-runtime": {
|
||||
"globals": {
|
||||
"regeneratorRuntime": "write"
|
||||
|
@ -661,7 +661,7 @@
|
||||
"@metamask/address-book-controller": {
|
||||
"packages": {
|
||||
"@metamask/address-book-controller>@metamask/base-controller": true,
|
||||
"@metamask/controller-utils": true
|
||||
"@metamask/address-book-controller>@metamask/controller-utils": true
|
||||
}
|
||||
},
|
||||
"@metamask/address-book-controller>@metamask/base-controller": {
|
||||
@ -669,6 +669,21 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/address-book-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/announcement-controller": {
|
||||
"packages": {
|
||||
"@metamask/announcement-controller>@metamask/base-controller": true
|
||||
@ -680,6 +695,9 @@
|
||||
}
|
||||
},
|
||||
"@metamask/approval-controller": {
|
||||
"globals": {
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/approval-controller>nanoid": true,
|
||||
"@metamask/base-controller": true,
|
||||
@ -747,7 +765,7 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -791,7 +809,8 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/controller-utils>@metamask/utils": true,
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -799,23 +818,34 @@
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>isomorphic-fetch": {
|
||||
"@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"fetch.bind": true
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch>whatwg-fetch": true
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>isomorphic-fetch>whatwg-fetch": {
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser": {
|
||||
"globals": {
|
||||
"Blob": true,
|
||||
"FileReader": true,
|
||||
"FormData": true,
|
||||
"URLSearchParams.prototype.isPrototypeOf": true,
|
||||
"XMLHttpRequest": true,
|
||||
"define": true,
|
||||
"setTimeout": true
|
||||
"console.error": true,
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true
|
||||
}
|
||||
},
|
||||
"@metamask/controller-utils>@spruceid/siwe-parser>apg-js": {
|
||||
"globals": {
|
||||
"mode": true
|
||||
},
|
||||
"packages": {
|
||||
"browserify>buffer": true,
|
||||
"browserify>insert-module-globals>is-buffer": true
|
||||
}
|
||||
},
|
||||
"@metamask/controllers>nanoid": {
|
||||
@ -1171,8 +1201,8 @@
|
||||
"setInterval": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/gas-fee-controller>@metamask/base-controller": true,
|
||||
"@metamask/gas-fee-controller>@metamask/controller-utils": true,
|
||||
"eth-query": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true,
|
||||
@ -1184,6 +1214,21 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/gas-fee-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/jazzicon": {
|
||||
"globals": {
|
||||
"document.createElement": true,
|
||||
@ -1282,8 +1327,8 @@
|
||||
},
|
||||
"@metamask/message-manager": {
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/message-manager>@metamask/base-controller": true,
|
||||
"@metamask/message-manager>@metamask/controller-utils": true,
|
||||
"@metamask/message-manager>jsonschema": true,
|
||||
"browserify>buffer": true,
|
||||
"browserify>events": true,
|
||||
@ -1297,34 +1342,6 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/message-manager>@metamask/controller-utils>@metamask/utils": true,
|
||||
"@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/message-manager>jsonschema": {
|
||||
"packages": {
|
||||
"browserify>url": true
|
||||
@ -1355,8 +1372,8 @@
|
||||
"console.error": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/permission-controller>@metamask/base-controller": true,
|
||||
"@metamask/permission-controller>@metamask/controller-utils": true,
|
||||
"@metamask/permission-controller>nanoid": true,
|
||||
"deep-freeze-strict": true,
|
||||
"eth-rpc-errors": true,
|
||||
@ -1369,34 +1386,6 @@
|
||||
"immer": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": true,
|
||||
"@spruceid/siwe-parser": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": {
|
||||
"globals": {
|
||||
"TextDecoder": true,
|
||||
"TextEncoder": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/utils>superstruct": true,
|
||||
"browserify>buffer": true,
|
||||
"nock>debug": true,
|
||||
"semver": true
|
||||
}
|
||||
},
|
||||
"@metamask/permission-controller>nanoid": {
|
||||
"globals": {
|
||||
"crypto.getRandomValues": true
|
||||
@ -1408,8 +1397,8 @@
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/base-controller": true,
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>@metamask/controller-utils": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"@metamask/phishing-warning>eth-phishing-detect": true,
|
||||
"punycode": true
|
||||
}
|
||||
@ -1421,7 +1410,7 @@
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
@ -1429,6 +1418,25 @@
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-controller>isomorphic-fetch": {
|
||||
"globals": {
|
||||
"fetch.bind": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch>whatwg-fetch": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-controller>isomorphic-fetch>whatwg-fetch": {
|
||||
"globals": {
|
||||
"Blob": true,
|
||||
"FileReader": true,
|
||||
"FormData": true,
|
||||
"URLSearchParams.prototype.isPrototypeOf": true,
|
||||
"XMLHttpRequest": true,
|
||||
"define": true,
|
||||
"setTimeout": true
|
||||
}
|
||||
},
|
||||
"@metamask/phishing-warning>eth-phishing-detect": {
|
||||
"packages": {
|
||||
"eslint>optionator>fast-levenshtein": true
|
||||
@ -1492,13 +1500,28 @@
|
||||
"@ethersproject/bignumber": true,
|
||||
"@ethersproject/providers": true,
|
||||
"@metamask/base-controller": true,
|
||||
"@metamask/controller-utils": true,
|
||||
"@metamask/controller-utils>isomorphic-fetch": true,
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"@metamask/smart-transactions-controller>@metamask/controller-utils": true,
|
||||
"@metamask/smart-transactions-controller>bignumber.js": true,
|
||||
"fast-json-patch": true,
|
||||
"lodash": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller>@metamask/controller-utils": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"fetch": true,
|
||||
"setTimeout": true
|
||||
},
|
||||
"packages": {
|
||||
"@metamask/phishing-controller>isomorphic-fetch": true,
|
||||
"browserify>buffer": true,
|
||||
"eslint>fast-deep-equal": true,
|
||||
"eth-ens-namehash": true,
|
||||
"ethereumjs-util": true,
|
||||
"ethjs>ethjs-unit": true
|
||||
}
|
||||
},
|
||||
"@metamask/smart-transactions-controller>@metamask/controllers>nanoid": {
|
||||
"globals": {
|
||||
"crypto.getRandomValues": true
|
||||
@ -1770,24 +1793,6 @@
|
||||
"define": true
|
||||
}
|
||||
},
|
||||
"@spruceid/siwe-parser": {
|
||||
"globals": {
|
||||
"console.error": true,
|
||||
"console.log": true
|
||||
},
|
||||
"packages": {
|
||||
"@spruceid/siwe-parser>apg-js": true
|
||||
}
|
||||
},
|
||||
"@spruceid/siwe-parser>apg-js": {
|
||||
"globals": {
|
||||
"mode": true
|
||||
},
|
||||
"packages": {
|
||||
"browserify>buffer": true,
|
||||
"browserify>insert-module-globals>is-buffer": true
|
||||
}
|
||||
},
|
||||
"@storybook/api>regenerator-runtime": {
|
||||
"globals": {
|
||||
"regeneratorRuntime": "write"
|
||||
|
@ -231,7 +231,7 @@
|
||||
"@metamask/assets-controllers": "^4.0.1",
|
||||
"@metamask/base-controller": "^1.0.0",
|
||||
"@metamask/contract-metadata": "^2.3.1",
|
||||
"@metamask/controller-utils": "^1.0.0",
|
||||
"@metamask/controller-utils": "^3.1.0",
|
||||
"@metamask/design-tokens": "^1.9.0",
|
||||
"@metamask/desktop": "^0.3.0",
|
||||
"@metamask/eth-json-rpc-infura": "^8.0.0",
|
||||
@ -245,7 +245,7 @@
|
||||
"@metamask/jazzicon": "^2.0.0",
|
||||
"@metamask/key-tree": "^7.0.0",
|
||||
"@metamask/logo": "^3.1.1",
|
||||
"@metamask/message-manager": "^2.0.0",
|
||||
"@metamask/message-manager": "^2.1.0",
|
||||
"@metamask/metamask-eth-abis": "^3.0.0",
|
||||
"@metamask/notification-controller": "^1.0.0",
|
||||
"@metamask/obs-store": "^8.0.0",
|
||||
@ -273,7 +273,6 @@
|
||||
"@sentry/integrations": "^6.0.0",
|
||||
"@sentry/types": "^6.0.1",
|
||||
"@sentry/utils": "^6.0.1",
|
||||
"@spruceid/siwe-parser": "^1.1.3",
|
||||
"@truffle/codec": "^0.14.12",
|
||||
"@truffle/decoder": "^5.3.5",
|
||||
"@zxing/browser": "^0.0.10",
|
||||
|
@ -1,55 +1,3 @@
|
||||
import { ParsedMessage } from '@spruceid/siwe-parser';
|
||||
import log from 'loglevel';
|
||||
import { stripHexPrefix } from './hexstring-utils';
|
||||
|
||||
const msgHexToText = (hex) => {
|
||||
try {
|
||||
const stripped = stripHexPrefix(hex);
|
||||
const buff = Buffer.from(stripped, 'hex');
|
||||
return buff.length === 32 ? hex : buff.toString('utf8');
|
||||
} catch (e) {
|
||||
log.error(e);
|
||||
return hex;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A locally defined object used to provide data to identify a Sign-In With Ethereum (SIWE)(EIP-4361) message and provide the parsed message
|
||||
*
|
||||
* @typedef localSIWEObject
|
||||
* @param {boolean} isSIWEMessage - Does the intercepted message conform to the SIWE specification?
|
||||
* @param {ParsedMessage} parsedMessage - The data parsed out of the message
|
||||
*/
|
||||
|
||||
/**
|
||||
* This function intercepts a sign message, detects if it's a
|
||||
* Sign-In With Ethereum (SIWE)(EIP-4361) message, and returns an object with
|
||||
* relevant SIWE data.
|
||||
*
|
||||
* {@see {@link https://eips.ethereum.org/EIPS/eip-4361}}
|
||||
*
|
||||
* @param {object} msgParams - The params of the message to sign
|
||||
* @returns {localSIWEObject}
|
||||
*/
|
||||
export const detectSIWE = (msgParams) => {
|
||||
try {
|
||||
const { data } = msgParams;
|
||||
const message = msgHexToText(data);
|
||||
const parsedMessage = new ParsedMessage(message);
|
||||
|
||||
return {
|
||||
isSIWEMessage: true,
|
||||
parsedMessage,
|
||||
};
|
||||
} catch (error) {
|
||||
// ignore error, it's not a valid SIWE message
|
||||
return {
|
||||
isSIWEMessage: false,
|
||||
parsedMessage: null,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Takes in a parsed Sign-In with Ethereum Message (EIP-4361)
|
||||
* and generates an array of label-value pairs
|
||||
|
@ -37,7 +37,11 @@ import Button from '../../ui/button';
|
||||
import SearchIcon from '../../ui/icon/search-icon';
|
||||
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
|
||||
import { IconColor } from '../../../helpers/constants/design-system';
|
||||
import { Icon, ICON_NAMES, ICON_SIZES } from '../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../component-library/icon/deprecated';
|
||||
import KeyRingLabel from './keyring-label';
|
||||
|
||||
export function AccountMenuItem(props) {
|
||||
|
@ -36,7 +36,12 @@ import { FEATURED_RPCS } from '../../../../shared/constants/network';
|
||||
import { ADD_NETWORK_ROUTE } from '../../../helpers/constants/routes';
|
||||
import { getEnvironmentType } from '../../../../app/scripts/lib/util';
|
||||
import ZENDESK_URLS from '../../../helpers/constants/zendesk-url';
|
||||
import { Icon, ICON_NAMES, ICON_SIZES, Text } from '../../component-library';
|
||||
import { Text } from '../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../component-library/icon/deprecated';
|
||||
import { MetaMetricsNetworkEventSource } from '../../../../shared/constants/metametrics';
|
||||
|
||||
const AddNetwork = () => {
|
||||
|
@ -10,7 +10,6 @@ const BSC_IMAGE_URL = './images/bsc-filled.svg';
|
||||
|
||||
export default {
|
||||
title: 'Components/App/AddNetwork',
|
||||
|
||||
argTypes: {
|
||||
onBackClick: {
|
||||
action: 'onBackClick',
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Icon, ICON_NAMES } from '../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
import ApproveContentCard from './approve-content-card';
|
||||
|
||||
export default {
|
||||
|
@ -16,7 +16,11 @@ import { INVALID_ASSET_TYPE } from '../../../helpers/constants/error-keys';
|
||||
import { MetaMetricsEventCategory } from '../../../../shared/constants/metametrics';
|
||||
import { AssetType } from '../../../../shared/constants/transaction';
|
||||
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
||||
import { Icon, ICON_NAMES, ICON_SIZES } from '../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../component-library/icon/deprecated';
|
||||
import Box from '../../ui/box/box';
|
||||
|
||||
const AssetListItem = ({
|
||||
|
@ -14,7 +14,11 @@ import {
|
||||
import { BETA_BUGS_URL } from '../../../helpers/constants/beta';
|
||||
|
||||
import { hideBetaHeader } from '../../../store/actions';
|
||||
import { ButtonIcon, ICON_NAMES, ICON_SIZES } from '../../component-library';
|
||||
import { ButtonIcon } from '../../component-library';
|
||||
import {
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../component-library/icon/deprecated';
|
||||
|
||||
const BetaHeader = () => {
|
||||
const t = useI18nContext();
|
||||
|
@ -10,7 +10,7 @@ import Identicon from '../../../ui/identicon';
|
||||
import { shortenAddress } from '../../../../helpers/utils/util';
|
||||
import AccountMismatchWarning from '../../../ui/account-mismatch-warning/account-mismatch-warning.component';
|
||||
import { useI18nContext } from '../../../../hooks/useI18nContext';
|
||||
import { Icon, ICON_NAMES } from '../../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../../component-library/icon/deprecated';
|
||||
|
||||
export default function ConfirmPageContainerHeader({
|
||||
onEdit,
|
||||
|
@ -14,7 +14,12 @@ import {
|
||||
AlignItems,
|
||||
IconColor,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import { Text, Icon, ICON_NAMES, ICON_SIZES } from '../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../component-library/icon/deprecated';
|
||||
import { Text } from '../../component-library';
|
||||
|
||||
const ConfirmationWarningModal = ({ onSubmit, onCancel }) => {
|
||||
const t = useI18nContext();
|
||||
|
@ -1,7 +1,8 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { useRef } from 'react';
|
||||
import { Menu } from '../../../ui/menu';
|
||||
import { ButtonIcon, ICON_NAMES } from '../../../component-library';
|
||||
import { ICON_NAMES } from '../../../component-library/icon/deprecated';
|
||||
import { ButtonIcon } from '../../../component-library';
|
||||
import { useI18nContext } from '../../../../hooks/useI18nContext';
|
||||
|
||||
const ConnectedAccountsListOptions = ({
|
||||
|
@ -1,6 +1,6 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { PureComponent } from 'react';
|
||||
import { ICON_NAMES } from '../../component-library';
|
||||
import { ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
import { MenuItem } from '../../ui/menu';
|
||||
import ConnectedAccountsListItem from './connected-accounts-list-item';
|
||||
import ConnectedAccountsListOptions from './connected-accounts-list-options';
|
||||
|
@ -8,7 +8,11 @@ import {
|
||||
DISPLAY,
|
||||
TypographyVariant,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import { Icon, ICON_NAMES, ICON_SIZES } from '../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../component-library/icon/deprecated';
|
||||
|
||||
export const CustomSpendingCapTooltip = ({
|
||||
tooltipContentText,
|
||||
|
@ -7,7 +7,8 @@ import { I18nContext } from '../../../contexts/i18n';
|
||||
import Box from '../../ui/box';
|
||||
import FormField from '../../ui/form-field';
|
||||
import Typography from '../../ui/typography';
|
||||
import { ButtonLink, Icon, ICON_NAMES } from '../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
import { ButtonLink } from '../../component-library';
|
||||
import {
|
||||
AlignItems,
|
||||
DISPLAY,
|
||||
|
@ -32,12 +32,8 @@ import {
|
||||
ADD_POPULAR_CUSTOM_NETWORK,
|
||||
ADVANCED_ROUTE,
|
||||
} from '../../../helpers/constants/routes';
|
||||
import {
|
||||
Icon,
|
||||
// ButtonIcon,
|
||||
ICON_NAMES,
|
||||
// ICON_SIZES,
|
||||
} from '../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
|
||||
import { Dropdown, DropdownMenuItem } from './dropdown';
|
||||
|
||||
// classes from nodes of the toggle element.
|
||||
|
@ -14,7 +14,11 @@ import { useTransactionEventFragment } from '../../../hooks/useTransactionEventF
|
||||
import { useTransactionModalContext } from '../../../contexts/transaction-modal';
|
||||
import InfoTooltip from '../../ui/info-tooltip/info-tooltip';
|
||||
import Typography from '../../ui/typography/typography';
|
||||
import { Icon, ICON_NAMES, ICON_SIZES } from '../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../component-library/icon/deprecated';
|
||||
|
||||
export default function EditGasFeeButton({ userAcknowledgedGasMissing }) {
|
||||
const t = useI18nContext();
|
||||
|
@ -14,7 +14,11 @@ import {
|
||||
Color,
|
||||
} from '../../../../helpers/constants/design-system';
|
||||
import { useCopyToClipboard } from '../../../../hooks/useCopyToClipboard';
|
||||
import { Icon, ICON_NAMES, ICON_SIZES } from '../../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../../component-library/icon/deprecated';
|
||||
|
||||
export const Copyable = ({ text }) => {
|
||||
const [copied, handleCopy] = useCopyToClipboard();
|
||||
|
@ -20,12 +20,11 @@ import {
|
||||
getSnapName,
|
||||
removeSnapIdPrefix,
|
||||
} from '../../../../helpers/utils/util';
|
||||
import { Text, ButtonIcon } from '../../../component-library';
|
||||
import {
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
Text,
|
||||
ButtonIcon,
|
||||
} from '../../../component-library';
|
||||
} from '../../../component-library/icon/deprecated';
|
||||
import { getTargetSubjectMetadata } from '../../../../selectors';
|
||||
import SnapAvatar from '../snap-avatar';
|
||||
|
||||
|
@ -15,11 +15,13 @@ import {
|
||||
AvatarFavicon,
|
||||
BadgeWrapper,
|
||||
BadgeWrapperPosition,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
AvatarIcon,
|
||||
AvatarBase,
|
||||
} from '../../../component-library';
|
||||
import {
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../../component-library/icon/deprecated';
|
||||
import { getTargetSubjectMetadata } from '../../../../selectors';
|
||||
|
||||
const SnapAvatar = ({ snapId, className }) => {
|
||||
|
@ -16,7 +16,7 @@ import {
|
||||
} from '../../../../helpers/constants/design-system';
|
||||
import Button from '../../../ui/button';
|
||||
import Box from '../../../ui/box/box';
|
||||
import { Icon, ICON_NAMES } from '../../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../../component-library/icon/deprecated';
|
||||
|
||||
export default function SnapContentFooter({ snapName, snapId }) {
|
||||
const t = useI18nContext();
|
||||
|
@ -12,12 +12,11 @@ import {
|
||||
TextColor,
|
||||
} from '../../../../helpers/constants/design-system';
|
||||
import Box from '../../../ui/box';
|
||||
import { AvatarIcon, Text } from '../../../component-library';
|
||||
import {
|
||||
AvatarIcon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
Text,
|
||||
} from '../../../component-library';
|
||||
} from '../../../component-library/icon/deprecated';
|
||||
import {
|
||||
DelineatorType,
|
||||
getDelineatorTitle,
|
||||
|
@ -15,7 +15,8 @@ import {
|
||||
} from '../../../../helpers/constants/design-system';
|
||||
import Popover from '../../../ui/popover';
|
||||
import Button from '../../../ui/button';
|
||||
import { AvatarIcon, ICON_NAMES, Text } from '../../../component-library';
|
||||
import { AvatarIcon, Text } from '../../../component-library';
|
||||
import { ICON_NAMES } from '../../../component-library/icon/deprecated';
|
||||
import Box from '../../../ui/box/box';
|
||||
|
||||
/**
|
||||
|
@ -9,24 +9,13 @@ export default function UpdateSnapPermissionList({
|
||||
approvedPermissions,
|
||||
revokedPermissions,
|
||||
newPermissions,
|
||||
targetSubjectMetadata,
|
||||
}) {
|
||||
const t = useI18nContext();
|
||||
|
||||
return (
|
||||
<Box paddingTop={1}>
|
||||
{getWeightedPermissions(t, newPermissions).map((permission, index) => {
|
||||
return (
|
||||
<PermissionCell
|
||||
title={permission.label}
|
||||
description={permission.description}
|
||||
weight={permission.weight}
|
||||
avatarIcon={permission.leftIcon}
|
||||
dateApproved={permission?.permissionValue?.date}
|
||||
key={`${permission.permissionName}-${index}`}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
{getWeightedPermissions(t, approvedPermissions).map(
|
||||
{getWeightedPermissions(t, newPermissions, targetSubjectMetadata).map(
|
||||
(permission, index) => {
|
||||
return (
|
||||
<PermissionCell
|
||||
@ -40,7 +29,23 @@ export default function UpdateSnapPermissionList({
|
||||
);
|
||||
},
|
||||
)}
|
||||
{getWeightedPermissions(t, revokedPermissions).map(
|
||||
{getWeightedPermissions(
|
||||
t,
|
||||
approvedPermissions,
|
||||
targetSubjectMetadata,
|
||||
).map((permission, index) => {
|
||||
return (
|
||||
<PermissionCell
|
||||
title={permission.label}
|
||||
description={permission.description}
|
||||
weight={permission.weight}
|
||||
avatarIcon={permission.leftIcon}
|
||||
dateApproved={permission?.permissionValue?.date}
|
||||
key={`${permission.permissionName}-${index}`}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
{getWeightedPermissions(t, revokedPermissions, targetSubjectMetadata).map(
|
||||
(permission, index) => {
|
||||
return (
|
||||
<PermissionCell
|
||||
@ -72,4 +77,5 @@ UpdateSnapPermissionList.propTypes = {
|
||||
* New permissions that are being requested
|
||||
*/
|
||||
newPermissions: PropTypes.object.isRequired,
|
||||
targetSubjectMetadata: PropTypes.object.isRequired,
|
||||
};
|
||||
|
@ -28,7 +28,7 @@ import {
|
||||
MetaMetricsEventName,
|
||||
} from '../../../../shared/constants/metametrics';
|
||||
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
||||
import { ICON_NAMES } from '../../component-library';
|
||||
import { ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
|
||||
export default function AccountOptionsMenu({ anchorElement, onClose }) {
|
||||
const t = useI18nContext();
|
||||
|
@ -14,7 +14,8 @@ import { CONNECTED_ACCOUNTS_ROUTE } from '../../../helpers/constants/routes';
|
||||
import { useI18nContext } from '../../../hooks/useI18nContext';
|
||||
import { getOriginOfCurrentTab } from '../../../selectors';
|
||||
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
||||
import { ButtonIcon, ICON_NAMES } from '../../component-library';
|
||||
import { ButtonIcon } from '../../component-library';
|
||||
import { ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
import { GlobalMenu } from '../../multichain/global-menu';
|
||||
import AccountOptionsMenu from './account-options-menu';
|
||||
|
||||
|
@ -25,7 +25,8 @@ import { useCopyToClipboard } from '../../../../hooks/useCopyToClipboard';
|
||||
import { getAddressBookEntry } from '../../../../selectors';
|
||||
import { TokenStandard } from '../../../../../shared/constants/transaction';
|
||||
import NftCollectionImage from '../../../ui/nft-collection-image/nft-collection-image';
|
||||
import { ButtonIcon, ICON_NAMES } from '../../../component-library';
|
||||
import { ButtonIcon } from '../../../component-library';
|
||||
import { ICON_NAMES } from '../../../component-library/icon/deprecated';
|
||||
|
||||
export default function ContractDetailsModal({
|
||||
onClose,
|
||||
|
@ -15,7 +15,11 @@ import Box from '../../../ui/box';
|
||||
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props';
|
||||
import { useI18nContext } from '../../../../hooks/useI18nContext';
|
||||
import ZENDESK_URLS from '../../../../helpers/constants/zendesk-url';
|
||||
import { ButtonIcon, ICON_NAMES, ICON_SIZES } from '../../../component-library';
|
||||
import { ButtonIcon } from '../../../component-library';
|
||||
import {
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../../component-library/icon/deprecated';
|
||||
|
||||
const CustomizeNonce = ({
|
||||
hideModal,
|
||||
|
@ -10,7 +10,11 @@ import {
|
||||
calcTokenAmount,
|
||||
toPrecisionWithoutTrailingZeros,
|
||||
} from '../../../../../shared/lib/transactions-controller-utils';
|
||||
import { ButtonIcon, ICON_SIZES, ICON_NAMES } from '../../../component-library';
|
||||
import { ButtonIcon } from '../../../component-library';
|
||||
import {
|
||||
ICON_SIZES,
|
||||
ICON_NAMES,
|
||||
} from '../../../component-library/icon/deprecated';
|
||||
|
||||
const MAX_UNSIGNED_256_INT = new BigNumber(2).pow(256).minus(1).toString(10);
|
||||
|
||||
|
@ -7,8 +7,8 @@ import {
|
||||
Button,
|
||||
BUTTON_TYPES,
|
||||
ButtonIcon,
|
||||
ICON_NAMES,
|
||||
} from '../../../component-library';
|
||||
import { ICON_NAMES } from '../../../component-library/icon/deprecated';
|
||||
import {
|
||||
AlignItems,
|
||||
DISPLAY,
|
||||
|
@ -1,7 +1,8 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Button from '../../../ui/button/button.component';
|
||||
import { ButtonIcon, ICON_NAMES } from '../../../component-library';
|
||||
import { ButtonIcon } from '../../../component-library';
|
||||
import { ICON_NAMES } from '../../../component-library/icon/deprecated';
|
||||
|
||||
export default class NewAccountModal extends Component {
|
||||
static contextTypes = {
|
||||
|
@ -1,7 +1,11 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Modal from '../../modal';
|
||||
import { Icon, ICON_NAMES, ICON_SIZES } from '../../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../../component-library/icon/deprecated';
|
||||
import { IconColor } from '../../../../helpers/constants/design-system';
|
||||
|
||||
export default class TransactionConfirmed extends PureComponent {
|
||||
|
@ -18,7 +18,11 @@ import {
|
||||
import Chip from '../../ui/chip/chip';
|
||||
import { useI18nContext } from '../../../hooks/useI18nContext';
|
||||
import { isNetworkLoading } from '../../../selectors';
|
||||
import { Icon, ICON_NAMES, ICON_SIZES } from '../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../component-library/icon/deprecated';
|
||||
|
||||
export default function NetworkDisplay({
|
||||
indicatorSize,
|
||||
|
@ -53,7 +53,8 @@ import {
|
||||
TokenStandard,
|
||||
} from '../../../../shared/constants/transaction';
|
||||
import NftDefaultImage from '../nft-default-image';
|
||||
import { ButtonIcon, ICON_NAMES } from '../../component-library';
|
||||
import { ButtonIcon } from '../../component-library';
|
||||
import { ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
import Tooltip from '../../ui/tooltip';
|
||||
import { decWEIToDecETH } from '../../../../shared/modules/conversion.utils';
|
||||
|
||||
|
@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
|
||||
|
||||
import { I18nContext } from '../../../contexts/i18n';
|
||||
import { Menu, MenuItem } from '../../ui/menu';
|
||||
import { ButtonIcon, ICON_NAMES } from '../../component-library';
|
||||
import { ButtonIcon } from '../../component-library';
|
||||
import { ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
import { Color } from '../../../helpers/constants/design-system';
|
||||
|
||||
const NftOptions = ({ onRemove, onViewOnOpensea }) => {
|
||||
|
@ -30,7 +30,7 @@ import { updateNftDropDownState } from '../../../store/actions';
|
||||
import { usePrevious } from '../../../hooks/usePrevious';
|
||||
import { getNftsDropdownState } from '../../../ducks/metamask/metamask';
|
||||
import { useI18nContext } from '../../../hooks/useI18nContext';
|
||||
import { Icon, ICON_NAMES } from '../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
import NftDefaultImage from '../nft-default-image';
|
||||
|
||||
const width =
|
||||
|
@ -11,13 +11,12 @@ import {
|
||||
TextColor,
|
||||
TextVariant,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import { AvatarIcon, Text } from '../../component-library';
|
||||
import {
|
||||
AvatarIcon,
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
Text,
|
||||
} from '../../component-library';
|
||||
} from '../../component-library/icon/deprecated';
|
||||
import { formatDate } from '../../../helpers/utils/util';
|
||||
import { useI18nContext } from '../../../hooks/useI18nContext';
|
||||
import Tooltip from '../../ui/tooltip';
|
||||
|
@ -5,27 +5,33 @@ import { useI18nContext } from '../../../hooks/useI18nContext';
|
||||
import PermissionCell from '../permission-cell';
|
||||
import Box from '../../ui/box';
|
||||
|
||||
export default function PermissionsConnectPermissionList({ permissions }) {
|
||||
export default function PermissionsConnectPermissionList({
|
||||
permissions,
|
||||
targetSubjectMetadata,
|
||||
}) {
|
||||
const t = useI18nContext();
|
||||
|
||||
return (
|
||||
<Box paddingTop={2} paddingBottom={2}>
|
||||
{getWeightedPermissions(t, permissions).map((permission, index) => {
|
||||
return (
|
||||
<PermissionCell
|
||||
title={permission.label}
|
||||
description={permission.description}
|
||||
weight={permission.weight}
|
||||
avatarIcon={permission.leftIcon}
|
||||
dateApproved={permission?.permissionValue?.date}
|
||||
key={`${permission.permissionName}-${index}`}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
{getWeightedPermissions(t, permissions, targetSubjectMetadata).map(
|
||||
(permission, index) => {
|
||||
return (
|
||||
<PermissionCell
|
||||
title={permission.label}
|
||||
description={permission.description}
|
||||
weight={permission.weight}
|
||||
avatarIcon={permission.leftIcon}
|
||||
dateApproved={permission?.permissionValue?.date}
|
||||
key={`${permission.permissionName}-${index}`}
|
||||
/>
|
||||
);
|
||||
},
|
||||
)}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
PermissionsConnectPermissionList.propTypes = {
|
||||
permissions: PropTypes.object.isRequired,
|
||||
targetSubjectMetadata: PropTypes.object.isRequired,
|
||||
};
|
||||
|
@ -16,7 +16,7 @@ import {
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import Identicon from '../../ui/identicon';
|
||||
import { shortenAddress } from '../../../helpers/utils/util';
|
||||
import { Icon, ICON_NAMES } from '../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
|
||||
const SetApproveForAllWarning = ({
|
||||
collectionName,
|
||||
|
@ -17,7 +17,7 @@ import {
|
||||
} from '../../../../helpers/constants/design-system';
|
||||
import Identicon from '../../../ui/identicon';
|
||||
import { shortenAddress } from '../../../../helpers/utils/util';
|
||||
import { Icon, ICON_NAMES } from '../../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../../component-library/icon/deprecated';
|
||||
|
||||
const SignatureRequestOriginalWarning = ({
|
||||
senderAddress,
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
JustifyContent,
|
||||
} from '../../../../helpers/constants/design-system';
|
||||
import Box from '../../../ui/box';
|
||||
import { Icon, ICON_NAMES } from '../../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../../component-library/icon/deprecated';
|
||||
|
||||
const SignatureRequestSIWEIcon = () => {
|
||||
return (
|
||||
|
@ -2,7 +2,11 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
|
||||
import { Icon, ICON_NAMES, ICON_SIZES } from '../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../component-library/icon/deprecated';
|
||||
|
||||
const TabBar = (props) => {
|
||||
const { tabs = [], onSelect, isActive } = props;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Icon, ICON_NAMES } from '../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
import TabBar from '.';
|
||||
|
||||
export default {
|
||||
|
@ -12,7 +12,11 @@ import {
|
||||
TRANSACTION_CANCEL_ATTEMPTED_EVENT,
|
||||
TRANSACTION_CANCEL_SUCCESS_EVENT,
|
||||
} from '../transaction-activity-log.constants';
|
||||
import { Icon, ICON_NAMES, ICON_SIZES } from '../../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
ICON_SIZES,
|
||||
} from '../../../component-library/icon/deprecated';
|
||||
import { Color } from '../../../../helpers/constants/design-system';
|
||||
|
||||
export const ACTIVITY_ICONS = {
|
||||
|
@ -4,7 +4,10 @@ import Tooltip from '../../../../../ui/tooltip/tooltip';
|
||||
import { I18nContext } from '../../../../../../contexts/i18n';
|
||||
|
||||
import { useCopyToClipboard } from '../../../../../../hooks/useCopyToClipboard';
|
||||
import { Icon, ICON_NAMES } from '../../../../../component-library';
|
||||
import {
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
} from '../../../../../component-library/icon/deprecated';
|
||||
import { IconColor } from '../../../../../../helpers/constants/design-system';
|
||||
|
||||
const CopyRawData = ({ data }) => {
|
||||
|
@ -10,7 +10,7 @@ import {
|
||||
|
||||
import Box from '../../ui/box/box';
|
||||
|
||||
import { Icon, ICON_NAMES } from '../icon';
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
import README from './README.mdx';
|
||||
import { AvatarBase } from './avatar-base';
|
||||
import { AVATAR_BASE_SIZES } from './avatar-base.constants';
|
||||
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
import { AvatarBase } from '../avatar-base';
|
||||
import Box from '../../ui/box/box';
|
||||
import { ICON_NAMES, Icon } from '../icon';
|
||||
import { ICON_NAMES, Icon } from '../icon/deprecated';
|
||||
import {
|
||||
BorderColor,
|
||||
Size,
|
||||
|
@ -14,7 +14,7 @@ import {
|
||||
|
||||
import Box from '../../ui/box/box';
|
||||
|
||||
import { Icon, ICON_NAMES } from '../icon';
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
import { AvatarBase } from '../avatar-base';
|
||||
|
||||
import { AVATAR_ICON_SIZES } from './avatar-icon.constants';
|
||||
|
@ -10,7 +10,7 @@ import {
|
||||
|
||||
import Box from '../../ui/box/box';
|
||||
|
||||
import { ICON_NAMES } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
|
||||
import README from './README.mdx';
|
||||
import { AvatarIcon, AVATAR_ICON_SIZES } from '.';
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import { ICON_NAMES } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import {
|
||||
BackgroundColor,
|
||||
IconColor,
|
||||
|
@ -113,7 +113,8 @@ import {
|
||||
BadgeWrapper,
|
||||
BadgeWrapperAnchorElementShape,
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
IconSize,
|
||||
IconName,
|
||||
Tag,
|
||||
} from '../../component-library';
|
||||
|
||||
@ -141,8 +142,8 @@ import {
|
||||
}
|
||||
>
|
||||
<Icon
|
||||
name={ICON_NAMES.GLOBAL}
|
||||
size={Size.XL}
|
||||
name={IconName.Global}
|
||||
size={IconSize.Xl}
|
||||
color={IconColor.iconAlternative}
|
||||
/>
|
||||
</BadgeWrapper>
|
||||
|
@ -19,7 +19,8 @@ import {
|
||||
AvatarNetwork,
|
||||
AvatarToken,
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
IconName,
|
||||
IconSize,
|
||||
Tag,
|
||||
} from '..';
|
||||
import {
|
||||
@ -165,8 +166,8 @@ export const Badge = () => (
|
||||
}
|
||||
>
|
||||
<Icon
|
||||
name={ICON_NAMES.GLOBAL}
|
||||
size={Size.XL}
|
||||
name={IconName.Global}
|
||||
size={IconSize.Xl}
|
||||
color={IconColor.iconAlternative}
|
||||
/>
|
||||
</BadgeWrapper>
|
||||
|
@ -2,7 +2,8 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
|
||||
import { BannerBase, Icon, ICON_NAMES } from '..';
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
import { BannerBase } from '..';
|
||||
|
||||
import {
|
||||
BackgroundColor,
|
||||
|
@ -7,7 +7,8 @@ import {
|
||||
Size,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import Box from '../../ui/box/box';
|
||||
import { ICON_NAMES, ButtonLink, ButtonPrimary } from '..';
|
||||
import { ButtonLink, ButtonPrimary } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import README from './README.mdx';
|
||||
import { BannerAlert, BANNER_ALERT_SEVERITIES } from '.';
|
||||
|
||||
|
@ -128,7 +128,8 @@ Use the `startAccessory` prop to add components such as icons or fox image to th
|
||||
|
||||
```jsx
|
||||
import { Size } from '../../../helpers/constants/design-system';
|
||||
import { BannerBase, Icon, ICON_NAMES } from '../../component-library';
|
||||
import { BannerBase } from '../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../component-library/icon/deprecated';
|
||||
|
||||
<BannerBase
|
||||
title="Start accessory demo"
|
||||
|
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
|
||||
import { ButtonIcon, ButtonLink, ICON_NAMES, Text } from '..';
|
||||
import { ButtonIcon, ButtonLink, Text } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
|
||||
import Box from '../../ui/box';
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
import { useState } from '@storybook/addons';
|
||||
import { Size } from '../../../helpers/constants/design-system';
|
||||
import { Icon, ICON_NAMES, ButtonLink, ButtonPrimary } from '..';
|
||||
import { ButtonLink, ButtonPrimary } from '..';
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
import { BannerBase } from './banner-base';
|
||||
import README from './README.mdx';
|
||||
|
||||
|
@ -4,7 +4,7 @@ import React from 'react';
|
||||
|
||||
import { renderWithUserEvent } from '../../../../test/lib/render-helpers';
|
||||
|
||||
import { Icon, ICON_NAMES } from '..';
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
import { BannerBase } from './banner-base';
|
||||
|
||||
describe('BannerBase', () => {
|
||||
|
@ -5,7 +5,8 @@ import {
|
||||
Size,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import Box from '../../ui/box/box';
|
||||
import { ButtonLink, ButtonPrimary, Icon, ICON_NAMES } from '..';
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
import { ButtonLink, ButtonPrimary } from '..';
|
||||
import README from './README.mdx';
|
||||
import { BannerTip, BannerTipLogoType } from '.';
|
||||
|
||||
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
|
||||
import Box from '../../ui/box';
|
||||
import { Icon, ICON_NAMES } from '../icon';
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
import { Text } from '../text';
|
||||
|
||||
import {
|
||||
|
@ -7,7 +7,8 @@ import {
|
||||
Size,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import Box from '../../ui/box/box';
|
||||
import { ICON_NAMES, TextDirection } from '..';
|
||||
import { TextDirection } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { BUTTON_BASE_SIZES } from './button-base.constants';
|
||||
import { ButtonBase } from './button-base';
|
||||
import README from './README.mdx';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable jest/require-top-level-describe */
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { ICON_NAMES } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { BUTTON_BASE_SIZES } from './button-base.constants';
|
||||
import { ButtonBase } from './button-base';
|
||||
|
||||
|
@ -13,7 +13,7 @@ import {
|
||||
} from '../../../helpers/constants/design-system';
|
||||
|
||||
import Box from '../../ui/box';
|
||||
import { Icon, ICON_NAMES } from '../icon';
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
|
||||
import { BUTTON_ICON_SIZES } from './button-icon.constants';
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
Size,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import Box from '../../ui/box/box';
|
||||
import { ICON_NAMES } from '../icon';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { BUTTON_ICON_SIZES } from './button-icon.constants';
|
||||
import { ButtonIcon } from './button-icon';
|
||||
import README from './README.mdx';
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { IconColor } from '../../../helpers/constants/design-system';
|
||||
import { ICON_NAMES } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { BUTTON_ICON_SIZES } from './button-icon.constants';
|
||||
import { ButtonIcon } from './button-icon';
|
||||
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
TextColor,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import Box from '../../ui/box/box';
|
||||
import { ICON_NAMES } from '../icon';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { Text } from '../text';
|
||||
import { ButtonLink } from './button-link';
|
||||
import { BUTTON_LINK_SIZES } from './button-link.constants';
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { Size } from '../../../helpers/constants/design-system';
|
||||
import { ICON_NAMES } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { ButtonLink } from './button-link';
|
||||
import { BUTTON_LINK_SIZES } from './button-link.constants';
|
||||
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
Size,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import Box from '../../ui/box/box';
|
||||
import { ICON_NAMES } from '../icon';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { ButtonPrimary } from './button-primary';
|
||||
|
||||
import README from './README.mdx';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable jest/require-top-level-describe */
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { ICON_NAMES } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { ButtonPrimary } from './button-primary';
|
||||
import { BUTTON_PRIMARY_SIZES } from './button-primary.constants';
|
||||
|
||||
|
@ -5,7 +5,7 @@ import {
|
||||
Size,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import Box from '../../ui/box/box';
|
||||
import { ICON_NAMES } from '../icon';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { ButtonSecondary } from './button-secondary';
|
||||
import { BUTTON_SECONDARY_SIZES } from './button-secondary.constants';
|
||||
import README from './README.mdx';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable jest/require-top-level-describe */
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { ICON_NAMES } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { ButtonSecondary } from './button-secondary';
|
||||
import { BUTTON_SECONDARY_SIZES } from './button-secondary.constants';
|
||||
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
Size,
|
||||
TextVariant,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
import { ICON_NAMES } from '../icon';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { BUTTON_LINK_SIZES } from '../button-link/button-link.constants';
|
||||
import Box from '../../ui/box/box';
|
||||
import { Text } from '../text';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable jest/require-top-level-describe */
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { ICON_NAMES } from '..';
|
||||
import { ICON_NAMES } from '../icon/deprecated';
|
||||
import { BUTTON_SIZES, BUTTON_TYPES } from './button.constants';
|
||||
import { Button } from './button';
|
||||
|
||||
|
@ -264,12 +264,11 @@ import {
|
||||
|
||||
import Box from '../../ui/box/box';
|
||||
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated'
|
||||
import {
|
||||
ButtonLink,
|
||||
FormTextField,
|
||||
HelpText,
|
||||
ICON_NAMES,
|
||||
Icon,
|
||||
Label,
|
||||
TEXT_FIELD_TYPES,
|
||||
Text,
|
||||
|
@ -12,14 +12,12 @@ import {
|
||||
} from '../../../helpers/constants/design-system';
|
||||
|
||||
import Box from '../../ui/box/box';
|
||||
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
import {
|
||||
ButtonLink,
|
||||
ButtonPrimary,
|
||||
ButtonSecondary,
|
||||
HelpText,
|
||||
Icon,
|
||||
ICON_NAMES,
|
||||
Label,
|
||||
Text,
|
||||
TEXT_FIELD_SIZES,
|
||||
|
@ -52,7 +52,12 @@ Use the `startAccessoryWrapperProps` prop to customize the wrapper element aroun
|
||||
</Canvas>
|
||||
|
||||
```jsx
|
||||
import { HeaderBase, Text } from '../../component-library';
|
||||
import {
|
||||
HeaderBase,
|
||||
Text,
|
||||
ButtonIcon,
|
||||
IconName,
|
||||
} from '../../component-library';
|
||||
import {
|
||||
TEXT_ALIGN,
|
||||
TextVariant,
|
||||
@ -62,7 +67,7 @@ import {
|
||||
startAccessory={
|
||||
<ButtonIcon
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.ARROW_LEFT}
|
||||
iconName={IconName.ArrowLeft}
|
||||
ariaLabel="back"
|
||||
/>
|
||||
}
|
||||
@ -84,7 +89,13 @@ Use the `endAccessoryWrapperProps` prop to customize the wrapper element around
|
||||
</Canvas>
|
||||
|
||||
```jsx
|
||||
import { HeaderBase, Text } from '../../component-library';
|
||||
import {
|
||||
ButtonIcon,
|
||||
BUTTON_ICON_SIZES,
|
||||
HeaderBase,
|
||||
IconName,
|
||||
Text,
|
||||
} from '../../component-library';
|
||||
import {
|
||||
TEXT_ALIGN,
|
||||
TextVariant,
|
||||
@ -94,7 +105,7 @@ import {
|
||||
endAccessory={
|
||||
<ButtonIcon
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.CLOSE}
|
||||
iconName={IconName.Close}
|
||||
ariaLabel="close"
|
||||
/>
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
||||
import Box from '../../ui/box';
|
||||
import {
|
||||
ICON_NAMES,
|
||||
IconName,
|
||||
Button,
|
||||
ButtonIcon,
|
||||
BUTTON_ICON_SIZES,
|
||||
@ -43,14 +43,14 @@ DefaultStory.args = {
|
||||
startAccessory: (
|
||||
<ButtonIcon
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.ARROW_LEFT}
|
||||
iconName={IconName.ArrowLeft}
|
||||
ariaLabel="back"
|
||||
/>
|
||||
),
|
||||
endAccessory: (
|
||||
<ButtonIcon
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.CLOSE}
|
||||
iconName={IconName.Close}
|
||||
ariaLabel="close"
|
||||
/>
|
||||
),
|
||||
@ -75,7 +75,7 @@ export const StartAccessory = (args) => {
|
||||
startAccessory={
|
||||
<ButtonIcon
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.ARROW_LEFT}
|
||||
iconName={IconName.ArrowLeft}
|
||||
ariaLabel="back"
|
||||
/>
|
||||
}
|
||||
@ -95,7 +95,7 @@ export const EndAccessory = (args) => {
|
||||
endAccessory={
|
||||
<ButtonIcon
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.CLOSE}
|
||||
iconName={IconName.Close}
|
||||
ariaLabel="close"
|
||||
/>
|
||||
}
|
||||
@ -130,7 +130,7 @@ export const UseCaseDemos = (args) => (
|
||||
<ButtonIcon
|
||||
backgroundColor={BackgroundColor.goerli}
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.CLOSE}
|
||||
iconName={IconName.Close}
|
||||
ariaLabel="close"
|
||||
/>
|
||||
}
|
||||
@ -153,7 +153,7 @@ export const UseCaseDemos = (args) => (
|
||||
<ButtonIcon
|
||||
backgroundColor={BackgroundColor.successAlternative}
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.ARROW_LEFT}
|
||||
iconName={IconName.ArrowLeft}
|
||||
ariaLabel="back"
|
||||
/>
|
||||
}
|
||||
@ -176,7 +176,7 @@ export const UseCaseDemos = (args) => (
|
||||
<ButtonIcon
|
||||
backgroundColor={BackgroundColor.successAlternative}
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.ARROW_LEFT}
|
||||
iconName={IconName.ArrowLeft}
|
||||
ariaLabel="back"
|
||||
/>
|
||||
}
|
||||
@ -184,7 +184,7 @@ export const UseCaseDemos = (args) => (
|
||||
<ButtonIcon
|
||||
backgroundColor={BackgroundColor.goerli}
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.CLOSE}
|
||||
iconName={IconName.Close}
|
||||
ariaLabel="close"
|
||||
/>
|
||||
}
|
||||
@ -216,7 +216,7 @@ export const UseCaseDemos = (args) => (
|
||||
<ButtonIcon
|
||||
backgroundColor={BackgroundColor.goerli}
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.CLOSE}
|
||||
iconName={IconName.Close}
|
||||
ariaLabel="close"
|
||||
/>
|
||||
}
|
||||
@ -243,7 +243,7 @@ export const UseCaseDemos = (args) => (
|
||||
<ButtonIcon
|
||||
backgroundColor={BackgroundColor.successAlternative}
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.CLOSE}
|
||||
iconName={IconName.Close}
|
||||
ariaLabel="close"
|
||||
/>
|
||||
}
|
||||
@ -282,7 +282,7 @@ export const UseCaseDemos = (args) => (
|
||||
<ButtonIcon
|
||||
backgroundColor={BackgroundColor.goerli}
|
||||
size={BUTTON_ICON_SIZES.SM}
|
||||
iconName={ICON_NAMES.CLOSE}
|
||||
iconName={IconName.Close}
|
||||
ariaLabel="close"
|
||||
/>
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable jest/require-top-level-describe */
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { Icon, ICON_NAMES } from '..';
|
||||
import { Icon, IconName } from '..';
|
||||
import { HeaderBase } from './header-base';
|
||||
|
||||
describe('HeaderBase', () => {
|
||||
@ -39,7 +39,7 @@ describe('HeaderBase', () => {
|
||||
const { getByTestId } = render(
|
||||
<HeaderBase
|
||||
startAccessory={
|
||||
<Icon data-testid="start-accessory" name={ICON_NAMES.ADD_SQUARE} />
|
||||
<Icon data-testid="start-accessory" name={IconName.AddSquare} />
|
||||
}
|
||||
/>,
|
||||
);
|
||||
@ -51,7 +51,7 @@ describe('HeaderBase', () => {
|
||||
const { getByTestId } = render(
|
||||
<HeaderBase
|
||||
endAccessory={
|
||||
<Icon data-testid="end-accessory" name={ICON_NAMES.ADD_SQUARE} />
|
||||
<Icon data-testid="end-accessory" name={IconName.AddSquare} />
|
||||
}
|
||||
/>,
|
||||
);
|
||||
|
@ -28,7 +28,8 @@ The `HelpText` accepts all props below as well as all [Box](/docs/components-ui-
|
||||
|
||||
```jsx
|
||||
import { Size, IconColor } from '../../../helpers/constants/design-system';
|
||||
import { HelpText, Icon, ICON_NAMES } from '../../component-library';
|
||||
import { Icon, ICON_NAMES } from '../../icon/deprecated';
|
||||
import { HelpText } from '../../component-library';
|
||||
|
||||
<HelpText>Plain text</HelpText> // renders as <p>Plain text</p>
|
||||
<HelpText>
|
||||
|
@ -10,7 +10,7 @@ import {
|
||||
|
||||
import Box from '../../ui/box';
|
||||
|
||||
import { Icon, ICON_NAMES } from '..';
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
|
||||
import { HelpText } from './help-text';
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { Color, SEVERITIES } from '../../../helpers/constants/design-system';
|
||||
import { Icon, ICON_NAMES } from '../icon';
|
||||
import { Icon, ICON_NAMES } from '../icon/deprecated';
|
||||
|
||||
import { HelpText } from './help-text';
|
||||
|
||||
|
@ -4,7 +4,7 @@ import { Icon } from './icon';
|
||||
|
||||
# Icon
|
||||
|
||||
The `Icon` component in conjunction with `ICON_NAMES` can be used for all icons in the extension
|
||||
The `Icon` component in conjunction with `IconName` can be used for all icons in the extension
|
||||
|
||||
<Canvas>
|
||||
<Story id="components-componentlibrary-icon--default-story" />
|
||||
@ -18,7 +18,7 @@ The `Icon` accepts all props below as well as all [Box](/docs/components-ui-box-
|
||||
|
||||
### Name
|
||||
|
||||
Use the `name` prop and the `ICON_NAMES` object to change the icon.
|
||||
Use the `name` prop and the `IconName` enum to change the icon.
|
||||
|
||||
Use the [IconSearch](/story/components-componentlibrary-icon--default-story) story to find the icon you want to use.
|
||||
|
||||
@ -27,50 +27,50 @@ Use the [IconSearch](/story/components-componentlibrary-icon--default-story) sto
|
||||
</Canvas>
|
||||
|
||||
```jsx
|
||||
import { Icon, ICON_NAMES } from '../../component-library';
|
||||
import { Icon, IconName } from '../../component-library';
|
||||
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} />
|
||||
<Icon name={ICON_NAMES.BANK} />
|
||||
<Icon name={ICON_NAMES.CALCULATOR} />
|
||||
<Icon name={ICON_NAMES.COIN} />
|
||||
<Icon name={IconName.AddSquare} />
|
||||
<Icon name={IconName.Bank} />
|
||||
<Icon name={IconName.Calculator} />
|
||||
<Icon name={IconName.Coin} />
|
||||
// etc...
|
||||
```
|
||||
|
||||
### Size
|
||||
|
||||
Use the `size` prop and the `Size` object from `./ui/helpers/constants/design-system.js` to change the size of `Icon`. Defaults to `Size.SM`
|
||||
Use the `size` prop and the `IconSize` enum to change the size of `Icon`. Defaults to `IconSize.Sm`
|
||||
|
||||
Possible sizes include:
|
||||
|
||||
- `Size.XS` 12px
|
||||
- `Size.SM` 16px
|
||||
- `Size.MD` 20px
|
||||
- `Size.LG` 24px
|
||||
- `Size.XL` 32px
|
||||
- `Size.inherit` inherits the font-size from parent element. This is useful for inline icons in text.
|
||||
- `IconSize.Xs` 12px
|
||||
- `IconSize.Sm` 16px
|
||||
- `IconSize.Md` 20px
|
||||
- `IconSize.Lg` 24px
|
||||
- `IconSize.Xl` 32px
|
||||
- `IconSize.Inherit` inherits the font-size from parent element. This is useful for inline icons in text.
|
||||
|
||||
<Canvas>
|
||||
<Story id="components-componentlibrary-icon--size-story" />
|
||||
</Canvas>
|
||||
|
||||
```jsx
|
||||
import { Size,TextVariant } from '../../../helpers/constants/design-system';
|
||||
import { Icon, ICON_NAMES } from '../../component-library';
|
||||
import { TextVariant } from '../../../helpers/constants/design-system';
|
||||
import { Icon, IconName, IconSize, Text } from '../../component-library';
|
||||
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} size={Size.XS} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} size={Size.SM} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} size={Size.MD} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} size={Size.LG} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} size={Size.XL} />
|
||||
<Icon name={IconName.AddSquare} size={IconSize.Xs} />
|
||||
<Icon name={IconName.AddSquare} size={IconSize.Sm} />
|
||||
<Icon name={IconName.AddSquare} size={IconSize.Md} />
|
||||
<Icon name={IconName.AddSquare} size={IconSize.Lg} />
|
||||
<Icon name={IconName.AddSquare} size={IconSize.Xl} />
|
||||
<Text as="p" variant={TextVariant.bodySm}>
|
||||
<Icon size={Size.inherit} /> inherits the
|
||||
<Icon size={IconSize.Inherit} /> inherits the
|
||||
font-size of the parent element.
|
||||
</Text>
|
||||
```
|
||||
|
||||
### Color
|
||||
|
||||
Use the `color` prop and the `Color` object from `./ui/helpers/constants/design-system.js` to change the color of `Icon`. Defaults to `Color.inherit` which will use the text color of the parent element. This is useful for inline icons.
|
||||
Use the `color` prop and the `IconColor` enum from `./ui/helpers/constants/design-system.js` to change the color of `Icon`. Defaults to `IconColor.inherit` which will use the text color of the parent element. This is useful for inline icons.
|
||||
|
||||
<Canvas>
|
||||
<Story id="components-componentlibrary-icon--color-story" />
|
||||
@ -78,23 +78,23 @@ Use the `color` prop and the `Color` object from `./ui/helpers/constants/design-
|
||||
|
||||
```jsx
|
||||
import { IconColor } from '../../../helpers/constants/design-system';
|
||||
import { Icon, ICON_NAMES } from '../../component-library';
|
||||
import { Icon, IconName } from '../../component-library';
|
||||
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.inherit} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.iconDefault} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.iconAlternative} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.iconMuted} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.overlayInverse} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.primaryDefault} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.primaryInverse} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.errorDefault} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.errorInverse} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.successDefault} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.successInverse} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.warningDefault} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.warningInverse} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.infoDefault} />
|
||||
<Icon name={ICON_NAMES.ADD_SQUARE} color={IconColor.infoInverse} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.inherit} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.iconDefault} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.iconAlternative} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.iconMuted} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.overlayInverse} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.primaryDefault} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.primaryInverse} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.errorDefault} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.errorInverse} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.successDefault} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.successInverse} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.warningDefault} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.warningInverse} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.infoDefault} />
|
||||
<Icon name={IconName.AddSquare} color={IconColor.infoInverse} />
|
||||
```
|
||||
|
||||
### Layout & Spacing
|
||||
@ -119,12 +119,12 @@ import {
|
||||
|
||||
import Box from '../../ui/box/box';
|
||||
|
||||
import { ICON_NAMES, Icon, Text, Label } from '../../component-library';
|
||||
import { IconName, Icon, IconSize, Text, Label } from '../../component-library';
|
||||
|
||||
<Box display={DISPLAY.FLEX} flexDirection={FLEX_DIRECTION.COLUMN} gap={4}>
|
||||
<Box display={DISPLAY.FLEX} alignItems={AlignItems.center}>
|
||||
<Icon
|
||||
name={ICON_NAMES.CHECK}
|
||||
name={IconName.Check}
|
||||
color={IconColor.successDefault}
|
||||
marginRight={1}
|
||||
/>
|
||||
@ -142,7 +142,7 @@ import { ICON_NAMES, Icon, Text, Label } from '../../component-library';
|
||||
0x79fAaFe7B6D5DB5D8c63FE88DFF0AF1Fe53358db
|
||||
</Text>
|
||||
<Icon
|
||||
name={ICON_NAMES.COPY}
|
||||
name={IconName.Copy}
|
||||
color={IconColor.primaryDefault}
|
||||
marginLeft={1}
|
||||
/>
|
||||
@ -155,18 +155,18 @@ import { ICON_NAMES, Icon, Text, Label } from '../../component-library';
|
||||
borderColor={BorderColor.borderMuted}
|
||||
backgroundColor={BackgroundColor.backgroundDefault}
|
||||
>
|
||||
<Icon name={ICON_NAMES.ADD} color={IconColor.iconDefault} marginRight={2} />
|
||||
<Icon name={IconName.Add} color={IconColor.iconDefault} marginRight={2} />
|
||||
<Text>Create account</Text>
|
||||
</Box>
|
||||
<Label>
|
||||
Custom spending cap{' '}
|
||||
<Icon name={ICON_NAMES.INFO} size={ICON_SIZES.AUTO} marginLeft={1} />
|
||||
<Icon name={IconName.Info} size={IconSize.Inherit} marginLeft={1} />
|
||||
</Label>
|
||||
<div>
|
||||
<Text>
|
||||
<Icon
|
||||
name={ICON_NAMES.WARNING}
|
||||
size={ICON_SIZES.AUTO}
|
||||
name={IconName.Warning}
|
||||
size={IconSize.Inherit}
|
||||
marginLeft={1}
|
||||
color={IconColor.warningDefault}
|
||||
/>{' '}
|
||||
@ -178,17 +178,17 @@ import { ICON_NAMES, Icon, Text, Label } from '../../component-library';
|
||||
|
||||
### Adding a new icon
|
||||
|
||||
To add a new icon the only thing you need to do is add the icon svg file to `app/images/icons`. To ensure that the icon is added correctly follow these steps:
|
||||
In order to ensure that a new icon is added correctly, there are a few steps that need to be followed:
|
||||
|
||||
#### Step 1.
|
||||
|
||||
Optimize the svg using [Fontastic](https://fontastic.me/). This will remove any unnecessary code from the svg. Your svg should only contain a single path.
|
||||
|
||||
Example of a correctly optimized svg:
|
||||
Example of a correctly optimized svg `add-square-filled.svg`:
|
||||
|
||||
```
|
||||
<svg xmlns="http://www.w3.org/2000/svg" id="icon-add-square-filled" viewBox="0 0 512 512">
|
||||
<path d="m337 51l-171 0c-75 0-119 45-119 119l0 172c0 74 44 119 119 119l171 0c75 0 119-45 119-119l0-172c1-74-44-119-119-119z m-3 220l-67 0 0 67c0 8-7 15-15 15-9 0-16-7-16-15l0-67-66 0c-9 0-16-7-16-15 0-8 7-15 16-15l66 0 0-67c0-8 7-15 16-15 8 0 15 7 15 15l0 67 67 0c8 0 15 7 15 15 0 8-7 15-15 15z"/>
|
||||
```xml
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
||||
<path d="m337 51l-171 0c-75 0-119 45-119 119l0 172c0 74 44 119 119 119l171 0c75 0 119-45 119-119l0-172c1-74-44-119-119-119z m-3 220l-67 0 0 67c0 8-7 15-15 15-9 0-16-7-16-15l0-67-66 0c-9 0-16-7-16-15 0-8 7-15 16-15l66 0 0-67c0-8 7-15 16-15 8 0 15 7 15 15l0 67 67 0c8 0 15 7 15 15 0 8-7 15-15 15z" />
|
||||
</svg>
|
||||
```
|
||||
|
||||
@ -200,6 +200,6 @@ Add your optimized svg file to to `app/images/icons`
|
||||
|
||||
#### Step 3.
|
||||
|
||||
Run `yarn start` to generate the `ICON_NAMES` with your added icon.
|
||||
Add your icon to the `IconName` enum in `./ui/components/ui/icon/icon.types.ts`
|
||||
|
||||
If you have any questions please reach out to the design system team in the [#metamask-design-system](https://consensys.slack.com/archives/C0354T27M5M) channel on slack.
|
||||
|
@ -0,0 +1,11 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Icon should render correctly 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="box mm-icon mm-icon--size-md box--display-inline-block box--flex-direction-row box--color-inherit"
|
||||
data-testid="icon"
|
||||
style="mask-image: url('./images/icons/add-square.svg');"
|
||||
/>
|
||||
</div>
|
||||
`;
|
@ -0,0 +1,23 @@
|
||||
import { Size } from '../../../../helpers/constants/design-system';
|
||||
|
||||
/**
|
||||
* @deprecated `ICON_NAMES` has been deprecated in favour of the `IconName` enum
|
||||
*
|
||||
* import { Icon, IconName } from '../../component-library';
|
||||
*/
|
||||
/* eslint-disable prefer-destructuring*/ // process.env is not a standard JavaScript object, so we are not able to use object destructuring
|
||||
export const ICON_NAMES = JSON.parse(process.env.ICON_NAMES);
|
||||
|
||||
/**
|
||||
* @deprecated `ICON_SIZES` has been deprecated in favour of the `IconSize` enum
|
||||
*
|
||||
* import { Icon, IconSize, IconName } from '../../component-library';
|
||||
*/
|
||||
export const ICON_SIZES = {
|
||||
XS: Size.XS,
|
||||
SM: Size.SM,
|
||||
MD: Size.MD,
|
||||
LG: Size.LG,
|
||||
XL: Size.XL,
|
||||
AUTO: Size.inherit,
|
||||
};
|
@ -2,13 +2,13 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
|
||||
import Box from '../../ui/box/box';
|
||||
import Box from '../../../ui/box/box';
|
||||
|
||||
import {
|
||||
Size,
|
||||
IconColor,
|
||||
DISPLAY,
|
||||
} from '../../../helpers/constants/design-system';
|
||||
} from '../../../../helpers/constants/design-system';
|
||||
|
||||
import { ICON_SIZES, ICON_NAMES } from './icon.constants';
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* eslint-disable jest/require-top-level-describe */
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { Size, IconColor } from '../../../helpers/constants/design-system';
|
||||
import { Size, IconColor } from '../../../../helpers/constants/design-system';
|
||||
import { ICON_NAMES } from './icon.constants';
|
||||
import { Icon } from './icon';
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user