Update `eth-json-rpc-infura` (#15845)

* Update `eth-json-rpc-infura`

The package `eth-json-rpc-infura@5` has been updated to
`@metamask/eth-json-rpc-infura@7`. This update includes TypeScript
support, and it drops support for older node.js versions. The exports
have also been changed from default to named exports.

See here for a full list of changes: https://github.com/MetaMask/eth-json-rpc-infura/blob/main/CHANGELOG.md#700

* Fix LavaMoat policy issue

The `web3` package used by `@metamask/controllers` unintentionally
overwrites the `XMLHttpRequest` global, which breaks things. This was
fixed by revoking `web3`'s write access to that global using a policy
override.

Previously this policy override was applied to `web3`, but for some
unknown reason, this update caused that override to no longer apply.
feature/default_network_editable
Mark Stacey 2 years ago committed by GitHub
parent b802e25a85
commit 929a1a0d52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/scripts/controllers/network/createInfuraClient.js
  2. 79
      lavamoat/browserify/beta/policy.json
  3. 79
      lavamoat/browserify/flask/policy.json
  4. 79
      lavamoat/browserify/main/policy.json
  5. 5
      lavamoat/browserify/policy-override.json
  6. 1423
      lavamoat/build-system/policy.json
  7. 2
      package.json
  8. 47
      yarn.lock

@ -8,7 +8,7 @@ import {
providerFromMiddleware,
} from 'eth-json-rpc-middleware';
import createInfuraMiddleware from 'eth-json-rpc-infura';
import { createInfuraMiddleware } from '@metamask/eth-json-rpc-infura';
import { PollingBlockTracker } from 'eth-block-tracker';
import { BUILT_IN_NETWORKS } from '../../../../shared/constants/network';

@ -2635,6 +2635,7 @@
"@metamask/contract-metadata": true,
"@metamask/controllers>abort-controller": true,
"@metamask/controllers>async-mutex": true,
"@metamask/controllers>eth-json-rpc-infura": true,
"@metamask/controllers>eth-method-registry": true,
"@metamask/controllers>eth-phishing-detect": true,
"@metamask/controllers>ethereumjs-wallet": true,
@ -2649,7 +2650,6 @@
"deep-freeze-strict": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"eth-json-rpc-infura": true,
"eth-keyring-controller": true,
"eth-query": true,
"eth-rpc-errors": true,
@ -2683,6 +2683,33 @@
"define": true
}
},
"@metamask/controllers>eth-json-rpc-infura": {
"globals": {
"setTimeout": true
},
"packages": {
"@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": true,
"@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true,
"@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": true,
"node-fetch": true
}
},
"@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": {
"packages": {
"safe-event-emitter": true
}
},
"@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": {
"packages": {
"eth-rpc-errors>fast-safe-stringify": true
}
},
"@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": {
"packages": {
"@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true,
"safe-event-emitter": true
}
},
"@metamask/controllers>eth-method-registry": {
"packages": {
"@metamask/controllers>eth-method-registry>ethjs": true
@ -2829,6 +2856,7 @@
},
"packages": {
"@ethereumjs/tx": true,
"@metamask/controllers>eth-json-rpc-infura": true,
"@metamask/controllers>web3-provider-engine>backoff": true,
"@metamask/controllers>web3-provider-engine>eth-block-tracker": true,
"@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware": true,
@ -2840,7 +2868,6 @@
"browserify>events": true,
"browserify>util": true,
"eth-json-rpc-filters": true,
"eth-json-rpc-infura": true,
"gh-pages>async": true,
"lavamoat>json-stable-stringify": true,
"watchify>xtend": true
@ -2991,6 +3018,25 @@
"pubnub>superagent>cookiejar": true
}
},
"@metamask/eth-json-rpc-infura": {
"globals": {
"setTimeout": true
},
"packages": {
"@metamask/eth-json-rpc-infura>@metamask/utils": true,
"eth-json-rpc-middleware": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"node-fetch": true
}
},
"@metamask/eth-json-rpc-infura>@metamask/utils": {
"packages": {
"@metamask/eth-json-rpc-infura>@metamask/utils>superstruct": true,
"eslint>fast-deep-equal": true,
"madge>debug": true
}
},
"@metamask/eth-ledger-bridge-keyring": {
"globals": {
"addEventListener": true,
@ -4297,33 +4343,6 @@
"eth-json-rpc-filters>json-rpc-engine": true
}
},
"eth-json-rpc-infura": {
"globals": {
"setTimeout": true
},
"packages": {
"eth-json-rpc-infura>eth-json-rpc-middleware": true,
"eth-json-rpc-infura>eth-rpc-errors": true,
"eth-json-rpc-infura>json-rpc-engine": true,
"node-fetch": true
}
},
"eth-json-rpc-infura>eth-json-rpc-middleware": {
"packages": {
"safe-event-emitter": true
}
},
"eth-json-rpc-infura>eth-rpc-errors": {
"packages": {
"eth-rpc-errors>fast-safe-stringify": true
}
},
"eth-json-rpc-infura>json-rpc-engine": {
"packages": {
"eth-json-rpc-infura>eth-rpc-errors": true,
"safe-event-emitter": true
}
},
"eth-json-rpc-middleware": {
"globals": {
"URL": true,
@ -6395,4 +6414,4 @@
}
}
}
}
}

