Skip to content

Commit 8d74bda

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/mul-924
2 parents f2b622c + fd1ecb6 commit 8d74bda

File tree

55 files changed

+2343
-434
lines changed

Some content is hidden

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

55 files changed

+2343
-434
lines changed

.depcheckrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ ignores:
9696
- '@metamask/bitcoin-wallet-snap'
9797
- '@metamask/solana-wallet-snap'
9898
- '@metamask/institutional-wallet-snap'
99+
- '@metamask/gator-permissions-snap'
100+
- '@metamask/permissions-kernel-snap'
99101

100102
# files depcheck should not parse
101103
ignorePatterns:

.github/scripts/push-firefox-bundle-script.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ fi
99

1010
git config --global user.name "MetaMask Bot"
1111
git config --global user.email [email protected]
12-
version=$(git show -s --format='%s' HEAD | grep -Eo 'v[0-9]+\.[0-9]+\.[0-9]+')
12+
rawVersion=$(git show -s --format='%s' HEAD | grep -Eo 'release/[0-9]+\.[0-9]+\.[0-9]+' | sed 's|release/||')
13+
version="v${rawVersion}"
14+
15+
# Validate that the version was successfully extracted
16+
if [[ -z "${rawVersion}" ]]; then
17+
echo "::error:: Failed to extract version from commit message. Ensure it follows the 'release/x.y.z' format."
18+
exit 1
19+
fi
20+
21+
echo "Version extracted: ${version}"
1322

1423
git clone "https://${FIREFOX_BUNDLE_SCRIPT_TOKEN}@github.com/MetaMask/firefox-bundle-script.git"
1524
cd firefox-bundle-script

