From e6f3c674ee4f0b39148f7aac6d0cde2d82338dab Mon Sep 17 00:00:00 2001 From: Matteo Scurati Date: Wed, 23 Oct 2024 14:37:03 +0200 Subject: [PATCH 1/4] feat: enable preview token (#27809) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** This PR introduces the ability for the user to utilize a preview token generated by Contentful to view unpublished content. The PR is particularly useful for the marketing team, allowing them to test product announcements before they are published. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27809?quickstart=1) ## **Related issues** N/A ## **Manual testing steps** 1. knowing the preview token 2. view the page `chrome-extension://ehkbeholfhcimjldhdaffdhalaalmdkp/home.html?previewToken=000` 3. go to the notifications section 4. also view the content still in draft in Contentful ## **Screenshots/Recordings** N/A ### **Before** N/A ### **After** N/A ## **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. --- .../metamask-notifications/useNotifications.ts | 7 ++++++- ui/store/actions.test.js | 4 ++-- ui/store/actions.ts | 14 ++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ui/hooks/metamask-notifications/useNotifications.ts b/ui/hooks/metamask-notifications/useNotifications.ts index 62367cdbe310..9724253a8671 100644 --- a/ui/hooks/metamask-notifications/useNotifications.ts +++ b/ui/hooks/metamask-notifications/useNotifications.ts @@ -54,8 +54,13 @@ export function useListNotifications(): { setLoading(true); setError(null); + const urlParams = new URLSearchParams(window.location.search); + const previewToken = urlParams.get('previewToken'); + try { - const data = await dispatch(fetchAndUpdateMetamaskNotifications()); + const data = await dispatch( + fetchAndUpdateMetamaskNotifications(previewToken ?? undefined), + ); setNotificationsData(data as unknown as Notification[]); return data as unknown as Notification[]; } catch (e) { diff --git a/ui/store/actions.test.js b/ui/store/actions.test.js index d86ea20f845c..22e8db2fa281 100644 --- a/ui/store/actions.test.js +++ b/ui/store/actions.test.js @@ -2258,7 +2258,7 @@ describe('Actions', () => { const fetchAndUpdateMetamaskNotificationsStub = sinon .stub() - .callsFake((cb) => cb()); + .callsFake((_, cb) => cb()); const forceUpdateMetamaskStateStub = sinon.stub().callsFake((cb) => cb()); background.getApi.returns({ @@ -2280,7 +2280,7 @@ describe('Actions', () => { const fetchAndUpdateMetamaskNotificationsStub = sinon .stub() - .callsFake((cb) => cb(error)); + .callsFake((_, cb) => cb(error)); const forceUpdateMetamaskStateStub = sinon .stub() .callsFake((cb) => cb(error)); diff --git a/ui/store/actions.ts b/ui/store/actions.ts index 91e4530035b5..09f819711fcd 100644 --- a/ui/store/actions.ts +++ b/ui/store/actions.ts @@ -5423,22 +5423,20 @@ export function updateOnChainTriggersByAccount( /** * Fetches and updates MetaMask notifications. * - * This function sends a request to the background script to fetch the latest notifications and update the state accordingly. - * Upon success, it dispatches an action with type `FETCH_AND_UPDATE_METAMASK_NOTIFICATIONS` to update the Redux state. + * This function sends a request to the background script to fetch the latest notifications. * If the operation encounters an error, it logs the error message and rethrows the error to ensure it is handled appropriately. * + * @param previewToken - Optional preview token for fetching draft feature announcements. * @returns A thunk action that, when dispatched, attempts to fetch and update MetaMask notifications. */ -export function fetchAndUpdateMetamaskNotifications(): ThunkAction< - void, - MetaMaskReduxState, - unknown, - AnyAction -> { +export function fetchAndUpdateMetamaskNotifications( + previewToken?: string, +): ThunkAction { return async () => { try { const response = await submitRequestToBackground( 'fetchAndUpdateMetamaskNotifications', + [previewToken], ); return response; } catch (error) { From 266990bb723a4368b1946242f40c85afaef28696 Mon Sep 17 00:00:00 2001 From: martahj Date: Wed, 23 Oct 2024 10:16:43 -0500 Subject: [PATCH 2/4] fix: adjust spacing of quote rate in swaps (#28016) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** The [PR to remove the legacy swaps code](https://github.com/MetaMask/metamask-extension/pull/27679) inadvertently caused a misalignment of the quote rate. This PR re-aligns it to be where it is expected. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28016?quickstart=1) ## **Manual testing steps** 1. Start a swap 2. Notice that the quote rate is back on one line and the value is left-aligned ## **Screenshots/Recordings** ### **Before** ![Screenshot 2024-10-11 at 11 32 09 AM](https://github.com/user-attachments/assets/aae5da2f-ae66-46f5-9168-6c6ed496a2a8) ### **After** Screenshot 2024-10-22 at 12 13 50 PM ## **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. --- ui/pages/swaps/prepare-swap-page/index.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/pages/swaps/prepare-swap-page/index.scss b/ui/pages/swaps/prepare-swap-page/index.scss index 60e24c6cdbce..b443006330d3 100644 --- a/ui/pages/swaps/prepare-swap-page/index.scss +++ b/ui/pages/swaps/prepare-swap-page/index.scss @@ -263,7 +263,7 @@ } &__exchange-rate-display { - color: var(--color-text-alternative); + width: auto !important; } } From a91c2d0c528e48e79bb064ca00c325a955c53a75 Mon Sep 17 00:00:00 2001 From: Pedro Figueiredo Date: Wed, 23 Oct 2024 16:24:05 +0100 Subject: [PATCH 3/4] fix: Gas changes for low Max base fee and Priority fee (#28037) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Previously, if the Max base fee and Priority fee were reduced to very low values, the Network fee wouldn't update accordingly. This is a discrepancy with the gas calculations in the old flows. What fixes it is, for low enough values of `maxFeePerGas` (low enough to be lower than `minimumFeePerGas`), the Network fee becomes the Max fee -- `maxFeePerGas` times `gasLimit` directly. Apart from fixing the symptom explained above, this ensures that the Network fee is never higher than the Max fee. The PR also fixes this calculation when it comes to the L2 fees (inside `useTransactionGasFeeEstimate`). It also adds a missing override of `dappSuggestedFees` for both `maxFeePerGas` and `maxPriorityFeePerGas` (inside `useEIP1559TxFees`). [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28037?quickstart=1) ## **Related issues** Fixes: https://github.com/MetaMask/metamask-extension/issues/27802 ## **Manual testing steps** See original report above. ## **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. --- .../confirm/info/hooks/useEIP1559TxFees.ts | 5 ++++- .../confirm/info/hooks/useFeeCalculations.ts | 13 ++++++++++++- .../info/hooks/useTransactionGasFeeEstimate.ts | 12 +++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ui/pages/confirmations/components/confirm/info/hooks/useEIP1559TxFees.ts b/ui/pages/confirmations/components/confirm/info/hooks/useEIP1559TxFees.ts index 40aca7cf2d31..e4bfaad8d779 100644 --- a/ui/pages/confirmations/components/confirm/info/hooks/useEIP1559TxFees.ts +++ b/ui/pages/confirmations/components/confirm/info/hooks/useEIP1559TxFees.ts @@ -8,8 +8,11 @@ export const useEIP1559TxFees = ( maxFeePerGas: string; maxPriorityFeePerGas: string; } => { - const hexMaxFeePerGas = transactionMeta?.txParams?.maxFeePerGas; + const hexMaxFeePerGas = + transactionMeta.dappSuggestedGasFees?.maxFeePerGas || + transactionMeta?.txParams?.maxFeePerGas; const hexMaxPriorityFeePerGas = + transactionMeta.dappSuggestedGasFees?.maxPriorityFeePerGas || transactionMeta?.txParams?.maxPriorityFeePerGas; return useMemo(() => { diff --git a/ui/pages/confirmations/components/confirm/info/hooks/useFeeCalculations.ts b/ui/pages/confirmations/components/confirm/info/hooks/useFeeCalculations.ts index ceb8a4b2d248..587d70c9c9ef 100644 --- a/ui/pages/confirmations/components/confirm/info/hooks/useFeeCalculations.ts +++ b/ui/pages/confirmations/components/confirm/info/hooks/useFeeCalculations.ts @@ -12,6 +12,7 @@ import { getValueFromWeiHex, multiplyHexes, } from '../../../../../../../shared/modules/conversion.utils'; +import { Numeric } from '../../../../../../../shared/modules/Numeric'; import { getConversionRate } from '../../../../../../ducks/metamask/metamask'; import { useFiatFormatter } from '../../../../../../hooks/useFiatFormatter'; import { useGasFeeEstimates } from '../../../../../../hooks/useGasFeeEstimates'; @@ -114,11 +115,21 @@ export function useFeeCalculations(transactionMeta: TransactionMeta) { } // Logic for any network without L1 and L2 fee components - const minimumFeePerGas = addHexes( + let minimumFeePerGas = addHexes( decGWEIToHexWEI(estimatedBaseFee) || HEX_ZERO, decimalToHex(maxPriorityFeePerGas), ); + // `minimumFeePerGas` should never be higher than the `maxFeePerGas` + if ( + new Numeric(minimumFeePerGas, 16).greaterThan( + decimalToHex(maxFeePerGas), + 16, + ) + ) { + minimumFeePerGas = decimalToHex(maxFeePerGas); + } + const estimatedFee = multiplyHexes( supportsEIP1559 ? (minimumFeePerGas as Hex) : (gasPrice as Hex), gasLimit as Hex, diff --git a/ui/pages/confirmations/components/confirm/info/hooks/useTransactionGasFeeEstimate.ts b/ui/pages/confirmations/components/confirm/info/hooks/useTransactionGasFeeEstimate.ts index 31802eb22feb..f5866a283935 100644 --- a/ui/pages/confirmations/components/confirm/info/hooks/useTransactionGasFeeEstimate.ts +++ b/ui/pages/confirmations/components/confirm/info/hooks/useTransactionGasFeeEstimate.ts @@ -5,6 +5,7 @@ import { addHexes, multiplyHexes, } from '../../../../../../../shared/modules/conversion.utils'; +import { Numeric } from '../../../../../../../shared/modules/Numeric'; import { useGasFeeEstimates } from '../../../../../../hooks/useGasFeeEstimates'; import { HEX_ZERO } from '../shared/constants'; @@ -28,15 +29,24 @@ export function useTransactionGasFeeEstimate( transactionMeta.dappSuggestedGasFees?.maxPriorityFeePerGas || transactionMeta.txParams?.maxPriorityFeePerGas || HEX_ZERO; + const maxFeePerGas = + transactionMeta.dappSuggestedGasFees?.maxFeePerGas || + transactionMeta.txParams?.maxFeePerGas || + HEX_ZERO; let gasEstimate: Hex; if (supportsEIP1559) { // Minimum Total Fee = (estimatedBaseFee + maxPriorityFeePerGas) * gasLimit - const minimumFeePerGas = addHexes( + let minimumFeePerGas = addHexes( estimatedBaseFee || HEX_ZERO, maxPriorityFeePerGas, ); + // `minimumFeePerGas` should never be higher than the `maxFeePerGas` + if (new Numeric(minimumFeePerGas, 16).greaterThan(maxFeePerGas, 16)) { + minimumFeePerGas = maxFeePerGas; + } + gasEstimate = multiplyHexes(minimumFeePerGas as Hex, gasLimit as Hex); } else { gasEstimate = multiplyHexes(gasPrice as Hex, gasLimit as Hex); From 566833380af10cadcf232e14b34bb4a7136859ba Mon Sep 17 00:00:00 2001 From: legobeat <109787230+legobeat@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:27:04 +0000 Subject: [PATCH 4/4] fix(deps): @keystonehq/metamask-airgapped-keyring@^0.13.1->^0.14.1 (#27952) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## **Description** Bump `@keystonehq/metamask-airgapped-kayring`, removing dependency on legacy `@metamask/obs-store`. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27952?quickstart=1) ## **Related issues** ## **Manual testing steps** - Test basic HW wallet flow with Keystone wallet ## **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** - [ ] 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. --- lavamoat/browserify/beta/policy.json | 84 +++++---------------------- lavamoat/browserify/flask/policy.json | 84 +++++---------------------- lavamoat/browserify/main/policy.json | 84 +++++---------------------- lavamoat/browserify/mmi/policy.json | 84 +++++---------------------- package.json | 2 +- yarn.lock | 33 +---------- 6 files changed, 58 insertions(+), 313 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 28c2fc85c8a6..86597b9a15fa 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -370,9 +370,9 @@ "@ethereumjs/tx": true, "@keystonehq/bc-ur-registry-eth": true, "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store": true, + "@keystonehq/metamask-airgapped-keyring>rlp": true, + "@metamask/obs-store": true, "browserify>buffer": true, - "ethereumjs-util>rlp": true, "uuid": true, "webpack>events": true } @@ -382,65 +382,18 @@ "@ethereumjs/tx": true, "@ethereumjs/tx>@ethereumjs/util": true, "@keystonehq/bc-ur-registry-eth": true, - "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>rlp": true, "@metamask/eth-trezor-keyring>hdkey": true, "browserify>buffer": true, + "eth-lattice-keyring>rlp": true, "uuid": true } }, - "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>rlp": { - "globals": { - "TextEncoder": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>@metamask/safe-event-emitter": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2": true, - "stream-browserify": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>@metamask/safe-event-emitter": { - "globals": { - "setTimeout": true - }, - "packages": { - "webpack>events": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream": true, - "browserify>util": true, - "process": true, - "watchify>xtend": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>isarray": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>string_decoder": true, - "browserify>browser-resolve": true, - "browserify>timers-browserify": true, - "process": true, - "pumpify>inherits": true, - "readable-stream-2>core-util-is": true, - "readable-stream-2>process-nextick-args": true, - "readable-stream>util-deprecate": true, - "webpack>events": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": { + "@keystonehq/metamask-airgapped-keyring>rlp": { "packages": { + "bn.js": true, "browserify>buffer": true } }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>string_decoder": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": true - } - }, "@lavamoat/lavadome-react": { "globals": { "Document.prototype": true, @@ -1409,12 +1362,18 @@ "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": { "packages": { "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, + "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util>rlp": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, - "ethereumjs-util>create-hash": true, - "ethereumjs-util>rlp": true + "ethereumjs-util>create-hash": true + } + }, + "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util>rlp": { + "packages": { + "bn.js": true, + "browserify>buffer": true } }, "@metamask/logging-controller": { @@ -4087,9 +4046,9 @@ "eth-lattice-keyring>gridplus-sdk>bignumber.js": true, "eth-lattice-keyring>gridplus-sdk>bitwise": true, "eth-lattice-keyring>gridplus-sdk>borc": true, - "eth-lattice-keyring>gridplus-sdk>rlp": true, "eth-lattice-keyring>gridplus-sdk>secp256k1": true, "eth-lattice-keyring>gridplus-sdk>uuid": true, + "eth-lattice-keyring>rlp": true, "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethers>@ethersproject/sha2>hash.js": true, "lodash": true @@ -4143,11 +4102,6 @@ "location": true } }, - "eth-lattice-keyring>gridplus-sdk>rlp": { - "globals": { - "TextEncoder": true - } - }, "eth-lattice-keyring>gridplus-sdk>secp256k1": { "packages": { "@metamask/ppom-validator>elliptic": true @@ -5362,16 +5316,6 @@ "webpack>events": true } }, - "readable-stream-2>core-util-is": { - "packages": { - "browserify>insert-module-globals>is-buffer": true - } - }, - "readable-stream-2>process-nextick-args": { - "packages": { - "process": true - } - }, "readable-stream>util-deprecate": { "globals": { "console.trace": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 28c2fc85c8a6..86597b9a15fa 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -370,9 +370,9 @@ "@ethereumjs/tx": true, "@keystonehq/bc-ur-registry-eth": true, "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store": true, + "@keystonehq/metamask-airgapped-keyring>rlp": true, + "@metamask/obs-store": true, "browserify>buffer": true, - "ethereumjs-util>rlp": true, "uuid": true, "webpack>events": true } @@ -382,65 +382,18 @@ "@ethereumjs/tx": true, "@ethereumjs/tx>@ethereumjs/util": true, "@keystonehq/bc-ur-registry-eth": true, - "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>rlp": true, "@metamask/eth-trezor-keyring>hdkey": true, "browserify>buffer": true, + "eth-lattice-keyring>rlp": true, "uuid": true } }, - "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>rlp": { - "globals": { - "TextEncoder": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>@metamask/safe-event-emitter": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2": true, - "stream-browserify": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>@metamask/safe-event-emitter": { - "globals": { - "setTimeout": true - }, - "packages": { - "webpack>events": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream": true, - "browserify>util": true, - "process": true, - "watchify>xtend": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>isarray": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>string_decoder": true, - "browserify>browser-resolve": true, - "browserify>timers-browserify": true, - "process": true, - "pumpify>inherits": true, - "readable-stream-2>core-util-is": true, - "readable-stream-2>process-nextick-args": true, - "readable-stream>util-deprecate": true, - "webpack>events": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": { + "@keystonehq/metamask-airgapped-keyring>rlp": { "packages": { + "bn.js": true, "browserify>buffer": true } }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>string_decoder": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": true - } - }, "@lavamoat/lavadome-react": { "globals": { "Document.prototype": true, @@ -1409,12 +1362,18 @@ "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": { "packages": { "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, + "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util>rlp": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, - "ethereumjs-util>create-hash": true, - "ethereumjs-util>rlp": true + "ethereumjs-util>create-hash": true + } + }, + "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util>rlp": { + "packages": { + "bn.js": true, + "browserify>buffer": true } }, "@metamask/logging-controller": { @@ -4087,9 +4046,9 @@ "eth-lattice-keyring>gridplus-sdk>bignumber.js": true, "eth-lattice-keyring>gridplus-sdk>bitwise": true, "eth-lattice-keyring>gridplus-sdk>borc": true, - "eth-lattice-keyring>gridplus-sdk>rlp": true, "eth-lattice-keyring>gridplus-sdk>secp256k1": true, "eth-lattice-keyring>gridplus-sdk>uuid": true, + "eth-lattice-keyring>rlp": true, "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethers>@ethersproject/sha2>hash.js": true, "lodash": true @@ -4143,11 +4102,6 @@ "location": true } }, - "eth-lattice-keyring>gridplus-sdk>rlp": { - "globals": { - "TextEncoder": true - } - }, "eth-lattice-keyring>gridplus-sdk>secp256k1": { "packages": { "@metamask/ppom-validator>elliptic": true @@ -5362,16 +5316,6 @@ "webpack>events": true } }, - "readable-stream-2>core-util-is": { - "packages": { - "browserify>insert-module-globals>is-buffer": true - } - }, - "readable-stream-2>process-nextick-args": { - "packages": { - "process": true - } - }, "readable-stream>util-deprecate": { "globals": { "console.trace": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 28c2fc85c8a6..86597b9a15fa 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -370,9 +370,9 @@ "@ethereumjs/tx": true, "@keystonehq/bc-ur-registry-eth": true, "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store": true, + "@keystonehq/metamask-airgapped-keyring>rlp": true, + "@metamask/obs-store": true, "browserify>buffer": true, - "ethereumjs-util>rlp": true, "uuid": true, "webpack>events": true } @@ -382,65 +382,18 @@ "@ethereumjs/tx": true, "@ethereumjs/tx>@ethereumjs/util": true, "@keystonehq/bc-ur-registry-eth": true, - "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>rlp": true, "@metamask/eth-trezor-keyring>hdkey": true, "browserify>buffer": true, + "eth-lattice-keyring>rlp": true, "uuid": true } }, - "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>rlp": { - "globals": { - "TextEncoder": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>@metamask/safe-event-emitter": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2": true, - "stream-browserify": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>@metamask/safe-event-emitter": { - "globals": { - "setTimeout": true - }, - "packages": { - "webpack>events": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream": true, - "browserify>util": true, - "process": true, - "watchify>xtend": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>isarray": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>string_decoder": true, - "browserify>browser-resolve": true, - "browserify>timers-browserify": true, - "process": true, - "pumpify>inherits": true, - "readable-stream-2>core-util-is": true, - "readable-stream-2>process-nextick-args": true, - "readable-stream>util-deprecate": true, - "webpack>events": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": { + "@keystonehq/metamask-airgapped-keyring>rlp": { "packages": { + "bn.js": true, "browserify>buffer": true } }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>string_decoder": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": true - } - }, "@lavamoat/lavadome-react": { "globals": { "Document.prototype": true, @@ -1409,12 +1362,18 @@ "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": { "packages": { "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, + "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util>rlp": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, - "ethereumjs-util>create-hash": true, - "ethereumjs-util>rlp": true + "ethereumjs-util>create-hash": true + } + }, + "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util>rlp": { + "packages": { + "bn.js": true, + "browserify>buffer": true } }, "@metamask/logging-controller": { @@ -4087,9 +4046,9 @@ "eth-lattice-keyring>gridplus-sdk>bignumber.js": true, "eth-lattice-keyring>gridplus-sdk>bitwise": true, "eth-lattice-keyring>gridplus-sdk>borc": true, - "eth-lattice-keyring>gridplus-sdk>rlp": true, "eth-lattice-keyring>gridplus-sdk>secp256k1": true, "eth-lattice-keyring>gridplus-sdk>uuid": true, + "eth-lattice-keyring>rlp": true, "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethers>@ethersproject/sha2>hash.js": true, "lodash": true @@ -4143,11 +4102,6 @@ "location": true } }, - "eth-lattice-keyring>gridplus-sdk>rlp": { - "globals": { - "TextEncoder": true - } - }, "eth-lattice-keyring>gridplus-sdk>secp256k1": { "packages": { "@metamask/ppom-validator>elliptic": true @@ -5362,16 +5316,6 @@ "webpack>events": true } }, - "readable-stream-2>core-util-is": { - "packages": { - "browserify>insert-module-globals>is-buffer": true - } - }, - "readable-stream-2>process-nextick-args": { - "packages": { - "process": true - } - }, "readable-stream>util-deprecate": { "globals": { "console.trace": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 923c51a9c32b..db949049605f 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -370,9 +370,9 @@ "@ethereumjs/tx": true, "@keystonehq/bc-ur-registry-eth": true, "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store": true, + "@keystonehq/metamask-airgapped-keyring>rlp": true, + "@metamask/obs-store": true, "browserify>buffer": true, - "ethereumjs-util>rlp": true, "uuid": true, "webpack>events": true } @@ -382,65 +382,18 @@ "@ethereumjs/tx": true, "@ethereumjs/tx>@ethereumjs/util": true, "@keystonehq/bc-ur-registry-eth": true, - "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>rlp": true, "@metamask/eth-trezor-keyring>hdkey": true, "browserify>buffer": true, + "eth-lattice-keyring>rlp": true, "uuid": true } }, - "@keystonehq/metamask-airgapped-keyring>@keystonehq/base-eth-keyring>rlp": { - "globals": { - "TextEncoder": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>@metamask/safe-event-emitter": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2": true, - "stream-browserify": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>@metamask/safe-event-emitter": { - "globals": { - "setTimeout": true - }, - "packages": { - "webpack>events": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream": true, - "browserify>util": true, - "process": true, - "watchify>xtend": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>isarray": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": true, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>string_decoder": true, - "browserify>browser-resolve": true, - "browserify>timers-browserify": true, - "process": true, - "pumpify>inherits": true, - "readable-stream-2>core-util-is": true, - "readable-stream-2>process-nextick-args": true, - "readable-stream>util-deprecate": true, - "webpack>events": true - } - }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": { + "@keystonehq/metamask-airgapped-keyring>rlp": { "packages": { + "bn.js": true, "browserify>buffer": true } }, - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>string_decoder": { - "packages": { - "@keystonehq/metamask-airgapped-keyring>@metamask/obs-store>through2>readable-stream>safe-buffer": true - } - }, "@lavamoat/lavadome-react": { "globals": { "Document.prototype": true, @@ -1501,12 +1454,18 @@ "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util": { "packages": { "@metamask/keyring-controller>ethereumjs-wallet>ethereum-cryptography": true, + "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util>rlp": true, "bn.js": true, "browserify>assert": true, "browserify>buffer": true, "browserify>insert-module-globals>is-buffer": true, - "ethereumjs-util>create-hash": true, - "ethereumjs-util>rlp": true + "ethereumjs-util>create-hash": true + } + }, + "@metamask/keyring-controller>ethereumjs-wallet>ethereumjs-util>rlp": { + "packages": { + "bn.js": true, + "browserify>buffer": true } }, "@metamask/logging-controller": { @@ -4179,9 +4138,9 @@ "eth-lattice-keyring>gridplus-sdk>bignumber.js": true, "eth-lattice-keyring>gridplus-sdk>bitwise": true, "eth-lattice-keyring>gridplus-sdk>borc": true, - "eth-lattice-keyring>gridplus-sdk>rlp": true, "eth-lattice-keyring>gridplus-sdk>secp256k1": true, "eth-lattice-keyring>gridplus-sdk>uuid": true, + "eth-lattice-keyring>rlp": true, "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethers>@ethersproject/sha2>hash.js": true, "lodash": true @@ -4235,11 +4194,6 @@ "location": true } }, - "eth-lattice-keyring>gridplus-sdk>rlp": { - "globals": { - "TextEncoder": true - } - }, "eth-lattice-keyring>gridplus-sdk>secp256k1": { "packages": { "@metamask/ppom-validator>elliptic": true @@ -5430,16 +5384,6 @@ "webpack>events": true } }, - "readable-stream-2>core-util-is": { - "packages": { - "browserify>insert-module-globals>is-buffer": true - } - }, - "readable-stream-2>process-nextick-args": { - "packages": { - "process": true - } - }, "readable-stream>util-deprecate": { "globals": { "console.trace": true, diff --git a/package.json b/package.json index 007077424491..4825184fddc4 100644 --- a/package.json +++ b/package.json @@ -288,7 +288,7 @@ "@ethersproject/wallet": "^5.7.0", "@fortawesome/fontawesome-free": "^5.13.0", "@keystonehq/bc-ur-registry-eth": "^0.19.1", - "@keystonehq/metamask-airgapped-keyring": "^0.13.1", + "@keystonehq/metamask-airgapped-keyring": "^0.14.1", "@lavamoat/lavadome-react": "0.0.17", "@lavamoat/snow": "^2.0.2", "@material-ui/core": "^4.11.0", diff --git a/yarn.lock b/yarn.lock index 01eea754a391..0674403766f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4172,20 +4172,6 @@ __metadata: languageName: node linkType: hard -"@keystonehq/metamask-airgapped-keyring@npm:^0.13.1": - version: 0.13.1 - resolution: "@keystonehq/metamask-airgapped-keyring@npm:0.13.1" - dependencies: - "@ethereumjs/tx": "npm:^4.0.2" - "@keystonehq/base-eth-keyring": "npm:^0.14.1" - "@keystonehq/bc-ur-registry-eth": "npm:^0.19.1" - "@metamask/obs-store": "npm:^7.0.0" - rlp: "npm:^2.2.6" - uuid: "npm:^8.3.2" - checksum: 10/a12870b4527ae91cbad1995700f0710188c6fd9d2c6c2d9b398c25d96c4267fa4812e075a117c05c5edd9f6ada2c525562b5a6df3a0881c938900ff0c88791ee - languageName: node - linkType: hard - "@keystonehq/metamask-airgapped-keyring@npm:^0.14.1": version: 0.14.1 resolution: "@keystonehq/metamask-airgapped-keyring@npm:0.14.1" @@ -5838,16 +5824,6 @@ __metadata: languageName: node linkType: hard -"@metamask/obs-store@npm:^7.0.0": - version: 7.0.0 - resolution: "@metamask/obs-store@npm:7.0.0" - dependencies: - "@metamask/safe-event-emitter": "npm:^2.0.0" - through2: "npm:^2.0.3" - checksum: 10/e1497140384de0ac689adbe7286df43e843c5d73fd8ba7080af2faab3de73e823b46b8214be1c839d9e9e5f86fb40df50a26e93bae936329daeaedae5e523323 - languageName: node - linkType: hard - "@metamask/obs-store@npm:^9.0.0": version: 9.0.0 resolution: "@metamask/obs-store@npm:9.0.0" @@ -6131,13 +6107,6 @@ __metadata: languageName: node linkType: hard -"@metamask/safe-event-emitter@npm:^2.0.0": - version: 2.0.0 - resolution: "@metamask/safe-event-emitter@npm:2.0.0" - checksum: 10/3e4f00c64aa1ddf9b9ae5c2337fb8cee359b6c481ded0ec21ef70610960c51cdcc4a9b569de334dcd7cb1fe445cafd298360907c1e211e244c5990b55246f350 - languageName: node - linkType: hard - "@metamask/safe-event-emitter@npm:^3.0.0, @metamask/safe-event-emitter@npm:^3.1.1": version: 3.1.1 resolution: "@metamask/safe-event-emitter@npm:3.1.1" @@ -25916,7 +25885,7 @@ __metadata: "@fortawesome/fontawesome-free": "npm:^5.13.0" "@jest/globals": "npm:^29.7.0" "@keystonehq/bc-ur-registry-eth": "npm:^0.19.1" - "@keystonehq/metamask-airgapped-keyring": "npm:^0.13.1" + "@keystonehq/metamask-airgapped-keyring": "npm:^0.14.1" "@lavamoat/allow-scripts": "npm:^3.0.4" "@lavamoat/lavadome-core": "npm:0.0.10" "@lavamoat/lavadome-react": "npm:0.0.17"