@ -2780,6 +2780,7 @@
"@metamask/contract-metadata": true,
"@metamask/controllers>abort-controller": true,
"@metamask/controllers>async-mutex": true,
"@metamask/controllers>eth-json-rpc-infura": true,
"@metamask/controllers>eth-method-registry": true,
"@metamask/controllers>eth-phishing-detect": true,
"@metamask/controllers>ethereumjs-wallet": true,
@ -2794,7 +2795,6 @@
"deep-freeze-strict": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"eth-json-rpc-infura": true,
"eth-keyring-controller": true,
"eth-query": true,
"eth-rpc-errors": true,
@ -2828,6 +2828,33 @@
"define": true
}
},
"@metamask/controllers>eth-json-rpc-infura": {
"globals": {
"setTimeout": true
},
"packages": {
"@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": true,
"@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true,
"@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": true,
"node-fetch": true
}
},
"@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": {
"packages": {
"safe-event-emitter": true
}
},
"@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": {
"packages": {
"eth-rpc-errors>fast-safe-stringify": true
}
},
"@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": {
"packages": {
"@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true,
"safe-event-emitter": true
}
},
"@metamask/controllers>eth-method-registry": {
"packages": {
"@metamask/controllers>eth-method-registry>ethjs": true
@ -2974,6 +3001,7 @@
},
"packages": {
"@ethereumjs/tx": true,
"@metamask/controllers>eth-json-rpc-infura": true,
"@metamask/controllers>web3-provider-engine>backoff": true,
"@metamask/controllers>web3-provider-engine>eth-block-tracker": true,
"@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware": true,
@ -2985,7 +3013,6 @@
"browserify>events": true,
"browserify>util": true,
"eth-json-rpc-filters": true,
"eth-json-rpc-infura": true,
"gh-pages>async": true,
"lavamoat>json-stable-stringify": true,
"watchify>xtend": true
@ -3136,6 +3163,25 @@
"pubnub>superagent>cookiejar": true
}
},
"@metamask/eth-json-rpc-infura": {
"globals": {
"setTimeout": true
},
"packages": {
"@metamask/eth-json-rpc-infura>@metamask/utils": true,
"eth-json-rpc-middleware": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"node-fetch": true
}
},
"@metamask/eth-json-rpc-infura>@metamask/utils": {
"packages": {
"@metamask/eth-json-rpc-infura>@metamask/utils>superstruct": true,
"eslint>fast-deep-equal": true,
"madge>debug": true
}
},
"@metamask/eth-ledger-bridge-keyring": {
"globals": {
"addEventListener": true,
@ -4839,33 +4885,6 @@
"eth-json-rpc-filters>json-rpc-engine": true
}
},
"eth-json-rpc-infura": {
"globals": {
"setTimeout": true
},
"packages": {
"eth-json-rpc-infura>eth-json-rpc-middleware": true,
"eth-json-rpc-infura>eth-rpc-errors": true,
"eth-json-rpc-infura>json-rpc-engine": true,
"node-fetch": true
}
},
"eth-json-rpc-infura>eth-json-rpc-middleware": {
"packages": {
"safe-event-emitter": true
}
},
"eth-json-rpc-infura>eth-rpc-errors": {
"packages": {
"eth-rpc-errors>fast-safe-stringify": true
}
},
"eth-json-rpc-infura>json-rpc-engine": {
"packages": {
"eth-json-rpc-infura>eth-rpc-errors": true,
"safe-event-emitter": true
}
},
"eth-json-rpc-middleware": {
"globals": {
"URL": true,
@ -7026,4 +7045,4 @@
}
}
}
}
}

