diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 1a508d4ac..f7b8390f1 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -659,7 +659,7 @@ export default class MetamaskController extends EventEmitter { ///: BEGIN:ONLY_INCLUDE_IN(flask) this.snapExecutionService = new IframeExecutionService({ iframeUrl: new URL( - 'https://metamask.github.io/iframe-execution-environment/0.9.0', + 'https://metamask.github.io/iframe-execution-environment/0.9.1', ), messenger: this.controllerMessenger.getRestricted({ name: 'ExecutionService', diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 2a7fc52a7..1ab56a362 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -3389,10 +3389,9 @@ "ethers>@ethersproject/wallet>@ethersproject/properties": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { + "@metamask/rpc-methods>nanoid": { "globals": { - "TextEncoder": true, - "crypto": true + "crypto.getRandomValues": true } }, "@metamask/smart-transactions-controller": { @@ -4525,7 +4524,13 @@ "crypto": true }, "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true + "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true } }, "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": { @@ -4681,10 +4686,16 @@ "crypto": true }, "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, + "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true } }, + "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": { "globals": { "crypto": true diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 23c1f2f48..cd23cc3b5 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -3551,6 +3551,7 @@ "packages": { "@metamask/rpc-methods>@metamask/controllers": true, "@metamask/rpc-methods>@metamask/key-tree": true, + "@metamask/rpc-methods>nanoid": true, "@metamask/snap-utils": true, "@metamask/snap-utils>superstruct": true, "eth-block-tracker>@metamask/utils": true, @@ -3586,7 +3587,7 @@ "@metamask/rpc-methods>@metamask/controllers>@ethersproject/abi": true, "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": true, "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": true, - "@metamask/rpc-methods>@metamask/controllers>nanoid": true, + "@metamask/rpc-methods>nanoid": true, "@metamask/smart-transactions-controller>@ethersproject/providers": true, "browserify>buffer": true, "browserify>events": true, @@ -3712,10 +3713,10 @@ "@metamask/rpc-methods>@metamask/key-tree": { "packages": { "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": true, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true, "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": true, + "@metamask/snap-utils>@noble/hashes": true, + "@metamask/snap-utils>@scure/base": true, "browserify>buffer": true } }, @@ -3727,12 +3728,6 @@ "browserify>browser-resolve": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, "@metamask/rpc-methods>@metamask/key-tree>@noble/secp256k1": { "globals": { "crypto": true @@ -3741,16 +3736,15 @@ "browserify>browser-resolve": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": { - "globals": { - "TextDecoder": true, - "TextEncoder": true - } - }, "@metamask/rpc-methods>@metamask/key-tree>@scure/bip39": { "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, - "@metamask/rpc-methods>@metamask/key-tree>@scure/base": true + "@metamask/snap-utils>@noble/hashes": true, + "@metamask/snap-utils>@scure/base": true + } + }, + "@metamask/rpc-methods>nanoid": { + "globals": { + "crypto.getRandomValues": true } }, "@metamask/smart-transactions-controller": { @@ -4259,6 +4253,8 @@ "packages": { "@babel/core": true, "@babel/core>@babel/types": true, + "@metamask/snap-utils>@noble/hashes": true, + "@metamask/snap-utils>@scure/base": true, "@metamask/snap-utils>ajv": true, "@metamask/snap-utils>rfdc": true, "@metamask/snap-utils>superstruct": true, @@ -4272,6 +4268,18 @@ "semver": true } }, + "@metamask/snap-utils>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, + "@metamask/snap-utils>@scure/base": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + } + }, "@metamask/snap-utils>rfdc": { "packages": { "browserify>buffer": true @@ -5351,7 +5359,13 @@ "crypto": true }, "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true + "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true } }, "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": { @@ -5507,10 +5521,16 @@ "crypto": true }, "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, + "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true } }, + "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": { "globals": { "crypto": true diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 2a7fc52a7..1ab56a362 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -3389,10 +3389,9 @@ "ethers>@ethersproject/wallet>@ethersproject/properties": true } }, - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": { + "@metamask/rpc-methods>nanoid": { "globals": { - "TextEncoder": true, - "crypto": true + "crypto.getRandomValues": true } }, "@metamask/smart-transactions-controller": { @@ -4525,7 +4524,13 @@ "crypto": true }, "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true + "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true } }, "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": { @@ -4681,10 +4686,16 @@ "crypto": true }, "packages": { - "@metamask/rpc-methods>@metamask/key-tree>@noble/hashes": true, + "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": true, "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": true } }, + "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, "eth-lattice-keyring>@ethereumjs/util>ethereum-cryptography>@noble/secp256k1": { "globals": { "crypto": true diff --git a/lavamoat/browserify/policy-override.json b/lavamoat/browserify/policy-override.json index 4089a7536..388f87f48 100644 --- a/lavamoat/browserify/policy-override.json +++ b/lavamoat/browserify/policy-override.json @@ -97,6 +97,11 @@ "crypto.getRandomValues": true } }, + "@metamask/rpc-methods>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, "@metamask/controllers>nanoid": { "globals": { "crypto.getRandomValues": true diff --git a/package.json b/package.json index 770f1dc4a..756de2028 100644 --- a/package.json +++ b/package.json @@ -135,11 +135,11 @@ "@metamask/obs-store": "^5.0.0", "@metamask/post-message-stream": "^4.0.0", "@metamask/providers": "^10.0.0", - "@metamask/rpc-methods": "^0.22.0", + "@metamask/rpc-methods": "^0.22.2", "@metamask/slip44": "^2.1.0", "@metamask/smart-transactions-controller": "^2.3.2", - "@metamask/snap-controllers": "^0.22.0", - "@metamask/snap-utils": "^0.22.0", + "@metamask/snap-controllers": "^0.22.2", + "@metamask/snap-utils": "^0.22.2", "@ngraveio/bc-ur": "^1.1.6", "@popperjs/core": "^2.4.0", "@reduxjs/toolkit": "^1.6.2", diff --git a/ui/pages/permissions-connect/permissions-connect.component.js b/ui/pages/permissions-connect/permissions-connect.component.js index 4d411c8f4..93306a76f 100644 --- a/ui/pages/permissions-connect/permissions-connect.component.js +++ b/ui/pages/permissions-connect/permissions-connect.component.js @@ -313,7 +313,10 @@ export default class PermissionConnect extends Component { { - approvePendingApproval(requestId, true); + approvePendingApproval(requestId, { + ...permissionsRequest, + approvedAccounts: selectedAccountAddresses, + }); this.redirect(true); }} rejectSnapInstall={(requestId) => { @@ -340,7 +343,10 @@ export default class PermissionConnect extends Component { { - approvePendingApproval(requestId, true); + approvePendingApproval(requestId, { + ...permissionsRequest, + approvedAccounts: selectedAccountAddresses, + }); this.redirect(true); }} rejectSnapUpdate={(requestId) => { diff --git a/yarn.lock b/yarn.lock index 7f7083c38..90279c10d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3329,16 +3329,16 @@ resolved "https://registry.yarnpkg.com/@metamask/etherscan-link/-/etherscan-link-2.2.0.tgz#76314d0c1405a0669fc4a0a19e0877bd3d0c389f" integrity sha512-xUgehvgU+ZbzeJ44m4sUtsyf6Dwou+SlYhiKfi6lkRcbWh6Jl3TCi0YM9C7XWgxfnLSdQBO1ndvcp0kslKgMsA== -"@metamask/execution-environments@^0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@metamask/execution-environments/-/execution-environments-0.22.0.tgz#2dd67add467e64fc6e992cb36461f20959ed87fd" - integrity sha512-mb5O3HX5Nrt0urAPWohiyB9w465Qk12tF1hXz+vjwFZe4LAbTHza7XsbvTzAy1XD99JjhtLMi+IwaHp8GELcDg== +"@metamask/execution-environments@^0.22.2": + version "0.22.2" + resolved "https://registry.yarnpkg.com/@metamask/execution-environments/-/execution-environments-0.22.2.tgz#174f4e37ed060b81cf29343581f35ad7c3a3182a" + integrity sha512-zfSP8L+KVrHGgZnnjauUpZD6GxDMGB5JI8Oq8BrsEtTZG9gZc7Sn5Jhx+6TuXKft1DLsjb4zM1trnAEgfXZ1aw== dependencies: "@metamask/object-multiplex" "^1.2.0" "@metamask/post-message-stream" "^6.0.0" "@metamask/providers" "^9.0.0" - "@metamask/snap-types" "^0.22.0" - "@metamask/snap-utils" "^0.22.0" + "@metamask/snap-types" "^0.22.2" + "@metamask/snap-utils" "^0.22.2" "@metamask/utils" "^3.1.0" eth-rpc-errors "^4.0.3" pump "^3.0.0" @@ -3479,17 +3479,18 @@ pump "^3.0.0" webextension-polyfill-ts "^0.25.0" -"@metamask/rpc-methods@^0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.22.0.tgz#17ee8db33deba5152d531123139fd3ea651e49ef" - integrity sha512-FCVbf68zgHHThG2OAOp9u7iBO1hjIMjo8S85bXsGtStUp9KjiGxnuQhyNK7b/Ny+WuHI+GP26abXRIyS2ampfA== +"@metamask/rpc-methods@^0.22.2": + version "0.22.2" + resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.22.2.tgz#4f60dcbbc0f9aebf86099b79639b7a711d4de31d" + integrity sha512-60InoQ9xteiJvpwRfCi8A4rCnBKazkLNuLnIochOuzPTIjH48GdEODaUQzOuwd/WGUNFstUI5yIGAv0NEr2EYA== dependencies: "@metamask/controllers" "^31.0.0" "@metamask/key-tree" "^5.0.2" - "@metamask/snap-utils" "^0.22.0" + "@metamask/snap-utils" "^0.22.2" "@metamask/types" "^1.1.0" "@metamask/utils" "^3.1.0" eth-rpc-errors "^4.0.2" + nanoid "^3.1.31" superstruct "^0.16.5" "@metamask/safe-event-emitter@^2.0.0": @@ -3517,19 +3518,19 @@ isomorphic-fetch "^3.0.0" lodash "^4.17.21" -"@metamask/snap-controllers@^0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@metamask/snap-controllers/-/snap-controllers-0.22.0.tgz#bb1dfb7551cfca74b17addad2390ad80a6df8b7a" - integrity sha512-k7TgYyzZna54ns3o9GjnLiHJDT3xvkG4i+zSEJSMPzqAy5Su5p2yMiTe/awEwTVFBMsC9xtX9owc0lArkk8NZw== +"@metamask/snap-controllers@^0.22.2": + version "0.22.2" + resolved "https://registry.yarnpkg.com/@metamask/snap-controllers/-/snap-controllers-0.22.2.tgz#d11ff1c5c35d5b659acb4f1e1365ae5b7055d828" + integrity sha512-QOtzlx9hlo4uCZhnrcYj0ChAL1deHUKS/A9sKUIWcFZpxpce+9mVyAljnz3CJkr2CCH8w7/MkfclDsLcoMci/A== dependencies: "@metamask/browser-passworder" "^3.0.0" "@metamask/controllers" "^31.0.0" - "@metamask/execution-environments" "^0.22.0" + "@metamask/execution-environments" "^0.22.2" "@metamask/object-multiplex" "^1.1.0" "@metamask/post-message-stream" "^6.0.0" - "@metamask/rpc-methods" "^0.22.0" - "@metamask/snap-types" "^0.22.0" - "@metamask/snap-utils" "^0.22.0" + "@metamask/rpc-methods" "^0.22.2" + "@metamask/snap-types" "^0.22.2" + "@metamask/snap-utils" "^0.22.2" "@metamask/utils" "^3.1.0" "@xstate/fsm" "^2.0.0" concat-stream "^2.0.0" @@ -3543,23 +3544,25 @@ readable-web-to-node-stream "^3.0.2" tar-stream "^2.2.0" -"@metamask/snap-types@^0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@metamask/snap-types/-/snap-types-0.22.0.tgz#4d74e34eea69a7afe0ad9a4d54be83cf5391bf9e" - integrity sha512-XwJNk+Qbtr7xjuh1Iz7wqybp+xB3H6uRJjlOqtgIoOui9V2zfL/At/FzHMMvaLeUsWJhOVSJP5qmEzCYaOEvmQ== +"@metamask/snap-types@^0.22.2": + version "0.22.2" + resolved "https://registry.yarnpkg.com/@metamask/snap-types/-/snap-types-0.22.2.tgz#590cfdd6088d77df6d103ceabdab4ae4d1bdcf03" + integrity sha512-8/KVU53ctZra7lQ9pjMScOXCBT7b3cmy2nilFDUHRPxEpw9XEgVtQVeekV7AVsXMcLEZdck+8tj5l7KUj5qxHg== dependencies: "@metamask/providers" "^9.0.0" - "@metamask/snap-utils" "^0.22.0" + "@metamask/snap-utils" "^0.22.2" "@metamask/types" "^1.1.0" -"@metamask/snap-utils@^0.22.0": - version "0.22.0" - resolved "https://registry.yarnpkg.com/@metamask/snap-utils/-/snap-utils-0.22.0.tgz#1815eecfc8a388a4ae6744664ff28f58404730ee" - integrity sha512-mwe72I/sVMVogNU+gxUU1P2Kos4S/4lEX1MUz7Hr79jfYzTgwTfxz/gaMubjD6CF2q0ZvF5JQr6OBk6ZRLHhCw== +"@metamask/snap-utils@^0.22.2": + version "0.22.2" + resolved "https://registry.yarnpkg.com/@metamask/snap-utils/-/snap-utils-0.22.2.tgz#040b2fc1c6ccd406b049084d90542f77e9a51572" + integrity sha512-hhQHsHS6xkwmqvPrDnrXgu8IIEtaPwLr7PUwqIDSHBeBgbhlsbS7R63nhMtrRxognLmnWj0xWvAvoz25o+Q/Rw== dependencies: "@babel/core" "^7.18.6" - "@metamask/snap-types" "^0.22.0" + "@metamask/snap-types" "^0.22.2" "@metamask/utils" "^3.1.0" + "@noble/hashes" "^1.1.3" + "@scure/base" "^1.1.1" ajv "^8.11.0" eth-rpc-errors "^4.0.3" fast-deep-equal "^3.1.3" @@ -3626,11 +3629,16 @@ resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.6.0.tgz#b55f7c9e532b478bf1d7c4f609e1f3a37850b583" integrity sha512-UKju89WV37IUALIMfKhKW3psO8AqmrE/GvH6QbPKjzolQ98zM7WmGUeY+xdIgSf5tqPFf75ZCYMgym6E9Jsw3Q== -"@noble/hashes@1.1.2", "@noble/hashes@^1.0.0", "@noble/hashes@~1.1.1": +"@noble/hashes@1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== +"@noble/hashes@^1.0.0", "@noble/hashes@^1.1.3", "@noble/hashes@~1.1.1": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.3.tgz#360afc77610e0a61f3417e497dcf36862e4f8111" + integrity sha512-CE0FCR57H2acVI5UOzIGSSIYxZ6v/HOhDR0Ro9VLyhnzLwx0o8W1mmgaqlEUx4049qJDlIBRztv5k+MM8vbO3A== + "@noble/secp256k1@1.6.3", "@noble/secp256k1@~1.6.0": version "1.6.3" resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.6.3.tgz#7eed12d9f4404b416999d0c87686836c4c5c9b94" @@ -3781,7 +3789,7 @@ redux-thunk "^2.3.0" reselect "^4.0.0" -"@scure/base@^1.0.0", "@scure/base@~1.1.0": +"@scure/base@^1.0.0", "@scure/base@^1.1.1", "@scure/base@~1.1.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==