diff --git a/packages/snaps-controllers/src/snaps/SnapController.test.ts b/packages/snaps-controllers/src/snaps/SnapController.test.ts index 201a25f8f2..4a45f7db37 100644 --- a/packages/snaps-controllers/src/snaps/SnapController.test.ts +++ b/packages/snaps-controllers/src/snaps/SnapController.test.ts @@ -33,7 +33,7 @@ import { import type { SemVerRange, SemVerVersion } from '@metamask/utils'; import { AssertionError } from '@metamask/utils'; import fetchMock from 'jest-fetch-mock'; -import { createAsyncMiddleware, JsonRpcEngine } from 'json-rpc-engine'; +import { createAsyncMiddleware, JsonRpcEngine }from '@metamask/json-rpc-engine'; import { createEngineStream } from 'json-rpc-middleware-stream'; import pump from 'pump'; import type { Duplex } from 'stream'; diff --git a/packages/snaps-controllers/src/test-utils/execution-environment.ts b/packages/snaps-controllers/src/test-utils/execution-environment.ts index 33cec2b79a..cc49070f27 100644 --- a/packages/snaps-controllers/src/test-utils/execution-environment.ts +++ b/packages/snaps-controllers/src/test-utils/execution-environment.ts @@ -1,6 +1,6 @@ import type { SnapRpcHookArgs } from '@metamask/snaps-utils'; import type { MockControllerMessenger } from '@metamask/snaps-utils/test-utils'; -import { JsonRpcEngine } from 'json-rpc-engine'; +import { JsonRpcEngine }from '@metamask/json-rpc-engine'; import { createEngineStream } from 'json-rpc-middleware-stream'; import pump from 'pump'; diff --git a/packages/snaps-controllers/src/test-utils/service.ts b/packages/snaps-controllers/src/test-utils/service.ts index 2abb7146cb..02bdefba2e 100644 --- a/packages/snaps-controllers/src/test-utils/service.ts +++ b/packages/snaps-controllers/src/test-utils/service.ts @@ -1,5 +1,5 @@ import { ControllerMessenger } from '@metamask/base-controller'; -import { JsonRpcEngine } from 'json-rpc-engine'; +import { JsonRpcEngine }from '@metamask/json-rpc-engine'; import { createEngineStream } from 'json-rpc-middleware-stream'; import pump from 'pump'; import type { Duplex } from 'stream'; diff --git a/packages/snaps-execution-environments/package.json b/packages/snaps-execution-environments/package.json index bae7b2ff78..51e5594e66 100644 --- a/packages/snaps-execution-environments/package.json +++ b/packages/snaps-execution-environments/package.json @@ -45,6 +45,7 @@ "lint:dependencies": "depcheck" }, "dependencies": { + "@metamask/json-rpc-engine": "^7.1.1", "@metamask/object-multiplex": "^1.2.0", "@metamask/post-message-stream": "^7.0.0", "@metamask/providers": "^11.1.1", @@ -52,7 +53,6 @@ "@metamask/rpc-methods": "workspace:^", "@metamask/snaps-utils": "workspace:^", "@metamask/utils": "^8.1.0", - "json-rpc-engine": "^6.1.0", "nanoid": "^3.1.31", "pump": "^3.0.0", "superstruct": "^1.0.3" diff --git a/packages/snaps-execution-environments/src/common/BaseSnapExecutor.ts b/packages/snaps-execution-environments/src/common/BaseSnapExecutor.ts index 060e34336f..12b93d21e2 100644 --- a/packages/snaps-execution-environments/src/common/BaseSnapExecutor.ts +++ b/packages/snaps-execution-environments/src/common/BaseSnapExecutor.ts @@ -28,7 +28,7 @@ import { hasProperty, getSafeJson, } from '@metamask/utils'; -import { createIdRemapMiddleware } from 'json-rpc-engine'; +import { createIdRemapMiddleware }from '@metamask/json-rpc-engine'; import type { Duplex } from 'stream'; import { validate } from 'superstruct'; diff --git a/packages/snaps-execution-environments/src/common/test-utils/endowments.ts b/packages/snaps-execution-environments/src/common/test-utils/endowments.ts index 7e4db25ec7..b11cd2fa2f 100644 --- a/packages/snaps-execution-environments/src/common/test-utils/endowments.ts +++ b/packages/snaps-execution-environments/src/common/test-utils/endowments.ts @@ -4,7 +4,7 @@ import ObjectMultiplex from '@metamask/object-multiplex'; import { StreamProvider } from '@metamask/providers'; import type { RequestArguments } from '@metamask/providers/dist/BaseProvider'; import { SNAP_STREAM_NAMES } from '@metamask/snaps-utils'; -import { createIdRemapMiddleware } from 'json-rpc-engine'; +import { createIdRemapMiddleware }from '@metamask/json-rpc-engine'; import { assertEthereumOutboundRequest, diff --git a/packages/snaps-simulator/package.json b/packages/snaps-simulator/package.json index 5fe7208285..bc36441a43 100644 --- a/packages/snaps-simulator/package.json +++ b/packages/snaps-simulator/package.json @@ -55,6 +55,7 @@ "@metamask/base-controller": "^3.2.0", "@metamask/browser-passworder": "^4.1.0", "@metamask/eth-json-rpc-middleware": "^12.0.0", + "@metamask/json-rpc-engine": "^7.1.1", "@metamask/key-tree": "^9.0.0", "@metamask/permission-controller": "^4.1.0", "@metamask/rpc-errors": "^6.0.0", @@ -69,7 +70,6 @@ "date-fns": "^2.30.0", "fast-deep-equal": "^3.1.3", "framer-motion": "^10.12.8", - "json-rpc-engine": "^6.1.0", "json-rpc-middleware-stream": "^4.2.0", "monaco-editor": "^0.38.0", "pump": "^3.0.0", diff --git a/packages/snaps-simulator/src/features/simulation/middleware.test.ts b/packages/snaps-simulator/src/features/simulation/middleware.test.ts index 3e3e1078ab..e0aab76d81 100644 --- a/packages/snaps-simulator/src/features/simulation/middleware.test.ts +++ b/packages/snaps-simulator/src/features/simulation/middleware.test.ts @@ -1,5 +1,5 @@ import { mnemonicPhraseToBytes } from '@metamask/key-tree'; -import { JsonRpcEngine } from 'json-rpc-engine'; +import { JsonRpcEngine }from '@metamask/json-rpc-engine'; import { DEFAULT_SRP } from '../configuration'; import { createMiscMethodMiddleware } from './middleware'; diff --git a/packages/snaps-simulator/src/features/simulation/middleware.ts b/packages/snaps-simulator/src/features/simulation/middleware.ts index 0b6ff69efa..b9cf9b2d9c 100644 --- a/packages/snaps-simulator/src/features/simulation/middleware.ts +++ b/packages/snaps-simulator/src/features/simulation/middleware.ts @@ -6,7 +6,7 @@ import type { JsonRpcMiddleware, JsonRpcRequest, PendingJsonRpcResponse, -} from 'json-rpc-engine'; +}from '@metamask/json-rpc-engine'; /* eslint-disable @typescript-eslint/naming-convention */ export const methodHandlers = { diff --git a/packages/snaps-simulator/src/features/simulation/sagas.ts b/packages/snaps-simulator/src/features/simulation/sagas.ts index e68b9c4b24..b6da23c8d0 100644 --- a/packages/snaps-simulator/src/features/simulation/sagas.ts +++ b/packages/snaps-simulator/src/features/simulation/sagas.ts @@ -27,7 +27,7 @@ import type { import { logError } from '@metamask/snaps-utils'; import { getSafeJson } from '@metamask/utils'; import type { PayloadAction } from '@reduxjs/toolkit'; -import { JsonRpcEngine } from 'json-rpc-engine'; +import { JsonRpcEngine }from '@metamask/json-rpc-engine'; import { createEngineStream } from 'json-rpc-middleware-stream'; import pump from 'pump'; import type { SagaIterator } from 'redux-saga'; @@ -170,7 +170,7 @@ export function* initSaga({ payload }: PayloadAction) { const mux = setupMultiplex(rpcStream, 'snapStream'); const stream = mux.createStream( 'metamask-provider', - ) as unknown as pump.Stream; + ) as pump.Stream; const providerStream = createEngineStream({ engine }); pump(stream, providerStream, stream); }, diff --git a/yarn.lock b/yarn.lock index c8b60c168c..f9582e2841 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4842,6 +4842,7 @@ __metadata: "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 + "@metamask/json-rpc-engine": ^7.1.1 "@metamask/key-tree": ^9.0.0 "@metamask/permission-controller": ^4.1.0 "@metamask/rpc-errors": ^6.0.0 @@ -4869,7 +4870,6 @@ __metadata: expect-type: ^0.15.0 jest: ^29.0.2 jest-it-up: ^2.0.0 - json-rpc-engine: ^6.1.0 prettier: ^2.7.1 prettier-plugin-packagejson: ^2.2.11 rimraf: ^4.1.2 @@ -5139,6 +5139,7 @@ __metadata: "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 + "@metamask/json-rpc-engine": ^7.1.1 "@metamask/object-multiplex": ^1.2.0 "@metamask/post-message-stream": ^7.0.0 "@metamask/providers": ^11.1.1 @@ -5182,7 +5183,6 @@ __metadata: jest: ^29.0.2 jest-environment-node: ^29.5.0 jest-fetch-mock: ^3.0.3 - json-rpc-engine: ^6.1.0 lavamoat: ^7.0.0 lavamoat-browserify: ^15.7.1 nanoid: ^3.1.31 @@ -5325,6 +5325,7 @@ __metadata: "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 "@metamask/eth-json-rpc-middleware": ^12.0.0 + "@metamask/json-rpc-engine": ^7.1.1 "@metamask/key-tree": ^9.0.0 "@metamask/permission-controller": ^4.1.0 "@metamask/rpc-errors": ^6.0.0 @@ -5378,7 +5379,6 @@ __metadata: jest-environment-jsdom: ^29.5.0 jest-fetch-mock: ^3.0.3 jest-it-up: ^2.0.0 - json-rpc-engine: ^6.1.0 json-rpc-middleware-stream: ^4.2.0 monaco-editor: ^0.38.0 monaco-editor-webpack-plugin: ^7.0.1