@ -2635,6 +2635,7 @@
"@metamask/contract-metadata": true,
"@metamask/controllers>abort-controller": true,
"@metamask/controllers>async-mutex": true,
"@metamask/controllers>eth-json-rpc-infura": true,
"@metamask/controllers>eth-method-registry": true,
"@metamask/controllers>eth-phishing-detect": true,
"@metamask/controllers>ethereumjs-wallet": true,
@ -2649,7 +2650,6 @@
"deep-freeze-strict": true,
"eslint>fast-deep-equal": true,
"eth-ens-namehash": true,
"eth-json-rpc-infura": true,
"eth-keyring-controller": true,
"eth-query": true,
"eth-rpc-errors": true,
@ -2683,6 +2683,33 @@
"define": true
}
},
"@metamask/controllers>eth-json-rpc-infura": {
"globals": {
"setTimeout": true
},
"packages": {
"@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": true,
"@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true,
"@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": true,
"node-fetch": true
}
},
"@metamask/controllers>eth-json-rpc-infura>eth-json-rpc-middleware": {
"packages": {
"safe-event-emitter": true
}
},
"@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": {
"packages": {
"eth-rpc-errors>fast-safe-stringify": true
}
},
"@metamask/controllers>eth-json-rpc-infura>json-rpc-engine": {
"packages": {
"@metamask/controllers>eth-json-rpc-infura>eth-rpc-errors": true,
"safe-event-emitter": true
}
},
"@metamask/controllers>eth-method-registry": {
"packages": {
"@metamask/controllers>eth-method-registry>ethjs": true
@ -2829,6 +2856,7 @@
},
"packages": {
"@ethereumjs/tx": true,
"@metamask/controllers>eth-json-rpc-infura": true,
"@metamask/controllers>web3-provider-engine>backoff": true,
"@metamask/controllers>web3-provider-engine>eth-block-tracker": true,
"@metamask/controllers>web3-provider-engine>eth-json-rpc-middleware": true,
@ -2840,7 +2868,6 @@
"browserify>events": true,
"browserify>util": true,
"eth-json-rpc-filters": true,
"eth-json-rpc-infura": true,
"gh-pages>async": true,
"lavamoat>json-stable-stringify": true,
"watchify>xtend": true
@ -2991,6 +3018,25 @@
"pubnub>superagent>cookiejar": true
}
},
"@metamask/eth-json-rpc-infura": {
"globals": {
"setTimeout": true
},
"packages": {
"@metamask/eth-json-rpc-infura>@metamask/utils": true,
"eth-json-rpc-middleware": true,
"eth-rpc-errors": true,
"json-rpc-engine": true,
"node-fetch": true
}
},
"@metamask/eth-json-rpc-infura>@metamask/utils": {
"packages": {
"@metamask/eth-json-rpc-infura>@metamask/utils>superstruct": true,
"eslint>fast-deep-equal": true,
"madge>debug": true
}
},
"@metamask/eth-ledger-bridge-keyring": {
"globals": {
"addEventListener": true,
@ -4297,33 +4343,6 @@
"eth-json-rpc-filters>json-rpc-engine": true
}
},
"eth-json-rpc-infura": {
"globals": {
"setTimeout": true
},
"packages": {
"eth-json-rpc-infura>eth-json-rpc-middleware": true,
"eth-json-rpc-infura>eth-rpc-errors": true,
"eth-json-rpc-infura>json-rpc-engine": true,
"node-fetch": true
}
},
"eth-json-rpc-infura>eth-json-rpc-middleware": {
"packages": {
"safe-event-emitter": true
}
},
"eth-json-rpc-infura>eth-rpc-errors": {
"packages": {
"eth-rpc-errors>fast-safe-stringify": true
}
},
"eth-json-rpc-infura>json-rpc-engine": {
"packages": {
"eth-json-rpc-infura>eth-rpc-errors": true,
"safe-event-emitter": true
}
},
"eth-json-rpc-middleware": {
"globals": {
"URL": true,
@ -6395,4 +6414,4 @@
}
}
}
}
}

