From 046766c11c6ee455c0695285a5352daf77e2c7fd Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Fri, 7 Jun 2024 05:44:54 -0230 Subject: [PATCH 001/236] v12.0.0 --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8bc947c4c01..b3c3a60bf10d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [12.0.0] + ## [11.16.7] ### Fixed - Fix bug that breaks dapps that expect users to switch chains manually([#25046]https://github.com/MetaMask/metamask-extension/pull/25046) @@ -4785,7 +4787,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.16.7...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.0.0...HEAD +[12.0.0]: https://github.com/MetaMask/metamask-extension/compare/v11.16.7...v12.0.0 [11.16.7]: https://github.com/MetaMask/metamask-extension/compare/v11.16.6...v11.16.7 [11.16.6]: https://github.com/MetaMask/metamask-extension/compare/v11.16.5...v11.16.6 [11.16.5]: https://github.com/MetaMask/metamask-extension/compare/v11.16.4...v11.16.5 diff --git a/package.json b/package.json index 731be3eb1e75..e5d4671a35af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "11.16.7", + "version": "12.0.0", "private": true, "repository": { "type": "git", From 169292b507fcb617e1b1b111ae18f1533fa5d8fd Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 6 Jun 2024 20:44:12 -0230 Subject: [PATCH 002/236] Version bump --- CHANGELOG.md | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8bc947c4c01..451760e45c8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [11.16.8] + ## [11.16.7] ### Fixed - Fix bug that breaks dapps that expect users to switch chains manually([#25046]https://github.com/MetaMask/metamask-extension/pull/25046) @@ -4785,7 +4787,8 @@ Update styles and spacing on the critical error page ([#20350](https://github.c - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.16.7...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.16.8...HEAD +[11.16.8]: https://github.com/MetaMask/metamask-extension/compare/v11.16.7...v11.16.8 [11.16.7]: https://github.com/MetaMask/metamask-extension/compare/v11.16.6...v11.16.7 [11.16.6]: https://github.com/MetaMask/metamask-extension/compare/v11.16.5...v11.16.6 [11.16.5]: https://github.com/MetaMask/metamask-extension/compare/v11.16.4...v11.16.5 diff --git a/package.json b/package.json index 42c2331a91f4..ee5930c1a41d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "11.16.7", + "version": "11.16.8", "private": true, "repository": { "type": "git", From 907b36d40be03686a6e520d3abf342658c1b8905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Regadas?= Date: Mon, 20 May 2024 10:53:48 +0100 Subject: [PATCH 003/236] chore: bumps MMI packages (#24581) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A few packages updates for MMI. Fixes: 1. Go to this page... 2. 3. - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: MetaMask Bot --- .../controllers/mmi-controller.test.ts | 12 +- lavamoat/browserify/mmi/policy.json | 48 +- package.json | 16 +- test/e2e/mmi/pageObjects/mmi-dummyApp-page.ts | 2 +- yarn.lock | 463 +++++++++++++++--- 5 files changed, 414 insertions(+), 127 deletions(-) diff --git a/app/scripts/controllers/mmi-controller.test.ts b/app/scripts/controllers/mmi-controller.test.ts index df8de77c2212..b926be047da5 100644 --- a/app/scripts/controllers/mmi-controller.test.ts +++ b/app/scripts/controllers/mmi-controller.test.ts @@ -201,10 +201,10 @@ describe('MMIController', function () { initState: { custodyAccountDetails: { [mockAccount.address]: { - custodyType: 'Custody - Jupiter', + custodyType: 'Custody - ECA3', }, [mockAccount2.address]: { - custodyType: 'Custody - Jupiter', + custodyType: 'Custody - ECA3', }, }, }, @@ -438,11 +438,11 @@ describe('MMIController', function () { getCustodianAccounts: mockCustodialKeyring, }); - await mmiController.getCustodianAccounts('token', 'mock url', 'JUPITER'); + await mmiController.getCustodianAccounts('token', 'neptune-custody', 'ECA3'); expect(selectedAccountSpy).toHaveBeenCalledTimes(0); - expect(keyringControllerSpy).toHaveBeenCalledWith('Custody - Jupiter'); + expect(keyringControllerSpy).toHaveBeenCalledWith('Custody - ECA3'); expect(mockCustodialKeyring).toHaveBeenCalled(); }); @@ -454,14 +454,14 @@ describe('MMIController', function () { getCustodianAccounts: mockCustodialKeyring, }); - await mmiController.getCustodianAccounts('token', 'mock url'); + await mmiController.getCustodianAccounts('token', 'neptune-custody'); expect(selectedAccountSpy).toHaveBeenCalledWith( 'AccountsController:getSelectedAccount', ); expect(selectedAccountSpy).toHaveReturnedWith(mockAccount); - expect(keyringControllerSpy).toHaveBeenCalledWith('Custody - Jupiter'); + expect(keyringControllerSpy).toHaveBeenCalledWith('Custody - ECA3'); expect(mockCustodialKeyring).toHaveBeenCalled(); }); }); diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index f18cd7e33cbe..87087d18fde1 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -765,57 +765,17 @@ "globals": { "URLSearchParams": true, "console.debug": true, + "console.error": true, "console.log": true, "console.warn": true, "fetch": true }, "packages": { "@metamask-institutional/sdk>@metamask-institutional/simplecache": true, - "@metamask-institutional/sdk>jsonwebtoken": true, "browserify>crypto-browserify": true, "webpack>events": true } }, - "@metamask-institutional/sdk>jsonwebtoken": { - "packages": { - "@metamask-institutional/sdk>jsonwebtoken>jws": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "browserify>process": true, - "lodash": true, - "mocha>ms": true, - "semver": true - } - }, - "@metamask-institutional/sdk>jsonwebtoken>jws": { - "packages": { - "@metamask-institutional/sdk>jsonwebtoken>jws>jwa": true, - "browserify>buffer": true, - "browserify>process": true, - "browserify>util": true, - "koa>content-disposition>safe-buffer": true, - "stream-browserify": true - } - }, - "@metamask-institutional/sdk>jsonwebtoken>jws>jwa": { - "packages": { - "@metamask-institutional/sdk>jsonwebtoken>jws>jwa>buffer-equal-constant-time": true, - "@metamask-institutional/sdk>jsonwebtoken>jws>jwa>ecdsa-sig-formatter": true, - "browserify>crypto-browserify": true, - "browserify>util": true, - "koa>content-disposition>safe-buffer": true - } - }, - "@metamask-institutional/sdk>jsonwebtoken>jws>jwa>buffer-equal-constant-time": { - "packages": { - "browserify>buffer": true - } - }, - "@metamask-institutional/sdk>jsonwebtoken>jws>jwa>ecdsa-sig-formatter": { - "packages": { - "koa>content-disposition>safe-buffer": true - } - }, "@metamask-institutional/transaction-update": { "globals": { "clearInterval": true, @@ -824,10 +784,10 @@ "setInterval": true }, "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, "@metamask-institutional/sdk": true, "@metamask-institutional/transaction-update>@metamask-institutional/websocket-client": true, - "@metamask/obs-store": true, - "ethereumjs-util": true, + "@metamask-institutional/transaction-update>@metamask/obs-store": true, "webpack>events": true } }, @@ -5153,4 +5113,4 @@ } } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index ee5930c1a41d..2b2c07066a25 100644 --- a/package.json +++ b/package.json @@ -270,14 +270,14 @@ "@lavamoat/lavadome-react": "0.0.17", "@lavamoat/snow": "^2.0.1", "@material-ui/core": "^4.11.0", - "@metamask-institutional/custody-controller": "^0.2.24", - "@metamask-institutional/custody-keyring": "^1.0.12", - "@metamask-institutional/extension": "^0.3.20", - "@metamask-institutional/institutional-features": "^1.2.15", - "@metamask-institutional/portfolio-dashboard": "^1.4.0", - "@metamask-institutional/rpc-allowlist": "1.0.3", - "@metamask-institutional/sdk": "^0.1.25", - "@metamask-institutional/transaction-update": "^0.2.0", + "@metamask-institutional/custody-controller": "^0.2.27", + "@metamask-institutional/custody-keyring": "^2.0.0", + "@metamask-institutional/extension": "^0.3.24", + "@metamask-institutional/institutional-features": "^1.3.2", + "@metamask-institutional/portfolio-dashboard": "^1.4.1", + "@metamask-institutional/rpc-allowlist": "^1.0.3", + "@metamask-institutional/sdk": "^0.1.26", + "@metamask-institutional/transaction-update": "^0.2.2", "@metamask/abi-utils": "^2.0.2", "@metamask/accounts-controller": "^11.0.0", "@metamask/address-book-controller": "^3.1.7", diff --git a/test/e2e/mmi/pageObjects/mmi-dummyApp-page.ts b/test/e2e/mmi/pageObjects/mmi-dummyApp-page.ts index 363f86bd1d08..99b2d2329ffb 100644 --- a/test/e2e/mmi/pageObjects/mmi-dummyApp-page.ts +++ b/test/e2e/mmi/pageObjects/mmi-dummyApp-page.ts @@ -59,7 +59,7 @@ export class DummyAppPage { await popup.waitForLoadState(); if (isSign) { - await popup.click('button:has-text("Sign")'); + await popup.click('button:has-text("Confirm")'); } else { // Confirm await popup.getByTestId('page-container-footer-next').click(); diff --git a/yarn.lock b/yarn.lock index a7716262981d..8a4650110bd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -337,7 +337,14 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.24.6, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": + version: 7.22.5 + resolution: "@babel/helper-plugin-utils@npm:7.22.5" + checksum: ab220db218089a2aadd0582f5833fd17fa300245999f5f8784b10f5a75267c4e808592284a29438a0da365e702f05acb369f99e1c915c02f9f9210ec60eab8ea + languageName: node + linkType: hard + +"@babel/helper-plugin-utils@npm:^7.24.6": version: 7.24.6 resolution: "@babel/helper-plugin-utils@npm:7.24.6" checksum: 0ac0a7a19959fb2f880ea87650475a4960232e98825d9a50f4aa56e5750a70fc799b48cf570af63a06b810d0128e758e801865762b51a8348067e37751a38478 @@ -451,7 +458,7 @@ __metadata: languageName: node linkType: hard -"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.22.13, @babel/highlight@npm:^7.24.6": +"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.24.6": version: 7.24.6 resolution: "@babel/highlight@npm:7.24.6" dependencies: @@ -463,6 +470,17 @@ __metadata: languageName: node linkType: hard +"@babel/highlight@npm:^7.22.13": + version: 7.23.4 + resolution: "@babel/highlight@npm:7.23.4" + dependencies: + "@babel/helper-validator-identifier": "npm:^7.22.20" + chalk: "npm:^2.4.2" + js-tokens: "npm:^4.0.0" + checksum: 62fef9b5bcea7131df4626d009029b1ae85332042f4648a4ce6e740c3fd23112603c740c45575caec62f260c96b11054d3be5987f4981a5479793579c3aac71f + languageName: node + linkType: hard + "@babel/parser@npm:7.16.4": version: 7.16.4 resolution: "@babel/parser@npm:7.16.4" @@ -490,6 +508,15 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.22.15": + version: 7.24.4 + resolution: "@babel/parser@npm:7.24.4" + bin: + parser: ./bin/babel-parser.js + checksum: 3742cc5068036287e6395269dce5a2735e6349cdc8d4b53297c75f98c580d7e1c8cb43235623999d151f2ef975d677dbc2c2357573a1855caa71c271bf3046c9 + languageName: node + linkType: hard + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.22.15": version: 7.22.15 resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.22.15" @@ -681,7 +708,18 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-jsx@npm:^7.22.5, @babel/plugin-syntax-jsx@npm:^7.24.6, @babel/plugin-syntax-jsx@npm:^7.7.2": +"@babel/plugin-syntax-jsx@npm:^7.22.5, @babel/plugin-syntax-jsx@npm:^7.7.2": + version: 7.22.5 + resolution: "@babel/plugin-syntax-jsx@npm:7.22.5" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.22.5" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 8829d30c2617ab31393d99cec2978e41f014f4ac6f01a1cecf4c4dd8320c3ec12fdc3ce121126b2d8d32f6887e99ca1a0bad53dedb1e6ad165640b92b24980ce + languageName: node + linkType: hard + +"@babel/plugin-syntax-jsx@npm:^7.24.6": version: 7.24.6 resolution: "@babel/plugin-syntax-jsx@npm:7.24.6" dependencies: @@ -1664,7 +1702,18 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.22.15, @babel/template@npm:^7.22.5, @babel/template@npm:^7.24.6, @babel/template@npm:^7.3.3": +"@babel/template@npm:^7.22.15, @babel/template@npm:^7.22.5, @babel/template@npm:^7.3.3": + version: 7.22.15 + resolution: "@babel/template@npm:7.22.15" + dependencies: + "@babel/code-frame": "npm:^7.22.13" + "@babel/parser": "npm:^7.22.15" + "@babel/types": "npm:^7.22.15" + checksum: 21e768e4eed4d1da2ce5d30aa51db0f4d6d8700bc1821fec6292587df7bba2fe1a96451230de8c64b989740731888ebf1141138bfffb14cacccf4d05c66ad93f + languageName: node + linkType: hard + +"@babel/template@npm:^7.24.6": version: 7.24.6 resolution: "@babel/template@npm:7.24.6" dependencies: @@ -3097,6 +3146,13 @@ __metadata: languageName: node linkType: hard +"@gar/promisify@npm:^1.1.3": + version: 1.1.3 + resolution: "@gar/promisify@npm:1.1.3" + checksum: 052dd232140fa60e81588000cbe729a40146579b361f1070bce63e2a761388a22a16d00beeffc504bd3601cb8e055c57b21a185448b3ed550cf50716f4fd442e + languageName: node + linkType: hard + "@graphql-tools/merge@npm:8.3.1": version: 8.3.1 resolution: "@graphql-tools/merge@npm:8.3.1" @@ -3942,80 +3998,80 @@ __metadata: languageName: node linkType: hard -"@metamask-institutional/custody-controller@npm:^0.2.24, @metamask-institutional/custody-controller@npm:^0.2.25": - version: 0.2.25 - resolution: "@metamask-institutional/custody-controller@npm:0.2.25" +"@metamask-institutional/custody-controller@npm:^0.2.27": + version: 0.2.27 + resolution: "@metamask-institutional/custody-controller@npm:0.2.27" dependencies: "@ethereumjs/util": "npm:^8.0.5" - "@metamask-institutional/custody-keyring": "npm:^1.1.0" - "@metamask-institutional/sdk": "npm:^0.1.26" + "@metamask-institutional/custody-keyring": "npm:^2.0.0" + "@metamask-institutional/sdk": "npm:^0.1.27" "@metamask-institutional/types": "npm:^1.1.0" "@metamask/obs-store": "npm:^8.0.0" - checksum: 38ad630637730180bed372f058d8fd0c7a11002b8664ce01c725d8ef8559a593761463adf09245ecda11e14d52e305b9fdba8438dae87622f833317265cd6253 + checksum: b834477c4551fdbd56143742038f1b101cb72b1655380a63d6d84416af949b259109a22967d3233009d737400f656c91ba100dcb61522eb14e6715564f07e404 languageName: node linkType: hard -"@metamask-institutional/custody-keyring@npm:^1.0.12, @metamask-institutional/custody-keyring@npm:^1.1.0": - version: 1.1.0 - resolution: "@metamask-institutional/custody-keyring@npm:1.1.0" +"@metamask-institutional/custody-keyring@npm:^2.0.0": + version: 2.0.0 + resolution: "@metamask-institutional/custody-keyring@npm:2.0.0" dependencies: "@ethereumjs/tx": "npm:^4.1.1" "@ethereumjs/util": "npm:^8.0.5" "@metamask-institutional/configuration-client": "npm:^2.0.1" - "@metamask-institutional/sdk": "npm:^0.1.26" + "@metamask-institutional/sdk": "npm:^0.1.27" "@metamask-institutional/types": "npm:^1.1.0" "@metamask/obs-store": "npm:^8.0.0" crypto: "npm:^1.0.1" lodash.clonedeep: "npm:^4.5.0" - checksum: 26d43168f8d398c6e391b6200ad36fa7b57ad2bb735812c4a9bc2b8a8cbf19fd8f3c547f4b3c6a82e199687e787549b8c95271ea049795e82974f4df4ba0d3c7 + checksum: 14563443d157d97554ab4456c69ecba52aacde9659bcdc5b20724a3cf7c626c3ef624446823ceafbf3aa25307e89f0dc09636e8db49f49f48d5d7c6b37f52bf9 languageName: node linkType: hard -"@metamask-institutional/extension@npm:^0.3.20": - version: 0.3.21 - resolution: "@metamask-institutional/extension@npm:0.3.21" +"@metamask-institutional/extension@npm:^0.3.24": + version: 0.3.24 + resolution: "@metamask-institutional/extension@npm:0.3.24" dependencies: "@ethereumjs/util": "npm:^8.0.5" - "@metamask-institutional/custody-controller": "npm:^0.2.25" - "@metamask-institutional/custody-keyring": "npm:^1.1.0" - "@metamask-institutional/portfolio-dashboard": "npm:^1.4.0" - "@metamask-institutional/sdk": "npm:^0.1.26" - "@metamask-institutional/transaction-update": "npm:^0.2.0" + "@metamask-institutional/custody-controller": "npm:^0.2.27" + "@metamask-institutional/custody-keyring": "npm:^2.0.0" + "@metamask-institutional/portfolio-dashboard": "npm:^1.4.1" + "@metamask-institutional/sdk": "npm:^0.1.27" + "@metamask-institutional/transaction-update": "npm:^0.2.2" "@metamask-institutional/types": "npm:^1.1.0" jest-create-mock-instance: "npm:^2.0.0" jest-fetch-mock: "npm:3.0.3" lodash.clonedeep: "npm:^4.5.0" - checksum: 47c2ac21e47d90f6a3166fe5616c45adb785561ff0daab7f333f5b7672d13c9d0c9a7b2b1cb0fc2be656ef902d5c170fb2518cb6d662f0ba9a3f54499b780de7 + checksum: 7ec773d3f98b61d4d6b877e39eec239aca3cb5accaa2211728ddbad32fb6dba5f1c2e7ac7e90e1606bf94995f78dd323cb64a06fa587fd435b7e1592515f73ab languageName: node linkType: hard -"@metamask-institutional/institutional-features@npm:^1.2.15": - version: 1.3.0 - resolution: "@metamask-institutional/institutional-features@npm:1.3.0" +"@metamask-institutional/institutional-features@npm:^1.3.2": + version: 1.3.2 + resolution: "@metamask-institutional/institutional-features@npm:1.3.2" dependencies: - "@metamask-institutional/custody-keyring": "npm:^1.1.0" + "@metamask-institutional/custody-keyring": "npm:^2.0.0" "@metamask/obs-store": "npm:^8.0.0" - checksum: 7b5bb9d7999443a8ec304891c0fde51c17111337f7aa092c08caf8f5195d56d73318f2b3e85b7cef55cd8c5c230271eb9927e73d12245cd86e696c25d2e539c5 + checksum: be5e8722c1180cf7127ee4c7cab0b26a60cb56e7bf0147836b496496bc6ada4de3e0265b97118ba4229ae6a847188097ed7175d51d689c5898e381fe54707aa9 languageName: node linkType: hard -"@metamask-institutional/portfolio-dashboard@npm:^1.4.0": +"@metamask-institutional/portfolio-dashboard@npm:^1.4.1": version: 1.4.1 resolution: "@metamask-institutional/portfolio-dashboard@npm:1.4.1" checksum: 75573d236d2dd709bcf8d0c92f69eb71f07de4ed02ef3f5122f2acf5cf29e41c9e17b14c67cea4f200e64ce2e9a6c60bc5e85508f77aa904f9bbbcf65e5efb10 languageName: node linkType: hard -"@metamask-institutional/rpc-allowlist@npm:1.0.3": +"@metamask-institutional/rpc-allowlist@npm:^1.0.3": version: 1.0.3 resolution: "@metamask-institutional/rpc-allowlist@npm:1.0.3" checksum: caed69a7855328d3261f7499bc024c772fc61f050c574c9e76a0dc565779e9d842a89ed01af33eaf268ac6b3b3624be7b7a8183329f734d08751ee98d5c18472 languageName: node linkType: hard -"@metamask-institutional/sdk@npm:^0.1.25, @metamask-institutional/sdk@npm:^0.1.26": - version: 0.1.26 - resolution: "@metamask-institutional/sdk@npm:0.1.26" +"@metamask-institutional/sdk@npm:^0.1.26, @metamask-institutional/sdk@npm:^0.1.27": + version: 0.1.27 + resolution: "@metamask-institutional/sdk@npm:0.1.27" dependencies: "@metamask-institutional/simplecache": "npm:^1.1.0" "@metamask-institutional/types": "npm:^1.1.0" @@ -4023,7 +4079,7 @@ __metadata: "@types/node": "npm:^20.11.17" bignumber.js: "npm:^9.1.1" jsonwebtoken: "npm:^9.0.0" - checksum: 3fda158c16ed832a30cf5157d6d33896780323f1e50755bc6d1f1a070188334dd38a276673f44b46cb824bf653fa4a1123c3d878276bd55e93491aecacb9df72 + checksum: 9de0d737cab194c8f16a63f92bade1265667f2042c4449bdde60240afb09cdfb71c2b583fbd629a9c72c43530b8d6816def91601aa517c8b47b0b2d473095397 languageName: node linkType: hard @@ -4034,17 +4090,17 @@ __metadata: languageName: node linkType: hard -"@metamask-institutional/transaction-update@npm:^0.2.0": - version: 0.2.0 - resolution: "@metamask-institutional/transaction-update@npm:0.2.0" +"@metamask-institutional/transaction-update@npm:^0.2.2": + version: 0.2.2 + resolution: "@metamask-institutional/transaction-update@npm:0.2.2" dependencies: - "@metamask-institutional/custody-keyring": "npm:^1.1.0" - "@metamask-institutional/sdk": "npm:^0.1.26" + "@ethereumjs/util": "npm:^8.0.5" + "@metamask-institutional/custody-keyring": "npm:^2.0.0" + "@metamask-institutional/sdk": "npm:^0.1.27" "@metamask-institutional/types": "npm:^1.1.0" - "@metamask-institutional/websocket-client": "npm:^0.2.0" + "@metamask-institutional/websocket-client": "npm:^0.2.2" "@metamask/obs-store": "npm:^8.0.0" - ethereumjs-util: "npm:^7.1.5" - checksum: 9f8cd7a6a79e7806c74bfe1b3e9135cfa2b0fff6d8bdcf3699a5fa6b7b23110e4402345ec297168b8210a02ba1af955c4119c1a7baadd74ddcfc0590551b509b + checksum: 31c62a2d207e8e3c2469b870eecb18ff2db450eda8b28c2d428a69cc9eee8a477142f74abebad50c62a6e0f1132dafa8db6b8bf95f43677a401a54b4d3cd5fd0 languageName: node linkType: hard @@ -4055,15 +4111,15 @@ __metadata: languageName: node linkType: hard -"@metamask-institutional/websocket-client@npm:^0.2.0": - version: 0.2.0 - resolution: "@metamask-institutional/websocket-client@npm:0.2.0" +"@metamask-institutional/websocket-client@npm:^0.2.2": + version: 0.2.2 + resolution: "@metamask-institutional/websocket-client@npm:0.2.2" dependencies: - "@metamask-institutional/custody-keyring": "npm:^1.1.0" - "@metamask-institutional/sdk": "npm:^0.1.26" + "@metamask-institutional/custody-keyring": "npm:^2.0.0" + "@metamask-institutional/sdk": "npm:^0.1.27" "@metamask-institutional/types": "npm:^1.1.0" mock-socket: "npm:^9.2.1" - checksum: 181ddcdedc5f8e1a68ce3e325add482a3fde5506c35b5ebcb775f3338cf54640dc88c7622d890a7ad05fb694d56e25e707e56ac796c283c381cec2d79b45892b + checksum: 652ffded926f5064e543e15e01992ec37a588783bc711a6f74404c1984ac5406fa83ab19187f00ae9b81a182cb46be08b0be388f583d68d6b45500969b5b2f46 languageName: node linkType: hard @@ -6351,6 +6407,16 @@ __metadata: languageName: node linkType: hard +"@npmcli/fs@npm:^2.1.0": + version: 2.1.2 + resolution: "@npmcli/fs@npm:2.1.2" + dependencies: + "@gar/promisify": "npm:^1.1.3" + semver: "npm:^7.3.5" + checksum: c5d4dfee80de2236e1e4ed595d17e217aada72ebd8215183fc46096fa010f583dd2aaaa486758de7cc0b89440dbc31cfe8b276269d75d47af35c716e896f78ec + languageName: node + linkType: hard + "@npmcli/fs@npm:^3.1.0": version: 3.1.0 resolution: "@npmcli/fs@npm:3.1.0" @@ -6376,6 +6442,16 @@ __metadata: languageName: node linkType: hard +"@npmcli/move-file@npm:^2.0.0": + version: 2.0.1 + resolution: "@npmcli/move-file@npm:2.0.1" + dependencies: + mkdirp: "npm:^1.0.4" + rimraf: "npm:^3.0.2" + checksum: 52dc02259d98da517fae4cb3a0a3850227bdae4939dda1980b788a7670636ca2b4a01b58df03dd5f65c1e3cb70c50fa8ce5762b582b3f499ec30ee5ce1fd9380 + languageName: node + linkType: hard + "@npmcli/node-gyp@npm:^3.0.0": version: 3.0.0 resolution: "@npmcli/node-gyp@npm:3.0.0" @@ -11372,6 +11448,13 @@ __metadata: languageName: node linkType: hard +"abbrev@npm:^1.0.0": + version: 1.1.1 + resolution: "abbrev@npm:1.1.1" + checksum: 2d882941183c66aa665118bafdab82b7a177e9add5eb2776c33e960a4f3c89cff88a1b38aba13a456de01d0dd9d66a8bea7c903268b21ea91dd1097e1e2e8243 + languageName: node + linkType: hard + "abbrev@npm:^2.0.0": version: 2.0.0 resolution: "abbrev@npm:2.0.0" @@ -11675,7 +11758,7 @@ __metadata: languageName: node linkType: hard -"agentkeepalive@npm:^4.5.0": +"agentkeepalive@npm:^4.2.1, agentkeepalive@npm:^4.5.0": version: 4.5.0 resolution: "agentkeepalive@npm:4.5.0" dependencies: @@ -11971,6 +12054,13 @@ __metadata: languageName: node linkType: hard +"aproba@npm:^1.0.3 || ^2.0.0": + version: 2.0.0 + resolution: "aproba@npm:2.0.0" + checksum: c2b9a631298e8d6f3797547e866db642f68493808f5b37cd61da778d5f6ada890d16f668285f7d60bd4fc3b03889bd590ffe62cf81b700e9bb353431238a0a7b + languageName: node + linkType: hard + "archy@npm:^1.0.0": version: 1.0.0 resolution: "archy@npm:1.0.0" @@ -11985,6 +12075,16 @@ __metadata: languageName: node linkType: hard +"are-we-there-yet@npm:^3.0.0": + version: 3.0.1 + resolution: "are-we-there-yet@npm:3.0.1" + dependencies: + delegates: "npm:^1.0.0" + readable-stream: "npm:^3.6.0" + checksum: 390731720e1bf9ed5d0efc635ea7df8cbc4c90308b0645a932f06e8495a0bf1ecc7987d3b97e805f62a17d6c4b634074b25200aa4d149be2a7b17250b9744bc4 + languageName: node + linkType: hard + "arg@npm:^4.1.0": version: 4.1.3 resolution: "arg@npm:4.1.3" @@ -12881,13 +12981,20 @@ __metadata: languageName: node linkType: hard -"big-integer@npm:1.6.x, big-integer@npm:^1.6.44, big-integer@npm:^1.6.48": +"big-integer@npm:1.6.x": version: 1.6.52 resolution: "big-integer@npm:1.6.52" checksum: 4bc6ae152a96edc9f95020f5fc66b13d26a9ad9a021225a9f0213f7e3dc44269f423aa8c42e19d6ac4a63bb2b22140b95d10be8f9ca7a6d9aa1b22b330d1f514 languageName: node linkType: hard +"big-integer@npm:^1.6.44, big-integer@npm:^1.6.48": + version: 1.6.51 + resolution: "big-integer@npm:1.6.51" + checksum: c7a12640901906d6f6b6bdb42a4eaba9578397b6d9a0dd090cf001ec813ff2bfcd441e364068ea0416db6175d2615f8ed19cff7d1a795115bf7c92d44993f991 + languageName: node + linkType: hard + "big.js@npm:^5.2.2": version: 5.2.2 resolution: "big.js@npm:5.2.2" @@ -13704,6 +13811,32 @@ __metadata: languageName: node linkType: hard +"cacache@npm:^16.1.0": + version: 16.1.3 + resolution: "cacache@npm:16.1.3" + dependencies: + "@npmcli/fs": "npm:^2.1.0" + "@npmcli/move-file": "npm:^2.0.0" + chownr: "npm:^2.0.0" + fs-minipass: "npm:^2.1.0" + glob: "npm:^8.0.1" + infer-owner: "npm:^1.0.4" + lru-cache: "npm:^7.7.1" + minipass: "npm:^3.1.6" + minipass-collect: "npm:^1.0.2" + minipass-flush: "npm:^1.0.5" + minipass-pipeline: "npm:^1.2.4" + mkdirp: "npm:^1.0.4" + p-map: "npm:^4.0.0" + promise-inflight: "npm:^1.0.1" + rimraf: "npm:^3.0.2" + ssri: "npm:^9.0.0" + tar: "npm:^6.1.11" + unique-filename: "npm:^2.0.0" + checksum: a14524d90e377ee691d63a81173b33c473f8bc66eb299c64290b58e1d41b28842397f8d6c15a01b4c57ca340afcec019ae112a45c2f67a79f76130d326472e92 + languageName: node + linkType: hard + "cacache@npm:^18.0.0": version: 18.0.3 resolution: "cacache@npm:18.0.3" @@ -14828,6 +14961,13 @@ __metadata: languageName: node linkType: hard +"console-control-strings@npm:^1.1.0": + version: 1.1.0 + resolution: "console-control-strings@npm:1.1.0" + checksum: 27b5fa302bc8e9ae9e98c03c66d76ca289ad0c61ce2fe20ab288d288bee875d217512d2edb2363fc83165e88f1c405180cf3f5413a46e51b4fe1a004840c6cdb + languageName: node + linkType: hard + "consolidate@npm:^0.16.0": version: 0.16.0 resolution: "consolidate@npm:0.16.0" @@ -19214,7 +19354,7 @@ __metadata: languageName: node linkType: hard -"fs-minipass@npm:^2.0.0": +"fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" dependencies: @@ -19415,6 +19555,22 @@ __metadata: languageName: node linkType: hard +"gauge@npm:^4.0.3": + version: 4.0.4 + resolution: "gauge@npm:4.0.4" + dependencies: + aproba: "npm:^1.0.3 || ^2.0.0" + color-support: "npm:^1.1.3" + console-control-strings: "npm:^1.1.0" + has-unicode: "npm:^2.0.1" + signal-exit: "npm:^3.0.7" + string-width: "npm:^4.2.3" + strip-ansi: "npm:^6.0.1" + wide-align: "npm:^1.1.5" + checksum: 09535dd53b5ced6a34482b1fa9f3929efdeac02f9858569cde73cef3ed95050e0f3d095706c1689614059898924b7a74aa14042f51381a1ccc4ee5c29d2389c4 + languageName: node + linkType: hard + "generic-names@npm:^2.0.1": version: 2.0.1 resolution: "generic-names@npm:2.0.1" @@ -19784,6 +19940,19 @@ __metadata: languageName: node linkType: hard +"glob@npm:^8.0.1": + version: 8.1.0 + resolution: "glob@npm:8.1.0" + dependencies: + fs.realpath: "npm:^1.0.0" + inflight: "npm:^1.0.4" + inherits: "npm:2" + minimatch: "npm:^5.0.1" + once: "npm:^1.3.0" + checksum: 9aab1c75eb087c35dbc41d1f742e51d0507aa2b14c910d96fb8287107a10a22f4bbdce26fc0a3da4c69a20f7b26d62f1640b346a4f6e6becfff47f335bb1dc5e + languageName: node + linkType: hard + "global-agent@npm:^3.0.0": version: 3.0.0 resolution: "global-agent@npm:3.0.0" @@ -20444,6 +20613,13 @@ __metadata: languageName: node linkType: hard +"has-unicode@npm:^2.0.1": + version: 2.0.1 + resolution: "has-unicode@npm:2.0.1" + checksum: 041b4293ad6bf391e21c5d85ed03f412506d6623786b801c4ab39e4e6ca54993f13201bceb544d92963f9e0024e6e7fbf0cb1d84c9d6b31cb9c79c8c990d13d8 + languageName: node + linkType: hard + "has-value@npm:^0.3.1": version: 0.3.1 resolution: "has-value@npm:0.3.1" @@ -20781,7 +20957,7 @@ __metadata: languageName: node linkType: hard -"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.1": +"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.0, http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" checksum: 362d5ed66b12ceb9c0a328fb31200b590ab1b02f4a254a697dc796850cc4385603e75f53ec59f768b2dad3bfa1464bd229f7de278d2899a0e3beffc634b6683f @@ -20924,7 +21100,7 @@ __metadata: languageName: node linkType: hard -"https-proxy-agent@npm:^7.0.1, https-proxy-agent@npm:^7.0.2": +"https-proxy-agent@npm:^7.0.1": version: 7.0.4 resolution: "https-proxy-agent@npm:7.0.4" dependencies: @@ -20934,6 +21110,16 @@ __metadata: languageName: node linkType: hard +"https-proxy-agent@npm:^7.0.2": + version: 7.0.2 + resolution: "https-proxy-agent@npm:7.0.2" + dependencies: + agent-base: "npm:^7.0.2" + debug: "npm:4" + checksum: 9ec844f78fd643608239c9c3f6819918631df5cd3e17d104cc507226a39b5d4adda9d790fc9fd63ac0d2bb8a761b2f9f60faa80584a9bf9d7f2e8c5ed0acd330 + languageName: node + linkType: hard + "human-signals@npm:^1.1.1": version: 1.1.1 resolution: "human-signals@npm:1.1.1" @@ -21119,6 +21305,13 @@ __metadata: languageName: node linkType: hard +"infer-owner@npm:^1.0.4": + version: 1.0.4 + resolution: "infer-owner@npm:1.0.4" + checksum: 181e732764e4a0611576466b4b87dac338972b839920b2a8cde43642e4ed6bd54dc1fb0b40874728f2a2df9a1b097b8ff83b56d5f8f8e3927f837fdcb47d8a89 + languageName: node + linkType: hard + "inflight@npm:^1.0.4": version: 1.0.6 resolution: "inflight@npm:1.0.6" @@ -24436,7 +24629,7 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^7.14.0": +"lru-cache@npm:^7.14.0, lru-cache@npm:^7.7.1": version: 7.18.3 resolution: "lru-cache@npm:7.18.3" checksum: 6029ca5aba3aacb554e919d7ef804fffd4adfc4c83db00fac8248c7c78811fb6d4b6f70f7fd9d55032b3823446546a007edaa66ad1f2377ae833bd983fac5d98 @@ -24510,6 +24703,30 @@ __metadata: languageName: node linkType: hard +"make-fetch-happen@npm:^10.0.3": + version: 10.2.1 + resolution: "make-fetch-happen@npm:10.2.1" + dependencies: + agentkeepalive: "npm:^4.2.1" + cacache: "npm:^16.1.0" + http-cache-semantics: "npm:^4.1.0" + http-proxy-agent: "npm:^5.0.0" + https-proxy-agent: "npm:^5.0.0" + is-lambda: "npm:^1.0.1" + lru-cache: "npm:^7.7.1" + minipass: "npm:^3.1.6" + minipass-collect: "npm:^1.0.2" + minipass-fetch: "npm:^2.0.3" + minipass-flush: "npm:^1.0.5" + minipass-pipeline: "npm:^1.2.4" + negotiator: "npm:^0.6.3" + promise-retry: "npm:^2.0.1" + socks-proxy-agent: "npm:^7.0.0" + ssri: "npm:^9.0.0" + checksum: fef5acb865a46f25ad0b5ad7d979799125db5dbb24ea811ffa850fbb804bc8e495df2237a8ec3a4fc6250e73c2f95549cca6d6d36a73b1faa61224504eb1188f + languageName: node + linkType: hard + "make-fetch-happen@npm:^13.0.0": version: 13.0.1 resolution: "make-fetch-happen@npm:13.0.1" @@ -25072,14 +25289,14 @@ __metadata: "@lavamoat/snow": "npm:^2.0.1" "@lgbot/madge": "npm:^6.2.0" "@material-ui/core": "npm:^4.11.0" - "@metamask-institutional/custody-controller": "npm:^0.2.24" - "@metamask-institutional/custody-keyring": "npm:^1.0.12" - "@metamask-institutional/extension": "npm:^0.3.20" - "@metamask-institutional/institutional-features": "npm:^1.2.15" - "@metamask-institutional/portfolio-dashboard": "npm:^1.4.0" - "@metamask-institutional/rpc-allowlist": "npm:1.0.3" - "@metamask-institutional/sdk": "npm:^0.1.25" - "@metamask-institutional/transaction-update": "npm:^0.2.0" + "@metamask-institutional/custody-controller": "npm:^0.2.27" + "@metamask-institutional/custody-keyring": "npm:^2.0.0" + "@metamask-institutional/extension": "npm:^0.3.24" + "@metamask-institutional/institutional-features": "npm:^1.3.2" + "@metamask-institutional/portfolio-dashboard": "npm:^1.4.1" + "@metamask-institutional/rpc-allowlist": "npm:^1.0.3" + "@metamask-institutional/sdk": "npm:^0.1.26" + "@metamask-institutional/transaction-update": "npm:^0.2.2" "@metamask/abi-utils": "npm:^2.0.2" "@metamask/accounts-controller": "npm:^11.0.0" "@metamask/address-book-controller": "npm:^3.1.7" @@ -25956,7 +26173,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:5.0.1": +"minimatch@npm:5.0.1, minimatch@npm:^5.0.1": version: 5.0.1 resolution: "minimatch@npm:5.0.1" dependencies: @@ -25992,6 +26209,15 @@ __metadata: languageName: node linkType: hard +"minipass-collect@npm:^1.0.2": + version: 1.0.2 + resolution: "minipass-collect@npm:1.0.2" + dependencies: + minipass: "npm:^3.0.0" + checksum: 14df761028f3e47293aee72888f2657695ec66bd7d09cae7ad558da30415fdc4752bbfee66287dcc6fd5e6a2fa3466d6c484dc1cbd986525d9393b9523d97f10 + languageName: node + linkType: hard + "minipass-collect@npm:^2.0.1": version: 2.0.1 resolution: "minipass-collect@npm:2.0.1" @@ -26001,6 +26227,21 @@ __metadata: languageName: node linkType: hard +"minipass-fetch@npm:^2.0.3": + version: 2.1.2 + resolution: "minipass-fetch@npm:2.1.2" + dependencies: + encoding: "npm:^0.1.13" + minipass: "npm:^3.1.6" + minipass-sized: "npm:^1.0.3" + minizlib: "npm:^2.1.2" + dependenciesMeta: + encoding: + optional: true + checksum: 8cfc589563ae2a11eebbf79121ef9a526fd078fca949ed3f1e4a51472ca4a4aad89fcea1738982ce9d7d833116ecc9c6ae9ebbd844832a94e3f4a3d4d1b9d3b9 + languageName: node + linkType: hard + "minipass-fetch@npm:^3.0.0": version: 3.0.3 resolution: "minipass-fetch@npm:3.0.3" @@ -26043,7 +26284,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^3.0.0": +"minipass@npm:^3.0.0, minipass@npm:^3.1.1, minipass@npm:^3.1.6": version: 3.3.5 resolution: "minipass@npm:3.3.5" dependencies: @@ -26679,7 +26920,7 @@ __metadata: languageName: node linkType: hard -"node-gyp@npm:^10.0.0, node-gyp@npm:latest": +"node-gyp@npm:^10.0.0": version: 10.1.0 resolution: "node-gyp@npm:10.1.0" dependencies: @@ -26699,6 +26940,26 @@ __metadata: languageName: node linkType: hard +"node-gyp@npm:latest": + version: 9.3.0 + resolution: "node-gyp@npm:9.3.0" + dependencies: + env-paths: "npm:^2.2.0" + glob: "npm:^7.1.4" + graceful-fs: "npm:^4.2.6" + make-fetch-happen: "npm:^10.0.3" + nopt: "npm:^6.0.0" + npmlog: "npm:^6.0.0" + rimraf: "npm:^3.0.2" + semver: "npm:^7.3.5" + tar: "npm:^6.1.2" + which: "npm:^2.0.2" + bin: + node-gyp: bin/node-gyp.js + checksum: b64c70a3984f9f23b9ae4606940e16c99edb93e7c455965afb0342ac961680efc4e553fed9f2654b9816072298da59fadfb832aeac6c625517cc228edb54c2c3 + languageName: node + linkType: hard + "node-int64@npm:^0.4.0": version: 0.4.0 resolution: "node-int64@npm:0.4.0" @@ -26751,6 +27012,17 @@ __metadata: languageName: node linkType: hard +"nopt@npm:^6.0.0": + version: 6.0.0 + resolution: "nopt@npm:6.0.0" + dependencies: + abbrev: "npm:^1.0.0" + bin: + nopt: bin/nopt.js + checksum: 3c1128e07cd0241ae66d6e6a472170baa9f3e84dd4203950ba8df5bafac4efa2166ce917a57ef02b01ba7c40d18b2cc64b29b225fd3640791fe07b24f0b33a32 + languageName: node + linkType: hard + "nopt@npm:^7.0.0": version: 7.2.1 resolution: "nopt@npm:7.2.1" @@ -26897,6 +27169,18 @@ __metadata: languageName: node linkType: hard +"npmlog@npm:^6.0.0": + version: 6.0.2 + resolution: "npmlog@npm:6.0.2" + dependencies: + are-we-there-yet: "npm:^3.0.0" + console-control-strings: "npm:^1.1.0" + gauge: "npm:^4.0.3" + set-blocking: "npm:^2.0.0" + checksum: 82b123677e62deb9e7472e27b92386c09e6e254ee6c8bcd720b3011013e4168bc7088e984f4fbd53cb6e12f8b4690e23e4fa6132689313e0d0dc4feea45489bb + languageName: node + linkType: hard + "nth-check@npm:^2.0.1": version: 2.0.1 resolution: "nth-check@npm:2.0.1" @@ -28066,13 +28350,20 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.1, pirates@npm:^4.0.4, pirates@npm:^4.0.5": +"pirates@npm:^4.0.1": version: 4.0.6 resolution: "pirates@npm:4.0.6" checksum: d02dda76f4fec1cbdf395c36c11cf26f76a644f9f9a1bfa84d3167d0d3154d5289aacc72677aa20d599bb4a6937a471de1b65c995e2aea2d8687cbcd7e43ea5f languageName: node linkType: hard +"pirates@npm:^4.0.4, pirates@npm:^4.0.5": + version: 4.0.5 + resolution: "pirates@npm:4.0.5" + checksum: 3728bae0cf6c18c3d25f5449ee8c5bc1a6a83bca688abe0e1654ce8c069bfd408170397cef133ed9ec8b0faeb4093c5c728d0e72ab7b3385256cd87008c40364 + languageName: node + linkType: hard + "pkg-dir@npm:^3.0.0": version: 3.0.0 resolution: "pkg-dir@npm:3.0.0" @@ -32276,6 +32567,15 @@ __metadata: languageName: node linkType: hard +"ssri@npm:^9.0.0": + version: 9.0.1 + resolution: "ssri@npm:9.0.1" + dependencies: + minipass: "npm:^3.1.1" + checksum: 7638a61e91432510718e9265d48d0438a17d53065e5184f1336f234ef6aa3479663942e41e97df56cda06bb24d9d0b5ef342c10685add3cac7267a82d7fa6718 + languageName: node + linkType: hard + "stack-trace@npm:0.0.10": version: 0.0.10 resolution: "stack-trace@npm:0.0.10" @@ -32507,7 +32807,7 @@ __metadata: languageName: node linkType: hard -"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -34325,6 +34625,15 @@ __metadata: languageName: node linkType: hard +"unique-filename@npm:^2.0.0": + version: 2.0.1 + resolution: "unique-filename@npm:2.0.1" + dependencies: + unique-slug: "npm:^3.0.0" + checksum: 807acf3381aff319086b64dc7125a9a37c09c44af7620bd4f7f3247fcd5565660ac12d8b80534dcbfd067e6fe88a67e621386dd796a8af828d1337a8420a255f + languageName: node + linkType: hard + "unique-filename@npm:^3.0.0": version: 3.0.0 resolution: "unique-filename@npm:3.0.0" @@ -34334,6 +34643,15 @@ __metadata: languageName: node linkType: hard +"unique-slug@npm:^3.0.0": + version: 3.0.0 + resolution: "unique-slug@npm:3.0.0" + dependencies: + imurmurhash: "npm:^0.1.4" + checksum: 26fc5bc209a875956dd5e84ca39b89bc3be777b112504667c35c861f9547df95afc80439358d836b878b6d91f6ee21fe5ba1a966e9ec2e9f071ddf3fd67d45ee + languageName: node + linkType: hard + "unique-slug@npm:^4.0.0": version: 4.0.0 resolution: "unique-slug@npm:4.0.0" @@ -35656,6 +35974,15 @@ __metadata: languageName: node linkType: hard +"wide-align@npm:^1.1.5": + version: 1.1.5 + resolution: "wide-align@npm:1.1.5" + dependencies: + string-width: "npm:^1.0.2 || 2 || 3 || 4" + checksum: d5f8027b9a8255a493a94e4ec1b74a27bff6679d5ffe29316a3215e4712945c84ef73ca4045c7e20ae7d0c72f5f57f296e04a4928e773d4276a2f1222e4c2e99 + languageName: node + linkType: hard + "widest-line@npm:^2.0.0": version: 2.0.1 resolution: "widest-line@npm:2.0.1" From bdea2e5f4a1c312dd34fc2ba713f71ae0c02fb6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Regadas?= Date: Mon, 3 Jun 2024 15:45:42 +0100 Subject: [PATCH 004/236] chore: adds to allowlist AccountsController:getSelectedAccount and other (#24992) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Adds to the MMI actions allow list: ``` AccountsController:getSelectedAccount AccountsController:setSelectedAccount ``` ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- app/scripts/metamask-controller.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index b421cb6a4844..d25c0e15e589 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1774,6 +1774,8 @@ export default class MetamaskController extends EventEmitter { 'AccountsController:getAccountByAddress', 'AccountsController:setAccountName', 'AccountsController:listAccounts', + 'AccountsController:getSelectedAccount', + 'AccountsController:setSelectedAccount', ], }); From 08d8395595772bbd1c669ec3730dad07c6b151c8 Mon Sep 17 00:00:00 2001 From: Antonio Regadas Date: Fri, 7 Jun 2024 14:10:24 +0100 Subject: [PATCH 005/236] chore: applies patch for tx-controller --- ...ion-controller-npm-29.1.0-22871eb356.patch | Bin 0 -> 8118 bytes package.json | 2 +- yarn.lock | 130 +++++++----------- 3 files changed, 47 insertions(+), 85 deletions(-) create mode 100644 .yarn/patches/@metamask-transaction-controller-npm-29.1.0-22871eb356.patch diff --git a/.yarn/patches/@metamask-transaction-controller-npm-29.1.0-22871eb356.patch b/.yarn/patches/@metamask-transaction-controller-npm-29.1.0-22871eb356.patch new file mode 100644 index 0000000000000000000000000000000000000000..43d0e53aa9db46ac90119d0283c5916b0faf0550 GIT binary patch literal 8118 zcmeHM>ucji5V!8q*6~ruhZgSRH21~9wyd`$j)LpDFKF(LI=OQ64tKQ=TZy7IlAHug z{6AHSfIhNH3B0_ILdmyQ*LoDnX#K+hqriDG1QOkE3Aq?9tW-hg{!yFSgI-L%5 z3BB${^Du0*TCELV`hDnVZ4FvF^!trgtyWV8bE4O3N1|C5m*k3U>>xS3Q}m=zmRylG z{F`LvhujzaKYstMkpA15^!}hmYC$cjrJE7>voJ_fO%uT=Po5rp^zkS4di`1b!)VHH zMkz|?$pFQ_$le*}p6Y9?%F9cQO6#^9kdk~QS4$5aUqj^$T8}fXf50lC3T* z6|0voGfL)x7>8_PP3h;n`mGSC5ZFZEY2H1Or+{xn%ItjU-<(qQDg-J7{$~g%2gA{D zAcD#t&iA8}&sq@Iui}y<^~wiw*4sD=h>rXxc`h|232i8Nzu?tzKmt)wg}^_IK;u2U z;vh;Fq4;bKC!6R!B7SP&0+qXck(&?heUvof1QU<2943 z&3qwuV@(1bIL{n_4A2a_1#Oa6|Xmp7Tn#R#SXbh+L8((&CZ+j71do~u{e`M54A z6VgFFOnld~Y~&csvQ5{vb=`Lf!M^8t4)UpP`M#=pgqqkgOziY*<~feYR0rG0#3B`4 yog!xT5Y~)ksq literal 0 HcmV?d00001 diff --git a/package.json b/package.json index 2b2c07066a25..6000435c1804 100644 --- a/package.json +++ b/package.json @@ -335,7 +335,7 @@ "@metamask/snaps-rpc-methods": "8.0.0", "@metamask/snaps-sdk": "4.0.1", "@metamask/snaps-utils": "7.2.0", - "@metamask/transaction-controller": "^29.0.2", + "@metamask/transaction-controller": "patch:@metamask/transaction-controller@npm%3A29.1.0#~/.yarn/patches/@metamask-transaction-controller-npm-29.1.0-22871eb356.patch", "@metamask/user-operation-controller": "^6.0.0", "@metamask/utils": "^8.2.1", "@ngraveio/bc-ur": "^1.1.12", diff --git a/yarn.lock b/yarn.lock index 8a4650110bd2..d14acd9e5bdb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -337,14 +337,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": - version: 7.22.5 - resolution: "@babel/helper-plugin-utils@npm:7.22.5" - checksum: ab220db218089a2aadd0582f5833fd17fa300245999f5f8784b10f5a75267c4e808592284a29438a0da365e702f05acb369f99e1c915c02f9f9210ec60eab8ea - languageName: node - linkType: hard - -"@babel/helper-plugin-utils@npm:^7.24.6": +"@babel/helper-plugin-utils@npm:^7.0.0, @babel/helper-plugin-utils@npm:^7.10.4, @babel/helper-plugin-utils@npm:^7.12.13, @babel/helper-plugin-utils@npm:^7.14.5, @babel/helper-plugin-utils@npm:^7.18.6, @babel/helper-plugin-utils@npm:^7.20.2, @babel/helper-plugin-utils@npm:^7.22.5, @babel/helper-plugin-utils@npm:^7.24.6, @babel/helper-plugin-utils@npm:^7.8.0, @babel/helper-plugin-utils@npm:^7.8.3": version: 7.24.6 resolution: "@babel/helper-plugin-utils@npm:7.24.6" checksum: 0ac0a7a19959fb2f880ea87650475a4960232e98825d9a50f4aa56e5750a70fc799b48cf570af63a06b810d0128e758e801865762b51a8348067e37751a38478 @@ -458,7 +451,7 @@ __metadata: languageName: node linkType: hard -"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.24.6": +"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.22.13, @babel/highlight@npm:^7.24.6": version: 7.24.6 resolution: "@babel/highlight@npm:7.24.6" dependencies: @@ -470,17 +463,6 @@ __metadata: languageName: node linkType: hard -"@babel/highlight@npm:^7.22.13": - version: 7.23.4 - resolution: "@babel/highlight@npm:7.23.4" - dependencies: - "@babel/helper-validator-identifier": "npm:^7.22.20" - chalk: "npm:^2.4.2" - js-tokens: "npm:^4.0.0" - checksum: 62fef9b5bcea7131df4626d009029b1ae85332042f4648a4ce6e740c3fd23112603c740c45575caec62f260c96b11054d3be5987f4981a5479793579c3aac71f - languageName: node - linkType: hard - "@babel/parser@npm:7.16.4": version: 7.16.4 resolution: "@babel/parser@npm:7.16.4" @@ -508,15 +490,6 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.22.15": - version: 7.24.4 - resolution: "@babel/parser@npm:7.24.4" - bin: - parser: ./bin/babel-parser.js - checksum: 3742cc5068036287e6395269dce5a2735e6349cdc8d4b53297c75f98c580d7e1c8cb43235623999d151f2ef975d677dbc2c2357573a1855caa71c271bf3046c9 - languageName: node - linkType: hard - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.22.15": version: 7.22.15 resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.22.15" @@ -708,18 +681,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-syntax-jsx@npm:^7.22.5, @babel/plugin-syntax-jsx@npm:^7.7.2": - version: 7.22.5 - resolution: "@babel/plugin-syntax-jsx@npm:7.22.5" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.22.5" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 8829d30c2617ab31393d99cec2978e41f014f4ac6f01a1cecf4c4dd8320c3ec12fdc3ce121126b2d8d32f6887e99ca1a0bad53dedb1e6ad165640b92b24980ce - languageName: node - linkType: hard - -"@babel/plugin-syntax-jsx@npm:^7.24.6": +"@babel/plugin-syntax-jsx@npm:^7.22.5, @babel/plugin-syntax-jsx@npm:^7.24.6, @babel/plugin-syntax-jsx@npm:^7.7.2": version: 7.24.6 resolution: "@babel/plugin-syntax-jsx@npm:7.24.6" dependencies: @@ -1702,18 +1664,7 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.22.15, @babel/template@npm:^7.22.5, @babel/template@npm:^7.3.3": - version: 7.22.15 - resolution: "@babel/template@npm:7.22.15" - dependencies: - "@babel/code-frame": "npm:^7.22.13" - "@babel/parser": "npm:^7.22.15" - "@babel/types": "npm:^7.22.15" - checksum: 21e768e4eed4d1da2ce5d30aa51db0f4d6d8700bc1821fec6292587df7bba2fe1a96451230de8c64b989740731888ebf1141138bfffb14cacccf4d05c66ad93f - languageName: node - linkType: hard - -"@babel/template@npm:^7.24.6": +"@babel/template@npm:^7.22.15, @babel/template@npm:^7.22.5, @babel/template@npm:^7.24.6, @babel/template@npm:^7.3.3": version: 7.24.6 resolution: "@babel/template@npm:7.24.6" dependencies: @@ -6067,6 +6018,41 @@ __metadata: languageName: node linkType: hard +"@metamask/transaction-controller@npm:29.1.0": + version: 29.1.0 + resolution: "@metamask/transaction-controller@npm:29.1.0" + dependencies: + "@ethereumjs/common": "npm:^3.2.0" + "@ethereumjs/tx": "npm:^4.2.0" + "@ethereumjs/util": "npm:^8.1.0" + "@ethersproject/abi": "npm:^5.7.0" + "@ethersproject/contracts": "npm:^5.7.0" + "@ethersproject/providers": "npm:^5.7.0" + "@metamask/approval-controller": "npm:^6.0.2" + "@metamask/base-controller": "npm:^5.0.2" + "@metamask/controller-utils": "npm:^9.1.0" + "@metamask/eth-query": "npm:^4.0.0" + "@metamask/gas-fee-controller": "npm:^15.1.2" + "@metamask/metamask-eth-abis": "npm:^3.1.1" + "@metamask/network-controller": "npm:^18.1.1" + "@metamask/rpc-errors": "npm:^6.2.1" + "@metamask/utils": "npm:^8.3.0" + async-mutex: "npm:^0.2.6" + bn.js: "npm:^5.2.1" + eth-method-registry: "npm:^4.0.0" + fast-json-patch: "npm:^3.1.1" + lodash: "npm:^4.17.21" + nonce-tracker: "npm:^3.0.0" + uuid: "npm:^8.3.2" + peerDependencies: + "@babel/runtime": ^7.23.9 + "@metamask/approval-controller": ^6.0.0 + "@metamask/gas-fee-controller": ^15.0.0 + "@metamask/network-controller": ^18.0.0 + checksum: 4b96d17d0bcc0f13ac72a94a3b4f3c3dd0f31a13aa6ae74b343ebe2d77e9aeb636b28c14ab23f08c6d8c6b66158c93f34243cf551f4c12d06b4ea8e87ae4ae64 + languageName: node + linkType: hard + "@metamask/transaction-controller@npm:^25.1.0": version: 25.3.0 resolution: "@metamask/transaction-controller@npm:25.3.0" @@ -6135,9 +6121,9 @@ __metadata: languageName: node linkType: hard -"@metamask/transaction-controller@npm:^29.0.2": +"@metamask/transaction-controller@patch:@metamask/transaction-controller@npm%3A29.1.0#~/.yarn/patches/@metamask-transaction-controller-npm-29.1.0-22871eb356.patch": version: 29.1.0 - resolution: "@metamask/transaction-controller@npm:29.1.0" + resolution: "@metamask/transaction-controller@patch:@metamask/transaction-controller@npm%3A29.1.0#~/.yarn/patches/@metamask-transaction-controller-npm-29.1.0-22871eb356.patch::version=29.1.0&hash=9ceba2" dependencies: "@ethereumjs/common": "npm:^3.2.0" "@ethereumjs/tx": "npm:^4.2.0" @@ -6166,7 +6152,7 @@ __metadata: "@metamask/approval-controller": ^6.0.0 "@metamask/gas-fee-controller": ^15.0.0 "@metamask/network-controller": ^18.0.0 - checksum: 4b96d17d0bcc0f13ac72a94a3b4f3c3dd0f31a13aa6ae74b343ebe2d77e9aeb636b28c14ab23f08c6d8c6b66158c93f34243cf551f4c12d06b4ea8e87ae4ae64 + checksum: 1ca1e2bc5e03e85cc992be4d6a43ebee281c277d635d53c918603da474d8f650698bb2a4508c411d79168144613d0e98a8f578d1692157de8fe86db874c59021 languageName: node linkType: hard @@ -12981,20 +12967,13 @@ __metadata: languageName: node linkType: hard -"big-integer@npm:1.6.x": +"big-integer@npm:1.6.x, big-integer@npm:^1.6.44, big-integer@npm:^1.6.48": version: 1.6.52 resolution: "big-integer@npm:1.6.52" checksum: 4bc6ae152a96edc9f95020f5fc66b13d26a9ad9a021225a9f0213f7e3dc44269f423aa8c42e19d6ac4a63bb2b22140b95d10be8f9ca7a6d9aa1b22b330d1f514 languageName: node linkType: hard -"big-integer@npm:^1.6.44, big-integer@npm:^1.6.48": - version: 1.6.51 - resolution: "big-integer@npm:1.6.51" - checksum: c7a12640901906d6f6b6bdb42a4eaba9578397b6d9a0dd090cf001ec813ff2bfcd441e364068ea0416db6175d2615f8ed19cff7d1a795115bf7c92d44993f991 - languageName: node - linkType: hard - "big.js@npm:^5.2.2": version: 5.2.2 resolution: "big.js@npm:5.2.2" @@ -21100,7 +21079,7 @@ __metadata: languageName: node linkType: hard -"https-proxy-agent@npm:^7.0.1": +"https-proxy-agent@npm:^7.0.1, https-proxy-agent@npm:^7.0.2": version: 7.0.4 resolution: "https-proxy-agent@npm:7.0.4" dependencies: @@ -21110,16 +21089,6 @@ __metadata: languageName: node linkType: hard -"https-proxy-agent@npm:^7.0.2": - version: 7.0.2 - resolution: "https-proxy-agent@npm:7.0.2" - dependencies: - agent-base: "npm:^7.0.2" - debug: "npm:4" - checksum: 9ec844f78fd643608239c9c3f6819918631df5cd3e17d104cc507226a39b5d4adda9d790fc9fd63ac0d2bb8a761b2f9f60faa80584a9bf9d7f2e8c5ed0acd330 - languageName: node - linkType: hard - "human-signals@npm:^1.1.1": version: 1.1.1 resolution: "human-signals@npm:1.1.1" @@ -25365,7 +25334,7 @@ __metadata: "@metamask/snaps-utils": "npm:7.2.0" "@metamask/test-bundler": "npm:^1.0.0" "@metamask/test-dapp": "npm:^8.4.0" - "@metamask/transaction-controller": "npm:^29.0.2" + "@metamask/transaction-controller": "patch:@metamask/transaction-controller@npm%3A29.1.0#~/.yarn/patches/@metamask-transaction-controller-npm-29.1.0-22871eb356.patch" "@metamask/user-operation-controller": "npm:^6.0.0" "@metamask/utils": "npm:^8.2.1" "@ngraveio/bc-ur": "npm:^1.1.12" @@ -28350,20 +28319,13 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.1": +"pirates@npm:^4.0.1, pirates@npm:^4.0.4, pirates@npm:^4.0.5": version: 4.0.6 resolution: "pirates@npm:4.0.6" checksum: d02dda76f4fec1cbdf395c36c11cf26f76a644f9f9a1bfa84d3167d0d3154d5289aacc72677aa20d599bb4a6937a471de1b65c995e2aea2d8687cbcd7e43ea5f languageName: node linkType: hard -"pirates@npm:^4.0.4, pirates@npm:^4.0.5": - version: 4.0.5 - resolution: "pirates@npm:4.0.5" - checksum: 3728bae0cf6c18c3d25f5449ee8c5bc1a6a83bca688abe0e1654ce8c069bfd408170397cef133ed9ec8b0faeb4093c5c728d0e72ab7b3385256cd87008c40364 - languageName: node - linkType: hard - "pkg-dir@npm:^3.0.0": version: 3.0.0 resolution: "pkg-dir@npm:3.0.0" From 47fdf265cd73ba9ca234d6cfc9aec6eaf9fb0723 Mon Sep 17 00:00:00 2001 From: Antonio Regadas Date: Thu, 6 Jun 2024 10:12:06 +0100 Subject: [PATCH 006/236] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 451760e45c8c..fee34a73cc69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [11.16.8] +### Changed +- [MMI] Updates MMI packages to latest versions ([#24581](https://github.com/MetaMask/metamask-extension/pull/24581)) + +### Fixed +- [MMI] Fixed an issue that prevented MMI transactions from being sent correctly ([#24947](https://github.com/MetaMask/metamask-extension/pull/24947)) +- [MMI] Better support for MMI Portfolio Dashboard with an update to the allow list ([#24992](https://github.com/MetaMask/metamask-extension/pull/24992)) ## [11.16.7] ### Fixed From 240d7d7db5284169ed907206cc26144f232b22e8 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Thu, 6 Jun 2024 17:26:40 -0230 Subject: [PATCH 007/236] fix: Add resolution for rpc-websockets to handle deps audit failure (#25112) --- package.json | 3 ++- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6000435c1804..4ca77c9fb4f8 100644 --- a/package.json +++ b/package.json @@ -251,7 +251,8 @@ "ts-mixer@npm:^6.0.3": "patch:ts-mixer@npm%3A6.0.4#~/.yarn/patches/ts-mixer-npm-6.0.4-5d9747bdf5.patch", "sucrase@npm:3.34.0": "^3.35.0", "@expo/config/glob": "^10.3.10", - "@expo/config-plugins/glob": "^10.3.10" + "@expo/config-plugins/glob": "^10.3.10", + "@solana/web3.js/rpc-websockets": "^8.0.1" }, "dependencies": { "@babel/runtime": "patch:@babel/runtime@npm%3A7.24.0#~/.yarn/patches/@babel-runtime-npm-7.24.0-7eb1dd11a2.patch", diff --git a/yarn.lock b/yarn.lock index d14acd9e5bdb..d5381f33e22b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31194,9 +31194,9 @@ __metadata: languageName: node linkType: hard -"rpc-websockets@npm:^7.11.0": - version: 7.11.1 - resolution: "rpc-websockets@npm:7.11.1" +"rpc-websockets@npm:^8.0.1": + version: 8.0.1 + resolution: "rpc-websockets@npm:8.0.1" dependencies: bufferutil: "npm:^4.0.1" eventemitter3: "npm:^4.0.7" @@ -31208,7 +31208,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 6b23cc7a54eb2158f4098545c0adbf118e9240d6006e262048b3dd5125e352892f989df7337b4ca70a1505699a480c92d6f3c58ebb8f4d3a483dda9606890a28 + checksum: ec50bebb6d85f977d3ab16c31d107ff7f546ea472be8f827d6236d2bbbb6d807481a7028a16f3fa7a9163b2338d9957a97e78f03761a9adc0e04b68586973c1c languageName: node linkType: hard From 6b9a6e27ebf98a78360940607542245c9985da20 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Thu, 6 Jun 2024 21:00:00 -0230 Subject: [PATCH 008/236] fix: Include missing files in Sentry release artifact upload (#25113) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** The Sentry release artifact upload step was assuming that all JavaScript files were at the root of the build directory. This is not the case; in #23672 some of them were moved to a `scripts/` subdirectory. These files have been missing from release artifacts for some time now. The script has been updated to include all JavaScript files included in the build. It references the entire build directory now rather than specifically targetting JavaScript files at the top-level. No additional filter is needed to exclude non-JavaScript files because this command defaults to only including JavaScript and sourcemap files (and some React native files that don't exist in our build). [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25113?quickstart=1) ## **Related issues** Fixes #25110 ## **Manual testing steps** 1. Create a personal Sentry account (if you don't have one already) 2. Create a project in Sentry called `metamask` (if you don't have one already) 2. Run this script: ``` SENTRY_ORG=[your account name/organization] SENTRY_PROJECT=metamask yarn exec ./development/sentry-upload-artifacts.sh --release v11.16.7 ``` 3. Verify that all JavaScript files and source maps are shown on the CLI as being uploaded, and visible in the artifact bundle on the Sentry dashboard * The artifact bundle should be listed here: `https://[your username/organization].sentry.io/settings/projects/metamask/source-maps/artifact-bundles/` ## **Screenshots/Recordings** N/A ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- development/sentry-upload-artifacts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/development/sentry-upload-artifacts.sh b/development/sentry-upload-artifacts.sh index e70989123e03..7b712f12de31 100755 --- a/development/sentry-upload-artifacts.sh +++ b/development/sentry-upload-artifacts.sh @@ -31,7 +31,7 @@ function upload_sourcemaps { local release="${1}"; shift local dist_directory="${1}"; shift - sentry-cli releases files "${release}" upload-sourcemaps "${dist_directory}"/chrome/*.js "${dist_directory}"/sourcemaps/ --rewrite --url-prefix '/metamask' + sentry-cli releases files "${release}" upload-sourcemaps "${dist_directory}"/chrome/ "${dist_directory}"/sourcemaps/ --rewrite --url-prefix '/metamask' } function main { From f19bcdfe37695c1ff22359854665af748352cfb4 Mon Sep 17 00:00:00 2001 From: jiexi Date: Fri, 7 Jun 2024 06:31:29 -0700 Subject: [PATCH 009/236] Version v11.16.8 alternative - patch selected network controller (#25127) Core PR: https://github.com/MetaMask/core/pull/4388 Patch Branch: [jl/patch-selected-network-controller-12.0.1-setNetworkClientId-guard](https://github.com/MetaMask/core/tree/jl/patch-selected-network-controller-12.0.1-setNetworkClientId-guard) --- ...ork-controller-npm-12.0.1-34b2edf62d.patch | Bin 261008 -> 205259 bytes yarn.lock | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.yarn/patches/@metamask-selected-network-controller-npm-12.0.1-34b2edf62d.patch b/.yarn/patches/@metamask-selected-network-controller-npm-12.0.1-34b2edf62d.patch index 4fc71d3c88eb7ff1568d8d01cfb3477789bc836b..768b8f9e906e443d9832c2cba1ec36647f6cceb0 100644 GIT binary patch delta 4881 zcmb_g3vg7`8J=@D2_XrOKnQsd_9h`@A$ODeeh@)!HUT4qBnZ@C5biUCkZiKMAjnwI z86DA1K~CeDc2w|5%NtXhPTQHnv^rC)S{!FO)wV({gIcXf$H!>Vo^x;ZZU}Zd(>61^ zIsZNX`Jdnaoty0cY}(7eDu8TtCA?5E1+t}UBcfnBoT&*c>#Cw9*(~e0tRkz5;W&nB z@Rr6Jh9Ow+coenVeSKg7m+FaT|BRMz;of3BC=?^qJ}M~s>R8cXj-nIsJ!Mlyu>RaFY}IJONIddR2_wv z=nr!FCSDLbSFR)JEl3OXTavX48uRKB&d|2rgcGT)Z?HCR8|aIsbA%;T-_K8LZ%Nie zP!oo4RlQluIfj8FG!<8K1&y~XUS$oA=Xh0AdDAjw)8J%Ig@3GmFIR3}y>`Vir4_z1 zuOySjhx0nB(w1=?wAoHw@+{kNfJbr zGi^tV;n1(Zk|Qhg(w^%3QQ-;D znCZajBgGlvwIh!P!btzox}1^kJoZptRl4^#G$q*Znxbf|!bv7)uo}xbJjSeSnjCJ9 zt;#MZYJ$P?jxBmk2?s~FB=eRorK2pv(sdleD;&LaX|fZaKl#BDypV&rs)W#X2=RJb3Bhp!F41PgG*vL&emktkO-OrkkrHY(H2ZB`RGs= z$UzTZ4Hb{v{EkhH%8!7zv#I4eTs2$)2fsIK^!C4lpNHT_D1Y>wAAt6((f&`tDP~eb z109Pe9JuerXqKvW51{E&fL@YxQmdTQUGYR;Y-_JGkZQG~J==_g4L`WQv7oVgz{{_D zpnCv5`AW^`{z`D}!K(57zkX=aJ3hW77SjSNIf^A|nxo-qv@Fw<9mC-@MK*2KlvI=B zNS5X4lLS)}`ZH26|MmZ(Bfpu1;tMHuevzmbkQ4};x-nKXC!O8xk%SmfSacf5YZ>8?c9eL^Dq5st216k

