diff --git a/app/scripts/controllers/network/createInfuraClient.js b/app/scripts/controllers/network/createInfuraClient.js index 111e742ce..76461eb62 100644 --- a/app/scripts/controllers/network/createInfuraClient.js +++ b/app/scripts/controllers/network/createInfuraClient.js @@ -6,7 +6,7 @@ import { createInflightCacheMiddleware, createBlockTrackerInspectorMiddleware, providerFromMiddleware, -} from 'eth-json-rpc-middleware'; +} from '@metamask/eth-json-rpc-middleware'; import { createInfuraMiddleware } from '@metamask/eth-json-rpc-infura'; import { PollingBlockTracker } from 'eth-block-tracker'; diff --git a/app/scripts/controllers/network/createJsonRpcClient.js b/app/scripts/controllers/network/createJsonRpcClient.js index bd5f648d3..b8cf0e7aa 100644 --- a/app/scripts/controllers/network/createJsonRpcClient.js +++ b/app/scripts/controllers/network/createJsonRpcClient.js @@ -6,7 +6,7 @@ import { createInflightCacheMiddleware, createBlockTrackerInspectorMiddleware, providerFromMiddleware, -} from 'eth-json-rpc-middleware'; +} from '@metamask/eth-json-rpc-middleware'; import { PollingBlockTracker } from 'eth-block-tracker'; import { SECOND } from '../../../../shared/constants/time'; diff --git a/app/scripts/controllers/network/network-controller.js b/app/scripts/controllers/network/network-controller.js index 2595ae99d..5c4d3d456 100644 --- a/app/scripts/controllers/network/network-controller.js +++ b/app/scripts/controllers/network/network-controller.js @@ -5,7 +5,7 @@ import { JsonRpcEngine } from 'json-rpc-engine'; import { providerFromEngine, providerFromMiddleware, -} from 'eth-json-rpc-middleware'; +} from '@metamask/eth-json-rpc-middleware'; import log from 'loglevel'; import { createSwappableProxy, diff --git a/app/scripts/controllers/network/network-controller.test.js b/app/scripts/controllers/network/network-controller.test.js index 939d9aa07..df2a76dbd 100644 --- a/app/scripts/controllers/network/network-controller.test.js +++ b/app/scripts/controllers/network/network-controller.test.js @@ -2,13 +2,13 @@ import { inspect, isDeepStrictEqual, promisify } from 'util'; import { isMatch } from 'lodash'; import nock from 'nock'; import sinon from 'sinon'; -import * as ethJsonRpcMiddlewareModule from 'eth-json-rpc-middleware'; +import * as ethJsonRpcMiddlewareModule from '@metamask/eth-json-rpc-middleware'; import NetworkController from './network-controller'; -jest.mock('eth-json-rpc-middleware', () => { +jest.mock('@metamask/eth-json-rpc-middleware', () => { return { __esModule: true, - ...jest.requireActual('eth-json-rpc-middleware'), + ...jest.requireActual('@metamask/eth-json-rpc-middleware'), }; }); diff --git a/app/scripts/controllers/network/provider-api-tests/helpers.js b/app/scripts/controllers/network/provider-api-tests/helpers.js index 38bfe0d87..f8deb72f8 100644 --- a/app/scripts/controllers/network/provider-api-tests/helpers.js +++ b/app/scripts/controllers/network/provider-api-tests/helpers.js @@ -1,7 +1,7 @@ import nock from 'nock'; import sinon from 'sinon'; import { JsonRpcEngine } from 'json-rpc-engine'; -import { providerFromEngine } from 'eth-json-rpc-middleware'; +import { providerFromEngine } from '@metamask/eth-json-rpc-middleware'; import EthQuery from 'eth-query'; import createInfuraClient from '../createInfuraClient'; import createJsonRpcClient from '../createJsonRpcClient'; diff --git a/app/scripts/lib/createMetamaskMiddleware.js b/app/scripts/lib/createMetamaskMiddleware.js index cee6b9b95..c0114dd23 100644 --- a/app/scripts/lib/createMetamaskMiddleware.js +++ b/app/scripts/lib/createMetamaskMiddleware.js @@ -1,5 +1,5 @@ import { createScaffoldMiddleware, mergeMiddleware } from 'json-rpc-engine'; -import { createWalletMiddleware } from 'eth-json-rpc-middleware'; +import { createWalletMiddleware } from '@metamask/eth-json-rpc-middleware'; import { createPendingNonceMiddleware, createPendingTxMiddleware, diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 73578b834..2c3231c90 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -5,7 +5,7 @@ import { storeAsStream } from '@metamask/obs-store/dist/asStream'; import { JsonRpcEngine } from 'json-rpc-engine'; import { debounce } from 'lodash'; import { createEngineStream } from 'json-rpc-middleware-stream'; -import { providerAsMiddleware } from 'eth-json-rpc-middleware'; +import { providerAsMiddleware } from '@metamask/eth-json-rpc-middleware'; import { KeyringController, keyringBuilderFactory, diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 4da2914dc..2d824d949 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -871,14 +871,34 @@ "ethjs>ethjs-util>strip-hex-prefix": true } }, + "@metamask/eth-json-rpc-middleware": { + "globals": { + "URL": true, + "btoa": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@metamask/eth-json-rpc-middleware>pify": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, + "@metamask/utils": true, + "browserify>browser-resolve": true, + "eth-rpc-errors": true, + "json-rpc-engine": true, + "json-rpc-engine>@metamask/safe-event-emitter": true, + "lavamoat>json-stable-stringify": true, + "vinyl>clone": true + } + }, "@metamask/eth-keyring-controller": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": true, "@metamask/eth-keyring-controller>obs-store": true, "@metamask/rpc-methods>@metamask/browser-passworder": true, - "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true + "browserify>events": true } }, "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": { @@ -887,9 +907,9 @@ }, "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, "browserify>buffer": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-lattice-keyring>@ethereumjs/util": true } }, @@ -909,12 +929,45 @@ "crypto": true } }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": { + "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": true, + "bn.js": true, + "browserify>buffer": true, + "eth-lattice-keyring>@ethereumjs/util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { + "globals": { + "TextDecoder": true, + "crypto": true + }, + "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": { + "packages": { + "browserify>buffer": true, + "ethjs>ethjs-util>is-hex-prefixed": true, + "ethjs>ethjs-util>strip-hex-prefix": true + } + }, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": { "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-lattice-keyring>@ethereumjs/util": true, "ethereumjs-wallet>randombytes": true } @@ -2575,59 +2628,6 @@ "wait-on>rxjs>tslib": true } }, - "eth-json-rpc-middleware": { - "globals": { - "URL": true, - "btoa": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/utils": true, - "browserify>browser-resolve": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, - "eth-json-rpc-middleware>pify": true, - "eth-rpc-errors": true, - "json-rpc-engine": true, - "json-rpc-engine>@metamask/safe-event-emitter": true, - "lavamoat>json-stable-stringify": true, - "vinyl>clone": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util": { - "packages": { - "bn.js": true, - "browserify>buffer": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": true, - "eth-lattice-keyring>@ethereumjs/util": true, - "eth-sig-util>tweetnacl": true, - "eth-sig-util>tweetnacl-util": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": { - "packages": { - "browserify>buffer": true, - "ethjs>ethjs-util>is-hex-prefixed": true, - "ethjs>ethjs-util>strip-hex-prefix": true - } - }, "eth-keyring-controller>@metamask/browser-passworder": { "globals": { "crypto": true @@ -3022,8 +3022,8 @@ }, "packages": { "@babel/runtime": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-trezor-keyring>trezor-connect>cross-fetch": true } }, diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index 79309f375..e3b4c0d4d 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -923,14 +923,34 @@ "ethjs>ethjs-util>strip-hex-prefix": true } }, + "@metamask/eth-json-rpc-middleware": { + "globals": { + "URL": true, + "btoa": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@metamask/eth-json-rpc-middleware>pify": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, + "@metamask/utils": true, + "browserify>browser-resolve": true, + "eth-rpc-errors": true, + "json-rpc-engine": true, + "json-rpc-engine>@metamask/safe-event-emitter": true, + "lavamoat>json-stable-stringify": true, + "vinyl>clone": true + } + }, "@metamask/eth-keyring-controller": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": true, "@metamask/eth-keyring-controller>obs-store": true, "@metamask/rpc-methods>@metamask/browser-passworder": true, - "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true + "browserify>events": true } }, "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": { @@ -939,9 +959,9 @@ }, "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, "browserify>buffer": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-lattice-keyring>@ethereumjs/util": true } }, @@ -961,12 +981,45 @@ "crypto": true } }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": { + "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": true, + "bn.js": true, + "browserify>buffer": true, + "eth-lattice-keyring>@ethereumjs/util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { + "globals": { + "TextDecoder": true, + "crypto": true + }, + "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": { + "packages": { + "browserify>buffer": true, + "ethjs>ethjs-util>is-hex-prefixed": true, + "ethjs>ethjs-util>strip-hex-prefix": true + } + }, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": { "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-lattice-keyring>@ethereumjs/util": true, "ethereumjs-wallet>randombytes": true } @@ -2941,59 +2994,6 @@ "wait-on>rxjs>tslib": true } }, - "eth-json-rpc-middleware": { - "globals": { - "URL": true, - "btoa": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/utils": true, - "browserify>browser-resolve": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, - "eth-json-rpc-middleware>pify": true, - "eth-rpc-errors": true, - "json-rpc-engine": true, - "json-rpc-engine>@metamask/safe-event-emitter": true, - "lavamoat>json-stable-stringify": true, - "vinyl>clone": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util": { - "packages": { - "bn.js": true, - "browserify>buffer": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": true, - "eth-lattice-keyring>@ethereumjs/util": true, - "eth-sig-util>tweetnacl": true, - "eth-sig-util>tweetnacl-util": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": { - "packages": { - "browserify>buffer": true, - "ethjs>ethjs-util>is-hex-prefixed": true, - "ethjs>ethjs-util>strip-hex-prefix": true - } - }, "eth-keyring-controller>@metamask/browser-passworder": { "globals": { "crypto": true @@ -3388,8 +3388,8 @@ }, "packages": { "@babel/runtime": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-trezor-keyring>trezor-connect>cross-fetch": true } }, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 1695b495f..9b6ec427f 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -871,14 +871,34 @@ "ethjs>ethjs-util>strip-hex-prefix": true } }, + "@metamask/eth-json-rpc-middleware": { + "globals": { + "URL": true, + "btoa": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@metamask/eth-json-rpc-middleware>pify": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, + "@metamask/utils": true, + "browserify>browser-resolve": true, + "eth-rpc-errors": true, + "json-rpc-engine": true, + "json-rpc-engine>@metamask/safe-event-emitter": true, + "lavamoat>json-stable-stringify": true, + "vinyl>clone": true + } + }, "@metamask/eth-keyring-controller": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": true, "@metamask/eth-keyring-controller>obs-store": true, "@metamask/rpc-methods>@metamask/browser-passworder": true, - "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true + "browserify>events": true } }, "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": { @@ -887,9 +907,9 @@ }, "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, "browserify>buffer": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-lattice-keyring>@ethereumjs/util": true } }, @@ -909,12 +929,45 @@ "crypto": true } }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": { + "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": true, + "bn.js": true, + "browserify>buffer": true, + "eth-lattice-keyring>@ethereumjs/util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { + "globals": { + "TextDecoder": true, + "crypto": true + }, + "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": { + "packages": { + "browserify>buffer": true, + "ethjs>ethjs-util>is-hex-prefixed": true, + "ethjs>ethjs-util>strip-hex-prefix": true + } + }, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": { "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-lattice-keyring>@ethereumjs/util": true, "ethereumjs-wallet>randombytes": true } @@ -2889,59 +2942,6 @@ "wait-on>rxjs>tslib": true } }, - "eth-json-rpc-middleware": { - "globals": { - "URL": true, - "btoa": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/utils": true, - "browserify>browser-resolve": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, - "eth-json-rpc-middleware>pify": true, - "eth-rpc-errors": true, - "json-rpc-engine": true, - "json-rpc-engine>@metamask/safe-event-emitter": true, - "lavamoat>json-stable-stringify": true, - "vinyl>clone": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util": { - "packages": { - "bn.js": true, - "browserify>buffer": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": true, - "eth-lattice-keyring>@ethereumjs/util": true, - "eth-sig-util>tweetnacl": true, - "eth-sig-util>tweetnacl-util": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": { - "packages": { - "browserify>buffer": true, - "ethjs>ethjs-util>is-hex-prefixed": true, - "ethjs>ethjs-util>strip-hex-prefix": true - } - }, "eth-keyring-controller>@metamask/browser-passworder": { "globals": { "crypto": true @@ -3336,8 +3336,8 @@ }, "packages": { "@babel/runtime": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-trezor-keyring>trezor-connect>cross-fetch": true } }, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 4da2914dc..2d824d949 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -871,14 +871,34 @@ "ethjs>ethjs-util>strip-hex-prefix": true } }, + "@metamask/eth-json-rpc-middleware": { + "globals": { + "URL": true, + "btoa": true, + "console.error": true, + "fetch": true, + "setTimeout": true + }, + "packages": { + "@metamask/eth-json-rpc-middleware>pify": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, + "@metamask/utils": true, + "browserify>browser-resolve": true, + "eth-rpc-errors": true, + "json-rpc-engine": true, + "json-rpc-engine>@metamask/safe-event-emitter": true, + "lavamoat>json-stable-stringify": true, + "vinyl>clone": true + } + }, "@metamask/eth-keyring-controller": { "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": true, "@metamask/eth-keyring-controller>obs-store": true, "@metamask/rpc-methods>@metamask/browser-passworder": true, - "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true + "browserify>events": true } }, "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring": { @@ -887,9 +907,9 @@ }, "packages": { "@metamask/eth-keyring-controller>@metamask/eth-hd-keyring>ethereum-cryptography": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/scure-bip39": true, "browserify>buffer": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-lattice-keyring>@ethereumjs/util": true } }, @@ -909,12 +929,45 @@ "crypto": true } }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": { + "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": true, + "bn.js": true, + "browserify>buffer": true, + "eth-lattice-keyring>@ethereumjs/util": true, + "eth-sig-util>tweetnacl": true, + "eth-sig-util>tweetnacl-util": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography": { + "globals": { + "TextDecoder": true, + "crypto": true + }, + "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { + "globals": { + "TextEncoder": true, + "crypto": true + } + }, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util>ethjs-util": { + "packages": { + "browserify>buffer": true, + "ethjs>ethjs-util>is-hex-prefixed": true, + "ethjs>ethjs-util>strip-hex-prefix": true + } + }, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring": { "packages": { + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": true, "browserify>buffer": true, "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-lattice-keyring>@ethereumjs/util": true, "ethereumjs-wallet>randombytes": true } @@ -2575,59 +2628,6 @@ "wait-on>rxjs>tslib": true } }, - "eth-json-rpc-middleware": { - "globals": { - "URL": true, - "btoa": true, - "console.error": true, - "fetch": true, - "setTimeout": true - }, - "packages": { - "@metamask/utils": true, - "browserify>browser-resolve": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, - "eth-json-rpc-middleware>pify": true, - "eth-rpc-errors": true, - "json-rpc-engine": true, - "json-rpc-engine>@metamask/safe-event-emitter": true, - "lavamoat>json-stable-stringify": true, - "vinyl>clone": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util": { - "packages": { - "bn.js": true, - "browserify>buffer": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": true, - "eth-lattice-keyring>@ethereumjs/util": true, - "eth-sig-util>tweetnacl": true, - "eth-sig-util>tweetnacl-util": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography": { - "globals": { - "TextDecoder": true, - "crypto": true - }, - "packages": { - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethereum-cryptography>@noble/hashes": { - "globals": { - "TextEncoder": true, - "crypto": true - } - }, - "eth-json-rpc-middleware>@metamask/eth-sig-util>ethjs-util": { - "packages": { - "browserify>buffer": true, - "ethjs>ethjs-util>is-hex-prefixed": true, - "ethjs>ethjs-util>strip-hex-prefix": true - } - }, "eth-keyring-controller>@metamask/browser-passworder": { "globals": { "crypto": true @@ -3022,8 +3022,8 @@ }, "packages": { "@babel/runtime": true, + "@metamask/eth-keyring-controller>@metamask/eth-sig-util": true, "browserify>events": true, - "eth-json-rpc-middleware>@metamask/eth-sig-util": true, "eth-trezor-keyring>trezor-connect>cross-fetch": true } }, diff --git a/package.json b/package.json index 2639e49c9..426f51e11 100644 --- a/package.json +++ b/package.json @@ -233,6 +233,7 @@ "@metamask/design-tokens": "^1.9.0", "@metamask/desktop": "^0.2.0", "@metamask/eth-json-rpc-infura": "^7.0.0", + "@metamask/eth-json-rpc-middleware": "^10.0.0", "@metamask/eth-keyring-controller": "^10.0.0", "@metamask/eth-ledger-bridge-keyring": "^0.13.0", "@metamask/eth-token-tracker": "^4.0.0", @@ -286,7 +287,6 @@ "eth-block-tracker": "^6.0.0", "eth-ens-namehash": "^2.0.8", "eth-json-rpc-filters": "^6.0.0", - "eth-json-rpc-middleware": "^9.0.1", "eth-lattice-keyring": "^0.12.3", "eth-method-registry": "^2.0.0", "eth-query": "^2.1.2", diff --git a/test/stub/provider.js b/test/stub/provider.js index 055c02a78..e070d55fa 100644 --- a/test/stub/provider.js +++ b/test/stub/provider.js @@ -1,5 +1,5 @@ import { JsonRpcEngine, createScaffoldMiddleware } from 'json-rpc-engine'; -import { providerAsMiddleware } from 'eth-json-rpc-middleware'; +import { providerAsMiddleware } from '@metamask/eth-json-rpc-middleware'; import Ganache from 'ganache'; export function getTestSeed() { diff --git a/yarn.lock b/yarn.lock index cc9027552..ffb694e88 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3769,6 +3769,25 @@ __metadata: languageName: node linkType: hard +"@metamask/eth-json-rpc-middleware@npm:^10.0.0": + version: 10.0.0 + resolution: "@metamask/eth-json-rpc-middleware@npm:10.0.0" + dependencies: + "@metamask/eth-sig-util": ^5.0.0 + "@metamask/safe-event-emitter": ^2.0.0 + "@metamask/utils": ^3.0.3 + btoa: ^1.2.1 + clone: ^2.1.1 + eth-block-tracker: ^5.0.1 + eth-rpc-errors: ^4.0.3 + json-rpc-engine: ^6.1.0 + json-stable-stringify: ^1.0.1 + node-fetch: ^2.6.7 + pify: ^3.0.0 + checksum: c754b3a39f175698070b4d07076e692d3080738bd25157c3b93114d286c975ee6895d5793b4188ca3d0abbcdef04bfde9e2d4835251a6b725b002d3750bf98de + languageName: node + linkType: hard + "@metamask/eth-keyring-controller@npm:^10.0.0": version: 10.0.0 resolution: "@metamask/eth-keyring-controller@npm:10.0.0" @@ -15426,25 +15445,6 @@ __metadata: languageName: node linkType: hard -"eth-json-rpc-middleware@npm:^9.0.1": - version: 9.0.1 - resolution: "eth-json-rpc-middleware@npm:9.0.1" - dependencies: - "@metamask/eth-sig-util": ^5.0.0 - "@metamask/safe-event-emitter": ^2.0.0 - "@metamask/utils": ^3.0.3 - btoa: ^1.2.1 - clone: ^2.1.1 - eth-block-tracker: ^5.0.1 - eth-rpc-errors: ^4.0.3 - json-rpc-engine: ^6.1.0 - json-stable-stringify: ^1.0.1 - node-fetch: ^2.6.7 - pify: ^3.0.0 - checksum: 9512829a6958df6ef739b891a0c0804b51a140407fd2e3ddaaa6b18d975796646cfcf7f7305a18beb7903db09e0c7a91b06dc5434b6bd2d6cdb85d992d9fd3ab - languageName: node - linkType: hard - "eth-lattice-keyring@npm:^0.12.3": version: 0.12.3 resolution: "eth-lattice-keyring@npm:0.12.3" @@ -24034,6 +24034,7 @@ __metadata: "@metamask/eslint-config-nodejs": ^9.0.0 "@metamask/eslint-config-typescript": ^9.0.1 "@metamask/eth-json-rpc-infura": ^7.0.0 + "@metamask/eth-json-rpc-middleware": ^10.0.0 "@metamask/eth-keyring-controller": ^10.0.0 "@metamask/eth-ledger-bridge-keyring": ^0.13.0 "@metamask/eth-token-tracker": ^4.0.0 @@ -24166,7 +24167,6 @@ __metadata: eth-block-tracker: ^6.0.0 eth-ens-namehash: ^2.0.8 eth-json-rpc-filters: ^6.0.0 - eth-json-rpc-middleware: ^9.0.1 eth-lattice-keyring: ^0.12.3 eth-method-registry: ^2.0.0 eth-query: ^2.1.2