diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 24ae9c0b63e7..c09e08d17e34 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -14,9 +14,9 @@ import { fetchMultiExchangeRate, } from '@metamask/assets-controllers'; import { JsonRpcEngine } from '@metamask/json-rpc-engine'; +import { createEngineStream } from '@metamask/json-rpc-middleware-stream'; import { ObservableStore } from '@metamask/obs-store'; import { storeAsStream } from '@metamask/obs-store/dist/asStream'; -import { createEngineStream } from 'json-rpc-middleware-stream'; import { providerAsMiddleware } from '@metamask/eth-json-rpc-middleware'; import { debounce, throttle, memoize, wrap } from 'lodash'; import { diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 9c89e02d2790..9e5b4b2504c0 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -1276,6 +1276,17 @@ "@metamask/utils": true } }, + "@metamask/json-rpc-middleware-stream": { + "globals": { + "console.warn": true, + "setTimeout": true + }, + "packages": { + "@metamask/safe-event-emitter": true, + "@metamask/utils": true, + "readable-stream": true + } + }, "@metamask/keyring-api": { "globals": { "URL": true @@ -2481,11 +2492,11 @@ "setTimeout": true }, "packages": { + "@metamask/json-rpc-middleware-stream": true, "@metamask/object-multiplex": true, "@metamask/post-message-stream": true, "@metamask/snaps-controllers>@metamask/base-controller": true, "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, - "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": true, "@metamask/snaps-controllers>@metamask/permission-controller": true, "@metamask/snaps-controllers>@metamask/rpc-errors": true, "@metamask/snaps-controllers>@xstate/fsm": true, @@ -2525,17 +2536,6 @@ "@metamask/utils": true } }, - "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": { - "globals": { - "console.warn": true, - "setTimeout": true - }, - "packages": { - "@metamask/safe-event-emitter": true, - "@metamask/utils": true, - "readable-stream": true - } - }, "@metamask/snaps-controllers>@metamask/permission-controller": { "globals": { "console.error": true @@ -4525,16 +4525,6 @@ "stream-http": true } }, - "json-rpc-middleware-stream": { - "globals": { - "console.warn": true, - "setTimeout": true - }, - "packages": { - "@metamask/safe-event-emitter": true, - "readable-stream": true - } - }, "koa>content-disposition>safe-buffer": { "packages": { "browserify>buffer": true diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 9c89e02d2790..9e5b4b2504c0 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -1276,6 +1276,17 @@ "@metamask/utils": true } }, + "@metamask/json-rpc-middleware-stream": { + "globals": { + "console.warn": true, + "setTimeout": true + }, + "packages": { + "@metamask/safe-event-emitter": true, + "@metamask/utils": true, + "readable-stream": true + } + }, "@metamask/keyring-api": { "globals": { "URL": true @@ -2481,11 +2492,11 @@ "setTimeout": true }, "packages": { + "@metamask/json-rpc-middleware-stream": true, "@metamask/object-multiplex": true, "@metamask/post-message-stream": true, "@metamask/snaps-controllers>@metamask/base-controller": true, "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, - "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": true, "@metamask/snaps-controllers>@metamask/permission-controller": true, "@metamask/snaps-controllers>@metamask/rpc-errors": true, "@metamask/snaps-controllers>@xstate/fsm": true, @@ -2525,17 +2536,6 @@ "@metamask/utils": true } }, - "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": { - "globals": { - "console.warn": true, - "setTimeout": true - }, - "packages": { - "@metamask/safe-event-emitter": true, - "@metamask/utils": true, - "readable-stream": true - } - }, "@metamask/snaps-controllers>@metamask/permission-controller": { "globals": { "console.error": true @@ -4525,16 +4525,6 @@ "stream-http": true } }, - "json-rpc-middleware-stream": { - "globals": { - "console.warn": true, - "setTimeout": true - }, - "packages": { - "@metamask/safe-event-emitter": true, - "readable-stream": true - } - }, "koa>content-disposition>safe-buffer": { "packages": { "browserify>buffer": true diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 9c89e02d2790..9e5b4b2504c0 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -1276,6 +1276,17 @@ "@metamask/utils": true } }, + "@metamask/json-rpc-middleware-stream": { + "globals": { + "console.warn": true, + "setTimeout": true + }, + "packages": { + "@metamask/safe-event-emitter": true, + "@metamask/utils": true, + "readable-stream": true + } + }, "@metamask/keyring-api": { "globals": { "URL": true @@ -2481,11 +2492,11 @@ "setTimeout": true }, "packages": { + "@metamask/json-rpc-middleware-stream": true, "@metamask/object-multiplex": true, "@metamask/post-message-stream": true, "@metamask/snaps-controllers>@metamask/base-controller": true, "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, - "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": true, "@metamask/snaps-controllers>@metamask/permission-controller": true, "@metamask/snaps-controllers>@metamask/rpc-errors": true, "@metamask/snaps-controllers>@xstate/fsm": true, @@ -2525,17 +2536,6 @@ "@metamask/utils": true } }, - "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": { - "globals": { - "console.warn": true, - "setTimeout": true - }, - "packages": { - "@metamask/safe-event-emitter": true, - "@metamask/utils": true, - "readable-stream": true - } - }, "@metamask/snaps-controllers>@metamask/permission-controller": { "globals": { "console.error": true @@ -4525,16 +4525,6 @@ "stream-http": true } }, - "json-rpc-middleware-stream": { - "globals": { - "console.warn": true, - "setTimeout": true - }, - "packages": { - "@metamask/safe-event-emitter": true, - "readable-stream": true - } - }, "koa>content-disposition>safe-buffer": { "packages": { "browserify>buffer": true diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 8b01ac0df789..a83eef0c7332 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -1368,6 +1368,17 @@ "@metamask/utils": true } }, + "@metamask/json-rpc-middleware-stream": { + "globals": { + "console.warn": true, + "setTimeout": true + }, + "packages": { + "@metamask/safe-event-emitter": true, + "@metamask/utils": true, + "readable-stream": true + } + }, "@metamask/keyring-api": { "globals": { "URL": true @@ -2573,11 +2584,11 @@ "setTimeout": true }, "packages": { + "@metamask/json-rpc-middleware-stream": true, "@metamask/object-multiplex": true, "@metamask/post-message-stream": true, "@metamask/snaps-controllers>@metamask/base-controller": true, "@metamask/snaps-controllers>@metamask/json-rpc-engine": true, - "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": true, "@metamask/snaps-controllers>@metamask/permission-controller": true, "@metamask/snaps-controllers>@metamask/rpc-errors": true, "@metamask/snaps-controllers>@xstate/fsm": true, @@ -2617,17 +2628,6 @@ "@metamask/utils": true } }, - "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": { - "globals": { - "console.warn": true, - "setTimeout": true - }, - "packages": { - "@metamask/safe-event-emitter": true, - "@metamask/utils": true, - "readable-stream": true - } - }, "@metamask/snaps-controllers>@metamask/permission-controller": { "globals": { "console.error": true @@ -4617,16 +4617,6 @@ "stream-http": true } }, - "json-rpc-middleware-stream": { - "globals": { - "console.warn": true, - "setTimeout": true - }, - "packages": { - "@metamask/safe-event-emitter": true, - "readable-stream": true - } - }, "koa>content-disposition>safe-buffer": { "packages": { "browserify>buffer": true diff --git a/package.json b/package.json index 821b21e7a816..a4201803eb4c 100644 --- a/package.json +++ b/package.json @@ -310,6 +310,7 @@ "@metamask/gas-fee-controller": "^18.0.0", "@metamask/jazzicon": "^2.0.0", "@metamask/json-rpc-engine": "^10.0.0", + "@metamask/json-rpc-middleware-stream": "^8.0.4", "@metamask/keyring-api": "^8.1.3", "@metamask/keyring-controller": "^17.2.2", "@metamask/logging-controller": "^6.0.0", @@ -388,7 +389,6 @@ "immer": "^9.0.6", "is-retry-allowed": "^2.2.0", "jest-junit": "^14.0.1", - "json-rpc-middleware-stream": "^5.0.1", "labeled-stream-splicer": "^2.0.2", "localforage": "^1.9.0", "lodash": "^4.17.21", diff --git a/yarn.lock b/yarn.lock index 6ae7e43bbf62..dede42412974 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5519,15 +5519,15 @@ __metadata: languageName: node linkType: hard -"@metamask/json-rpc-middleware-stream@npm:^8.0.1, @metamask/json-rpc-middleware-stream@npm:^8.0.2": - version: 8.0.2 - resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.2" +"@metamask/json-rpc-middleware-stream@npm:^8.0.1, @metamask/json-rpc-middleware-stream@npm:^8.0.2, @metamask/json-rpc-middleware-stream@npm:^8.0.4": + version: 8.0.4 + resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.4" dependencies: - "@metamask/json-rpc-engine": "npm:^9.0.2" + "@metamask/json-rpc-engine": "npm:^10.0.0" "@metamask/safe-event-emitter": "npm:^3.0.0" "@metamask/utils": "npm:^9.1.0" readable-stream: "npm:^3.6.2" - checksum: 10/aaf41cb6fa015494eb0424959d14022b1355c390066898603223e3418d93bd72249b6e54caee3e23b4d6a679f389c2374f687882f2a7202379b4f4b042a84974 + checksum: 10/93c842e1ac8e624c65d888cb3539b38ade5b8415ea45f649d78dad91e7139f11fa96bbf89136998d21def7711b3f710939f8e4498ce31a6cf461892e3f4ba176 languageName: node linkType: hard @@ -25920,6 +25920,7 @@ __metadata: "@metamask/gas-fee-controller": "npm:^18.0.0" "@metamask/jazzicon": "npm:^2.0.0" "@metamask/json-rpc-engine": "npm:^10.0.0" + "@metamask/json-rpc-middleware-stream": "npm:^8.0.4" "@metamask/keyring-api": "npm:^8.1.3" "@metamask/keyring-controller": "npm:^17.2.2" "@metamask/logging-controller": "npm:^6.0.0" @@ -26138,7 +26139,6 @@ __metadata: jest-environment-jsdom: "patch:jest-environment-jsdom@npm%3A29.7.0#~/.yarn/patches/jest-environment-jsdom-npm-29.7.0-0b72dd0e0b.patch" jest-junit: "npm:^14.0.1" jsdom: "npm:^16.7.0" - json-rpc-middleware-stream: "npm:^5.0.1" json-schema-to-ts: "npm:^3.0.1" koa: "npm:^2.7.0" labeled-stream-splicer: "npm:^2.0.2"