From b69032cb5e856b2a2b20c37c0acb536fb24cfc3d Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Sun, 12 Jan 2025 14:19:13 +0100 Subject: [PATCH 1/2] chore: remove @metemask/eth-query package --- .../eth-query-npm-2.1.2-7c6adc825f.patch | 27 --------- .../controllers/account-tracker-controller.ts | 26 ++++---- .../lib/transaction/decode/proxy.test.ts | 30 +++++----- app/scripts/lib/transaction/decode/proxy.ts | 19 +++--- .../lib/transaction/decode/util.test.ts | 12 ++-- app/scripts/lib/transaction/decode/util.ts | 8 +-- app/scripts/metamask-controller.js | 59 +++++++++---------- app/scripts/metamask-controller.test.js | 10 ++-- app/scripts/ui.js | 2 - package.json | 3 - types/eth-query.d.ts | 50 ---------------- ui/ducks/swaps/swaps.js | 20 ++++++- yarn.lock | 1 - 13 files changed, 101 insertions(+), 166 deletions(-) delete mode 100644 .yarn/patches/eth-query-npm-2.1.2-7c6adc825f.patch delete mode 100644 types/eth-query.d.ts diff --git a/.yarn/patches/eth-query-npm-2.1.2-7c6adc825f.patch b/.yarn/patches/eth-query-npm-2.1.2-7c6adc825f.patch deleted file mode 100644 index e801e600534c..000000000000 --- a/.yarn/patches/eth-query-npm-2.1.2-7c6adc825f.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/index.js b/index.js -index 13e9f3c25e7d3bee6a4ec3c2c5e1eea31e86a377..18b050ded27baf3603708fd6d595a554ea3c19c8 100644 ---- a/index.js -+++ b/index.js -@@ -1,9 +1,9 @@ - const extend = require('xtend') - const createRandomId = require('json-rpc-random-id')() -+const debug = require('debug')('eth-query') - - module.exports = EthQuery - -- - function EthQuery(provider){ - const self = this - self.currentProvider = provider -@@ -63,7 +63,10 @@ EthQuery.prototype.submitHashrate = generateFnFor('eth_subm - - EthQuery.prototype.sendAsync = function(opts, cb){ - const self = this -- self.currentProvider.sendAsync(createPayload(opts), function(err, response){ -+ const payload = createPayload(opts) -+ debug('making request %o', payload) -+ self.currentProvider.sendAsync(payload, function(err, response){ -+ debug('got err = %o, response = %o', err, response) - if (!err && response.error) err = new Error('EthQuery - RPC Error - '+response.error.message) - if (err) return cb(err) - cb(null, response.result) diff --git a/app/scripts/controllers/account-tracker-controller.ts b/app/scripts/controllers/account-tracker-controller.ts index ec6ba74ceec2..54d55d3d0bff 100644 --- a/app/scripts/controllers/account-tracker-controller.ts +++ b/app/scripts/controllers/account-tracker-controller.ts @@ -7,11 +7,9 @@ * on each new block. */ -import EthQuery from '@metamask/eth-query'; import { v4 as random } from 'uuid'; import log from 'loglevel'; -import pify from 'pify'; import { Web3Provider } from '@ethersproject/providers'; import { Contract } from '@ethersproject/contracts'; import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi'; @@ -24,7 +22,7 @@ import { NetworkControllerGetStateAction, Provider, } from '@metamask/network-controller'; -import { hasProperty, Hex } from '@metamask/utils'; +import { hasProperty, type Hex, type JsonRpcParams } from '@metamask/utils'; import { BaseController, ControllerGetStateAction, @@ -481,7 +479,7 @@ export default class AccountTrackerController extends BaseController< * AccountTrackerController. * * Once this AccountTrackerController accounts are up to date with those referenced by the passed addresses, each - * of these accounts are given an updated balance via EthQuery. + * of these accounts are given an updated balance via Provider. * * @param addresses - The array of hex addresses for accounts with which this AccountTrackerController accounts should be * in sync @@ -588,7 +586,7 @@ export default class AccountTrackerController extends BaseController< /** * Given a block, updates this AccountTrackerController currentBlockGasLimit and currentBlockGasLimitByChainId and then updates - * each local account's balance via EthQuery + * each local account's balance via Provider * * @private * @param blockNumber - the block number to update to. @@ -600,7 +598,7 @@ export default class AccountTrackerController extends BaseController< /** * Given a block, updates this AccountTrackerController currentBlockGasLimitByChainId, and then updates each local account's balance - * via EthQuery + * via Provider * * @private * @param networkClientId - optional network client ID to use instead of the globally selected network. @@ -616,10 +614,13 @@ export default class AccountTrackerController extends BaseController< this.#currentBlockNumberByChainId[chainId] = blockNumber; // block gasLimit polling shouldn't be in account-tracker shouldn't be here... - const currentBlock = await pify(new EthQuery(provider)).getBlockByNumber( - blockNumber, - false, - ); + const currentBlock = await provider.request< + JsonRpcParams, + { gasLimit: string } + >({ + method: 'eth_getBlockByNumber', + params: [blockNumber, false], + }); if (!currentBlock) { return; } @@ -729,7 +730,10 @@ export default class AccountTrackerController extends BaseController< // query balance try { - balance = await pify(new EthQuery(provider)).getBalance(address); + balance = await provider.request({ + method: 'eth_getBalance', + params: [address, 'latest'], + }); } catch (error) { if ( error && diff --git a/app/scripts/lib/transaction/decode/proxy.test.ts b/app/scripts/lib/transaction/decode/proxy.test.ts index d137fe567c73..b98839d16743 100644 --- a/app/scripts/lib/transaction/decode/proxy.test.ts +++ b/app/scripts/lib/transaction/decode/proxy.test.ts @@ -1,44 +1,46 @@ -import EthQuery from '@metamask/eth-query'; +import type { Provider } from '@metamask/network-controller'; import { getContractProxyAddress } from './proxy'; const CONTRACT_ADDRESS_MOCK = '0x456'; -function createEthQueryMock(storageValues: string[]): EthQuery { - const ethQuery = { - eth_getStorageAt: jest.fn(), - }; +function createProviderMock(storageValues: string[]): Provider { + const ethGetStorageAt = jest.fn(); for (const storageValue of storageValues) { - ethQuery.eth_getStorageAt.mockImplementationOnce( - (_contractAddress, _storageSlot, _blockNumber, cb) => - cb(null, storageValue), - ); + ethGetStorageAt.mockImplementationOnce(() => storageValue); } - return ethQuery as unknown as EthQuery; + return { + request: async (request) => { + if (request.method === 'eth_getStorageAt') { + return ethGetStorageAt(request); + } + throw new Error(`Unexpected method: ${request.method}`); + }, + } as Provider; } describe('Proxy', () => { describe('getContractProxyAddress', () => { it('returns undefined if all responses empty', async () => { - const ethQuery = createEthQueryMock([ + const provider = createProviderMock([ '0x0000000000000000000000000000000000000000000000000000000000000000', '0x0000000000000000000000000000000000000000000000000000000000000000', ]); expect( - await getContractProxyAddress(CONTRACT_ADDRESS_MOCK, ethQuery), + await getContractProxyAddress(CONTRACT_ADDRESS_MOCK, provider), ).toBeUndefined(); }); it('returns first non-empty response', async () => { - const ethQuery = createEthQueryMock([ + const provider = createProviderMock([ '0x0000000000000000000000000000000000000000000000000000000000000000', '00000000000000000000000000123', ]); expect( - await getContractProxyAddress(CONTRACT_ADDRESS_MOCK, ethQuery), + await getContractProxyAddress(CONTRACT_ADDRESS_MOCK, provider), ).toBe('0x123'); }); }); diff --git a/app/scripts/lib/transaction/decode/proxy.ts b/app/scripts/lib/transaction/decode/proxy.ts index 19d5887acd13..3f0367abc648 100644 --- a/app/scripts/lib/transaction/decode/proxy.ts +++ b/app/scripts/lib/transaction/decode/proxy.ts @@ -1,6 +1,5 @@ -import { query } from '@metamask/controller-utils'; -import EthQuery from '@metamask/eth-query'; -import { Hex } from '@metamask/utils'; +import type { Provider } from '@metamask/network-controller'; +import type { Hex, JsonRpcParams } from '@metamask/utils'; import { addHexPrefix, stripHexPrefix } from 'ethereumjs-util'; const IMPLEMENTATION_STORAGE_SLOTS = [ @@ -15,16 +14,14 @@ const EMPTY_RESULT = '0'.padEnd(64, '0'); export async function getContractProxyAddress( contractAddress: Hex, - ethQuery: EthQuery, + provider: Provider, ): Promise { const responses = await Promise.all( - IMPLEMENTATION_STORAGE_SLOTS.map( - (storageSlot) => - query(ethQuery, 'eth_getStorageAt', [ - contractAddress, - storageSlot, - 'latest', - ]) as Promise, + IMPLEMENTATION_STORAGE_SLOTS.map((storageSlot) => + provider.request({ + method: 'eth_getStorageAt', + params: [contractAddress, storageSlot, 'latest'], + }), ), ); diff --git a/app/scripts/lib/transaction/decode/util.test.ts b/app/scripts/lib/transaction/decode/util.test.ts index 66984b29cfe4..d114b5cc4fb7 100644 --- a/app/scripts/lib/transaction/decode/util.test.ts +++ b/app/scripts/lib/transaction/decode/util.test.ts @@ -1,4 +1,4 @@ -import EthQuery from '@metamask/eth-query'; +import type { Provider } from '@metamask/network-controller'; import { TRANSACTION_DATA_FOUR_BYTE, TRANSACTION_DATA_SOURCIFY, @@ -20,7 +20,7 @@ jest.mock('./proxy'); const CONTRACT_ADDRESS_MOCK = '0x456'; const CHAIN_ID_MOCK = '0x123'; -const ETH_QUERY_MOCK = {} as EthQuery; +const PROVIDER_MOCK = {} as Provider; describe('Transaction Decode Utils', () => { const decodeUniswapRouterTransactionDataMock = jest.mocked( @@ -56,7 +56,7 @@ describe('Transaction Decode Utils', () => { transactionData: TRANSACTION_DATA_UNISWAP, contractAddress: CONTRACT_ADDRESS_MOCK, chainId: CHAIN_ID_MOCK, - ethQuery: ETH_QUERY_MOCK, + provider: PROVIDER_MOCK, }); expect(result).toStrictEqual(TRANSACTION_DECODE_UNISWAP); @@ -71,7 +71,7 @@ describe('Transaction Decode Utils', () => { transactionData: TRANSACTION_DATA_SOURCIFY, contractAddress: CONTRACT_ADDRESS_MOCK, chainId: CHAIN_ID_MOCK, - ethQuery: ETH_QUERY_MOCK, + provider: PROVIDER_MOCK, }); expect(result).toStrictEqual(TRANSACTION_DECODE_SOURCIFY); @@ -86,7 +86,7 @@ describe('Transaction Decode Utils', () => { transactionData: TRANSACTION_DATA_FOUR_BYTE, contractAddress: CONTRACT_ADDRESS_MOCK, chainId: CHAIN_ID_MOCK, - ethQuery: ETH_QUERY_MOCK, + provider: PROVIDER_MOCK, }); expect(result).toStrictEqual(TRANSACTION_DECODE_FOUR_BYTE); @@ -97,7 +97,7 @@ describe('Transaction Decode Utils', () => { transactionData: TRANSACTION_DATA_FOUR_BYTE, contractAddress: CONTRACT_ADDRESS_MOCK, chainId: CHAIN_ID_MOCK, - ethQuery: ETH_QUERY_MOCK, + provider: PROVIDER_MOCK, }); expect(result).toBeUndefined(); diff --git a/app/scripts/lib/transaction/decode/util.ts b/app/scripts/lib/transaction/decode/util.ts index d8bca103ff73..cb5aca019516 100644 --- a/app/scripts/lib/transaction/decode/util.ts +++ b/app/scripts/lib/transaction/decode/util.ts @@ -1,5 +1,5 @@ import { Hex, createProjectLogger } from '@metamask/utils'; -import EthQuery from '@metamask/eth-query'; +import type { Provider } from '@metamask/network-controller'; import { DecodedTransactionDataMethod, DecodedTransactionDataParam, @@ -17,12 +17,12 @@ export async function decodeTransactionData({ transactionData, contractAddress, chainId, - ethQuery, + provider, }: { transactionData: Hex; contractAddress: Hex; chainId: Hex; - ethQuery: EthQuery; + provider: Provider; }): Promise { log('Decoding transaction data', { transactionData, @@ -45,7 +45,7 @@ export async function decodeTransactionData({ }; } - const proxyAddress = await getContractProxyAddress(contractAddress, ethQuery); + const proxyAddress = await getContractProxyAddress(contractAddress, provider); if (proxyAddress) { log('Retrieved proxy implementation address', proxyAddress); diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index c98ba72c0f96..e9b12ffaf6a7 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -45,7 +45,6 @@ import { import LatticeKeyring from 'eth-lattice-keyring'; import { rawChainData } from 'eth-chainlist'; import { MetaMaskKeyring as QRHardwareKeyring } from '@keystonehq/metamask-airgapped-keyring'; -import EthQuery from '@metamask/eth-query'; import EthJSQuery from '@metamask/ethjs-query'; import { nanoid } from 'nanoid'; import { captureException } from '@sentry/browser'; @@ -3390,17 +3389,16 @@ export default class MetamaskController extends EventEmitter { let networkVersion = this.deprecatedNetworkVersions[networkClientId]; if (networkVersion === undefined && completedOnboarding) { - const ethQuery = new EthQuery(networkClient.provider); - networkVersion = await new Promise((resolve) => { - ethQuery.sendAsync({ method: 'net_version' }, (error, result) => { - if (error) { - console.error(error); - resolve(null); - } else { - resolve(convertNetworkId(result)); - } + try { + const result = await networkClient.provider.request({ + method: 'net_version', }); - }); + networkVersion = convertNetworkId(result); + } catch (error) { + console.error(error); + networkVersion = null; + } + this.deprecatedNetworkVersions[networkClientId] = networkVersion; } @@ -4432,7 +4430,7 @@ export default class MetamaskController extends EventEmitter { decodeTransactionData: (request) => decodeTransactionData({ ...request, - ethQuery: new EthQuery(this.provider), + provider: this.provider, }), // metrics data deleteion createMetaMetricsDataDeletionTask: @@ -4652,12 +4650,11 @@ export default class MetamaskController extends EventEmitter { try { // Scan accounts until we find an empty one const chainId = this.#getGlobalChainId(); - const ethQuery = new EthQuery(this.provider); const accounts = await this.keyringController.getAccounts(); let address = accounts[accounts.length - 1]; for (let count = accounts.length; ; count++) { - const balance = await this.getBalance(address, ethQuery); + const balance = await this.getBalance(address, this.provider); if (balance === '0x0') { // This account has no balance, so check for tokens @@ -4727,25 +4724,25 @@ export default class MetamaskController extends EventEmitter { * Get an account balance from the AccountTrackerController or request it directly from the network. * * @param {string} address - The account address - * @param {EthQuery} ethQuery - The EthQuery instance to use when asking the network + * @param {Provider} provider - The provider instance to use when asking the network */ - getBalance(address, ethQuery) { - return new Promise((resolve, reject) => { - const cached = this.accountTrackerController.state.accounts[address]; + async getBalance(address, provider) { + const cached = this.accountTrackerController.state.accounts[address]; - if (cached && cached.balance) { - resolve(cached.balance); - } else { - ethQuery.getBalance(address, (error, balance) => { - if (error) { - reject(error); - log.error(error); - } else { - resolve(balance || '0x0'); - } - }); - } - }); + if (cached && cached.balance) { + return cached.balance; + } + + try { + const balance = await provider.request({ + method: 'eth_getBalance', + params: [address, 'latest'], + }); + return balance || '0x0'; + } catch (error) { + log.error(error); + throw error; + } } /** diff --git a/app/scripts/metamask-controller.test.js b/app/scripts/metamask-controller.test.js index 47a9050232fd..8429dd3d175d 100644 --- a/app/scripts/metamask-controller.test.js +++ b/app/scripts/metamask-controller.test.js @@ -4,7 +4,6 @@ import { cloneDeep } from 'lodash'; import nock from 'nock'; import { obj as createThroughStream } from 'through2'; -import EthQuery from '@metamask/eth-query'; import { wordlist as englishWordlist } from '@metamask/scure-bip39/dist/wordlists/english'; import { ListNames, @@ -780,9 +779,10 @@ describe('MetaMaskController', () => { it('should ask the network for a balance when not known by accountTrackerController', async () => { const accounts = {}; const balance = '0x14ced5122ce0a000'; - const ethQuery = new EthQuery(); - jest.spyOn(ethQuery, 'getBalance').mockImplementation((_, callback) => { - callback(undefined, balance); + const { provider } = createTestProviderTools({ + scaffold: { + eth_getBalance: balance, + }, }); jest @@ -793,7 +793,7 @@ describe('MetaMaskController', () => { const gotten = await metamaskController.getBalance( TEST_ADDRESS, - ethQuery, + provider, ); expect(balance).toStrictEqual(gotten); diff --git a/app/scripts/ui.js b/app/scripts/ui.js index ec612e748e11..ea3b6b3f1254 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -11,7 +11,6 @@ import 'react-devtools'; import PortStream from 'extension-port-stream'; import browser from 'webextension-polyfill'; -import EthQuery from '@metamask/eth-query'; import StreamProvider from 'web3-stream-provider'; import log from 'loglevel'; // TODO: Remove restricted import @@ -361,7 +360,6 @@ function setupWeb3Connection(connectionStream) { connectionStream.on('error', console.error.bind(console)); providerStream.on('error', console.error.bind(console)); global.ethereumProvider = providerStream; - global.ethQuery = new EthQuery(providerStream); } /** diff --git a/package.json b/package.json index 90462b6440e4..50a93aec532f 100644 --- a/package.json +++ b/package.json @@ -174,8 +174,6 @@ "await-semaphore@^0.1.1": "patch:await-semaphore@npm%3A0.1.3#./.yarn/patches/await-semaphore-npm-0.1.3-b7a0001fab.patch", "await-semaphore@^0.1.3": "patch:await-semaphore@npm%3A0.1.3#./.yarn/patches/await-semaphore-npm-0.1.3-b7a0001fab.patch", "eslint@npm:^8.7.0": "patch:eslint@npm%3A8.57.0#~/.yarn/patches/eslint-npm-8.57.0-4286e12a3a.patch", - "eth-query@^2.1.2": "patch:eth-query@npm%3A2.1.2#./.yarn/patches/eth-query-npm-2.1.2-7c6adc825f.patch", - "eth-query@^2.1.0": "patch:eth-query@npm%3A2.1.2#./.yarn/patches/eth-query-npm-2.1.2-7c6adc825f.patch", "ethereumjs-util@^7.0.10": "patch:ethereumjs-util@npm%3A7.1.5#./.yarn/patches/ethereumjs-util-npm-7.1.5-5bb4d00000.patch", "ethereumjs-util@^7.1.5": "patch:ethereumjs-util@npm%3A7.1.5#./.yarn/patches/ethereumjs-util-npm-7.1.5-5bb4d00000.patch", "ethereumjs-util@^7.1.4": "patch:ethereumjs-util@npm%3A7.1.5#./.yarn/patches/ethereumjs-util-npm-7.1.5-5bb4d00000.patch", @@ -306,7 +304,6 @@ "@metamask/eth-json-rpc-filters": "^9.0.0", "@metamask/eth-json-rpc-middleware": "^15.1.2", "@metamask/eth-ledger-bridge-keyring": "^5.0.1", - "@metamask/eth-query": "^4.0.0", "@metamask/eth-sig-util": "^7.0.1", "@metamask/eth-snap-keyring": "^7.0.0", "@metamask/eth-token-tracker": "^9.0.0", diff --git a/types/eth-query.d.ts b/types/eth-query.d.ts deleted file mode 100644 index 726300f68176..000000000000 --- a/types/eth-query.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -declare module 'eth-query' { - // What it says on the tin. We omit `null` because confusingly, this is used - // for a successful response to indicate a lack of an error. - type EverythingButNull = - | string - | number - | boolean - | object - | symbol - | undefined; - - type ProviderSendAsyncResponse = { - error?: { message: string }; - result?: Result; - }; - - type ProviderSendAsyncCallback = ( - error: unknown, - response: ProviderSendAsyncResponse, - ) => void; - - type Provider = { - sendAsync( - payload: SendAsyncPayload, - callback: ProviderSendAsyncCallback, - ): void; - }; - - type SendAsyncPayload = { - id: number; - jsonrpc: '2.0'; - method: string; - params: Params; - }; - - type SendAsyncCallback = ( - ...args: - | [error: EverythingButNull, result: undefined] - | [error: null, result: Result] - ) => void; - - export default class EthQuery { - constructor(provider: Provider); - - sendAsync( - opts: Partial>, - callback: SendAsyncCallback, - ): void; - } -} diff --git a/ui/ducks/swaps/swaps.js b/ui/ducks/swaps/swaps.js index e044fdf42b3f..845a84ffb8cd 100644 --- a/ui/ducks/swaps/swaps.js +++ b/ui/ducks/swaps/swaps.js @@ -1365,7 +1365,25 @@ export function fetchMetaSwapsGasPriceEstimates() { dispatch(swapGasPriceEstimatesFetchFailed()); try { - const gasPrice = await global.ethQuery.gasPrice(); + const gasPrice = await new Promise((resolve, reject) => { + global.ethereumProvider.sendAsync( + { + method: 'eth_gasPrice', + params: [], + }, + (err, response) => { + let error = err; + if (!error && response.error) { + error = new Error(`RPC Error - ${response.error.message}`); + } + if (error) { + reject(error); + return; + } + resolve(response.result); + }, + ); + }); const gasPriceInDecGWEI = hexWEIToDecGWEI(gasPrice.toString(10)); dispatch(retrievedFallbackSwapsGasPrice(gasPriceInDecGWEI)); diff --git a/yarn.lock b/yarn.lock index 23a6e248fef0..082e62ca8d3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26597,7 +26597,6 @@ __metadata: "@metamask/eth-json-rpc-middleware": "npm:^15.1.2" "@metamask/eth-json-rpc-provider": "npm:^4.1.6" "@metamask/eth-ledger-bridge-keyring": "npm:^5.0.1" - "@metamask/eth-query": "npm:^4.0.0" "@metamask/eth-sig-util": "npm:^7.0.1" "@metamask/eth-snap-keyring": "npm:^7.0.0" "@metamask/eth-token-tracker": "npm:^9.0.0" From 6f611fc1887ffc8c07f788fbf11b1931fe9f2795 Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Sun, 12 Jan 2025 13:34:30 +0000 Subject: [PATCH 2/2] Update LavaMoat policies --- lavamoat/browserify/beta/policy.json | 24 ++++++++++++------------ lavamoat/browserify/flask/policy.json | 24 ++++++++++++------------ lavamoat/browserify/main/policy.json | 24 ++++++++++++------------ lavamoat/browserify/mmi/policy.json | 24 ++++++++++++------------ 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 60b9bea834de..08ce02b34559 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -889,7 +889,7 @@ "@metamask/base-controller": true, "@metamask/contract-metadata": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/metamask-eth-abis": true, "@metamask/polling-controller": true, "@metamask/rpc-errors": true, @@ -992,7 +992,7 @@ "packages": { "@metamask/safe-event-emitter": true, "@metamask/eth-token-tracker>@metamask/eth-block-tracker>@metamask/utils": true, - "@metamask/eth-query>json-rpc-random-id": true, + "@metamask/ppom-validator>json-rpc-random-id": true, "pify": true } }, @@ -1005,7 +1005,7 @@ "packages": { "@metamask/safe-event-emitter": true, "@metamask/network-controller>@metamask/eth-block-tracker>@metamask/utils": true, - "@metamask/eth-query>json-rpc-random-id": true + "@metamask/ppom-validator>json-rpc-random-id": true } }, "@metamask/keyring-controller>@metamask/eth-hd-keyring": { @@ -1026,7 +1026,7 @@ "console.error": true }, "packages": { - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/json-rpc-engine": true, "@metamask/safe-event-emitter": true, "@metamask/name-controller>async-mutex": true, @@ -1088,9 +1088,9 @@ "@metamask/eth-trezor-keyring>hdkey": true } }, - "@metamask/eth-query": { + "@metamask/controller-utils>@metamask/eth-query": { "packages": { - "@metamask/eth-query>json-rpc-random-id": true, + "@metamask/ppom-validator>json-rpc-random-id": true, "watchify>xtend": true } }, @@ -1281,7 +1281,7 @@ }, "packages": { "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/polling-controller": true, "bn.js": true, "uuid": true @@ -1424,7 +1424,7 @@ "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, "@metamask/eth-json-rpc-middleware": true, "@metamask/eth-json-rpc-provider": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/json-rpc-engine": true, "@metamask/rpc-errors": true, "@metamask/network-controller>@metamask/swappable-obj-proxy": true, @@ -1561,7 +1561,7 @@ "browserify>buffer": true, "@metamask/ppom-validator>crypto-js": true, "@metamask/ppom-validator>elliptic": true, - "@metamask/eth-query>json-rpc-random-id": true + "@metamask/ppom-validator>json-rpc-random-id": true } }, "@metamask/preferences-controller": { @@ -1688,7 +1688,7 @@ "@metamask/smart-transactions-controller>@ethereumjs/util": true, "@ethersproject/bytes": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/polling-controller": true, "@metamask/transaction-controller": true, "@metamask/smart-transactions-controller>bignumber.js": true, @@ -1823,7 +1823,7 @@ "@ethersproject/providers": true, "@metamask/base-controller": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/gas-fee-controller": true, "@metamask/metamask-eth-abis": true, "@metamask/network-controller": true, @@ -1847,7 +1847,7 @@ "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/gas-fee-controller": true, "@metamask/polling-controller": true, "@metamask/rpc-errors": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 60b9bea834de..08ce02b34559 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -889,7 +889,7 @@ "@metamask/base-controller": true, "@metamask/contract-metadata": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/metamask-eth-abis": true, "@metamask/polling-controller": true, "@metamask/rpc-errors": true, @@ -992,7 +992,7 @@ "packages": { "@metamask/safe-event-emitter": true, "@metamask/eth-token-tracker>@metamask/eth-block-tracker>@metamask/utils": true, - "@metamask/eth-query>json-rpc-random-id": true, + "@metamask/ppom-validator>json-rpc-random-id": true, "pify": true } }, @@ -1005,7 +1005,7 @@ "packages": { "@metamask/safe-event-emitter": true, "@metamask/network-controller>@metamask/eth-block-tracker>@metamask/utils": true, - "@metamask/eth-query>json-rpc-random-id": true + "@metamask/ppom-validator>json-rpc-random-id": true } }, "@metamask/keyring-controller>@metamask/eth-hd-keyring": { @@ -1026,7 +1026,7 @@ "console.error": true }, "packages": { - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/json-rpc-engine": true, "@metamask/safe-event-emitter": true, "@metamask/name-controller>async-mutex": true, @@ -1088,9 +1088,9 @@ "@metamask/eth-trezor-keyring>hdkey": true } }, - "@metamask/eth-query": { + "@metamask/controller-utils>@metamask/eth-query": { "packages": { - "@metamask/eth-query>json-rpc-random-id": true, + "@metamask/ppom-validator>json-rpc-random-id": true, "watchify>xtend": true } }, @@ -1281,7 +1281,7 @@ }, "packages": { "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/polling-controller": true, "bn.js": true, "uuid": true @@ -1424,7 +1424,7 @@ "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, "@metamask/eth-json-rpc-middleware": true, "@metamask/eth-json-rpc-provider": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/json-rpc-engine": true, "@metamask/rpc-errors": true, "@metamask/network-controller>@metamask/swappable-obj-proxy": true, @@ -1561,7 +1561,7 @@ "browserify>buffer": true, "@metamask/ppom-validator>crypto-js": true, "@metamask/ppom-validator>elliptic": true, - "@metamask/eth-query>json-rpc-random-id": true + "@metamask/ppom-validator>json-rpc-random-id": true } }, "@metamask/preferences-controller": { @@ -1688,7 +1688,7 @@ "@metamask/smart-transactions-controller>@ethereumjs/util": true, "@ethersproject/bytes": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/polling-controller": true, "@metamask/transaction-controller": true, "@metamask/smart-transactions-controller>bignumber.js": true, @@ -1823,7 +1823,7 @@ "@ethersproject/providers": true, "@metamask/base-controller": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/gas-fee-controller": true, "@metamask/metamask-eth-abis": true, "@metamask/network-controller": true, @@ -1847,7 +1847,7 @@ "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/gas-fee-controller": true, "@metamask/polling-controller": true, "@metamask/rpc-errors": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 60b9bea834de..08ce02b34559 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -889,7 +889,7 @@ "@metamask/base-controller": true, "@metamask/contract-metadata": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/metamask-eth-abis": true, "@metamask/polling-controller": true, "@metamask/rpc-errors": true, @@ -992,7 +992,7 @@ "packages": { "@metamask/safe-event-emitter": true, "@metamask/eth-token-tracker>@metamask/eth-block-tracker>@metamask/utils": true, - "@metamask/eth-query>json-rpc-random-id": true, + "@metamask/ppom-validator>json-rpc-random-id": true, "pify": true } }, @@ -1005,7 +1005,7 @@ "packages": { "@metamask/safe-event-emitter": true, "@metamask/network-controller>@metamask/eth-block-tracker>@metamask/utils": true, - "@metamask/eth-query>json-rpc-random-id": true + "@metamask/ppom-validator>json-rpc-random-id": true } }, "@metamask/keyring-controller>@metamask/eth-hd-keyring": { @@ -1026,7 +1026,7 @@ "console.error": true }, "packages": { - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/json-rpc-engine": true, "@metamask/safe-event-emitter": true, "@metamask/name-controller>async-mutex": true, @@ -1088,9 +1088,9 @@ "@metamask/eth-trezor-keyring>hdkey": true } }, - "@metamask/eth-query": { + "@metamask/controller-utils>@metamask/eth-query": { "packages": { - "@metamask/eth-query>json-rpc-random-id": true, + "@metamask/ppom-validator>json-rpc-random-id": true, "watchify>xtend": true } }, @@ -1281,7 +1281,7 @@ }, "packages": { "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/polling-controller": true, "bn.js": true, "uuid": true @@ -1424,7 +1424,7 @@ "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, "@metamask/eth-json-rpc-middleware": true, "@metamask/eth-json-rpc-provider": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/json-rpc-engine": true, "@metamask/rpc-errors": true, "@metamask/network-controller>@metamask/swappable-obj-proxy": true, @@ -1561,7 +1561,7 @@ "browserify>buffer": true, "@metamask/ppom-validator>crypto-js": true, "@metamask/ppom-validator>elliptic": true, - "@metamask/eth-query>json-rpc-random-id": true + "@metamask/ppom-validator>json-rpc-random-id": true } }, "@metamask/preferences-controller": { @@ -1688,7 +1688,7 @@ "@metamask/smart-transactions-controller>@ethereumjs/util": true, "@ethersproject/bytes": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/polling-controller": true, "@metamask/transaction-controller": true, "@metamask/smart-transactions-controller>bignumber.js": true, @@ -1823,7 +1823,7 @@ "@ethersproject/providers": true, "@metamask/base-controller": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/gas-fee-controller": true, "@metamask/metamask-eth-abis": true, "@metamask/network-controller": true, @@ -1847,7 +1847,7 @@ "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/gas-fee-controller": true, "@metamask/polling-controller": true, "@metamask/rpc-errors": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index eeeb07ad2268..341fc6d29b5d 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -981,7 +981,7 @@ "@metamask/base-controller": true, "@metamask/contract-metadata": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/metamask-eth-abis": true, "@metamask/polling-controller": true, "@metamask/rpc-errors": true, @@ -1084,7 +1084,7 @@ "packages": { "@metamask/safe-event-emitter": true, "@metamask/eth-token-tracker>@metamask/eth-block-tracker>@metamask/utils": true, - "@metamask/eth-query>json-rpc-random-id": true, + "@metamask/ppom-validator>json-rpc-random-id": true, "pify": true } }, @@ -1097,7 +1097,7 @@ "packages": { "@metamask/safe-event-emitter": true, "@metamask/network-controller>@metamask/eth-block-tracker>@metamask/utils": true, - "@metamask/eth-query>json-rpc-random-id": true + "@metamask/ppom-validator>json-rpc-random-id": true } }, "@metamask/keyring-controller>@metamask/eth-hd-keyring": { @@ -1118,7 +1118,7 @@ "console.error": true }, "packages": { - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/json-rpc-engine": true, "@metamask/safe-event-emitter": true, "@metamask/name-controller>async-mutex": true, @@ -1180,9 +1180,9 @@ "@metamask/eth-trezor-keyring>hdkey": true } }, - "@metamask/eth-query": { + "@metamask/controller-utils>@metamask/eth-query": { "packages": { - "@metamask/eth-query>json-rpc-random-id": true, + "@metamask/ppom-validator>json-rpc-random-id": true, "watchify>xtend": true } }, @@ -1373,7 +1373,7 @@ }, "packages": { "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/polling-controller": true, "bn.js": true, "uuid": true @@ -1516,7 +1516,7 @@ "@metamask/network-controller>@metamask/eth-json-rpc-infura": true, "@metamask/eth-json-rpc-middleware": true, "@metamask/eth-json-rpc-provider": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/json-rpc-engine": true, "@metamask/rpc-errors": true, "@metamask/network-controller>@metamask/swappable-obj-proxy": true, @@ -1653,7 +1653,7 @@ "browserify>buffer": true, "@metamask/ppom-validator>crypto-js": true, "@metamask/ppom-validator>elliptic": true, - "@metamask/eth-query>json-rpc-random-id": true + "@metamask/ppom-validator>json-rpc-random-id": true } }, "@metamask/preferences-controller": { @@ -1780,7 +1780,7 @@ "@metamask/smart-transactions-controller>@ethereumjs/util": true, "@ethersproject/bytes": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/polling-controller": true, "@metamask/transaction-controller": true, "@metamask/smart-transactions-controller>bignumber.js": true, @@ -1915,7 +1915,7 @@ "@ethersproject/providers": true, "@metamask/base-controller": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/gas-fee-controller": true, "@metamask/metamask-eth-abis": true, "@metamask/network-controller": true, @@ -1939,7 +1939,7 @@ "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, - "@metamask/eth-query": true, + "@metamask/controller-utils>@metamask/eth-query": true, "@metamask/gas-fee-controller": true, "@metamask/polling-controller": true, "@metamask/rpc-errors": true,