diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 66fb46b027c9..98eed3561a50 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -4866,7 +4866,7 @@ "description": "This message is shown to a user if their swap fails. The $1 will be replaced by support.metamask.io" }, "stxOptInDescription": { - "message": "Turn on Smart Transactions for more reliable and secure transactions, and adjustable fees on ETH Mainnet. $1" + "message": "Turn on Smart Transactions for more reliable and secure transactions on ETH Mainnet. $1" }, "stxPendingPrivatelySubmittingSwap": { "message": "Privately submitting your Swap..." diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 225d2f3c5ef5..4fe538188ba3 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -1,8 +1,9 @@ import EventEmitter from '@metamask/safe-event-emitter'; import ExtensionPlatform from '../platforms/extension'; - -const NOTIFICATION_HEIGHT = 620; -const NOTIFICATION_WIDTH = 360; +import { + NOTIFICATION_HEIGHT, + NOTIFICATION_WIDTH, +} from '../../../shared/constants/notifications'; export const NOTIFICATION_MANAGER_EVENTS = { POPUP_CLOSED: 'onPopupClosed', diff --git a/app/scripts/lib/transaction/smart-transactions.test.ts b/app/scripts/lib/transaction/smart-transactions.test.ts index 35f533f7c882..507ab83ecdf2 100644 --- a/app/scripts/lib/transaction/smart-transactions.test.ts +++ b/app/scripts/lib/transaction/smart-transactions.test.ts @@ -134,6 +134,23 @@ describe('submitSmartTransactionHook', () => { expect(result).toEqual({ transactionHash: undefined }); }); + it('falls back to regular transaction submit if /getFees throws an error', async () => { + const request: SubmitSmartTransactionRequestMocked = createRequest(); + jest + .spyOn(request.smartTransactionsController, 'getFees') + .mockImplementation(() => { + throw new Error('Backend call to /getFees failed'); + }); + const result = await submitSmartTransactionHook(request); + expect(request.controllerMessenger.call).toHaveBeenCalledWith( + 'ApprovalController:endFlow', + { + id: 'approvalId', + }, + ); + expect(result).toEqual({ transactionHash: undefined }); + }); + it('returns a txHash asap if the feature flag requires it', async () => { const request: SubmitSmartTransactionRequestMocked = createRequest(); request.featureFlags.smartTransactions.returnTxHashAsap = true; diff --git a/app/scripts/lib/transaction/smart-transactions.ts b/app/scripts/lib/transaction/smart-transactions.ts index df9fc82e33f5..38f57f597947 100644 --- a/app/scripts/lib/transaction/smart-transactions.ts +++ b/app/scripts/lib/transaction/smart-transactions.ts @@ -129,11 +129,21 @@ class SmartTransactionHook { 'ApprovalController:startFlow', ); this.#approvalFlowId = approvalFlowId; + let getFeesResponse; try { - const getFeesResponse = await this.#smartTransactionsController.getFees( + getFeesResponse = await this.#smartTransactionsController.getFees( { ...this.#txParams, chainId: this.#chainId }, undefined, ); + } catch (error) { + log.error( + 'Error in smart transaction publish hook, falling back to regular transaction submission', + error, + ); + this.#onApproveOrReject(); + return useRegularTransactionSubmit; // Fallback to regular transaction submission. + } + try { const submitTransactionResponse = await this.#signAndSubmitTransactions({ getFeesResponse, }); diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 25ba90d3eae2..f0619145eb3c 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -171,7 +171,8 @@ import { TEST_NETWORK_TICKER_MAP, NetworkStatus, } from '../../shared/constants/network'; -import { ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS } from '../../shared/constants/smartTransactions'; +import { getAllowedSmartTransactionsChainIds } from '../../shared/constants/smartTransactions'; + import { HardwareDeviceNames, LedgerTransportTypes, @@ -1847,7 +1848,7 @@ export default class MetamaskController extends EventEmitter { ), }, { - supportedChainIds: ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS, + supportedChainIds: getAllowedSmartTransactionsChainIds(), }, initState.SmartTransactionsController, ); @@ -4283,7 +4284,11 @@ export default class MetamaskController extends EventEmitter { async resetAccount() { const selectedAddress = this.accountsController.getSelectedAccount().address; - this.txController.wipeTransactions(true, selectedAddress); + this.txController.wipeTransactions(false, selectedAddress); + this.smartTransactionsController.wipeSmartTransactions({ + address: selectedAddress, + ignoreNetwork: false, + }); this.networkController.resetConnection(); return selectedAddress; diff --git a/app/scripts/metamask-controller.test.js b/app/scripts/metamask-controller.test.js index 749d3ce66e70..d9c5983ff29e 100644 --- a/app/scripts/metamask-controller.test.js +++ b/app/scripts/metamask-controller.test.js @@ -1033,15 +1033,28 @@ describe('MetaMaskController', () => { .mockReturnValue({ address: selectedAddressMock }); jest.spyOn(metamaskController.txController, 'wipeTransactions'); + jest.spyOn( + metamaskController.smartTransactionsController, + 'wipeSmartTransactions', + ); await metamaskController.resetAccount(); expect( metamaskController.txController.wipeTransactions, ).toHaveBeenCalledTimes(1); + expect( + metamaskController.smartTransactionsController.wipeSmartTransactions, + ).toHaveBeenCalledTimes(1); expect( metamaskController.txController.wipeTransactions, - ).toHaveBeenCalledWith(true, selectedAddressMock); + ).toHaveBeenCalledWith(false, selectedAddressMock); + expect( + metamaskController.smartTransactionsController.wipeSmartTransactions, + ).toHaveBeenCalledWith({ + address: selectedAddressMock, + ignoreNetwork: false, + }); }); }); diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 2e2010a40c1c..5fea4b45c7a6 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -1415,24 +1415,24 @@ "uuid": true } }, - "@metamask/gas-fee-controller>@metamask/base-controller": { + "@metamask/gas-fee-controller>@metamask/polling-controller": { "globals": { + "clearTimeout": true, + "console.error": true, "setTimeout": true }, "packages": { - "immer": true + "@metamask/gas-fee-controller>@metamask/polling-controller>@metamask/base-controller": true, + "@metamask/snaps-utils>fast-json-stable-stringify": true, + "uuid": true } }, - "@metamask/gas-fee-controller>@metamask/polling-controller": { + "@metamask/gas-fee-controller>@metamask/polling-controller>@metamask/base-controller": { "globals": { - "clearTimeout": true, - "console.error": true, "setTimeout": true }, "packages": { - "@metamask/gas-fee-controller>@metamask/base-controller": true, - "@metamask/snaps-utils>fast-json-stable-stringify": true, - "uuid": true + "immer": true } }, "@metamask/jazzicon": { @@ -1938,11 +1938,11 @@ }, "packages": { "@ethersproject/abi>@ethersproject/bytes": true, - "@metamask/assets-controllers>@metamask/polling-controller": true, + "@metamask/controller-utils": true, "@metamask/eth-query": true, "@metamask/smart-transactions-controller>@ethereumjs/tx": true, "@metamask/smart-transactions-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/controller-utils": true, + "@metamask/smart-transactions-controller>@metamask/polling-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller": true, "@metamask/smart-transactions-controller>bignumber.js": true, "browserify>buffer": true, @@ -1991,40 +1991,65 @@ "TextEncoder": true } }, - "@metamask/smart-transactions-controller>@metamask/controller-utils": { + "@metamask/smart-transactions-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, + "@metamask/smart-transactions-controller>@metamask/network-controller": { "globals": { "URL": true, - "console.error": true, + "btoa": true, "fetch": true, "setTimeout": true }, "packages": { - "@metamask/ens-controller>@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": true, + "@metamask/controller-utils": true, + "@metamask/eth-json-rpc-middleware": true, + "@metamask/eth-query": true, + "@metamask/eth-token-tracker>eth-block-tracker": true, + "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, + "@metamask/network-controller>@metamask/swappable-obj-proxy": true, + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true + "browserify>assert": true, + "uuid": true } }, - "@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": { - "globals": { - "console.warn": true - }, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": { "packages": { - "@ethereumjs/tx>@ethereumjs/rlp": true, - "@ethereumjs/tx>@ethereumjs/util>micro-ftch": true, - "@ethereumjs/tx>ethereum-cryptography": true, - "browserify>buffer": true, - "browserify>insert-module-globals>is-buffer": true, - "webpack>events": true + "@metamask/safe-event-emitter": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": true } }, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/smart-transactions-controller>@metamask/polling-controller": { "globals": { - "crypto.getRandomValues": true + "clearTimeout": true, + "console.error": true, + "setTimeout": true + }, + "packages": { + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/snaps-utils>fast-json-stable-stringify": true, + "uuid": true } }, "@metamask/smart-transactions-controller>@metamask/transaction-controller": { @@ -2037,20 +2062,23 @@ "packages": { "@ethereumjs/common": true, "@ethersproject/abi": true, + "@ethersproject/contracts": true, + "@ethersproject/providers": true, + "@metamask/controller-utils": true, "@metamask/eth-query": true, - "@metamask/gas-fee-controller": true, "@metamask/metamask-eth-abis": true, "@metamask/name-controller>async-mutex": true, - "@metamask/network-controller": true, "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/smart-transactions-controller>@metamask/network-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/tx": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/base-controller": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>eth-method-registry": true, "@metamask/transaction-controller>nonce-tracker": true, "@metamask/utils": true, "bn.js": true, + "browserify>buffer": true, "fast-json-patch": true, "lodash": true, "uuid": true, @@ -2080,40 +2108,19 @@ "webpack>events": true } }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/base-controller": { + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { "globals": { - "setTimeout": true - }, - "packages": { - "immer": true - } - }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils": { - "globals": { - "URL": true, + "clearInterval": true, "console.error": true, - "fetch": true, - "setTimeout": true + "setInterval": true }, "packages": { - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, + "@metamask/controller-utils": true, + "@metamask/eth-query": true, + "@metamask/smart-transactions-controller>@metamask/polling-controller": true, "bn.js": true, "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": { - "globals": { - "console.error": true, - "console.log": true - }, - "packages": { - "@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true, - "@noble/hashes": true + "uuid": true } }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>eth-method-registry": { @@ -2252,6 +2259,7 @@ "File": true, "FileReader": true, "TextDecoder": true, + "TextEncoder": true, "URL": true, "console.error": true, "console.log": true, @@ -2288,24 +2296,9 @@ }, "@metamask/snaps-utils>marked": { "globals": { - "Hooks": true, - "Lexer": true, - "Parser": true, - "Renderer": true, - "TextRenderer": true, - "Tokenizer": true, "console.error": true, "console.warn": true, - "defaults": true, - "define": true, - "inlineQueue": true, - "passThroughHooks": true, - "renderer": true, - "rules": true, - "state": true, - "textRenderer": true, - "tokenizer": true, - "tokens": true + "define": true } }, "@metamask/snaps-utils>rfdc": { @@ -2403,10 +2396,10 @@ "@metamask/controller-utils": true, "@metamask/eth-query": true, "@metamask/gas-fee-controller": true, + "@metamask/gas-fee-controller>@metamask/polling-controller": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/transaction-controller": true, "@metamask/user-operation-controller>@metamask/base-controller": true, - "@metamask/user-operation-controller>@metamask/polling-controller": true, "@metamask/utils": true, "bn.js": true, "lodash": true, @@ -2423,18 +2416,6 @@ "immer": true } }, - "@metamask/user-operation-controller>@metamask/polling-controller": { - "globals": { - "clearTimeout": true, - "console.error": true, - "setTimeout": true - }, - "packages": { - "@metamask/snaps-utils>fast-json-stable-stringify": true, - "@metamask/user-operation-controller>@metamask/base-controller": true, - "uuid": true - } - }, "@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index e5050b94ee8e..5f51afbc44bf 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -1500,24 +1500,24 @@ "uuid": true } }, - "@metamask/gas-fee-controller>@metamask/base-controller": { + "@metamask/gas-fee-controller>@metamask/polling-controller": { "globals": { + "clearTimeout": true, + "console.error": true, "setTimeout": true }, "packages": { - "immer": true + "@metamask/gas-fee-controller>@metamask/polling-controller>@metamask/base-controller": true, + "@metamask/snaps-utils>fast-json-stable-stringify": true, + "uuid": true } }, - "@metamask/gas-fee-controller>@metamask/polling-controller": { + "@metamask/gas-fee-controller>@metamask/polling-controller>@metamask/base-controller": { "globals": { - "clearTimeout": true, - "console.error": true, "setTimeout": true }, "packages": { - "@metamask/gas-fee-controller>@metamask/base-controller": true, - "@metamask/snaps-utils>fast-json-stable-stringify": true, - "uuid": true + "immer": true } }, "@metamask/jazzicon": { @@ -2122,11 +2122,11 @@ }, "packages": { "@ethersproject/abi>@ethersproject/bytes": true, - "@metamask/assets-controllers>@metamask/polling-controller": true, + "@metamask/controller-utils": true, "@metamask/eth-query": true, "@metamask/smart-transactions-controller>@ethereumjs/tx": true, "@metamask/smart-transactions-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/controller-utils": true, + "@metamask/smart-transactions-controller>@metamask/polling-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller": true, "@metamask/smart-transactions-controller>bignumber.js": true, "browserify>buffer": true, @@ -2175,40 +2175,65 @@ "TextEncoder": true } }, - "@metamask/smart-transactions-controller>@metamask/controller-utils": { + "@metamask/smart-transactions-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, + "@metamask/smart-transactions-controller>@metamask/network-controller": { "globals": { "URL": true, - "console.error": true, + "btoa": true, "fetch": true, "setTimeout": true }, "packages": { - "@metamask/ens-controller>@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": true, + "@metamask/controller-utils": true, + "@metamask/eth-json-rpc-middleware": true, + "@metamask/eth-query": true, + "@metamask/eth-token-tracker>eth-block-tracker": true, + "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, + "@metamask/network-controller>@metamask/swappable-obj-proxy": true, + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true + "browserify>assert": true, + "uuid": true } }, - "@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": { - "globals": { - "console.warn": true - }, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": { "packages": { - "@ethereumjs/tx>@ethereumjs/rlp": true, - "@ethereumjs/tx>@ethereumjs/util>micro-ftch": true, - "@ethereumjs/tx>ethereum-cryptography": true, - "browserify>buffer": true, - "browserify>insert-module-globals>is-buffer": true, - "webpack>events": true + "@metamask/safe-event-emitter": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": true } }, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/smart-transactions-controller>@metamask/polling-controller": { "globals": { - "crypto.getRandomValues": true + "clearTimeout": true, + "console.error": true, + "setTimeout": true + }, + "packages": { + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/snaps-utils>fast-json-stable-stringify": true, + "uuid": true } }, "@metamask/smart-transactions-controller>@metamask/transaction-controller": { @@ -2221,20 +2246,23 @@ "packages": { "@ethereumjs/common": true, "@ethersproject/abi": true, + "@ethersproject/contracts": true, + "@ethersproject/providers": true, + "@metamask/controller-utils": true, "@metamask/eth-query": true, - "@metamask/gas-fee-controller": true, "@metamask/metamask-eth-abis": true, "@metamask/name-controller>async-mutex": true, - "@metamask/network-controller": true, "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/smart-transactions-controller>@metamask/network-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/tx": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/base-controller": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>eth-method-registry": true, "@metamask/transaction-controller>nonce-tracker": true, "@metamask/utils": true, "bn.js": true, + "browserify>buffer": true, "fast-json-patch": true, "lodash": true, "uuid": true, @@ -2264,40 +2292,19 @@ "webpack>events": true } }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/base-controller": { + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { "globals": { - "setTimeout": true - }, - "packages": { - "immer": true - } - }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils": { - "globals": { - "URL": true, + "clearInterval": true, "console.error": true, - "fetch": true, - "setTimeout": true + "setInterval": true }, "packages": { - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, + "@metamask/controller-utils": true, + "@metamask/eth-query": true, + "@metamask/smart-transactions-controller>@metamask/polling-controller": true, "bn.js": true, "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": { - "globals": { - "console.error": true, - "console.log": true - }, - "packages": { - "@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true, - "@noble/hashes": true + "uuid": true } }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>eth-method-registry": { @@ -2568,6 +2575,7 @@ "File": true, "FileReader": true, "TextDecoder": true, + "TextEncoder": true, "URL": true, "console.error": true, "console.log": true, @@ -2612,24 +2620,9 @@ }, "@metamask/snaps-utils>marked": { "globals": { - "Hooks": true, - "Lexer": true, - "Parser": true, - "Renderer": true, - "TextRenderer": true, - "Tokenizer": true, "console.error": true, "console.warn": true, - "defaults": true, - "define": true, - "inlineQueue": true, - "passThroughHooks": true, - "renderer": true, - "rules": true, - "state": true, - "textRenderer": true, - "tokenizer": true, - "tokens": true + "define": true } }, "@metamask/snaps-utils>rfdc": { @@ -2727,10 +2720,10 @@ "@metamask/controller-utils": true, "@metamask/eth-query": true, "@metamask/gas-fee-controller": true, + "@metamask/gas-fee-controller>@metamask/polling-controller": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/transaction-controller": true, "@metamask/user-operation-controller>@metamask/base-controller": true, - "@metamask/user-operation-controller>@metamask/polling-controller": true, "@metamask/utils": true, "bn.js": true, "lodash": true, @@ -2747,18 +2740,6 @@ "immer": true } }, - "@metamask/user-operation-controller>@metamask/polling-controller": { - "globals": { - "clearTimeout": true, - "console.error": true, - "setTimeout": true - }, - "packages": { - "@metamask/snaps-utils>fast-json-stable-stringify": true, - "@metamask/user-operation-controller>@metamask/base-controller": true, - "uuid": true - } - }, "@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 668216a5e810..83a74b49e9e8 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -1500,24 +1500,24 @@ "uuid": true } }, - "@metamask/gas-fee-controller>@metamask/base-controller": { + "@metamask/gas-fee-controller>@metamask/polling-controller": { "globals": { + "clearTimeout": true, + "console.error": true, "setTimeout": true }, "packages": { - "immer": true + "@metamask/gas-fee-controller>@metamask/polling-controller>@metamask/base-controller": true, + "@metamask/snaps-utils>fast-json-stable-stringify": true, + "uuid": true } }, - "@metamask/gas-fee-controller>@metamask/polling-controller": { + "@metamask/gas-fee-controller>@metamask/polling-controller>@metamask/base-controller": { "globals": { - "clearTimeout": true, - "console.error": true, "setTimeout": true }, "packages": { - "@metamask/gas-fee-controller>@metamask/base-controller": true, - "@metamask/snaps-utils>fast-json-stable-stringify": true, - "uuid": true + "immer": true } }, "@metamask/jazzicon": { @@ -2174,11 +2174,11 @@ }, "packages": { "@ethersproject/abi>@ethersproject/bytes": true, - "@metamask/assets-controllers>@metamask/polling-controller": true, + "@metamask/controller-utils": true, "@metamask/eth-query": true, "@metamask/smart-transactions-controller>@ethereumjs/tx": true, "@metamask/smart-transactions-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/controller-utils": true, + "@metamask/smart-transactions-controller>@metamask/polling-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller": true, "@metamask/smart-transactions-controller>bignumber.js": true, "browserify>buffer": true, @@ -2227,40 +2227,65 @@ "TextEncoder": true } }, - "@metamask/smart-transactions-controller>@metamask/controller-utils": { + "@metamask/smart-transactions-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, + "@metamask/smart-transactions-controller>@metamask/network-controller": { "globals": { "URL": true, - "console.error": true, + "btoa": true, "fetch": true, "setTimeout": true }, "packages": { - "@metamask/ens-controller>@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": true, + "@metamask/controller-utils": true, + "@metamask/eth-json-rpc-middleware": true, + "@metamask/eth-query": true, + "@metamask/eth-token-tracker>eth-block-tracker": true, + "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, + "@metamask/network-controller>@metamask/swappable-obj-proxy": true, + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true + "browserify>assert": true, + "uuid": true } }, - "@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": { - "globals": { - "console.warn": true - }, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": { "packages": { - "@ethereumjs/tx>@ethereumjs/rlp": true, - "@ethereumjs/tx>@ethereumjs/util>micro-ftch": true, - "@ethereumjs/tx>ethereum-cryptography": true, - "browserify>buffer": true, - "browserify>insert-module-globals>is-buffer": true, - "webpack>events": true + "@metamask/safe-event-emitter": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": true } }, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/smart-transactions-controller>@metamask/polling-controller": { "globals": { - "crypto.getRandomValues": true + "clearTimeout": true, + "console.error": true, + "setTimeout": true + }, + "packages": { + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/snaps-utils>fast-json-stable-stringify": true, + "uuid": true } }, "@metamask/smart-transactions-controller>@metamask/transaction-controller": { @@ -2273,20 +2298,23 @@ "packages": { "@ethereumjs/common": true, "@ethersproject/abi": true, + "@ethersproject/contracts": true, + "@ethersproject/providers": true, + "@metamask/controller-utils": true, "@metamask/eth-query": true, - "@metamask/gas-fee-controller": true, "@metamask/metamask-eth-abis": true, "@metamask/name-controller>async-mutex": true, - "@metamask/network-controller": true, "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/smart-transactions-controller>@metamask/network-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/tx": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/base-controller": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>eth-method-registry": true, "@metamask/transaction-controller>nonce-tracker": true, "@metamask/utils": true, "bn.js": true, + "browserify>buffer": true, "fast-json-patch": true, "lodash": true, "uuid": true, @@ -2316,40 +2344,19 @@ "webpack>events": true } }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/base-controller": { + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { "globals": { - "setTimeout": true - }, - "packages": { - "immer": true - } - }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils": { - "globals": { - "URL": true, + "clearInterval": true, "console.error": true, - "fetch": true, - "setTimeout": true + "setInterval": true }, "packages": { - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, + "@metamask/controller-utils": true, + "@metamask/eth-query": true, + "@metamask/smart-transactions-controller>@metamask/polling-controller": true, "bn.js": true, "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": { - "globals": { - "console.error": true, - "console.log": true - }, - "packages": { - "@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true, - "@noble/hashes": true + "uuid": true } }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>eth-method-registry": { @@ -2620,6 +2627,7 @@ "File": true, "FileReader": true, "TextDecoder": true, + "TextEncoder": true, "URL": true, "console.error": true, "console.log": true, @@ -2664,24 +2672,9 @@ }, "@metamask/snaps-utils>marked": { "globals": { - "Hooks": true, - "Lexer": true, - "Parser": true, - "Renderer": true, - "TextRenderer": true, - "Tokenizer": true, "console.error": true, "console.warn": true, - "defaults": true, - "define": true, - "inlineQueue": true, - "passThroughHooks": true, - "renderer": true, - "rules": true, - "state": true, - "textRenderer": true, - "tokenizer": true, - "tokens": true + "define": true } }, "@metamask/snaps-utils>rfdc": { @@ -2779,10 +2772,10 @@ "@metamask/controller-utils": true, "@metamask/eth-query": true, "@metamask/gas-fee-controller": true, + "@metamask/gas-fee-controller>@metamask/polling-controller": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/transaction-controller": true, "@metamask/user-operation-controller>@metamask/base-controller": true, - "@metamask/user-operation-controller>@metamask/polling-controller": true, "@metamask/utils": true, "bn.js": true, "lodash": true, @@ -2799,18 +2792,6 @@ "immer": true } }, - "@metamask/user-operation-controller>@metamask/polling-controller": { - "globals": { - "clearTimeout": true, - "console.error": true, - "setTimeout": true - }, - "packages": { - "@metamask/snaps-utils>fast-json-stable-stringify": true, - "@metamask/user-operation-controller>@metamask/base-controller": true, - "uuid": true - } - }, "@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 570802f04e57..7d429fbd34e1 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -1415,24 +1415,24 @@ "uuid": true } }, - "@metamask/gas-fee-controller>@metamask/base-controller": { + "@metamask/gas-fee-controller>@metamask/polling-controller": { "globals": { + "clearTimeout": true, + "console.error": true, "setTimeout": true }, "packages": { - "immer": true + "@metamask/gas-fee-controller>@metamask/polling-controller>@metamask/base-controller": true, + "@metamask/snaps-utils>fast-json-stable-stringify": true, + "uuid": true } }, - "@metamask/gas-fee-controller>@metamask/polling-controller": { + "@metamask/gas-fee-controller>@metamask/polling-controller>@metamask/base-controller": { "globals": { - "clearTimeout": true, - "console.error": true, "setTimeout": true }, "packages": { - "@metamask/gas-fee-controller>@metamask/base-controller": true, - "@metamask/snaps-utils>fast-json-stable-stringify": true, - "uuid": true + "immer": true } }, "@metamask/jazzicon": { @@ -2089,11 +2089,11 @@ }, "packages": { "@ethersproject/abi>@ethersproject/bytes": true, - "@metamask/assets-controllers>@metamask/polling-controller": true, + "@metamask/controller-utils": true, "@metamask/eth-query": true, "@metamask/smart-transactions-controller>@ethereumjs/tx": true, "@metamask/smart-transactions-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/controller-utils": true, + "@metamask/smart-transactions-controller>@metamask/polling-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller": true, "@metamask/smart-transactions-controller>bignumber.js": true, "browserify>buffer": true, @@ -2142,40 +2142,65 @@ "TextEncoder": true } }, - "@metamask/smart-transactions-controller>@metamask/controller-utils": { + "@metamask/smart-transactions-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, + "@metamask/smart-transactions-controller>@metamask/network-controller": { "globals": { "URL": true, - "console.error": true, + "btoa": true, "fetch": true, "setTimeout": true }, "packages": { - "@metamask/ens-controller>@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": true, + "@metamask/controller-utils": true, + "@metamask/eth-json-rpc-middleware": true, + "@metamask/eth-query": true, + "@metamask/eth-token-tracker>eth-block-tracker": true, + "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, + "@metamask/network-controller>@metamask/swappable-obj-proxy": true, + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true + "browserify>assert": true, + "uuid": true } }, - "@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": { - "globals": { - "console.warn": true - }, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": { "packages": { - "@ethereumjs/tx>@ethereumjs/rlp": true, - "@ethereumjs/tx>@ethereumjs/util>micro-ftch": true, - "@ethereumjs/tx>ethereum-cryptography": true, - "browserify>buffer": true, - "browserify>insert-module-globals>is-buffer": true, - "webpack>events": true + "@metamask/safe-event-emitter": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": true } }, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/smart-transactions-controller>@metamask/polling-controller": { "globals": { - "crypto.getRandomValues": true + "clearTimeout": true, + "console.error": true, + "setTimeout": true + }, + "packages": { + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/snaps-utils>fast-json-stable-stringify": true, + "uuid": true } }, "@metamask/smart-transactions-controller>@metamask/transaction-controller": { @@ -2188,20 +2213,23 @@ "packages": { "@ethereumjs/common": true, "@ethersproject/abi": true, + "@ethersproject/contracts": true, + "@ethersproject/providers": true, + "@metamask/controller-utils": true, "@metamask/eth-query": true, - "@metamask/gas-fee-controller": true, "@metamask/metamask-eth-abis": true, "@metamask/name-controller>async-mutex": true, - "@metamask/network-controller": true, "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/smart-transactions-controller>@metamask/network-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/tx": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/base-controller": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>eth-method-registry": true, "@metamask/transaction-controller>nonce-tracker": true, "@metamask/utils": true, "bn.js": true, + "browserify>buffer": true, "fast-json-patch": true, "lodash": true, "uuid": true, @@ -2231,40 +2259,19 @@ "webpack>events": true } }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/base-controller": { + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { "globals": { - "setTimeout": true - }, - "packages": { - "immer": true - } - }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils": { - "globals": { - "URL": true, + "clearInterval": true, "console.error": true, - "fetch": true, - "setTimeout": true + "setInterval": true }, "packages": { - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, + "@metamask/controller-utils": true, + "@metamask/eth-query": true, + "@metamask/smart-transactions-controller>@metamask/polling-controller": true, "bn.js": true, "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": { - "globals": { - "console.error": true, - "console.log": true - }, - "packages": { - "@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true, - "@noble/hashes": true + "uuid": true } }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>eth-method-registry": { @@ -2535,6 +2542,7 @@ "File": true, "FileReader": true, "TextDecoder": true, + "TextEncoder": true, "URL": true, "console.error": true, "console.log": true, @@ -2579,24 +2587,9 @@ }, "@metamask/snaps-utils>marked": { "globals": { - "Hooks": true, - "Lexer": true, - "Parser": true, - "Renderer": true, - "TextRenderer": true, - "Tokenizer": true, "console.error": true, "console.warn": true, - "defaults": true, - "define": true, - "inlineQueue": true, - "passThroughHooks": true, - "renderer": true, - "rules": true, - "state": true, - "textRenderer": true, - "tokenizer": true, - "tokens": true + "define": true } }, "@metamask/snaps-utils>rfdc": { @@ -2694,10 +2687,10 @@ "@metamask/controller-utils": true, "@metamask/eth-query": true, "@metamask/gas-fee-controller": true, + "@metamask/gas-fee-controller>@metamask/polling-controller": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/transaction-controller": true, "@metamask/user-operation-controller>@metamask/base-controller": true, - "@metamask/user-operation-controller>@metamask/polling-controller": true, "@metamask/utils": true, "bn.js": true, "lodash": true, @@ -2714,18 +2707,6 @@ "immer": true } }, - "@metamask/user-operation-controller>@metamask/polling-controller": { - "globals": { - "clearTimeout": true, - "console.error": true, - "setTimeout": true - }, - "packages": { - "@metamask/snaps-utils>fast-json-stable-stringify": true, - "@metamask/user-operation-controller>@metamask/base-controller": true, - "uuid": true - } - }, "@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index cd28d6568779..f5be6a215d9e 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -1554,24 +1554,24 @@ "uuid": true } }, - "@metamask/gas-fee-controller>@metamask/base-controller": { + "@metamask/gas-fee-controller>@metamask/polling-controller": { "globals": { + "clearTimeout": true, + "console.error": true, "setTimeout": true }, "packages": { - "immer": true + "@metamask/gas-fee-controller>@metamask/polling-controller>@metamask/base-controller": true, + "@metamask/snaps-utils>fast-json-stable-stringify": true, + "uuid": true } }, - "@metamask/gas-fee-controller>@metamask/polling-controller": { + "@metamask/gas-fee-controller>@metamask/polling-controller>@metamask/base-controller": { "globals": { - "clearTimeout": true, - "console.error": true, "setTimeout": true }, "packages": { - "@metamask/gas-fee-controller>@metamask/base-controller": true, - "@metamask/snaps-utils>fast-json-stable-stringify": true, - "uuid": true + "immer": true } }, "@metamask/jazzicon": { @@ -2228,11 +2228,11 @@ }, "packages": { "@ethersproject/abi>@ethersproject/bytes": true, - "@metamask/assets-controllers>@metamask/polling-controller": true, + "@metamask/controller-utils": true, "@metamask/eth-query": true, "@metamask/smart-transactions-controller>@ethereumjs/tx": true, "@metamask/smart-transactions-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/controller-utils": true, + "@metamask/smart-transactions-controller>@metamask/polling-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller": true, "@metamask/smart-transactions-controller>bignumber.js": true, "browserify>buffer": true, @@ -2281,40 +2281,65 @@ "TextEncoder": true } }, - "@metamask/smart-transactions-controller>@metamask/controller-utils": { + "@metamask/smart-transactions-controller>@metamask/base-controller": { + "globals": { + "setTimeout": true + }, + "packages": { + "immer": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, + "@metamask/smart-transactions-controller>@metamask/network-controller": { "globals": { "URL": true, - "console.error": true, + "btoa": true, "fetch": true, "setTimeout": true }, "packages": { - "@metamask/ens-controller>@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": true, + "@metamask/controller-utils": true, + "@metamask/eth-json-rpc-middleware": true, + "@metamask/eth-query": true, + "@metamask/eth-token-tracker>eth-block-tracker": true, + "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, + "@metamask/network-controller>@metamask/swappable-obj-proxy": true, + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": true, "@metamask/utils": true, - "bn.js": true, - "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true + "browserify>assert": true, + "uuid": true } }, - "@metamask/smart-transactions-controller>@metamask/controller-utils>@ethereumjs/util": { - "globals": { - "console.warn": true - }, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/eth-json-rpc-provider": { "packages": { - "@ethereumjs/tx>@ethereumjs/rlp": true, - "@ethereumjs/tx>@ethereumjs/util>micro-ftch": true, - "@ethereumjs/tx>ethereum-cryptography": true, - "browserify>buffer": true, - "browserify>insert-module-globals>is-buffer": true, - "webpack>events": true + "@metamask/safe-event-emitter": true, + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": true } }, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { + "@metamask/smart-transactions-controller>@metamask/network-controller>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/safe-event-emitter": true, + "@metamask/utils": true + } + }, + "@metamask/smart-transactions-controller>@metamask/polling-controller": { "globals": { - "crypto.getRandomValues": true + "clearTimeout": true, + "console.error": true, + "setTimeout": true + }, + "packages": { + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/snaps-utils>fast-json-stable-stringify": true, + "uuid": true } }, "@metamask/smart-transactions-controller>@metamask/transaction-controller": { @@ -2327,20 +2352,23 @@ "packages": { "@ethereumjs/common": true, "@ethersproject/abi": true, + "@ethersproject/contracts": true, + "@ethersproject/providers": true, + "@metamask/controller-utils": true, "@metamask/eth-query": true, - "@metamask/gas-fee-controller": true, "@metamask/metamask-eth-abis": true, "@metamask/name-controller>async-mutex": true, - "@metamask/network-controller": true, "@metamask/providers>@metamask/rpc-errors": true, + "@metamask/smart-transactions-controller>@metamask/base-controller": true, + "@metamask/smart-transactions-controller>@metamask/network-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/tx": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/base-controller": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>eth-method-registry": true, "@metamask/transaction-controller>nonce-tracker": true, "@metamask/utils": true, "bn.js": true, + "browserify>buffer": true, "fast-json-patch": true, "lodash": true, "uuid": true, @@ -2370,40 +2398,19 @@ "webpack>events": true } }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/base-controller": { + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { "globals": { - "setTimeout": true - }, - "packages": { - "immer": true - } - }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils": { - "globals": { - "URL": true, + "clearInterval": true, "console.error": true, - "fetch": true, - "setTimeout": true + "setInterval": true }, "packages": { - "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": true, - "@metamask/utils": true, + "@metamask/controller-utils": true, + "@metamask/eth-query": true, + "@metamask/smart-transactions-controller>@metamask/polling-controller": true, "bn.js": true, "browserify>buffer": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true - } - }, - "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@spruceid/siwe-parser": { - "globals": { - "console.error": true, - "console.log": true - }, - "packages": { - "@metamask/controller-utils>@spruceid/siwe-parser>apg-js": true, - "@noble/hashes": true + "uuid": true } }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>eth-method-registry": { @@ -2674,6 +2681,7 @@ "File": true, "FileReader": true, "TextDecoder": true, + "TextEncoder": true, "URL": true, "console.error": true, "console.log": true, @@ -2718,24 +2726,9 @@ }, "@metamask/snaps-utils>marked": { "globals": { - "Hooks": true, - "Lexer": true, - "Parser": true, - "Renderer": true, - "TextRenderer": true, - "Tokenizer": true, "console.error": true, "console.warn": true, - "defaults": true, - "define": true, - "inlineQueue": true, - "passThroughHooks": true, - "renderer": true, - "rules": true, - "state": true, - "textRenderer": true, - "tokenizer": true, - "tokens": true + "define": true } }, "@metamask/snaps-utils>rfdc": { @@ -2833,10 +2826,10 @@ "@metamask/controller-utils": true, "@metamask/eth-query": true, "@metamask/gas-fee-controller": true, + "@metamask/gas-fee-controller>@metamask/polling-controller": true, "@metamask/providers>@metamask/rpc-errors": true, "@metamask/transaction-controller": true, "@metamask/user-operation-controller>@metamask/base-controller": true, - "@metamask/user-operation-controller>@metamask/polling-controller": true, "@metamask/utils": true, "bn.js": true, "lodash": true, @@ -2853,18 +2846,6 @@ "immer": true } }, - "@metamask/user-operation-controller>@metamask/polling-controller": { - "globals": { - "clearTimeout": true, - "console.error": true, - "setTimeout": true - }, - "packages": { - "@metamask/snaps-utils>fast-json-stable-stringify": true, - "@metamask/user-operation-controller>@metamask/base-controller": true, - "uuid": true - } - }, "@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 7d14fd81bd30..9de31f82694a 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -1227,26 +1227,17 @@ }, "@lavamoat/lavapack>lavamoat-core": { "builtin": { - "events": true, - "fs.readFileSync": true, - "node:fs/promises.readFile": true, + "node:events": true, + "node:fs.readFileSync": true, "node:fs/promises.writeFile": true, - "path.extname": true, - "path.join": true + "node:path.extname": true, + "node:path.join": true }, "globals": { "__dirname": true, - "ast": true, "console.error": true, "console.warn": true, - "content": true, - "define": true, - "file": true, - "importMap": true, - "moduleInitializer": true, - "packageName": true, - "specifier": true, - "type": true + "define": true }, "packages": { "@lavamoat/lavapack>json-stable-stringify": true, @@ -1259,7 +1250,7 @@ "console.log": true }, "packages": { - "@babel/core>@babel/parser": true, + "@lavamoat/lavapack>lavamoat-core>lavamoat-tofu>@babel/parser": true, "depcheck>@babel/traverse": true } }, diff --git a/package.json b/package.json index e33cc9d5a061..109c33ef820f 100644 --- a/package.json +++ b/package.json @@ -317,7 +317,7 @@ "@metamask/scure-bip39": "^2.0.3", "@metamask/selected-network-controller": "^9.0.0", "@metamask/signature-controller": "^12.0.0", - "@metamask/smart-transactions-controller": "^8.1.0", + "@metamask/smart-transactions-controller": "^10.0.0", "@metamask/snaps-controllers": "^6.0.4", "@metamask/snaps-execution-environments": "^5.0.4", "@metamask/snaps-rpc-methods": "^7.0.2", diff --git a/shared/constants/notifications.ts b/shared/constants/notifications.ts new file mode 100644 index 000000000000..54254570d1b2 --- /dev/null +++ b/shared/constants/notifications.ts @@ -0,0 +1,2 @@ +export const NOTIFICATION_HEIGHT = 620; +export const NOTIFICATION_WIDTH = 360; diff --git a/shared/constants/smartTransactions.test.ts b/shared/constants/smartTransactions.test.ts new file mode 100644 index 000000000000..47f4f8250c2b --- /dev/null +++ b/shared/constants/smartTransactions.test.ts @@ -0,0 +1,33 @@ +import { isProduction } from '../modules/environment'; +import { getAllowedSmartTransactionsChainIds } from './smartTransactions'; +import { CHAIN_IDS } from './network'; + +jest.mock('../modules/environment', () => ({ + isProduction: jest.fn(() => false), // Initially mock isProduction to return false +})); + +// Cast isProduction to jest.Mock to inform TypeScript about the mock type +const mockIsProduction = isProduction as jest.Mock; + +describe('smartTransactions', () => { + describe('getAllowedSmartTransactionsChainIds', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should return the correct chain IDs for development environment', () => { + mockIsProduction.mockReturnValue(false); + const allowedChainIds = getAllowedSmartTransactionsChainIds(); + expect(allowedChainIds).toStrictEqual([ + CHAIN_IDS.MAINNET, + CHAIN_IDS.SEPOLIA, + ]); + }); + + it('should return the correct chain IDs for production environment', () => { + mockIsProduction.mockReturnValue(true); + const allowedChainIds = getAllowedSmartTransactionsChainIds(); + expect(allowedChainIds).toStrictEqual([CHAIN_IDS.MAINNET]); + }); + }); +}); diff --git a/shared/constants/smartTransactions.ts b/shared/constants/smartTransactions.ts index 4e648d2c9cbf..4e39ec5ba234 100644 --- a/shared/constants/smartTransactions.ts +++ b/shared/constants/smartTransactions.ts @@ -1,5 +1,5 @@ +import { isProduction } from '../modules/environment'; import { SECOND } from './time'; - import { CHAIN_IDS } from './network'; export const FALLBACK_SMART_TRANSACTIONS_REFRESH_TIME: number = SECOND * 10; @@ -8,14 +8,24 @@ export const FALLBACK_SMART_TRANSACTIONS_EXPECTED_DEADLINE = 45; export const FALLBACK_SMART_TRANSACTIONS_MAX_DEADLINE = 150; export const FALLBACK_SMART_TRANSACTIONS_MAX_FEE_MULTIPLIER: number = 2; -export const ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS: string[] = [ +const ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS_DEVELOPMENT: string[] = [ CHAIN_IDS.MAINNET, CHAIN_IDS.SEPOLIA, ]; +const ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS_PRODUCTION: string[] = [ + CHAIN_IDS.MAINNET, +]; + +export const getAllowedSmartTransactionsChainIds = (): string[] => { + return isProduction() + ? ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS_PRODUCTION + : ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS_DEVELOPMENT; +}; + export const SKIP_STX_RPC_URL_CHECK_CHAIN_IDS: string[] = [CHAIN_IDS.SEPOLIA]; export const CANCEL_GAS_LIMIT_DEC = 21000; export const SMART_TRANSACTIONS_LEARN_MORE_URL = - 'https://support.metamask.io/hc/en-us/articles/9184393821211'; + 'https://support.metamask.io/transactions-and-gas/transactions/smart-transactions/'; diff --git a/shared/modules/environment.test.ts b/shared/modules/environment.test.ts new file mode 100644 index 000000000000..a6d8128cc764 --- /dev/null +++ b/shared/modules/environment.test.ts @@ -0,0 +1,29 @@ +import { ENVIRONMENT } from '../../development/build/constants'; +import { isProduction } from './environment'; + +describe('isProduction', () => { + let originalMetaMaskEnvironment: string | undefined; + + beforeAll(() => { + originalMetaMaskEnvironment = process.env.METAMASK_ENVIRONMENT; + }); + + afterAll(() => { + process.env.METAMASK_ENVIRONMENT = originalMetaMaskEnvironment; + }); + + it('should return true when ENVIRONMENT is "production"', () => { + process.env.METAMASK_ENVIRONMENT = ENVIRONMENT.PRODUCTION; + expect(isProduction()).toBe(true); + }); + + it('should return false when ENVIRONMENT is "development"', () => { + process.env.METAMASK_ENVIRONMENT = ENVIRONMENT.DEVELOPMENT; + expect(isProduction()).toBe(false); + }); + + it('should return false when ENVIRONMENT is "testing"', () => { + process.env.METAMASK_ENVIRONMENT = ENVIRONMENT.TESTING; + expect(isProduction()).toBe(false); + }); +}); diff --git a/shared/modules/environment.ts b/shared/modules/environment.ts new file mode 100644 index 000000000000..96631bdc6f9b --- /dev/null +++ b/shared/modules/environment.ts @@ -0,0 +1,8 @@ +import { ENVIRONMENT } from '../../development/build/constants'; + +export const isProduction = (): boolean => { + return ( + process.env.METAMASK_ENVIRONMENT !== ENVIRONMENT.DEVELOPMENT && + process.env.METAMASK_ENVIRONMENT !== ENVIRONMENT.TESTING + ); +}; diff --git a/shared/modules/selectors/smart-transactions.ts b/shared/modules/selectors/smart-transactions.ts index f58f0b911d30..24994f1ec203 100644 --- a/shared/modules/selectors/smart-transactions.ts +++ b/shared/modules/selectors/smart-transactions.ts @@ -1,14 +1,14 @@ import type { Hex } from '@metamask/utils'; import { - ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS, + getAllowedSmartTransactionsChainIds, SKIP_STX_RPC_URL_CHECK_CHAIN_IDS, } from '../../constants/smartTransactions'; -import { ENVIRONMENT } from '../../../development/build/constants'; import { getCurrentChainId, getCurrentNetwork, accountSupportsSmartTx, } from '../../../ui/selectors/selectors'; // TODO: Migrate shared selectors to this file. +import { isProduction } from '../environment'; type SmartTransactionsMetaMaskState = { metamask: { @@ -69,17 +69,14 @@ export const getCurrentChainSupportsSmartTransactions = ( state: SmartTransactionsMetaMaskState, ): boolean => { const chainId = getCurrentChainId(state); - return ALLOWED_SMART_TRANSACTIONS_CHAIN_IDS.includes(chainId); + return getAllowedSmartTransactionsChainIds().includes(chainId); }; const getIsAllowedRpcUrlForSmartTransactions = ( state: SmartTransactionsMetaMaskState, ) => { const chainId = getCurrentChainId(state); - const isDevelopment = - process.env.METAMASK_ENVIRONMENT === ENVIRONMENT.DEVELOPMENT || - process.env.METAMASK_ENVIRONMENT === ENVIRONMENT.TESTING; - if (isDevelopment || SKIP_STX_RPC_URL_CHECK_CHAIN_IDS.includes(chainId)) { + if (!isProduction() || SKIP_STX_RPC_URL_CHECK_CHAIN_IDS.includes(chainId)) { // Allow any STX RPC URL in development and testing environments or for specific chain IDs. return true; } diff --git a/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap b/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap index b18592928943..08801b7188e2 100644 --- a/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap +++ b/ui/pages/settings/advanced-tab/__snapshots__/advanced-tab.component.test.js.snap @@ -80,10 +80,10 @@ exports[`AdvancedTab Component should match snapshot 1`] = ` > - Turn on Smart Transactions for more reliable and secure transactions, and adjustable fees on ETH Mainnet. + Turn on Smart Transactions for more reliable and secure transactions on ETH Mainnet. diff --git a/ui/pages/smart-transactions/smart-transaction-status-page/__snapshots__/smart-transactions-status-page.test.js.snap b/ui/pages/smart-transactions/smart-transaction-status-page/__snapshots__/smart-transactions-status-page.test.js.snap index e4cb60c2585b..4da9535d2e3e 100644 --- a/ui/pages/smart-transactions/smart-transaction-status-page/__snapshots__/smart-transactions-status-page.test.js.snap +++ b/ui/pages/smart-transactions/smart-transaction-status-page/__snapshots__/smart-transactions-status-page.test.js.snap @@ -42,7 +42,7 @@ exports[`SmartTransactionStatusPage renders the "Sorry for the wait" pending sta

{ display={Display.Flex} flexDirection={FlexDirection.Column} alignItems={AlignItems.center} + className="smart-transaction-status-page__description" > { - if (!isSmartTransactionPending) { + const isWiderThanNotificationWidth = window.innerWidth > NOTIFICATION_WIDTH; + if (!isSmartTransactionPending || isWiderThanNotificationWidth) { onCloseExtension(); } global.platform.openTab({ diff --git a/ui/store/actions.ts b/ui/store/actions.ts index cae3188e3c1d..ea46b0597299 100644 --- a/ui/store/actions.ts +++ b/ui/store/actions.ts @@ -96,6 +96,7 @@ import { } from '../../shared/constants/metametrics'; import { parseSmartTransactionsError } from '../pages/swaps/swaps.util'; import { isEqualCaseInsensitive } from '../../shared/modules/string-utils'; +import { getSmartTransactionsOptInStatus } from '../../shared/modules/selectors'; ///: BEGIN:ONLY_INCLUDE_IF(snaps) import { NOTIFICATIONS_EXPIRATION_DELAY } from '../helpers/constants/notifications'; ///: END:ONLY_INCLUDE_IF @@ -3083,15 +3084,24 @@ export function setShowExtensionInFullSizeView(value: boolean) { return setPreference('showExtensionInFullSizeView', value); } -export function setSmartTransactionsOptInStatus(value: boolean) { - trackMetaMetricsEvent({ - category: MetaMetricsEventCategory.Settings, - event: MetaMetricsEventName.SettingsUpdated, - properties: { - stx_opt_in: value, - }, - }); - return setPreference('smartTransactionsOptInStatus', value); +export function setSmartTransactionsOptInStatus( + value: boolean, +): ThunkAction { + return async (dispatch, getState) => { + const smartTransactionsOptInStatus = getSmartTransactionsOptInStatus( + getState(), + ); + trackMetaMetricsEvent({ + category: MetaMetricsEventCategory.Settings, + event: MetaMetricsEventName.SettingsUpdated, + properties: { + stx_opt_in: value, + prev_stx_opt_in: smartTransactionsOptInStatus, + }, + }); + await dispatch(setPreference('smartTransactionsOptInStatus', value)); + await forceUpdateMetamaskState(dispatch); + }; } export function setAutoLockTimeLimit(value: boolean) { diff --git a/yarn.lock b/yarn.lock index f3dc9ad8a051..c0b361fba7b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -462,12 +462,21 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:7.23.9, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.12.0, @babel/parser@npm:^7.13.16, @babel/parser@npm:^7.13.9, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.8, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.22.7, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.23.9": - version: 7.23.9 - resolution: "@babel/parser@npm:7.23.9" +"@babel/parser@npm:7.24.0": + version: 7.24.0 + resolution: "@babel/parser@npm:7.24.0" bin: parser: ./bin/babel-parser.js - checksum: 727a7a807100f6a26df859e2f009c4ddbd0d3363287b45daa50bd082ccd0d431d0c4d0e610a91f806e04a1918726cd0f5a0592c9b902a815337feed12e1cafd9 + checksum: 3e5ebb903a6f71629a9d0226743e37fe3d961e79911d2698b243637f66c4df7e3e0a42c07838bc0e7cc9fcd585d9be8f4134a145b9459ee4a459420fb0d1360b + languageName: node + linkType: hard + +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.12.0, @babel/parser@npm:^7.13.16, @babel/parser@npm:^7.13.9, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.21.8, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.22.7, @babel/parser@npm:^7.23.0, @babel/parser@npm:^7.24.0": + version: 7.24.4 + resolution: "@babel/parser@npm:7.24.4" + bin: + parser: ./bin/babel-parser.js + checksum: 3742cc5068036287e6395269dce5a2735e6349cdc8d4b53297c75f98c580d7e1c8cb43235623999d151f2ef975d677dbc2c2357573a1855caa71c271bf3046c9 languageName: node linkType: hard @@ -1656,9 +1665,9 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:7.23.9, @babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.12.5, @babel/traverse@npm:^7.22.8, @babel/traverse@npm:^7.23.2": - version: 7.23.9 - resolution: "@babel/traverse@npm:7.23.9" +"@babel/traverse@npm:7.24.0, @babel/traverse@npm:^7.1.6, @babel/traverse@npm:^7.12.5, @babel/traverse@npm:^7.22.8, @babel/traverse@npm:^7.23.2": + version: 7.24.0 + resolution: "@babel/traverse@npm:7.24.0" dependencies: "@babel/code-frame": "npm:^7.23.5" "@babel/generator": "npm:^7.23.6" @@ -1666,22 +1675,22 @@ __metadata: "@babel/helper-function-name": "npm:^7.23.0" "@babel/helper-hoist-variables": "npm:^7.22.5" "@babel/helper-split-export-declaration": "npm:^7.22.6" - "@babel/parser": "npm:^7.23.9" - "@babel/types": "npm:^7.23.9" + "@babel/parser": "npm:^7.24.0" + "@babel/types": "npm:^7.24.0" debug: "npm:^4.3.1" globals: "npm:^11.1.0" - checksum: e2bb845f7f229feb7c338f7e150f5f1abc5395dcd3a6a47f63a25242ec3ec6b165f04a6df7d4849468547faee34eb3cf52487eb0bd867a7d3c42fec2a648266f + checksum: 5cc482248ebb79adcbcf021aab4e0e95bafe2a1736ee4b46abe6f88b59848ad73e15e219db8f06c9a33a14c64257e5b47e53876601e998a8c596accb1b7f4996 languageName: node linkType: hard -"@babel/types@npm:7.23.9, @babel/types@npm:^7.0.0, @babel/types@npm:^7.12.0, @babel/types@npm:^7.13.0, @babel/types@npm:^7.2.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.19, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.6, @babel/types@npm:^7.23.9, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": - version: 7.23.9 - resolution: "@babel/types@npm:7.23.9" +"@babel/types@npm:7.24.0, @babel/types@npm:^7.0.0, @babel/types@npm:^7.12.0, @babel/types@npm:^7.13.0, @babel/types@npm:^7.2.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.19, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.23.6, @babel/types@npm:^7.24.0, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": + version: 7.24.0 + resolution: "@babel/types@npm:7.24.0" dependencies: "@babel/helper-string-parser": "npm:^7.23.4" "@babel/helper-validator-identifier": "npm:^7.22.20" to-fast-properties: "npm:^2.0.0" - checksum: bed9634e5fd0f9dc63c84cfa83316c4cb617192db9fedfea464fca743affe93736d7bf2ebf418ee8358751a9d388e303af87a0c050cb5d87d5870c1b0154f6cb + checksum: a0b4875ce2e132f9daff0d5b27c7f4c4fcc97f2b084bdc5834e92c9d32592778489029e65d99d00c406da612d87b72d7a236c0afccaa1435c028d0c94c9b6da4 languageName: node linkType: hard @@ -5257,7 +5266,7 @@ __metadata: languageName: node linkType: hard -"@metamask/polling-controller@npm:^5.0.0, @metamask/polling-controller@npm:^5.0.1": +"@metamask/polling-controller@npm:^5.0.1": version: 5.0.1 resolution: "@metamask/polling-controller@npm:5.0.1" dependencies: @@ -5488,25 +5497,25 @@ __metadata: languageName: node linkType: hard -"@metamask/smart-transactions-controller@npm:^8.1.0": - version: 8.1.0 - resolution: "@metamask/smart-transactions-controller@npm:8.1.0" +"@metamask/smart-transactions-controller@npm:^10.0.0": + version: 10.0.0 + resolution: "@metamask/smart-transactions-controller@npm:10.0.0" dependencies: "@babel/runtime": "npm:^7.24.1" "@ethereumjs/tx": "npm:^5.2.1" "@ethereumjs/util": "npm:^9.0.2" "@ethersproject/bytes": "npm:^5.7.0" - "@metamask/base-controller": "npm:^4.0.0" - "@metamask/controller-utils": "npm:^8.0.2" + "@metamask/base-controller": "npm:^5.0.1" + "@metamask/controller-utils": "npm:^9.1.0" "@metamask/eth-query": "npm:^4.0.0" - "@metamask/network-controller": "npm:^17.2.0" - "@metamask/polling-controller": "npm:^5.0.0" - "@metamask/transaction-controller": "npm:^25.1.0" + "@metamask/network-controller": "npm:^18.1.0" + "@metamask/polling-controller": "npm:^6.0.1" + "@metamask/transaction-controller": "npm:^28.1.0" bignumber.js: "npm:^9.0.1" events: "npm:^3.3.0" fast-json-patch: "npm:^3.1.0" lodash: "npm:^4.17.21" - checksum: e125be94851c44ddca11719c25228bf0b079666d987b3fb21de233514e7add58633d70167441f9722083afc3c091b9d3966ff03fe8844f30623b403a812729c4 + checksum: f0a3d466761a43171f122d5d00afb80d20ec89689f2194d8f8397c5d698d303d47edf1ba75932b08b8d08156a0e5a21c1e0fd474bcd3b926cda3806e52071bbe languageName: node linkType: hard @@ -5742,8 +5751,8 @@ __metadata: linkType: hard "@metamask/snaps-utils@npm:^7.0.4, @metamask/snaps-utils@npm:^7.1.0": - version: 7.1.0 - resolution: "@metamask/snaps-utils@npm:7.1.0" + version: 7.2.0 + resolution: "@metamask/snaps-utils@npm:7.2.0" dependencies: "@babel/core": "npm:^7.23.2" "@babel/types": "npm:^7.23.0" @@ -5753,7 +5762,7 @@ __metadata: "@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.0.0" + "@metamask/snaps-sdk": "npm:^4.0.1" "@metamask/utils": "npm:^8.3.0" "@noble/hashes": "npm:^1.3.1" "@scure/base": "npm:^1.1.1" @@ -5767,7 +5776,7 @@ __metadata: ses: "npm:^1.1.0" superstruct: "npm:^1.0.3" validate-npm-package-name: "npm:^5.0.0" - checksum: 94e8161b0ebb2d2722689c30eabb3c1b1d6d04bbbcb4c256cbd2649a1b1e1a057af35acefeb9d53e44c4951388a0a95fb9d979ba855379e91d2e8608019bbd94 + checksum: ca2b1e236a708fdfbc46ba2e8b159e9bdd25fc3a21155d00f964da93ecbd77d6b21ad4279dc3248f3033e4d25d013f5c452f991e59426d58825579a6e33c9e5a languageName: node linkType: hard @@ -5841,7 +5850,7 @@ __metadata: languageName: node linkType: hard -"@metamask/transaction-controller@npm:^28.1.1": +"@metamask/transaction-controller@npm:^28.1.0, @metamask/transaction-controller@npm:^28.1.1": version: 28.1.1 resolution: "@metamask/transaction-controller@npm:28.1.1" dependencies: @@ -12257,13 +12266,13 @@ __metadata: linkType: hard "axios@npm:^1.1.3": - version: 1.6.2 - resolution: "axios@npm:1.6.2" + version: 1.6.8 + resolution: "axios@npm:1.6.8" dependencies: - follow-redirects: "npm:^1.15.0" + follow-redirects: "npm:^1.15.6" form-data: "npm:^4.0.0" proxy-from-env: "npm:^1.1.0" - checksum: 612bc93f8f738a518e7c5f9de9cc782bcd36aac6bae279160ef6a10260378e21c1786520eab3336898e3d66e0839ebdf739f327fb6d0431baa4d3235703a7652 + checksum: 3f9a79eaf1d159544fca9576261ff867cbbff64ed30017848e4210e49f3b01e97cf416390150e6fdf6633f336cd43dc1151f890bbd09c3c01ad60bb0891eee63 languageName: node linkType: hard @@ -18769,13 +18778,13 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.14.0, follow-redirects@npm:^1.14.9, follow-redirects@npm:^1.15.0": - version: 1.15.3 - resolution: "follow-redirects@npm:1.15.3" +"follow-redirects@npm:^1.14.0, follow-redirects@npm:^1.14.9, follow-redirects@npm:^1.15.6": + version: 1.15.6 + resolution: "follow-redirects@npm:1.15.6" peerDependenciesMeta: debug: optional: true - checksum: 60d98693f4976892f8c654b16ef6d1803887a951898857ab0cdc009570b1c06314ad499505b7a040ac5b98144939f8597766e5e6a6859c0945d157b473aa6f5f + checksum: 70c7612c4cab18e546e36b991bbf8009a1a41cf85354afe04b113d1117569abf760269409cb3eb842d9f7b03d62826687086b081c566ea7b1e6613cf29030bf7 languageName: node linkType: hard @@ -23603,15 +23612,15 @@ __metadata: linkType: hard "lavamoat-core@npm:^15.1.2": - version: 15.1.2 - resolution: "lavamoat-core@npm:15.1.2" + version: 15.3.0 + resolution: "lavamoat-core@npm:15.3.0" dependencies: - "@babel/types": "npm:7.23.9" + "@babel/types": "npm:7.24.0" json-stable-stringify: "npm:1.1.1" - lavamoat-tofu: "npm:^7.2.0" + lavamoat-tofu: "npm:^7.2.3" merge-deep: "npm:3.0.3" - type-fest: "npm:4.10.2" - checksum: a29625b74afbd3346bc3d8b19f5bc210248e237065df3add28fefb23f4d65eb5cc889260275bfa0cd24ee59a609f3c3e6453376e7173cb96c3bc8da135eb83f4 + type-fest: "npm:4.13.1" + checksum: 567e186017eba440a683c2d286fce14ca050762c3a24d80f4b57fd00aab3762680180ce867fff6bb301051fb3cc5a74506515fdd5b9f87a3b571f4e6edc8043d languageName: node linkType: hard @@ -23627,18 +23636,18 @@ __metadata: languageName: node linkType: hard -"lavamoat-tofu@npm:^7.1.0, lavamoat-tofu@npm:^7.2.0": - version: 7.2.0 - resolution: "lavamoat-tofu@npm:7.2.0" +"lavamoat-tofu@npm:^7.1.0, lavamoat-tofu@npm:^7.2.3": + version: 7.2.3 + resolution: "lavamoat-tofu@npm:7.2.3" dependencies: - "@babel/parser": "npm:7.23.9" - "@babel/traverse": "npm:7.23.9" - "@babel/types": "npm:7.23.9" + "@babel/parser": "npm:7.24.0" + "@babel/traverse": "npm:7.24.0" + "@babel/types": "npm:7.24.0" "@types/babel__traverse": "npm:7.20.5" - type-fest: "npm:4.10.2" + type-fest: "npm:4.13.1" peerDependencies: - lavamoat-core: ^15.1.2 - checksum: 66ddd5075ad4543a8376a7047d1461225da483e8f9c312dec44305b0ea6636e34f3540d0970b0a88a96db292bfbd2eb4fe4f6afc652d255a514cb918d21348b8 + lavamoat-core: ^15.3.0 + checksum: c0f67b47107b1fa6b319c37fca74611adb42b0d1bcf593923dd200e8de1783ff3f05435f806842cef888cfd2b8d589889541b8fdaa7aeb445482516dc0e8bfcc languageName: node linkType: hard @@ -24995,7 +25004,7 @@ __metadata: "@metamask/scure-bip39": "npm:^2.0.3" "@metamask/selected-network-controller": "npm:^9.0.0" "@metamask/signature-controller": "npm:^12.0.0" - "@metamask/smart-transactions-controller": "npm:^8.1.0" + "@metamask/smart-transactions-controller": "npm:^10.0.0" "@metamask/snaps-controllers": "npm:^6.0.4" "@metamask/snaps-execution-environments": "npm:^5.0.4" "@metamask/snaps-rpc-methods": "npm:^7.0.2" @@ -33863,10 +33872,10 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:4.10.2": - version: 4.10.2 - resolution: "type-fest@npm:4.10.2" - checksum: 2b1ad1270d9fabeeb506ba831d513caeb05bfc852e5e012511d785ce9dc68d773fe0a42bddf857a362c7f3406244809c5b8a698b743bb7617d4a8c470672087f +"type-fest@npm:4.13.1": + version: 4.13.1 + resolution: "type-fest@npm:4.13.1" + checksum: 3a5db31e45d79dae6d7810b3e6180fed117cfeec7b9f0d3ebbc3780dc53297f9f0dea1752cd8d1f42c2f8206f9a1091a18aa38eb3cb9923a4c79aea480404182 languageName: node linkType: hard @@ -33977,7 +33986,17 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.0.4, typescript@npm:^5.2.2, typescript@npm:~5.3.3": +"typescript@npm:^5.0.4, typescript@npm:^5.2.2": + version: 5.4.5 + resolution: "typescript@npm:5.4.5" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: d04a9e27e6d83861f2126665aa8d84847e8ebabcea9125b9ebc30370b98cb38b5dff2508d74e2326a744938191a83a69aa9fddab41f193ffa43eabfdf3f190a5 + languageName: node + linkType: hard + +"typescript@npm:~5.3.3": version: 5.3.3 resolution: "typescript@npm:5.3.3" bin: @@ -33987,7 +34006,17 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.0.4#optional!builtin, typescript@patch:typescript@npm%3A^5.2.2#optional!builtin, typescript@patch:typescript@npm%3A~5.3.3#optional!builtin": +"typescript@patch:typescript@npm%3A^5.0.4#optional!builtin, typescript@patch:typescript@npm%3A^5.2.2#optional!builtin": + version: 5.4.5 + resolution: "typescript@patch:typescript@npm%3A5.4.5#optional!builtin::version=5.4.5&hash=e012d7" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 584be8bac7112ad49a9eb9992f71d542b1ff2fafb5bb315e1c196145e8feab589f1d7223cfb2d5df6770789582e6918f8287d1f2f89911b38eb80e29c560ad00 + languageName: node + linkType: hard + +"typescript@patch:typescript@npm%3A~5.3.3#optional!builtin": version: 5.3.3 resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7" bin: