diff --git a/package.json b/package.json index b46ea1551a..18609d1d3e 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", - "@metamask/eth-json-rpc-provider": "^1.0.0", + "@metamask/eth-json-rpc-provider": "^2.1.0", + "@metamask/json-rpc-engine": "^7.1.1", "@metamask/utils": "^8.1.0", "@types/node": "^16.18.54", "@typescript-eslint/eslint-plugin": "^5.62.0", @@ -57,10 +58,9 @@ "eslint-plugin-n": "^15.7.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-promise": "^6.1.1", - "eth-block-tracker": "^7.0.1", + "eth-block-tracker": "^8.0.0", "execa": "^5.0.0", "isomorphic-fetch": "^3.0.0", - "json-rpc-engine": "^6.1.0", "nock": "^13.3.1", "prettier": "^2.7.1", "prettier-plugin-packagejson": "^2.4.5", diff --git a/packages/approval-controller/package.json b/packages/approval-controller/package.json index 93510380db..5a1cb47244 100644 --- a/packages/approval-controller/package.json +++ b/packages/approval-controller/package.json @@ -30,7 +30,7 @@ }, "dependencies": { "@metamask/base-controller": "^3.2.3", - "@metamask/rpc-errors": "^6.0.0", + "@metamask/rpc-errors": "^6.1.0", "@metamask/utils": "^8.1.0", "immer": "^9.0.6", "nanoid": "^3.1.31" diff --git a/packages/assets-controllers/package.json b/packages/assets-controllers/package.json index def007df8a..bbd731fcfc 100644 --- a/packages/assets-controllers/package.json +++ b/packages/assets-controllers/package.json @@ -42,7 +42,7 @@ "@metamask/metamask-eth-abis": "3.0.0", "@metamask/network-controller": "^14.0.0", "@metamask/preferences-controller": "^4.4.2", - "@metamask/rpc-errors": "^6.0.0", + "@metamask/rpc-errors": "^6.1.0", "@metamask/utils": "^8.1.0", "@types/uuid": "^8.3.0", "async-mutex": "^0.2.6", diff --git a/packages/gas-fee-controller/src/GasFeeController.ts b/packages/gas-fee-controller/src/GasFeeController.ts index a81f77dff3..659bc37abb 100644 --- a/packages/gas-fee-controller/src/GasFeeController.ts +++ b/packages/gas-fee-controller/src/GasFeeController.ts @@ -342,6 +342,7 @@ export class GasFeeController extends PollingController< this.legacyAPIEndpoint = legacyAPIEndpoint; this.clientId = clientId; + // @ts-expect-error TODO: Provider type alignment this.ethQuery = new EthQuery(this.#getProvider()); if (onNetworkStateChange && getChainId) { @@ -417,6 +418,7 @@ export class GasFeeController extends PollingController< isEIP1559Compatible = false; } + // @ts-expect-error TODO: Provider type alignment const ethQuery = new EthQuery(networkClient.provider); const gasFeeCalculations = await determineGasFeeCalculations({ @@ -588,6 +590,7 @@ export class GasFeeController extends PollingController< const newChainId = networkControllerState.providerConfig.chainId; if (newChainId !== this.currentChainId) { + // @ts-expect-error TODO: Provider type alignment this.ethQuery = new EthQuery(this.#getProvider()); await this.resetPolling(); diff --git a/packages/network-controller/package.json b/packages/network-controller/package.json index 7c3cce6ecb..8357dfe6e3 100644 --- a/packages/network-controller/package.json +++ b/packages/network-controller/package.json @@ -31,17 +31,17 @@ "dependencies": { "@metamask/base-controller": "^3.2.3", "@metamask/controller-utils": "^5.0.2", - "@metamask/eth-json-rpc-infura": "^8.1.1", - "@metamask/eth-json-rpc-middleware": "^11.0.2", - "@metamask/eth-json-rpc-provider": "^1.0.0", + "@metamask/eth-json-rpc-infura": "^9.0.0", + "@metamask/eth-json-rpc-middleware": "^12.0.0", + "@metamask/eth-json-rpc-provider": "^2.1.0", "@metamask/eth-query": "^3.0.1", + "@metamask/json-rpc-engine": "^7.1.1", + "@metamask/rpc-errors": "^6.1.0", "@metamask/swappable-obj-proxy": "^2.1.0", "@metamask/utils": "^8.1.0", "async-mutex": "^0.2.6", - "eth-block-tracker": "^7.0.1", - "eth-rpc-errors": "^4.0.2", + "eth-block-tracker": "^8.0.0", "immer": "^9.0.6", - "json-rpc-engine": "^6.1.0", "uuid": "^8.3.2" }, "devDependencies": { diff --git a/packages/network-controller/src/NetworkController.ts b/packages/network-controller/src/NetworkController.ts index 67cfcce839..424f6de958 100644 --- a/packages/network-controller/src/NetworkController.ts +++ b/packages/network-controller/src/NetworkController.ts @@ -9,6 +9,7 @@ import { isSafeChainId, } from '@metamask/controller-utils'; import EthQuery from '@metamask/eth-query'; +import { errorCodes } from '@metamask/rpc-errors'; import { createEventEmitterProxy } from '@metamask/swappable-obj-proxy'; import type { SwappableProxy } from '@metamask/swappable-obj-proxy'; import type { Hex } from '@metamask/utils'; @@ -18,7 +19,6 @@ import { isPlainObject, } from '@metamask/utils'; import { strict as assert } from 'assert'; -import { errorCodes } from 'eth-rpc-errors'; import type { Patch } from 'immer'; import { v4 as random } from 'uuid'; @@ -980,6 +980,7 @@ export class NetworkController extends BaseControllerV2< } const networkClient = this.getNetworkClientById(networkClientId); + // @ts-expect-error TODO: Provider type alignment const ethQuery = new EthQuery(networkClient.provider); return new Promise((resolve, reject) => { @@ -1545,6 +1546,7 @@ export class NetworkController extends BaseControllerV2< }); } + // @ts-expect-error TODO: Provider type alignment this.#ethQuery = new EthQuery(this.#providerProxy); } } diff --git a/packages/network-controller/src/create-network-client.ts b/packages/network-controller/src/create-network-client.ts index 0f8ddbaf37..99eddd9bf7 100644 --- a/packages/network-controller/src/create-network-client.ts +++ b/packages/network-controller/src/create-network-client.ts @@ -15,15 +15,15 @@ import { providerFromEngine, providerFromMiddleware, } from '@metamask/eth-json-rpc-provider'; -import type { Hex } from '@metamask/utils'; -import { PollingBlockTracker } from 'eth-block-tracker'; import { createAsyncMiddleware, createScaffoldMiddleware, JsonRpcEngine, mergeMiddleware, -} from 'json-rpc-engine'; -import type { JsonRpcMiddleware } from 'json-rpc-engine'; +} from '@metamask/json-rpc-engine'; +import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine'; +import type { Hex, Json, JsonRpcParams } from '@metamask/utils'; +import { PollingBlockTracker } from 'eth-block-tracker'; import type { BlockTracker, @@ -126,7 +126,7 @@ function createInfuraNetworkMiddleware({ blockTracker: PollingBlockTracker; network: InfuraNetworkType; rpcProvider: SafeEventEmitterProvider; - rpcApiMiddleware: JsonRpcMiddleware; + rpcApiMiddleware: JsonRpcMiddleware; }) { return mergeMiddleware([ createNetworkAndChainIdMiddleware({ network }), @@ -158,7 +158,7 @@ function createNetworkAndChainIdMiddleware({ const createChainIdMiddleware = ( chainId: Hex, -): JsonRpcMiddleware => { +): JsonRpcMiddleware => { return (req, res, next, end) => { if (req.method === 'eth_chainId') { res.result = chainId; @@ -184,8 +184,8 @@ function createCustomNetworkMiddleware({ }: { blockTracker: PollingBlockTracker; chainId: Hex; - rpcApiMiddleware: any; -}) { + rpcApiMiddleware: JsonRpcMiddleware; +}): JsonRpcMiddleware { // eslint-disable-next-line n/no-process-env const testMiddlewares = process.env.IN_TEST ? [createEstimateGasDelayTestMiddleware()] diff --git a/packages/network-controller/src/types.ts b/packages/network-controller/src/types.ts index af39896249..de069964f7 100644 --- a/packages/network-controller/src/types.ts +++ b/packages/network-controller/src/types.ts @@ -1,11 +1,13 @@ import type { InfuraNetworkType } from '@metamask/controller-utils'; import type { SafeEventEmitterProvider } from '@metamask/eth-json-rpc-provider'; import type { Hex } from '@metamask/utils'; -import type { PollingBlockTracker } from 'eth-block-tracker'; +import type { BlockTracker as BaseBlockTracker } from 'eth-block-tracker'; export type Provider = SafeEventEmitterProvider; -export type BlockTracker = PollingBlockTracker; +export type BlockTracker = BaseBlockTracker & { + checkForLatestBlock(): Promise; +}; /** * The type of network client that can be created. diff --git a/packages/network-controller/tests/NetworkController.test.ts b/packages/network-controller/tests/NetworkController.test.ts index dfb583938d..cebf7ec4e1 100644 --- a/packages/network-controller/tests/NetworkController.test.ts +++ b/packages/network-controller/tests/NetworkController.test.ts @@ -7,8 +7,8 @@ import { NetworkType, toHex, } from '@metamask/controller-utils'; +import { rpcErrors } from '@metamask/rpc-errors'; import assert from 'assert'; -import { ethErrors } from 'eth-rpc-errors'; import type { Patch } from 'immer'; import { when, resetAllWhenMocks } from 'jest-when'; import { inspect, isDeepStrictEqual, promisify } from 'util'; @@ -27,7 +27,7 @@ import type { ProviderConfig, } from '../src/NetworkController'; import { NetworkController } from '../src/NetworkController'; -import type { Provider } from '../src/types'; +import type { BlockTracker, Provider } from '../src/types'; import { NetworkClientType } from '../src/types'; import type { FakeProviderStub } from './fake-provider'; import { FakeProvider } from './fake-provider'; @@ -128,7 +128,7 @@ const SUCCESSFUL_ETH_GET_BLOCK_BY_NUMBER_RESPONSE = { /** * A response object for a request that has been geoblocked by Infura. */ -const BLOCKED_INFURA_JSON_RPC_ERROR = ethErrors.rpc.internal( +const BLOCKED_INFURA_JSON_RPC_ERROR = rpcErrors.internal( JSON.stringify({ error: 'countryBlocked' }), ); @@ -136,7 +136,7 @@ const BLOCKED_INFURA_JSON_RPC_ERROR = ethErrors.rpc.internal( * A response object for a unsuccessful request to any RPC method. It is assumed * that the error here is insignificant to the test. */ -const GENERIC_JSON_RPC_ERROR = ethErrors.rpc.internal( +const GENERIC_JSON_RPC_ERROR = rpcErrors.internal( JSON.stringify({ error: 'oops' }), ); @@ -5106,7 +5106,7 @@ describe('NetworkController', () => { request: { method: 'eth_getBlockByNumber', }, - error: ethErrors.rpc.methodNotFound(), + error: rpcErrors.methodNotFound(), }, ]), buildFakeProvider([ @@ -5622,7 +5622,7 @@ describe('NetworkController', () => { request: { method: 'eth_getBlockByNumber', }, - error: ethErrors.rpc.methodNotFound(), + error: rpcErrors.methodNotFound(), }, ]), buildFakeProvider([ @@ -6250,7 +6250,7 @@ function lookupNetworkTests({ method: 'eth_getBlockByNumber', params: ['latest', false], }, - error: ethErrors.rpc.limitExceeded('some error'), + error: rpcErrors.limitExceeded('some error'), }, ], stubLookupNetworkWhileSetting: true, @@ -6291,7 +6291,7 @@ function lookupNetworkTests({ method: 'eth_getBlockByNumber', params: ['latest', false], }, - error: ethErrors.rpc.limitExceeded('some error'), + error: rpcErrors.limitExceeded('some error'), }, ], }); @@ -6326,7 +6326,7 @@ function lookupNetworkTests({ method: 'eth_getBlockByNumber', params: ['latest', false], }, - error: ethErrors.rpc.limitExceeded('some error'), + error: rpcErrors.limitExceeded('some error'), }, ], stubLookupNetworkWhileSetting: true, @@ -6358,7 +6358,7 @@ function lookupNetworkTests({ method: 'eth_getBlockByNumber', params: ['latest', false], }, - error: ethErrors.rpc.limitExceeded('some error'), + error: rpcErrors.limitExceeded('some error'), }, ], stubLookupNetworkWhileSetting: true, @@ -6392,7 +6392,7 @@ function lookupNetworkTests({ method: 'eth_getBlockByNumber', params: ['latest', false], }, - error: ethErrors.rpc.limitExceeded('some error'), + error: rpcErrors.limitExceeded('some error'), }, ], stubLookupNetworkWhileSetting: true, @@ -6957,7 +6957,7 @@ function buildFakeClient( rpcUrl: 'https://test.network', }, provider, - blockTracker: new FakeBlockTracker(), + blockTracker: new FakeBlockTracker() as BlockTracker, destroy: () => { // do nothing }, diff --git a/packages/network-controller/tests/fake-provider.ts b/packages/network-controller/tests/fake-provider.ts index b98352e191..0405999a5d 100644 --- a/packages/network-controller/tests/fake-provider.ts +++ b/packages/network-controller/tests/fake-provider.ts @@ -1,6 +1,6 @@ import { SafeEventEmitterProvider } from '@metamask/eth-json-rpc-provider/dist/safe-event-emitter-provider'; -import type { JsonRpcRequest, JsonRpcResponse } from 'json-rpc-engine'; -import { JsonRpcEngine } from 'json-rpc-engine'; +import { JsonRpcEngine } from '@metamask/json-rpc-engine'; +import type { JsonRpcRequest, JsonRpcResponse } from '@metamask/utils'; import { inspect, isDeepStrictEqual } from 'util'; // Store this in case it gets stubbed later diff --git a/packages/network-controller/tests/provider-api-tests/helpers.ts b/packages/network-controller/tests/provider-api-tests/helpers.ts index c3d87f4656..8d4cda0f82 100644 --- a/packages/network-controller/tests/provider-api-tests/helpers.ts +++ b/packages/network-controller/tests/provider-api-tests/helpers.ts @@ -456,6 +456,7 @@ export async function withNetworkClient( const { provider, blockTracker } = clientUnderTest; + // @ts-expect-error TODO: Provider type alignment const ethQuery = new EthQuery(provider); const curriedMakeRpcCall = (request: Request) => makeRpcCall(ethQuery, request); diff --git a/packages/permission-controller/package.json b/packages/permission-controller/package.json index b1edf19c87..c96258c3ba 100644 --- a/packages/permission-controller/package.json +++ b/packages/permission-controller/package.json @@ -33,7 +33,7 @@ "@metamask/base-controller": "^3.2.3", "@metamask/controller-utils": "^5.0.2", "@metamask/json-rpc-engine": "^7.1.1", - "@metamask/rpc-errors": "^6.0.0", + "@metamask/rpc-errors": "^6.1.0", "@metamask/utils": "^8.1.0", "@types/deep-freeze-strict": "^1.1.0", "deep-freeze-strict": "^1.1.1", diff --git a/packages/rate-limit-controller/package.json b/packages/rate-limit-controller/package.json index d7f8a44ce4..4cb0d567d8 100644 --- a/packages/rate-limit-controller/package.json +++ b/packages/rate-limit-controller/package.json @@ -30,7 +30,7 @@ }, "dependencies": { "@metamask/base-controller": "^3.2.3", - "eth-rpc-errors": "^4.0.2", + "@metamask/rpc-errors": "^6.1.0", "immer": "^9.0.6" }, "devDependencies": { diff --git a/packages/rate-limit-controller/src/RateLimitController.ts b/packages/rate-limit-controller/src/RateLimitController.ts index b3372d382a..83526e6dd9 100644 --- a/packages/rate-limit-controller/src/RateLimitController.ts +++ b/packages/rate-limit-controller/src/RateLimitController.ts @@ -1,6 +1,6 @@ import type { RestrictedControllerMessenger } from '@metamask/base-controller'; import { BaseControllerV2 as BaseController } from '@metamask/base-controller'; -import { ethErrors } from 'eth-rpc-errors'; +import { rpcErrors } from '@metamask/rpc-errors'; import type { Patch } from 'immer'; /** @@ -143,7 +143,7 @@ export class RateLimitController< ...args: Parameters ): Promise> { if (this.isRateLimited(type, origin)) { - throw ethErrors.rpc.limitExceeded({ + throw rpcErrors.limitExceeded({ message: `"${type.toString()}" is currently rate-limited. Please try again later.`, }); } diff --git a/packages/selected-network-controller/package.json b/packages/selected-network-controller/package.json index 96741d192d..f71f131cb3 100644 --- a/packages/selected-network-controller/package.json +++ b/packages/selected-network-controller/package.json @@ -30,8 +30,8 @@ }, "dependencies": { "@metamask/base-controller": "^3.2.3", - "@metamask/network-controller": "^14.0.0", - "json-rpc-engine": "^6.1.0" + "@metamask/json-rpc-engine": "^7.1.1", + "@metamask/network-controller": "^14.0.0" }, "devDependencies": { "@metamask/auto-changelog": "^3.1.0", diff --git a/packages/selected-network-controller/src/SelectedNetworkMiddleware.ts b/packages/selected-network-controller/src/SelectedNetworkMiddleware.ts index 68b369e9aa..fca882e52f 100644 --- a/packages/selected-network-controller/src/SelectedNetworkMiddleware.ts +++ b/packages/selected-network-controller/src/SelectedNetworkMiddleware.ts @@ -1,9 +1,9 @@ import type { ControllerMessenger } from '@metamask/base-controller'; +import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine'; import type { NetworkClientId, NetworkControllerGetStateAction, } from '@metamask/network-controller'; -import type { JsonRpcMiddleware } from 'json-rpc-engine'; import type { SelectedNetworkControllerGetNetworkClientIdForDomainAction, diff --git a/packages/selected-network-controller/tests/SelectedNetworkMiddleware.test.ts b/packages/selected-network-controller/tests/SelectedNetworkMiddleware.test.ts index 8d7a19e86c..71e807a2d4 100644 --- a/packages/selected-network-controller/tests/SelectedNetworkMiddleware.test.ts +++ b/packages/selected-network-controller/tests/SelectedNetworkMiddleware.test.ts @@ -1,6 +1,6 @@ import { ControllerMessenger } from '@metamask/base-controller'; +import { JsonRpcEngine } from '@metamask/json-rpc-engine'; import type { NetworkControllerGetStateAction } from '@metamask/network-controller'; -import { JsonRpcEngine } from 'json-rpc-engine'; import type { SelectedNetworkControllerGetNetworkClientIdForDomainAction, diff --git a/packages/signature-controller/package.json b/packages/signature-controller/package.json index d280f5fb45..ff1354cffa 100644 --- a/packages/signature-controller/package.json +++ b/packages/signature-controller/package.json @@ -34,8 +34,8 @@ "@metamask/controller-utils": "^5.0.2", "@metamask/logging-controller": "^1.0.3", "@metamask/message-manager": "^7.3.5", + "@metamask/rpc-errors": "^6.1.0", "@metamask/utils": "^8.1.0", - "eth-rpc-errors": "^4.0.2", "ethereumjs-util": "^7.0.10", "immer": "^9.0.6", "lodash": "^4.17.21" diff --git a/packages/signature-controller/src/SignatureController.test.ts b/packages/signature-controller/src/SignatureController.test.ts index 78408fafa5..4931f368b2 100644 --- a/packages/signature-controller/src/SignatureController.test.ts +++ b/packages/signature-controller/src/SignatureController.test.ts @@ -13,7 +13,7 @@ import { PersonalMessageManager, TypedMessageManager, } from '@metamask/message-manager'; -import { EthereumProviderError } from 'eth-rpc-errors'; +import { EthereumProviderError } from '@metamask/rpc-errors'; import type { SignatureControllerMessenger, diff --git a/packages/signature-controller/src/SignatureController.ts b/packages/signature-controller/src/SignatureController.ts index 768100d57c..332c2ca7ee 100644 --- a/packages/signature-controller/src/SignatureController.ts +++ b/packages/signature-controller/src/SignatureController.ts @@ -40,8 +40,8 @@ import { PersonalMessageManager, TypedMessageManager, } from '@metamask/message-manager'; +import { providerErrors, rpcErrors } from '@metamask/rpc-errors'; import type { Hex, Json } from '@metamask/utils'; -import { ethErrors } from 'eth-rpc-errors'; import { bufferToHex } from 'ethereumjs-util'; import EventEmitter from 'events'; import type { Patch } from 'immer'; @@ -435,7 +435,7 @@ export class SignatureController extends BaseControllerV2< #validateUnsignedMessage(messageParams: MessageParamsMetamask): void { if (!this.#isEthSignEnabled()) { - throw ethErrors.rpc.methodNotFound( + throw rpcErrors.methodNotFound( 'eth_sign has been disabled. You must enable it in the advanced settings', ); } @@ -444,9 +444,7 @@ export class SignatureController extends BaseControllerV2< // This is needed because Ethereum's EcSign works only on 32 byte numbers // For 67 length see: https://github.com/MetaMask/metamask-extension/pull/12679/files#r749479607 if (data.length !== 66 && data.length !== 67) { - throw ethErrors.rpc.invalidParams( - 'eth_sign requires 32 byte message hash', - ); + throw rpcErrors.invalidParams('eth_sign requires 32 byte message hash'); } } @@ -513,9 +511,7 @@ export class SignatureController extends BaseControllerV2< ); this.#cancelAbstractMessage(messageManager, messageId); - throw ethErrors.provider.userRejectedRequest( - 'User rejected the request.', - ); + throw providerErrors.userRejectedRequest('User rejected the request.'); } await signMessage(messageParamsWithId, signingOpts); diff --git a/packages/transaction-controller/package.json b/packages/transaction-controller/package.json index d6c50965c1..89887994b5 100644 --- a/packages/transaction-controller/package.json +++ b/packages/transaction-controller/package.json @@ -38,7 +38,7 @@ "@metamask/eth-query": "^3.0.1", "@metamask/metamask-eth-abis": "^3.0.0", "@metamask/network-controller": "^14.0.0", - "@metamask/rpc-errors": "^6.0.0", + "@metamask/rpc-errors": "^6.1.0", "@metamask/utils": "^8.1.0", "async-mutex": "^0.2.6", "eth-method-registry": "1.1.0", diff --git a/packages/transaction-controller/src/TransactionController.ts b/packages/transaction-controller/src/TransactionController.ts index 95a006a104..0e3c812a4a 100644 --- a/packages/transaction-controller/src/TransactionController.ts +++ b/packages/transaction-controller/src/TransactionController.ts @@ -316,6 +316,7 @@ export class TransactionController extends BaseController< this.provider = provider; this.messagingSystem = messenger; this.getNetworkState = getNetworkState; + // @ts-expect-error TODO: Provider type alignment this.ethQuery = new EthQuery(provider); this.isSendFlowHistoryDisabled = disableSendFlowHistory ?? false; this.isHistoryDisabled = disableHistory ?? false; @@ -389,6 +390,7 @@ export class TransactionController extends BaseController< ); onNetworkStateChange(() => { + // @ts-expect-error TODO: Provider type alignment this.ethQuery = new EthQuery(this.provider); this.registry = new MethodRegistry({ provider: this.provider }); }); diff --git a/tests/fake-block-tracker.ts b/tests/fake-block-tracker.ts index 9513e0fd7d..70d1abac89 100644 --- a/tests/fake-block-tracker.ts +++ b/tests/fake-block-tracker.ts @@ -1,6 +1,6 @@ import { SafeEventEmitterProvider } from '@metamask/eth-json-rpc-provider/dist/safe-event-emitter-provider'; +import { JsonRpcEngine } from '@metamask/json-rpc-engine'; import { PollingBlockTracker } from 'eth-block-tracker'; -import { JsonRpcEngine } from 'json-rpc-engine'; /** * Acts like a PollingBlockTracker, but doesn't start the polling loop or @@ -13,10 +13,9 @@ export class FakeBlockTracker extends PollingBlockTracker { super({ provider: new SafeEventEmitterProvider({ engine: new JsonRpcEngine() }), }); - } - - override async _start() { // Don't start the polling loop + // eslint-disable-next-line @typescript-eslint/no-empty-function + (this as any).start = () => {}; } /** diff --git a/yarn.lock b/yarn.lock index b395558b73..f147a4097f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1367,7 +1367,7 @@ __metadata: dependencies: "@metamask/auto-changelog": ^3.1.0 "@metamask/base-controller": ^3.2.3 - "@metamask/rpc-errors": ^6.0.0 + "@metamask/rpc-errors": ^6.1.0 "@metamask/utils": ^8.1.0 "@types/jest": ^27.4.1 deepmerge: ^4.2.2 @@ -1413,7 +1413,7 @@ __metadata: "@metamask/metamask-eth-abis": 3.0.0 "@metamask/network-controller": ^14.0.0 "@metamask/preferences-controller": ^4.4.2 - "@metamask/rpc-errors": ^6.0.0 + "@metamask/rpc-errors": ^6.1.0 "@metamask/utils": ^8.1.0 "@types/jest": ^27.4.1 "@types/node": ^16.18.54 @@ -1539,7 +1539,8 @@ __metadata: "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 - "@metamask/eth-json-rpc-provider": ^1.0.0 + "@metamask/eth-json-rpc-provider": ^2.1.0 + "@metamask/json-rpc-engine": ^7.1.1 "@metamask/utils": ^8.1.0 "@types/node": ^16.18.54 "@typescript-eslint/eslint-plugin": ^5.62.0 @@ -1553,10 +1554,9 @@ __metadata: eslint-plugin-n: ^15.7.0 eslint-plugin-prettier: ^4.2.1 eslint-plugin-promise: ^6.1.1 - eth-block-tracker: ^7.0.1 + eth-block-tracker: ^8.0.0 execa: ^5.0.0 isomorphic-fetch: ^3.0.0 - json-rpc-engine: ^6.1.0 nock: ^13.3.1 prettier: ^2.7.1 prettier-plugin-packagejson: ^2.4.5 @@ -1673,43 +1673,44 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-json-rpc-infura@npm:^8.1.1": - version: 8.1.1 - resolution: "@metamask/eth-json-rpc-infura@npm:8.1.1" +"@metamask/eth-json-rpc-infura@npm:^9.0.0": + version: 9.0.0 + resolution: "@metamask/eth-json-rpc-infura@npm:9.0.0" dependencies: - "@metamask/eth-json-rpc-provider": ^1.0.0 - "@metamask/utils": ^4.0.0 - eth-rpc-errors: ^4.0.3 - json-rpc-engine: ^6.1.0 + "@metamask/eth-json-rpc-provider": ^2.1.0 + "@metamask/json-rpc-engine": ^7.1.1 + "@metamask/rpc-errors": ^6.0.0 + "@metamask/utils": ^8.1.0 node-fetch: ^2.6.7 - checksum: ab4ce53fcc1586344824d58aed4d71412b015466f697758b4849e186038ae1730c9765935dfaf1a9131ff1a8f0f36dcb66fd50355ed95ac7a4bf0bc18c4c2696 + checksum: 3dd6783dd54a72fc479496212524150e3e3f6869a135a02709d3ef9c2d7a2e2b99690eef91776c269da3c0d79709daed0c8693549cb8dd999e5b3d96e0b106c0 languageName: node linkType: hard -"@metamask/eth-json-rpc-middleware@npm:^11.0.2": - version: 11.0.2 - resolution: "@metamask/eth-json-rpc-middleware@npm:11.0.2" +"@metamask/eth-json-rpc-middleware@npm:^12.0.0": + version: 12.0.0 + resolution: "@metamask/eth-json-rpc-middleware@npm:12.0.0" dependencies: - "@metamask/eth-json-rpc-provider": ^1.0.0 - "@metamask/eth-sig-util": ^6.0.0 - "@metamask/utils": ^5.0.1 - clone: ^2.1.1 - eth-block-tracker: ^7.0.1 - eth-rpc-errors: ^4.0.3 - json-rpc-engine: ^6.1.0 - pify: ^3.0.0 - safe-stable-stringify: ^2.3.2 - checksum: e548012b65d33111618e4a30a21b82f22d473e6f9d1ed98f5a8b7db61ffad956f2a09a0196f60bd0ac800f4ed1b19ddb16f680915112a6649fcc2084412ecd0f + "@metamask/eth-json-rpc-provider": ^2.1.0 + "@metamask/eth-sig-util": ^7.0.0 + "@metamask/json-rpc-engine": ^7.1.1 + "@metamask/rpc-errors": ^6.0.0 + "@metamask/utils": ^8.1.0 + eth-block-tracker: ^8.0.0 + klona: ^2.0.6 + pify: ^5.0.0 + safe-stable-stringify: ^2.4.3 + checksum: 22391116f752abcb0145385297b426450260e857d9a37b6aeb7602f48079126e0920d39d28ec3e6de8fc247d589dd089731198af4f92aa98974fa45d37ede027 languageName: node linkType: hard -"@metamask/eth-json-rpc-provider@npm:^1.0.0": - version: 1.0.0 - resolution: "@metamask/eth-json-rpc-provider@npm:1.0.0" +"@metamask/eth-json-rpc-provider@npm:^2.1.0": + version: 2.2.0 + resolution: "@metamask/eth-json-rpc-provider@npm:2.2.0" dependencies: - "@metamask/safe-event-emitter": ^2.0.0 - json-rpc-engine: ^6.1.0 - checksum: 27865d84d90030db1a9e5a66bc0b0ae079706fb7be635ec1e9bd4f64771e819aae78f0a026c6629d3a1a2eb277fcd51977315c049c47a70df1dd95d1d4106982 + "@metamask/json-rpc-engine": ^7.1.0 + "@metamask/safe-event-emitter": ^3.0.0 + "@metamask/utils": ^8.1.0 + checksum: da725fa51e8bfe0b904520b8223aed209fc54605edf1ab5ae6091a460694fd4aad5046f3ae88e8df3741079507dc0e6f2e2c85f1feee8a98506c4f550ea07549 languageName: node linkType: hard @@ -1841,7 +1842,7 @@ __metadata: languageName: unknown linkType: soft -"@metamask/json-rpc-engine@npm:^7.1.1": +"@metamask/json-rpc-engine@npm:^7.1.0, @metamask/json-rpc-engine@npm:^7.1.1": version: 7.1.1 resolution: "@metamask/json-rpc-engine@npm:7.1.1" dependencies: @@ -2005,10 +2006,12 @@ __metadata: "@metamask/auto-changelog": ^3.1.0 "@metamask/base-controller": ^3.2.3 "@metamask/controller-utils": ^5.0.2 - "@metamask/eth-json-rpc-infura": ^8.1.1 - "@metamask/eth-json-rpc-middleware": ^11.0.2 - "@metamask/eth-json-rpc-provider": ^1.0.0 + "@metamask/eth-json-rpc-infura": ^9.0.0 + "@metamask/eth-json-rpc-middleware": ^12.0.0 + "@metamask/eth-json-rpc-provider": ^2.1.0 "@metamask/eth-query": ^3.0.1 + "@metamask/json-rpc-engine": ^7.1.1 + "@metamask/rpc-errors": ^6.1.0 "@metamask/swappable-obj-proxy": ^2.1.0 "@metamask/utils": ^8.1.0 "@types/jest": ^27.4.1 @@ -2016,12 +2019,10 @@ __metadata: "@types/lodash": ^4.14.191 async-mutex: ^0.2.6 deepmerge: ^4.2.2 - eth-block-tracker: ^7.0.1 - eth-rpc-errors: ^4.0.2 + eth-block-tracker: ^8.0.0 immer: ^9.0.6 jest: ^27.5.1 jest-when: ^3.4.2 - json-rpc-engine: ^6.1.0 lodash: ^4.17.21 nock: ^13.3.1 sinon: ^9.2.4 @@ -2112,7 +2113,7 @@ __metadata: "@metamask/base-controller": ^3.2.3 "@metamask/controller-utils": ^5.0.2 "@metamask/json-rpc-engine": ^7.1.1 - "@metamask/rpc-errors": ^6.0.0 + "@metamask/rpc-errors": ^6.1.0 "@metamask/utils": ^8.1.0 "@types/deep-freeze-strict": ^1.1.0 "@types/jest": ^27.4.1 @@ -2267,9 +2268,9 @@ __metadata: dependencies: "@metamask/auto-changelog": ^3.1.0 "@metamask/base-controller": ^3.2.3 + "@metamask/rpc-errors": ^6.1.0 "@types/jest": ^27.4.1 deepmerge: ^4.2.2 - eth-rpc-errors: ^4.0.2 immer: ^9.0.6 jest: ^27.5.1 ts-jest: ^27.1.4 @@ -2279,13 +2280,13 @@ __metadata: languageName: unknown linkType: soft -"@metamask/rpc-errors@npm:^6.0.0": - version: 6.0.0 - resolution: "@metamask/rpc-errors@npm:6.0.0" +"@metamask/rpc-errors@npm:^6.0.0, @metamask/rpc-errors@npm:^6.1.0": + version: 6.1.0 + resolution: "@metamask/rpc-errors@npm:6.1.0" dependencies: - "@metamask/utils": ^8.0.0 + "@metamask/utils": ^8.1.0 fast-safe-stringify: ^2.0.6 - checksum: 7e1ee1a98972266af4a34f0bbc842cdc11dc565056f0b8fbc93aa95663a7027eab8ff1fecbe3e09c38a1dc199f8219a6c69b2237015b2fdb8de0e5b35027c3f8 + checksum: 9f4821d804e2fcaa8987b0958d02c6d829b7c7db49740c811cb593f381d0c4b00dabb7f1802907f1b2f6126f7c0d83ec34219183d29650f5d24df014ac72906a languageName: node linkType: hard @@ -2372,12 +2373,12 @@ __metadata: dependencies: "@metamask/auto-changelog": ^3.1.0 "@metamask/base-controller": ^3.2.3 + "@metamask/json-rpc-engine": ^7.1.1 "@metamask/network-controller": ^14.0.0 "@types/jest": ^27.4.1 deepmerge: ^4.2.2 immer: ^9.0.6 jest: ^27.5.1 - json-rpc-engine: ^6.1.0 lodash: ^4.17.21 nock: ^13.3.1 sinon: ^9.2.4 @@ -2401,10 +2402,10 @@ __metadata: "@metamask/keyring-controller": ^8.0.2 "@metamask/logging-controller": ^1.0.3 "@metamask/message-manager": ^7.3.5 + "@metamask/rpc-errors": ^6.1.0 "@metamask/utils": ^8.1.0 "@types/jest": ^27.4.1 deepmerge: ^4.2.2 - eth-rpc-errors: ^4.0.2 ethereumjs-util: ^7.0.10 immer: ^9.0.6 jest: ^27.5.1 @@ -2626,7 +2627,7 @@ __metadata: "@metamask/eth-query": ^3.0.1 "@metamask/metamask-eth-abis": ^3.0.0 "@metamask/network-controller": ^14.0.0 - "@metamask/rpc-errors": ^6.0.0 + "@metamask/rpc-errors": ^6.1.0 "@metamask/utils": ^8.1.0 "@types/jest": ^27.4.1 "@types/node": ^16.18.54 @@ -2660,19 +2661,7 @@ __metadata: languageName: node linkType: hard -"@metamask/utils@npm:^4.0.0": - version: 4.0.0 - resolution: "@metamask/utils@npm:4.0.0" - dependencies: - "@types/debug": ^4.1.7 - debug: ^4.3.4 - semver: ^7.3.8 - superstruct: ^1.0.3 - checksum: 6d4edca78fe1f66504ed5e5ca021a67f4b4e0893e86484c746b87039c2161c39d3b8bd8e4b9235ddfd023b2d76dd54210af94ec5550e27bc4ad9c0d7d5f3f231 - languageName: node - linkType: hard - -"@metamask/utils@npm:^5.0.0, @metamask/utils@npm:^5.0.1, @metamask/utils@npm:^5.0.2": +"@metamask/utils@npm:^5.0.0, @metamask/utils@npm:^5.0.2": version: 5.0.2 resolution: "@metamask/utils@npm:5.0.2" dependencies: @@ -4319,13 +4308,6 @@ __metadata: languageName: node linkType: hard -"clone@npm:^2.1.1": - version: 2.1.2 - resolution: "clone@npm:2.1.2" - checksum: aaf106e9bc025b21333e2f4c12da539b568db4925c0501a1bf4070836c9e848c892fa22c35548ce0d1132b08bbbfa17a00144fe58fccdab6fa900fec4250f67d - languageName: node - linkType: hard - "cmd-shim@npm:^6.0.0": version: 6.0.1 resolution: "cmd-shim@npm:6.0.1" @@ -5349,16 +5331,16 @@ __metadata: languageName: node linkType: hard -"eth-block-tracker@npm:^7.0.1": - version: 7.1.0 - resolution: "eth-block-tracker@npm:7.1.0" +"eth-block-tracker@npm:^8.0.0": + version: 8.0.0 + resolution: "eth-block-tracker@npm:8.0.0" dependencies: - "@metamask/eth-json-rpc-provider": ^1.0.0 + "@metamask/eth-json-rpc-provider": ^2.1.0 "@metamask/safe-event-emitter": ^3.0.0 - "@metamask/utils": ^5.0.1 + "@metamask/utils": ^8.1.0 json-rpc-random-id: ^1.0.1 - pify: ^3.0.0 - checksum: 1d019f261e0ef07387cd74538b160700caa35ba9859ab9d4e5137c48bf9c92822c3b4ade40f8a504f16cb813de4c317c5378d047625ddf04592e256be8842588 + pify: ^5.0.0 + checksum: 3416c2ee653f81d1f71f3a9b80e04837fb516494f64ded45c053dfc24c6c6ce8dac7e5b8376cd57f52838f43a93d20a8e17d4d875e50d1e4c267543ffe0e6ad8 languageName: node linkType: hard @@ -7737,6 +7719,13 @@ __metadata: languageName: node linkType: hard +"klona@npm:^2.0.6": + version: 2.0.6 + resolution: "klona@npm:2.0.6" + checksum: ac9ee3732e42b96feb67faae4d27cf49494e8a3bf3fa7115ce242fe04786788e0aff4741a07a45a2462e2079aa983d73d38519c85d65b70ef11447bbc3c58ce7 + languageName: node + linkType: hard + "leven@npm:^3.1.0": version: 3.1.0 resolution: "leven@npm:3.1.0" @@ -8642,10 +8631,10 @@ __metadata: languageName: node linkType: hard -"pify@npm:^3.0.0": - version: 3.0.0 - resolution: "pify@npm:3.0.0" - checksum: 6cdcbc3567d5c412450c53261a3f10991665d660961e06605decf4544a61a97a54fefe70a68d5c37080ff9d6f4cf51444c90198d1ba9f9309a6c0d6e9f5c4fde +"pify@npm:^5.0.0": + version: 5.0.0 + resolution: "pify@npm:5.0.0" + checksum: 443e3e198ad6bfa8c0c533764cf75c9d5bc976387a163792fb553ffe6ce923887cf14eebf5aea9b7caa8eab930da8c33612990ae85bd8c2bc18bedb9eae94ecb languageName: node linkType: hard @@ -9153,7 +9142,7 @@ __metadata: languageName: node linkType: hard -"safe-stable-stringify@npm:^2.3.2": +"safe-stable-stringify@npm:^2.4.3": version: 2.4.3 resolution: "safe-stable-stringify@npm:2.4.3" checksum: 3aeb64449706ee1f5ad2459fc99648b131d48e7a1fbb608d7c628020177512dc9d94108a5cb61bbc953985d313d0afea6566d243237743e02870490afef04b43