Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Version v12.8.0 #28503

Merged
merged 115 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
08e4681
chore: improve token lookup performance in `useAccountTotalFiatBalanc…
bergeron Nov 1, 2024
9b85efb
feat: Upgrade alert controller to base controller v2 (#28054)
kanthesha Nov 1, 2024
8c4af60
fix: Error handling for the state log download failure (#26999)
NiranjanaBinoy Nov 1, 2024
2de414e
chore: remove broken link in docs (#28232)
georgewrmarshall Nov 1, 2024
59044a4
chore: Adding installType to Sentry Tags for easy filtering (#28084)
vthomas13 Nov 1, 2024
a94de6a
fix: Removing `warning` prop from settings (#27990)
NiranjanaBinoy Nov 1, 2024
db2e8be
chore: Remove obsolete preview build support (#27968)
Gudahtt Nov 1, 2024
d773dd6
feat: add token verification source count and link to block explorer …
bfullam Nov 2, 2024
5e28e36
fix: margin on asset chart min/max indicators (#27916)
bergeron Nov 4, 2024
3e1dd23
refactor: remove global network usage from signatures (#28167)
matthewwalsh0 Nov 4, 2024
cdfaa42
test: [POM] Migrate edit network rpc e2e tests and create related pag…
chloeYue Nov 4, 2024
49e5e78
fix: Prevent coercing symbols to zero in the edit spending cap modal …
pedronfigueiredo Nov 4, 2024
7a8da64
fix: Add different copy for tooltip when a snap is requesting a signa…
hmalik88 Nov 4, 2024
77b77a8
refactor: move `getInternalAccounts` from `selectors.js` to `accounts…
davidmurdoch Nov 4, 2024
eab6233
feat: multi chain polling for token prices (#28158)
bergeron Nov 4, 2024
08d1854
feat: adds the experimental toggle for Solana (#28190)
zone-live Nov 4, 2024
63ea629
fix: Fix alignment of long RPC labels in Networks menu (#28244)
darkwing Nov 4, 2024
9d77985
chore: use accounts api for token detection (#28254)
bergeron Nov 4, 2024
18e81ba
fix: notification settings type (#28271)
Prithpal-Sooriya Nov 4, 2024
aaee4e7
fix: ignore error when getTokenStandardAndDetails fails (#28030)
sahar-fehri Nov 4, 2024
9fb69f4
fix: Permit message, dataTree value incorrectly using default ERC20 d…
digiwand Nov 5, 2024
7b8d2c6
chore: display bridge quotes (#28031)
micaelae Nov 5, 2024
56e92f8
fix: Hide fiat values on test networks (#28219)
pedronfigueiredo Nov 5, 2024
4a53aea
fix: unit flaky test `AddContact component › should disable submit bu…
seaona Nov 5, 2024
572496a
fix: smart transactions in redesigned confirmations (#28273)
matthewwalsh0 Nov 5, 2024
82c1910
feat: Add simulation metrics to "Transaction Submitted" and "Transact…
digiwand Nov 5, 2024
93e3872
chore: Bump Snaps packages (#28215)
FrederikBolding Nov 5, 2024
d970c25
chore: Add gravity logo and image mappings (#28306)
gambinish Nov 5, 2024
63fb3ac
fix: remove scroll-to-bottom requirement in redesigned transaction co…
vinistevam Nov 6, 2024
3da34f4
feat: btc e2e tests (#27986)
montelaidev Nov 6, 2024
4dd5413
test: [POM] Refactor e2e tests to use onboarding flows defined in Pag…
chloeYue Nov 6, 2024
04e4542
chore: add the gas_included prop into Quotes Requested event (#28295)
dan437 Nov 6, 2024
74e163f
fix: flaky test `Phishing Detection Via Iframe should redirect users …
seaona Nov 6, 2024
f117f7c
fix: use transaction address to get lock for custom nonce (#28272)
jpuri Nov 6, 2024
e1f09aa
fix: GasDetailItem invalid paddingStart prop (#28281)
digiwand Nov 6, 2024
64424be
feat: Enable simulation metrics for redesign transactions (#28280)
digiwand Nov 6, 2024
e5b415f
chore: adding e2e tests for NFT permit (#28004)
jpuri Nov 6, 2024
10102d0
chore: e2e quality gate enhancement (#28206)
seaona Nov 6, 2024
6a54c99
chore: revert commit `3da34f4` (feat: btc e2e tests (#27986)) (#28323)
gantunesr Nov 6, 2024
e5ae877
chore: Remove STX opt in modal (#28291)
dan437 Nov 6, 2024
4e94984
chore: add Solana shared utilities and constants (#28269)
ulissesferreira Nov 6, 2024
ef03946
feat: team-label-token (#28134)
itsyoboieltr Nov 6, 2024
201752e
build(webpack): fix cache issues in webpack build by updating `html-b…
davidmurdoch Nov 6, 2024
e563cfa
feat: adds solana feature, code fence (#28320)
zone-live Nov 6, 2024
264a432
fix: Negate privacy mode in Send screen (#28248)
darkwing Nov 6, 2024
87299be
feat: Show network badge in detected tokens modal (#28231)
darkwing Nov 7, 2024
0064020
chore: adds Solana snap to preinstall list (#28141)
zone-live Nov 7, 2024
bde47a6
refactor: rename SECURITY_PROVIDER_SUPPORTED_CHAIN_IDS_FALLBACK_LIST …
digiwand Nov 7, 2024
3401ef0
fix: Updates to the simulations component (#28107)
pedronfigueiredo Nov 7, 2024
765c62e
feat: Convert mmi controller to a non-controller (#27983)
kanthesha Nov 7, 2024
afa7365
fix: disable account syncing (#28359)
mathieuartu Nov 7, 2024
1614632
fix: Revert "fix: Negate privacy mode in Send screen" (#28360)
darkwing Nov 7, 2024
fce0fe4
fix: bump `@metamask/queued-request-controller` with patch fix (#28355)
adonesky1 Nov 7, 2024
2484e86
perf: ensure `setupLocale` doesn't fetch `_locales/en/messages.json` …
davidmurdoch Nov 7, 2024
54c563e
fix: mv2 firefox csp header (#27770)
itsyoboieltr Nov 7, 2024
82fdd64
fix: Bug 28347 - Privacy mode tweaks (#28367)
gambinish Nov 7, 2024
f3f6507
build: update yarn to v4.5.1 (#28365)
HowardBraham Nov 8, 2024
04dd7d3
fix: gas limit estimation (#28327)
matthewwalsh0 Nov 8, 2024
c564383
refactor: remove global network usage from transaction confirmations …
matthewwalsh0 Nov 8, 2024
e882da0
fix: Address design review for ERC20 token send (#28212)
pedronfigueiredo Nov 8, 2024
1d4fcc0
fix: disable buy for btc testnet accounts (#28341)
montelaidev Nov 8, 2024
152a50e
feat(1852): Implement sentry user report on error screen (#27857)
DDDDDanica Nov 8, 2024
77314cf
test: [POM] Refactor import account e2e tests to use Page Object Mode…
chloeYue Nov 8, 2024
4ba7d89
fix: Return to send page with different asset types (#28382)
pedronfigueiredo Nov 8, 2024
d2ddf24
feat(Solana): add "Add a new Solana account" link to the account crea…
ulissesferreira Nov 8, 2024
ab8df12
chore: add unit test for `useMultiPolling` (#28387)
bergeron Nov 8, 2024
3701940
feat: change expand icon per new design (#28267)
pnarayanaswamy Nov 11, 2024
6ae02e8
feat: migrate MetaMetricsController to BaseControllerV2 (#28113)
cryptodev-2s Nov 11, 2024
4752afd
chore: Bump snaps-utils (#28399)
FrederikBolding Nov 11, 2024
3fedf45
fix: Properly ellipsize long token names (#28392)
darkwing Nov 11, 2024
d887c79
fix: Add metric trait for privacy mode (#28335)
darkwing Nov 11, 2024
68ba635
test: [POM] Migrate reveal account srp e2e tests to use Page Object M…
chloeYue Nov 11, 2024
e54f555
fix: get `supportedChains` to avoid blocking the confirmation process…
vinistevam Nov 12, 2024
2b7101d
feat: add `account_type`/`snap_id` for buy/send metrics (#28011)
ccharly Nov 12, 2024
81008f6
fix: `Test Snap Cronjob can trigger a cronjob to open a di...` flaky …
hjetpoluru Nov 12, 2024
ea00b02
ci: Fix `attributions:check` silent failure (#28413)
Gudahtt Nov 12, 2024
36cee88
fix: fix network client ID used on the useGasFeeInputs hook (#28391)
salimtb Nov 12, 2024
a45b674
test: Reintegrate refactored Swap e2e tests to the pipeline (#26493)
davibroc Nov 12, 2024
0be3a41
chore: limit bridge quote request frequency and cancel requests (#27237)
micaelae Nov 12, 2024
7b3f951
chore(deps): bump `@metamask/eth-ledger-bridge-keyring` to `^5.0.1` (…
mikesposito Nov 12, 2024
54a9743
test: [POM] Migrate autodetect and import nft e2e tests to use Page O…
chloeYue Nov 13, 2024
8368b89
test: fix state fixtures race condition (#28421)
seaona Nov 13, 2024
caf6b24
feat: btc send flow e2e (#28340)
montelaidev Nov 13, 2024
6bb750a
fix: Default to dApp suggested fees only when user selects the option…
pedronfigueiredo Nov 13, 2024
15f7125
perf: Create custom spans for account overview tabs (#28086)
MajorLift Nov 13, 2024
8a87315
fix: Update PortfolioView flag (#28446)
darkwing Nov 13, 2024
e9ffd0a
feat: update signature controller and integrate decoding api (#28397)
jpuri Nov 13, 2024
0a5eb58
chore: Begin introducing patterns for Multichain AssetList (#28429)
gambinish Nov 14, 2024
c5c59df
fix: Hide "interacting with" when simulated balance changes are shown…
pedronfigueiredo Nov 14, 2024
b7c3f83
fix: Remove multiple overlapping spinners (#28301)
pedronfigueiredo Nov 14, 2024
072c8c7
fix: ui customizations for redesigned transactions (#28443)
cryptotavares Nov 14, 2024
8441041
test: Improve test for signatures (#27532)
pnarayanaswamy Nov 14, 2024
c174ca7
fix: Fix attribution generation (#28415)
Gudahtt Nov 14, 2024
1934a4e
feat: add simulation metrics when simulation UI is not visible (#28427)
digiwand Nov 14, 2024
12246e1
fix: Allow outerclick to close import modal (#28448)
darkwing Nov 14, 2024
1c8bfff
fix: dont poll token prices during onboarding or when locked (#28465)
bergeron Nov 14, 2024
2367e4e
feat: UI changes to show decoding data for permits (#28342)
jpuri Nov 15, 2024
5990644
test: [POM] Migrate vault decryption e2e tests to TS and Page Object …
chloeYue Nov 15, 2024
010b560
chore: Fix flaky ERC20 transfer blockaid e2e (#28453)
jpuri Nov 15, 2024
4d5940e
chore: fix test path on CI (#28482)
chloeYue Nov 15, 2024
dbe5947
fix: Fix race condition validating ERC20 transfer (blockaid) (#28487)
vinistevam Nov 15, 2024
1700422
fix: display btc account creation while in settings (#28379)
montelaidev Nov 15, 2024
a597a8e
feat: Upgrade assets controllers to 43 with multichain polling for to…
bergeron Nov 15, 2024
92da4de
Merge origin/develop into master-sync
danjm Nov 15, 2024
8d60de9
Merge pull request #28459 from MetaMask/master-sync
danjm Nov 15, 2024
e78d479
Version v12.8.0
metamaskbot Nov 15, 2024
5fa1028
Update Attributions
metamaskbot Nov 15, 2024
ec359ed
chore: Fix changelog title v12.8.0 (#28505)
hjetpoluru Nov 15, 2024
2d84732
[cherry pick] chore: Reduce E2E test jobs run on PRs (#28525) (#28621)
Gudahtt Nov 21, 2024
034222a
Merge remote-tracking branch 'origin/master' into merge-master-12.7.2…
danjm Nov 27, 2024
5453b96
Lint changelog
danjm Nov 27, 2024
0ad9990
Merge pull request #28771 from MetaMask/merge-master-12.7.2-12.8.0
danjm Nov 28, 2024
0304023
chore: Changelog v12.8.0 (#28692)
hjetpoluru Dec 2, 2024
8e074a6
fix(cherry-pick): use PORTFOLIO_VIEW flag to determine chain polling …
bergeron Dec 2, 2024
d909bde
fix(cherry-pick): use PORTFOLIO_VIEW flag to determine token list pol…
bergeron Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 7 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ workflows:
requires:
- prep-deps
- test-e2e-chrome-webpack:
<<: *develop_master_rc_only
requires:
- prep-build-test-webpack
- get-changed-files-with-git-diff
Expand All @@ -205,6 +206,7 @@ workflows:
- prep-build-test
- get-changed-files-with-git-diff
- test-e2e-firefox:
<<: *develop_master_rc_only
requires:
- prep-build-test-mv2
- get-changed-files-with-git-diff
Expand Down Expand Up @@ -234,6 +236,9 @@ workflows:
- test-e2e-mmi-playwright:
requires:
- prep-build-test-mmi-playwright
- test-e2e-swap-playwright - OPTIONAL:
requires:
- prep-build
- test-e2e-chrome-rpc-mmi:
requires:
- prep-build-test-mmi
Expand Down Expand Up @@ -444,7 +449,7 @@ jobs:
- gh/install
- run:
name: Install dependencies
command: .circleci/scripts/install-dependencies.sh
command: yarn --immutable
- save_cache:
key: dependency-cache-{{ checksum "/tmp/YARN_VERSION" }}-{{ checksum "yarn.lock" }}
paths:
Expand Down Expand Up @@ -1192,7 +1197,7 @@ jobs:
at: .
- run:
name: test:e2e:single
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.js --browser chrome
command: .circleci/scripts/test-run-e2e.sh yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.ts --browser chrome
no_output_timeout: 5m
- store_artifacts:
path: test-artifacts
Expand Down
6 changes: 5 additions & 1 deletion .circleci/scripts/git-diff-develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type PRInfo = {
ref: string;
};
body: string;
labels: { name: string }[];
};

/**
Expand Down Expand Up @@ -123,7 +124,7 @@ async function storeGitDiffOutputAndPrBody() {
fs.mkdirSync(CHANGED_FILES_DIR, { recursive: true });

console.log(
`Determining whether this run is for a PR targeting ${MAIN_BRANCH}`,
`Determining whether to run git diff...`,
);
if (!PR_NUMBER) {
console.log('Not a PR, skipping git diff');
Expand All @@ -140,6 +141,9 @@ async function storeGitDiffOutputAndPrBody() {
console.log(`This is for a PR targeting '${baseRef}', skipping git diff`);
writePrBodyToFile(prInfo.body);
return;
} else if (prInfo.labels.some(label => label.name === 'skip-e2e-quality-gate')) {
console.log('PR has the skip-e2e-quality-gate label, skipping git diff');
return;
}

console.log('Attempting to get git diff...');
Expand Down
42 changes: 0 additions & 42 deletions .circleci/scripts/install-dependencies.sh

This file was deleted.

1 change: 0 additions & 1 deletion .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ ignores:
- 'crypto-browserify' # polyfill
- 'process' # polyfill
- 'stream-http' # polyfill
- 'rimraf' # misc: install helper
- 'json-schema-to-ts' # misc: typescript helper
- 'https-browserify' # polyfill
- 'path-browserify' # polyfill
Expand Down
25 changes: 25 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,5 +472,30 @@ module.exports = {
'@metamask/design-tokens/color-no-hex': 'off',
},
},
{
files: ['ui/pages/confirmations/**/*.{js,ts,tsx}'],
rules: {
'no-restricted-syntax': [
'error',
{
selector: `ImportSpecifier[imported.name=/${[
'getConversionRate',
'getCurrentChainId',
'getNativeCurrency',
'getNetworkIdentifier',
'getNftContracts',
'getNfts',
'getProviderConfig',
'getRpcPrefsForCurrentProvider',
'getUSDConversionRate',
'isCurrentProviderCustom',
]
.map((method) => `(${method})`)
.join('|')}/]`,
message: 'Avoid using global network selectors in confirmations',
},
],
},
},
],
};
6 changes: 2 additions & 4 deletions .github/workflows/add-team-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:

jobs:
add-team-label:
uses: metamask/github-tools/.github/workflows/add-team-label.yml@058012b49ff2fbd9649c566ba43b29497f93b21d
permissions:
pull-requests: write
uses: metamask/github-tools/.github/workflows/add-team-label.yml@18af6e4b56a18230d1792480e249ebc50b324927
secrets:
PERSONAL_ACCESS_TOKEN: ${{ secrets.RELEASE_LABEL_TOKEN }}
TEAM_LABEL_TOKEN: ${{ secrets.TEAM_LABEL_TOKEN }}
5 changes: 3 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import MetaMetricsProviderStorybook from './metametrics';
import testData from './test-data.js';
import { Router } from 'react-router-dom';
import { createBrowserHistory } from 'history';
import { MemoryRouter } from 'react-router-dom';
import { setBackgroundConnection } from '../ui/store/background-connection';
import { metamaskStorybookTheme } from './metamask-storybook-theme';
import { DocsContainer } from '@storybook/addon-docs';
Expand Down Expand Up @@ -147,7 +148,7 @@ const metamaskDecorator = (story, context) => {

return (
<Provider store={store}>
<Router history={history}>
<MemoryRouter>
<MetaMetricsProviderStorybook>
<AlertMetricsProvider
metrics={{
Expand All @@ -165,7 +166,7 @@ const metamaskDecorator = (story, context) => {
</I18nProvider>
</AlertMetricsProvider>
</MetaMetricsProviderStorybook>
</Router>
</MemoryRouter>
</Provider>
);
};
Expand Down
15 changes: 15 additions & 0 deletions .yarn/patches/@ledgerhq-evm-tools-npm-1.2.3-414f44baa9.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/lib/message/EIP712/index.js b/lib/message/EIP712/index.js
index 5443ac06d4ef29028e3acce98210949da2ef9263..57ec8615340a9285290ad5d2c2522ed19af2d0fc 100644
--- a/lib/message/EIP712/index.js
+++ b/lib/message/EIP712/index.js
@@ -28,8 +28,8 @@ const ethers_1 = require("ethers");
const axios_1 = __importDefault(require("axios"));
const sha224_1 = __importDefault(require("crypto-js/sha224"));
const live_env_1 = require("@ledgerhq/live-env");
-const eip712_1 = __importDefault(require("@ledgerhq/cryptoassets-evm-signatures/data/eip712"));
-const eip712_v2_1 = __importDefault(require("@ledgerhq/cryptoassets-evm-signatures/data/eip712_v2"));
+const eip712_1 = __importDefault(require("@ledgerhq/cryptoassets-evm-signatures/lib/data/eip712"));
+const eip712_v2_1 = __importDefault(require("@ledgerhq/cryptoassets-evm-signatures/lib/data/eip712_v2"));
// As defined in [spec](https://eips.ethereum.org/EIPS/eip-712), the properties below are all required.
function isEIP712Message(message) {
return (!!message &&
65 changes: 65 additions & 0 deletions .yarn/patches/@ledgerhq-hw-app-eth-npm-6.39.0-866309bbbe.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
diff --git a/lib/modules/EIP712/index.js b/lib/modules/EIP712/index.js
index bbca23c9a596b2b300aca0f323bad277a4190def..c85cb18c3d6ff049c442d358b4d834c04a49951f 100644
--- a/lib/modules/EIP712/index.js
+++ b/lib/modules/EIP712/index.js
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.signEIP712HashedMessage = exports.signEIP712Message = void 0;
/* eslint-disable @typescript-eslint/no-duplicate-enum-values */
const semver_1 = __importDefault(require("semver"));
-const index_1 = require("@ledgerhq/evm-tools/message/EIP712/index");
+const index_1 = require("@ledgerhq/evm-tools/lib/message/EIP712/index");
const erc20_1 = require("../../services/ledger/erc20");
const utils_1 = require("../../utils");
const loadConfig_1 = require("../../services/ledger/loadConfig");
diff --git a/lib/modules/EIP712/utils.js b/lib/modules/EIP712/utils.js
index 4f09ea8a24ae4f175f1a4d2d40999d36ffa2a915..1cc7de0d5ffd2b980741ad6d85a75792085c031b 100644
--- a/lib/modules/EIP712/utils.js
+++ b/lib/modules/EIP712/utils.js
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPayloadForFilterV2 = exports.getFilterDisplayNameAndSigBuffers = exports.getAppAndVersion = exports.getCoinRefTokensMap = exports.makeTypeEntryStructBuffer = exports.constructTypeDescByteString = exports.destructTypeFromString = exports.EIP712_TYPE_ENCODERS = exports.EIP712_TYPE_PROPERTIES = void 0;
const bignumber_js_1 = __importDefault(require("bignumber.js"));
-const index_1 = require("@ledgerhq/evm-tools/message/index");
+const index_1 = require("@ledgerhq/evm-tools/lib/message/index");
const utils_1 = require("../../utils");
/**
* @ignore for the README
diff --git a/lib/services/ledger/erc20.js b/lib/services/ledger/erc20.js
index 8fdedf8037b2684ab6d48fd279a0c014b074b676..c10cea22504a4d3cd72bfac51463e5664639d20e 100644
--- a/lib/services/ledger/erc20.js
+++ b/lib/services/ledger/erc20.js
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.byContractAddressAndChainId = exports.findERC20SignaturesInfo = void 0;
const axios_1 = __importDefault(require("axios"));
const logs_1 = require("@ledgerhq/logs");
-const index_1 = require("@ledgerhq/cryptoassets-evm-signatures/data/evm/index");
+const index_1 = require("@ledgerhq/cryptoassets-evm-signatures/lib/data/evm/index");
const loadConfig_1 = require("./loadConfig");
const asContractAddress = (addr) => {
const a = addr.toLowerCase();
diff --git a/lib/services/ledger/index.js b/lib/services/ledger/index.js
index 8385537236dfc98902376b29f712e9f7b605091a..6641b951b0c7e477fe5622c724ee22b9e5272213 100644
--- a/lib/services/ledger/index.js
+++ b/lib/services/ledger/index.js
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
// This implements the resolution of a Transaction using Ledger's own API
const logs_1 = require("@ledgerhq/logs");
const abi_1 = require("@ethersproject/abi");
-const index_1 = require("@ledgerhq/domain-service/signers/index");
+const index_1 = require("@ledgerhq/domain-service/lib/signers/index");
const erc20_1 = require("./erc20");
const contracts_1 = require("./contracts");
const nfts_1 = require("./nfts");
diff --git a/lib/utils.js b/lib/utils.js
index 027089bf09c047b34af79e3dea253d5335d336f3..1c5da628db47a33099532973de9ea634a1ee65df 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -2,7 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeResolutions = exports.nftSelectors = exports.tokenSelectors = exports.intAsHexBytes = exports.decodeTxInfo = exports.maybeHexBuffer = exports.hexBuffer = exports.splitPath = exports.padHexString = exports.ERC1155_CLEAR_SIGNED_SELECTORS = exports.ERC721_CLEAR_SIGNED_SELECTORS = exports.ERC20_CLEAR_SIGNED_SELECTORS = void 0;
const bignumber_js_1 = require("bignumber.js");
-const index_1 = require("@ledgerhq/evm-tools/selectors/index");
+const index_1 = require("@ledgerhq/evm-tools/lib/selectors/index");
Object.defineProperty(exports, "ERC20_CLEAR_SIGNED_SELECTORS", { enumerable: true, get: function () { return index_1.ERC20_CLEAR_SIGNED_SELECTORS; } });
Object.defineProperty(exports, "ERC721_CLEAR_SIGNED_SELECTORS", { enumerable: true, get: function () { return index_1.ERC721_CLEAR_SIGNED_SELECTORS; } });
Object.defineProperty(exports, "ERC1155_CLEAR_SIGNED_SELECTORS", { enumerable: true, get: function () { return index_1.ERC1155_CLEAR_SIGNED_SELECTORS; } });
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
diff --git a/dist/assetsUtil.cjs b/dist/assetsUtil.cjs
index e90a1b6767bc8ac54b7a4d580035cf5db6861dca..a5e0f03d2541b4e3540431ef2e6e4b60fb7ae9fe 100644
index c2e83cf6caee19152aa164f1333cfef7b681e900..590b6de6e9d20ca402b82ac56b0929ab8c16c932 100644
--- a/dist/assetsUtil.cjs
+++ b/dist/assetsUtil.cjs
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
+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; } }
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;
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;
const controller_utils_1 = require("@metamask/controller-utils");
const utils_1 = require("@metamask/utils");
@@ -221,7 +222,7 @@ async function getIpfsCIDv1AndPath(ipfsUrl) {
@@ -233,7 +234,7 @@ async function getIpfsCIDv1AndPath(ipfsUrl) {
const index = url.indexOf('/');
const cid = index !== -1 ? url.substring(0, index) : url;
const path = index !== -1 ? url.substring(index) : undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
diff --git a/dist/TokenDetectionController.cjs b/dist/TokenDetectionController.cjs
index ab23c95d667357db365f925c4c4acce4736797f8..8fd5efde7a3c24080f8a43f79d10300e8c271245 100644
--- a/dist/TokenDetectionController.cjs
+++ b/dist/TokenDetectionController.cjs
@@ -204,13 +204,10 @@ class TokenDetectionController extends (0, polling_controller_1.StaticIntervalPo
// Try detecting tokens via Account API first if conditions allow
if (supportedNetworks && chainsToDetectUsingAccountAPI.length > 0) {
const apiResult = await __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_attemptAccountAPIDetection).call(this, chainsToDetectUsingAccountAPI, addressToDetect, supportedNetworks);
- // If API succeeds and no chains are left for RPC detection, we can return early
- if (apiResult?.result === 'success' &&
- chainsToDetectUsingRpc.length === 0) {
- return;
+ // If the account API call failed, have those chains fall back to RPC detection
+ if (apiResult?.result === 'failed') {
+ __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks);
}
- // If API fails or chainsToDetectUsingRpc still has items, add chains to RPC detection
- __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks);
}
// Proceed with RPC detection if there are chains remaining in chainsToDetectUsingRpc
if (chainsToDetectUsingRpc.length > 0) {
@@ -446,8 +443,7 @@ async function _TokenDetectionController_addDetectedTokensViaAPI({ selectedAddre
const tokenBalancesByChain = await __classPrivateFieldGet(this, _TokenDetectionController_accountsAPI, "f")
.getMultiNetworksBalances(selectedAddress, chainIds, supportedNetworks)
.catch(() => null);
- if (!tokenBalancesByChain ||
- Object.keys(tokenBalancesByChain).length === 0) {
+ if (tokenBalancesByChain === null) {
return { result: 'failed' };
}
// Process each chain ID individually
diff --git a/dist/TokenDetectionController.mjs b/dist/TokenDetectionController.mjs
index f75eb5c2c74f2a9d15a79760985111171dc938e1..ebc30bb915cc39dabf49f9e0da84a7948ae1ed48 100644
--- a/dist/TokenDetectionController.mjs
+++ b/dist/TokenDetectionController.mjs
@@ -205,13 +205,10 @@ export class TokenDetectionController extends StaticIntervalPollingController()
// Try detecting tokens via Account API first if conditions allow
if (supportedNetworks && chainsToDetectUsingAccountAPI.length > 0) {
const apiResult = await __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_attemptAccountAPIDetection).call(this, chainsToDetectUsingAccountAPI, addressToDetect, supportedNetworks);
- // If API succeeds and no chains are left for RPC detection, we can return early
- if (apiResult?.result === 'success' &&
- chainsToDetectUsingRpc.length === 0) {
- return;
+ // If the account API call failed, have those chains fall back to RPC detection
+ if (apiResult?.result === 'failed') {
+ __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks);
}
- // If API fails or chainsToDetectUsingRpc still has items, add chains to RPC detection
- __classPrivateFieldGet(this, _TokenDetectionController_instances, "m", _TokenDetectionController_addChainsToRpcDetection).call(this, chainsToDetectUsingRpc, chainsToDetectUsingAccountAPI, clientNetworks);
}
// Proceed with RPC detection if there are chains remaining in chainsToDetectUsingRpc
if (chainsToDetectUsingRpc.length > 0) {
@@ -446,8 +443,7 @@ async function _TokenDetectionController_addDetectedTokensViaAPI({ selectedAddre
const tokenBalancesByChain = await __classPrivateFieldGet(this, _TokenDetectionController_accountsAPI, "f")
.getMultiNetworksBalances(selectedAddress, chainIds, supportedNetworks)
.catch(() => null);
- if (!tokenBalancesByChain ||
- Object.keys(tokenBalancesByChain).length === 0) {
+ if (tokenBalancesByChain === null) {
return { result: 'failed' };
}
// Process each chain ID individually
Loading
Loading