From 7dee24cdad0ef3067fe0d0a1733836406563c792 Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Mon, 15 Jul 2024 10:37:34 -0400 Subject: [PATCH] Bump `@metamask/providers` from `17.0.0` to `^17.1.1` --- .../lavamoat/browserify/iframe/policy.json | 55 +++++++++++-- .../browserify/node-process/policy.json | 82 +++++++++++++++++-- .../browserify/node-thread/policy.json | 82 +++++++++++++++++-- .../browserify/worker-executor/policy.json | 55 +++++++++++-- .../snaps-execution-environments/package.json | 2 +- .../src/common/BaseSnapExecutor.ts | 2 +- packages/snaps-sdk/package.json | 2 +- packages/test-snaps/package.json | 2 +- yarn.lock | 68 ++++++--------- 9 files changed, 267 insertions(+), 83 deletions(-) diff --git a/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json index b251904ff1..0fea054be0 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json @@ -39,26 +39,33 @@ }, "@metamask/providers": { "globals": { - "console": true + "CustomEvent": true, + "Event": true, + "addEventListener": true, + "chrome.runtime.connect": true, + "console": true, + "dispatchEvent": true, + "document.createElement": true, + "document.readyState": true, + "ethereum": "write", + "location.hostname": true, + "removeEventListener": true, + "web3": true }, "packages": { + "@metamask/json-rpc-engine": true, "@metamask/object-multiplex": true, - "@metamask/providers>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/json-rpc-middleware-stream": true, "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/providers>detect-browser": true, + "@metamask/providers>extension-port-stream": true, "@metamask/providers>is-stream": true, "@metamask/rpc-errors": true, + "@metamask/utils": true, "eslint>fast-deep-equal": true, "readable-stream": true } }, - "@metamask/providers>@metamask/json-rpc-engine": { - "packages": { - "@metamask/providers>@metamask/safe-event-emitter": true, - "@metamask/rpc-errors": true, - "@metamask/utils": true - } - }, "@metamask/providers>@metamask/json-rpc-middleware-stream": { "globals": { "console.warn": true, @@ -66,6 +73,7 @@ }, "packages": { "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/utils": true, "readable-stream": true } }, @@ -77,6 +85,35 @@ "browserify>events": true } }, + "@metamask/providers>detect-browser": { + "globals": { + "document": true, + "navigator": true + }, + "packages": { + "browserify>process": true + } + }, + "@metamask/providers>extension-port-stream": { + "packages": { + "@metamask/providers>extension-port-stream>readable-stream": true, + "browserify>buffer": true + } + }, + "@metamask/providers>extension-port-stream>readable-stream": { + "globals": { + "AbortController": true, + "AggregateError": true, + "Blob": true + }, + "packages": { + "@metamask/providers>extension-port-stream>readable-stream>abort-controller": true, + "browserify>buffer": true, + "browserify>events": true, + "browserify>process": true, + "browserify>string_decoder": true + } + }, "@metamask/rpc-errors": { "packages": { "@metamask/rpc-errors>fast-safe-stringify": true, diff --git a/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json index 760ede1af5..2fb6e952f3 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json @@ -46,26 +46,33 @@ }, "@metamask/providers": { "globals": { - "console": true + "CustomEvent": true, + "Event": true, + "addEventListener": true, + "chrome.runtime.connect": true, + "console": true, + "dispatchEvent": true, + "document.createElement": true, + "document.readyState": true, + "ethereum": "write", + "location.hostname": true, + "removeEventListener": true, + "web3": true }, "packages": { + "@metamask/json-rpc-engine": true, "@metamask/object-multiplex": true, - "@metamask/providers>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/json-rpc-middleware-stream": true, "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/providers>detect-browser": true, + "@metamask/providers>extension-port-stream": true, "@metamask/providers>is-stream": true, "@metamask/rpc-errors": true, + "@metamask/utils": true, "eslint>fast-deep-equal": true, "readable-stream": true } }, - "@metamask/providers>@metamask/json-rpc-engine": { - "packages": { - "@metamask/providers>@metamask/safe-event-emitter": true, - "@metamask/rpc-errors": true, - "@metamask/utils": true - } - }, "@metamask/providers>@metamask/json-rpc-middleware-stream": { "globals": { "console.warn": true, @@ -73,6 +80,7 @@ }, "packages": { "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/utils": true, "readable-stream": true } }, @@ -87,6 +95,57 @@ "events": true } }, + "@metamask/providers>detect-browser": { + "globals": { + "document": true, + "navigator": true, + "process": true + } + }, + "@metamask/providers>extension-port-stream": { + "builtin": { + "buffer.Buffer": true + }, + "packages": { + "@metamask/providers>extension-port-stream>readable-stream": true, + "buffer": true + } + }, + "@metamask/providers>extension-port-stream>readable-stream": { + "builtin": { + "buffer.Blob": true, + "buffer.Buffer": true, + "events.EventEmitter": true, + "stream": true, + "string_decoder.StringDecoder": true + }, + "globals": { + "AbortController": true, + "AggregateError": true, + "Blob": true, + "process.env.READABLE_STREAM": true + }, + "packages": { + "@metamask/providers>extension-port-stream>readable-stream>abort-controller": true, + "browserify>process": true, + "buffer": true, + "events": true, + "stream": true, + "string_decoder": true + } + }, + "@metamask/providers>extension-port-stream>readable-stream>abort-controller": { + "packages": { + "@metamask/providers>extension-port-stream>readable-stream>abort-controller>event-target-shim": true + } + }, + "@metamask/providers>extension-port-stream>readable-stream>abort-controller>event-target-shim": { + "globals": { + "Event": true, + "EventTarget": true, + "console": true + } + }, "@metamask/rpc-errors": { "packages": { "@metamask/rpc-errors>fast-safe-stringify": true, @@ -180,6 +239,11 @@ "util": true } }, + "browserify>process": { + "globals": { + "process": true + } + }, "browserify>string_decoder": { "packages": { "browserify>browser-pack>safe-buffer": true diff --git a/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json index 760ede1af5..2fb6e952f3 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json @@ -46,26 +46,33 @@ }, "@metamask/providers": { "globals": { - "console": true + "CustomEvent": true, + "Event": true, + "addEventListener": true, + "chrome.runtime.connect": true, + "console": true, + "dispatchEvent": true, + "document.createElement": true, + "document.readyState": true, + "ethereum": "write", + "location.hostname": true, + "removeEventListener": true, + "web3": true }, "packages": { + "@metamask/json-rpc-engine": true, "@metamask/object-multiplex": true, - "@metamask/providers>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/json-rpc-middleware-stream": true, "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/providers>detect-browser": true, + "@metamask/providers>extension-port-stream": true, "@metamask/providers>is-stream": true, "@metamask/rpc-errors": true, + "@metamask/utils": true, "eslint>fast-deep-equal": true, "readable-stream": true } }, - "@metamask/providers>@metamask/json-rpc-engine": { - "packages": { - "@metamask/providers>@metamask/safe-event-emitter": true, - "@metamask/rpc-errors": true, - "@metamask/utils": true - } - }, "@metamask/providers>@metamask/json-rpc-middleware-stream": { "globals": { "console.warn": true, @@ -73,6 +80,7 @@ }, "packages": { "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/utils": true, "readable-stream": true } }, @@ -87,6 +95,57 @@ "events": true } }, + "@metamask/providers>detect-browser": { + "globals": { + "document": true, + "navigator": true, + "process": true + } + }, + "@metamask/providers>extension-port-stream": { + "builtin": { + "buffer.Buffer": true + }, + "packages": { + "@metamask/providers>extension-port-stream>readable-stream": true, + "buffer": true + } + }, + "@metamask/providers>extension-port-stream>readable-stream": { + "builtin": { + "buffer.Blob": true, + "buffer.Buffer": true, + "events.EventEmitter": true, + "stream": true, + "string_decoder.StringDecoder": true + }, + "globals": { + "AbortController": true, + "AggregateError": true, + "Blob": true, + "process.env.READABLE_STREAM": true + }, + "packages": { + "@metamask/providers>extension-port-stream>readable-stream>abort-controller": true, + "browserify>process": true, + "buffer": true, + "events": true, + "stream": true, + "string_decoder": true + } + }, + "@metamask/providers>extension-port-stream>readable-stream>abort-controller": { + "packages": { + "@metamask/providers>extension-port-stream>readable-stream>abort-controller>event-target-shim": true + } + }, + "@metamask/providers>extension-port-stream>readable-stream>abort-controller>event-target-shim": { + "globals": { + "Event": true, + "EventTarget": true, + "console": true + } + }, "@metamask/rpc-errors": { "packages": { "@metamask/rpc-errors>fast-safe-stringify": true, @@ -180,6 +239,11 @@ "util": true } }, + "browserify>process": { + "globals": { + "process": true + } + }, "browserify>string_decoder": { "packages": { "browserify>browser-pack>safe-buffer": true diff --git a/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json index b251904ff1..0fea054be0 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json @@ -39,26 +39,33 @@ }, "@metamask/providers": { "globals": { - "console": true + "CustomEvent": true, + "Event": true, + "addEventListener": true, + "chrome.runtime.connect": true, + "console": true, + "dispatchEvent": true, + "document.createElement": true, + "document.readyState": true, + "ethereum": "write", + "location.hostname": true, + "removeEventListener": true, + "web3": true }, "packages": { + "@metamask/json-rpc-engine": true, "@metamask/object-multiplex": true, - "@metamask/providers>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/json-rpc-middleware-stream": true, "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/providers>detect-browser": true, + "@metamask/providers>extension-port-stream": true, "@metamask/providers>is-stream": true, "@metamask/rpc-errors": true, + "@metamask/utils": true, "eslint>fast-deep-equal": true, "readable-stream": true } }, - "@metamask/providers>@metamask/json-rpc-engine": { - "packages": { - "@metamask/providers>@metamask/safe-event-emitter": true, - "@metamask/rpc-errors": true, - "@metamask/utils": true - } - }, "@metamask/providers>@metamask/json-rpc-middleware-stream": { "globals": { "console.warn": true, @@ -66,6 +73,7 @@ }, "packages": { "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/utils": true, "readable-stream": true } }, @@ -77,6 +85,35 @@ "browserify>events": true } }, + "@metamask/providers>detect-browser": { + "globals": { + "document": true, + "navigator": true + }, + "packages": { + "browserify>process": true + } + }, + "@metamask/providers>extension-port-stream": { + "packages": { + "@metamask/providers>extension-port-stream>readable-stream": true, + "browserify>buffer": true + } + }, + "@metamask/providers>extension-port-stream>readable-stream": { + "globals": { + "AbortController": true, + "AggregateError": true, + "Blob": true + }, + "packages": { + "@metamask/providers>extension-port-stream>readable-stream>abort-controller": true, + "browserify>buffer": true, + "browserify>events": true, + "browserify>process": true, + "browserify>string_decoder": true + } + }, "@metamask/rpc-errors": { "packages": { "@metamask/rpc-errors>fast-safe-stringify": true, diff --git a/packages/snaps-execution-environments/package.json b/packages/snaps-execution-environments/package.json index 24444a9dd5..b3fcb29487 100644 --- a/packages/snaps-execution-environments/package.json +++ b/packages/snaps-execution-environments/package.json @@ -54,7 +54,7 @@ "@metamask/json-rpc-engine": "^9.0.0", "@metamask/object-multiplex": "^2.0.0", "@metamask/post-message-stream": "^8.1.0", - "@metamask/providers": "17.0.0", + "@metamask/providers": "^17.1.1", "@metamask/rpc-errors": "^6.3.1", "@metamask/snaps-sdk": "workspace:^", "@metamask/snaps-utils": "workspace:^", diff --git a/packages/snaps-execution-environments/src/common/BaseSnapExecutor.ts b/packages/snaps-execution-environments/src/common/BaseSnapExecutor.ts index cabd40c57d..d66cddcf99 100644 --- a/packages/snaps-execution-environments/src/common/BaseSnapExecutor.ts +++ b/packages/snaps-execution-environments/src/common/BaseSnapExecutor.ts @@ -2,7 +2,7 @@ /// import { createIdRemapMiddleware } from '@metamask/json-rpc-engine'; import type { RequestArguments } from '@metamask/providers'; -import { StreamProvider } from '@metamask/providers/dist/StreamProvider'; +import { StreamProvider } from '@metamask/providers'; import { errorCodes, rpcErrors, serializeError } from '@metamask/rpc-errors'; import type { SnapsProvider } from '@metamask/snaps-sdk'; import { getErrorData } from '@metamask/snaps-sdk'; diff --git a/packages/snaps-sdk/package.json b/packages/snaps-sdk/package.json index 62b4885907..4c22e9f437 100644 --- a/packages/snaps-sdk/package.json +++ b/packages/snaps-sdk/package.json @@ -60,7 +60,7 @@ }, "dependencies": { "@metamask/key-tree": "^9.1.2", - "@metamask/providers": "17.0.0", + "@metamask/providers": "^17.1.1", "@metamask/rpc-errors": "^6.3.1", "@metamask/superstruct": "^3.1.0", "@metamask/utils": "^9.0.0" diff --git a/packages/test-snaps/package.json b/packages/test-snaps/package.json index 619ac695fc..73ab1daffc 100644 --- a/packages/test-snaps/package.json +++ b/packages/test-snaps/package.json @@ -71,7 +71,7 @@ "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", - "@metamask/providers": "17.0.0", + "@metamask/providers": "^17.1.1", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", diff --git a/yarn.lock b/yarn.lock index 8ecc40e554..e19fb767ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4877,7 +4877,7 @@ __metadata: languageName: unknown linkType: soft -"@metamask/json-rpc-engine@npm:^8.0.1, @metamask/json-rpc-engine@npm:^8.0.2": +"@metamask/json-rpc-engine@npm:^8.0.2": version: 8.0.2 resolution: "@metamask/json-rpc-engine@npm:8.0.2" dependencies: @@ -4935,27 +4935,15 @@ __metadata: languageName: unknown linkType: soft -"@metamask/json-rpc-middleware-stream@npm:^7.0.1": - version: 7.0.1 - resolution: "@metamask/json-rpc-middleware-stream@npm:7.0.1" - dependencies: - "@metamask/json-rpc-engine": ^8.0.1 - "@metamask/safe-event-emitter": ^3.0.0 - "@metamask/utils": ^8.3.0 - readable-stream: ^3.6.2 - checksum: aacf571a906c3c1d5376e9b1f78d47510b568cc64af26f432dfaa6c6d5480d86e0f8af36855c57a0de95c017313d7ff19bfc396c648aa6ee79f689092154d46b - languageName: node - linkType: hard - -"@metamask/json-rpc-middleware-stream@npm:^8.0.0": - version: 8.0.0 - resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.0" +"@metamask/json-rpc-middleware-stream@npm:^8.0.0, @metamask/json-rpc-middleware-stream@npm:^8.0.1": + version: 8.0.1 + resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.1" dependencies: - "@metamask/json-rpc-engine": ^9.0.0 + "@metamask/json-rpc-engine": ^9.0.1 "@metamask/safe-event-emitter": ^3.0.0 - "@metamask/utils": ^8.3.0 + "@metamask/utils": ^9.0.0 readable-stream: ^3.6.2 - checksum: 4bf809366da41744c841dd50d68cf126e1cccda0d78a812154489faa2b0a56bbd511a7bb4e9ccc7c68f2a9a6437f00561bc9423a5b5596badd511a4ff6244c9e + checksum: 7f9b43bb171aed6ba1b3fbad1420224cf505fc1cc8f79bff8e3da404f9b835fe660efee0a538565f035f00c8de811979d2921afd9c756dbba91366d558f2fdef languageName: node linkType: hard @@ -5290,24 +5278,24 @@ __metadata: languageName: node linkType: hard -"@metamask/providers@npm:17.0.0": - version: 17.0.0 - resolution: "@metamask/providers@npm:17.0.0" +"@metamask/providers@npm:^17.1.1": + version: 17.1.1 + resolution: "@metamask/providers@npm:17.1.1" dependencies: - "@metamask/json-rpc-engine": ^8.0.1 - "@metamask/json-rpc-middleware-stream": ^7.0.1 + "@metamask/json-rpc-engine": ^9.0.1 + "@metamask/json-rpc-middleware-stream": ^8.0.1 "@metamask/object-multiplex": ^2.0.0 - "@metamask/rpc-errors": ^6.2.1 + "@metamask/rpc-errors": ^6.3.1 "@metamask/safe-event-emitter": ^3.1.1 - "@metamask/utils": ^8.3.0 + "@metamask/utils": ^9.0.0 detect-browser: ^5.2.0 - extension-port-stream: ^3.0.0 + extension-port-stream: ^4.1.0 fast-deep-equal: ^3.1.3 is-stream: ^2.0.0 readable-stream: ^3.6.2 peerDependencies: webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 - checksum: 330e369458edc68d743d87b8b2597cdacac58df01b5fc31f565ae5dacee2390ee23693fb10fa451c6146665e87475a4c8f54163407eb05fceeb698900e34f9e6 + checksum: d5e3f8acff2bb172c836ecbaaac1f3f41ebc74dfd3ef5b71c59891ac724c5c68d48f8fd576aaf96d5a663d4019ea069fee7d07e79f75cb359abbc06001a4bb06 languageName: node linkType: hard @@ -5676,7 +5664,7 @@ __metadata: "@metamask/json-rpc-engine": ^9.0.0 "@metamask/object-multiplex": ^2.0.0 "@metamask/post-message-stream": ^8.1.0 - "@metamask/providers": 17.0.0 + "@metamask/providers": ^17.1.1 "@metamask/rpc-errors": ^6.3.1 "@metamask/snaps-sdk": "workspace:^" "@metamask/snaps-utils": "workspace:^" @@ -5906,7 +5894,7 @@ __metadata: "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 "@metamask/key-tree": ^9.1.2 - "@metamask/providers": 17.0.0 + "@metamask/providers": ^17.1.1 "@metamask/rpc-errors": ^6.3.1 "@metamask/superstruct": ^3.1.0 "@metamask/utils": ^9.0.0 @@ -6219,7 +6207,7 @@ __metadata: "@metamask/name-lookup-example-snap": "workspace:^" "@metamask/network-example-snap": "workspace:^" "@metamask/notification-example-snap": "workspace:^" - "@metamask/providers": 17.0.0 + "@metamask/providers": ^17.1.1 "@metamask/signature-insights-example-snap": "workspace:^" "@metamask/snaps-utils": "workspace:^" "@metamask/utils": ^9.0.0 @@ -13262,13 +13250,14 @@ __metadata: languageName: node linkType: hard -"extension-port-stream@npm:^3.0.0": - version: 3.0.0 - resolution: "extension-port-stream@npm:3.0.0" +"extension-port-stream@npm:^4.1.0": + version: 4.2.0 + resolution: "extension-port-stream@npm:4.2.0" dependencies: readable-stream: ^3.6.2 || ^4.4.2 - webextension-polyfill: ">=0.10.0 <1.0" - checksum: 4f51d2258a96154c2d916a8a5425636a2b0817763e9277f7dc378d08b6f050c90d185dbde4313d27cf66ad99d4b3116479f9f699c40358c64cccfa524d2b55bf + peerDependencies: + webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 + checksum: 85559c82e3f3aa21462e234b30b7d53872708893664cd03f2f848af556cf0730cf2243b089efc9d40bbe9a4f73bd8fd19684db5a985329b0c4402b4f2fe26358 languageName: node linkType: hard @@ -22928,13 +22917,6 @@ __metadata: languageName: node linkType: hard -"webextension-polyfill@npm:>=0.10.0 <1.0": - version: 0.10.0 - resolution: "webextension-polyfill@npm:0.10.0" - checksum: 4a59036bda571360c2c0b2fb03fe1dc244f233946bcf9a6766f677956c40fd14d270aaa69cdba95e4ac521014afbe4008bfa5959d0ac39f91c990eb206587f91 - languageName: node - linkType: hard - "webidl-conversions@npm:^3.0.0": version: 3.0.1 resolution: "webidl-conversions@npm:3.0.1"