>VaC`#iZ+Un2=;%l4MO&3`yo( zQFI(jRPY@m@QNzBsDYu%(B~YrH((UBm#2Q6>F&AkT69F97Q@wt!stVRT8Q2`2t>46 zq{67-8Bjj@lt``p1HQgzpqh6>^HArzAqGDG7#(r(Rc1*%$4N3~N!)xE*HI8HSGF|G zR!JCwtg0@$co4|mS=jXWtO6Ai3}G2eFHv}MZ9A10J+Q7($cy&&55^NII<<4qp?A?u zTjN&WnuKBXIf;%$e8*0Po-mON+Or-+(W&)-BVWa^;FEkn!=XEh;eI1Om!a{o?Y%bY z=muqI>S<6kZGsP^e-0|)@lRy*#OFYQg-^|d?5DGFJm}tTP(3{_>g@0$vK?!yfhpq5 zrzLRm!U_M5oBd~-ZuRc)aCf*$99Xn4S2RY zLX1Cp4NUPhr(FZmIL*j#167twFZQ#=>We+K0~^?JO1GwMDd@Xjfl^=k_{-*TDmAFX z1U0@3{cF&X)|rn!GQr&Oiug?-CzPZY!;iyd=*(vzYnY`jX8^W!WQ8-ph|SHN#udB|)6b1@(yXipY3cd`#3j3D$x7F8O?hP?Y|0ljz$y*=J* z2McfKfX$?<)J}mp=)_8VPsS-wGFH=Usw&@aaKpldIHtjD>egA<*uFT48cJ{X`SG32rS8I!kPN+$$Zsn?kW3}ES*ds;vWxC_l1T?cI>FE$z!@4E zFPBmbjZS5Ql0t^IXk?h?p?zf_7v|hw2?Il5w!Pmh(nVufiOCAIW$JQcq0nmKU6z9_iAV)7j=9b`emAWXQ54pF+tR0BT2%- z6`q_$WO(|q%7~(wj>@_`C(E|WnwB9LvLrc<$+C)|VVX8rLlqP$;A7vQZ$N*%xPTkS z%;*=-f*64_cn&lZBwl!O1^IRQ*gEnQ5~ztt zwk&WO{!`0wdEPWdo0EB7wnf3>HCzCml^s=+Sn(S(zHo>`xX8txQMBZ0=q7)4=Sfh3 z==VZJ*}YA=-iv;AHB??a(89FqdONd1*HAK~w+H}2*@ys_dF?_xeTNG}v(TBJCV&hK8I3PJVu{^bm!G?CXk?%HU8`jnySR*kKCEa3<1Ir5E>*nPivduz-;PvRKoi-?UeJ+>wA*RqTx-R^7G;ZW+D zn4xBUUd!DvrVopKO-v?NFaMbCY>#=4(9oBmum|LCby3qP+C-gQRI&FOp_qy)YaDAC zl8gU7H8FZ^UUF^Q#VD2?$B}u(X63OalH=qxVv3Y`i*R;8?kRF@0VZH*pPPbPV2r9x zU90qU%F){vpz%}A#7_u2Q^_=&CM`3Z_{sEv9YbS5(Zx}ELsJU>a;($?TS0ARGIkxPq0w8@CIUX?||*>AXDyB2dMzM|8i&s+R#PiA?gyC7jXn0PrD>b1}8eEB{}#_UBLgw zkPS&y1VuCO`9sZ>?GziloNq{0;Syf$A8>$V}g|_tHni}cPvg~lChox`! zTi2&jgH{n|)}}Zg9ogD2ZFwr0W$`3W2R-5r2bs+`#FI{Hq$f3;bTUEb{yZZT4u!Wi z%-p@(pi(TV%gSxB=x)=;6dwi{vkHA>{XeTm=f{}v|NP>0p`|C{f1x9KhCY9vh{El|t^&-TIe~(L^FJW|`Pvt$ z@}YkL?muq$Fj|0J1z0%LBA*8r%6A5s?~Dr1At+(9WB7F0zALt!6>K*Gyn`V04$m>{%LkGj|X4#`S<7KGp`B%KQlZRoyjh`1#e2^ zO7G~L$o|%Ews40j61N>!A>5QqN7Eet-2}BXnaW&NI8h{tFlYZ`W1-a>^qYEA+T*pO z>7~Zl9q2cx)biF>UOC=ic+P=oST84RDR0aXFHFOY-d$DW>bxIUz1?C{MlD%UT+7gz z>%hAcLxHB@7=~%uu52j=b5ut5Ki1~`t@>n0+qAxWg}kZ9d#UC~3*ok|sD{j3O|c|N zvNcztGNGEGYD71Q%q4^9y6XKg(&oKc`%Y-xT6)t;UAw_|Ye})uzAe+dq%+c*<~xSt zY2MP@-eKQ5oZQ}43c~d859*52+cNFq)C@e|I}twF?C3<*9O7tPl_ZTAT#{UaS`b7= z7?muSIEHFT-pR;YEj>5tt9tcKeeH>DnT233o)}7{v(be`YbDR#u3NXb*zkpmFPid$ zD(3`moNQgyWJgj6lXY8nRPf!AEe+#JKTTc6pfa5FMH_}qq-ElcpAI1 zZF6OAqy_DmToYZqINH(S-FdKWl4e9&qlL?R=3w{yA)ZdeGnsfQ*_MH~EWFLWl_dvw z+rThOJCRoJ#b+ADN6(`=(eVp3&%3|3)*E>C3URa(P4V8#g~Yo)^2*+7vF>MRwdm4N zZSElh?XUU%3N$zO&{b%`)bW{4HeDGm%zAr5u(@d3IPcY_wJj!d74B-PrI@a4yHsL^ zE$gl-8z!-cLKWE$ks$>E81I^z-RrLm@#M>3JbFEPYNmL$9!DDUUZ#ek%a$#RHZ#X* zhB$bK_f8ibNz^DF_$jJ7kU-%^pl(hUW0HsYU|pgaj7OS>QrbS?@Cz$=Ipb47JvU4+O-+{b<2>J^I(AL}?QJ;#6OnL%%qc zt(!Z?#Tah(_AQ#{J+h&C?7mBGM&sK2lqilXpAyAZdyo>|!wsv#B@#^ZCh_l?mD9!H z5US2SFc0Ob#lsJxx*UEG9ogBUbFSK|tLxO%i0pEiGhMP6HC4vAUuh*pcO~YEQ&aHo zOLl{kL(zu#`=$8$@sXc#sK_Aiu5h#X&oq49xXk&VE|z|xMvD{E@k1@#v=yC0+7qg} z%wW{fEg9;xu4|U0QJYGN1GQT9$3IIvGXvjU+GNBvGx4v-OU6qz8^yL+c$s)%7M3~~ zlbH#%26hu>nKF?y-7og8O*u7P!`5`wmWW281kMJEB4#$>R%D5JO?W}b|J;MX#~!&G zn(*cms5Q5_33pBs_nR<+Cl}+p8!VRLHhh_oP7Mz7^iCq4YQ`P8Z#QFmN)6x1lUbg7 z!@wsI%8HM_ftS_}@&RV=3K}B?T8PJoh^m?aaoLnKOJPT8H^*BCpd4#AjN;J52(e)ahmD~Oro{PlyUdOYMDjt0u?-N%Y z!&g*NNfvh;!!fb#7zE?7W4J{uIgWe8E64B(vHdt+CuSVSQ^j+~@swJsC^4$2;>d9< zi;s@uSWf-}o?hE%#0XKg#BTQO5uyf|o;&pxz8BZ&F(S)AA%-IMzJu9zHAWPlKqU|^ zV0w%O6i}3>5DBnArKA8BsFchiSE6}&_*#f4n%|Ss5+(zt2Q(sHcmvNJg%PO4Cn&&D z14A;1tHB^-7>*hklEIJ~7?Qz|8mLu#xj>l$rc@))LI5*;Oa^_L6ksrLEpG#y(gGV0 zE24poDln|(Zuu+TJrO7>pB|_n+(Doq-1$I#@Gic;GHeucH+RqbxDHjr976sa`~WwP zLRv%SPziEI^2H>8kd}}g)XxjZ2|pX)TnaY5mq8v9fWp*Mm~;x$O<|%bOfiMY zr3%Qxg!&_-3drYEJ*Ma}#fT|pOqF6PiK$d{{R96*?441$Ab93!_$RKeYKMJLd@Ec@ zI&8vp+mWDx$*!)Ms;ue^zFuVT Date: Fri, 7 Jun 2024 12:13:57 -0230 Subject: [PATCH 010/236] Update lockfile --- yarn.lock | 270 ++---------------------------------------------------- 1 file changed, 8 insertions(+), 262 deletions(-) diff --git a/yarn.lock b/yarn.lock index 7020ba1ebaa1..bfc99b8f8948 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3097,13 +3097,6 @@ __metadata: languageName: node linkType: hard -"@gar/promisify@npm:^1.1.3": - version: 1.1.3 - resolution: "@gar/promisify@npm:1.1.3" - checksum: 052dd232140fa60e81588000cbe729a40146579b361f1070bce63e2a761388a22a16d00beeffc504bd3601cb8e055c57b21a185448b3ed550cf50716f4fd442e - languageName: node - linkType: hard - "@graphql-tools/merge@npm:8.3.1": version: 8.3.1 resolution: "@graphql-tools/merge@npm:8.3.1" @@ -6393,16 +6386,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/fs@npm:^2.1.0": - version: 2.1.2 - resolution: "@npmcli/fs@npm:2.1.2" - dependencies: - "@gar/promisify": "npm:^1.1.3" - semver: "npm:^7.3.5" - checksum: c5d4dfee80de2236e1e4ed595d17e217aada72ebd8215183fc46096fa010f583dd2aaaa486758de7cc0b89440dbc31cfe8b276269d75d47af35c716e896f78ec - languageName: node - linkType: hard - "@npmcli/fs@npm:^3.1.0": version: 3.1.0 resolution: "@npmcli/fs@npm:3.1.0" @@ -6428,16 +6411,6 @@ __metadata: languageName: node linkType: hard -"@npmcli/move-file@npm:^2.0.0": - version: 2.0.1 - resolution: "@npmcli/move-file@npm:2.0.1" - dependencies: - mkdirp: "npm:^1.0.4" - rimraf: "npm:^3.0.2" - checksum: 52dc02259d98da517fae4cb3a0a3850227bdae4939dda1980b788a7670636ca2b4a01b58df03dd5f65c1e3cb70c50fa8ce5762b582b3f499ec30ee5ce1fd9380 - languageName: node - linkType: hard - "@npmcli/node-gyp@npm:^3.0.0": version: 3.0.0 resolution: "@npmcli/node-gyp@npm:3.0.0" @@ -11434,13 +11407,6 @@ __metadata: languageName: node linkType: hard -"abbrev@npm:^1.0.0": - version: 1.1.1 - resolution: "abbrev@npm:1.1.1" - checksum: 2d882941183c66aa665118bafdab82b7a177e9add5eb2776c33e960a4f3c89cff88a1b38aba13a456de01d0dd9d66a8bea7c903268b21ea91dd1097e1e2e8243 - languageName: node - linkType: hard - "abbrev@npm:^2.0.0": version: 2.0.0 resolution: "abbrev@npm:2.0.0" @@ -11744,7 +11710,7 @@ __metadata: languageName: node linkType: hard -"agentkeepalive@npm:^4.2.1, agentkeepalive@npm:^4.5.0": +"agentkeepalive@npm:^4.5.0": version: 4.5.0 resolution: "agentkeepalive@npm:4.5.0" dependencies: @@ -12040,13 +12006,6 @@ __metadata: languageName: node linkType: hard -"aproba@npm:^1.0.3 || ^2.0.0": - version: 2.0.0 - resolution: "aproba@npm:2.0.0" - checksum: c2b9a631298e8d6f3797547e866db642f68493808f5b37cd61da778d5f6ada890d16f668285f7d60bd4fc3b03889bd590ffe62cf81b700e9bb353431238a0a7b - languageName: node - linkType: hard - "archy@npm:^1.0.0": version: 1.0.0 resolution: "archy@npm:1.0.0" @@ -12061,16 +12020,6 @@ __metadata: languageName: node linkType: hard -"are-we-there-yet@npm:^3.0.0": - version: 3.0.1 - resolution: "are-we-there-yet@npm:3.0.1" - dependencies: - delegates: "npm:^1.0.0" - readable-stream: "npm:^3.6.0" - checksum: 390731720e1bf9ed5d0efc635ea7df8cbc4c90308b0645a932f06e8495a0bf1ecc7987d3b97e805f62a17d6c4b634074b25200aa4d149be2a7b17250b9744bc4 - languageName: node - linkType: hard - "arg@npm:^4.1.0": version: 4.1.3 resolution: "arg@npm:4.1.3" @@ -13790,32 +13739,6 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^16.1.0": - version: 16.1.3 - resolution: "cacache@npm:16.1.3" - dependencies: - "@npmcli/fs": "npm:^2.1.0" - "@npmcli/move-file": "npm:^2.0.0" - chownr: "npm:^2.0.0" - fs-minipass: "npm:^2.1.0" - glob: "npm:^8.0.1" - infer-owner: "npm:^1.0.4" - lru-cache: "npm:^7.7.1" - minipass: "npm:^3.1.6" - minipass-collect: "npm:^1.0.2" - minipass-flush: "npm:^1.0.5" - minipass-pipeline: "npm:^1.2.4" - mkdirp: "npm:^1.0.4" - p-map: "npm:^4.0.0" - promise-inflight: "npm:^1.0.1" - rimraf: "npm:^3.0.2" - ssri: "npm:^9.0.0" - tar: "npm:^6.1.11" - unique-filename: "npm:^2.0.0" - checksum: a14524d90e377ee691d63a81173b33c473f8bc66eb299c64290b58e1d41b28842397f8d6c15a01b4c57ca340afcec019ae112a45c2f67a79f76130d326472e92 - languageName: node - linkType: hard - "cacache@npm:^18.0.0": version: 18.0.3 resolution: "cacache@npm:18.0.3" @@ -14940,13 +14863,6 @@ __metadata: languageName: node linkType: hard -"console-control-strings@npm:^1.1.0": - version: 1.1.0 - resolution: "console-control-strings@npm:1.1.0" - checksum: 27b5fa302bc8e9ae9e98c03c66d76ca289ad0c61ce2fe20ab288d288bee875d217512d2edb2363fc83165e88f1c405180cf3f5413a46e51b4fe1a004840c6cdb - languageName: node - linkType: hard - "consolidate@npm:^0.16.0": version: 0.16.0 resolution: "consolidate@npm:0.16.0" @@ -19333,7 +19249,7 @@ __metadata: languageName: node linkType: hard -"fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0": +"fs-minipass@npm:^2.0.0": version: 2.1.0 resolution: "fs-minipass@npm:2.1.0" dependencies: @@ -19534,22 +19450,6 @@ __metadata: languageName: node linkType: hard -"gauge@npm:^4.0.3": - version: 4.0.4 - resolution: "gauge@npm:4.0.4" - dependencies: - aproba: "npm:^1.0.3 || ^2.0.0" - color-support: "npm:^1.1.3" - console-control-strings: "npm:^1.1.0" - has-unicode: "npm:^2.0.1" - signal-exit: "npm:^3.0.7" - string-width: "npm:^4.2.3" - strip-ansi: "npm:^6.0.1" - wide-align: "npm:^1.1.5" - checksum: 09535dd53b5ced6a34482b1fa9f3929efdeac02f9858569cde73cef3ed95050e0f3d095706c1689614059898924b7a74aa14042f51381a1ccc4ee5c29d2389c4 - languageName: node - linkType: hard - "generic-names@npm:^2.0.1": version: 2.0.1 resolution: "generic-names@npm:2.0.1" @@ -19919,19 +19819,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:^8.0.1": - version: 8.1.0 - resolution: "glob@npm:8.1.0" - dependencies: - fs.realpath: "npm:^1.0.0" - inflight: "npm:^1.0.4" - inherits: "npm:2" - minimatch: "npm:^5.0.1" - once: "npm:^1.3.0" - checksum: 9aab1c75eb087c35dbc41d1f742e51d0507aa2b14c910d96fb8287107a10a22f4bbdce26fc0a3da4c69a20f7b26d62f1640b346a4f6e6becfff47f335bb1dc5e - languageName: node - linkType: hard - "global-agent@npm:^3.0.0": version: 3.0.0 resolution: "global-agent@npm:3.0.0" @@ -20592,13 +20479,6 @@ __metadata: languageName: node linkType: hard -"has-unicode@npm:^2.0.1": - version: 2.0.1 - resolution: "has-unicode@npm:2.0.1" - checksum: 041b4293ad6bf391e21c5d85ed03f412506d6623786b801c4ab39e4e6ca54993f13201bceb544d92963f9e0024e6e7fbf0cb1d84c9d6b31cb9c79c8c990d13d8 - languageName: node - linkType: hard - "has-value@npm:^0.3.1": version: 0.3.1 resolution: "has-value@npm:0.3.1" @@ -20936,7 +20816,7 @@ __metadata: languageName: node linkType: hard -"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.0, http-cache-semantics@npm:^4.1.1": +"http-cache-semantics@npm:^4.0.0, http-cache-semantics@npm:^4.1.1": version: 4.1.1 resolution: "http-cache-semantics@npm:4.1.1" checksum: 362d5ed66b12ceb9c0a328fb31200b590ab1b02f4a254a697dc796850cc4385603e75f53ec59f768b2dad3bfa1464bd229f7de278d2899a0e3beffc634b6683f @@ -21274,13 +21154,6 @@ __metadata: languageName: node linkType: hard -"infer-owner@npm:^1.0.4": - version: 1.0.4 - resolution: "infer-owner@npm:1.0.4" - checksum: 181e732764e4a0611576466b4b87dac338972b839920b2a8cde43642e4ed6bd54dc1fb0b40874728f2a2df9a1b097b8ff83b56d5f8f8e3927f837fdcb47d8a89 - languageName: node - linkType: hard - "inflight@npm:^1.0.4": version: 1.0.6 resolution: "inflight@npm:1.0.6" @@ -24598,7 +24471,7 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^7.14.0, lru-cache@npm:^7.7.1": +"lru-cache@npm:^7.14.0": version: 7.18.3 resolution: "lru-cache@npm:7.18.3" checksum: 6029ca5aba3aacb554e919d7ef804fffd4adfc4c83db00fac8248c7c78811fb6d4b6f70f7fd9d55032b3823446546a007edaa66ad1f2377ae833bd983fac5d98 @@ -24672,30 +24545,6 @@ __metadata: languageName: node linkType: hard -"make-fetch-happen@npm:^10.0.3": - version: 10.2.1 - resolution: "make-fetch-happen@npm:10.2.1" - dependencies: - agentkeepalive: "npm:^4.2.1" - cacache: "npm:^16.1.0" - http-cache-semantics: "npm:^4.1.0" - http-proxy-agent: "npm:^5.0.0" - https-proxy-agent: "npm:^5.0.0" - is-lambda: "npm:^1.0.1" - lru-cache: "npm:^7.7.1" - minipass: "npm:^3.1.6" - minipass-collect: "npm:^1.0.2" - minipass-fetch: "npm:^2.0.3" - minipass-flush: "npm:^1.0.5" - minipass-pipeline: "npm:^1.2.4" - negotiator: "npm:^0.6.3" - promise-retry: "npm:^2.0.1" - socks-proxy-agent: "npm:^7.0.0" - ssri: "npm:^9.0.0" - checksum: fef5acb865a46f25ad0b5ad7d979799125db5dbb24ea811ffa850fbb804bc8e495df2237a8ec3a4fc6250e73c2f95549cca6d6d36a73b1faa61224504eb1188f - languageName: node - linkType: hard - "make-fetch-happen@npm:^13.0.0": version: 13.0.1 resolution: "make-fetch-happen@npm:13.0.1" @@ -26142,7 +25991,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:5.0.1, minimatch@npm:^5.0.1": +"minimatch@npm:5.0.1": version: 5.0.1 resolution: "minimatch@npm:5.0.1" dependencies: @@ -26178,15 +26027,6 @@ __metadata: languageName: node linkType: hard -"minipass-collect@npm:^1.0.2": - version: 1.0.2 - resolution: "minipass-collect@npm:1.0.2" - dependencies: - minipass: "npm:^3.0.0" - checksum: 14df761028f3e47293aee72888f2657695ec66bd7d09cae7ad558da30415fdc4752bbfee66287dcc6fd5e6a2fa3466d6c484dc1cbd986525d9393b9523d97f10 - languageName: node - linkType: hard - "minipass-collect@npm:^2.0.1": version: 2.0.1 resolution: "minipass-collect@npm:2.0.1" @@ -26196,21 +26036,6 @@ __metadata: languageName: node linkType: hard -"minipass-fetch@npm:^2.0.3": - version: 2.1.2 - resolution: "minipass-fetch@npm:2.1.2" - dependencies: - encoding: "npm:^0.1.13" - minipass: "npm:^3.1.6" - minipass-sized: "npm:^1.0.3" - minizlib: "npm:^2.1.2" - dependenciesMeta: - encoding: - optional: true - checksum: 8cfc589563ae2a11eebbf79121ef9a526fd078fca949ed3f1e4a51472ca4a4aad89fcea1738982ce9d7d833116ecc9c6ae9ebbd844832a94e3f4a3d4d1b9d3b9 - languageName: node - linkType: hard - "minipass-fetch@npm:^3.0.0": version: 3.0.3 resolution: "minipass-fetch@npm:3.0.3" @@ -26253,7 +26078,7 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^3.0.0, minipass@npm:^3.1.1, minipass@npm:^3.1.6": +"minipass@npm:^3.0.0": version: 3.3.5 resolution: "minipass@npm:3.3.5" dependencies: @@ -26889,7 +26714,7 @@ __metadata: languageName: node linkType: hard -"node-gyp@npm:^10.0.0": +"node-gyp@npm:^10.0.0, node-gyp@npm:latest": version: 10.1.0 resolution: "node-gyp@npm:10.1.0" dependencies: @@ -26909,26 +26734,6 @@ __metadata: languageName: node linkType: hard -"node-gyp@npm:latest": - version: 9.3.0 - resolution: "node-gyp@npm:9.3.0" - dependencies: - env-paths: "npm:^2.2.0" - glob: "npm:^7.1.4" - graceful-fs: "npm:^4.2.6" - make-fetch-happen: "npm:^10.0.3" - nopt: "npm:^6.0.0" - npmlog: "npm:^6.0.0" - rimraf: "npm:^3.0.2" - semver: "npm:^7.3.5" - tar: "npm:^6.1.2" - which: "npm:^2.0.2" - bin: - node-gyp: bin/node-gyp.js - checksum: b64c70a3984f9f23b9ae4606940e16c99edb93e7c455965afb0342ac961680efc4e553fed9f2654b9816072298da59fadfb832aeac6c625517cc228edb54c2c3 - languageName: node - linkType: hard - "node-int64@npm:^0.4.0": version: 0.4.0 resolution: "node-int64@npm:0.4.0" @@ -26981,17 +26786,6 @@ __metadata: languageName: node linkType: hard -"nopt@npm:^6.0.0": - version: 6.0.0 - resolution: "nopt@npm:6.0.0" - dependencies: - abbrev: "npm:^1.0.0" - bin: - nopt: bin/nopt.js - checksum: 3c1128e07cd0241ae66d6e6a472170baa9f3e84dd4203950ba8df5bafac4efa2166ce917a57ef02b01ba7c40d18b2cc64b29b225fd3640791fe07b24f0b33a32 - languageName: node - linkType: hard - "nopt@npm:^7.0.0": version: 7.2.1 resolution: "nopt@npm:7.2.1" @@ -27138,18 +26932,6 @@ __metadata: languageName: node linkType: hard -"npmlog@npm:^6.0.0": - version: 6.0.2 - resolution: "npmlog@npm:6.0.2" - dependencies: - are-we-there-yet: "npm:^3.0.0" - console-control-strings: "npm:^1.1.0" - gauge: "npm:^4.0.3" - set-blocking: "npm:^2.0.0" - checksum: 82b123677e62deb9e7472e27b92386c09e6e254ee6c8bcd720b3011013e4168bc7088e984f4fbd53cb6e12f8b4690e23e4fa6132689313e0d0dc4feea45489bb - languageName: node - linkType: hard - "nth-check@npm:^2.0.1": version: 2.0.1 resolution: "nth-check@npm:2.0.1" @@ -32529,15 +32311,6 @@ __metadata: languageName: node linkType: hard -"ssri@npm:^9.0.0": - version: 9.0.1 - resolution: "ssri@npm:9.0.1" - dependencies: - minipass: "npm:^3.1.1" - checksum: 7638a61e91432510718e9265d48d0438a17d53065e5184f1336f234ef6aa3479663942e41e97df56cda06bb24d9d0b5ef342c10685add3cac7267a82d7fa6718 - languageName: node - linkType: hard - "stack-trace@npm:0.0.10": version: 0.0.10 resolution: "stack-trace@npm:0.0.10" @@ -32769,7 +32542,7 @@ __metadata: languageName: node linkType: hard -"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^1.0.2 || 2 || 3 || 4, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": +"string-width-cjs@npm:string-width@^4.2.0, string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": version: 4.2.3 resolution: "string-width@npm:4.2.3" dependencies: @@ -34587,15 +34360,6 @@ __metadata: languageName: node linkType: hard -"unique-filename@npm:^2.0.0": - version: 2.0.1 - resolution: "unique-filename@npm:2.0.1" - dependencies: - unique-slug: "npm:^3.0.0" - checksum: 807acf3381aff319086b64dc7125a9a37c09c44af7620bd4f7f3247fcd5565660ac12d8b80534dcbfd067e6fe88a67e621386dd796a8af828d1337a8420a255f - languageName: node - linkType: hard - "unique-filename@npm:^3.0.0": version: 3.0.0 resolution: "unique-filename@npm:3.0.0" @@ -34605,15 +34369,6 @@ __metadata: languageName: node linkType: hard -"unique-slug@npm:^3.0.0": - version: 3.0.0 - resolution: "unique-slug@npm:3.0.0" - dependencies: - imurmurhash: "npm:^0.1.4" - checksum: 26fc5bc209a875956dd5e84ca39b89bc3be777b112504667c35c861f9547df95afc80439358d836b878b6d91f6ee21fe5ba1a966e9ec2e9f071ddf3fd67d45ee - languageName: node - linkType: hard - "unique-slug@npm:^4.0.0": version: 4.0.0 resolution: "unique-slug@npm:4.0.0" @@ -35936,15 +35691,6 @@ __metadata: languageName: node linkType: hard -"wide-align@npm:^1.1.5": - version: 1.1.5 - resolution: "wide-align@npm:1.1.5" - dependencies: - string-width: "npm:^1.0.2 || 2 || 3 || 4" - checksum: d5f8027b9a8255a493a94e4ec1b74a27bff6679d5ffe29316a3215e4712945c84ef73ca4045c7e20ae7d0c72f5f57f296e04a4928e773d4276a2f1222e4c2e99 - languageName: node - linkType: hard - "widest-line@npm:^2.0.0": version: 2.0.1 resolution: "widest-line@npm:2.0.1" From b2930c2cc4a153ff9b15f157134b7ba04d95aebe Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Fri, 7 Jun 2024 14:53:56 +0000 Subject: [PATCH 011/236] Update LavaMoat policies --- lavamoat/browserify/mmi/policy.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 87087d18fde1..dc6edd72b20e 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -787,7 +787,7 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask-institutional/sdk": true, "@metamask-institutional/transaction-update>@metamask-institutional/websocket-client": true, - "@metamask-institutional/transaction-update>@metamask/obs-store": true, + "@metamask/obs-store": true, "webpack>events": true } }, @@ -5113,4 +5113,4 @@ } } } -} +} \ No newline at end of file From 9a0fa837126865c109b3e10a1df0d89b0fc4cec2 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Fri, 7 Jun 2024 12:41:25 -0230 Subject: [PATCH 012/236] fix: Update minimum browser warning version, and gracefully fail if chrome.offscreen does not exist (#25142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the update to manifest v3, users on versions older than chrome 109 would have errors thrown from app-init about chrome.offscreen being undefined. Snaps and hardware wallets would be broken for these users. We need to update our minimum supported browser version to 109, but before we do that we need to warn users that there current browser version is out of date. This PR: 1. Handles the of chrome.offscreen being undefined in app-init.js, by simple not attempting to create the offscreen document of chrome.offscreen is undefined 2. Updates the `OUTDATED_BROWSER_VERSIONS` const so that users on chromium versions older than 109 will see a warning about their browser version 3. Adds an additional note to the outdated browser warning to tell users that snaps and hardware wallets won't work on the current version (but only for users on a MV3 version, where there is no offscreen document api) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25142?quickstart=1) Fixes: https://github.com/MetaMask/metamask-extension/issues/25116 1. Install a chromium version earlier than 109 (https://www.chromium.org/getting-involved/download-chromium/#downloading-old-builds-of-chrome-chromium) 2. Build, install and onboard on this branch 3. You should see a warning about the browser being out of date, and that snaps and most hardware wallets won't work with this version ![Screenshot from 2024-06-07 10-26-34](https://github.com/MetaMask/metamask-extension/assets/7499938/fa1ab356-47eb-4720-916c-72e334d9d0e5) ![Screenshot from 2024-06-07 10-25-59](https://github.com/MetaMask/metamask-extension/assets/7499938/36f78219-3266-4e76-9600-1b5f983ae98a) - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- app/_locales/en/messages.json | 3 +++ app/scripts/app-init.js | 2 +- shared/modules/mv3.utils.js | 20 ++++++++++++++++++++ ui/helpers/constants/common.ts | 13 ++++++++----- ui/helpers/utils/util.test.js | 6 +++--- ui/pages/home/home.component.js | 16 +++++++++++++++- 6 files changed, 50 insertions(+), 10 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 350195769da2..4e932f8a21e4 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2975,6 +2975,9 @@ "noDomainResolution": { "message": "No resolution for domain provided." }, + "noHardwareWalletOrSnapsSupport": { + "message": "Snaps, and most hardware wallets, will not work with your current browser version." + }, "noNFTs": { "message": "No NFTs yet" }, diff --git a/app/scripts/app-init.js b/app/scripts/app-init.js index 754346ecf2a0..c2295eeafc0b 100644 --- a/app/scripts/app-init.js +++ b/app/scripts/app-init.js @@ -186,7 +186,7 @@ registerInPageContentScript(); * folder for more details. */ async function createOffscreen() { - if (await chrome.offscreen.hasDocument()) { + if (!chrome.offscreen || (await chrome.offscreen.hasDocument())) { return; } diff --git a/shared/modules/mv3.utils.js b/shared/modules/mv3.utils.js index 3f9388b07a6b..4307ebbd8920 100644 --- a/shared/modules/mv3.utils.js +++ b/shared/modules/mv3.utils.js @@ -1,4 +1,24 @@ import browser from 'webextension-polyfill'; +/** + * A boolean indicating whether the manifest of the current extension + * is set to manifest version 3. + */ export const isManifestV3 = browser.runtime.getManifest().manifest_version === 3; + +/** + * A boolean indicating whether the browser supports the offscreen document api. + * This is only available in when the manifest is version 3, and only in chromium + * versions 109 and higher. As of June 7, 2024, it is not available in firefox. + */ +export const isOffscreenAvailable = Boolean(browser.offscreen); + +/** + * A boolean indicating whether the current extension's manifest is version 3 + * while the current browser does not support the offscreen document. This can + * happen to users on MetaMask versions 11.16.7 and higher, who are using a + * chromium browser with a version below 109. + */ +export const isMv3ButOffscreenDocIsMissing = + isManifestV3 && !isOffscreenAvailable; diff --git a/ui/helpers/constants/common.ts b/ui/helpers/constants/common.ts index 9df9eb95368f..0fcadbff3d6b 100644 --- a/ui/helpers/constants/common.ts +++ b/ui/helpers/constants/common.ts @@ -14,12 +14,15 @@ export const SUPPORT_REQUEST_LINK = process.env.SUPPORT_REQUEST_LINK; export const CONTRACT_ADDRESS_LINK = _contractAddressLink; export const PASSWORD_MIN_LENGTH = 8; export const OUTDATED_BROWSER_VERSIONS = { - // Chrome and Edge should match the latest Chrome version released ~2 years ago - chrome: '<90', - edge: '<90', + // Chrome and Edge should match the latest Chrome version released ~2 years ago, + // or the earliest version that supports our MV3 functionality, whichever is higher + chrome: '<109', + edge: '<109', // Firefox should match the most recent end-of-life extended support release firefox: '<91', - // Opera should be set to the equivalent of the Chrome version set + // Opera versions correspond to differently numbered Chromium versions. + // Opera should be set to the equivalent of the Chromium version set + // Opera 95 is based on Chromium 109 // See https://en.wikipedia.org/wiki/History_of_the_Opera_web_browser - opera: '<76', + opera: '<95', }; diff --git a/ui/helpers/utils/util.test.js b/ui/helpers/utils/util.test.js index f51824b3d8e4..bd9cbee4ebdf 100644 --- a/ui/helpers/utils/util.test.js +++ b/ui/helpers/utils/util.test.js @@ -204,7 +204,7 @@ describe('util', () => { }); it('should return false when given a modern chrome browser', () => { const browser = Bowser.getParser( - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.2623.112 Safari/537.36', + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.2623.112 Safari/537.36', ); const result = util.getIsBrowserDeprecated(browser); expect(result).toStrictEqual(false); @@ -232,7 +232,7 @@ describe('util', () => { }); it('should return false when given a modern opera browser', () => { const browser = Bowser.getParser( - 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.3578.98 Safari/537.36 OPR/76.0.3135.47', + 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.3578.98 Safari/537.36 OPR/95.0.3135.47', ); const result = util.getIsBrowserDeprecated(browser); expect(result).toStrictEqual(false); @@ -246,7 +246,7 @@ describe('util', () => { }); it('should return false when given a modern edge browser', () => { const browser = Bowser.getParser( - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.3578.98 Safari/537.36 Edg/90.0.416.68', + 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.3578.98 Safari/537.36 Edg/109.0.416.68', ); const result = util.getIsBrowserDeprecated(browser); expect(result).toStrictEqual(false); diff --git a/ui/pages/home/home.component.js b/ui/pages/home/home.component.js index 6bd78ec0efc9..62c584e46e4b 100644 --- a/ui/pages/home/home.component.js +++ b/ui/pages/home/home.component.js @@ -26,6 +26,7 @@ import ConnectedSites from '../connected-sites'; import ConnectedAccounts from '../connected-accounts'; import { Tabs, Tab } from '../../components/ui/tabs'; import { EthOverview } from '../../components/app/wallet-overview'; +import { isMv3ButOffscreenDocIsMissing } from '../../../shared/modules/mv3.utils'; import ActionableMessage from '../../components/ui/actionable-message/actionable-message'; import { @@ -483,6 +484,19 @@ export default class Home extends PureComponent { const autoHideDelay = 5 * SECOND; + const outdatedBrowserNotificationDescriptionText = + isMv3ButOffscreenDocIsMissing ? ( +

+ {t('outdatedBrowserNotification')} +
+ + {t('noHardwareWalletOrSnapsSupport')} + +
+ ) : ( + t('outdatedBrowserNotification') + ); + return ( {newNftAddedMessage === 'success' ? ( @@ -700,7 +714,7 @@ export default class Home extends PureComponent { ) : null} {showOutdatedBrowserWarning ? ( Date: Thu, 6 Jun 2024 15:08:49 -0230 Subject: [PATCH 013/236] fix: Fix types associated with auto lock timer call (#25109) --- app/scripts/controllers/app-state.js | 15 ++++++++++++--- .../advanced-tab/advanced-tab.component.js | 2 +- .../advanced-tab.component.test.js | 18 ++++++++++++++++-- ui/store/actions.ts | 2 +- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/app/scripts/controllers/app-state.js b/app/scripts/controllers/app-state.js index c871fd739ed2..731a9d0d25e4 100644 --- a/app/scripts/controllers/app-state.js +++ b/app/scripts/controllers/app-state.js @@ -288,10 +288,19 @@ export default class AppStateController extends EventEmitter { return; } + // This is a temporary fix until we add a state migration. + // Due to a bug in ui/pages/settings/advanced-tab/advanced-tab.component.js, + // it was possible for timeoutMinutes to be saved as a string, as explained + // in PR 25109. `alarms.create` will fail in that case. We are + // converting this to a number here to prevent that failure. Once + // we add a migration to update the malformed state to the right type, + // we will remove this conversion. + const timeoutToSet = Number(timeoutMinutes); + if (isManifestV3) { this.extension.alarms.create(AUTO_LOCK_TIMEOUT_ALARM, { - delayInMinutes: timeoutMinutes, - periodInMinutes: timeoutMinutes, + delayInMinutes: timeoutToSet, + periodInMinutes: timeoutToSet, }); this.extension.alarms.onAlarm.addListener((alarmInfo) => { if (alarmInfo.name === AUTO_LOCK_TIMEOUT_ALARM) { @@ -302,7 +311,7 @@ export default class AppStateController extends EventEmitter { } else { this.timer = setTimeout( () => this.onInactiveTimeout(), - timeoutMinutes * MINUTE, + timeoutToSet * MINUTE, ); } } diff --git a/ui/pages/settings/advanced-tab/advanced-tab.component.js b/ui/pages/settings/advanced-tab/advanced-tab.component.js index 33e0443d4570..2a2a759d5a96 100644 --- a/ui/pages/settings/advanced-tab/advanced-tab.component.js +++ b/ui/pages/settings/advanced-tab/advanced-tab.component.js @@ -613,7 +613,7 @@ export default class AdvancedTab extends PureComponent { if (autoLockTimeLimitBeforeNormalization === '') { this.setState({ autoLockTimeLimitBeforeNormalization, - autoLockTimeLimit: DEFAULT_AUTO_LOCK_TIME_LIMIT.toString(), + autoLockTimeLimit: DEFAULT_AUTO_LOCK_TIME_LIMIT, lockTimeError: '', }); return; diff --git a/ui/pages/settings/advanced-tab/advanced-tab.component.test.js b/ui/pages/settings/advanced-tab/advanced-tab.component.test.js index c50a32a7bd26..3982485b5178 100644 --- a/ui/pages/settings/advanced-tab/advanced-tab.component.test.js +++ b/ui/pages/settings/advanced-tab/advanced-tab.component.test.js @@ -6,13 +6,13 @@ import mockState from '../../../../test/data/mock-state.json'; import { renderWithProvider } from '../../../../test/lib/render-helpers'; import AdvancedTab from '.'; -const mockSetAutoLockTimeLimit = jest.fn(); +const mockSetAutoLockTimeLimit = jest.fn().mockReturnValue({ type: 'TYPE' }); const mockSetShowTestNetworks = jest.fn(); const mockSetStxOptIn = jest.fn(); jest.mock('../../../store/actions.ts', () => { return { - setAutoLockTimeLimit: () => mockSetAutoLockTimeLimit, + setAutoLockTimeLimit: (...args) => mockSetAutoLockTimeLimit(...args), setShowTestNetworks: () => mockSetShowTestNetworks, setSmartTransactionsOptInStatus: () => mockSetStxOptIn, }; @@ -60,6 +60,20 @@ describe('AdvancedTab Component', () => { expect(mockSetAutoLockTimeLimit).toHaveBeenCalled(); }); + it('should update the auto-lockout time to 0 if the input field is set to empty', () => { + const { queryByTestId } = renderWithProvider(, mockStore); + const autoLockoutTime = queryByTestId('auto-lockout-time'); + const autoLockoutButton = queryByTestId('auto-lockout-button'); + + fireEvent.change(autoLockoutTime, { target: { value: '' } }); + + expect(autoLockoutTime).toHaveValue(''); + + fireEvent.click(autoLockoutButton); + + expect(mockSetAutoLockTimeLimit).toHaveBeenCalledWith(0); + }); + it('should toggle show test networks', () => { const { queryAllByRole } = renderWithProvider(, mockStore); diff --git a/ui/store/actions.ts b/ui/store/actions.ts index 6c7331433365..90ad6bcddce6 100644 --- a/ui/store/actions.ts +++ b/ui/store/actions.ts @@ -3102,7 +3102,7 @@ export function setSmartTransactionsOptInStatus( }; } -export function setAutoLockTimeLimit(value: boolean) { +export function setAutoLockTimeLimit(value: number | null) { return setPreference('autoLockTimeLimit', value); } From 2d74793b141a7a9aa534a1bad3087272dc80f88d Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Fri, 7 Jun 2024 13:28:49 -0230 Subject: [PATCH 014/236] Update changelog for v11.16.8 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fee34a73cc69..f7c2b5641570 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [11.16.8] ### Changed +- Prepare for increasing the minimum Chromium version supported by MetaMask ([#25142](https://github.com/MetaMask/metamask-extension/pull/25142)) + - Users on Chromium versions lower than 109 will now see a warning that they need to update their browser. + Assuming their Chromium browser does not support the Offscreen Document api, the warning will include a note + that Snaps and Hardware wallets do not work on their current browser version. - [MMI] Updates MMI packages to latest versions ([#24581](https://github.com/MetaMask/metamask-extension/pull/24581)) ### Fixed +- Fix bug that could cause users to be locked out of MetaMask if they previously emptied the "Auto-lock timer" advanced setting +input field and save it in that empty state. ([#25109](https://github.com/MetaMask/metamask-extension/pull/25109)) +- Fix bug that can prevent updates to network data in connected dapps after manually switching the network in the wallet ui ([#25127](https://github.com/MetaMask/metamask-extension/pull/25127)) - [MMI] Fixed an issue that prevented MMI transactions from being sent correctly ([#24947](https://github.com/MetaMask/metamask-extension/pull/24947)) - [MMI] Better support for MMI Portfolio Dashboard with an update to the allow list ([#24992](https://github.com/MetaMask/metamask-extension/pull/24992)) From fab8cb54baf30299f4925d41a8b589804f28f168 Mon Sep 17 00:00:00 2001 From: micaelae <100321200+micaelae@users.noreply.github.com> Date: Fri, 7 Jun 2024 17:23:56 -0700 Subject: [PATCH 015/236] v12.0.0 swap send updates (#25152) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Follow-up PR for [Swap+Send](https://github.com/MetaMask/metamask-extension/pull/23703) Cherry pick of * chore: update swaps blockedList api url #[24837](https://github.com/MetaMask/metamask-extension/pull/24837) * fix: re-enable swap-send-eth e2e test #[24882](https://github.com/MetaMask/metamask-extension/pull/24882) * chore: add swap+send analytics #[25078](https://github.com/MetaMask/metamask-extension/pull/25078) * fix: resolve all known swap+send bugs #[25100](https://github.com/MetaMask/metamask-extension/pull/25100) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25152?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Bilal <44588480+BZahory@users.noreply.github.com> --- app/_locales/de/messages.json | 3 - app/_locales/el/messages.json | 3 - app/_locales/en/messages.json | 4 +- app/_locales/es/messages.json | 3 - app/_locales/fr/messages.json | 3 - app/_locales/hi/messages.json | 3 - app/_locales/id/messages.json | 3 - app/_locales/ja/messages.json | 3 - app/_locales/ko/messages.json | 3 - app/_locales/pt/messages.json | 3 - app/_locales/ru/messages.json | 3 - app/_locales/tl/messages.json | 3 - app/_locales/tr/messages.json | 3 - app/_locales/vi/messages.json | 3 - app/_locales/zh_CN/messages.json | 3 - privacy-snapshot.json | 1 + shared/constants/metametrics.ts | 8 + shared/constants/swaps.ts | 1 + shared/lib/swaps-utils.js | 8 +- test/data/mock-send-state.json | 1 + .../e2e/tests/swap-send/swap-send-eth.spec.ts | 38 ++- .../tests/swap-send/swap-send-test-utils.ts | 24 +- test/jest/mocks.js | 1 + ui/components/app/nfts-items/nfts-items.js | 26 +- .../text-field-search/text-field-search.tsx | 1 + .../asset-picker-modal/AssetList.test.tsx | 14 +- .../asset-picker-modal/AssetList.tsx | 12 +- .../asset-picker-modal.test.tsx | 8 +- .../asset-picker-modal/asset-picker-modal.tsx | 146 +++++++++--- .../asset-picker/asset-picker.tsx | 24 +- .../asset-picker-amount/max-clear-button.tsx | 3 + .../send/__snapshots__/send.test.js.snap | 2 +- .../pages/send/components/address-book.tsx | 14 ++ .../send/components/quote-card/index.tsx | 15 +- .../send/components/recipient-content.tsx | 2 - .../pages/send/components/recipient-input.tsx | 13 +- .../pages/send/components/recipient.tsx | 20 ++ .../pages/send/components/your-accounts.tsx | 16 +- ui/components/multichain/pages/send/send.js | 45 +++- ui/ducks/send/helpers.js | 7 +- ui/ducks/send/send.js | 223 ++++++++++++++---- ui/ducks/send/send.test.js | 4 + ui/hooks/useUpdateSwapsState.test.ts | 5 + ui/hooks/useUpdateSwapsState.ts | 13 +- 44 files changed, 560 insertions(+), 181 deletions(-) diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 4093f1a7e8ab..a6d9509f2eaa 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -4385,9 +4385,6 @@ "searchAccounts": { "message": "Konten durchsuchen" }, - "searchTokenOrNFT": { - "message": "Token oder NFT suchen" - }, "searchTokens": { "message": "Tokens suchen" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 6ce8f31594d8..07444377c33e 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -4385,9 +4385,6 @@ "searchAccounts": { "message": "Αναζήτηση λογαριασμών" }, - "searchTokenOrNFT": { - "message": "Αναζήτηση tokens ή NFC" - }, "searchTokens": { "message": "Αναζήτηση tokens" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 8dfe76bd4d6a..95e0cee18115 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -4422,8 +4422,8 @@ "searchAccounts": { "message": "Search accounts" }, - "searchTokenOrNFT": { - "message": "Search token or NFT" + "searchNfts": { + "message": "Search NFTs" }, "searchTokens": { "message": "Search tokens" diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 1e49892ddc52..9a433fa6cec5 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -4382,9 +4382,6 @@ "searchAccounts": { "message": "Buscar cuentas" }, - "searchTokenOrNFT": { - "message": "Buscar token o NFT" - }, "searchTokens": { "message": "Buscar tokens" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 914d6751aa66..bfc83939ea44 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -4385,9 +4385,6 @@ "searchAccounts": { "message": "Rechercher des comptes" }, - "searchTokenOrNFT": { - "message": "Rechercher un jeton ou un NFT" - }, "searchTokens": { "message": "Rechercher des jetons" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index a991c2f69fab..7862528c3aa7 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -4382,9 +4382,6 @@ "searchAccounts": { "message": "अकाउंट्स खोजें" }, - "searchTokenOrNFT": { - "message": "टोकन या NFT को ढूंढें" - }, "searchTokens": { "message": "टोकनों को ढूंढें" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 646475dd70d6..c78f823a3482 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -4385,9 +4385,6 @@ "searchAccounts": { "message": "Cari akun" }, - "searchTokenOrNFT": { - "message": "Cari token atau NFT" - }, "searchTokens": { "message": "Cari token" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 6fe9c6e9e022..c4bd9a76e9d3 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -4382,9 +4382,6 @@ "searchAccounts": { "message": "アカウントを検索" }, - "searchTokenOrNFT": { - "message": "トークンまたはNFTを検索" - }, "searchTokens": { "message": "トークンを検索" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 541eddf65c3b..9a6f5e4f1e57 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -4382,9 +4382,6 @@ "searchAccounts": { "message": "계정 검색" }, - "searchTokenOrNFT": { - "message": "토큰 또는 NFT 검색" - }, "searchTokens": { "message": "토큰 검색" }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 0d2e49a4a352..7c2cb8d46847 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -4385,9 +4385,6 @@ "searchAccounts": { "message": "Pesquisar contas" }, - "searchTokenOrNFT": { - "message": "Pesquisar token ou NFT" - }, "searchTokens": { "message": "Pesquisar tokens" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 8766b3bf8c5e..fe34b9fb4074 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -4385,9 +4385,6 @@ "searchAccounts": { "message": "Поиск счетов" }, - "searchTokenOrNFT": { - "message": "Поиск токена или NFT" - }, "searchTokens": { "message": "Поиск токенов" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index bc3ca3ac0d84..3cf94a3b2736 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -4382,9 +4382,6 @@ "searchAccounts": { "message": "Maghanap ng mga account" }, - "searchTokenOrNFT": { - "message": "Maghanap ng token o NFT" - }, "searchTokens": { "message": "Maghanap ng mga token" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index c2c3e5807dc6..d42faeb0fcf6 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -4385,9 +4385,6 @@ "searchAccounts": { "message": "Hesapları ara" }, - "searchTokenOrNFT": { - "message": "Token veya NFT ara" - }, "searchTokens": { "message": "Token ara" }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 6c4e04884f59..4d433ab1c7b8 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -4382,9 +4382,6 @@ "searchAccounts": { "message": "Tìm kiếm tài khoản" }, - "searchTokenOrNFT": { - "message": "Tìm kiếm token hoặc NFT" - }, "searchTokens": { "message": "Tìm kiếm token" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index d4031bc5f668..87a5e2cdc6fd 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -4382,9 +4382,6 @@ "searchAccounts": { "message": "搜索账户" }, - "searchTokenOrNFT": { - "message": "搜索代币或 NFT" - }, "searchTokens": { "message": "搜索代币" }, diff --git a/privacy-snapshot.json b/privacy-snapshot.json index b0a1525cf961..499582424bd4 100644 --- a/privacy-snapshot.json +++ b/privacy-snapshot.json @@ -41,6 +41,7 @@ "swap.api.cx.metamask.io", "test.metamask-phishing.io", "token.api.cx.metamask.io", + "tokens.api.cx.metamask.io", "tx-sentinel-ethereum-mainnet.api.cx.metamask.io", "unresponsive-rpc.url", "www.4byte.directory", diff --git a/shared/constants/metametrics.ts b/shared/constants/metametrics.ts index f3f6f8a08396..0cec97a26f31 100644 --- a/shared/constants/metametrics.ts +++ b/shared/constants/metametrics.ts @@ -720,6 +720,13 @@ export enum MetaMetricsEventName { // Notifications PushNotificationReceived = 'Push Notification Received', PushNotificationClicked = 'Push Notification Clicked', + // Send + sendAssetSelected = 'Send Asset Selected', + sendFlowExited = 'Send Flow Exited', + sendRecipientSelected = 'Send Recipient Selected', + sendSwapQuoteError = 'Send Swap Quote Error', + sendSwapQuoteFetched = 'Send Swap Quote Fetched', + sendTokenModalOpened = 'Send Token Modal Opened', } export enum MetaMetricsEventAccountType { @@ -761,6 +768,7 @@ export enum MetaMetricsEventCategory { Phishing = 'Phishing', PushNotifications = 'Notifications', Retention = 'Retention', + Send = 'Send', Settings = 'Settings', Snaps = 'Snaps', Swaps = 'Swaps', diff --git a/shared/constants/swaps.ts b/shared/constants/swaps.ts index 301e7f7ade0c..61f9b58b3ed5 100644 --- a/shared/constants/swaps.ts +++ b/shared/constants/swaps.ts @@ -170,6 +170,7 @@ const SWAPS_TESTNET_CHAIN_ID = '0x539'; export const SWAPS_API_V2_BASE_URL = 'https://swap.api.cx.metamask.io'; export const SWAPS_DEV_API_V2_BASE_URL = 'https://swap.dev-api.cx.metamask.io'; +export const TOKEN_API_BASE_URL = 'https://tokens.api.cx.metamask.io'; export const GAS_API_BASE_URL = 'https://gas.api.infura.io'; export const GAS_DEV_API_BASE_URL = 'https://gas.uat-api.cx.metamask.io'; diff --git a/shared/lib/swaps-utils.js b/shared/lib/swaps-utils.js index 1cc69a7285fb..303e0f12f0e1 100644 --- a/shared/lib/swaps-utils.js +++ b/shared/lib/swaps-utils.js @@ -8,6 +8,7 @@ import { SWAPS_CLIENT_ID, SWAPS_DEV_API_V2_BASE_URL, SWAPS_WRAPPED_TOKENS_ADDRESSES, + TOKEN_API_BASE_URL, } from '../constants/swaps'; import { SECOND } from '../constants/time'; import { isValidHexAddress } from '../modules/hexstring-utils'; @@ -130,6 +131,7 @@ const getBaseUrlForNewSwapsApi = (type, chainId) => { ? SWAPS_DEV_API_V2_BASE_URL : SWAPS_API_V2_BASE_URL; const gasApiBaseUrl = GAS_API_BASE_URL; + const tokenApiBaseUrl = TOKEN_API_BASE_URL; const noNetworkSpecificTypes = ['refreshTime']; // These types don't need network info in the URL. if (noNetworkSpecificTypes.includes(type)) { return v2ApiBaseUrl; @@ -139,6 +141,10 @@ const getBaseUrlForNewSwapsApi = (type, chainId) => { if (gasApiTypes.includes(type)) { return `${gasApiBaseUrl}/networks/${chainIdDecimal}`; // Gas calculations are in its own repo. } + const tokenApiTypes = ['blockedTokens']; + if (tokenApiTypes.includes(type)) { + return `${tokenApiBaseUrl}/blocklist?chainId=${chainIdDecimal}`; // Token blocklist is in its own api + } return `${v2ApiBaseUrl}/networks/${chainIdDecimal}`; }; @@ -164,7 +170,7 @@ export const getBaseApi = function (type, chainId) { case 'gasPrices': return `${baseUrl}/gasPrices`; case 'blockedTokens': - return `${baseUrl}/blockedTokens`; + return `${baseUrl}®ion=global`; case 'network': return baseUrl; default: diff --git a/test/data/mock-send-state.json b/test/data/mock-send-state.json index af9a25d14136..f1caf9b7eeee 100644 --- a/test/data/mock-send-state.json +++ b/test/data/mock-send-state.json @@ -1288,6 +1288,7 @@ "status": "VALID", "swapQuotesError": null, "swapQuotesLatestRequestTimestamp": null, + "timeToFetchQuotes": null, "transactionType": "0x2", "userInputHexData": null } diff --git a/test/e2e/tests/swap-send/swap-send-eth.spec.ts b/test/e2e/tests/swap-send/swap-send-eth.spec.ts index b1e40543150f..f7835af0c332 100644 --- a/test/e2e/tests/swap-send/swap-send-eth.spec.ts +++ b/test/e2e/tests/swap-send/swap-send-eth.spec.ts @@ -15,9 +15,7 @@ const RECIPIENT_ADDRESS = '0xc427D562164062a23a5cFf596A4a3208e72Acd28'; describe('Swap-Send ETH', function () { describe('to non-contract address with data that matches swap data signature', function (this: Suite) { - // TODO: reenable this in follow-up - // eslint-disable-next-line mocha/no-skipped-tests - it.skip('submits a transaction successfully', async function () { + it('submits a transaction successfully', async function () { await withFixtures( getSwapSendFixtures(this.test?.fullTitle()), async ({ @@ -38,11 +36,6 @@ describe('Swap-Send ETH', function () { await swapSendPage.fillRecipientAddressInput(RECIPIENT_ADDRESS); await swapSendPage.fillAmountInput('1'); - await swapSendPage.verifyMaxButtonClick( - ['ETH', 'ETH'], - ['24.995559472', '24.995559472'], - ); - await swapSendPage.searchAndSelectToken('TST', 'src'); await swapSendPage.verifyAssetSymbolsAndAmounts( ['TST', 'TST'], @@ -97,4 +90,33 @@ describe('Swap-Send ETH', function () { ); }); }); + + it('sets max amount', async function () { + await withFixtures( + getSwapSendFixtures(this.test?.fullTitle()), + async ({ + driver, + ganacheServer, + }: { + // TODO: Replace `any` with type + // eslint-disable-next-line @typescript-eslint/no-explicit-any + driver: any; + ganacheServer: Ganache; + }) => { + const swapSendPage = new SwapSendPage(driver); + await logInWithBalanceValidation(driver, ganacheServer); + + // START SWAP AND SEND FLOW + await openActionMenuAndStartSendFlow(driver); + + await swapSendPage.fillRecipientAddressInput(RECIPIENT_ADDRESS); + await swapSendPage.fillAmountInput('1'); + + await swapSendPage.verifyMaxButtonClick( + ['ETH', 'ETH'], + ['24.995559472', '24.995559472'], + ); + }, + ); + }); }); diff --git a/test/e2e/tests/swap-send/swap-send-test-utils.ts b/test/e2e/tests/swap-send/swap-send-test-utils.ts index 533e0da97bda..0cfff6449b7f 100644 --- a/test/e2e/tests/swap-send/swap-send-test-utils.ts +++ b/test/e2e/tests/swap-send/swap-send-test-utils.ts @@ -36,13 +36,27 @@ export class SwapSendPage { ); const indexOfButtonToClick = isDest ? 1 : 0; await buttons[indexOfButtonToClick].click(); - await this.driver.waitForSelector( - '[data-testid="asset-picker-modal-search-input"]', - ); - await this.driver.fill( + + // Clear search input + const searchInputField = await this.driver.waitForSelector( '[data-testid="asset-picker-modal-search-input"]', - symbol, ); + const searchValue = await searchInputField.getProperty('value'); + if (searchValue) { + const clearButton = await this.driver.findElement( + '[data-testid="text-field-search-clear-button"]', + ); + if (clearButton) { + await clearButton.click(); + } + } + + for (const i of symbol) { + const f = await this.driver.waitForSelector( + '[data-testid="asset-picker-modal-search-input"]', + ); + await f.press(i); + } // Verify that only matching tokens are listed assert.equal( ( diff --git a/test/jest/mocks.js b/test/jest/mocks.js index 7289f687bcd3..3170a8dbb8f9 100644 --- a/test/jest/mocks.js +++ b/test/jest/mocks.js @@ -152,6 +152,7 @@ export const getInitialSendStateWithExistingTxState = (draftTxState) => ({ }, swapQuotesError: null, swapQuotesLatestRequestTimestamp: null, + timeToFetchQuotes: null, recipient: { ...draftTransactionInitialState.recipient, ...draftTxState.recipient, diff --git a/ui/components/app/nfts-items/nfts-items.js b/ui/components/app/nfts-items/nfts-items.js index 6615ab928279..7f2cfce7c7cb 100644 --- a/ui/components/app/nfts-items/nfts-items.js +++ b/ui/components/app/nfts-items/nfts-items.js @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useContext, useEffect } from 'react'; import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; @@ -33,8 +33,16 @@ import { getNftsDropdownState } from '../../../ducks/metamask/metamask'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { Icon, IconName, Text } from '../../component-library'; import { NftItem } from '../../multichain/nft-item'; -import { updateSendAsset } from '../../../ducks/send'; +import { + getSendAnalyticProperties, + updateSendAsset, +} from '../../../ducks/send'; import { AssetType } from '../../../../shared/constants/transaction'; +import { MetaMetricsContext } from '../../../contexts/metametrics'; +import { + MetaMetricsEventCategory, + MetaMetricsEventName, +} from '../../../../shared/constants/metametrics'; const width = (isModal) => { const env = getEnvironmentType() === ENVIRONMENT_TYPE_POPUP; @@ -69,6 +77,9 @@ export default function NftsItems({ const ipfsGateway = useSelector(getIpfsGateway); const openSeaEnabled = useSelector(getOpenSeaEnabled); + const trackEvent = useContext(MetaMetricsContext); + const sendAnalytics = useSelector(getSendAnalyticProperties); + useEffect(() => { if ( chainId !== undefined && @@ -153,6 +164,17 @@ export default function NftsItems({ }; const onSendNft = async (nft) => { + trackEvent({ + event: MetaMetricsEventName.sendAssetSelected, + category: MetaMetricsEventCategory.Send, + properties: { + ...sendAnalytics, + is_destination_asset_picker_modal: false, + new_asset_symbol: nft.name, + new_asset_address: nft.address, + is_nft: true, + }, + }); await dispatch( updateSendAsset({ type: AssetType.NFT, diff --git a/ui/components/component-library/text-field-search/text-field-search.tsx b/ui/components/component-library/text-field-search/text-field-search.tsx index 822bed278b98..736f30a55859 100644 --- a/ui/components/component-library/text-field-search/text-field-search.tsx +++ b/ui/components/component-library/text-field-search/text-field-search.tsx @@ -46,6 +46,7 @@ export const TextFieldSearch: TextFieldSearchComponent = React.forwardRef( <> ({ @@ -21,10 +20,6 @@ jest.mock('../../../../ducks/metamask/metamask', () => ({ getNativeCurrency: jest.fn(), })); -jest.mock('../../../../ducks/send', () => ({ - getSwapsBlockedTokens: jest.fn(), -})); - jest.mock('../../../../hooks/useUserPreferencedCurrency', () => ({ useUserPreferencedCurrency: jest.fn(), })); @@ -83,9 +78,6 @@ describe('AssetList', () => { if (selector === getSelectedAccountCachedBalance) { return balanceValue; } - if (selector === getSwapsBlockedTokens) { - return []; - } return undefined; }); @@ -112,6 +104,7 @@ describe('AssetList', () => { handleAssetChange={handleAssetChangeMock} asset={{ balance: '1', type: AssetType.native }} tokenList={tokenList} + memoizedSwapsBlockedTokens={new Set([])} />, ); @@ -125,6 +118,7 @@ describe('AssetList', () => { handleAssetChange={handleAssetChangeMock} asset={{ balance: '1', type: AssetType.native }} tokenList={tokenList} + memoizedSwapsBlockedTokens={new Set([])} />, ); @@ -142,9 +136,6 @@ describe('AssetList', () => { if (selector === getSelectedAccountCachedBalance) { return balanceValue; } - if (selector === getSwapsBlockedTokens) { - return ['0xtoken1']; - } return undefined; }); @@ -154,6 +145,7 @@ describe('AssetList', () => { asset={{ balance: '1', type: AssetType.native }} tokenList={tokenList} sendingAssetSymbol="IRRELEVANT" + memoizedSwapsBlockedTokens={new Set(['0xtoken1'])} />, ); diff --git a/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx b/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx index 7e4068f63d69..fc117998ea3c 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker-modal/AssetList.tsx @@ -1,4 +1,4 @@ -import React, { useMemo } from 'react'; +import React from 'react'; import { useSelector } from 'react-redux'; import classnames from 'classnames'; import { getSelectedAccountCachedBalance } from '../../../../selectors'; @@ -16,7 +16,6 @@ import { FlexWrap, } from '../../../../helpers/constants/design-system'; import { TokenListItem } from '../..'; -import { getSwapsBlockedTokens } from '../../../../ducks/send'; import { isEqualCaseInsensitive } from '../../../../../shared/modules/string-utils'; import { Asset, Token } from './types'; import AssetComponent from './Asset'; @@ -26,6 +25,7 @@ type AssetListProps = { asset: Asset; tokenList: Token[]; sendingAssetSymbol?: string; + memoizedSwapsBlockedTokens: Set; }; export default function AssetList({ @@ -33,6 +33,7 @@ export default function AssetList({ asset, tokenList, sendingAssetSymbol, + memoizedSwapsBlockedTokens, }: AssetListProps) { const selectedToken = asset.details?.address; @@ -61,11 +62,6 @@ export default function AssetList({ hideLabel: true, }); - const swapsBlockedTokens = useSelector(getSwapsBlockedTokens); - const memoizedSwapsBlockedTokens = useMemo(() => { - return new Set(swapsBlockedTokens); - }, [swapsBlockedTokens]); - return ( {tokenList.map((token) => { @@ -73,7 +69,7 @@ export default function AssetList({ const isSelected = tokenAddress === selectedToken?.toLowerCase(); const isDisabled = sendingAssetSymbol ? !isEqualCaseInsensitive(sendingAssetSymbol, token.symbol) && - memoizedSwapsBlockedTokens.has(tokenAddress) + memoizedSwapsBlockedTokens.has(tokenAddress as string) : false; return ( { renderWithProvider(, store); expect(screen.getByTestId('asset-picker-modal')).toBeInTheDocument(); - expect(screen.getByPlaceholderText('searchTokenOrNFT')).toBeInTheDocument(); + expect(screen.getByPlaceholderText('searchTokens')).toBeInTheDocument(); }); it('calls onClose when modal is closed', () => { @@ -174,7 +174,7 @@ describe('AssetPickerModal', () => { it('filters tokens based on search query', () => { renderWithProvider(, store); - fireEvent.change(screen.getByPlaceholderText('searchTokenOrNFT'), { + fireEvent.change(screen.getByPlaceholderText('searchTokens'), { target: { value: 'TO' }, }); @@ -182,7 +182,7 @@ describe('AssetPickerModal', () => { (AssetList as jest.Mock).mock.calls.slice(-1)[0][0].tokenList.length, ).toBe(1); - fireEvent.change(screen.getByPlaceholderText('searchTokenOrNFT'), { + fireEvent.change(screen.getByPlaceholderText('searchTokens'), { target: { value: 'UNAVAILABLE TOKEN' }, }); @@ -224,7 +224,7 @@ describe('AssetPickerModal', () => { store, ); const modalTitle = getByText('sendSelectReceiveAsset'); - const searchPlaceholder = getByPlaceholderText('searchTokenOrNFT'); + const searchPlaceholder = getByPlaceholderText('searchTokens'); expect(modalTitle).toBeInTheDocument(); expect(searchPlaceholder).toBeInTheDocument(); diff --git a/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.tsx b/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.tsx index 042041f6adca..8a4d5789dacf 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.tsx @@ -1,4 +1,4 @@ -import React, { useState, useCallback, useMemo } from 'react'; +import React, { useState, useCallback, useMemo, useContext } from 'react'; import { useSelector } from 'react-redux'; import { isEqual, uniqBy } from 'lodash'; @@ -37,26 +37,39 @@ import { AssetType } from '../../../../../shared/constants/transaction'; import { useNftsCollections } from '../../../../hooks/useNftsCollections'; import ZENDESK_URLS from '../../../../helpers/constants/zendesk-url'; import { + getAllTokens, getCurrentChainId, getCurrentCurrency, + getIsMainnet, getNativeCurrencyImage, getSelectedAccountCachedBalance, getSelectedInternalAccount, getShouldHideZeroBalanceTokens, getTokenExchangeRates, getTokenList, + getUseNftDetection, } from '../../../../selectors'; import { getConversionRate, getNativeCurrency, - getTokens, } from '../../../../ducks/metamask/metamask'; import { useTokenTracker } from '../../../../hooks/useTokenTracker'; import { getTopAssets } from '../../../../ducks/swaps/swaps'; import { getRenderableTokenData } from '../../../../hooks/useTokensToSearch'; import { useEqualityCheck } from '../../../../hooks/useEqualityCheck'; -import AssetList from './AssetList'; +import { + MetaMetricsEventName, + MetaMetricsEventCategory, +} from '../../../../../shared/constants/metametrics'; +import { MetaMetricsContext } from '../../../../contexts/metametrics'; +import { + getSendAnalyticProperties, + getSwapsBlockedTokens, +} from '../../../../ducks/send'; +import NFTsDetectionNoticeNFTsTab from '../../../app/nfts-detection-notice-nfts-tab/nfts-detection-notice-nfts-tab'; +import { isEqualCaseInsensitive } from '../../../../../shared/modules/string-utils'; import { Asset, Collection, Token } from './types'; +import AssetList from './AssetList'; type AssetPickerModalProps = { isOpen: boolean; @@ -78,6 +91,8 @@ export function AssetPickerModal({ sendingAssetSymbol, }: AssetPickerModalProps) { const t = useI18nContext(); + const trackEvent = useContext(MetaMetricsContext); + const sendAnalytics = useSelector(getSendAnalyticProperties); const [searchQuery, setSearchQuery] = useState(''); @@ -108,9 +123,27 @@ export function AssetPickerModal({ (collection) => collection.nfts.length > 0, ); + const swapsBlockedTokens = useSelector(getSwapsBlockedTokens); + const memoizedSwapsBlockedTokens = useMemo(() => { + return new Set(swapsBlockedTokens); + }, [swapsBlockedTokens]); + + const isDest = sendingAssetImage && sendingAssetSymbol; + const handleAssetChange = useCallback( (token: Token) => { onAssetChange(token); + trackEvent({ + event: MetaMetricsEventName.sendAssetSelected, + category: MetaMetricsEventCategory.Send, + properties: { + ...sendAnalytics, + is_destination_asset_picker_modal: Boolean(isDest), + new_asset_symbol: token.symbol, + new_asset_address: token.address, + is_nft: false, + }, + }); onClose(); }, [onAssetChange], @@ -118,7 +151,6 @@ export function AssetPickerModal({ const defaultActiveTabKey = asset?.type === AssetType.NFT ? 'nfts' : 'tokens'; - const isDest = sendingAssetImage && sendingAssetSymbol; const chainId = useSelector(getCurrentChainId); const nativeCurrencyImage = useSelector(getNativeCurrencyImage); @@ -133,7 +165,13 @@ export function AssetPickerModal({ const shouldHideZeroBalanceTokens = useSelector( getShouldHideZeroBalanceTokens, ); - const tokens = useSelector(getTokens, isEqual); + + const useNftDetection = useSelector(getUseNftDetection); + const isMainnet = useSelector(getIsMainnet); + + const detectedTokens = useSelector(getAllTokens); + const tokens = detectedTokens?.[chainId]?.[selectedAddress] ?? []; + const { tokensWithBalances } = useTokenTracker({ tokens, address: selectedAddress, @@ -162,9 +200,20 @@ export function AssetPickerModal({ // undefined would be the native token address const filteredTokensAddresses = new Set(); + const getIsDisabled = ({ address, symbol }: Token) => { + const isDisabled = sendingAssetSymbol + ? !isEqualCaseInsensitive(sendingAssetSymbol, symbol) && + memoizedSwapsBlockedTokens.has(address || '') + : false; + + return isDisabled; + }; + function* tokenGenerator() { yield nativeToken; + const blockedTokens = []; + for (const token of memoizedUsersTokens) { yield token; } @@ -173,13 +222,22 @@ export function AssetPickerModal({ for (const address of Object.keys(topTokens)) { const token = tokenList?.[address]; if (token) { - yield token; + if (isDest && getIsDisabled(token)) { + blockedTokens.push(token); + continue; + } else { + yield token; + } } } for (const token of Object.values(tokenList)) { yield token; } + + for (const token of blockedTokens) { + yield token; + } } let token: Token; @@ -225,14 +283,15 @@ export function AssetPickerModal({ currentCurrency, chainId, tokenList, + sendingAssetSymbol, ]); const Search = useCallback( - () => ( + ({ isNFTSearch = false }: { isNFTSearch?: boolean }) => ( setSearchQuery(e.target.value)} error={false} @@ -298,6 +357,7 @@ export function AssetPickerModal({ asset={asset} tokenList={filteredTokenList} sendingAssetSymbol={sendingAssetSymbol} + memoizedSwapsBlockedTokens={memoizedSwapsBlockedTokens} /> ) : ( @@ -319,6 +379,7 @@ export function AssetPickerModal({ handleAssetChange={handleAssetChange} asset={asset} tokenList={filteredTokenList} + memoizedSwapsBlockedTokens={memoizedSwapsBlockedTokens} /> } @@ -334,7 +395,7 @@ export function AssetPickerModal({ > {hasAnyNfts ? ( - + ) : ( - - - - + <> + {isMainnet && !useNftDetection && ( + + + + )} - - {t('noNFTs')} - - + + + - {t('learnMoreUpperCase')} - + + {t('noNFTs')} + + + {t('learnMoreUpperCase')} + + - + )} } diff --git a/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx b/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx index 4c7be3c9db44..5867fc86b870 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useContext, useState } from 'react'; import { useSelector } from 'react-redux'; import { AvatarTokenSize, @@ -8,7 +8,7 @@ import { Box, Button, } from '../../../component-library'; -import { Asset } from '../../../../ducks/send'; +import { Asset, getSendAnalyticProperties } from '../../../../ducks/send'; import { AlignItems, BackgroundColor, @@ -31,6 +31,11 @@ import Tooltip from '../../../ui/tooltip'; import { LARGE_SYMBOL_LENGTH } from '../constants'; import { getAssetImageURL } from '../../../../helpers/utils/util'; import { useI18nContext } from '../../../../hooks/useI18nContext'; +import { MetaMetricsContext } from '../../../../contexts/metametrics'; +import { + MetaMetricsEventCategory, + MetaMetricsEventName, +} from '../../../../../shared/constants/metametrics'; export type AssetPickerProps = { asset: Asset; @@ -53,6 +58,9 @@ export function AssetPicker({ isDisabled = false, }: AssetPickerProps) { const t = useI18nContext(); + const trackEvent = useContext(MetaMetricsContext); + const sendAnalytics = useSelector(getSendAnalyticProperties); + const nativeCurrencySymbol = useSelector(getNativeCurrency); const nativeCurrencyImageUrl = useSelector(getNativeCurrencyImage); // TODO: Replace `any` with type @@ -124,7 +132,17 @@ export function AssetPicker({ paddingRight={2} justifyContent={isNFT ? JustifyContent.spaceBetween : undefined} backgroundColor={BackgroundColor.transparent} - onClick={() => setShowAssetPickerModal(true)} + onClick={() => { + setShowAssetPickerModal(true); + trackEvent({ + event: MetaMetricsEventName.sendTokenModalOpened, + category: MetaMetricsEventCategory.Send, + properties: { + ...sendAnalytics, + is_destination_asset_picker_modal: Boolean(sendingAsset), + }, + }); + }} endIconName={IconName.ArrowDown} endIconProps={{ color: IconColor.iconDefault, diff --git a/ui/components/multichain/asset-picker-amount/max-clear-button.tsx b/ui/components/multichain/asset-picker-amount/max-clear-button.tsx index 5abefcf4c857..fc1034fbb827 100644 --- a/ui/components/multichain/asset-picker-amount/max-clear-button.tsx +++ b/ui/components/multichain/asset-picker-amount/max-clear-button.tsx @@ -2,6 +2,7 @@ import React, { useContext } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { Asset, + getSendAnalyticProperties, getSendMaxModeState, toggleSendMaxMode, } from '../../../ducks/send'; @@ -19,12 +20,14 @@ export default function MaxClearButton({ asset }: { asset: Asset }) { const maxModeOn = useSelector(getSendMaxModeState); const dispatch = useDispatch(); const trackEvent = useContext(MetaMetricsContext); + const sendAnalytics = useSelector(getSendAnalyticProperties); const onClick = () => { trackEvent({ event: 'Clicked "Amount Max"', category: MetaMetricsEventCategory.Transactions, properties: { + ...sendAnalytics, action: 'Edit Screen', legacy_event: true, }, diff --git a/ui/components/multichain/pages/send/__snapshots__/send.test.js.snap b/ui/components/multichain/pages/send/__snapshots__/send.test.js.snap index d20b3201493b..05839490b466 100644 --- a/ui/components/multichain/pages/send/__snapshots__/send.test.js.snap +++ b/ui/components/multichain/pages/send/__snapshots__/send.test.js.snap @@ -540,7 +540,7 @@ exports[`SendPage render and initialization should render correctly even when a
) : null} @@ -57,4 +59,5 @@ Setting.propTypes = { description: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), showToggle: PropTypes.bool, dataTestId: PropTypes.string, + disabled: PropTypes.bool, }; diff --git a/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap b/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap index 08552fa9d90c..5d0a1853360b 100644 --- a/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap +++ b/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap @@ -241,7 +241,7 @@ exports[`Security Tab should match snapshot 1`] = ` class="settings-page__content-item-col" >
+ ); + } + + renderDataCollectionForMarketing() { + const { t } = this.context; + const { + dataCollectionForMarketing, + participateInMetaMetrics, + setDataCollectionForMarketing, + setParticipateInMetaMetrics, + } = this.props; + + return ( + +
+ {t('dataCollectionForMarketing')} +
+ {t('dataCollectionForMarketingDescription')} +
+
+ +
+ { + setDataCollectionForMarketing(!value); + if (participateInMetaMetrics) { + this.context.trackEvent({ + category: MetaMetricsEventCategory.Settings, + event: MetaMetricsEventName.AnalyticsPreferenceSelected, + properties: { + is_metrics_opted_in: true, + has_marketing_consent: false, + location: 'Settings', + }, + }); + } else { + setParticipateInMetaMetrics(true); + } + }} offLabel={t('off')} onLabel={t('on')} /> @@ -1034,12 +1125,60 @@ export default class SecurityTab extends PureComponent { ); } + renderDataCollectionWarning = () => { + const { t } = this.context; + + return ( + this.setState({ showDataCollectionDisclaimer: false })} + title={ + + } + footer={ + + } + > + + {t('dataCollectionWarningPopoverDescription')} + + + ); + }; + render() { - const { warning, petnamesEnabled } = this.props; + const { + warning, + petnamesEnabled, + dataCollectionForMarketing, + setDataCollectionForMarketing, + } = this.props; + const { showDataCollectionDisclaimer } = this.state; return (
{this.renderUseExternalServices()} + {showDataCollectionDisclaimer + ? this.renderDataCollectionWarning() + : null} {warning &&
{warning}
} @@ -1118,6 +1257,7 @@ export default class SecurityTab extends PureComponent {
{this.renderMetaMetricsOptIn()} + {this.renderDataCollectionForMarketing()}
); diff --git a/ui/pages/settings/security-tab/security-tab.container.js b/ui/pages/settings/security-tab/security-tab.container.js index f411e1ceb1f2..98a2c7c9c3f5 100644 --- a/ui/pages/settings/security-tab/security-tab.container.js +++ b/ui/pages/settings/security-tab/security-tab.container.js @@ -6,6 +6,7 @@ import { setIpfsGateway, setIsIpfsGatewayEnabled, setParticipateInMetaMetrics, + setDataCollectionForMarketing, setUseCurrencyRateCheck, setUseMultiAccountBalanceChecker, setUsePhishDetect, @@ -43,6 +44,7 @@ const mapStateToProps = (state) => { const { incomingTransactionsPreferences, participateInMetaMetrics, + dataCollectionForMarketing, usePhishDetect, useTokenDetection, ipfsGateway, @@ -64,6 +66,7 @@ const mapStateToProps = (state) => { incomingTransactionsPreferences, allNetworks, participateInMetaMetrics, + dataCollectionForMarketing, usePhishDetect, useTokenDetection, ipfsGateway, @@ -90,6 +93,8 @@ const mapDispatchToProps = (dispatch) => { dispatch(setIncomingTransactionsPreferences(chainId, value)), setParticipateInMetaMetrics: (val) => dispatch(setParticipateInMetaMetrics(val)), + setDataCollectionForMarketing: (val) => + dispatch(setDataCollectionForMarketing(val)), setUsePhishDetect: (val) => dispatch(setUsePhishDetect(val)), setUseCurrencyRateCheck: (val) => dispatch(setUseCurrencyRateCheck(val)), setUseTokenDetection: (val) => dispatch(setUseTokenDetection(val)), diff --git a/ui/selectors/metametrics.js b/ui/selectors/metametrics.js index 377181a3e6a8..c623e378c003 100644 --- a/ui/selectors/metametrics.js +++ b/ui/selectors/metametrics.js @@ -2,6 +2,12 @@ import { createSelector } from 'reselect'; export const selectFragments = (state) => state.metamask.fragments; +export const getDataCollectionForMarketing = (state) => + state.metamask.dataCollectionForMarketing; + +export const getParticipateInMetaMetrics = (state) => + Boolean(state.metamask.participateInMetaMetrics); + export const selectFragmentBySuccessEvent = createSelector( selectFragments, (_, fragmentOptions) => fragmentOptions, diff --git a/ui/store/actionConstants.ts b/ui/store/actionConstants.ts index d89aa1d1bbb3..d1321d9b1bae 100644 --- a/ui/store/actionConstants.ts +++ b/ui/store/actionConstants.ts @@ -78,6 +78,8 @@ export const DEPRECATED_NETWORK_POPOVER_CLOSE = export const UPDATE_CUSTOM_NONCE = 'UPDATE_CUSTOM_NONCE'; export const SET_PARTICIPATE_IN_METAMETRICS = 'SET_PARTICIPATE_IN_METAMETRICS'; +export const SET_DATA_COLLECTION_FOR_MARKETING = + 'SET_DATA_COLLECTION_FOR_MARKETING'; // locale export const SET_CURRENT_LOCALE = 'SET_CURRENT_LOCALE'; diff --git a/ui/store/actions.ts b/ui/store/actions.ts index 08ad588b8b30..dc538e9c8a9a 100644 --- a/ui/store/actions.ts +++ b/ui/store/actions.ts @@ -3265,6 +3265,26 @@ export function setParticipateInMetaMetrics( }; } +export function setDataCollectionForMarketing( + dataCollectionPreference: boolean, +): ThunkAction< + Promise<[boolean, string]>, + MetaMaskReduxState, + unknown, + AnyAction +> { + return async (dispatch: MetaMaskReduxDispatch) => { + log.debug(`background.setDataCollectionForMarketing`); + await submitRequestToBackground('setDataCollectionForMarketing', [ + dataCollectionPreference, + ]); + dispatch({ + type: actionConstants.SET_DATA_COLLECTION_FOR_MARKETING, + value: dataCollectionPreference, + }); + }; +} + export function setUseBlockie( val: boolean, ): ThunkAction { From 3e8ce0700cb6c964a3e86bec7d57a5c89675a86b Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Mon, 17 Jun 2024 17:21:33 -0230 Subject: [PATCH 043/236] Fix lint errors on commit 5892d7cdc (#25367) Fixes lint errors and e2e failures on v11.16.12, which would have been introduced during conflict resolution when cherry-picking #24605 Specifically: - `test/e2e/default-fixture.js` is deleted as that file does not exist on master yet and is not used. However, importantly, the change made in `test/e2e/default-fixture.js` in #24605 is now applied to `test/e2e/fixture-builder.js` (this was needed for e2e tests to pass) - delete `ui/pages/settings/security-tab/metametrics-toggle/metametrics-toggle.tsx` and the associated test file, as these seem to be unused - delete unused variables in `ui/pages/settings/security-tab/security-tab.component.js` --- test/e2e/default-fixture.js | 265 ------------------ test/e2e/fixture-builder.js | 1 + .../metametrics-toggle.test.tsx | 88 ------ .../metametrics-toggle/metametrics-toggle.tsx | 130 --------- .../security-tab/security-tab.component.js | 15 +- 5 files changed, 8 insertions(+), 491 deletions(-) delete mode 100644 test/e2e/default-fixture.js delete mode 100644 ui/pages/settings/security-tab/metametrics-toggle/metametrics-toggle.test.tsx delete mode 100644 ui/pages/settings/security-tab/metametrics-toggle/metametrics-toggle.tsx diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js deleted file mode 100644 index 98413671caca..000000000000 --- a/test/e2e/default-fixture.js +++ /dev/null @@ -1,265 +0,0 @@ -const { NetworkStatus } = require('@metamask/network-controller'); -const { CHAIN_IDS } = require('../../shared/constants/network'); -const { FirstTimeFlowType } = require('../../shared/constants/onboarding'); - -const FIXTURE_STATE_METADATA_VERSION = 74; - -const E2E_SRP = - 'spread raise short crane omit tent fringe mandate neglect detail suspect cradle'; - -function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { - return { - data: { - AuthenticationController: { - isSignedIn: true, - }, - UserStorageController: { - isProfileSyncingEnabled: true, - }, - MetamaskNotificationsController: { - subscriptionAccountsSeen: [], - isFeatureAnnouncementsEnabled: false, - isMetamaskNotificationsEnabled: false, - isMetamaskNotificationsFeatureSeen: false, - metamaskNotificationsList: [], - metamaskNotificationsReadList: [], - }, - AccountsController: { - internalAccounts: { - selectedAccount: 'd5e45e4a-3b04-4a09-a5e1-39762e5c6be4', - accounts: { - 'd5e45e4a-3b04-4a09-a5e1-39762e5c6be4': { - id: 'd5e45e4a-3b04-4a09-a5e1-39762e5c6be4', - address: '0x5cfe73b6021e818b776b421b1c4db2474086a7e1', - metadata: { - name: 'Account 1', - lastSelected: 1665507600000, - keyring: { - type: 'HD Key Tree', - }, - }, - options: {}, - methods: [ - 'personal_sign', - 'eth_sign', - 'eth_signTransaction', - 'eth_signTypedData_v1', - 'eth_signTypedData_v3', - 'eth_signTypedData_v4', - ], - type: 'eip155:eoa', - }, - }, - }, - }, - AlertController: { - alertEnabledness: { - unconnectedAccount: true, - web3ShimUsage: true, - }, - unconnectedAccountAlertShownOrigins: {}, - web3ShimUsageOrigins: {}, - }, - AnnouncementController: { - announcements: { - 8: { - date: '2021-11-01', - id: 8, - isShown: false, - }, - }, - }, - NetworkOrderController: { - orderedNetworkList: [ - { - networkId: '0x1', - networkRpcUrl: - 'https://mainnet.infura.io/v3/00000000000000000000000000000000', - }, - { - networkId: '0xe708', - networkRpcUrl: - 'https://linea-mainnet.infura.io/v3/00000000000000000000000000000000', - }, - { - networkId: '0x539', - networkRpcUrl: 'http://localhost:8545', - }, - ], - }, - AccountOrderController: { - pinnedAccountList: [], - hiddenAccountList: [], - }, - AppStateController: { - browserEnvironment: {}, - nftsDropdownState: {}, - connectedStatusPopoverHasBeenShown: true, - termsOfUseLastAgreed: - '__FIXTURE_SUBSTITUTION__currentDateInMilliseconds', - defaultHomeActiveTabName: null, - fullScreenGasPollTokens: [], - notificationGasPollTokens: [], - popupGasPollTokens: [], - qrHardware: {}, - recoveryPhraseReminderHasBeenShown: true, - recoveryPhraseReminderLastShown: - '__FIXTURE_SUBSTITUTION__currentDateInMilliseconds', - showTestnetMessageInDropdown: true, - trezorModel: null, - usedNetworks: { - [CHAIN_IDS.MAINNET]: true, - [CHAIN_IDS.LINEA_MAINNET]: true, - [CHAIN_IDS.GOERLI]: true, - [CHAIN_IDS.LOCALHOST]: true, - }, - snapsInstallPrivacyWarningShown: true, - }, - CurrencyController: { - currentCurrency: 'usd', - currencyRates: { - ETH: { - conversionDate: 1665507600.0, - conversionRate: 1700.0, - usdConversionRate: 1700.0, - }, - }, - }, - GasFeeController: { - estimatedGasFeeTimeBounds: {}, - gasEstimateType: 'none', - gasFeeEstimates: {}, - }, - KeyringController: { - vault: - '{"data":"WHaP1FrrtV4zUonudIppDifsLHF39g6oPkVksAIdWAHBRzax1uy1asfAJprR7u72t4/HuYz5yPIFQrnNnv+hwQu9GRuty88VKMnvMy+sq8MNtoXI+C54bZpWa8r4iUQfa0Mj/cfJbpFpzOdF1ZYXahTfTcU5WsrHwvJew842CiJR4B2jmCHHXfm/DxLK3WazsVQwXJGx/U71UelGoOOrT8NI28EKrAwgPn+7Xmv0j92gmhau30N7Bo2fr6Zv","iv":"LfD8/tY1EjXzxuemSmDVdA==","keyMetadata":{"algorithm":"PBKDF2","params":{"iterations":600000}},"salt":"nk4xdpmMR+1s5BYe4Vnk++XAQwrISI2bCtbMg7V1wUA="}', - }, - MetaMetricsController: { - eventsBeforeMetricsOptIn: [], - fragments: {}, - metaMetricsId: null, - participateInMetaMetrics: false, - dataCollectionForMarketing: false, - traits: {}, - }, - NetworkController: { - selectedNetworkClientId: 'networkConfigurationId', - networksMetadata: { - networkConfigurationId: { - EIPS: {}, - status: NetworkStatus.Available, - }, - }, - providerConfig: { - chainId: inputChainId, - nickname: 'Localhost 8545', - rpcPrefs: {}, - rpcUrl: 'http://localhost:8545', - ticker: 'ETH', - type: 'rpc', - id: 'networkConfigurationId', - }, - networkConfigurations: { - networkConfigurationId: { - chainId: inputChainId, - nickname: 'Localhost 8545', - rpcPrefs: {}, - rpcUrl: 'http://localhost:8545', - ticker: 'ETH', - networkConfigurationId: 'networkConfigurationId', - }, - }, - }, - OnboardingController: { - completedOnboarding: true, - firstTimeFlowType: FirstTimeFlowType.import, - onboardingTabs: {}, - seedPhraseBackedUp: true, - }, - PermissionController: { - subjects: {}, - }, - PreferencesController: { - advancedGasFee: null, - currentLocale: 'en', - useExternalServices: true, - dismissSeedBackUpReminder: true, - featureFlags: {}, - forgottenPassword: false, - identities: { - '0x5cfe73b6021e818b776b421b1c4db2474086a7e1': { - address: '0x5cfe73b6021e818b776b421b1c4db2474086a7e1', - lastSelected: 1665507600000, - name: 'Account 1', - }, - }, - ipfsGateway: 'dweb.link', - knownMethodData: {}, - ledgerTransportType: 'webhid', - lostIdentities: {}, - openSeaEnabled: false, - preferences: { - hideZeroBalanceTokens: false, - showExtensionInFullSizeView: false, - showFiatInTestnets: false, - showTestNetworks: false, - smartTransactionsOptInStatus: false, - useNativeCurrencyAsPrimaryCurrency: true, - petnamesEnabled: true, - showTokenAutodetectModal: false, - }, - selectedAddress: '0x5cfe73b6021e818b776b421b1c4db2474086a7e1', - theme: 'light', - useBlockie: false, - useNftDetection: false, - useNonceField: false, - usePhishDetect: true, - useTokenDetection: false, - useCurrencyRateCheck: true, - useMultiAccountBalanceChecker: true, - useRequestQueue: true, - }, - SelectedNetworkController: { - domains: {}, - }, - SmartTransactionsController: { - smartTransactionsState: { - fees: {}, - liveness: true, - smartTransactions: { - [CHAIN_IDS.MAINNET]: [], - }, - }, - }, - SubjectMetadataController: { - subjectMetadata: { - 'https://metamask.github.io': { - extensionId: null, - iconUrl: null, - name: 'MetaMask < = > Ledger Bridge', - origin: 'https://metamask.github.io', - subjectType: 'website', - }, - }, - }, - TokensController: { - allDetectedTokens: {}, - allIgnoredTokens: {}, - allTokens: {}, - detectedTokens: [], - ignoredTokens: [], - tokens: [], - }, - TransactionController: { - transactions: {}, - }, - config: {}, - firstTimeInfo: { - date: 1665507600000, - version: '10.21.0', - }, - }, - }; -} - -module.exports = { defaultFixture, FIXTURE_STATE_METADATA_VERSION, E2E_SRP }; diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index 6cec07fa3e81..b57bb64211f6 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -114,6 +114,7 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { fragments: {}, metaMetricsId: null, participateInMetaMetrics: false, + dataCollectionForMarketing: false, traits: {}, }, NetworkController: { diff --git a/ui/pages/settings/security-tab/metametrics-toggle/metametrics-toggle.test.tsx b/ui/pages/settings/security-tab/metametrics-toggle/metametrics-toggle.test.tsx deleted file mode 100644 index 5e93bc9feaab..000000000000 --- a/ui/pages/settings/security-tab/metametrics-toggle/metametrics-toggle.test.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import React from 'react'; -import { Provider } from 'react-redux'; -import configureMockStore from 'redux-mock-store'; -import { render, fireEvent } from '@testing-library/react'; -import * as MetametricsHooks from '../../../../hooks/metamask-notifications/useMetametrics'; -import MetametricsToggle from './metametrics-toggle'; - -let mockUseSelectorReturnValue = false; - -jest.mock('react-redux', () => ({ - ...jest.requireActual('react-redux'), - useSelector: jest.fn(() => mockUseSelectorReturnValue), -})); - -const mockStore = configureMockStore(); -const initialState = { - metamask: { - isSignedIn: false, - }, -}; -const store = mockStore(initialState); - -describe('MetametricsToggle', () => { - const enableMetametricsMock = jest.fn(() => Promise.resolve()); - const disableMetametricsMock = jest.fn(() => Promise.resolve()); - - beforeEach(() => { - jest.spyOn(MetametricsHooks, 'useEnableMetametrics').mockReturnValue({ - enableMetametrics: enableMetametricsMock, - loading: false, - error: null, - }); - jest.spyOn(MetametricsHooks, 'useDisableMetametrics').mockReturnValue({ - disableMetametrics: disableMetametricsMock, - loading: false, - error: null, - }); - jest.spyOn(store, 'dispatch').mockImplementation(jest.fn()); - }); - - afterEach(() => { - jest.clearAllMocks(); - }); - - it('renders correctly', () => { - mockUseSelectorReturnValue = false; - const { getByTestId } = render( - - {}} - /> - , - ); - expect(getByTestId('profileSyncToggle')).toBeInTheDocument(); - }); - - it('calls enableMetametrics when toggle is turned on and profile syncing is disabled', () => { - mockUseSelectorReturnValue = false; - const { getByTestId } = render( - - {}} - /> - , - ); - fireEvent.click(getByTestId('toggleButton')); - expect(enableMetametricsMock).toHaveBeenCalled(); - }); - - it('calls disableMetametrics when toggle is turned off and profile syncing is enabled', () => { - mockUseSelectorReturnValue = true; - const { getByTestId } = render( - - {}} - /> - , - ); - fireEvent.click(getByTestId('toggleButton')); - expect(disableMetametricsMock).toHaveBeenCalled(); - }); -}); diff --git a/ui/pages/settings/security-tab/metametrics-toggle/metametrics-toggle.tsx b/ui/pages/settings/security-tab/metametrics-toggle/metametrics-toggle.tsx deleted file mode 100644 index 661dd7f974b4..000000000000 --- a/ui/pages/settings/security-tab/metametrics-toggle/metametrics-toggle.tsx +++ /dev/null @@ -1,130 +0,0 @@ -import React, { useContext } from 'react'; -import { useSelector } from 'react-redux'; -import { useI18nContext } from '../../../../hooks/useI18nContext'; -import { MetaMetricsContext } from '../../../../contexts/metametrics'; -import { - useEnableMetametrics, - useDisableMetametrics, -} from '../../../../hooks/metamask-notifications/useMetametrics'; -import { selectIsProfileSyncingEnabled } from '../../../../selectors/metamask-notifications/profile-syncing'; -import { selectParticipateInMetaMetrics } from '../../../../selectors/metamask-notifications/authentication'; -import { - MetaMetricsEventCategory, - MetaMetricsEventName, -} from '../../../../../shared/constants/metametrics'; -import { Box, Text } from '../../../../components/component-library'; -import ToggleButton from '../../../../components/ui/toggle-button'; -import { - Display, - FlexDirection, - JustifyContent, - TextColor, - TextVariant, -} from '../../../../helpers/constants/design-system'; - -const MetametricsToggle = ({ - dataCollectionForMarketing, - setDataCollectionForMarketing, -}: { - dataCollectionForMarketing: boolean; - setDataCollectionForMarketing: (value: boolean) => void; -}) => { - const t = useI18nContext(); - const trackEvent = useContext(MetaMetricsContext); - const { enableMetametrics, error: enableMetametricsError } = - useEnableMetametrics(); - const { disableMetametrics, error: disableMetametricsError } = - useDisableMetametrics(); - - const error = enableMetametricsError || disableMetametricsError; - - const isProfileSyncingEnabled = useSelector(selectIsProfileSyncingEnabled); - const participateInMetaMetrics = useSelector(selectParticipateInMetaMetrics); - - const handleUseParticipateInMetaMetrics = async () => { - if (participateInMetaMetrics) { - await disableMetametrics(); - trackEvent({ - category: MetaMetricsEventCategory.Settings, - event: MetaMetricsEventName.TurnOffMetaMetrics, - properties: { - isProfileSyncingEnabled, - participateInMetaMetrics, - }, - }); - - trackEvent({ - category: MetaMetricsEventCategory.Settings, - event: MetaMetricsEventName.AnalyticsPreferenceSelected, - properties: { - is_metrics_opted_in: false, - has_marketing_consent: false, - location: 'Settings', - }, - }); - } else { - await enableMetametrics(); - trackEvent({ - category: MetaMetricsEventCategory.Settings, - event: MetaMetricsEventName.TurnOnMetaMetrics, - properties: { - isProfileSyncingEnabled, - participateInMetaMetrics, - }, - }); - } - - if (dataCollectionForMarketing) { - setDataCollectionForMarketing(false); - } - }; - - return ( - - -
- {t('participateInMetaMetrics')} -
- {t('participateInMetaMetricsDescription')} -
-
- -
- -
-
- {error && ( - - - {t('notificationsSettingsBoxError')} - - - )} -
- ); -}; - -export default MetametricsToggle; diff --git a/ui/pages/settings/security-tab/security-tab.component.js b/ui/pages/settings/security-tab/security-tab.component.js index fd5b163ad6e5..5fe9c477ddeb 100644 --- a/ui/pages/settings/security-tab/security-tab.component.js +++ b/ui/pages/settings/security-tab/security-tab.component.js @@ -344,8 +344,12 @@ export default class SecurityTab extends PureComponent { renderMetaMetricsOptIn() { const { t } = this.context; - const { participateInMetaMetrics, setParticipateInMetaMetrics, dataCollectionForMarketing, setDataCollectionForMarketing } = - this.props; + const { + participateInMetaMetrics, + setParticipateInMetaMetrics, + dataCollectionForMarketing, + setDataCollectionForMarketing, + } = this.props; return ( Date: Tue, 18 Jun 2024 07:25:54 -0400 Subject: [PATCH 044/236] cherry-pick fix: re-add patch to nonce-tracker that was incorrectly removed (#25342) into v12.0.0 (#25353) cherry-pick fix: re-add patch to nonce-tracker that was incorrectly removed 8b764fa (#25342) into v12.0.0 Merge conflict in package.json: ```json "@expo/config/glob": "^10.3.10", "@expo/config-plugins/glob": "^10.3.10", <<<<<<< HEAD "@metamask/network-controller": "patch:@metamask/network-controller@npm%3A18.1.2#~/.yarn/patches/@metamask-network-controller-npm-18.1.2-1bcb8d8610.patch", "@solana/web3.js/rpc-websockets": "^8.0.1" ======= "@metamask/network-controller": "patch:@metamask/network-controller@npm%3A19.0.0#~/.yarn/patches/@metamask-network-controller-npm-19.0.0-a5e0d1fe14.patch", "@solana/web3.js/rpc-websockets": "^8.0.1", "@metamask/network-controller@npm:^19.0.0": "patch:@metamask/network-controller@npm%3A19.0.0#~/.yarn/patches/@metamask-network-controller-npm-19.0.0-a5e0d1fe14.patch", "@metamask/gas-fee-controller@npm:^15.1.1": "patch:@metamask/gas-fee-controller@npm%3A15.1.2#~/.yarn/patches/@metamask-gas-fee-controller-npm-15.1.2-db4d2976aa.patch", "@metamask/nonce-tracker@npm:^5.0.0": "patch:@metamask/nonce-tracker@npm%3A5.0.0#~/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch" >>>>>>> 8b764fa4b0 (fix: re-add patch to nonce-tracker that was incorrectly removed (#25342)) }, "dependencies": { "@babel/runtime": "patch:@babel/runtime@npm%3A7.24.0#~/.yarn/patches/@babel-runtime-npm-7.24.0-7eb1dd11a2.patch", ``` --- ...k-nonce-tracker-npm-5.0.0-d81478218e.patch | 30 +++++++++++++++++++ package.json | 3 +- yarn.lock | 14 ++++++++- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch diff --git a/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch b/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch new file mode 100644 index 000000000000..fb9a5c1ef5f6 --- /dev/null +++ b/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch @@ -0,0 +1,30 @@ +diff --git a/dist/NonceTracker.js b/dist/NonceTracker.js +index 7cfa1e1962c930a425b3dbf6e1520450f0bf1747..2f4ff77a678fe0501e96a92d16f63a8e5f299401 100644 +--- a/dist/NonceTracker.js ++++ b/dist/NonceTracker.js +@@ -12,7 +12,6 @@ class NonceTracker { + constructor(opts) { + this.provider = opts.provider; + this.blockTracker = opts.blockTracker; +- this.web3 = new Web3Provider(opts.provider); + this.getPendingTransactions = opts.getPendingTransactions; + this.getConfirmedTransactions = opts.getConfirmedTransactions; + this.lockMap = {}; +@@ -96,7 +95,7 @@ class NonceTracker { + // we need to make sure our base count + // and pending count are from the same block + const blockNumber = await this.blockTracker.getLatestBlock(); +- const baseCount = await this.web3.getTransactionCount(address, blockNumber); ++ const baseCount = await new Web3Provider(this.provider).getTransactionCount(address, blockNumber); + assert_1.default(Number.isInteger(baseCount), `nonce-tracker - baseCount is not an integer - got: (${typeof baseCount}) "${baseCount}"`); + return { + name: 'network', +diff --git a/dist/NonceTracker.js.map b/dist/NonceTracker.js.map +index 70e16afc468187dddb2ba1a6752e60c0aadb0f82..0e9d43aed1f7c5ccc2e16f91318aaab88da104ea 100644 +--- a/dist/NonceTracker.js.map ++++ b/dist/NonceTracker.js.map +@@ -1 +1 @@ +-{"version":3,"file":"NonceTracker.js","sourceRoot":"","sources":["../src/NonceTracker.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,6CAAoC;AAGpC,qGAAqG;AACrG,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAqF7D,MAAa,YAAY;IAavB,YAAY,IAAyB;QACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5C,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;QAC1D,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,wBAAwB,CAAC;QAC9D,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa;QACjB,MAAM,WAAW,GAAU,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACvD,0BAA0B;QAC1B,MAAM,WAAW,GAAiB,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;QAC9D,OAAO,EAAE,WAAW,EAAE,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,YAAY,CAAC,OAAe;QAChC,0BAA0B;QAC1B,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9B,kCAAkC;QAClC,MAAM,WAAW,GAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI;YACF,yCAAyC;YACzC,MAAM,kBAAkB,GACtB,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;YAC3C,MAAM,uBAAuB,GAC3B,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;YAC5C,MAAM,gBAAgB,GAAW,kBAAkB,CAAC,KAAK,CAAC;YAC1D,MAAM,gBAAgB,GAAW,IAAI,CAAC,GAAG,CACvC,gBAAgB,EAChB,uBAAuB,CACxB,CAAC;YAEF,MAAM,UAAU,GAAkB,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;YACvE,MAAM,gBAAgB,GACpB,IAAI,CAAC,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;YAE/D,MAAM,YAAY,GAAiB;gBACjC,MAAM,EAAE;oBACN,uBAAuB;oBACvB,gBAAgB;oBAChB,gBAAgB;iBACjB;gBACD,KAAK,EAAE,gBAAgB;gBACvB,OAAO,EAAE,kBAAkB;aAC5B,CAAC;YAEF,MAAM,SAAS,GAAW,IAAI,CAAC,GAAG,CAChC,kBAAkB,CAAC,KAAK,EACxB,gBAAgB,CAAC,KAAK,CACvB,CAAC;YACF,gBAAM,CACJ,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,EAC3B,uDAAuD,OAAO,SAAS,MAAM,SAAS,GAAG,CAC1F,CAAC;YAEF,8BAA8B;YAC9B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;SACjD;QAAC,OAAO,GAAG,EAAE;YACZ,wCAAwC;YACxC,WAAW,EAAE,CAAC;YACd,MAAM,GAAG,CAAC;SACX;IACH,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,WAAW,GAAU,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,WAAW,GAAiB,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;QAC9D,WAAW,EAAE,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc;QAC7B,MAAM,KAAK,GAAU,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,WAAW,GAAiB,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QACxD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,MAAc;QACzB,IAAI,KAAK,GAAU,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,EAAE;YACV,KAAK,GAAG,IAAI,mBAAK,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;SAC9B;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,oBAAoB,CAAC,OAAe;QACxC,uBAAuB;QACvB,sCAAsC;QACtC,4CAA4C;QAC5C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC;QAC7D,MAAM,SAAS,GAAW,MAAM,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAC3D,OAAO,EACP,WAAW,CACZ,CAAC;QACF,gBAAM,CACJ,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,EAC3B,uDAAuD,OAAO,SAAS,MAAM,SAAS,GAAG,CAC1F,CAAC;QACF,OAAO;YACL,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE;SACpC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,2BAA2B,CAAC,OAAe;QACzC,MAAM,qBAAqB,GACzB,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,OAAO,GAAW,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;QACrE,OAAO,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACH,gBAAgB,CAAC,MAAqB;QACpC,MAAM,MAAM,GAAa,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;YAClC,gBAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,8BAA8B,CAAC,CAAC;YAClE,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,MAAM,YAAY,GAAW,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1D,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;IACH,yBAAyB,CACvB,MAAqB,EACrB,UAAkB;QAElB,MAAM,MAAM,GAAa,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;YAClC,gBAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,8BAA8B,CAAC,CAAC;YAClE,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,GAAW,UAAU,CAAC;QACjC,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC/B,OAAO,IAAI,CAAC,CAAC;SACd;QAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;IAC7E,CAAC;CACF;AA3LD,oCA2LC"} +\ No newline at end of file ++{"version":3,"file":"NonceTracker.js","sourceRoot":"","sources":["../src/NonceTracker.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,6CAAoC;AAGpC,qGAAqG;AACrG,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAqF7D,MAAa,YAAY;IAavB,YAAY,IAAyB;QACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACtC,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;QAC1D,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,wBAAwB,CAAC;QAC9D,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa;QACjB,MAAM,WAAW,GAAU,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACvD,0BAA0B;QAC1B,MAAM,WAAW,GAAiB,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;QAC9D,OAAO,EAAE,WAAW,EAAE,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,YAAY,CAAC,OAAe;QAChC,0BAA0B;QAC1B,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9B,kCAAkC;QAClC,MAAM,WAAW,GAAiB,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI;YACF,yCAAyC;YACzC,MAAM,kBAAkB,GACtB,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;YAC3C,MAAM,uBAAuB,GAC3B,IAAI,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;YAC5C,MAAM,gBAAgB,GAAW,kBAAkB,CAAC,KAAK,CAAC;YAC1D,MAAM,gBAAgB,GAAW,IAAI,CAAC,GAAG,CACvC,gBAAgB,EAChB,uBAAuB,CACxB,CAAC;YAEF,MAAM,UAAU,GAAkB,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;YACvE,MAAM,gBAAgB,GACpB,IAAI,CAAC,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;YAE/D,MAAM,YAAY,GAAiB;gBACjC,MAAM,EAAE;oBACN,uBAAuB;oBACvB,gBAAgB;oBAChB,gBAAgB;iBACjB;gBACD,KAAK,EAAE,gBAAgB;gBACvB,OAAO,EAAE,kBAAkB;aAC5B,CAAC;YAEF,MAAM,SAAS,GAAW,IAAI,CAAC,GAAG,CAChC,kBAAkB,CAAC,KAAK,EACxB,gBAAgB,CAAC,KAAK,CACvB,CAAC;YACF,gBAAM,CACJ,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,EAC3B,uDAAuD,OAAO,SAAS,MAAM,SAAS,GAAG,CAC1F,CAAC;YAEF,8BAA8B;YAC9B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;SACjD;QAAC,OAAO,GAAG,EAAE;YACZ,wCAAwC;YACxC,WAAW,EAAE,CAAC;YACd,MAAM,GAAG,CAAC;SACX;IACH,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,MAAM,WAAW,GAAU,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACvD,MAAM,WAAW,GAAiB,MAAM,WAAW,CAAC,OAAO,EAAE,CAAC;QAC9D,WAAW,EAAE,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc;QAC7B,MAAM,KAAK,GAAU,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,WAAW,GAAiB,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QACxD,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,MAAc;QACzB,IAAI,KAAK,GAAU,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,EAAE;YACV,KAAK,GAAG,IAAI,mBAAK,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;SAC9B;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,oBAAoB,CAAC,OAAe;QACxC,uBAAuB;QACvB,sCAAsC;QACtC,4CAA4C;QAC5C,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC;QAC7D,MAAM,SAAS,GAAW,MAAM,IAAI,YAAY,CAC9C,IAAI,CAAC,QAAQ,CACd,CAAC,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC5C,gBAAM,CACJ,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,EAC3B,uDAAuD,OAAO,SAAS,MAAM,SAAS,GAAG,CAC1F,CAAC;QACF,OAAO;YACL,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE;SACpC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,2BAA2B,CAAC,OAAe;QACzC,MAAM,qBAAqB,GACzB,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,OAAO,GAAW,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;QACrE,OAAO,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACH,gBAAgB,CAAC,MAAqB;QACpC,MAAM,MAAM,GAAa,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;YAClC,gBAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,8BAA8B,CAAC,CAAC;YAClE,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,MAAM,YAAY,GAAW,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1D,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;IACH,yBAAyB,CACvB,MAAqB,EACrB,UAAkB;QAElB,MAAM,MAAM,GAAa,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;YAClC,gBAAM,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,8BAA8B,CAAC,CAAC;YAClE,OAAO,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,GAAW,UAAU,CAAC;QACjC,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;YAC/B,OAAO,IAAI,CAAC,CAAC;SACd;QAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;IAC7E,CAAC;CACF;AAzLD,oCAyLC"} +\ No newline at end of file diff --git a/package.json b/package.json index e5d4671a35af..699dc1b55523 100644 --- a/package.json +++ b/package.json @@ -253,7 +253,8 @@ "@expo/config/glob": "^10.3.10", "@expo/config-plugins/glob": "^10.3.10", "@metamask/network-controller": "patch:@metamask/network-controller@npm%3A18.1.2#~/.yarn/patches/@metamask-network-controller-npm-18.1.2-1bcb8d8610.patch", - "@solana/web3.js/rpc-websockets": "^8.0.1" + "@solana/web3.js/rpc-websockets": "^8.0.1", + "@metamask/nonce-tracker@npm:^5.0.0": "patch:@metamask/nonce-tracker@npm%3A5.0.0#~/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch" }, "dependencies": { "@babel/runtime": "patch:@babel/runtime@npm%3A7.24.0#~/.yarn/patches/@babel-runtime-npm-7.24.0-7eb1dd11a2.patch", diff --git a/yarn.lock b/yarn.lock index 9c1e7619adc2..31d04b8c651b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5730,7 +5730,7 @@ __metadata: languageName: node linkType: hard -"@metamask/nonce-tracker@npm:^5.0.0": +"@metamask/nonce-tracker@npm:5.0.0": version: 5.0.0 resolution: "@metamask/nonce-tracker@npm:5.0.0" dependencies: @@ -5742,6 +5742,18 @@ __metadata: languageName: node linkType: hard +"@metamask/nonce-tracker@patch:@metamask/nonce-tracker@npm%3A5.0.0#~/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch": + version: 5.0.0 + resolution: "@metamask/nonce-tracker@patch:@metamask/nonce-tracker@npm%3A5.0.0#~/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch::version=5.0.0&hash=b362e2" + dependencies: + "@ethersproject/providers": "npm:^5.7.2" + async-mutex: "npm:^0.3.1" + peerDependencies: + "@metamask/eth-block-tracker": ">=9" + checksum: 10/89c3e5219edc104ecc5f7bfb81f818a0800f946c9dd11d54ac79558e4abdbc895032dc2d7fed400a2d46b03ee6370dc393d62ec15b6cc0f2d3b45bcba6240fe0 + languageName: node + linkType: hard + "@metamask/notification-controller@npm:^3.0.0": version: 3.0.0 resolution: "@metamask/notification-controller@npm:3.0.0" From 19c3eb4ce964bb2b97b167b9af25dd7786e80dd0 Mon Sep 17 00:00:00 2001 From: Prithpal Sooriya Date: Tue, 18 Jun 2024 12:26:23 +0100 Subject: [PATCH 045/236] v12.0.0 fix: failing push notifications (#25379) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This fixes push notifications so that they are not silent push notifications. Some of our notifications we send through push, have a different data shape. And since the shape was different (missing polyfilled fields) it was not parsable and hence would only show the default notification message PR: https://github.com/MetaMask/metamask-extension/pull/25340 Commit Hash: [68d35f0dc2d9edc2a67849f4f932fb2a189af33a](https://github.com/MetaMask/metamask-extension/commit/68d35f0dc2d9edc2a67849f4f932fb2a189af33a) **There were no merge conflicts when picking these commits.** [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25340?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Create a wallet notification 2. See push notification received ## **Screenshots/Recordings** ### **Before** ![image](https://github.com/MetaMask/metamask-extension/assets/17534261/672702a9-b8d1-40ba-970e-adca7fbfedfc) ### **After** ![Screenshot 2024-06-14 at 21 04 55](https://github.com/MetaMask/metamask-extension/assets/17534261/3fcf8792-04c2-4825-89dc-389006f0e4f9) ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- .../services/services.ts | 15 +++++++++------ .../utils/get-notification-image.ts | 6 ++++++ .../utils/get-notification-message.ts | 5 ++++- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 app/scripts/controllers/push-platform-notifications/utils/get-notification-image.ts diff --git a/app/scripts/controllers/push-platform-notifications/services/services.ts b/app/scripts/controllers/push-platform-notifications/services/services.ts index da15be11c8d8..392cd22ad051 100644 --- a/app/scripts/controllers/push-platform-notifications/services/services.ts +++ b/app/scripts/controllers/push-platform-notifications/services/services.ts @@ -195,18 +195,21 @@ export async function listenToPushNotifications( const unsubscribePushNotifications = onBackgroundMessage( messaging, async (payload: MessagePayload): Promise => { - const typedPayload = payload; - - // if the payload does not contain data, do nothing try { - const notificationData: NotificationUnion = typedPayload?.data?.data - ? JSON.parse(typedPayload?.data?.data) + const data = payload?.data?.data + ? JSON.parse(payload?.data?.data) : undefined; - if (!notificationData) { + // if the payload does not contain data, do nothing + if (!data) { return; } + const notificationData = { + ...data, + type: data?.type ?? data?.data?.kind, + } as NotificationUnion; + const notification = processNotification(notificationData); onNewNotification(notification); diff --git a/app/scripts/controllers/push-platform-notifications/utils/get-notification-image.ts b/app/scripts/controllers/push-platform-notifications/utils/get-notification-image.ts new file mode 100644 index 000000000000..3dbaf951b3d0 --- /dev/null +++ b/app/scripts/controllers/push-platform-notifications/utils/get-notification-image.ts @@ -0,0 +1,6 @@ +import browser from 'webextension-polyfill'; + +export async function getNotificationImage() { + const iconUrl = await browser.runtime.getURL('../../images/icon-64.png'); + return iconUrl; +} diff --git a/app/scripts/controllers/push-platform-notifications/utils/get-notification-message.ts b/app/scripts/controllers/push-platform-notifications/utils/get-notification-message.ts index e979e9cc5b53..514c5b40fadc 100644 --- a/app/scripts/controllers/push-platform-notifications/utils/get-notification-message.ts +++ b/app/scripts/controllers/push-platform-notifications/utils/get-notification-message.ts @@ -9,6 +9,7 @@ import { t } from '../../../translate'; import type { Notification } from '../../metamask-notifications/types/types'; import ExtensionPlatform from '../../../platforms/extension'; import { getAmount, formatAmount } from './get-notification-data'; +import { getNotificationImage } from './get-notification-image'; type PushNotificationMessage = { title: string; @@ -47,9 +48,11 @@ export async function onPushNotification( return; } + const iconUrl = await getNotificationImage(); + await registration.showNotification(notificationMessage.title, { body: notificationMessage.description, - icon: './images/icon-64.png', + icon: iconUrl, tag: notification?.id, data: notification, }); From 755ecedf27e2a796d169ba2d906fafc2025cde77 Mon Sep 17 00:00:00 2001 From: Matteo Scurati Date: Tue, 18 Jun 2024 15:11:15 +0200 Subject: [PATCH 046/236] v12.0.0 fix: logic for using notifications tabs (#25382) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This PR introduces two small fixes: - If there are no snaps with notifications, the tabs for filtering results are not displayed on the notifications page. - Feature announcements are included in the onChain tab and not in the Web3 tab. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25350?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. ## **Description** [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25382?quickstart=1) ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** ### **Before** ### **After** ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --- ui/pages/notifications/notifications.test.tsx | 2 + ui/pages/notifications/notifications.tsx | 95 ++++++++++--------- 2 files changed, 51 insertions(+), 46 deletions(-) diff --git a/ui/pages/notifications/notifications.test.tsx b/ui/pages/notifications/notifications.test.tsx index 61f793775f34..fc7675a85dea 100644 --- a/ui/pages/notifications/notifications.test.tsx +++ b/ui/pages/notifications/notifications.test.tsx @@ -4,6 +4,7 @@ import { Provider } from 'react-redux'; import { MemoryRouter } from 'react-router-dom'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; +import mockState from '../../../test/data/mock-state.json'; import Notifications from './notifications'; const mockDispatch = jest.fn(); @@ -32,6 +33,7 @@ jest.mock('../../store/actions', () => ({ const initialState = { metamask: { + ...mockState.metamask, theme: 'light', isMetamaskNotificationsEnabled: true, isFeatureAnnouncementsEnabled: true, diff --git a/ui/pages/notifications/notifications.tsx b/ui/pages/notifications/notifications.tsx index 138011fe5124..5b5d89e6645a 100644 --- a/ui/pages/notifications/notifications.tsx +++ b/ui/pages/notifications/notifications.tsx @@ -16,7 +16,7 @@ import { import { NotificationsPage } from '../../components/multichain'; import { Content, Header } from '../../components/multichain/pages/page'; import { useMetamaskNotificationsContext } from '../../contexts/metamask-notifications/metamask-notifications'; -import { getNotifications } from '../../selectors'; +import { getNotifications, getNotifySnaps } from '../../selectors'; import { selectIsFeatureAnnouncementsEnabled, selectIsMetamaskNotificationsEnabled, @@ -142,17 +142,15 @@ const filterNotifications = ( } if (activeTab === TAB_KEYS.WALLET) { - return notifications.filter((notification) => - TRIGGER_TYPES_WALLET_SET.has(notification.type), + return notifications.filter( + (notification) => + TRIGGER_TYPES_WALLET_SET.has(notification.type) || + notification.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT, ); } if (activeTab === TAB_KEYS.WEB3) { - return notifications.filter( - (notification) => - notification.type === TRIGGER_TYPES.FEATURES_ANNOUNCEMENT || - notification.type === 'SNAP', - ); + return notifications.filter((notification) => notification.type === 'SNAP'); } return notifications; @@ -172,6 +170,9 @@ export default function Notifications() { [activeTab, combinedNotifications], ); + let hasNotifySnaps = false; + hasNotifySnaps = useSelector(getNotifySnaps).length > 0; + return ( {/* Back and Settings Buttons */} @@ -202,44 +203,46 @@ export default function Notifications() { > {t('notifications')} - - setActiveTab(tab)} - tabsClassName="notifications__tabs" - > - - - {t('wallet')} - - - } - tabKey={TAB_KEYS.WALLET} - > - - + + {hasNotifySnaps && ( + setActiveTab(tab)} + tabsClassName="notifications__tabs" + > + + + {t('wallet')} + + + } + tabKey={TAB_KEYS.WALLET} + > + + + )} Date: Fri, 14 Jun 2024 23:41:16 -0600 Subject: [PATCH 047/236] fix: swap+send bugs in Version v12.0.0 release (#25307) --- test/data/transaction-data.json | 1388 +++++++++++++++++ .../tests/swap-send/swap-send-erc20.spec.ts | 3 +- .../e2e/tests/swap-send/swap-send-eth.spec.ts | 6 +- .../tests/swap-send/swap-send-test-utils.ts | 12 +- .../multichain/asset-picker-amount/index.scss | 12 +- .../send/components/recipient-content.tsx | 7 +- .../ui/unit-input/unit-input.component.js | 1 + ui/hooks/useSwappedTokenValue.js | 33 +- ui/hooks/useTransactionDisplayData.js | 3 +- ui/hooks/useTransactionDisplayData.test.js | 30 +- 10 files changed, 1470 insertions(+), 25 deletions(-) diff --git a/test/data/transaction-data.json b/test/data/transaction-data.json index bdcbd7cd6abf..ad2dacfe082c 100644 --- a/test/data/transaction-data.json +++ b/test/data/transaction-data.json @@ -1252,5 +1252,1393 @@ }, "hasRetried": false, "hasCancelled": false + }, + { + "nonce": "0x9", + "transactions": [ + { + "actionId": 1718133500046.724, + "approvalTxId": "5ce4f880-2827-11ef-9c65-d1738f73c46f", + "baseFeePerGas": "0x0", + "blockTimestamp": "0x6668a2fd", + "chainId": "0x38", + "defaultGasEstimates": { + "estimateType": "medium", + "gas": "0x51fc6", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "destinationTokenAddress": "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + "destinationTokenAmount": "4990565483715933000", + "destinationTokenDecimals": 18, + "destinationTokenSymbol": "DAI", + "hash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "history": [], + "id": "5cf9b900-2827-11ef-9c65-d1738f73c46f", + "networkClientId": "899c28d9-9f01-43c6-be76-b5e9f3cfe8bc", + "origin": "metamask", + "r": "0x443ec5a1269c18767b078894d177b4067831ea9ddcb33ebf92670d6667940985", + "rawTx": "0x02f903f1380984b2d05e0084b2d05e0083051fc6943cb693656622fc470f0bb07d3f5813f7889bf82e80b90384048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c188380000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b82680400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000148c43c9ef600000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b826804000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000030000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d560000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb0000000000000000000000000000000000000000aca7f7533c2098f78f35db24000000000000000000000000000000000000000000000000c001a0443ec5a1269c18767b078894d177b4067831ea9ddcb33ebf92670d6667940985a0519c27715e9ce0cab31e7738ffad7d454088c3e3c855f54b8a0965a17d999c62", + "s": "0x519c27715e9ce0cab31e7738ffad7d454088c3e3c855f54b8a0965a17d999c62", + "sendFlowHistory": [], + "sourceTokenAddress": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "sourceTokenAmount": "5000000000000000000", + "sourceTokenDecimals": 18, + "sourceTokenSymbol": "USDC", + "status": "confirmed", + "submittedTime": 1718133500335, + "swapAndSendRecipient": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "swapTokenValue": "5", + "time": 1718133500048, + "txParams": { + "data": "0x048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c188380000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b82680400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000148c43c9ef600000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b826804000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000030000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d560000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb0000000000000000000000000000000000000000aca7f7533c2098f78f35db24000000000000000000000000000000000000000000000000", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gas": "0x51fc6", + "gasLimit": "0x51fc6", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00", + "nonce": "0x9", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "type": "0x2", + "value": "0x0" + }, + "txReceipt": { + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "contractAddress": null, + "cumulativeGasUsed": "0x30fb3e", + "effectiveGasPrice": "0xb2d05e00", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gasUsed": "0x401d6", + "logs": [ + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f40000", + "logIndex": "0x45", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x46", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838", + "0x0000000000000000000000003cb693656622fc470f0bb07d3f5813f7889bf82e" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f40000", + "logIndex": "0x47", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f40000", + "logIndex": "0x48", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x0000000000000000000000002354ef4df11afacb85a5c7f98b624072eccddbb1" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x49", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0xe9e7cea3dedca5984780bafc599bd69add087d56", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x00000000000000000000000000000000000000000000000045351670c8c8eb16", + "logIndex": "0x4a", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000002354ef4df11afacb85a5c7f98b624072eccddbb1", + "0x00000000000000000000000066fdb2eccfb58cf098eaa419e5efde841368e489" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x2354ef4df11afacb85a5c7f98b624072eccddbb1", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000005cf210c436771e7d4016000000000000000000000000000000000000000000005cfaf19326e57b4c5707", + "logIndex": "0x4b", + "removed": false, + "topics": [ + "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x2354ef4df11afacb85a5c7f98b624072eccddbb1", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045351670c8c8eb16", + "logIndex": "0x4c", + "removed": false, + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x00000000000000000000000066fdb2eccfb58cf098eaa419e5efde841368e489" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000453047e918796cfd", + "logIndex": "0x4d", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000066fdb2eccfb58cf098eaa419e5efde841368e489", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x66fdb2eccfb58cf098eaa419e5efde841368e489", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000020c638a3898eb7869dcf0000000000000000000000000000000000000000000020af974dbd9430b354c8", + "logIndex": "0x4e", + "removed": false, + "topics": [ + "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x66fdb2eccfb58cf098eaa419e5efde841368e489", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045351670c8c8eb16000000000000000000000000000000000000000000000000453047e918796cfd0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x4f", + "removed": false, + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x50", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000453047e918796cfd", + "logIndex": "0x51", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000045357415000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x52", + "removed": false, + "topics": [ + "0x0c18aae526accb31b01cf9a15bdf435e70632ee31efc4c5c0752c4262ea45d2f" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + } + ], + "logsBloom": "0x006000000040001000000000800004000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000002000c0000000010000012000040008000000240000000000000088000000000000000008000000000000000000000004000040000000000000002008000010000000020000000000000001000000000040008000000000000800084000004000000100020000000000000000004000000000000000000000000000004000000000000000000002000000020000000000001000000040100000001000000020000000000010000000004002000000100000000000800000008000000000000001000000", + "status": "0x1", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21", + "type": "0x2" + }, + "type": "swapAndSend", + "userEditedGasLimit": false, + "userFeeLevel": "medium", + "v": "0x1", + "verifiedOnBlockchain": true + } + ], + "initialTransaction": { + "actionId": 1718133500046.724, + "approvalTxId": "5ce4f880-2827-11ef-9c65-d1738f73c46f", + "baseFeePerGas": "0x0", + "blockTimestamp": "0x6668a2fd", + "chainId": "0x38", + "defaultGasEstimates": { + "estimateType": "medium", + "gas": "0x51fc6", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "destinationTokenAddress": "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + "destinationTokenAmount": "4990565483715933000", + "destinationTokenDecimals": 18, + "destinationTokenSymbol": "DAI", + "hash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "history": [], + "id": "5cf9b900-2827-11ef-9c65-d1738f73c46f", + "networkClientId": "899c28d9-9f01-43c6-be76-b5e9f3cfe8bc", + "origin": "metamask", + "r": "0x443ec5a1269c18767b078894d177b4067831ea9ddcb33ebf92670d6667940985", + "rawTx": "0x02f903f1380984b2d05e0084b2d05e0083051fc6943cb693656622fc470f0bb07d3f5813f7889bf82e80b90384048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c188380000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b82680400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000148c43c9ef600000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b826804000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000030000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d560000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb0000000000000000000000000000000000000000aca7f7533c2098f78f35db24000000000000000000000000000000000000000000000000c001a0443ec5a1269c18767b078894d177b4067831ea9ddcb33ebf92670d6667940985a0519c27715e9ce0cab31e7738ffad7d454088c3e3c855f54b8a0965a17d999c62", + "s": "0x519c27715e9ce0cab31e7738ffad7d454088c3e3c855f54b8a0965a17d999c62", + "sendFlowHistory": [], + "sourceTokenAddress": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "sourceTokenAmount": "5000000000000000000", + "sourceTokenDecimals": 18, + "sourceTokenSymbol": "USDC", + "status": "confirmed", + "submittedTime": 1718133500335, + "swapAndSendRecipient": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "swapTokenValue": "5", + "time": 1718133500048, + "txParams": { + "data": "0x048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c188380000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b82680400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000148c43c9ef600000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b826804000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000030000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d560000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb0000000000000000000000000000000000000000aca7f7533c2098f78f35db24000000000000000000000000000000000000000000000000", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gas": "0x51fc6", + "gasLimit": "0x51fc6", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00", + "nonce": "0x9", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "type": "0x2", + "value": "0x0" + }, + "txReceipt": { + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "contractAddress": null, + "cumulativeGasUsed": "0x30fb3e", + "effectiveGasPrice": "0xb2d05e00", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gasUsed": "0x401d6", + "logs": [ + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f40000", + "logIndex": "0x45", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x46", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838", + "0x0000000000000000000000003cb693656622fc470f0bb07d3f5813f7889bf82e" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f40000", + "logIndex": "0x47", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f40000", + "logIndex": "0x48", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x0000000000000000000000002354ef4df11afacb85a5c7f98b624072eccddbb1" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x49", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0xe9e7cea3dedca5984780bafc599bd69add087d56", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x00000000000000000000000000000000000000000000000045351670c8c8eb16", + "logIndex": "0x4a", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000002354ef4df11afacb85a5c7f98b624072eccddbb1", + "0x00000000000000000000000066fdb2eccfb58cf098eaa419e5efde841368e489" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x2354ef4df11afacb85a5c7f98b624072eccddbb1", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000005cf210c436771e7d4016000000000000000000000000000000000000000000005cfaf19326e57b4c5707", + "logIndex": "0x4b", + "removed": false, + "topics": [ + "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x2354ef4df11afacb85a5c7f98b624072eccddbb1", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045351670c8c8eb16", + "logIndex": "0x4c", + "removed": false, + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x00000000000000000000000066fdb2eccfb58cf098eaa419e5efde841368e489" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000453047e918796cfd", + "logIndex": "0x4d", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000066fdb2eccfb58cf098eaa419e5efde841368e489", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x66fdb2eccfb58cf098eaa419e5efde841368e489", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000020c638a3898eb7869dcf0000000000000000000000000000000000000000000020af974dbd9430b354c8", + "logIndex": "0x4e", + "removed": false, + "topics": [ + "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x66fdb2eccfb58cf098eaa419e5efde841368e489", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045351670c8c8eb16000000000000000000000000000000000000000000000000453047e918796cfd0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x4f", + "removed": false, + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x50", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000453047e918796cfd", + "logIndex": "0x51", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000045357415000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x52", + "removed": false, + "topics": [ + "0x0c18aae526accb31b01cf9a15bdf435e70632ee31efc4c5c0752c4262ea45d2f" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + } + ], + "logsBloom": "0x006000000040001000000000800004000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000002000c0000000010000012000040008000000240000000000000088000000000000000008000000000000000000000004000040000000000000002008000010000000020000000000000001000000000040008000000000000800084000004000000100020000000000000000004000000000000000000000000000004000000000000000000002000000020000000000001000000040100000001000000020000000000010000000004002000000100000000000800000008000000000000001000000", + "status": "0x1", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21", + "type": "0x2" + }, + "type": "swapAndSend", + "userEditedGasLimit": false, + "userFeeLevel": "medium", + "v": "0x1", + "verifiedOnBlockchain": true + }, + "primaryTransaction": { + "actionId": 1718133500046.724, + "approvalTxId": "5ce4f880-2827-11ef-9c65-d1738f73c46f", + "baseFeePerGas": "0x0", + "blockTimestamp": "0x6668a2fd", + "chainId": "0x38", + "defaultGasEstimates": { + "estimateType": "medium", + "gas": "0x51fc6", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "destinationTokenAddress": "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + "destinationTokenAmount": "4990565483715933000", + "destinationTokenDecimals": 18, + "destinationTokenSymbol": "DAI", + "hash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "history": [], + "id": "5cf9b900-2827-11ef-9c65-d1738f73c46f", + "networkClientId": "899c28d9-9f01-43c6-be76-b5e9f3cfe8bc", + "origin": "metamask", + "r": "0x443ec5a1269c18767b078894d177b4067831ea9ddcb33ebf92670d6667940985", + "rawTx": "0x02f903f1380984b2d05e0084b2d05e0083051fc6943cb693656622fc470f0bb07d3f5813f7889bf82e80b90384048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c188380000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b82680400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000148c43c9ef600000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b826804000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000030000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d560000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb0000000000000000000000000000000000000000aca7f7533c2098f78f35db24000000000000000000000000000000000000000000000000c001a0443ec5a1269c18767b078894d177b4067831ea9ddcb33ebf92670d6667940985a0519c27715e9ce0cab31e7738ffad7d454088c3e3c855f54b8a0965a17d999c62", + "s": "0x519c27715e9ce0cab31e7738ffad7d454088c3e3c855f54b8a0965a17d999c62", + "sendFlowHistory": [], + "sourceTokenAddress": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "sourceTokenAmount": "5000000000000000000", + "sourceTokenDecimals": 18, + "sourceTokenSymbol": "USDC", + "status": "confirmed", + "submittedTime": 1718133500335, + "swapAndSendRecipient": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "swapTokenValue": "5", + "time": 1718133500048, + "txParams": { + "data": "0x048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000000000000000002c0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c188380000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d0000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc30000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b82680400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000148c43c9ef600000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000004563918244f4000000000000000000000000000000000000000000000000000043df73024b826804000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000030000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d560000000000000000000000001af3f329e8be154074d8769d1ffa4ee058b1dbc3869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb0000000000000000000000000000000000000000aca7f7533c2098f78f35db24000000000000000000000000000000000000000000000000", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gas": "0x51fc6", + "gasLimit": "0x51fc6", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00", + "nonce": "0x9", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "type": "0x2", + "value": "0x0" + }, + "txReceipt": { + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "contractAddress": null, + "cumulativeGasUsed": "0x30fb3e", + "effectiveGasPrice": "0xb2d05e00", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gasUsed": "0x401d6", + "logs": [ + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f40000", + "logIndex": "0x45", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x46", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838", + "0x0000000000000000000000003cb693656622fc470f0bb07d3f5813f7889bf82e" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f40000", + "logIndex": "0x47", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f40000", + "logIndex": "0x48", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x0000000000000000000000002354ef4df11afacb85a5c7f98b624072eccddbb1" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x49", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0xe9e7cea3dedca5984780bafc599bd69add087d56", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x00000000000000000000000000000000000000000000000045351670c8c8eb16", + "logIndex": "0x4a", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000002354ef4df11afacb85a5c7f98b624072eccddbb1", + "0x00000000000000000000000066fdb2eccfb58cf098eaa419e5efde841368e489" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x2354ef4df11afacb85a5c7f98b624072eccddbb1", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000005cf210c436771e7d4016000000000000000000000000000000000000000000005cfaf19326e57b4c5707", + "logIndex": "0x4b", + "removed": false, + "topics": [ + "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x2354ef4df11afacb85a5c7f98b624072eccddbb1", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000004563918244f400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045351670c8c8eb16", + "logIndex": "0x4c", + "removed": false, + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x00000000000000000000000066fdb2eccfb58cf098eaa419e5efde841368e489" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000453047e918796cfd", + "logIndex": "0x4d", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x00000000000000000000000066fdb2eccfb58cf098eaa419e5efde841368e489", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x66fdb2eccfb58cf098eaa419e5efde841368e489", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000020c638a3898eb7869dcf0000000000000000000000000000000000000000000020af974dbd9430b354c8", + "logIndex": "0x4e", + "removed": false, + "topics": [ + "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x66fdb2eccfb58cf098eaa419e5efde841368e489", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045351670c8c8eb16000000000000000000000000000000000000000000000000453047e918796cfd0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x4f", + "removed": false, + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x50", + "removed": false, + "topics": [ + "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000453047e918796cfd", + "logIndex": "0x51", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + }, + { + "address": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "blockHash": "0x2ad0174dc123330852694ddeaa1924450b6bba340485f18abe3a6681bc8896f7", + "blockNumber": "0x25b2338", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000045357415000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x52", + "removed": false, + "topics": [ + "0x0c18aae526accb31b01cf9a15bdf435e70632ee31efc4c5c0752c4262ea45d2f" + ], + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21" + } + ], + "logsBloom": "0x006000000040001000000000800004000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000002000c0000000010000012000040008000000240000000000000088000000000000000008000000000000000000000004000040000000000000002008000010000000020000000000000001000000000040008000000000000800084000004000000100020000000000000000004000000000000000000000000000004000000000000000000002000000020000000000001000000040100000001000000020000000000010000000004002000000100000000000800000008000000000000001000000", + "status": "0x1", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "transactionHash": "0x5be1ae5ae27c4e2a5542228b4f7967a660881dcbc71521a978ea6d9c3b3971fe", + "transactionIndex": "0x21", + "type": "0x2" + }, + "type": "swapAndSend", + "userEditedGasLimit": false, + "userFeeLevel": "medium", + "v": "0x1", + "verifiedOnBlockchain": true + }, + "hasRetried": false, + "hasCancelled": false + }, + { + "nonce": "0x0", + "transactions": [ + { + "actionId": 1717789986313.557, + "baseFeePerGas": "0x0", + "blockTimestamp": "0x66636524", + "chainId": "0x38", + "defaultGasEstimates": { + "estimateType": "medium", + "gas": "0x397cf", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "destinationTokenAddress": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "destinationTokenAmount": "33721280446418538542", + "destinationTokenDecimals": 18, + "destinationTokenSymbol": "USDC", + "firstRetryBlockNumber": "0x259650b", + "gasFeeEstimates": { + "high": { + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "low": { + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "medium": { + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "type": "fee-market" + }, + "gasFeeEstimatesLoaded": true, + "hash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "history": [], + "id": "8ed642e0-2507-11ef-99c4-53f3fc2768a2", + "networkClientId": "899c28d9-9f01-43c6-be76-b5e9f3cfe8bc", + "origin": "metamask", + "r": "0x7fbbe0d92a8da53a9bc98ef8144c6677ecb08050ea180548d93b7830cb407a2a", + "rawTx": "0x02f903d8388084b2d05e0084b2d05e00830397cf943cb693656622fc470f0bb07d3f5813f7889bf82e87b1a2bc2ec50000b90364048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c1883800000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d00000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000018de76816d80000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000128c43c9ef6000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb000000000000000000000000000000003736a41146b8f4bb97dbe80a5771808c000000000000000000000000000000000000000000000000c001a07fbbe0d92a8da53a9bc98ef8144c6677ecb08050ea180548d93b7830cb407a2aa04d050489b179ec7832166566d3769408ef6c407d0032243cdabeb99bab87d634", + "s": "0x4d050489b179ec7832166566d3769408ef6c407d0032243cdabeb99bab87d634", + "sendFlowHistory": [], + "sourceTokenAddress": "0x0000000000000000000000000000000000000000", + "sourceTokenAmount": "50000000000000000", + "sourceTokenDecimals": 18, + "sourceTokenSymbol": "BNB", + "status": "confirmed", + "submittedTime": 1717789986704, + "swapAndSendRecipient": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "swapTokenValue": "0.05", + "time": 1717789986319, + "txParams": { + "data": "0x048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c1883800000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d00000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000018de76816d80000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000128c43c9ef6000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb000000000000000000000000000000003736a41146b8f4bb97dbe80a5771808c000000000000000000000000000000000000000000000000", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gas": "0x397cf", + "gasLimit": "0x397cf", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00", + "nonce": "0x0", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "type": "0x2", + "value": "0xb1a2bc2ec50000" + }, + "txReceipt": { + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "contractAddress": null, + "cumulativeGasUsed": "0x2644bd", + "effectiveGasPrice": "0xb2d05e00", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gasUsed": "0x31a28", + "logs": [ + { + "address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x00000000000000000000000000000000000000000000000000b014d4c6ae2800", + "logIndex": "0x38", + "removed": false, + "topics": [ + "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x00000000000000000000000000000000000000000000000000b014d4c6ae2800", + "logIndex": "0x39", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x000000000000000000000000d99c7f6c65857ac913a8f880a4cb84032ab2fc5b" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000001d3be028ce893dfbe", + "logIndex": "0x3a", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000d99c7f6c65857ac913a8f880a4cb84032ab2fc5b", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0xd99c7f6c65857ac913a8f880a4cb84032ab2fc5b", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000003ef046f04c7cafc1e5e20000000000000000000000000000000000000000000000179ff39de2fc5b390a", + "logIndex": "0x3b", + "removed": false, + "topics": [ + "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0xd99c7f6c65857ac913a8f880a4cb84032ab2fc5b", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001d3be028ce893dfbe0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x3c", + "removed": false, + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000001d3be028ce893dfbe", + "logIndex": "0x3d", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000045357415000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x3e", + "removed": false, + "topics": [ + "0x0c18aae526accb31b01cf9a15bdf435e70632ee31efc4c5c0752c4262ea45d2f" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + } + ], + "logsBloom": "0x00600000000000000000000080000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000010000012000000008000000200000000000000000000400008000000000400000000000000000000004000040000000000000000008000010000000000000000000000001000000000040008000040001000800080000004000000000000000000000000000004000000000000000000000000004024000000000000000000002000000000000040000000000000000000000001040000000000080000000000000005002000000000000000000000000000000400000000001000000", + "status": "0x1", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e", + "type": "0x2" + }, + "type": "swapAndSend", + "userEditedGasLimit": false, + "userFeeLevel": "medium", + "v": "0x1", + "verifiedOnBlockchain": true + } + ], + "initialTransaction": { + "actionId": 1717789986313.557, + "baseFeePerGas": "0x0", + "blockTimestamp": "0x66636524", + "chainId": "0x38", + "defaultGasEstimates": { + "estimateType": "medium", + "gas": "0x397cf", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "destinationTokenAddress": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "destinationTokenAmount": "33721280446418538542", + "destinationTokenDecimals": 18, + "destinationTokenSymbol": "USDC", + "firstRetryBlockNumber": "0x259650b", + "gasFeeEstimates": { + "high": { + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "low": { + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "medium": { + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "type": "fee-market" + }, + "gasFeeEstimatesLoaded": true, + "hash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "history": [], + "id": "8ed642e0-2507-11ef-99c4-53f3fc2768a2", + "networkClientId": "899c28d9-9f01-43c6-be76-b5e9f3cfe8bc", + "origin": "metamask", + "r": "0x7fbbe0d92a8da53a9bc98ef8144c6677ecb08050ea180548d93b7830cb407a2a", + "rawTx": "0x02f903d8388084b2d05e0084b2d05e00830397cf943cb693656622fc470f0bb07d3f5813f7889bf82e87b1a2bc2ec50000b90364048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c1883800000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d00000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000018de76816d80000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000128c43c9ef6000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb000000000000000000000000000000003736a41146b8f4bb97dbe80a5771808c000000000000000000000000000000000000000000000000c001a07fbbe0d92a8da53a9bc98ef8144c6677ecb08050ea180548d93b7830cb407a2aa04d050489b179ec7832166566d3769408ef6c407d0032243cdabeb99bab87d634", + "s": "0x4d050489b179ec7832166566d3769408ef6c407d0032243cdabeb99bab87d634", + "sendFlowHistory": [], + "sourceTokenAddress": "0x0000000000000000000000000000000000000000", + "sourceTokenAmount": "50000000000000000", + "sourceTokenDecimals": 18, + "sourceTokenSymbol": "BNB", + "status": "confirmed", + "submittedTime": 1717789986704, + "swapAndSendRecipient": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "swapTokenValue": "0.05", + "time": 1717789986319, + "txParams": { + "data": "0x048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c1883800000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d00000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000018de76816d80000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000128c43c9ef6000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb000000000000000000000000000000003736a41146b8f4bb97dbe80a5771808c000000000000000000000000000000000000000000000000", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gas": "0x397cf", + "gasLimit": "0x397cf", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00", + "nonce": "0x0", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "type": "0x2", + "value": "0xb1a2bc2ec50000" + }, + "txReceipt": { + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "contractAddress": null, + "cumulativeGasUsed": "0x2644bd", + "effectiveGasPrice": "0xb2d05e00", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gasUsed": "0x31a28", + "logs": [ + { + "address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x00000000000000000000000000000000000000000000000000b014d4c6ae2800", + "logIndex": "0x38", + "removed": false, + "topics": [ + "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x00000000000000000000000000000000000000000000000000b014d4c6ae2800", + "logIndex": "0x39", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x000000000000000000000000d99c7f6c65857ac913a8f880a4cb84032ab2fc5b" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000001d3be028ce893dfbe", + "logIndex": "0x3a", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000d99c7f6c65857ac913a8f880a4cb84032ab2fc5b", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0xd99c7f6c65857ac913a8f880a4cb84032ab2fc5b", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000003ef046f04c7cafc1e5e20000000000000000000000000000000000000000000000179ff39de2fc5b390a", + "logIndex": "0x3b", + "removed": false, + "topics": [ + "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0xd99c7f6c65857ac913a8f880a4cb84032ab2fc5b", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001d3be028ce893dfbe0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x3c", + "removed": false, + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000001d3be028ce893dfbe", + "logIndex": "0x3d", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000045357415000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x3e", + "removed": false, + "topics": [ + "0x0c18aae526accb31b01cf9a15bdf435e70632ee31efc4c5c0752c4262ea45d2f" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + } + ], + "logsBloom": "0x00600000000000000000000080000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000010000012000000008000000200000000000000000000400008000000000400000000000000000000004000040000000000000000008000010000000000000000000000001000000000040008000040001000800080000004000000000000000000000000000004000000000000000000000000004024000000000000000000002000000000000040000000000000000000000001040000000000080000000000000005002000000000000000000000000000000400000000001000000", + "status": "0x1", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e", + "type": "0x2" + }, + "type": "swapAndSend", + "userEditedGasLimit": false, + "userFeeLevel": "medium", + "v": "0x1", + "verifiedOnBlockchain": true + }, + "primaryTransaction": { + "actionId": 1717789986313.557, + "baseFeePerGas": "0x0", + "blockTimestamp": "0x66636524", + "chainId": "0x38", + "defaultGasEstimates": { + "estimateType": "medium", + "gas": "0x397cf", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "destinationTokenAddress": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "destinationTokenAmount": "33721280446418538542", + "destinationTokenDecimals": 18, + "destinationTokenSymbol": "USDC", + "firstRetryBlockNumber": "0x259650b", + "gasFeeEstimates": { + "high": { + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "low": { + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "medium": { + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00" + }, + "type": "fee-market" + }, + "gasFeeEstimatesLoaded": true, + "hash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "history": [], + "id": "8ed642e0-2507-11ef-99c4-53f3fc2768a2", + "networkClientId": "899c28d9-9f01-43c6-be76-b5e9f3cfe8bc", + "origin": "metamask", + "r": "0x7fbbe0d92a8da53a9bc98ef8144c6677ecb08050ea180548d93b7830cb407a2a", + "rawTx": "0x02f903d8388084b2d05e0084b2d05e00830397cf943cb693656622fc470f0bb07d3f5813f7889bf82e87b1a2bc2ec50000b90364048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c1883800000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d00000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000018de76816d80000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000128c43c9ef6000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb000000000000000000000000000000003736a41146b8f4bb97dbe80a5771808c000000000000000000000000000000000000000000000000c001a07fbbe0d92a8da53a9bc98ef8144c6677ecb08050ea180548d93b7830cb407a2aa04d050489b179ec7832166566d3769408ef6c407d0032243cdabeb99bab87d634", + "s": "0x4d050489b179ec7832166566d3769408ef6c407d0032243cdabeb99bab87d634", + "sendFlowHistory": [], + "sourceTokenAddress": "0x0000000000000000000000000000000000000000", + "sourceTokenAmount": "50000000000000000", + "sourceTokenDecimals": 18, + "sourceTokenSymbol": "BNB", + "status": "confirmed", + "submittedTime": 1717789986704, + "swapAndSendRecipient": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "swapTokenValue": "0.05", + "time": 1717789986319, + "txParams": { + "data": "0x048226a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c1883800000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d00000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000018de76816d80000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000128c43c9ef6000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001ca9e03628c802fdb00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000008ac76a51cc950d9822d68b83fe1ad97b32cd580d869584cd00000000000000000000000011ededebf63bef0ea2d2d071bdf88f71543ec6fb000000000000000000000000000000003736a41146b8f4bb97dbe80a5771808c000000000000000000000000000000000000000000000000", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gas": "0x397cf", + "gasLimit": "0x397cf", + "maxFeePerGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0xb2d05e00", + "nonce": "0x0", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "type": "0x2", + "value": "0xb1a2bc2ec50000" + }, + "txReceipt": { + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "contractAddress": null, + "cumulativeGasUsed": "0x2644bd", + "effectiveGasPrice": "0xb2d05e00", + "from": "0x141d32a89a1e0a5ef360034a2f60a4b917c18838", + "gasUsed": "0x31a28", + "logs": [ + { + "address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x00000000000000000000000000000000000000000000000000b014d4c6ae2800", + "logIndex": "0x38", + "removed": false, + "topics": [ + "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x00000000000000000000000000000000000000000000000000b014d4c6ae2800", + "logIndex": "0x39", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x000000000000000000000000d99c7f6c65857ac913a8f880a4cb84032ab2fc5b" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000001d3be028ce893dfbe", + "logIndex": "0x3a", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000d99c7f6c65857ac913a8f880a4cb84032ab2fc5b", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0xd99c7f6c65857ac913a8f880a4cb84032ab2fc5b", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000003ef046f04c7cafc1e5e20000000000000000000000000000000000000000000000179ff39de2fc5b390a", + "logIndex": "0x3b", + "removed": false, + "topics": [ + "0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0xd99c7f6c65857ac913a8f880a4cb84032ab2fc5b", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b014d4c6ae2800000000000000000000000000000000000000000000000001d3be028ce893dfbe0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x3c", + "removed": false, + "topics": [ + "0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822", + "0x000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25eff", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000001d3be028ce893dfbe", + "logIndex": "0x3d", + "removed": false, + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x000000000000000000000000bd7607133b9620320e745b3e0b1af717f8ea5889", + "0x000000000000000000000000141d32a89a1e0a5ef360034a2f60a4b917c18838" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + }, + { + "address": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "blockHash": "0xdf447bf7f6018f3b30ddc7004f45d8d55f68434865a05598ce4c1fd774642590", + "blockNumber": "0x259650c", + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000045357415000000000000000000000000000000000000000000000000000000000", + "logIndex": "0x3e", + "removed": false, + "topics": [ + "0x0c18aae526accb31b01cf9a15bdf435e70632ee31efc4c5c0752c4262ea45d2f" + ], + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e" + } + ], + "logsBloom": "0x00600000000000000000000080000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000010000012000000008000000200000000000000000000400008000000000400000000000000000000004000040000000000000000008000010000000000000000000000001000000000040008000040001000800080000004000000000000000000000000000004000000000000000000000000004024000000000000000000002000000000000040000000000000000000000001040000000000080000000000000005002000000000000000000000000000000400000000001000000", + "status": "0x1", + "to": "0x3cb693656622fc470f0bb07d3f5813f7889bf82e", + "transactionHash": "0x5b13c4573b31d93bfb564c4f8506448bba16908b6974a4c0494a40d9aa622de7", + "transactionIndex": "0x2e", + "type": "0x2" + }, + "type": "swapAndSend", + "userEditedGasLimit": false, + "userFeeLevel": "medium", + "v": "0x1", + "verifiedOnBlockchain": true + }, + "hasRetried": false, + "hasCancelled": false } ] diff --git a/test/e2e/tests/swap-send/swap-send-erc20.spec.ts b/test/e2e/tests/swap-send/swap-send-erc20.spec.ts index 3e2fdc1f7b41..2fe73a9b53aa 100644 --- a/test/e2e/tests/swap-send/swap-send-erc20.spec.ts +++ b/test/e2e/tests/swap-send/swap-send-erc20.spec.ts @@ -21,6 +21,7 @@ describe('Swap-Send ERC20', function () { getSwapSendFixtures( this.test?.fullTitle(), SWAP_SEND_QUOTES_RESPONSE_TST_ETH, + '?sourceAmount=100000&sourceToken=0x581c3C1A2A4EBDE2A0Df29B5cf4c116E42945947&destinationToken=0x0000000000000000000000000000000000000000&sender=0x5cfe73b6021e818b776b421b1c4db2474086a7e1&recipient=0xc427D562164062a23a5cFf596A4a3208e72Acd28&slippage=2', ), async ({ driver, @@ -104,7 +105,7 @@ describe('Swap-Send ERC20', function () { 'Send TST as ETH', 'Confirmed', '-10 TST', - '-$0.00', + '', ); driver.summarizeErrorsAndExceptions(); diff --git a/test/e2e/tests/swap-send/swap-send-eth.spec.ts b/test/e2e/tests/swap-send/swap-send-eth.spec.ts index f7835af0c332..780840d28b04 100644 --- a/test/e2e/tests/swap-send/swap-send-eth.spec.ts +++ b/test/e2e/tests/swap-send/swap-send-eth.spec.ts @@ -71,18 +71,20 @@ describe('Swap-Send ETH', function () { '≈ $4,515,000,000.00', ); + // TODO assert swap api request payload + await swapSendPage.submitSwap(); await swapSendPage.verifyHistoryEntry( 'Send ETH as TST', 'Pending', '-1 ETH', - '-$3,010.00', + '', ); await swapSendPage.verifyHistoryEntry( 'Send ETH as TST', 'Confirmed', '-1 ETH', - '-$3,010.00', + '', ); driver.summarizeErrorsAndExceptions(); diff --git a/test/e2e/tests/swap-send/swap-send-test-utils.ts b/test/e2e/tests/swap-send/swap-send-test-utils.ts index 0cfff6449b7f..bcb76ae9c378 100644 --- a/test/e2e/tests/swap-send/swap-send-test-utils.ts +++ b/test/e2e/tests/swap-send/swap-send-test-utils.ts @@ -2,7 +2,7 @@ import { strict as assert } from 'assert'; import { Mockttp } from 'mockttp'; import FixtureBuilder from '../../fixture-builder'; import { SWAPS_API_V2_BASE_URL } from '../../../../shared/constants/swaps'; -import { defaultGanacheOptions } from '../../helpers'; +import { generateGanacheOptions } from '../../helpers'; import { SMART_CONTRACTS } from '../../seeder/smart-contracts'; import { SWAP_SEND_QUOTES_RESPONSE_ETH_TST } from './mocks/eth-data'; @@ -245,10 +245,11 @@ export class SwapSendPage { } export const mockSwapsApi = - (quotes = SWAP_SEND_QUOTES_RESPONSE_ETH_TST) => + (quotes: typeof SWAP_SEND_QUOTES_RESPONSE_ETH_TST, query: string) => async (mockServer: Mockttp) => { - return await mockServer + await mockServer .forGet(`${SWAPS_API_V2_BASE_URL}/v2/networks/1337/quotes`) + .withExactQuery(query) .always() .thenCallback(() => { return { @@ -261,6 +262,7 @@ export const mockSwapsApi = export const getSwapSendFixtures = ( title?: string, swapsQuotes = SWAP_SEND_QUOTES_RESPONSE_ETH_TST, + swapsQuery = '?sourceAmount=1000000000000000000&sourceToken=0x0000000000000000000000000000000000000000&destinationToken=0x581c3C1A2A4EBDE2A0Df29B5cf4c116E42945947&sender=0x5cfe73b6021e818b776b421b1c4db2474086a7e1&recipient=0xc427D562164062a23a5cFf596A4a3208e72Acd28&slippage=2', ) => { const ETH_CONVERSION_RATE_USD = 3010; return { @@ -296,8 +298,8 @@ export const getSwapSendFixtures = ( .build(), smartContract: SMART_CONTRACTS.HST, ethConversionInUsd: ETH_CONVERSION_RATE_USD, - testSpecificMock: mockSwapsApi(swapsQuotes), - ganacheOptions: defaultGanacheOptions, + testSpecificMock: mockSwapsApi(swapsQuotes, swapsQuery), + ganacheOptions: generateGanacheOptions({ hardfork: 'london' }), title, }; }; diff --git a/ui/components/multichain/asset-picker-amount/index.scss b/ui/components/multichain/asset-picker-amount/index.scss index 573e71c83f05..b9f22ba6d1cf 100644 --- a/ui/components/multichain/asset-picker-amount/index.scss +++ b/ui/components/multichain/asset-picker-amount/index.scss @@ -36,7 +36,7 @@ .unit-input__inputs { // primary (i.e., input) and secondary (i.e., subtext) input sections & > div { - max-width: 125px; + max-width: 138px; white-space: nowrap; text-overflow: ellipsis; } @@ -51,7 +51,15 @@ text-overflow: ellipsis; overflow: hidden; - display: inline; + flex-wrap: nowrap; + + & > span.currency-display-component__text { + width: max-content; + } + + & > span.currency-display-component__suffix { + width: max-content; + } } // secondary field elements (e.g., value, symbols) diff --git a/ui/components/multichain/pages/send/components/recipient-content.tsx b/ui/components/multichain/pages/send/components/recipient-content.tsx index 6ca53ae62575..90a73a932c4b 100644 --- a/ui/components/multichain/pages/send/components/recipient-content.tsx +++ b/ui/components/multichain/pages/send/components/recipient-content.tsx @@ -25,6 +25,7 @@ import { getUseExternalServices, } from '../../../../../selectors'; import type { Quote } from '../../../../../ducks/send/swap-and-send-utils'; +import { isEqualCaseInsensitive } from '../../../../../../shared/modules/string-utils'; import { SendHexData, SendPageRow, QuoteCard } from '.'; export const SendPageRecipientContent = ({ @@ -59,8 +60,10 @@ export const SendPageRecipientContent = ({ const isLoadingInitialQuotes = !bestQuote && isSwapQuoteLoading; - const isBasicSend = - receiveAsset.details?.address === sendAsset.details?.address; + const isBasicSend = isEqualCaseInsensitive( + receiveAsset.details?.address ?? '', + sendAsset.details?.address ?? '', + ); const amount = isBasicSend ? sendAmount diff --git a/ui/components/ui/unit-input/unit-input.component.js b/ui/components/ui/unit-input/unit-input.component.js index e916cf5e2e3f..727a33e98c4a 100644 --- a/ui/components/ui/unit-input/unit-input.component.js +++ b/ui/components/ui/unit-input/unit-input.component.js @@ -95,6 +95,7 @@ export default class UnitInput extends PureComponent { } this.props.onBlur && this.props.onBlur(value); + this.unitInput.scrollTo && this.unitInput.scrollTo(0, 0); }; handleChange = (event) => { diff --git a/ui/hooks/useSwappedTokenValue.js b/ui/hooks/useSwappedTokenValue.js index a93140373829..c7007346d7c0 100644 --- a/ui/hooks/useSwappedTokenValue.js +++ b/ui/hooks/useSwappedTokenValue.js @@ -37,16 +37,16 @@ export function useSwappedTokenValue(transactionGroup, currentAsset) { const chainId = useSelector(getCurrentChainId); const isViewingReceivedTokenFromSwap = - currentAsset?.symbol === primaryTransaction.destinationTokenSymbol || - (isSwapsDefaultTokenAddress(currentAsset.address, chainId) && - isSwapsDefaultTokenSymbol( - primaryTransaction.destinationTokenSymbol, - chainId, - )); + type === TransactionType.swap && + (currentAsset?.symbol === primaryTransaction.destinationTokenSymbol || + (isSwapsDefaultTokenAddress(currentAsset.address, chainId) && + isSwapsDefaultTokenSymbol( + primaryTransaction.destinationTokenSymbol, + chainId, + ))); const swapTokenValue = - [TransactionType.swap, TransactionType.swapAndSend].includes(type) && - isViewingReceivedTokenFromSwap + [TransactionType.swap].includes(type) && isViewingReceivedTokenFromSwap ? getSwapsTokensReceivedFromTxMeta( primaryTransaction.destinationTokenSymbol, initialTransaction, @@ -69,8 +69,21 @@ export function useSwappedTokenValue(transactionGroup, currentAsset) { swapTokenValue || '', symbol, ); - const swapTokenFiatAmount = - swapTokenValue && isViewingReceivedTokenFromSwap && _swapTokenFiatAmount; + const _swapAndSendTokenFiatAmount = useTokenFiatAmount( + primaryTransaction.sourceTokenAddress, + swapTokenValue, + primaryTransaction.sourceTokenSymbol, + ); + + let swapTokenFiatAmount; + if (swapTokenValue) { + if (isViewingReceivedTokenFromSwap) { + swapTokenFiatAmount = _swapTokenFiatAmount; + } else if (type === TransactionType.swapAndSend) { + swapTokenFiatAmount = _swapAndSendTokenFiatAmount; + } + } + return { swapTokenValue, swapTokenFiatAmount, diff --git a/ui/hooks/useTransactionDisplayData.js b/ui/hooks/useTransactionDisplayData.js index 019a9ec13fa2..4b551b318b62 100644 --- a/ui/hooks/useTransactionDisplayData.js +++ b/ui/hooks/useTransactionDisplayData.js @@ -394,7 +394,8 @@ export function useTransactionDisplayData(transactionGroup) { recipientAddress, secondaryCurrency: (isTokenCategory && !tokenFiatAmount) || - (type === TransactionType.swap && !swapTokenFiatAmount) + ([TransactionType.swap, TransactionType.swapAndSend].includes(type) && + !swapTokenFiatAmount) ? undefined : secondaryCurrency, displayedStatusKey, diff --git a/ui/hooks/useTransactionDisplayData.test.js b/ui/hooks/useTransactionDisplayData.test.js index 6a8838fdbd61..0755105a32f7 100644 --- a/ui/hooks/useTransactionDisplayData.test.js +++ b/ui/hooks/useTransactionDisplayData.test.js @@ -165,10 +165,36 @@ const expectedResults = [ subtitle: 'metamask', subtitleContainsOrigin: true, date: formatDateWithYearContext(1585088013000), - primaryCurrency: '-0 BAT', + primaryCurrency: '-33.425656732428330864 BAT', senderAddress: '0x0a985a957b490f4d05bef05bc7ec556dd8535946', recipientAddress: '0xc6f6ca03d790168758285264bcbf7fb30d27322b', - secondaryCurrency: '-0 ETH', + secondaryCurrency: undefined, + isPending: false, + displayedStatusKey: TransactionStatus.confirmed, + }, + { + title: 'Send USDC as DAI', + category: TransactionType.swapAndSend, + subtitle: 'metamask', + subtitleContainsOrigin: true, + date: formatDateWithYearContext(1585088013000), + primaryCurrency: '-5 USDC', + senderAddress: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + recipientAddress: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + secondaryCurrency: undefined, + isPending: false, + displayedStatusKey: TransactionStatus.confirmed, + }, + { + title: 'Send BNB as USDC', + category: TransactionType.swapAndSend, + subtitle: 'metamask', + subtitleContainsOrigin: true, + date: formatDateWithYearContext(1585088013000), + primaryCurrency: '-0.05 BNB', + senderAddress: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + recipientAddress: '0x141d32a89a1e0a5ef360034a2f60a4b917c18838', + secondaryCurrency: undefined, isPending: false, displayedStatusKey: TransactionStatus.confirmed, }, From a9f7d7114eed5054bd77e73ddcecd931bf332b94 Mon Sep 17 00:00:00 2001 From: Derek Brans Date: Wed, 12 Jun 2024 18:04:22 -0400 Subject: [PATCH 048/236] fix: swap+send e2e tests (#25275) --- test/e2e/tests/swap-send/swap-send-erc20.spec.ts | 4 ++-- test/e2e/tests/swap-send/swap-send-eth.spec.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/e2e/tests/swap-send/swap-send-erc20.spec.ts b/test/e2e/tests/swap-send/swap-send-erc20.spec.ts index 2fe73a9b53aa..10b18592f42b 100644 --- a/test/e2e/tests/swap-send/swap-send-erc20.spec.ts +++ b/test/e2e/tests/swap-send/swap-send-erc20.spec.ts @@ -75,8 +75,8 @@ describe('Swap-Send ERC20', function () { await swapSendPage.verifyQuoteDisplay( '1 TST = 0.000002634 ETH', - '879687 ETH', - '≈ $2,647,857,870.00', + '0.0075669 ETH', + '≈ $22.78', ); await swapSendPage.submitSwap(); diff --git a/test/e2e/tests/swap-send/swap-send-eth.spec.ts b/test/e2e/tests/swap-send/swap-send-eth.spec.ts index 780840d28b04..244693d513a2 100644 --- a/test/e2e/tests/swap-send/swap-send-eth.spec.ts +++ b/test/e2e/tests/swap-send/swap-send-eth.spec.ts @@ -67,8 +67,8 @@ describe('Swap-Send ETH', function () { await swapSendPage.verifyQuoteDisplay( '1 ETH = 301075.4807 TST', - '1500000 ETH', // TODO this looks weird - '≈ $4,515,000,000.00', + '0.0129028 ETH', + '≈ $38.84', ); // TODO assert swap api request payload @@ -116,7 +116,7 @@ describe('Swap-Send ETH', function () { await swapSendPage.verifyMaxButtonClick( ['ETH', 'ETH'], - ['24.995559472', '24.995559472'], + ['24.9970184730279925', '24.9970184730279925'], ); }, ); From 2c4822be627cfd3a0707f715a599ab01ce7fec86 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Wed, 19 Jun 2024 06:18:36 -0230 Subject: [PATCH 049/236] chore: Cherry pick 25372 v12 (#25395) Cherry-pick https://github.com/MetaMask/metamask-extension/pull/25372 to v12 this will fix the audit failure on the v12 branch/PR Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com> --- package.json | 2 ++ yarn.lock | 52 +++++++++++----------------------------------------- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index 699dc1b55523..fee996b1730c 100644 --- a/package.json +++ b/package.json @@ -190,6 +190,8 @@ "regenerator-runtime@^0.13.4": "patch:regenerator-runtime@npm%3A0.13.7#./.yarn/patches/regenerator-runtime-npm-0.13.7-41bcbe64ea.patch", "regenerator-runtime@^0.13.7": "patch:regenerator-runtime@npm%3A0.13.7#./.yarn/patches/regenerator-runtime-npm-0.13.7-41bcbe64ea.patch", "regenerator-runtime@^0.11.0": "patch:regenerator-runtime@npm%3A0.13.7#./.yarn/patches/regenerator-runtime-npm-0.13.7-41bcbe64ea.patch", + "ws@8.13.0": "^8.17.1", + "ws@7.4.6": "^7.5.10", "jsdom@^16.7.0": "patch:jsdom@npm%3A16.7.0#./.yarn/patches/jsdom-npm-16.7.0-216c5c4bf9.patch", "trim": "^0.0.3", "@eslint/eslintrc@npm:^2.1.4": "patch:@eslint/eslintrc@npm%3A2.1.4#~/.yarn/patches/@eslint-eslintrc-npm-2.1.4-1ff4b5f908.patch", diff --git a/yarn.lock b/yarn.lock index 31d04b8c651b..8004288ae8a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35678,9 +35678,9 @@ __metadata: languageName: node linkType: hard -"ws@npm:*, ws@npm:>=8.14.2, ws@npm:^8.11.0, ws@npm:^8.16.0, ws@npm:^8.2.3, ws@npm:^8.5.0, ws@npm:^8.8.0": - version: 8.16.0 - resolution: "ws@npm:8.16.0" +"ws@npm:*, ws@npm:>=8.14.2, ws@npm:^8.11.0, ws@npm:^8.16.0, ws@npm:^8.17.1, ws@npm:^8.2.3, ws@npm:^8.5.0, ws@npm:^8.8.0": + version: 8.17.1 + resolution: "ws@npm:8.17.1" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -35689,52 +35689,22 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 10/7c511c59e979bd37b63c3aea4a8e4d4163204f00bd5633c053b05ed67835481995f61a523b0ad2b603566f9a89b34cb4965cb9fab9649fbfebd8f740cea57f17 - languageName: node - linkType: hard - -"ws@npm:7.4.6": - version: 7.4.6 - resolution: "ws@npm:7.4.6" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 10/150e3f917b7cde568d833a5ea6ccc4132e59c38d04218afcf2b6c7b845752bd011a9e0dc1303c8694d3c402a0bdec5893661a390b71ff88f0fc81a4e4e66b09c - languageName: node - linkType: hard - -"ws@npm:8.13.0": - version: 8.13.0 - resolution: "ws@npm:8.13.0" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 10/1769532b6fdab9ff659f0b17810e7501831d34ecca23fd179ee64091dd93a51f42c59f6c7bb4c7a384b6c229aca8076fb312aa35626257c18081511ef62a161d + checksum: 10/4264ae92c0b3e59c7e309001e93079b26937aab181835fb7af79f906b22cd33b6196d96556dafb4e985742dd401e99139572242e9847661fdbc96556b9e6902d languageName: node linkType: hard "ws@npm:^6.1.0": - version: 6.2.2 - resolution: "ws@npm:6.2.2" + version: 6.2.3 + resolution: "ws@npm:6.2.3" dependencies: async-limiter: "npm:~1.0.0" - checksum: 10/bb791ac02ad7e59fd4208cc6dd3a5bf7a67dff4611a128ed33365996f9fc24fa0d699043559f1798b4bc8045639fd21a1fd3ceca81de560124444abd8e321afc + checksum: 10/19f8d1608317f4c98f63da6eebaa85260a6fe1ba459cbfedd83ebe436368177fb1e2944761e2392c6b7321cbb7a375c8a81f9e1be35d555b6b4647eb61eadd46 languageName: node linkType: hard -"ws@npm:^7, ws@npm:^7.2.0, ws@npm:^7.4.5, ws@npm:^7.4.6, ws@npm:^7.5.0": - version: 7.5.9 - resolution: "ws@npm:7.5.9" +"ws@npm:^7, ws@npm:^7.2.0, ws@npm:^7.4.5, ws@npm:^7.4.6, ws@npm:^7.5.0, ws@npm:^7.5.10": + version: 7.5.10 + resolution: "ws@npm:7.5.10" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ^5.0.2 @@ -35743,7 +35713,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 10/171e35012934bd8788150a7f46f963e50bac43a4dc524ee714c20f258693ac4d3ba2abadb00838fdac42a47af9e958c7ae7e6f4bc56db047ba897b8a2268cf7c + checksum: 10/9c796b84ba80ffc2c2adcdfc9c8e9a219ba99caa435c9a8d45f9ac593bba325563b3f83edc5eb067cc6d21b9a6bf2c930adf76dd40af5f58a5ca6859e81858f0 languageName: node linkType: hard From ba52059d9aa274d5ad5127dac58b4060de86b1c9 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 18 Jun 2024 13:43:17 +0200 Subject: [PATCH 050/236] chore: Refactor offscreen creation logic (#25302) Refactor initialization logic to defer creation of the offscreen document until the `MetaMaskController` is initialized. This adds a `offscreenPromise` to the controller that can be awaited for functionality that requires the offscreen document to be created. Additionally this PR adds a message that the offscreen document will send once initial execution of the offscreen page has finished. This is awaited in the `offscreenPromise`. We await `offscreenPromise` before unlocking the keyrings as some keyrings rely on the offscreen document to process requests, e.g. hardware wallets. There may be room for more improvements here though, that I have not tackled in this PR. As the hardware wallet logic doesn't seem to wait for iframes to fully load, so there is a chance of some missed messages. I have tested that hardware wallet support, at least for Ledger, is still working following the changes in this PR. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25302?quickstart=1) --- app/scripts/app-init.js | 24 ----------- app/scripts/background.js | 7 ++++ app/scripts/metamask-controller.js | 6 +++ app/scripts/offscreen.js | 44 +++++++++++++++++++++ offscreen/scripts/offscreen.ts | 6 +++ shared/constants/offscreen-communication.ts | 1 + 6 files changed, 64 insertions(+), 24 deletions(-) create mode 100644 app/scripts/offscreen.js diff --git a/app/scripts/app-init.js b/app/scripts/app-init.js index 3290dc59d84b..766ba15e2d0d 100644 --- a/app/scripts/app-init.js +++ b/app/scripts/app-init.js @@ -185,27 +185,3 @@ const registerInPageContentScript = async () => { }; registerInPageContentScript(); - -/** - * Creates an offscreen document that can be used to load additional scripts - * and iframes that can communicate with the extension through the chrome - * runtime API. Only one offscreen document may exist, so any iframes required - * by extension can be embedded in the offscreen.html file. See the offscreen - * folder for more details. - */ -async function createOffscreen() { - if (!chrome.offscreen || (await chrome.offscreen.hasDocument())) { - return; - } - - await chrome.offscreen.createDocument({ - url: './offscreen.html', - reasons: ['IFRAME_SCRIPTING'], - justification: - 'Used for Hardware Wallet and Snaps scripts to communicate with the extension.', - }); - - console.debug('Offscreen iframe loaded'); -} - -createOffscreen(); diff --git a/app/scripts/background.js b/app/scripts/background.js index 1fde714275cd..c7a1621fba19 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -67,6 +67,7 @@ import { shouldEmitDappViewedEvent, } from './lib/util'; import { generateSkipOnboardingState } from './skip-onboarding'; +import { createOffscreen } from './offscreen'; /* eslint-enable import/first */ @@ -278,6 +279,8 @@ function saveTimestamp() { */ async function initialize() { try { + const offscreenPromise = isManifestV3 ? createOffscreen() : null; + const initData = await loadStateFromPersistence(); const initState = initData.data; @@ -314,6 +317,7 @@ async function initialize() { {}, isFirstMetaMaskControllerSetup, initData.meta, + offscreenPromise, ); if (!isManifestV3) { await loadPhishingWarningPage(); @@ -528,6 +532,7 @@ function emitDappViewedMetricEvent( * @param {object} overrides - object with callbacks that are allowed to override the setup controller logic (usefull for desktop app) * @param isFirstMetaMaskControllerSetup * @param {object} stateMetadata - Metadata about the initial state and migrations, including the most recent migration version + * @param {Promise} offscreenPromise - A promise that resolves when the offscreen document has finished initialization. */ export function setupController( initState, @@ -535,6 +540,7 @@ export function setupController( overrides, isFirstMetaMaskControllerSetup, stateMetadata, + offscreenPromise, ) { // // MetaMask Controller @@ -563,6 +569,7 @@ export function setupController( isFirstMetaMaskControllerSetup, currentMigrationVersion: stateMetadata.version, featureFlags: {}, + offscreenPromise, }); setupEnsIpfsResolver({ diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index fdfddfd3689b..d2e8580e105f 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -371,6 +371,8 @@ export default class MetamaskController extends EventEmitter { // the only thing that uses controller connections are open metamask UI instances this.activeControllerConnections = 0; + this.offscreenPromise = opts.offscreenPromise ?? Promise.resolve(); + this.getRequestAccountTabIds = opts.getRequestAccountTabIds; this.getOpenMetamaskTabsIds = opts.getOpenMetamaskTabsIds; @@ -4081,6 +4083,10 @@ export default class MetamaskController extends EventEmitter { */ async submitPassword(password) { const { completedOnboarding } = this.onboardingController.store.getState(); + + // Before attempting to unlock the keyrings, we need the offscreen to have loaded. + await this.offscreenPromise; + await this.keyringController.submitPassword(password); ///: BEGIN:ONLY_INCLUDE_IF(build-mmi) diff --git a/app/scripts/offscreen.js b/app/scripts/offscreen.js new file mode 100644 index 000000000000..ba796874f2fc --- /dev/null +++ b/app/scripts/offscreen.js @@ -0,0 +1,44 @@ +import { OffscreenCommunicationTarget } from '../../shared/constants/offscreen-communication'; + +/** + * Creates an offscreen document that can be used to load additional scripts + * and iframes that can communicate with the extension through the chrome + * runtime API. Only one offscreen document may exist, so any iframes required + * by extension can be embedded in the offscreen.html file. See the offscreen + * folder for more details. + */ +export async function createOffscreen() { + const { chrome } = globalThis; + if (!chrome.offscreen || (await chrome.offscreen.hasDocument())) { + return; + } + + const loadPromise = new Promise((resolve) => { + const messageListener = (msg) => { + if ( + msg.target === OffscreenCommunicationTarget.extensionMain && + msg.isBooted + ) { + chrome.runtime.onMessage.removeListener(messageListener); + resolve(); + } + }; + chrome.runtime.onMessage.addListener(messageListener); + }); + + await chrome.offscreen.createDocument({ + url: './offscreen.html', + reasons: ['IFRAME_SCRIPTING'], + justification: + 'Used for Hardware Wallet and Snaps scripts to communicate with the extension.', + }); + + // In case we are in a bad state where the offscreen document is not loading, timeout and let execution continue. + const timeoutPromise = new Promise((resolve) => { + setTimeout(resolve, 5000); + }); + + await Promise.race([loadPromise, timeoutPromise]); + + console.debug('Offscreen iframe loaded'); +} diff --git a/offscreen/scripts/offscreen.ts b/offscreen/scripts/offscreen.ts index 8c0598b4bd3f..c2448ae3c289 100644 --- a/offscreen/scripts/offscreen.ts +++ b/offscreen/scripts/offscreen.ts @@ -1,5 +1,6 @@ import { BrowserRuntimePostMessageStream } from '@metamask/post-message-stream'; import { ProxySnapExecutor } from '@metamask/snaps-execution-environments'; +import { OffscreenCommunicationTarget } from '../../shared/constants/offscreen-communication'; import initLedger from './ledger'; import initTrezor from './trezor'; import initLattice from './lattice'; @@ -20,3 +21,8 @@ const parentStream = new BrowserRuntimePostMessageStream({ }); ProxySnapExecutor.initialize(parentStream); + +chrome.runtime.sendMessage({ + target: OffscreenCommunicationTarget.extensionMain, + isBooted: true, +}); diff --git a/shared/constants/offscreen-communication.ts b/shared/constants/offscreen-communication.ts index cab4232c09dc..618239609956 100644 --- a/shared/constants/offscreen-communication.ts +++ b/shared/constants/offscreen-communication.ts @@ -7,6 +7,7 @@ export enum OffscreenCommunicationTarget { ledgerOffscreen = 'ledger-offscreen', latticeOffscreen = 'lattice-offscreen', extension = 'extension-offscreen', + extensionMain = 'extension', } /** From f95565371394a0bb51f233cdf92ff895b5c6506c Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Wed, 19 Jun 2024 11:05:12 +0200 Subject: [PATCH 051/236] chore: Bump Snaps packages (#25292) Bump snaps packages to latest and handle breaking changes. ~~Depends on #25302~~ Summary of changes in the snaps deps: - **Breaking:** Defer creation of offscreen document - Fix an issue with decrypting legacy state blobs - Support nested children in JSX - Allow usage of the `tooltip` prop on `Row` - Revert requiring at least one child in JSX components - Update `onNameLookup` response to include `domainName` [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25292?quickstart=1) --- app/scripts/metamask-controller.js | 4 +- builds.yml | 6 +- lavamoat/browserify/beta/policy.json | 172 +++++++++++---- lavamoat/browserify/desktop/policy.json | 202 ++++++++++++++---- lavamoat/browserify/flask/policy.json | 202 ++++++++++++++---- lavamoat/browserify/main/policy.json | 202 ++++++++++++++---- lavamoat/browserify/mmi/policy.json | 202 ++++++++++++++---- package.json | 12 +- test/e2e/snaps/enums.js | 2 +- .../snaps/snap-ui-renderer/components/row.ts | 1 + yarn.lock | 164 ++++++++++---- 11 files changed, 926 insertions(+), 243 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index d2e8580e105f..9782bd1d78eb 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1248,9 +1248,8 @@ export default class MetamaskController extends EventEmitter { iframeUrl: new URL(process.env.IFRAME_EXECUTION_ENVIRONMENT_URL), }) : new OffscreenExecutionService({ - // eslint-disable-next-line no-undef - documentUrl: chrome.runtime.getURL('./offscreen.html'), ...snapExecutionServiceArgs, + offscreenPromise: this.offscreenPromise, }); const snapControllerMessenger = this.controllerMessenger.getRestricted({ @@ -1398,7 +1397,6 @@ export default class MetamaskController extends EventEmitter { state: initState.SnapsRegistry, messenger: snapsRegistryMessenger, refetchOnAllowlistMiss: requireAllowlist, - failOnUnavailableRegistry: requireAllowlist, url: { registry: 'https://acl.execution.metamask.io/latest/registry.json', signature: 'https://acl.execution.metamask.io/latest/signature.json', diff --git a/builds.yml b/builds.yml index 48cc602120bb..9358a8b1dcea 100644 --- a/builds.yml +++ b/builds.yml @@ -27,7 +27,7 @@ buildTypes: - SEGMENT_WRITE_KEY_REF: SEGMENT_PROD_WRITE_KEY - ALLOW_LOCAL_SNAPS: false - REQUIRE_SNAPS_ALLOWLIST: true - - IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.3.0/index.html + - IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.4.0/index.html - ACCOUNT_SNAPS_DIRECTORY_URL: https://snaps.metamask.io/account-management # Main build uses the default browser manifest manifestOverrides: false @@ -64,7 +64,7 @@ buildTypes: - SEGMENT_FLASK_WRITE_KEY - ALLOW_LOCAL_SNAPS: true - REQUIRE_SNAPS_ALLOWLIST: false - - IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.3.0/index.html + - IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.4.0/index.html - SUPPORT_LINK: https://metamask-flask.zendesk.com/hc - SUPPORT_REQUEST_LINK: https://metamask-flask.zendesk.com/hc/en-us/requests/new - INFURA_ENV_KEY_REF: INFURA_FLASK_PROJECT_ID @@ -109,7 +109,7 @@ buildTypes: - SEGMENT_WRITE_KEY_REF: SEGMENT_MMI_WRITE_KEY - ALLOW_LOCAL_SNAPS: false - REQUIRE_SNAPS_ALLOWLIST: true - - IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.3.0/index.html + - IFRAME_EXECUTION_ENVIRONMENT_URL: https://execution.metamask.io/iframe/6.4.0/index.html - MMI_CONFIGURATION_SERVICE_URL: https://configuration.metamask-institutional.io/v2/configuration/default - SUPPORT_LINK: https://mmi-support.metamask.io/hc/en-us - SUPPORT_REQUEST_LINK: https://mmi-support.metamask.io/hc/en-us/requests/new diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 30fe70df1cdc..895997ffb97b 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -1759,9 +1759,9 @@ "@metamask/network-controller>@metamask/controller-utils": true, "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, "@metamask/network-controller>@metamask/eth-json-rpc-provider": true, + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/network-controller>@metamask/swappable-obj-proxy": true, "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true, "browserify>assert": true, "uuid": true @@ -1820,8 +1820,15 @@ }, "@metamask/network-controller>@metamask/eth-json-rpc-provider": { "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, + "@metamask/safe-event-emitter": true + } + }, + "@metamask/network-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true + "@metamask/utils": true } }, "@metamask/notification-controller>nanoid": { @@ -1854,11 +1861,11 @@ "console.error": true }, "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/permission-controller>@metamask/base-controller": true, "@metamask/permission-controller>@metamask/controller-utils": true, "@metamask/permission-controller>nanoid": true, "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true, "deep-freeze-strict": true, "immer": true @@ -1914,8 +1921,8 @@ "fetch": true }, "packages": { + "@metamask/controller-utils": true, "@metamask/phishing-controller>@metamask/base-controller": true, - "@metamask/phishing-controller>@metamask/controller-utils": true, "@metamask/phishing-warning>eth-phishing-detect": true, "punycode": true } @@ -1928,24 +1935,6 @@ "immer": true } }, - "@metamask/phishing-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, "@metamask/phishing-warning>eth-phishing-detect": { "packages": { "eslint>optionator>fast-levenshtein": true @@ -2002,10 +1991,10 @@ }, "@metamask/queued-request-controller": { "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/queued-request-controller>@metamask/base-controller": true, "@metamask/selected-network-controller": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true } }, @@ -2438,13 +2427,6 @@ "crypto.getRandomValues": true } }, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": { - "packages": { - "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/safe-event-emitter": true, - "@metamask/utils": true - } - }, "@metamask/snaps-controllers>nanoid": { "globals": { "crypto.getRandomValues": true @@ -2462,8 +2444,8 @@ }, "@metamask/snaps-rpc-methods": { "packages": { - "@metamask/permission-controller": true, "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller": true, "@metamask/snaps-sdk": true, "@metamask/snaps-sdk>@metamask/key-tree": true, "@metamask/snaps-utils": true, @@ -2472,13 +2454,65 @@ "superstruct": true } }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/base-controller": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/controller-utils": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/json-rpc-engine": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/snaps-sdk": { "globals": { "fetch": true }, "packages": { "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-sdk>fast-xml-parser": true, "@metamask/utils": true, "superstruct": true } @@ -2492,15 +2526,6 @@ "@noble/hashes": true } }, - "@metamask/snaps-sdk>fast-xml-parser": { - "globals": { - "entityName": true, - "val": true - }, - "packages": { - "@metamask/snaps-sdk>fast-xml-parser>strnum": true - } - }, "@metamask/snaps-utils": { "globals": { "File": true, @@ -2517,13 +2542,14 @@ "fetch": true }, "packages": { - "@metamask/permission-controller": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/snaps-sdk": true, "@metamask/snaps-sdk>@metamask/key-tree": true, + "@metamask/snaps-utils>@metamask/permission-controller": true, "@metamask/snaps-utils>@metamask/slip44": true, "@metamask/snaps-utils>cron-parser": true, "@metamask/snaps-utils>fast-json-stable-stringify": true, + "@metamask/snaps-utils>fast-xml-parser": true, "@metamask/snaps-utils>marked": true, "@metamask/snaps-utils>rfdc": true, "@metamask/snaps-utils>validate-npm-package-name": true, @@ -2535,12 +2561,74 @@ "superstruct": true } }, + "@metamask/snaps-utils>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-utils>@metamask/base-controller": true, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils": true, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/json-rpc-engine": true, + "@metamask/snaps-utils>@metamask/permission-controller>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/snaps-utils>cron-parser": { "packages": { "browserify>browser-resolve": true, "luxon": true } }, + "@metamask/snaps-utils>fast-xml-parser": { + "globals": { + "entityName": true, + "val": true + }, + "packages": { + "@metamask/snaps-utils>fast-xml-parser>strnum": true + } + }, "@metamask/snaps-utils>marked": { "globals": { "console.error": true, diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index 1a637052d11f..6c8c137e500b 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -1904,9 +1904,9 @@ "@metamask/network-controller>@metamask/controller-utils": true, "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, "@metamask/network-controller>@metamask/eth-json-rpc-provider": true, + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/network-controller>@metamask/swappable-obj-proxy": true, "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true, "browserify>assert": true, "uuid": true @@ -1965,8 +1965,15 @@ }, "@metamask/network-controller>@metamask/eth-json-rpc-provider": { "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, + "@metamask/safe-event-emitter": true + } + }, + "@metamask/network-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true + "@metamask/utils": true } }, "@metamask/notification-controller": { @@ -2026,11 +2033,11 @@ "console.error": true }, "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/permission-controller>@metamask/base-controller": true, "@metamask/permission-controller>@metamask/controller-utils": true, "@metamask/permission-controller>nanoid": true, "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true, "deep-freeze-strict": true, "immer": true @@ -2086,8 +2093,8 @@ "fetch": true }, "packages": { + "@metamask/controller-utils": true, "@metamask/phishing-controller>@metamask/base-controller": true, - "@metamask/phishing-controller>@metamask/controller-utils": true, "@metamask/phishing-warning>eth-phishing-detect": true, "punycode": true } @@ -2100,24 +2107,6 @@ "immer": true } }, - "@metamask/phishing-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, "@metamask/phishing-warning>eth-phishing-detect": { "packages": { "eslint>optionator>fast-levenshtein": true @@ -2174,10 +2163,10 @@ }, "@metamask/queued-request-controller": { "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/queued-request-controller>@metamask/base-controller": true, "@metamask/selected-network-controller": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true } }, @@ -2627,8 +2616,6 @@ "globals": { "DecompressionStream": true, "URL": true, - "chrome.offscreen.createDocument": true, - "chrome.offscreen.hasDocument": true, "clearTimeout": true, "document.getElementById": true, "fetch.bind": true, @@ -2636,12 +2623,12 @@ }, "packages": { "@metamask/object-multiplex": true, - "@metamask/permission-controller": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/snaps-controllers>@metamask/base-controller": true, "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": true, + "@metamask/snaps-controllers>@metamask/permission-controller": true, "@metamask/snaps-controllers>@xstate/fsm": true, "@metamask/snaps-controllers>concat-stream": true, "@metamask/snaps-controllers>get-npm-tarball-url": true, @@ -2688,6 +2675,39 @@ "readable-stream": true } }, + "@metamask/snaps-controllers>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-controllers>@metamask/base-controller": true, + "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, + "@metamask/snaps-controllers>@metamask/phishing-controller>@metamask/controller-utils": true, + "@metamask/snaps-controllers>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-controllers>@metamask/phishing-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, "@metamask/snaps-controllers>concat-stream": { "packages": { "browserify>buffer": true, @@ -2745,8 +2765,8 @@ }, "@metamask/snaps-rpc-methods": { "packages": { - "@metamask/permission-controller": true, "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller": true, "@metamask/snaps-sdk": true, "@metamask/snaps-sdk>@metamask/key-tree": true, "@metamask/snaps-utils": true, @@ -2755,13 +2775,65 @@ "superstruct": true } }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/base-controller": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/controller-utils": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/json-rpc-engine": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/snaps-sdk": { "globals": { "fetch": true }, "packages": { "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-sdk>fast-xml-parser": true, "@metamask/utils": true, "superstruct": true } @@ -2775,15 +2847,6 @@ "@noble/hashes": true } }, - "@metamask/snaps-sdk>fast-xml-parser": { - "globals": { - "entityName": true, - "val": true - }, - "packages": { - "@metamask/snaps-sdk>fast-xml-parser>strnum": true - } - }, "@metamask/snaps-utils": { "globals": { "File": true, @@ -2800,13 +2863,14 @@ "fetch": true }, "packages": { - "@metamask/permission-controller": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/snaps-sdk": true, "@metamask/snaps-sdk>@metamask/key-tree": true, + "@metamask/snaps-utils>@metamask/permission-controller": true, "@metamask/snaps-utils>@metamask/slip44": true, "@metamask/snaps-utils>cron-parser": true, "@metamask/snaps-utils>fast-json-stable-stringify": true, + "@metamask/snaps-utils>fast-xml-parser": true, "@metamask/snaps-utils>marked": true, "@metamask/snaps-utils>rfdc": true, "@metamask/snaps-utils>validate-npm-package-name": true, @@ -2818,6 +2882,59 @@ "superstruct": true } }, + "@metamask/snaps-utils>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-utils>@metamask/base-controller": true, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils": true, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/json-rpc-engine": true, + "@metamask/snaps-utils>@metamask/permission-controller>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/snaps-utils>@metamask/snaps-registry": { "packages": { "@metamask/message-signing-snap>@noble/curves": true, @@ -2832,6 +2949,15 @@ "luxon": true } }, + "@metamask/snaps-utils>fast-xml-parser": { + "globals": { + "entityName": true, + "val": true + }, + "packages": { + "@metamask/snaps-utils>fast-xml-parser>strnum": true + } + }, "@metamask/snaps-utils>marked": { "globals": { "console.error": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 481676bbf8b5..aa61e9d971a4 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -1904,9 +1904,9 @@ "@metamask/network-controller>@metamask/controller-utils": true, "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, "@metamask/network-controller>@metamask/eth-json-rpc-provider": true, + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/network-controller>@metamask/swappable-obj-proxy": true, "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true, "browserify>assert": true, "uuid": true @@ -1965,8 +1965,15 @@ }, "@metamask/network-controller>@metamask/eth-json-rpc-provider": { "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, + "@metamask/safe-event-emitter": true + } + }, + "@metamask/network-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true + "@metamask/utils": true } }, "@metamask/notification-controller": { @@ -2026,11 +2033,11 @@ "console.error": true }, "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/permission-controller>@metamask/base-controller": true, "@metamask/permission-controller>@metamask/controller-utils": true, "@metamask/permission-controller>nanoid": true, "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true, "deep-freeze-strict": true, "immer": true @@ -2086,8 +2093,8 @@ "fetch": true }, "packages": { + "@metamask/controller-utils": true, "@metamask/phishing-controller>@metamask/base-controller": true, - "@metamask/phishing-controller>@metamask/controller-utils": true, "@metamask/phishing-warning>eth-phishing-detect": true, "punycode": true } @@ -2100,24 +2107,6 @@ "immer": true } }, - "@metamask/phishing-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, "@metamask/phishing-warning>eth-phishing-detect": { "packages": { "eslint>optionator>fast-levenshtein": true @@ -2226,10 +2215,10 @@ }, "@metamask/queued-request-controller": { "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/queued-request-controller>@metamask/base-controller": true, "@metamask/selected-network-controller": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true } }, @@ -2679,8 +2668,6 @@ "globals": { "DecompressionStream": true, "URL": true, - "chrome.offscreen.createDocument": true, - "chrome.offscreen.hasDocument": true, "clearTimeout": true, "document.getElementById": true, "fetch.bind": true, @@ -2688,12 +2675,12 @@ }, "packages": { "@metamask/object-multiplex": true, - "@metamask/permission-controller": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/snaps-controllers>@metamask/base-controller": true, "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": true, + "@metamask/snaps-controllers>@metamask/permission-controller": true, "@metamask/snaps-controllers>@xstate/fsm": true, "@metamask/snaps-controllers>concat-stream": true, "@metamask/snaps-controllers>get-npm-tarball-url": true, @@ -2740,6 +2727,39 @@ "readable-stream": true } }, + "@metamask/snaps-controllers>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-controllers>@metamask/base-controller": true, + "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, + "@metamask/snaps-controllers>@metamask/phishing-controller>@metamask/controller-utils": true, + "@metamask/snaps-controllers>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-controllers>@metamask/phishing-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, "@metamask/snaps-controllers>concat-stream": { "packages": { "browserify>buffer": true, @@ -2797,8 +2817,8 @@ }, "@metamask/snaps-rpc-methods": { "packages": { - "@metamask/permission-controller": true, "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller": true, "@metamask/snaps-sdk": true, "@metamask/snaps-sdk>@metamask/key-tree": true, "@metamask/snaps-utils": true, @@ -2807,13 +2827,65 @@ "superstruct": true } }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/base-controller": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/controller-utils": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/json-rpc-engine": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/snaps-sdk": { "globals": { "fetch": true }, "packages": { "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-sdk>fast-xml-parser": true, "@metamask/utils": true, "superstruct": true } @@ -2827,15 +2899,6 @@ "@noble/hashes": true } }, - "@metamask/snaps-sdk>fast-xml-parser": { - "globals": { - "entityName": true, - "val": true - }, - "packages": { - "@metamask/snaps-sdk>fast-xml-parser>strnum": true - } - }, "@metamask/snaps-utils": { "globals": { "File": true, @@ -2852,13 +2915,14 @@ "fetch": true }, "packages": { - "@metamask/permission-controller": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/snaps-sdk": true, "@metamask/snaps-sdk>@metamask/key-tree": true, + "@metamask/snaps-utils>@metamask/permission-controller": true, "@metamask/snaps-utils>@metamask/slip44": true, "@metamask/snaps-utils>cron-parser": true, "@metamask/snaps-utils>fast-json-stable-stringify": true, + "@metamask/snaps-utils>fast-xml-parser": true, "@metamask/snaps-utils>marked": true, "@metamask/snaps-utils>rfdc": true, "@metamask/snaps-utils>validate-npm-package-name": true, @@ -2870,6 +2934,59 @@ "superstruct": true } }, + "@metamask/snaps-utils>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-utils>@metamask/base-controller": true, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils": true, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/json-rpc-engine": true, + "@metamask/snaps-utils>@metamask/permission-controller>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/snaps-utils>@metamask/snaps-registry": { "packages": { "@metamask/message-signing-snap>@noble/curves": true, @@ -2884,6 +3001,15 @@ "luxon": true } }, + "@metamask/snaps-utils>fast-xml-parser": { + "globals": { + "entityName": true, + "val": true + }, + "packages": { + "@metamask/snaps-utils>fast-xml-parser>strnum": true + } + }, "@metamask/snaps-utils>marked": { "globals": { "console.error": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 84c84a7491d2..b3440376d9b5 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -1759,9 +1759,9 @@ "@metamask/network-controller>@metamask/controller-utils": true, "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, "@metamask/network-controller>@metamask/eth-json-rpc-provider": true, + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/network-controller>@metamask/swappable-obj-proxy": true, "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true, "browserify>assert": true, "uuid": true @@ -1820,8 +1820,15 @@ }, "@metamask/network-controller>@metamask/eth-json-rpc-provider": { "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, + "@metamask/safe-event-emitter": true + } + }, + "@metamask/network-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true + "@metamask/utils": true } }, "@metamask/notification-controller": { @@ -1881,11 +1888,11 @@ "console.error": true }, "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/permission-controller>@metamask/base-controller": true, "@metamask/permission-controller>@metamask/controller-utils": true, "@metamask/permission-controller>nanoid": true, "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true, "deep-freeze-strict": true, "immer": true @@ -1941,8 +1948,8 @@ "fetch": true }, "packages": { + "@metamask/controller-utils": true, "@metamask/phishing-controller>@metamask/base-controller": true, - "@metamask/phishing-controller>@metamask/controller-utils": true, "@metamask/phishing-warning>eth-phishing-detect": true, "punycode": true } @@ -1955,24 +1962,6 @@ "immer": true } }, - "@metamask/phishing-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, "@metamask/phishing-warning>eth-phishing-detect": { "packages": { "eslint>optionator>fast-levenshtein": true @@ -2081,10 +2070,10 @@ }, "@metamask/queued-request-controller": { "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/queued-request-controller>@metamask/base-controller": true, "@metamask/selected-network-controller": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true } }, @@ -2534,8 +2523,6 @@ "globals": { "DecompressionStream": true, "URL": true, - "chrome.offscreen.createDocument": true, - "chrome.offscreen.hasDocument": true, "clearTimeout": true, "document.getElementById": true, "fetch.bind": true, @@ -2543,12 +2530,12 @@ }, "packages": { "@metamask/object-multiplex": true, - "@metamask/permission-controller": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/snaps-controllers>@metamask/base-controller": true, "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": true, + "@metamask/snaps-controllers>@metamask/permission-controller": true, "@metamask/snaps-controllers>@xstate/fsm": true, "@metamask/snaps-controllers>concat-stream": true, "@metamask/snaps-controllers>get-npm-tarball-url": true, @@ -2595,6 +2582,39 @@ "readable-stream": true } }, + "@metamask/snaps-controllers>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-controllers>@metamask/base-controller": true, + "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, + "@metamask/snaps-controllers>@metamask/phishing-controller>@metamask/controller-utils": true, + "@metamask/snaps-controllers>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-controllers>@metamask/phishing-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, "@metamask/snaps-controllers>concat-stream": { "packages": { "browserify>buffer": true, @@ -2652,8 +2672,8 @@ }, "@metamask/snaps-rpc-methods": { "packages": { - "@metamask/permission-controller": true, "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller": true, "@metamask/snaps-sdk": true, "@metamask/snaps-sdk>@metamask/key-tree": true, "@metamask/snaps-utils": true, @@ -2662,13 +2682,65 @@ "superstruct": true } }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/base-controller": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/controller-utils": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/json-rpc-engine": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/snaps-sdk": { "globals": { "fetch": true }, "packages": { "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-sdk>fast-xml-parser": true, "@metamask/utils": true, "superstruct": true } @@ -2682,15 +2754,6 @@ "@noble/hashes": true } }, - "@metamask/snaps-sdk>fast-xml-parser": { - "globals": { - "entityName": true, - "val": true - }, - "packages": { - "@metamask/snaps-sdk>fast-xml-parser>strnum": true - } - }, "@metamask/snaps-utils": { "globals": { "File": true, @@ -2707,13 +2770,14 @@ "fetch": true }, "packages": { - "@metamask/permission-controller": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/snaps-sdk": true, "@metamask/snaps-sdk>@metamask/key-tree": true, + "@metamask/snaps-utils>@metamask/permission-controller": true, "@metamask/snaps-utils>@metamask/slip44": true, "@metamask/snaps-utils>cron-parser": true, "@metamask/snaps-utils>fast-json-stable-stringify": true, + "@metamask/snaps-utils>fast-xml-parser": true, "@metamask/snaps-utils>marked": true, "@metamask/snaps-utils>rfdc": true, "@metamask/snaps-utils>validate-npm-package-name": true, @@ -2725,6 +2789,59 @@ "superstruct": true } }, + "@metamask/snaps-utils>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-utils>@metamask/base-controller": true, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils": true, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/json-rpc-engine": true, + "@metamask/snaps-utils>@metamask/permission-controller>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/snaps-utils>@metamask/snaps-registry": { "packages": { "@metamask/message-signing-snap>@noble/curves": true, @@ -2739,6 +2856,15 @@ "luxon": true } }, + "@metamask/snaps-utils>fast-xml-parser": { + "globals": { + "entityName": true, + "val": true + }, + "packages": { + "@metamask/snaps-utils>fast-xml-parser>strnum": true + } + }, "@metamask/snaps-utils>marked": { "globals": { "console.error": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 707f51758f20..892524d9742a 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -2044,9 +2044,9 @@ "@metamask/network-controller>@metamask/controller-utils": true, "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, "@metamask/network-controller>@metamask/eth-json-rpc-provider": true, + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/network-controller>@metamask/swappable-obj-proxy": true, "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true, "browserify>assert": true, "uuid": true @@ -2105,8 +2105,15 @@ }, "@metamask/network-controller>@metamask/eth-json-rpc-provider": { "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, + "@metamask/safe-event-emitter": true + } + }, + "@metamask/network-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true + "@metamask/utils": true } }, "@metamask/notification-controller": { @@ -2166,11 +2173,11 @@ "console.error": true }, "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/permission-controller>@metamask/base-controller": true, "@metamask/permission-controller>@metamask/controller-utils": true, "@metamask/permission-controller>nanoid": true, "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true, "deep-freeze-strict": true, "immer": true @@ -2226,8 +2233,8 @@ "fetch": true }, "packages": { + "@metamask/controller-utils": true, "@metamask/phishing-controller>@metamask/base-controller": true, - "@metamask/phishing-controller>@metamask/controller-utils": true, "@metamask/phishing-warning>eth-phishing-detect": true, "punycode": true } @@ -2240,24 +2247,6 @@ "immer": true } }, - "@metamask/phishing-controller>@metamask/controller-utils": { - "globals": { - "URL": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx>@ethereumjs/util": true, - "@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, "@metamask/phishing-warning>eth-phishing-detect": { "packages": { "eslint>optionator>fast-levenshtein": true @@ -2366,10 +2355,10 @@ }, "@metamask/queued-request-controller": { "packages": { + "@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/queued-request-controller>@metamask/base-controller": true, "@metamask/selected-network-controller": true, - "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/utils": true } }, @@ -2819,8 +2808,6 @@ "globals": { "DecompressionStream": true, "URL": true, - "chrome.offscreen.createDocument": true, - "chrome.offscreen.hasDocument": true, "clearTimeout": true, "document.getElementById": true, "fetch.bind": true, @@ -2828,12 +2815,12 @@ }, "packages": { "@metamask/object-multiplex": true, - "@metamask/permission-controller": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/snaps-controllers>@metamask/base-controller": true, "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": true, + "@metamask/snaps-controllers>@metamask/permission-controller": true, "@metamask/snaps-controllers>@xstate/fsm": true, "@metamask/snaps-controllers>concat-stream": true, "@metamask/snaps-controllers>get-npm-tarball-url": true, @@ -2880,6 +2867,39 @@ "readable-stream": true } }, + "@metamask/snaps-controllers>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-controllers>@metamask/base-controller": true, + "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, + "@metamask/snaps-controllers>@metamask/phishing-controller>@metamask/controller-utils": true, + "@metamask/snaps-controllers>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-controllers>@metamask/phishing-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, "@metamask/snaps-controllers>concat-stream": { "packages": { "browserify>buffer": true, @@ -2937,8 +2957,8 @@ }, "@metamask/snaps-rpc-methods": { "packages": { - "@metamask/permission-controller": true, "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller": true, "@metamask/snaps-sdk": true, "@metamask/snaps-sdk>@metamask/key-tree": true, "@metamask/snaps-utils": true, @@ -2947,13 +2967,65 @@ "superstruct": true } }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/base-controller": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/controller-utils": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/json-rpc-engine": true, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/snaps-rpc-methods>@metamask/permission-controller>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/snaps-sdk": { "globals": { "fetch": true }, "packages": { "@metamask/providers>@metamask/rpc-errors": true, - "@metamask/snaps-sdk>fast-xml-parser": true, "@metamask/utils": true, "superstruct": true } @@ -2967,15 +3039,6 @@ "@noble/hashes": true } }, - "@metamask/snaps-sdk>fast-xml-parser": { - "globals": { - "entityName": true, - "val": true - }, - "packages": { - "@metamask/snaps-sdk>fast-xml-parser>strnum": true - } - }, "@metamask/snaps-utils": { "globals": { "File": true, @@ -2992,13 +3055,14 @@ "fetch": true }, "packages": { - "@metamask/permission-controller": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/snaps-sdk": true, "@metamask/snaps-sdk>@metamask/key-tree": true, + "@metamask/snaps-utils>@metamask/permission-controller": true, "@metamask/snaps-utils>@metamask/slip44": true, "@metamask/snaps-utils>cron-parser": true, "@metamask/snaps-utils>fast-json-stable-stringify": true, + "@metamask/snaps-utils>fast-xml-parser": true, "@metamask/snaps-utils>marked": true, "@metamask/snaps-utils>rfdc": true, "@metamask/snaps-utils>validate-npm-package-name": true, @@ -3010,6 +3074,59 @@ "superstruct": true } }, + "@metamask/snaps-utils>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller": { + "globals": { + "console.error": true + }, + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/snaps-utils>@metamask/base-controller": true, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils": true, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/json-rpc-engine": true, + "@metamask/snaps-utils>@metamask/permission-controller>nanoid": true, + "@metamask/utils": true, + "deep-freeze-strict": true, + "immer": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils": { + "globals": { + "URL": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/controller-utils>@spruceid/siwe-parser": true, + "@metamask/ethjs>@metamask/ethjs-unit": true, + "@metamask/utils": true, + "bn.js": true, + "browserify>buffer": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/snaps-utils>@metamask/permission-controller>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/snaps-utils>@metamask/snaps-registry": { "packages": { "@metamask/message-signing-snap>@noble/curves": true, @@ -3024,6 +3141,15 @@ "luxon": true } }, + "@metamask/snaps-utils>fast-xml-parser": { + "globals": { + "entityName": true, + "val": true + }, + "packages": { + "@metamask/snaps-utils>fast-xml-parser>strnum": true + } + }, "@metamask/snaps-utils>marked": { "globals": { "console.error": true, diff --git a/package.json b/package.json index fee996b1730c..ef57199fa40f 100644 --- a/package.json +++ b/package.json @@ -222,7 +222,7 @@ "semver@7.3.8": "^7.5.4", "@trezor/schema-utils@npm:1.0.2": "patch:@trezor/schema-utils@npm%3A1.0.2#~/.yarn/patches/@trezor-schema-utils-npm-1.0.2-7dd48689b2.patch", "lavamoat-core@npm:^15.1.1": "patch:lavamoat-core@npm%3A15.1.1#~/.yarn/patches/lavamoat-core-npm-15.1.1-51fbe39988.patch", - "@metamask/snaps-sdk": "^4.4.2", + "@metamask/snaps-sdk": "^5.0.0", "@metamask/transaction-controller": "^32.0.0", "@babel/runtime@npm:^7.7.6": "patch:@babel/runtime@npm%3A7.24.0#~/.yarn/patches/@babel-runtime-npm-7.24.0-7eb1dd11a2.patch", "@babel/runtime@npm:^7.9.2": "patch:@babel/runtime@npm%3A7.24.0#~/.yarn/patches/@babel-runtime-npm-7.24.0-7eb1dd11a2.patch", @@ -335,11 +335,11 @@ "@metamask/selected-network-controller": "^13.0.0", "@metamask/signature-controller": "^14.0.1", "@metamask/smart-transactions-controller": "^10.1.2", - "@metamask/snaps-controllers": "^8.4.0", - "@metamask/snaps-execution-environments": "^6.3.0", - "@metamask/snaps-rpc-methods": "^9.1.2", - "@metamask/snaps-sdk": "^4.4.2", - "@metamask/snaps-utils": "^7.5.0", + "@metamask/snaps-controllers": "^9.0.0", + "@metamask/snaps-execution-environments": "^6.4.0", + "@metamask/snaps-rpc-methods": "^9.1.3", + "@metamask/snaps-sdk": "^5.0.0", + "@metamask/snaps-utils": "^7.6.0", "@metamask/transaction-controller": "^32.0.0", "@metamask/user-operation-controller": "^10.0.0", "@metamask/utils": "^8.2.1", diff --git a/test/e2e/snaps/enums.js b/test/e2e/snaps/enums.js index 5732b1b7f335..daeaf9db924f 100644 --- a/test/e2e/snaps/enums.js +++ b/test/e2e/snaps/enums.js @@ -1,3 +1,3 @@ module.exports = { - TEST_SNAPS_WEBSITE_URL: 'https://metamask.github.io/snaps/test-snaps/2.6.1/', + TEST_SNAPS_WEBSITE_URL: 'https://metamask.github.io/snaps/test-snaps/2.9.0/', }; diff --git a/ui/components/app/snaps/snap-ui-renderer/components/row.ts b/ui/components/app/snaps/snap-ui-renderer/components/row.ts index 153da8fc8148..b57425250c7a 100644 --- a/ui/components/app/snaps/snap-ui-renderer/components/row.ts +++ b/ui/components/app/snaps/snap-ui-renderer/components/row.ts @@ -9,6 +9,7 @@ export const row: UIComponentFactory = ({ element, ...params }) => ({ props: { label: element.props.label, variant: element.props.variant, + tooltip: element.props.tooltip, style: { // We do this to cause an overhang with certain confirmation row variants marginLeft: '-8px', diff --git a/yarn.lock b/yarn.lock index 8004288ae8a9..af571c3016fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5482,6 +5482,17 @@ __metadata: languageName: node linkType: hard +"@metamask/json-rpc-engine@npm:^9.0.0": + version: 9.0.0 + resolution: "@metamask/json-rpc-engine@npm:9.0.0" + dependencies: + "@metamask/rpc-errors": "npm:^6.2.1" + "@metamask/safe-event-emitter": "npm:^3.0.0" + "@metamask/utils": "npm:^8.3.0" + checksum: 10/9ddde2ca81e3b3a70e0cc752b5e22e436723cafa1948cbb45d63a42796a1260ff0f9356ebda0d375d9aae81232e77e487a8d0e1273aed3aa83ca0fe3e2f2763f + languageName: node + linkType: hard + "@metamask/json-rpc-middleware-stream@npm:^7.0.1": version: 7.0.1 resolution: "@metamask/json-rpc-middleware-stream@npm:7.0.1" @@ -5494,6 +5505,18 @@ __metadata: languageName: node linkType: hard +"@metamask/json-rpc-middleware-stream@npm:^8.0.0": + version: 8.0.0 + resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.0" + dependencies: + "@metamask/json-rpc-engine": "npm:^9.0.0" + "@metamask/safe-event-emitter": "npm:^3.0.0" + "@metamask/utils": "npm:^8.3.0" + readable-stream: "npm:^3.6.2" + checksum: 10/0b32021714032093311f72ede6671d14eb4faf39a379ce12ea98b4621f24e0e41332bca966329f308159eb5884c8d376297c45bbe8ea9c0b7b09f7ce0810bef9 + languageName: node + linkType: hard + "@metamask/key-tree@npm:^9.1.1": version: 9.1.1 resolution: "@metamask/key-tree@npm:9.1.1" @@ -5827,6 +5850,25 @@ __metadata: languageName: node linkType: hard +"@metamask/permission-controller@npm:^10.0.0": + version: 10.0.0 + resolution: "@metamask/permission-controller@npm:10.0.0" + dependencies: + "@metamask/base-controller": "npm:^6.0.0" + "@metamask/controller-utils": "npm:^11.0.0" + "@metamask/json-rpc-engine": "npm:^9.0.0" + "@metamask/rpc-errors": "npm:^6.2.1" + "@metamask/utils": "npm:^8.3.0" + "@types/deep-freeze-strict": "npm:^1.1.0" + deep-freeze-strict: "npm:^1.1.1" + immer: "npm:^9.0.6" + nanoid: "npm:^3.1.31" + peerDependencies: + "@metamask/approval-controller": ^7.0.0 + checksum: 10/0c72e205be760fc471b2a6892a9ad52d5c6a40b4cf1757464e992a5ada2dec57efbb24b09351ce8c29990b59f1d731cd2b338caaef37ce7690ea2d1919afe061 + languageName: node + linkType: hard + "@metamask/permission-controller@npm:^9.0.1, @metamask/permission-controller@npm:^9.0.2": version: 9.0.2 resolution: "@metamask/permission-controller@npm:9.0.2" @@ -5857,16 +5899,29 @@ __metadata: languageName: node linkType: hard +"@metamask/phishing-controller@npm:^10.0.0": + version: 10.0.0 + resolution: "@metamask/phishing-controller@npm:10.0.0" + dependencies: + "@metamask/base-controller": "npm:^6.0.0" + "@metamask/controller-utils": "npm:^11.0.0" + "@types/punycode": "npm:^2.1.0" + eth-phishing-detect: "npm:^1.2.0" + punycode: "npm:^2.1.1" + checksum: 10/aef6fbd540f4b3c04400166aef16a7dadaee8414879269b3148cc965c803f29402115fa64de9e5e059baad6afdd5cdc749c02c964cda685642bb84d12a7aace1 + languageName: node + linkType: hard + "@metamask/phishing-controller@npm:^9.0.1, @metamask/phishing-controller@npm:^9.0.3": - version: 9.0.3 - resolution: "@metamask/phishing-controller@npm:9.0.3" + version: 9.0.4 + resolution: "@metamask/phishing-controller@npm:9.0.4" dependencies: "@metamask/base-controller": "npm:^5.0.2" - "@metamask/controller-utils": "npm:^9.1.0" + "@metamask/controller-utils": "npm:^10.0.0" "@types/punycode": "npm:^2.1.0" eth-phishing-detect: "npm:^1.2.0" punycode: "npm:^2.1.1" - checksum: 10/effc72b2fa136e8d0c2dfd2bef45ade7ae07ac5fa6ac79b3b3de988cb2cbf29b3069ea1297f6297a62cfe73e281dec6a8e948ba4fe644a7e924202b17289d384 + checksum: 10/e68258c3dfedd7a60a040f8b58577ee98cc4566a3893a047b7b620edd72e98c8f2f75056332457b9773932c3ae8cbc7c66bbe0792e07de31dff895a9b77d081b languageName: node linkType: hard @@ -6139,7 +6194,7 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-controllers@npm:^8.1.1, @metamask/snaps-controllers@npm:^8.4.0": +"@metamask/snaps-controllers@npm:^8.1.1": version: 8.4.0 resolution: "@metamask/snaps-controllers@npm:8.4.0" dependencies: @@ -6176,22 +6231,59 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-execution-environments@npm:^6.3.0": - version: 6.3.0 - resolution: "@metamask/snaps-execution-environments@npm:6.3.0" +"@metamask/snaps-controllers@npm:^9.0.0": + version: 9.0.0 + resolution: "@metamask/snaps-controllers@npm:9.0.0" dependencies: - "@metamask/json-rpc-engine": "npm:^8.0.1" + "@metamask/approval-controller": "npm:^7.0.0" + "@metamask/base-controller": "npm:^6.0.0" + "@metamask/json-rpc-engine": "npm:^9.0.0" + "@metamask/json-rpc-middleware-stream": "npm:^8.0.0" + "@metamask/object-multiplex": "npm:^2.0.0" + "@metamask/permission-controller": "npm:^10.0.0" + "@metamask/phishing-controller": "npm:^10.0.0" + "@metamask/post-message-stream": "npm:^8.1.0" + "@metamask/rpc-errors": "npm:^6.2.1" + "@metamask/snaps-registry": "npm:^3.1.0" + "@metamask/snaps-rpc-methods": "npm:^9.1.3" + "@metamask/snaps-sdk": "npm:^5.0.0" + "@metamask/snaps-utils": "npm:^7.6.0" + "@metamask/utils": "npm:^8.3.0" + "@xstate/fsm": "npm:^2.0.0" + browserify-zlib: "npm:^0.2.0" + concat-stream: "npm:^2.0.0" + fast-deep-equal: "npm:^3.1.3" + get-npm-tarball-url: "npm:^2.0.3" + immer: "npm:^9.0.6" + nanoid: "npm:^3.1.31" + readable-stream: "npm:^3.6.2" + readable-web-to-node-stream: "npm:^3.0.2" + tar-stream: "npm:^3.1.7" + peerDependencies: + "@metamask/snaps-execution-environments": ^6.4.0 + peerDependenciesMeta: + "@metamask/snaps-execution-environments": + optional: true + checksum: 10/12e89e622865025e89c0f06f34e9dad278f91b3621e2b9944b154a7f190e5b47d5a899beb65e431627e023ebcd00969c492a280a5051239b57ed24cf5c3347ec + languageName: node + linkType: hard + +"@metamask/snaps-execution-environments@npm:^6.4.0": + version: 6.4.0 + resolution: "@metamask/snaps-execution-environments@npm:6.4.0" + dependencies: + "@metamask/json-rpc-engine": "npm:^9.0.0" "@metamask/object-multiplex": "npm:^2.0.0" "@metamask/post-message-stream": "npm:^8.1.0" "@metamask/providers": "npm:^17.0.0" "@metamask/rpc-errors": "npm:^6.2.1" - "@metamask/snaps-sdk": "npm:^4.4.0" - "@metamask/snaps-utils": "npm:^7.4.0" + "@metamask/snaps-sdk": "npm:^5.0.0" + "@metamask/snaps-utils": "npm:^7.6.0" "@metamask/utils": "npm:^8.3.0" nanoid: "npm:^3.1.31" readable-stream: "npm:^3.6.2" superstruct: "npm:^1.0.3" - checksum: 10/9ee030a5b8134cc4a4dad533e23e09a5008f66b3b87b05f74b6e1c2988dd3e1c9c9f961e0e549867034b20270edbddc1e9f6dcb99d8c2424e3f227e3e869056a + checksum: 10/ef487a7b8e2b1aa46c214d06e14d482a741abdc75f5904ff61f38b019cd253422cd5ae95fba7263b0fab57256eb081a3c44eeafcdff8ad71d5bf9163d65fd5dc languageName: node linkType: hard @@ -6207,49 +6299,48 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-rpc-methods@npm:^9.1.2": - version: 9.1.2 - resolution: "@metamask/snaps-rpc-methods@npm:9.1.2" +"@metamask/snaps-rpc-methods@npm:^9.1.2, @metamask/snaps-rpc-methods@npm:^9.1.3": + version: 9.1.3 + resolution: "@metamask/snaps-rpc-methods@npm:9.1.3" dependencies: "@metamask/key-tree": "npm:^9.1.1" - "@metamask/permission-controller": "npm:^9.0.2" + "@metamask/permission-controller": "npm:^10.0.0" "@metamask/rpc-errors": "npm:^6.2.1" - "@metamask/snaps-sdk": "npm:^4.4.1" - "@metamask/snaps-utils": "npm:^7.4.1" + "@metamask/snaps-sdk": "npm:^5.0.0" + "@metamask/snaps-utils": "npm:^7.6.0" "@metamask/utils": "npm:^8.3.0" "@noble/hashes": "npm:^1.3.1" superstruct: "npm:^1.0.3" - checksum: 10/c24bcf81c4a53dc600ba63bddbaf4b307ac53517081a47417970ccc5e50e5ef385228ec1a18df7f24151e438040a20e7a3dd982d683720a4143ccbedc67ad057 + checksum: 10/d346f12fb170dac694b4b5d1580fe9bc212cd266cece063636be85c442be0a7d0fa98e1d93d999da3dc67a9b5ce49c5a67e5345567b97062dd94e7d10c4e2959 languageName: node linkType: hard -"@metamask/snaps-sdk@npm:^4.4.2": - version: 4.4.2 - resolution: "@metamask/snaps-sdk@npm:4.4.2" +"@metamask/snaps-sdk@npm:^5.0.0": + version: 5.0.0 + resolution: "@metamask/snaps-sdk@npm:5.0.0" dependencies: "@metamask/key-tree": "npm:^9.1.1" "@metamask/providers": "npm:^17.0.0" "@metamask/rpc-errors": "npm:^6.2.1" "@metamask/utils": "npm:^8.3.0" - fast-xml-parser: "npm:^4.3.4" superstruct: "npm:^1.0.3" - checksum: 10/32be48679eb306ec97c2ee16b4146ce69875e665feb61c04f7e63a23361c445b49ad4a0c8f6176560e7973b09c56e5a26055ba7cd894d67111c8c3cedf90dc4f + checksum: 10/2419edb193c32fbd7292ebddbe37e9af6b09dc175fa03b74e9b732b859cdd1b6ddd5d18d19dcf0d550fdcfdb6210ec89168e020c382d3cf41178f51e0e1e888c languageName: node linkType: hard -"@metamask/snaps-utils@npm:^7.1.0, @metamask/snaps-utils@npm:^7.4.0, @metamask/snaps-utils@npm:^7.4.1, @metamask/snaps-utils@npm:^7.5.0": - version: 7.5.0 - resolution: "@metamask/snaps-utils@npm:7.5.0" +"@metamask/snaps-utils@npm:^7.1.0, @metamask/snaps-utils@npm:^7.4.0, @metamask/snaps-utils@npm:^7.5.0, @metamask/snaps-utils@npm:^7.6.0": + version: 7.6.0 + resolution: "@metamask/snaps-utils@npm:7.6.0" dependencies: "@babel/core": "npm:^7.23.2" "@babel/types": "npm:^7.23.0" - "@metamask/base-controller": "npm:^5.0.2" + "@metamask/base-controller": "npm:^6.0.0" "@metamask/key-tree": "npm:^9.1.1" - "@metamask/permission-controller": "npm:^9.0.2" + "@metamask/permission-controller": "npm:^10.0.0" "@metamask/rpc-errors": "npm:^6.2.1" "@metamask/slip44": "npm:^3.1.0" "@metamask/snaps-registry": "npm:^3.1.0" - "@metamask/snaps-sdk": "npm:^4.4.2" + "@metamask/snaps-sdk": "npm:^5.0.0" "@metamask/utils": "npm:^8.3.0" "@noble/hashes": "npm:^1.3.1" "@scure/base": "npm:^1.1.1" @@ -6257,13 +6348,14 @@ __metadata: cron-parser: "npm:^4.5.0" fast-deep-equal: "npm:^3.1.3" fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.3.4" marked: "npm:^12.0.1" rfdc: "npm:^1.3.0" semver: "npm:^7.5.4" ses: "npm:^1.1.0" superstruct: "npm:^1.0.3" validate-npm-package-name: "npm:^5.0.0" - checksum: 10/34e22ee984d99f692db7d0f3fdb6426ba5ea31f3d83b9dfd65f074eb5e52d916f675cf631430bc4c5e369b85052e08ccc04f0f84bbfca1c07ccab3e35a7e4fe7 + checksum: 10/e81e0185ab1678822b47e400c4422023449be1641bea7ce3d679386257545091ecc73c9a4626c0ed585d93d9fe3a1354dc8e4b8310c27c33871f7fb0bb029506 languageName: node linkType: hard @@ -24986,11 +25078,11 @@ __metadata: "@metamask/selected-network-controller": "npm:^13.0.0" "@metamask/signature-controller": "npm:^14.0.1" "@metamask/smart-transactions-controller": "npm:^10.1.2" - "@metamask/snaps-controllers": "npm:^8.4.0" - "@metamask/snaps-execution-environments": "npm:^6.3.0" - "@metamask/snaps-rpc-methods": "npm:^9.1.2" - "@metamask/snaps-sdk": "npm:^4.4.2" - "@metamask/snaps-utils": "npm:^7.5.0" + "@metamask/snaps-controllers": "npm:^9.0.0" + "@metamask/snaps-execution-environments": "npm:^6.4.0" + "@metamask/snaps-rpc-methods": "npm:^9.1.3" + "@metamask/snaps-sdk": "npm:^5.0.0" + "@metamask/snaps-utils": "npm:^7.6.0" "@metamask/test-bundler": "npm:^1.0.0" "@metamask/test-dapp": "npm:^8.4.0" "@metamask/transaction-controller": "npm:^32.0.0" From 9efed04b7543044c25f305f3704ba529932795ce Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 18 Jun 2024 15:43:42 +0200 Subject: [PATCH 052/236] fix: Improve stability of initial state sync in Snaps UI (#25375) ## **Description** Improves stability of initial state sync when using Snaps UI. Previously, sometimes, the `initialState` in the `SnapInterfaceContext` wouldn't be updated when the content of the interface changed and thus initial values would be missing. This PR changes the implementation to use one selector in the renderer, which only changes when the content does, but passes the `initialState` and `context` to the `SnapInterfaceContext` itself. This way we are guaranteed for the content and state to stay in sync. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25375?quickstart=1) Can be tested with a Snap like: ```ts export const onRpcRequest: OnRpcRequestHandler = async ({ origin, request, }) => { switch (request.method) { case 'hello': { const id = await snap.request({ method: 'snap_createInterface', params: { ui: ( foo ), context: { foo: 'bar' }, }, }); return snap.request({ method: 'snap_dialog', params: { type: 'confirmation', id, }, }); } default: throw new Error('Method not found.'); } }; export const onUserInput: OnUserInputHandler = async ({ id, event, context, }) => { if (event.type === 'ButtonClickEvent') { await snap.request({ method: 'snap_updateInterface', params: { id, ui: ( Settings
), }, }); return; } }; ``` --- .../snap-ui-renderer/snap-ui-renderer.js | 23 +++++++++++++------ ui/contexts/snaps/snap-interface.tsx | 16 ++++++------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js b/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js index 4b5f19e0a014..6a812917306b 100644 --- a/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js +++ b/ui/components/app/snaps/snap-ui-renderer/snap-ui-renderer.js @@ -5,10 +5,7 @@ import { useSelector } from 'react-redux'; import { isEqual } from 'lodash'; import MetaMaskTemplateRenderer from '../../metamask-template-renderer/metamask-template-renderer'; import { SnapDelineator } from '../snap-delineator'; -import { - getSnapMetadata, - getMemoizedInterfaceContent, -} from '../../../../selectors'; +import { getSnapMetadata, getMemoizedInterface } from '../../../../selectors'; import { Box, FormTextField } from '../../../component-library'; import { DelineatorType } from '../../../../helpers/constants/snaps'; @@ -35,10 +32,15 @@ const SnapUIRendererComponent = ({ getSnapMetadata(state, snapId), ); - const content = useSelector((state) => - getMemoizedInterfaceContent(state, interfaceId), + const interfaceState = useSelector( + (state) => getMemoizedInterface(state, interfaceId), + // We only want to update the state if the content has changed. + // We do this to avoid useless re-renders. + (oldState, newState) => isEqual(oldState.content, newState.content), ); + const content = interfaceState?.content; + // sections are memoized to avoid useless re-renders if one of the parents element re-renders. const sections = useMemo( () => @@ -64,6 +66,8 @@ const SnapUIRendererComponent = ({ ); } + const { state: initialState, context } = interfaceState; + return ( - + {isPrompt && ( diff --git a/ui/contexts/snaps/snap-interface.tsx b/ui/contexts/snaps/snap-interface.tsx index 194128af4ebe..1943e35a2745 100644 --- a/ui/contexts/snaps/snap-interface.tsx +++ b/ui/contexts/snaps/snap-interface.tsx @@ -3,6 +3,7 @@ import { InterfaceState, UserInputEventType, } from '@metamask/snaps-sdk'; +import { Json } from '@metamask/utils'; import { debounce, throttle } from 'lodash'; import React, { FunctionComponent, @@ -11,8 +12,7 @@ import React, { useEffect, useRef, } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; -import { getMemoizedInterface } from '../../selectors'; +import { useDispatch } from 'react-redux'; import { handleSnapRequest, updateInterfaceState, @@ -47,6 +47,8 @@ export const SnapInterfaceContext = export type SnapInterfaceContextProviderProps = { interfaceId: string; snapId: string; + initialState: Record | unknown>; + context: Json; }; // We want button clicks to be instant and therefore use throttling @@ -64,18 +66,14 @@ const THROTTLED_EVENTS = [ * @param params.children - The childrens to wrap with the context provider. * @param params.interfaceId - The interface ID to use. * @param params.snapId - The Snap ID that requested the interface. + * @param params.initialState - The initial state of the interface. + * @param params.context - The context blob of the interface. * @returns The context provider. */ export const SnapInterfaceContextProvider: FunctionComponent< SnapInterfaceContextProviderProps -> = ({ children, interfaceId, snapId }) => { +> = ({ children, interfaceId, snapId, initialState, context }) => { const dispatch = useDispatch(); - const { state: initialState, context } = useSelector( - (state) => getMemoizedInterface(state, interfaceId), - // Prevents the selector update. - // We do this to avoid useless re-renders. - () => true, - ); // We keep an internal copy of the state to speed-up the state update in the UI. // It's kept in a ref to avoid useless re-rendering of the entire tree of components. From d49478d019d95deaad2922d8ae1cc67f7ae3fc23 Mon Sep 17 00:00:00 2001 From: Daniel <80175477+dan437@users.noreply.github.com> Date: Wed, 19 Jun 2024 18:30:25 +0200 Subject: [PATCH 053/236] Cherry pick: fix: Disable Smart Transactions for the new Send&Swap feature (#25422) --- app/scripts/lib/transaction/smart-transactions.test.ts | 7 +++++++ app/scripts/lib/transaction/smart-transactions.ts | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/scripts/lib/transaction/smart-transactions.test.ts b/app/scripts/lib/transaction/smart-transactions.test.ts index 507ab83ecdf2..04c029c3ef8b 100644 --- a/app/scripts/lib/transaction/smart-transactions.test.ts +++ b/app/scripts/lib/transaction/smart-transactions.test.ts @@ -134,6 +134,13 @@ describe('submitSmartTransactionHook', () => { expect(result).toEqual({ transactionHash: undefined }); }); + it('falls back to regular transaction submit if the transaction type is "swapAndSend"', async () => { + const request: SubmitSmartTransactionRequestMocked = createRequest(); + request.transactionMeta.type = TransactionType.swapAndSend; + const result = await submitSmartTransactionHook(request); + expect(result).toEqual({ transactionHash: undefined }); + }); + it('falls back to regular transaction submit if /getFees throws an error', async () => { const request: SubmitSmartTransactionRequestMocked = createRequest(); jest diff --git a/app/scripts/lib/transaction/smart-transactions.ts b/app/scripts/lib/transaction/smart-transactions.ts index 38f57f597947..97e37965d6ea 100644 --- a/app/scripts/lib/transaction/smart-transactions.ts +++ b/app/scripts/lib/transaction/smart-transactions.ts @@ -10,6 +10,7 @@ import { TransactionController, TransactionMeta, TransactionParams, + TransactionType, } from '@metamask/transaction-controller'; import log from 'loglevel'; import { @@ -120,9 +121,15 @@ class SmartTransactionHook { } async submit() { + const isUnsupportedTransactionTypeForSmartTransaction = + this.#transactionMeta?.type === TransactionType.swapAndSend; + // Will cause TransactionController to publish to the RPC provider as normal. const useRegularTransactionSubmit = { transactionHash: undefined }; - if (!this.#isSmartTransaction) { + if ( + !this.#isSmartTransaction || + isUnsupportedTransactionTypeForSmartTransaction + ) { return useRegularTransactionSubmit; } const { id: approvalFlowId } = await this.#controllerMessenger.call( From c3a4a3d13fae6471370fa5507ff69be7bf451195 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Wed, 19 Jun 2024 17:27:13 -0230 Subject: [PATCH 054/236] Update blockaid unit tests for v12 --- .../__snapshots__/blockaid-banner-alert.test.js.snap | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/pages/confirmations/components/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap b/ui/pages/confirmations/components/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap index 4111226eea01..50b8d01883c8 100644 --- a/ui/pages/confirmations/components/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap +++ b/ui/pages/confirmations/components/security-provider-banner-alert/blockaid-banner-alert/__snapshots__/blockaid-banner-alert.test.js.snap @@ -54,7 +54,7 @@ exports[`Blockaid Banner Alert should render 'danger' UI when securityAlertRespo Something doesn't look right? @@ -151,7 +151,7 @@ exports[`Blockaid Banner Alert should render 'warning' UI when securityAlertResp Something doesn't look right? @@ -248,7 +248,7 @@ exports[`Blockaid Banner Alert should render 'warning' UI when securityAlertResp Something doesn't look right? @@ -346,7 +346,7 @@ exports[`Blockaid Banner Alert should render details section even when features Something doesn't look right? @@ -457,7 +457,7 @@ exports[`Blockaid Banner Alert should render details when provided 1`] = ` Something doesn't look right? @@ -556,7 +556,7 @@ exports[`Blockaid Banner Alert should render link to report url 1`] = ` Something doesn't look right? From fc9bcff969686091e5de605677bd453d9e8ae233 Mon Sep 17 00:00:00 2001 From: Prithpal Sooriya Date: Tue, 18 Jun 2024 20:44:06 +0100 Subject: [PATCH 055/236] fix: Fix unit and e2e tests that were expected the date based privacy policy components to not be shown (#25390) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixture / mock data in unit and e2e tests have been modified to handle the privacy policy toast. These tests previously assumed that the privacy policy toast, and in one case the updated metametrics component during onboarding, would not be shown. However, their display was date dependent. With this PR, the updated test data takes these dates into account, and tests should now pass. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25390?quickstart=1) Fixes: failing tests on develop e2e and unit tests should pass - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Dan Miller --- test/e2e/default-fixture.js | 2 + ...rs-after-init-opt-in-background-state.json | 4 +- .../errors-after-init-opt-in-ui-state.json | 4 +- ...s-before-init-opt-in-background-state.json | 2 + .../errors-before-init-opt-in-ui-state.json | 2 + .../__snapshots__/metametrics.test.js.snap | 85 +++++++--------- .../onboarding-flow/onboarding-flow.test.js | 4 +- ui/pages/routes/routes.component.test.js | 13 ++- .../__snapshots__/security-tab.test.js.snap | 98 +++++++++---------- 9 files changed, 104 insertions(+), 110 deletions(-) diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js index d6d84c154772..96b28c6896d1 100644 --- a/test/e2e/default-fixture.js +++ b/test/e2e/default-fixture.js @@ -107,6 +107,8 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { '__FIXTURE_SUBSTITUTION__currentDateInMilliseconds', showTestnetMessageInDropdown: true, trezorModel: null, + newPrivacyPolicyToastClickedOrClosed: true, + newPrivacyPolicyToastShownDate: Date.now(), usedNetworks: { [CHAIN_IDS.MAINNET]: true, [CHAIN_IDS.LINEA_MAINNET]: true, diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json index 69e354480f37..0e02c3ddf794 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json @@ -39,6 +39,8 @@ "showAccountBanner": true, "trezorModel": null, "onboardingDate": "object", + "newPrivacyPolicyToastClickedOrClosed": "boolean", + "newPrivacyPolicyToastShownDate": "number", "hadAdvancedGasFeesSetPriorToMigration92_3": false, "nftsDropdownState": {}, "termsOfUseLastAgreed": "number", @@ -46,8 +48,6 @@ "usedNetworks": { "0x1": true, "0x5": true, "0x539": true }, "snapsInstallPrivacyWarningShown": true, "surveyLinkLastClickedOrClosed": "object", - "newPrivacyPolicyToastClickedOrClosed": "object", - "newPrivacyPolicyToastShownDate": "object", "signatureSecurityAlertResponses": "object", "switchedNetworkDetails": "object", "switchedNetworkNeverShowMessage": "boolean", diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json index 0772ce4d7c23..f00c2b601230 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json @@ -76,6 +76,8 @@ "showAccountBanner": true, "trezorModel": null, "onboardingDate": "object", + "newPrivacyPolicyToastClickedOrClosed": "boolean", + "newPrivacyPolicyToastShownDate": "number", "hadAdvancedGasFeesSetPriorToMigration92_3": false, "nftsDropdownState": {}, "termsOfUseLastAgreed": "number", @@ -83,8 +85,6 @@ "usedNetworks": { "0x1": true, "0x5": true, "0x539": true }, "snapsInstallPrivacyWarningShown": true, "surveyLinkLastClickedOrClosed": "object", - "newPrivacyPolicyToastClickedOrClosed": "object", - "newPrivacyPolicyToastShownDate": "object", "signatureSecurityAlertResponses": "object", "switchedNetworkDetails": "object", "switchedNetworkNeverShowMessage": "boolean", diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json index 60379a1d0811..dd90d1071776 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json @@ -46,6 +46,8 @@ "0x5": true, "0x539": true }, + "newPrivacyPolicyToastClickedOrClosed": "boolean", + "newPrivacyPolicyToastShownDate": "number", "snapsInstallPrivacyWarningShown": true }, "CurrencyController": { diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json index 48392c6b4db3..fc4bb1d65eed 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json @@ -46,6 +46,8 @@ "0x5": true, "0x539": true }, + "newPrivacyPolicyToastClickedOrClosed": "boolean", + "newPrivacyPolicyToastShownDate": "number", "snapsInstallPrivacyWarningShown": true }, "CurrencyController": { diff --git a/ui/pages/onboarding-flow/metametrics/__snapshots__/metametrics.test.js.snap b/ui/pages/onboarding-flow/metametrics/__snapshots__/metametrics.test.js.snap index f669f81f59d7..c68e7759e419 100644 --- a/ui/pages/onboarding-flow/metametrics/__snapshots__/metametrics.test.js.snap +++ b/ui/pages/onboarding-flow/metametrics/__snapshots__/metametrics.test.js.snap @@ -4,7 +4,7 @@ exports[`Onboarding Metametrics Component should match snapshot 1`] = `

- MetaMask would like to gather usage data to better understand how our users interact with MetaMask. This data will be used to provide the service, which includes improving the service based on your use. + We’d like to gather basic usage and diagnostics data to improve MetaMask. Know that we never sell the data you provide here.

- MetaMask will... + When we gather metrics, it will always be...

    -
  • - - Always allow you to opt-out via Settings -
  • -
  • - - Send anonymized click and pageview events -
  • @@ -50,9 +36,9 @@ exports[`Onboarding Metametrics Component should match snapshot 1`] = ` - Never + Private: - collect information we don’t need to provide the service (such as keys, addresses, transaction hashes, or balances) + clicks and views on the app are stored, but other details (like your public address) are not.
    @@ -62,8 +48,8 @@ exports[`Onboarding Metametrics Component should match snapshot 1`] = ` class="box box--flex-direction-row" > @@ -71,9 +57,9 @@ exports[`Onboarding Metametrics Component should match snapshot 1`] = ` - Never + General: - collect your full IP address* + we temporarily use your IP address to detect a general location (like your country or region), but it's never stored.

@@ -83,8 +69,8 @@ exports[`Onboarding Metametrics Component should match snapshot 1`] = ` class="box box--flex-direction-row" > @@ -92,42 +78,47 @@ exports[`Onboarding Metametrics Component should match snapshot 1`] = ` - Never + Optional: - sell data. Ever! + you decide if you want to share or delete your usage data via settings any time.
-
- This data is aggregated and is therefore anonymous for the purposes of General Data Protection Regulation (EU) 2016/679. -
+ + + + + We’ll use this data to learn how you interact with our marketing communications. We may share relevant news (like product features). + +
- * When you use Infura as your default RPC provider in MetaMask, Infura will collect your IP address and your Ethereum wallet address when you send a transaction. We don’t store this information in a way that allows our systems to associate those two pieces of data. For more information on how MetaMask and Infura interact from a data collection perspective, see our update - - here - - . For more information on our privacy practices in general, see our + We’ll let you know if we decide to use this data for other purposes. You can review our - Privacy Policy here + Privacy Policy - . + for more information. Remember, you can go to settings and opt out at any time.
diff --git a/ui/pages/onboarding-flow/onboarding-flow.test.js b/ui/pages/onboarding-flow/onboarding-flow.test.js index cc471f5febd5..a02ba4f9b5ea 100644 --- a/ui/pages/onboarding-flow/onboarding-flow.test.js +++ b/ui/pages/onboarding-flow/onboarding-flow.test.js @@ -244,9 +244,7 @@ describe('Onboarding Flow', () => { ONBOARDING_METAMETRICS, ); - const onboardingMetametrics = queryByTestId( - 'onboarding-legacy-metametrics', - ); + const onboardingMetametrics = queryByTestId('onboarding-metametrics'); expect(onboardingMetametrics).toBeInTheDocument(); }); diff --git a/ui/pages/routes/routes.component.test.js b/ui/pages/routes/routes.component.test.js index 377f6bf98c55..5119ad5c5c42 100644 --- a/ui/pages/routes/routes.component.test.js +++ b/ui/pages/routes/routes.component.test.js @@ -109,6 +109,7 @@ describe('Routes Component', () => { ticker: 'ETH', type: NETWORK_TYPES.MAINNET, }, + newPrivacyPolicyToastShownDate: new Date('0'), }, send: { ...mockSendState.send, @@ -125,7 +126,7 @@ describe('Routes Component', () => { }); describe('toast display', () => { - const testState = { + const getToastDisplayTestState = (date) => ({ ...mockState, metamask: { ...mockState.metamask, @@ -134,17 +135,21 @@ describe('toast display', () => { completedOnboarding: true, usedNetworks: [], swapsState: { swapsFeatureIsLive: true }, + newPrivacyPolicyToastShownDate: date, }, - }; + }); it('renders toastContainer on default route', async () => { - await render([DEFAULT_ROUTE], testState); + await render([DEFAULT_ROUTE], getToastDisplayTestState(new Date('9999'))); const toastContainer = document.querySelector('.toasts-container'); expect(toastContainer).toBeInTheDocument(); }); it('does not render toastContainer on confirmation route', async () => { - await render([CONFIRMATION_V_NEXT_ROUTE], testState); + await render( + [CONFIRMATION_V_NEXT_ROUTE], + getToastDisplayTestState(new Date(0)), + ); const toastContainer = document.querySelector('.toasts-container'); expect(toastContainer).not.toBeInTheDocument(); }); diff --git a/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap b/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap index c6d2258b4fdb..c2ab279a6979 100644 --- a/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap +++ b/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap @@ -1762,77 +1762,71 @@ exports[`Security Tab should match snapshot 1`] = ` class="settings-page__content-padded" >
+ + Participate in MetaMetrics +
- Participate in MetaMetrics - -
Participate in MetaMetrics to help us make MetaMask better -
+
-
+
+