Skip to content

Commit 5664076

Browse files
committed
Merge branch 'develop' into 3040-alert-for-when-interacting-with-an-address-for-the-first-time
2 parents bc0f58d + fd78a56 commit 5664076

File tree

139 files changed

+2744
-1321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+2744
-1321
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ jobs:
11951195
at: .
11961196
- run:
11971197
name: test:e2e:single
1198-
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.js --browser chrome
1198+
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.ts --browser chrome
11991199
no_output_timeout: 5m
12001200
- store_artifacts:
12011201
path: test-artifacts

.depcheckrc.yml

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ ignores:
7070
- 'crypto-browserify' # polyfill
7171
- 'process' # polyfill
7272
- 'stream-http' # polyfill
73-
- 'rimraf' # misc: install helper
7473
- 'json-schema-to-ts' # misc: typescript helper
7574
- 'https-browserify' # polyfill
7675
- 'path-browserify' # polyfill

.yarn/patches/@metamask-assets-controllers-npm-42.0.0-57b3d695bb.patch renamed to .yarn/patches/@metamask-assets-controllers-npm-44.0.0-c223d56176.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
diff --git a/dist/assetsUtil.cjs b/dist/assetsUtil.cjs
2-
index e90a1b6767bc8ac54b7a4d580035cf5db6861dca..a5e0f03d2541b4e3540431ef2e6e4b60fb7ae9fe 100644
2+
index c2e83cf6caee19152aa164f1333cfef7b681e900..590b6de6e9d20ca402b82ac56b0929ab8c16c932 100644
33
--- a/dist/assetsUtil.cjs
44
+++ b/dist/assetsUtil.cjs
55
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
66
return (mod && mod.__esModule) ? mod : { "default": mod };
77
};
88
Object.defineProperty(exports, "__esModule", { value: true });
99
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
10-
exports.fetchTokenContractExchangeRates = exports.reduceInBatchesSerially = exports.divideIntoBatches = exports.ethersBigNumberToBN = exports.addUrlProtocolPrefix = exports.getFormattedIpfsUrl = exports.getIpfsCIDv1AndPath = exports.removeIpfsProtocolPrefix = exports.isTokenListSupportedForNetwork = exports.isTokenDetectionSupportedForNetwork = exports.SupportedTokenDetectionNetworks = exports.formatIconUrlWithProxy = exports.formatAggregatorNames = exports.hasNewCollectionFields = exports.compareNftMetadata = exports.TOKEN_PRICES_BATCH_SIZE = void 0;
10+
exports.fetchTokenContractExchangeRates = exports.reduceInBatchesSerially = exports.divideIntoBatches = exports.ethersBigNumberToBN = exports.addUrlProtocolPrefix = exports.getFormattedIpfsUrl = exports.getIpfsCIDv1AndPath = exports.removeIpfsProtocolPrefix = exports.isTokenListSupportedForNetwork = exports.isTokenDetectionSupportedForNetwork = exports.SupportedStakedBalanceNetworks = exports.SupportedTokenDetectionNetworks = exports.formatIconUrlWithProxy = exports.formatAggregatorNames = exports.hasNewCollectionFields = exports.compareNftMetadata = exports.TOKEN_PRICES_BATCH_SIZE = void 0;
1111
const controller_utils_1 = require("@metamask/controller-utils");
1212
const utils_1 = require("@metamask/utils");
13-
@@ -221,7 +222,7 @@ async function getIpfsCIDv1AndPath(ipfsUrl) {
13+
@@ -233,7 +234,7 @@ async function getIpfsCIDv1AndPath(ipfsUrl) {
1414
const index = url.indexOf('/');
1515
const cid = index !== -1 ? url.substring(0, index) : url;
1616
const path = index !== -1 ? url.substring(index) : undefined;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
diff --git a/dist/TokenDetectionController.cjs b/dist/TokenDetectionController.cjs
2+
index ab23c95d667357db365f925c4c4acce4736797f8..8fd5efde7a3c24080f8a43f79d10300e8c271245 100644
3+
--- a/dist/TokenDetectionController.cjs
4+
+++ b/dist/TokenDetectionController.cjs
5+
@@ -204,13 +204,10 @@ class TokenDetectionController extends (0, polling_controller_1.StaticIntervalPo
6+
// Try detecting tokens via Account API first if conditions allow
7+
if (supportedNetworks && chainsToDetectUsingAccountAPI.length > 0) {
8+
const apiResult = await __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_attemptAccountAPIDetection).call(this, chainsToDetectUsingAccountAPI, addressToDetect, supportedNetworks);
9+
- // If API succeeds and no chains are left for RPC detection, we can return early
10+
- if (apiResult?.result === 'success' &&
11+
- chainsToDetectUsingRpc.length === 0) {
12+
- return;
13+
+ // If the account API call failed, have those chains fall back to RPC detection
14+
+ if (apiResult?.result === 'failed') {
15+
+ __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks);
16+
}
17+
- // If API fails or chainsToDetectUsingRpc still has items, add chains to RPC detection
18+
- __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks);
19+
}
20+
// Proceed with RPC detection if there are chains remaining in chainsToDetectUsingRpc
21+
if (chainsToDetectUsingRpc.length > 0) {
22+
@@ -446,8 +443,7 @@ async function _TokenDetectionController_addDetectedTokensViaAPI({ selectedAddre
23+
const tokenBalancesByChain = await __classPrivateFieldGet(this, _TokenDetectionController_accountsAPI, "f")
24+
.getMultiNetworksBalances(selectedAddress, chainIds, supportedNetworks)
25+
.catch(() => null);
26+
- if (!tokenBalancesByChain ||
27+
- Object.keys(tokenBalancesByChain).length === 0) {
28+
+ if (tokenBalancesByChain === null) {
29+
return { result: 'failed' };
30+
}
31+
// Process each chain ID individually
32+
diff --git a/dist/TokenDetectionController.mjs b/dist/TokenDetectionController.mjs
33+
index f75eb5c2c74f2a9d15a79760985111171dc938e1..ebc30bb915cc39dabf49f9e0da84a7948ae1ed48 100644
34+
--- a/dist/TokenDetectionController.mjs
35+
+++ b/dist/TokenDetectionController.mjs
36+
@@ -205,13 +205,10 @@ export class TokenDetectionController extends StaticIntervalPollingController()
37+
// Try detecting tokens via Account API first if conditions allow
38+
if (supportedNetworks && chainsToDetectUsingAccountAPI.length > 0) {
39+
const apiResult = await __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_attemptAccountAPIDetection).call(this, chainsToDetectUsingAccountAPI, addressToDetect, supportedNetworks);
40+
- // If API succeeds and no chains are left for RPC detection, we can return early
41+
- if (apiResult?.result === 'success' &&
42+
- chainsToDetectUsingRpc.length === 0) {
43+
- return;
44+
+ // If the account API call failed, have those chains fall back to RPC detection
45+
+ if (apiResult?.result === 'failed') {
46+
+ __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks);
47+
}
48+
- // If API fails or chainsToDetectUsingRpc still has items, add chains to RPC detection
49+
- __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks);
50+
}
51+
// Proceed with RPC detection if there are chains remaining in chainsToDetectUsingRpc
52+
if (chainsToDetectUsingRpc.length > 0) {
53+
@@ -446,8 +443,7 @@ async function _TokenDetectionController_addDetectedTokensViaAPI({ selectedAddre
54+
const tokenBalancesByChain = await __classPrivateFieldGet(this, _TokenDetectionController_accountsAPI, "f")
55+
.getMultiNetworksBalances(selectedAddress, chainIds, supportedNetworks)
56+
.catch(() => null);
57+
- if (!tokenBalancesByChain ||
58+
- Object.keys(tokenBalancesByChain).length === 0) {
59+
+ if (tokenBalancesByChain === null) {
60+
return { result: 'failed' };
61+
}
62+
// Process each chain ID individually

CHANGELOG.md

+43-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [12.7.0]
10+
### Added
11+
- Added Token Network Filter UI, allowing users to filter tokens by network (behind a feature flag) ([#27884](https://github.com/MetaMask/metamask-extension/pull/27884))
12+
- Added Ape token icon for mainnet ([#27974](https://github.com/MetaMask/metamask-extension/pull/27974))
13+
- Implemented redesigned native asset transfer for both wallet-initiated and dApp-initiated confirmations ([#27979](https://github.com/MetaMask/metamask-extension/pull/27979))
14+
- Enabled the Security Alerts API with a fallback mechanism to ensure user experience is not disrupted ([#28040](https://github.com/MetaMask/metamask-extension/pull/28040))
15+
- Added re-simulation logic to the transaction controller ([#28104](https://github.com/MetaMask/metamask-extension/pull/28104))
16+
- Made the message section in the signature page collapsible and added a copy option ([#28038](https://github.com/MetaMask/metamask-extension/pull/28038))
17+
- Added token transfer confirmation for ERC721 and ERC1155 tokens ([#27955](https://github.com/MetaMask/metamask-extension/pull/27955))
18+
- Added support for external links in feature announcements ([#26491](https://github.com/MetaMask/metamask-extension/pull/26491))
19+
- Added a Notifications option to the settings page ([#26843](https://github.com/MetaMask/metamask-extension/pull/26843))
20+
- Enabled the use of a preview token to view unpublished content from Contentful ([#27809](https://github.com/MetaMask/metamask-extension/pull/27809))
21+
- Added account syncing to MetaMask, allowing users to synchronize accounts and account names across devices ([#28120](https://github.com/MetaMask/metamask-extension/pull/28120))
22+
- Introduced a new phishing warning UI with improved design ([#27942](https://github.com/MetaMask/metamask-extension/pull/27942))
23+
- Added a privacy mode toggle to hide and show sensitive information and token balances ([#28021](https://github.com/MetaMask/metamask-extension/pull/28021))
24+
- Added test network to the default selected networks list if it is the globally selected network during a connection request ([#27980](https://github.com/MetaMask/metamask-extension/pull/27980))
25+
26+
### Changed
27+
- Allowed users to remove Linea from the networks list and added it to the Popular Networks section ([#27512](https://github.com/MetaMask/metamask-extension/pull/27512))
28+
- Updated transaction controller to reduce gas limit fallback and remove global network usage from transaction simulation ([#27954](https://github.com/MetaMask/metamask-extension/pull/27954))
29+
- Reduced usage of scientific notation by implementing a decimals rounding strategy and added tooltips for full values ([#27992](https://github.com/MetaMask/metamask-extension/pull/27992))
30+
- Improved visibility of decrypted messages and added a "scroll to bottom" button ([#27622](https://github.com/MetaMask/metamask-extension/pull/27622))
31+
- Updated network message to show the full network name on the Review Permission and Connections pages ([#28126](https://github.com/MetaMask/metamask-extension/pull/28126))
32+
- Removed the feature flag for the confirmations screen ([#27877](https://github.com/MetaMask/metamask-extension/pull/27877))
33+
34+
### Fixed
35+
- Fixed issue where token balance showed as 0 during send flow when navigating from the token details page ([#28136](https://github.com/MetaMask/metamask-extension/pull/28136))
36+
- Fixed issue where small spending caps were coerced to zero on the approve screen ([#28179](https://github.com/MetaMask/metamask-extension/pull/28179))
37+
- Fixed gas calculations for low Max base fee and Priority fee ([#28037](https://github.com/MetaMask/metamask-extension/pull/28037))
38+
- Disabled notifications when Basic functionality is turned off ([#28045])
39+
- Fixed alignment issues of custom UI links in Snaps ([#27957](https://github.com/MetaMask/metamask-extension/pull/27957))
40+
- Fixed misalignment of the quote rate in swaps ([#28016](https://github.com/MetaMask/metamask-extension/pull/28016))
41+
- Prevented scrolling to the account list item on the send page to keep the relevant UI in view ([#27934](https://github.com/MetaMask/metamask-extension/pull/27934))
42+
- Improved handling of network switching and adding networks to prevent issues with queued transactions ([#28090](https://github.com/MetaMask/metamask-extension/pull/28090))
43+
- Prevented redirect after adding a network in Onboarding Settings ([#28165](https://github.com/MetaMask/metamask-extension/pull/28165))
44+
45+
## [12.6.1]
46+
### Fixed
47+
- Fixed gas limit estimation on Base and BNB chains ([#28327](https://github.com/MetaMask/metamask-extension/pull/28327))
48+
949
## [12.6.0]
1050
### Added
1151
- Added the APE network icon ([#27841](https://github.com/MetaMask/metamask-extension/pull/27841))
@@ -5303,7 +5343,9 @@ Update styles and spacing on the critical error page ([#20350](https://github.c
53035343
- Added the ability to restore accounts from seed words.
53045344

53055345

5306-
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.6.0...HEAD
5346+
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.7.0...HEAD
5347+
[12.7.0]: https://github.com/MetaMask/metamask-extension/compare/v12.6.1...v12.7.0
5348+
[12.6.1]: https://github.com/MetaMask/metamask-extension/compare/v12.6.0...v12.6.1
53075349
[12.6.0]: https://github.com/MetaMask/metamask-extension/compare/v12.5.1...v12.6.0
53085350
[12.5.1]: https://github.com/MetaMask/metamask-extension/compare/v12.5.0...v12.5.1
53095351
[12.5.0]: https://github.com/MetaMask/metamask-extension/compare/v12.4.2...v12.5.0

app/scripts/constants/sentry-state.ts

+3
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ export const SENTRY_BACKGROUND_STATE = {
355355
[AllProperties]: false,
356356
},
357357
},
358+
TokenBalancesController: {
359+
tokenBalances: false,
360+
},
358361
TokenRatesController: {
359362
marketData: false,
360363
},

app/scripts/controllers/app-state-controller.test.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ORIGIN_METAMASK,
66
POLLING_TOKEN_ENVIRONMENT_TYPES,
77
} from '../../../shared/constants/app';
8+
import { AccountOverviewTabKey } from '../../../shared/constants/app-state';
89
import { AppStateController } from './app-state-controller';
910
import type {
1011
AllowedActions,
@@ -209,9 +210,11 @@ describe('AppStateController', () => {
209210

210211
describe('setDefaultHomeActiveTabName', () => {
211212
it('sets the default home tab name', () => {
212-
appStateController.setDefaultHomeActiveTabName('testTabName');
213+
appStateController.setDefaultHomeActiveTabName(
214+
AccountOverviewTabKey.Activity,
215+
);
213216
expect(appStateController.store.getState().defaultHomeActiveTabName).toBe(
214-
'testTabName',
217+
AccountOverviewTabKey.Activity,
215218
);
216219
});
217220
});

app/scripts/controllers/app-state-controller.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
import { DEFAULT_AUTO_LOCK_TIME_LIMIT } from '../../../shared/constants/preferences';
2727
import { LastInteractedConfirmationInfo } from '../../../shared/types/confirm';
2828
import { SecurityAlertResponse } from '../lib/ppom/types';
29+
import { AccountOverviewTabKey } from '../../../shared/constants/app-state';
2930
import type {
3031
Preferences,
3132
PreferencesControllerGetStateAction,
@@ -35,7 +36,7 @@ import type {
3536
export type AppStateControllerState = {
3637
timeoutMinutes: number;
3738
connectedStatusPopoverHasBeenShown: boolean;
38-
defaultHomeActiveTabName: string | null;
39+
defaultHomeActiveTabName: AccountOverviewTabKey | null;
3940
browserEnvironment: Record<string, string>;
4041
popupGasPollTokens: string[];
4142
notificationGasPollTokens: string[];
@@ -326,7 +327,9 @@ export class AppStateController extends EventEmitter {
326327
*
327328
* @param defaultHomeActiveTabName - the tab name
328329
*/
329-
setDefaultHomeActiveTabName(defaultHomeActiveTabName: string | null): void {
330+
setDefaultHomeActiveTabName(
331+
defaultHomeActiveTabName: AccountOverviewTabKey | null,
332+
): void {
330333
this.store.updateState({
331334
defaultHomeActiveTabName,
332335
});

app/scripts/controllers/mmi-controller.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import { NetworkState } from '@metamask/network-controller';
2424
import {
2525
MessageParamsPersonal,
2626
MessageParamsTyped,
27+
OriginalRequest,
2728
SignatureController,
2829
} from '@metamask/signature-controller';
29-
import { OriginalRequest } from '@metamask/message-manager';
3030
import { InternalAccount } from '@metamask/keyring-api';
3131
import { toHex } from '@metamask/controller-utils';
3232
import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils';

app/scripts/lib/ppom/security-alerts-api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async function request(endpoint: string, options?: RequestInit) {
5151
);
5252
}
5353

54-
return response.json();
54+
return await response.json();
5555
}
5656

5757
function getUrl(endpoint: string) {

app/scripts/lib/transaction/metrics.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ async function buildEventFragmentProperties({
998998
}
999999
const isRedesignedConfirmationsDeveloperSettingEnabled =
10001000
transactionMetricsRequest.getIsRedesignedConfirmationsDeveloperEnabled() ||
1001-
Boolean(process.env.ENABLE_CONFIRMATION_REDESIGN);
1001+
process.env.ENABLE_CONFIRMATION_REDESIGN === 'true';
10021002

10031003
const isRedesignedTransactionsUserSettingEnabled =
10041004
transactionMetricsRequest.getRedesignedTransactionsEnabled();

0 commit comments

Comments
 (0)