From dfb6210910f74983f9a4eb55e6d825d2f5e59275 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Wed, 30 Nov 2022 13:19:33 +0100 Subject: [PATCH] [FLASK] `snaps-monorepo@0.25.0` (#16673) * snaps-monorepo@0.25.0 * Regen LavaMoat policies * Bump test-snaps * [FLASK] Add Snaps JSON-RPC handler permission (#16670) * Add Snaps JSON-RPC handler permission * Add copy and icon * Fix test Co-authored-by: Maarten Zuidhoorn --- app/_locales/en/messages.json | 12 + .../permissions/specifications.test.js | 5 +- app/scripts/metamask-controller.js | 1 + lavamoat/browserify/beta/policy.json | 407 +++++----- lavamoat/browserify/flask/policy.json | 720 +++++++++--------- lavamoat/browserify/main/policy.json | 407 +++++----- lavamoat/browserify/policy-override.json | 5 - package.json | 6 +- shared/constants/permissions.ts | 1 + test/e2e/snaps/enums.js | 2 +- ui/helpers/utils/permission.js | 19 + yarn.lock | 80 +- 12 files changed, 834 insertions(+), 831 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 9b60906ce..2ea13311a 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2640,6 +2640,10 @@ "osTheme": { "message": "System" }, + "otherSnaps": { + "message": "other snaps", + "description": "Used in the 'permission_rpc' message." + }, "padlock": { "message": "Padlock" }, @@ -2751,6 +2755,10 @@ "message": "Show notifications.", "description": "The description for the `snap_notify` permission" }, + "permission_rpc": { + "message": "Allow $1 to communicate directly with this snap.", + "description": "The description for the `endowment:rpc` permission. $1 is 'other snaps' or 'websites'." + }, "permission_transactionInsight": { "message": "Fetch and display transaction insights.", "description": "The description for the `endowment:transaction-insight` permission" @@ -4414,6 +4422,10 @@ "message": "WebHID", "description": "Refers to a interface for connecting external devices to the browser. Used for connecting ledger to the browser. Read more here https://developer.mozilla.org/en-US/docs/Web/API/WebHID_API" }, + "websites": { + "message": "websites", + "description": "Used in the 'permission_rpc' message." + }, "welcome": { "message": "Welcome to MetaMask" }, diff --git a/app/scripts/controllers/permissions/specifications.test.js b/app/scripts/controllers/permissions/specifications.test.js index 7e1dc24df..3143c7f96 100644 --- a/app/scripts/controllers/permissions/specifications.test.js +++ b/app/scripts/controllers/permissions/specifications.test.js @@ -16,7 +16,7 @@ describe('PermissionController specifications', () => { describe('caveat specifications', () => { it('getCaveatSpecifications returns the expected specifications object', () => { const caveatSpecifications = getCaveatSpecifications({}); - expect(Object.keys(caveatSpecifications)).toHaveLength(6); + expect(Object.keys(caveatSpecifications)).toHaveLength(7); expect( caveatSpecifications[CaveatTypes.restrictReturnedAccounts].type, ).toStrictEqual(CaveatTypes.restrictReturnedAccounts); @@ -36,6 +36,9 @@ describe('PermissionController specifications', () => { expect(caveatSpecifications.transactionOrigin.type).toStrictEqual( SnapCaveatType.TransactionOrigin, ); + expect(caveatSpecifications.rpcOrigin.type).toStrictEqual( + SnapCaveatType.RpcOrigin, + ); }); describe('restrictReturnedAccounts', () => { diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index dee48bb68..7e01b23bf 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -703,6 +703,7 @@ export default class MetamaskController extends EventEmitter { `${this.permissionController.name}:revokePermissionForAllSubjects`, `${this.approvalController.name}:addRequest`, `${this.permissionController.name}:grantPermissions`, + `${this.subjectMetadataController.name}:getSubjectMetadata`, 'ExecutionService:executeSnap', 'ExecutionService:getRpcRequestHandler', 'ExecutionService:terminateSnap', diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 27a4be63f..c67f24bb7 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -919,6 +919,142 @@ "uuid": true } }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura": { + "globals": { + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-json-rpc-middleware": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-rpc-errors": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>json-rpc-engine": true, + "node-fetch": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-json-rpc-middleware": { + "packages": { + "safe-event-emitter": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-rpc-errors": { + "packages": { + "eth-rpc-errors>fast-safe-stringify": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>json-rpc-engine": { + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-rpc-errors": true, + "safe-event-emitter": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine": { + "globals": { + "WebSocket": true, + "console": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-block-tracker": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-json-rpc-middleware": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-sig-util": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>semaphore": true, + "browserify>browser-resolve": true, + "browserify>buffer": true, + "browserify>events": true, + "browserify>util": true, + "eth-json-rpc-filters": true, + "gh-pages>async": true, + "lavamoat>json-stable-stringify": true, + "watchify>xtend": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff": { + "globals": { + "clearTimeout": true, + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff>precond": true, + "browserify>events": true, + "browserify>util": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff>precond": { + "packages": { + "browserify>util": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-block-tracker": { + "globals": { + "clearTimeout": true, + "console.error": true, + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-block-tracker>pify": true, + "eth-query": true, + "safe-event-emitter": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-json-rpc-middleware": { + "globals": { + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-json-rpc-middleware>json-rpc-engine": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-rpc-errors": true, + "browserify>url": true, + "lavamoat>json-stable-stringify": true, + "node-fetch": true, + "source-map-explorer>btoa": true, + "vinyl>clone": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-rpc-errors": { + "packages": { + "eth-rpc-errors>fast-safe-stringify": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-sig-util": { + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util": true, + "ethereumjs-abi": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util": { + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util>ethjs-util": true, + "bn.js": true, + "browserify>assert": true, + "browserify>buffer": true, + "ethereumjs-util>create-hash": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-util>rlp": true, + "ethereumjs-wallet>safe-buffer": true, + "ethers>@ethersproject/signing-key>elliptic": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util>ethjs-util": { + "packages": { + "browserify>buffer": true, + "ethjs>ethjs-util>is-hex-prefixed": true, + "ethjs>ethjs-util>strip-hex-prefix": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>semaphore": { + "globals": { + "define": true, + "setTimeout": true + }, + "packages": { + "browserify>process": true + } + }, "@metamask/jazzicon": { "globals": { "document.createElement": true, @@ -1021,7 +1157,32 @@ "eslint>optionator>fast-levenshtein": true } }, - "@metamask/rpc-methods>@metamask/controllers": { + "@metamask/rpc-methods>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, + "@metamask/smart-transactions-controller": { + "globals": { + "URLSearchParams": true, + "clearInterval": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true + }, + "packages": { + "@ethersproject/bignumber": true, + "@ethersproject/bignumber>@ethersproject/bytes": true, + "@metamask/assets-controllers>@ethersproject/providers": true, + "@metamask/controller-utils>isomorphic-fetch": true, + "@metamask/smart-transactions-controller>@metamask/controllers": true, + "@metamask/smart-transactions-controller>bignumber.js": true, + "@metamask/smart-transactions-controller>fast-json-patch": true, + "lodash": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers": { "globals": { "Headers": true, "URL": true, @@ -1044,15 +1205,15 @@ "@metamask/assets-controllers>multiformats": true, "@metamask/contract-metadata": true, "@metamask/controller-utils>isomorphic-fetch": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine": true, "@metamask/metamask-eth-abis": true, "@metamask/phishing-controller>eth-phishing-detect": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura": true, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": 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>@metamask/controllers>web3": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3": true, "browserify>buffer": true, "browserify>events": true, "deep-freeze-strict": true, @@ -1071,36 +1232,9 @@ "uuid": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura": { - "globals": { - "setTimeout": true - }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": true, - "node-fetch": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": { - "packages": { - "safe-event-emitter": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": { - "packages": { - "eth-rpc-errors>fast-safe-stringify": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true, - "safe-event-emitter": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder": true, "browserify>buffer": true, "browserify>events": true, "eth-keyring-controller>@metamask/bip39": true, @@ -1110,7 +1244,7 @@ "eth-sig-util": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder": { "globals": { "btoa": true, "crypto.getRandomValues": true, @@ -1120,30 +1254,30 @@ "crypto.subtle.importKey": true }, "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": { "globals": { "atob": true, "btoa": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": { "globals": { "clearInterval": true, "setInterval": true }, "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, "browserify>buffer": true, "ethjs>ethjs-filter": true, "ethjs>ethjs-provider-http": true, @@ -1153,17 +1287,17 @@ "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, "browserify>buffer": true, "ethjs>js-sha3": true, "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, "ethjs-query>babel-runtime": true, "ethjs>ethjs-filter": true, "ethjs>ethjs-util": true, @@ -1171,15 +1305,15 @@ "promise-to-callback": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, "browserify>buffer": true, "ethjs>js-sha3": true, "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { "globals": { "console": true }, @@ -1190,9 +1324,9 @@ "promise-to-callback": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": { + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": true, "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, @@ -1204,18 +1338,18 @@ "ethers>@ethersproject/json-wallets>scrypt-js": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": { "globals": { "crypto": true, "msCrypto": true } }, - "@metamask/rpc-methods>@metamask/controllers>nanoid": { + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { "globals": { "crypto.getRandomValues": true } }, - "@metamask/rpc-methods>@metamask/controllers>web3": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3": { "globals": { "Web3": "write", "XMLHttpRequest": "write", @@ -1224,123 +1358,14 @@ "setTimeout": true }, "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3>bignumber.js": true, - "@metamask/rpc-methods>@metamask/controllers>web3>crypto-js": true, - "@metamask/rpc-methods>@metamask/controllers>web3>utf8": true, - "@metamask/rpc-methods>@metamask/controllers>web3>xhr2-cookies": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>bignumber.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>crypto-js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>utf8": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>xhr2-cookies": true, "browserify>buffer": true } }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine": { - "globals": { - "WebSocket": true, - "console": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-block-tracker": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-sig-util": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>semaphore": true, - "browserify>browser-resolve": true, - "browserify>buffer": true, - "browserify>events": true, - "browserify>util": true, - "eth-json-rpc-filters": true, - "gh-pages>async": true, - "lavamoat>json-stable-stringify": true, - "watchify>xtend": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff": { - "globals": { - "clearTimeout": true, - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff>precond": true, - "browserify>events": true, - "browserify>util": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff>precond": { - "packages": { - "browserify>util": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-block-tracker": { - "globals": { - "clearTimeout": true, - "console.error": true, - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-block-tracker>pify": true, - "eth-query": true, - "safe-event-emitter": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware": { - "globals": { - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware>json-rpc-engine": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-rpc-errors": true, - "browserify>url": true, - "lavamoat>json-stable-stringify": true, - "node-fetch": true, - "source-map-explorer>btoa": true, - "vinyl>clone": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-rpc-errors": { - "packages": { - "eth-rpc-errors>fast-safe-stringify": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-sig-util": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util": true, - "ethereumjs-abi": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util>ethjs-util": true, - "bn.js": true, - "browserify>assert": true, - "browserify>buffer": true, - "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-util>rlp": true, - "ethereumjs-wallet>safe-buffer": true, - "ethers>@ethersproject/signing-key>elliptic": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util>ethjs-util": { - "packages": { - "browserify>buffer": true, - "ethjs>ethjs-util>is-hex-prefixed": true, - "ethjs>ethjs-util>strip-hex-prefix": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>semaphore": { - "globals": { - "define": true, - "setTimeout": true - }, - "packages": { - "browserify>process": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3>bignumber.js": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3>bignumber.js": { "globals": { "define": true }, @@ -1348,17 +1373,17 @@ "browserify>crypto-browserify": true } }, - "@metamask/rpc-methods>@metamask/controllers>web3>crypto-js": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3>crypto-js": { "globals": { "define": true } }, - "@metamask/rpc-methods>@metamask/controllers>web3>utf8": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3>utf8": { "globals": { "define": true } }, - "@metamask/rpc-methods>@metamask/controllers>web3>xhr2-cookies": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3>xhr2-cookies": { "globals": { "console.warn": true }, @@ -1372,36 +1397,6 @@ "pubnub>superagent>cookiejar": true } }, - "@metamask/rpc-methods>nanoid": { - "globals": { - "crypto.getRandomValues": true - } - }, - "@metamask/smart-transactions-controller": { - "globals": { - "URLSearchParams": true, - "clearInterval": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true - }, - "packages": { - "@ethersproject/bignumber": true, - "@ethersproject/bignumber>@ethersproject/bytes": true, - "@metamask/assets-controllers>@ethersproject/providers": true, - "@metamask/controller-utils>isomorphic-fetch": true, - "@metamask/rpc-methods>@metamask/controllers": true, - "@metamask/smart-transactions-controller>bignumber.js": true, - "@metamask/smart-transactions-controller>fast-json-patch": true, - "lodash": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { - "globals": { - "crypto.getRandomValues": true - } - }, "@metamask/smart-transactions-controller>bignumber.js": { "globals": { "crypto": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index d180e7f43..0ad76917c 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -1064,6 +1064,142 @@ "uuid": true } }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura": { + "globals": { + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-json-rpc-middleware": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-rpc-errors": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>json-rpc-engine": true, + "node-fetch": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-json-rpc-middleware": { + "packages": { + "safe-event-emitter": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-rpc-errors": { + "packages": { + "eth-rpc-errors>fast-safe-stringify": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>json-rpc-engine": { + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-rpc-errors": true, + "safe-event-emitter": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine": { + "globals": { + "WebSocket": true, + "console": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-block-tracker": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-json-rpc-middleware": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-sig-util": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>semaphore": true, + "browserify>browser-resolve": true, + "browserify>buffer": true, + "browserify>events": true, + "browserify>util": true, + "eth-json-rpc-filters": true, + "gh-pages>async": true, + "lavamoat>json-stable-stringify": true, + "watchify>xtend": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff": { + "globals": { + "clearTimeout": true, + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff>precond": true, + "browserify>events": true, + "browserify>util": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff>precond": { + "packages": { + "browserify>util": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-block-tracker": { + "globals": { + "clearTimeout": true, + "console.error": true, + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-block-tracker>pify": true, + "eth-query": true, + "safe-event-emitter": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-json-rpc-middleware": { + "globals": { + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-json-rpc-middleware>json-rpc-engine": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-rpc-errors": true, + "browserify>url": true, + "lavamoat>json-stable-stringify": true, + "node-fetch": true, + "source-map-explorer>btoa": true, + "vinyl>clone": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-rpc-errors": { + "packages": { + "eth-rpc-errors>fast-safe-stringify": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-sig-util": { + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util": true, + "ethereumjs-abi": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util": { + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util>ethjs-util": true, + "bn.js": true, + "browserify>assert": true, + "browserify>buffer": true, + "ethereumjs-util>create-hash": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-util>rlp": true, + "ethereumjs-wallet>safe-buffer": true, + "ethers>@ethersproject/signing-key>elliptic": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util>ethjs-util": { + "packages": { + "browserify>buffer": true, + "ethjs>ethjs-util>is-hex-prefixed": true, + "ethjs>ethjs-util>strip-hex-prefix": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>semaphore": { + "globals": { + "define": true, + "setTimeout": true + }, + "packages": { + "browserify>process": true + } + }, "@metamask/jazzicon": { "globals": { "document.createElement": true, @@ -1241,7 +1377,7 @@ "console.warn": true }, "packages": { - "@metamask/rpc-methods>@metamask/controllers": true, + "@metamask/permission-controller": true, "@metamask/rpc-methods>@metamask/key-tree": true, "@metamask/rpc-methods>nanoid": true, "@metamask/snaps-utils": true, @@ -1251,357 +1387,6 @@ "eth-rpc-errors": true } }, - "@metamask/rpc-methods>@metamask/controllers": { - "globals": { - "Headers": true, - "URL": true, - "clearInterval": true, - "clearTimeout": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true, - "setTimeout": true - }, - "packages": { - "@eth-optimism/contracts>@ethersproject/contracts": true, - "@ethereumjs/common": true, - "@ethereumjs/tx": true, - "@metamask/assets-controllers>@ethersproject/abi": true, - "@metamask/assets-controllers>@ethersproject/providers": true, - "@metamask/assets-controllers>abort-controller": true, - "@metamask/assets-controllers>async-mutex": true, - "@metamask/assets-controllers>multiformats": true, - "@metamask/contract-metadata": true, - "@metamask/controller-utils>isomorphic-fetch": true, - "@metamask/metamask-eth-abis": true, - "@metamask/phishing-controller>eth-phishing-detect": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura": true, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": 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>@metamask/controllers>web3": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine": true, - "browserify>buffer": true, - "browserify>events": true, - "deep-freeze-strict": true, - "eslint>fast-deep-equal": true, - "eth-ens-namehash": true, - "eth-query": true, - "eth-rpc-errors": true, - "eth-sig-util": true, - "ethereumjs-util": true, - "ethjs>ethjs-unit": true, - "immer": true, - "json-rpc-engine": true, - "jsonschema": true, - "punycode": true, - "single-call-balance-checker-abi": true, - "uuid": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura": { - "globals": { - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": true, - "node-fetch": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": { - "packages": { - "safe-event-emitter": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": { - "packages": { - "eth-rpc-errors>fast-safe-stringify": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true, - "safe-event-emitter": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder": true, - "browserify>buffer": true, - "browserify>events": true, - "eth-keyring-controller>@metamask/bip39": true, - "eth-keyring-controller>@metamask/eth-hd-keyring": true, - "eth-keyring-controller>eth-simple-keyring": true, - "eth-keyring-controller>obs-store": true, - "eth-sig-util": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder": { - "globals": { - "btoa": true, - "crypto.getRandomValues": true, - "crypto.subtle.decrypt": true, - "crypto.subtle.deriveKey": true, - "crypto.subtle.encrypt": true, - "crypto.subtle.importKey": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": { - "globals": { - "atob": true, - "btoa": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": { - "globals": { - "clearInterval": true, - "setInterval": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, - "browserify>buffer": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-provider-http": true, - "ethjs>ethjs-unit": true, - "ethjs>ethjs-util": true, - "ethjs>js-sha3": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "browserify>buffer": true, - "ethjs>js-sha3": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, - "ethjs-query>babel-runtime": true, - "ethjs>ethjs-filter": true, - "ethjs>ethjs-util": true, - "ethjs>js-sha3": true, - "promise-to-callback": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "browserify>buffer": true, - "ethjs>js-sha3": true, - "ethjs>number-to-bn": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { - "globals": { - "console": true - }, - "packages": { - "ethjs-query>babel-runtime": true, - "ethjs-query>ethjs-format": true, - "ethjs-query>ethjs-rpc": true, - "promise-to-callback": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": true, - "@truffle/codec>utf8": true, - "browserify>buffer": true, - "browserify>crypto-browserify": true, - "ethereumjs-util": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethers>@ethersproject/json-wallets>scrypt-js": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>nanoid": { - "globals": { - "crypto.getRandomValues": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3": { - "globals": { - "Web3": "write", - "XMLHttpRequest": "write", - "clearTimeout": true, - "console.error": true, - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3>bignumber.js": true, - "@metamask/rpc-methods>@metamask/controllers>web3>crypto-js": true, - "@metamask/rpc-methods>@metamask/controllers>web3>utf8": true, - "@metamask/rpc-methods>@metamask/controllers>web3>xhr2-cookies": true, - "browserify>buffer": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine": { - "globals": { - "WebSocket": true, - "console": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-block-tracker": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-sig-util": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>semaphore": true, - "browserify>browser-resolve": true, - "browserify>buffer": true, - "browserify>events": true, - "browserify>util": true, - "eth-json-rpc-filters": true, - "gh-pages>async": true, - "lavamoat>json-stable-stringify": true, - "watchify>xtend": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff": { - "globals": { - "clearTimeout": true, - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff>precond": true, - "browserify>events": true, - "browserify>util": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff>precond": { - "packages": { - "browserify>util": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-block-tracker": { - "globals": { - "clearTimeout": true, - "console.error": true, - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-block-tracker>pify": true, - "eth-query": true, - "safe-event-emitter": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware": { - "globals": { - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware>json-rpc-engine": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-rpc-errors": true, - "browserify>url": true, - "lavamoat>json-stable-stringify": true, - "node-fetch": true, - "source-map-explorer>btoa": true, - "vinyl>clone": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-rpc-errors": { - "packages": { - "eth-rpc-errors>fast-safe-stringify": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-sig-util": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util": true, - "ethereumjs-abi": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util>ethjs-util": true, - "bn.js": true, - "browserify>assert": true, - "browserify>buffer": true, - "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-util>rlp": true, - "ethereumjs-wallet>safe-buffer": true, - "ethers>@ethersproject/signing-key>elliptic": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util>ethjs-util": { - "packages": { - "browserify>buffer": true, - "ethjs>ethjs-util>is-hex-prefixed": true, - "ethjs>ethjs-util>strip-hex-prefix": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>semaphore": { - "globals": { - "define": true, - "setTimeout": true - }, - "packages": { - "browserify>process": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3>bignumber.js": { - "globals": { - "define": true - }, - "packages": { - "browserify>crypto-browserify": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3>crypto-js": { - "globals": { - "define": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3>utf8": { - "globals": { - "define": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3>xhr2-cookies": { - "globals": { - "console.warn": true - }, - "packages": { - "browserify>buffer": true, - "browserify>https-browserify": true, - "browserify>os-browserify": true, - "browserify>process": true, - "browserify>stream-http": true, - "browserify>url": true, - "pubnub>superagent>cookiejar": true - } - }, "@metamask/rpc-methods>@metamask/key-tree": { "packages": { "@metamask/rpc-methods>@metamask/key-tree>@noble/ed25519": true, @@ -1653,17 +1438,227 @@ "@ethersproject/bignumber>@ethersproject/bytes": true, "@metamask/assets-controllers>@ethersproject/providers": true, "@metamask/controller-utils>isomorphic-fetch": true, - "@metamask/rpc-methods>@metamask/controllers": true, + "@metamask/smart-transactions-controller>@metamask/controllers": true, "@metamask/smart-transactions-controller>bignumber.js": true, "@metamask/smart-transactions-controller>fast-json-patch": true, "lodash": true } }, + "@metamask/smart-transactions-controller>@metamask/controllers": { + "globals": { + "Headers": true, + "URL": true, + "clearInterval": true, + "clearTimeout": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true, + "setTimeout": true + }, + "packages": { + "@eth-optimism/contracts>@ethersproject/contracts": true, + "@ethereumjs/common": true, + "@ethereumjs/tx": true, + "@metamask/assets-controllers>@ethersproject/abi": true, + "@metamask/assets-controllers>@ethersproject/providers": true, + "@metamask/assets-controllers>abort-controller": true, + "@metamask/assets-controllers>async-mutex": true, + "@metamask/assets-controllers>multiformats": true, + "@metamask/contract-metadata": true, + "@metamask/controller-utils>isomorphic-fetch": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine": true, + "@metamask/metamask-eth-abis": true, + "@metamask/phishing-controller>eth-phishing-detect": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3": true, + "browserify>buffer": true, + "browserify>events": true, + "deep-freeze-strict": true, + "eslint>fast-deep-equal": true, + "eth-ens-namehash": true, + "eth-query": true, + "eth-rpc-errors": true, + "eth-sig-util": true, + "ethereumjs-util": true, + "ethjs>ethjs-unit": true, + "immer": true, + "json-rpc-engine": true, + "jsonschema": true, + "punycode": true, + "single-call-balance-checker-abi": true, + "uuid": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder": true, + "browserify>buffer": true, + "browserify>events": true, + "eth-keyring-controller>@metamask/bip39": true, + "eth-keyring-controller>@metamask/eth-hd-keyring": true, + "eth-keyring-controller>eth-simple-keyring": true, + "eth-keyring-controller>obs-store": true, + "eth-sig-util": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder": { + "globals": { + "btoa": true, + "crypto.getRandomValues": true, + "crypto.subtle.decrypt": true, + "crypto.subtle.deriveKey": true, + "crypto.subtle.encrypt": true, + "crypto.subtle.importKey": true + }, + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": { + "globals": { + "atob": true, + "btoa": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": { + "globals": { + "clearInterval": true, + "setInterval": true + }, + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "browserify>buffer": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-provider-http": true, + "ethjs>ethjs-unit": true, + "ethjs>ethjs-util": true, + "ethjs>js-sha3": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "browserify>buffer": true, + "ethjs>js-sha3": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "ethjs-query>babel-runtime": true, + "ethjs>ethjs-filter": true, + "ethjs>ethjs-util": true, + "ethjs>js-sha3": true, + "promise-to-callback": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "browserify>buffer": true, + "ethjs>js-sha3": true, + "ethjs>number-to-bn": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "globals": { + "console": true + }, + "packages": { + "ethjs-query>babel-runtime": true, + "ethjs-query>ethjs-format": true, + "ethjs-query>ethjs-rpc": true, + "promise-to-callback": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": { + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@truffle/codec>utf8": true, + "browserify>buffer": true, + "browserify>crypto-browserify": true, + "ethereumjs-util": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-wallet>aes-js": true, + "ethereumjs-wallet>bs58check": true, + "ethereumjs-wallet>randombytes": true, + "ethers>@ethersproject/json-wallets>scrypt-js": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": { + "globals": { + "crypto": true, + "msCrypto": true + } + }, "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { "globals": { "crypto.getRandomValues": true } }, + "@metamask/smart-transactions-controller>@metamask/controllers>web3": { + "globals": { + "Web3": "write", + "XMLHttpRequest": "write", + "clearTimeout": true, + "console.error": true, + "setTimeout": true + }, + "packages": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3>bignumber.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>crypto-js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>utf8": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>xhr2-cookies": true, + "browserify>buffer": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>bignumber.js": { + "globals": { + "define": true + }, + "packages": { + "browserify>crypto-browserify": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>crypto-js": { + "globals": { + "define": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>utf8": { + "globals": { + "define": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>xhr2-cookies": { + "globals": { + "console.warn": true + }, + "packages": { + "browserify>buffer": true, + "browserify>https-browserify": true, + "browserify>os-browserify": true, + "browserify>process": true, + "browserify>stream-http": true, + "browserify>url": true, + "pubnub>superagent>cookiejar": true + } + }, "@metamask/smart-transactions-controller>bignumber.js": { "globals": { "crypto": true, @@ -1693,11 +1688,11 @@ "setTimeout": true }, "packages": { + "@metamask/base-controller": true, + "@metamask/permission-controller": true, "@metamask/post-message-stream": true, "@metamask/providers>@metamask/object-multiplex": true, "@metamask/rpc-methods": true, - "@metamask/rpc-methods>@metamask/controllers": true, - "@metamask/snaps-controllers>@metamask/browser-passworder": true, "@metamask/snaps-controllers>@xstate/fsm": true, "@metamask/snaps-controllers>concat-stream": true, "@metamask/snaps-controllers>gunzip-maybe": true, @@ -1706,25 +1701,14 @@ "@metamask/snaps-controllers>readable-web-to-node-stream": true, "@metamask/snaps-controllers>tar-stream": true, "@metamask/snaps-utils": true, + "@metamask/subject-metadata-controller": true, "eth-block-tracker>@metamask/utils": true, + "eth-keyring-controller>@metamask/browser-passworder": true, "eth-rpc-errors": true, "json-rpc-engine": true, "pump": true } }, - "@metamask/snaps-controllers>@metamask/browser-passworder": { - "globals": { - "btoa": true, - "crypto.getRandomValues": true, - "crypto.subtle.decrypt": true, - "crypto.subtle.deriveKey": true, - "crypto.subtle.encrypt": true, - "crypto.subtle.importKey": true - }, - "packages": { - "browserify>buffer": true - } - }, "@metamask/snaps-controllers>concat-stream": { "packages": { "@metamask/snaps-controllers>concat-stream>readable-stream": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 27a4be63f..c67f24bb7 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -919,6 +919,142 @@ "uuid": true } }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura": { + "globals": { + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-json-rpc-middleware": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-rpc-errors": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>json-rpc-engine": true, + "node-fetch": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-json-rpc-middleware": { + "packages": { + "safe-event-emitter": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-rpc-errors": { + "packages": { + "eth-rpc-errors>fast-safe-stringify": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>json-rpc-engine": { + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura>eth-rpc-errors": true, + "safe-event-emitter": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine": { + "globals": { + "WebSocket": true, + "console": true, + "setTimeout": true + }, + "packages": { + "@ethereumjs/tx": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-block-tracker": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-json-rpc-middleware": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-sig-util": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>semaphore": true, + "browserify>browser-resolve": true, + "browserify>buffer": true, + "browserify>events": true, + "browserify>util": true, + "eth-json-rpc-filters": true, + "gh-pages>async": true, + "lavamoat>json-stable-stringify": true, + "watchify>xtend": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff": { + "globals": { + "clearTimeout": true, + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff>precond": true, + "browserify>events": true, + "browserify>util": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>backoff>precond": { + "packages": { + "browserify>util": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-block-tracker": { + "globals": { + "clearTimeout": true, + "console.error": true, + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-block-tracker>pify": true, + "eth-query": true, + "safe-event-emitter": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-json-rpc-middleware": { + "globals": { + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-json-rpc-middleware>json-rpc-engine": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-rpc-errors": true, + "browserify>url": true, + "lavamoat>json-stable-stringify": true, + "node-fetch": true, + "source-map-explorer>btoa": true, + "vinyl>clone": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-rpc-errors": { + "packages": { + "eth-rpc-errors>fast-safe-stringify": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>eth-sig-util": { + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util": true, + "ethereumjs-abi": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util": { + "packages": { + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util>ethjs-util": true, + "bn.js": true, + "browserify>assert": true, + "browserify>buffer": true, + "ethereumjs-util>create-hash": true, + "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-util>rlp": true, + "ethereumjs-wallet>safe-buffer": true, + "ethers>@ethersproject/signing-key>elliptic": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>ethereumjs-util>ethjs-util": { + "packages": { + "browserify>buffer": true, + "ethjs>ethjs-util>is-hex-prefixed": true, + "ethjs>ethjs-util>strip-hex-prefix": true + } + }, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine>semaphore": { + "globals": { + "define": true, + "setTimeout": true + }, + "packages": { + "browserify>process": true + } + }, "@metamask/jazzicon": { "globals": { "document.createElement": true, @@ -1021,7 +1157,32 @@ "eslint>optionator>fast-levenshtein": true } }, - "@metamask/rpc-methods>@metamask/controllers": { + "@metamask/rpc-methods>nanoid": { + "globals": { + "crypto.getRandomValues": true + } + }, + "@metamask/smart-transactions-controller": { + "globals": { + "URLSearchParams": true, + "clearInterval": true, + "console.error": true, + "console.log": true, + "fetch": true, + "setInterval": true + }, + "packages": { + "@ethersproject/bignumber": true, + "@ethersproject/bignumber>@ethersproject/bytes": true, + "@metamask/assets-controllers>@ethersproject/providers": true, + "@metamask/controller-utils>isomorphic-fetch": true, + "@metamask/smart-transactions-controller>@metamask/controllers": true, + "@metamask/smart-transactions-controller>bignumber.js": true, + "@metamask/smart-transactions-controller>fast-json-patch": true, + "lodash": true + } + }, + "@metamask/smart-transactions-controller>@metamask/controllers": { "globals": { "Headers": true, "URL": true, @@ -1044,15 +1205,15 @@ "@metamask/assets-controllers>multiformats": true, "@metamask/contract-metadata": true, "@metamask/controller-utils>isomorphic-fetch": true, + "@metamask/gas-fee-controller>@metamask/network-controller>eth-json-rpc-infura": true, + "@metamask/gas-fee-controller>@metamask/network-controller>web3-provider-engine": true, "@metamask/metamask-eth-abis": true, "@metamask/phishing-controller>eth-phishing-detect": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura": true, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": 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>@metamask/controllers>web3": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": true, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": true, + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3": true, "browserify>buffer": true, "browserify>events": true, "deep-freeze-strict": true, @@ -1071,36 +1232,9 @@ "uuid": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura": { - "globals": { - "setTimeout": true - }, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": true, - "node-fetch": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": { - "packages": { - "safe-event-emitter": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": { - "packages": { - "eth-rpc-errors>fast-safe-stringify": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true, - "safe-event-emitter": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder": true, "browserify>buffer": true, "browserify>events": true, "eth-keyring-controller>@metamask/bip39": true, @@ -1110,7 +1244,7 @@ "eth-sig-util": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder": { "globals": { "btoa": true, "crypto.getRandomValues": true, @@ -1120,30 +1254,30 @@ "crypto.subtle.importKey": true }, "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-keyring-controller>browser-passworder>browserify-unibabel": { "globals": { "atob": true, "btoa": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": true + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs": { "globals": { "clearInterval": true, "setInterval": true }, "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": true, "browserify>buffer": true, "ethjs>ethjs-filter": true, "ethjs>ethjs-provider-http": true, @@ -1153,17 +1287,17 @@ "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-abi": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, "browserify>buffer": true, "ethjs>js-sha3": true, "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": true, "ethjs-query>babel-runtime": true, "ethjs>ethjs-filter": true, "ethjs>ethjs-util": true, @@ -1171,15 +1305,15 @@ "promise-to-callback": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-contract>ethjs-abi": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>bn.js": true, "browserify>buffer": true, "ethjs>js-sha3": true, "ethjs>number-to-bn": true } }, - "@metamask/rpc-methods>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { + "@metamask/smart-transactions-controller>@metamask/controllers>eth-method-registry>ethjs>ethjs-query": { "globals": { "console": true }, @@ -1190,9 +1324,9 @@ "promise-to-callback": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet": { + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet": { "packages": { - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": true, + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": true, "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, @@ -1204,18 +1338,18 @@ "ethers>@ethersproject/json-wallets>scrypt-js": true } }, - "@metamask/rpc-methods>@metamask/controllers>ethereumjs-wallet>uuid": { + "@metamask/smart-transactions-controller>@metamask/controllers>ethereumjs-wallet>uuid": { "globals": { "crypto": true, "msCrypto": true } }, - "@metamask/rpc-methods>@metamask/controllers>nanoid": { + "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { "globals": { "crypto.getRandomValues": true } }, - "@metamask/rpc-methods>@metamask/controllers>web3": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3": { "globals": { "Web3": "write", "XMLHttpRequest": "write", @@ -1224,123 +1358,14 @@ "setTimeout": true }, "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3>bignumber.js": true, - "@metamask/rpc-methods>@metamask/controllers>web3>crypto-js": true, - "@metamask/rpc-methods>@metamask/controllers>web3>utf8": true, - "@metamask/rpc-methods>@metamask/controllers>web3>xhr2-cookies": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>bignumber.js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>crypto-js": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>utf8": true, + "@metamask/smart-transactions-controller>@metamask/controllers>web3>xhr2-cookies": true, "browserify>buffer": true } }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine": { - "globals": { - "WebSocket": true, - "console": true, - "setTimeout": true - }, - "packages": { - "@ethereumjs/tx": true, - "@metamask/rpc-methods>@metamask/controllers>eth-json-rpc-infura": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-block-tracker": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-sig-util": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>semaphore": true, - "browserify>browser-resolve": true, - "browserify>buffer": true, - "browserify>events": true, - "browserify>util": true, - "eth-json-rpc-filters": true, - "gh-pages>async": true, - "lavamoat>json-stable-stringify": true, - "watchify>xtend": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff": { - "globals": { - "clearTimeout": true, - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff>precond": true, - "browserify>events": true, - "browserify>util": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>backoff>precond": { - "packages": { - "browserify>util": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-block-tracker": { - "globals": { - "clearTimeout": true, - "console.error": true, - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-block-tracker>pify": true, - "eth-query": true, - "safe-event-emitter": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware": { - "globals": { - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware>json-rpc-engine": true, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-rpc-errors": true, - "browserify>url": true, - "lavamoat>json-stable-stringify": true, - "node-fetch": true, - "source-map-explorer>btoa": true, - "vinyl>clone": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-rpc-errors": { - "packages": { - "eth-rpc-errors>fast-safe-stringify": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>eth-sig-util": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util": true, - "ethereumjs-abi": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util": { - "packages": { - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util>ethjs-util": true, - "bn.js": true, - "browserify>assert": true, - "browserify>buffer": true, - "ethereumjs-util>create-hash": true, - "ethereumjs-util>ethereum-cryptography": true, - "ethereumjs-util>rlp": true, - "ethereumjs-wallet>safe-buffer": true, - "ethers>@ethersproject/signing-key>elliptic": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>ethereumjs-util>ethjs-util": { - "packages": { - "browserify>buffer": true, - "ethjs>ethjs-util>is-hex-prefixed": true, - "ethjs>ethjs-util>strip-hex-prefix": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3-provider-engine>semaphore": { - "globals": { - "define": true, - "setTimeout": true - }, - "packages": { - "browserify>process": true - } - }, - "@metamask/rpc-methods>@metamask/controllers>web3>bignumber.js": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3>bignumber.js": { "globals": { "define": true }, @@ -1348,17 +1373,17 @@ "browserify>crypto-browserify": true } }, - "@metamask/rpc-methods>@metamask/controllers>web3>crypto-js": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3>crypto-js": { "globals": { "define": true } }, - "@metamask/rpc-methods>@metamask/controllers>web3>utf8": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3>utf8": { "globals": { "define": true } }, - "@metamask/rpc-methods>@metamask/controllers>web3>xhr2-cookies": { + "@metamask/smart-transactions-controller>@metamask/controllers>web3>xhr2-cookies": { "globals": { "console.warn": true }, @@ -1372,36 +1397,6 @@ "pubnub>superagent>cookiejar": true } }, - "@metamask/rpc-methods>nanoid": { - "globals": { - "crypto.getRandomValues": true - } - }, - "@metamask/smart-transactions-controller": { - "globals": { - "URLSearchParams": true, - "clearInterval": true, - "console.error": true, - "console.log": true, - "fetch": true, - "setInterval": true - }, - "packages": { - "@ethersproject/bignumber": true, - "@ethersproject/bignumber>@ethersproject/bytes": true, - "@metamask/assets-controllers>@ethersproject/providers": true, - "@metamask/controller-utils>isomorphic-fetch": true, - "@metamask/rpc-methods>@metamask/controllers": true, - "@metamask/smart-transactions-controller>bignumber.js": true, - "@metamask/smart-transactions-controller>fast-json-patch": true, - "lodash": true - } - }, - "@metamask/smart-transactions-controller>@metamask/controllers>nanoid": { - "globals": { - "crypto.getRandomValues": true - } - }, "@metamask/smart-transactions-controller>bignumber.js": { "globals": { "crypto": true, diff --git a/lavamoat/browserify/policy-override.json b/lavamoat/browserify/policy-override.json index 4f09c39c3..81ba32953 100644 --- a/lavamoat/browserify/policy-override.json +++ b/lavamoat/browserify/policy-override.json @@ -112,11 +112,6 @@ "crypto.getRandomValues": true } }, - "@metamask/rpc-methods>@metamask/controllers>nanoid": { - "globals": { - "crypto.getRandomValues": true - } - }, "@metamask/controllers>nanoid": { "globals": { "crypto.getRandomValues": true diff --git a/package.json b/package.json index aead07c2a..4eb39164e 100644 --- a/package.json +++ b/package.json @@ -132,11 +132,11 @@ "@metamask/post-message-stream": "^6.0.0", "@metamask/providers": "^10.2.1", "@metamask/rate-limit-controller": "^1.0.0", - "@metamask/rpc-methods": "^0.24.1", + "@metamask/rpc-methods": "^0.25.0", "@metamask/slip44": "^2.1.0", "@metamask/smart-transactions-controller": "^3.0.0", - "@metamask/snaps-controllers": "^0.24.1", - "@metamask/snaps-utils": "^0.24.1", + "@metamask/snaps-controllers": "^0.25.0", + "@metamask/snaps-utils": "^0.25.0", "@metamask/subject-metadata-controller": "^1.0.0", "@ngraveio/bc-ur": "^1.1.6", "@popperjs/core": "^2.4.0", diff --git a/shared/constants/permissions.ts b/shared/constants/permissions.ts index a21d34539..7cb301239 100644 --- a/shared/constants/permissions.ts +++ b/shared/constants/permissions.ts @@ -27,6 +27,7 @@ export const EndowmentPermissions = Object.freeze({ 'endowment:transaction-insight': 'endowment:transaction-insight', 'endowment:cronjob': 'endowment:cronjob', 'endowment:ethereum-provider': 'endowment:ethereum-provider', + 'endowment:rpc': 'endowment:rpc', } as const); // Methods / permissions in external packages that we are temporarily excluding. diff --git a/test/e2e/snaps/enums.js b/test/e2e/snaps/enums.js index 1cc1906b0..dd4708fb6 100644 --- a/test/e2e/snaps/enums.js +++ b/test/e2e/snaps/enums.js @@ -1,3 +1,3 @@ module.exports = { - TEST_SNAPS_WEBSITE_URL: 'https://metamask.github.io/test-snaps/4.1.1/', + TEST_SNAPS_WEBSITE_URL: 'https://metamask.github.io/test-snaps/4.2.0/', }; diff --git a/ui/helpers/utils/permission.js b/ui/helpers/utils/permission.js index 3bc90813d..589a9b676 100644 --- a/ui/helpers/utils/permission.js +++ b/ui/helpers/utils/permission.js @@ -1,6 +1,7 @@ import deepFreeze from 'deep-freeze-strict'; ///: BEGIN:ONLY_INCLUDE_IN(flask) import React from 'react'; +import { getRpcCaveatOrigins } from '@metamask/snaps-controllers/dist/snaps/endowments/rpc'; ///: END:ONLY_INCLUDE_IN import { RestrictedMethods, @@ -117,6 +118,24 @@ const PERMISSION_DESCRIPTIONS = deepFreeze({ leftIcon: 'fab fa-ethereum', rightIcon: null, }, + [EndowmentPermissions['endowment:rpc']]: { + label: (t, _, permissionValue) => { + const { snaps, dapps } = getRpcCaveatOrigins(permissionValue); + + const messages = []; + if (snaps) { + messages.push(t('permission_rpc', [t('otherSnaps')])); + } + + if (dapps) { + messages.push(t('permission_rpc', [t('websites')])); + } + + return messages; + }, + leftIcon: 'fas fa-plug', + rightIcon: null, + }, ///: END:ONLY_INCLUDE_IN [UNKNOWN_PERMISSION]: { label: (t, permissionName) => diff --git a/yarn.lock b/yarn.lock index c9ad1c5e8..f5ee73012 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2842,15 +2842,10 @@ pbkdf2 "^3.0.9" randombytes "^2.0.1" -"@metamask/browser-passworder@^3.0.0": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@metamask/browser-passworder/-/browser-passworder-3.0.0.tgz#c06744e66a968ffa13f70cc71a7d3b15d86b0ee7" - integrity sha512-hD10mgvhcDkZX8wnauw8udp1K2MzcbZfrN7Yon9sQ+OqVK9kiQ4VhZAyZNZTy9KJLtfoVD9Y2F6L4gEese7hDA== - -"@metamask/browser-passworder@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@metamask/browser-passworder/-/browser-passworder-4.0.1.tgz#bb2613bb1886774e18da4107ab94a21042e5e3da" - integrity sha512-mtekzCKph/S/15hRfWFDIUrpvz9mNoIU0CmH0SOlTHpLhalonEsZ+56MbQQUDshXbytzHp1eKr29OHrIx0u9iQ== +"@metamask/browser-passworder@^4.0.1", "@metamask/browser-passworder@^4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@metamask/browser-passworder/-/browser-passworder-4.0.2.tgz#436d7252aad56763baa5e5608e60a170ac9458d7" + integrity sha512-fC1EdXCd2nRZXCNcoCUODOV3p7dGkwYfWzZlqocBrckCv0+J6MQw2aIjFPER0laS/+OB86w89QFOtwzPZuuYkw== "@metamask/contract-metadata@^1.31.0", "@metamask/contract-metadata@^1.35.0": version "1.36.0" @@ -3210,14 +3205,14 @@ eth-rpc-errors "^4.0.0" immer "^9.0.6" -"@metamask/rpc-methods@^0.24.1": - version "0.24.1" - resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.24.1.tgz#77bb9d3c0960a53b04aeec5e97967a7581a341f7" - integrity sha512-mUwN5Ya1F51p/yq81MAqUwR1D3R8CU1cLw3sKypfH0gVtwHNxXogp6Jeyv1VI/46Hrh4i9yXDztsRMOr+AjZEw== +"@metamask/rpc-methods@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@metamask/rpc-methods/-/rpc-methods-0.25.0.tgz#d0c5fe0fb266be91cfd18ac43bf3921eb5a0ad4c" + integrity sha512-/5tG1PBIbj26zqzz+7fYDoBR5AsHTTgvXQ9kk/b99amkHgpNAirNry6qBEqvxYS4+F1uwkFmzjmqx+DJpinvGw== dependencies: - "@metamask/controllers" "^32.0.2" "@metamask/key-tree" "^6.0.0" - "@metamask/snaps-utils" "^0.24.1" + "@metamask/permission-controller" "^1.0.0" + "@metamask/snaps-utils" "^0.25.0" "@metamask/types" "^1.1.0" "@metamask/utils" "^3.3.1" "@noble/hashes" "^1.1.3" @@ -3250,19 +3245,22 @@ isomorphic-fetch "^3.0.0" lodash "^4.17.21" -"@metamask/snaps-controllers@^0.24.1": - version "0.24.1" - resolved "https://registry.yarnpkg.com/@metamask/snaps-controllers/-/snaps-controllers-0.24.1.tgz#602542b8b35e8faefcea4393589a82a5d3d8dfd8" - integrity sha512-RI9uZJipGHyh/+9joZVV6OC1bMI4h1XSfSJeJtNl121i0CZIsAIZQHWDfPToPfwKV2vVkpd3AEPrWIaHZ94hHg== +"@metamask/snaps-controllers@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@metamask/snaps-controllers/-/snaps-controllers-0.25.0.tgz#aa879a28df7cfa32e38d1dea0ee5a89459ce0377" + integrity sha512-d4Z/SrzHCeV7U15NRBOiEZ83DBYL1rK+P8E6E027o+nsbzNnRyWI76Egf++UALOF7Mk/gM5WolJLSZvmTsvEjA== dependencies: - "@metamask/browser-passworder" "^3.0.0" - "@metamask/controllers" "^32.0.2" + "@metamask/approval-controller" "^1.0.0" + "@metamask/base-controller" "^1.0.0" + "@metamask/browser-passworder" "^4.0.2" "@metamask/object-multiplex" "^1.1.0" + "@metamask/permission-controller" "^1.0.0" "@metamask/post-message-stream" "^6.0.0" - "@metamask/rpc-methods" "^0.24.1" - "@metamask/snaps-execution-environments" "^0.24.1" - "@metamask/snaps-types" "^0.24.1" - "@metamask/snaps-utils" "^0.24.1" + "@metamask/rpc-methods" "^0.25.0" + "@metamask/snaps-execution-environments" "^0.25.0" + "@metamask/snaps-types" "^0.25.0" + "@metamask/snaps-utils" "^0.25.0" + "@metamask/subject-metadata-controller" "^1.0.0" "@metamask/utils" "^3.3.1" "@xstate/fsm" "^2.0.0" concat-stream "^2.0.0" @@ -3277,16 +3275,16 @@ readable-web-to-node-stream "^3.0.2" tar-stream "^2.2.0" -"@metamask/snaps-execution-environments@^0.24.1": - version "0.24.1" - resolved "https://registry.yarnpkg.com/@metamask/snaps-execution-environments/-/snaps-execution-environments-0.24.1.tgz#fd2765b0ca24670c245896330a85e2c1b57b2997" - integrity sha512-pMsKM3htIXmdeRKkXrl4ktiRrXojo3oxCqv3GhIhY0Tbm+nuJM4x105utLEi62LFeuAFvIVFB8uU1dnjtl6bhg== +"@metamask/snaps-execution-environments@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@metamask/snaps-execution-environments/-/snaps-execution-environments-0.25.0.tgz#b2dfa8342ed603da2782d70b91e6612947ee2cdd" + integrity sha512-CF/+NgMf+fkuq8bhzIripXxcK45f/kCyrBIuhwoBmU9KCC4+LDeDHaNMqBpfgHJcw/pfZg1I0gfPXaGOLSmc3g== dependencies: "@metamask/object-multiplex" "^1.2.0" "@metamask/post-message-stream" "^6.0.0" "@metamask/providers" "^10.2.0" - "@metamask/snaps-types" "^0.24.1" - "@metamask/snaps-utils" "^0.24.1" + "@metamask/snaps-types" "^0.25.0" + "@metamask/snaps-utils" "^0.25.0" "@metamask/utils" "^3.3.1" eth-rpc-errors "^4.0.3" json-rpc-engine "^6.1.0" @@ -3295,23 +3293,23 @@ stream-browserify "^3.0.0" superstruct "^0.16.7" -"@metamask/snaps-types@^0.24.1": - version "0.24.1" - resolved "https://registry.yarnpkg.com/@metamask/snaps-types/-/snaps-types-0.24.1.tgz#f315321f954611a7bdb514cf786a9c008897a3b6" - integrity sha512-Kt6pacC+nEISJm2BSa9Gu9HvYApIk03THCl6pmG8/HQr5g6r+VXRtQ56nQw7pHAiyV6eKlSITl/rFY+dYuJg6Q== +"@metamask/snaps-types@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@metamask/snaps-types/-/snaps-types-0.25.0.tgz#9593156e6e43ccfa6995b122061137dec405a123" + integrity sha512-izPueVfjQwlD5V3heJSOjEIINlldkYxD80MkVmQnr8mJVR0AQCvB3WTpoSWiYAMdS32b6cb9I2q8ZYZGOvyrmw== dependencies: "@metamask/providers" "^10.2.0" - "@metamask/snaps-utils" "^0.24.1" + "@metamask/snaps-utils" "^0.25.0" "@metamask/types" "^1.1.0" -"@metamask/snaps-utils@^0.24.1": - version "0.24.1" - resolved "https://registry.yarnpkg.com/@metamask/snaps-utils/-/snaps-utils-0.24.1.tgz#b95678828a739a5cf0c4e25c0843094931d3a0c7" - integrity sha512-W0wtDcvZd/y6MGyPWKnOBQ4ORpUTSCy8cwuxS0NsMuV1FhLgl9RlTmNWUlUS+eEGkUiQxdX8l+W34Cfe4ZZnuA== +"@metamask/snaps-utils@^0.25.0": + version "0.25.0" + resolved "https://registry.yarnpkg.com/@metamask/snaps-utils/-/snaps-utils-0.25.0.tgz#1a84570d4c24f71e4b0ea3ac4d5003aa22ed5be2" + integrity sha512-m0HTWQ1Jwr1y/nJqjPCmnB6EfiErKXwCPkkKFFvtgAGnMd0LkmrROrq35009KzDfDfE7K3edSReTYzgfKgOucg== dependencies: "@babel/core" "^7.18.6" "@babel/types" "^7.18.7" - "@metamask/snaps-types" "^0.24.1" + "@metamask/snaps-types" "^0.25.0" "@metamask/utils" "^3.3.1" "@noble/hashes" "^1.1.3" "@scure/base" "^1.1.1"