.github/scripts/release-create-gh-release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ function publish_tag() {
4747

4848
current_commit_msg=$(git show -s --format='%s' HEAD)
4949

50-
if [[ "${current_commit_msg}" =~ Version[-[:space:]](v[[:digit:]]+.[[:digit:]]+.[[:digit:]]+) ]]; then
51-
tag="${BASH_REMATCH[1]}"
50+
if [[ "${current_commit_msg}" =~ release/([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+) ]]; then
51+
tag="v${BASH_REMATCH[1]}"
5252
flask_version="$(print_build_version 'flask')"
5353

5454
printf '%s\n' 'Creating GitHub Release'

.yarn/patches/@metamask-assets-controllers-npm-75.2.0-26c7526112.patch renamed to .yarn/patches/@metamask-assets-controllers-npm-76.0.0-95e99a2835.patch

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/dist/assetsUtil.cjs b/dist/assetsUtil.cjs
2-
index b3db76c39d78362273ff081d8c8efe30040ffc28..e2437a3a8f6e027d86849d2e597791c3fc4ce7b0 100644
2+
index b3db76c39d78362273ff081d8c8efe30040ffc28..cab60d3a8541ad0459112638f027c7e303b68b1e 100644
33
--- a/dist/assetsUtil.cjs
44
+++ b/dist/assetsUtil.cjs
55
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
@@ -10,12 +10,11 @@ index b3db76c39d78362273ff081d8c8efe30040ffc28..e2437a3a8f6e027d86849d2e597791c3
1010
exports.accountAddressToCaipReference = exports.getKeyByValue = 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-
@@ -240,7 +241,13 @@ async function getIpfsCIDv1AndPath(ipfsUrl) {
13+
@@ -240,7 +241,12 @@ 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;
1717
- const { CID } = await import("multiformats");
18-
+ // Use CJS require to allow Jest to parse without ESM transform
1918
+ // Dynamic import is used here in `core` for CJS compatbility, because 'multiformats' is ESM-
2019
+ // only. However, dynamic import is not supported by LavaMoat.
2120
+ // See here for details: https://github.com/MetaMask/metamask-extension/pull/27629#discussion_r1791797810

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [13.3.1]
11+
12+
### Fixed
13+
14+
- fix: fixes issues with balances not updating on Solana (#36129)
15+
- fix: improves Solana account synchronization and WebSocket subscriptions (#36129)
16+
- fix: adds multichain asset prices polling to ensure Solana chart always displays up-to-date price data (#36175)
17+
- fix: adds support for signing transactions where the fee payer differs from the user's account (#36251)
18+
1019
## [13.3.0]
1120

1221
### Added
@@ -587,7 +596,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
587596
- This changelog was split off with 12.22.0
588597
- All older changes can be found in [docs/CHANGELOG_older.md](https://github.com/MetaMask/metamask-extension/blob/main/docs/CHANGELOG_older.md)
589598

590-
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v13.3.0...HEAD
599+
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v13.3.1...HEAD
600+
[13.3.1]: https://github.com/MetaMask/metamask-extension/compare/v13.3.0...v13.3.1
591601
[13.3.0]: https://github.com/MetaMask/metamask-extension/compare/v13.2.3...v13.3.0
592602
[13.2.3]: https://github.com/MetaMask/metamask-extension/compare/v13.2.2...v13.2.3
593603
[13.2.2]: https://github.com/MetaMask/metamask-extension/compare/v13.2.1...v13.2.2

app/_locales/en/messages.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/_locales/en_GB/messages.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/scripts/background.js

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { isStateCorruptionError } from '../../shared/constants/errors';
5050
import getFirstPreferredLangCode from '../../shared/lib/get-first-preferred-lang-code';
5151
import { getManifestFlags } from '../../shared/lib/manifestFlags';
5252
import { DISPLAY_GENERAL_STARTUP_ERROR } from '../../shared/constants/start-up-errors';
53+
import { HYPERLIQUID_ORIGIN } from '../../shared/constants/referrals';
5354
import {
5455
CorruptionHandler,
5556
hasVault,
@@ -91,6 +92,7 @@ import { createEvent } from './lib/deep-links/metrics';
9192
import { getRequestSafeReload } from './lib/safe-reload';
9293
import { tryPostMessage } from './lib/start-up-errors/start-up-errors';
9394
import { CronjobControllerStorageManager } from './lib/CronjobControllerStorageManager';
95+
import { HyperliquidPermissionTriggerType } from './lib/createHyperliquidReferralMiddleware';
9496

9597
/**
9698
* @typedef {import('./lib/stores/persistence-manager').Backup} Backup
@@ -145,6 +147,7 @@ let uiIsTriggering = false;
145147
const openMetamaskTabsIDs = {};
146148
const requestAccountTabIds = {};
147149
let controller;
150+
const senderOriginMapping = {};
148151
const tabOriginMapping = {};
149152

150153
if (inTest || process.env.METAMASK_DEBUG) {
@@ -935,16 +938,26 @@ function emitDappViewedMetricEvent(origin) {
935938
* @param {chrome.runtime.Port} remotePort - The port provided by a new context.
936939
*/
937940
function trackDappView(remotePort) {
938-
if (!remotePort.sender || !remotePort.sender.tab || !remotePort.sender.url) {
941+
if (
942+
!remotePort.sender?.tab ||
943+
!remotePort.sender?.url ||
944+
!remotePort.sender?.tab?.url
945+
) {
939946
return;
940947
}
941948
const tabId = remotePort.sender.tab.id;
942949
const url = new URL(remotePort.sender.url);
943950
const { origin } = url;
951+
const tabUrl = new URL(remotePort.sender.tab.url);
952+
const { origin: tabOrigin } = tabUrl;
944953

945-
// store the orgin to corresponding tab so it can provide infor for onActivated listener
946-
if (!Object.keys(tabOriginMapping).includes(tabId)) {
947-
tabOriginMapping[tabId] = origin;
954+
// store the origin to corresponding tab so it can provide info for onActivated listener
955+
if (!Object.keys(senderOriginMapping).includes(tabId)) {
956+
senderOriginMapping[tabId] = origin;
957+
}
958+
// do the same for tab origin, which can be different to sender origin
959+
if (!(tabId in tabOriginMapping)) {
960+
tabOriginMapping[tabId] = tabOrigin;
948961
}
949962

950963
const isConnectedToDapp = controller.controllerMessenger.call(
@@ -1579,7 +1592,8 @@ function onNavigateToTab() {
15791592
browser.tabs.onActivated.addListener((onActivatedTab) => {
15801593
if (controller) {
15811594
const { tabId } = onActivatedTab;
1582-
const currentOrigin = tabOriginMapping[tabId];
1595+
const currentOrigin = senderOriginMapping[tabId];
1596+
const currentTabOrigin = tabOriginMapping[tabId];
15831597
// *** Emit DappViewed metric event when ***
15841598
// - navigate to a connected dapp
15851599
if (currentOrigin) {
@@ -1591,6 +1605,27 @@ function onNavigateToTab() {
15911605
emitDappViewedMetricEvent(currentOrigin);
15921606
}
15931607
}
1608+
1609+
// If the connected dApp is Hyperliquid, trigger the referral flow
1610+
if (currentTabOrigin === HYPERLIQUID_ORIGIN) {
1611+
const connectSitePermissions =
1612+
controller.permissionController.state.subjects[currentTabOrigin];
1613+
// when the dapp is not connected, connectSitePermissions is undefined
1614+
const isConnectedToDapp = connectSitePermissions !== undefined;
1615+
if (isConnectedToDapp) {
1616+
controller
1617+
.handleHyperliquidReferral(
1618+
tabId,
1619+
HyperliquidPermissionTriggerType.OnNavigateConnectedTab,
1620+
)
1621+
.catch((error) => {
1622+
log.error(
1623+
'Failed to handle Hyperliquid referral after navigation to connected tab: ',
1624+
error,
1625+
);
1626+
});
1627+
}
1628+
}
15941629
}
15951630
});
15961631
}

app/scripts/constants/snaps.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,16 @@ export const PREINSTALLED_SNAPS_URLS = [
3939
// @ts-expect-error TS1470: 'import.meta' is not allowed in CommonJS
4040
import.meta.url,
4141
),
42+
///: BEGIN:ONLY_INCLUDE_IF(gator-permissions)
43+
new URL(
44+
'@metamask/permissions-kernel-snap/dist/preinstalled-snap.json',
45+
// @ts-expect-error TS1470: 'import.meta' is not allowed in CommonJS
46+
import.meta.url,
47+
),
48+
new URL(
49+
'@metamask/gator-permissions-snap/dist/preinstalled-snap.json',
50+
// @ts-expect-error TS1470: 'import.meta' is not allowed in CommonJS
51+
import.meta.url,
52+
),
53+
///: END:ONLY_INCLUDE_IF
4254
];

0 commit comments

Comments
 (0)