@ -58,6 +58,11 @@
"XMLHttpRequest": true
}
},
"@metamask/controllers>web3": {
"globals": {
"XMLHttpRequest": true
}
},
"react-dom": {
"globals": {
"HTMLIFrameElement": true

File diff suppressed because it is too large Load Diff

@ -124,6 +124,7 @@
"@metamask/controllers": "^30.3.0",
"@metamask/design-tokens": "^1.9.0",
"@metamask/eth-ledger-bridge-keyring": "^0.13.0",
"@metamask/eth-json-rpc-infura": "^7.0.0",
"@metamask/eth-token-tracker": "^4.0.0",
"@metamask/etherscan-link": "^2.1.0",
"@metamask/jazzicon": "^2.0.0",
@ -164,7 +165,6 @@
"eth-block-tracker": "^5.0.1",
"eth-ens-namehash": "^2.0.8",
"eth-json-rpc-filters": "^4.2.1",
"eth-json-rpc-infura": "^5.1.0",
"eth-json-rpc-middleware": "^8.0.0",
"eth-keyring-controller": "^7.0.2",
"eth-lattice-keyring": "^0.12.0",

@ -2974,6 +2974,17 @@
ethereumjs-util "^7.0.9"
ethereumjs-wallet "^1.0.1"
"@metamask/eth-json-rpc-infura@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@metamask/eth-json-rpc-infura/-/eth-json-rpc-infura-7.0.0.tgz#67bf7655539cd4234d85b1aa31b15e02be4671df"
integrity sha512-V8iDCw3H0QCD1XyjtNNAz5jYsJWS0jGCUxLWsePSJydAdJnBEObcUuzWzwS2/7c7BIINPJbQ/toQ62syDOyYWg==
dependencies:
"@metamask/utils" "^3.0.1"
eth-json-rpc-middleware "^8.1.0"
eth-rpc-errors "^4.0.3"
json-rpc-engine "^6.1.0"
node-fetch "^2.6.7"
"@metamask/eth-ledger-bridge-keyring@^0.13.0":
version "0.13.0"
resolved "https://registry.yarnpkg.com/@metamask/eth-ledger-bridge-keyring/-/eth-ledger-bridge-keyring-0.13.0.tgz#586b705d92339d08650f9eef42ab2388c4dd2675"
@ -3245,6 +3256,16 @@
dependencies:
fast-deep-equal "^3.1.3"
"@metamask/utils@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-3.0.1.tgz#53ed2b9cbbd12b18c1db6929728446633d6a74c4"
integrity sha512-FDWQ+MeeWQh0b/w2D50+oVPrRqUIvawDlPia+EH9NCOFN0Ty3KkzkQXfO6FgHKMyR4aWuS4SBOrhWFRW8km6lQ==
dependencies:
"@types/debug" "^4.1.7"
debug "^4.3.4"
fast-deep-equal "^3.1.3"
superstruct "^0.16.0"
"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
@ -4814,6 +4835,13 @@
resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080"
integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==
"@types/debug@^4.1.7":
version "4.1.7"
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.7.tgz#7cc0ea761509124709b8b2d1090d8f6c17aadb82"
integrity sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==
dependencies:
"@types/ms" "*"
"@types/end-of-stream@^1.4.1":
version "1.4.1"
resolved "https://registry.yarnpkg.com/@types/end-of-stream/-/end-of-stream-1.4.1.tgz#9a401b642bcb0e4a8f0b70326725fbbb0216eb10"
@ -5052,6 +5080,11 @@
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.0.tgz#69a23a3ad29caf0097f06eda59b361ee2f0639f6"
integrity sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=
"@types/ms@*":
version "0.7.31"
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197"
integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==
"@types/node-fetch@^2.5.7":
version "2.5.12"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.12.tgz#8a6f779b1d4e60b7a57fb6fd48d84fb545b9cc66"
@ -11731,14 +11764,15 @@ eth-json-rpc-middleware@^6.0.0:
pify "^3.0.0"
safe-event-emitter "^1.0.1"
eth-json-rpc-middleware@^8.0.0:
version "8.0.2"
resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-8.0.2.tgz#7ce0b44443b8733c271ad64843a39d1782350fcb"
integrity sha512-aUx+Nf43pFAHnSQq1MqDETc6Bq0fIKpIen9oC3y4DLle4rsrSInx1Gxdde2/VZ1tlNcmN4M82ucbSMxR8bMqsg==
eth-json-rpc-middleware@^8.0.0, eth-json-rpc-middleware@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/eth-json-rpc-middleware/-/eth-json-rpc-middleware-8.1.0.tgz#d2bf980768b43dcbcb7830ed1fcc34a16f63074d"
integrity sha512-0ZZDr6KoddqN4N100a7YWzLTYrVN0P49DJ3Su1vsRavPpieq92rgZymnQcr0tLFBQDEJg1MVqLex46fA0GEkDA==
dependencies:
"@metamask/safe-event-emitter" "^2.0.0"
btoa "^1.2.1"
clone "^2.1.1"
eth-block-tracker "^5.0.1"
eth-rpc-errors "^4.0.3"
eth-sig-util "^1.4.2"
json-rpc-engine "^6.1.0"
@ -26346,6 +26380,11 @@ superagent@^7.1.3:
readable-stream "^3.6.0"
semver "^7.3.7"
superstruct@^0.16.0:
version "0.16.0"
resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.16.0.tgz#9af5e059acd08e774789ad8880962427ef68dace"
integrity sha512-IDQtwnnlaan1NhuHqyD/U11lROYvCQ79JyfwlFU9xEVHzqV/Ys/RrwmHPCG0CVH/1g0BuodEjH1msxK2UHxehA==
superstruct@^0.6.0, superstruct@~0.6.0, superstruct@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.6.1.tgz#148fc3d627bb59fcfe24aa1bd2a1b8c51b1db072"

Loading…
Cancel
Save