From 07da427a4ca18aca918a09ce49654f82c56b0ab0 Mon Sep 17 00:00:00 2001 From: Michele Esposito Date: Tue, 25 Jul 2023 10:30:34 +0200 Subject: [PATCH] refactor: use new importaccount from keyring controller --- .../account-import-strategies.test.js | 72 --------- .../account-import-strategies/index.js | 75 --------- .../metamask-controller.actions.test.js | 4 +- app/scripts/metamask-controller.js | 19 +-- app/scripts/metamask-controller.test.js | 2 +- lavamoat/browserify/beta/policy.json | 140 +++++++++-------- lavamoat/browserify/desktop/policy.json | 140 +++++++++-------- lavamoat/browserify/flask/policy.json | 140 +++++++++-------- lavamoat/browserify/main/policy.json | 140 +++++++++-------- lavamoat/browserify/mmi/policy.json | 146 ++++++++++-------- lavamoat/build-system/policy.json | 24 ++- package.json | 1 - .../import-account/import-account.js | 2 +- .../multichain/import-account/json.js | 2 +- .../multichain/import-account/json.test.tsx | 7 +- .../multichain/import-account/private-key.js | 2 +- yarn.lock | 31 +--- 17 files changed, 409 insertions(+), 538 deletions(-) delete mode 100644 app/scripts/account-import-strategies/account-import-strategies.test.js delete mode 100644 app/scripts/account-import-strategies/index.js diff --git a/app/scripts/account-import-strategies/account-import-strategies.test.js b/app/scripts/account-import-strategies/account-import-strategies.test.js deleted file mode 100644 index 0c2c6fc3aa31..000000000000 --- a/app/scripts/account-import-strategies/account-import-strategies.test.js +++ /dev/null @@ -1,72 +0,0 @@ -import { strict as assert } from 'assert'; -import { stripHexPrefix } from '../../../shared/modules/hexstring-utils'; -import accountImporter from '.'; - -describe('Account Import Strategies', function () { - const privkey = - '0x4cfd3e90fc78b0f86bf7524722150bb8da9c60cd532564d7ff43f5716514f553'; - const json = - '{"version":3,"id":"dbb54385-0a99-437f-83c0-647de9f244c3","address":"a7f92ce3fba24196cf6f4bd2e1eb3db282ba998c","Crypto":{"ciphertext":"bde13d9ade5c82df80281ca363320ce254a8a3a06535bbf6ffdeaf0726b1312c","cipherparams":{"iv":"fbf93718a57f26051b292f072f2e5b41"},"cipher":"aes-128-ctr","kdf":"scrypt","kdfparams":{"dklen":32,"salt":"7ffe00488319dec48e4c49a120ca49c6afbde9272854c64d9541c83fc6acdffe","n":8192,"r":8,"p":1},"mac":"2adfd9c4bc1cdac4c85bddfb31d9e21a684e0e050247a70c5698facf6b7d4681"}}'; - - describe('private key import', function () { - it('imports a private key and strips 0x prefix', async function () { - const importPrivKey = await accountImporter.importAccount('Private Key', [ - privkey, - ]); - assert.equal(importPrivKey, stripHexPrefix(privkey)); - }); - - it('throws an error for empty string private key', async function () { - await assert.rejects( - async () => { - await accountImporter.importAccount('Private Key', ['']); - }, - Error, - 'no empty strings', - ); - }); - - it('throws an error for undefined string private key', async function () { - await assert.rejects(async () => { - await accountImporter.importAccount('Private Key', [undefined]); - }); - - await assert.rejects(async () => { - await accountImporter.importAccount('Private Key', []); - }); - }); - - it('throws an error for invalid private key', async function () { - await assert.rejects(async () => { - await accountImporter.importAccount('Private Key', ['popcorn']); - }); - }); - }); - - describe('JSON keystore import', function () { - it('fails when password is incorrect for keystore', async function () { - const wrongPassword = 'password2'; - - try { - await accountImporter.importAccount('JSON File', [json, wrongPassword]); - } catch (error) { - assert.equal( - error.message, - 'Key derivation failed - possibly wrong passphrase', - ); - } - }); - - it('imports json string and password to return a private key', async function () { - const fileContentsPassword = 'password1'; - const importJson = await accountImporter.importAccount('JSON File', [ - json, - fileContentsPassword, - ]); - assert.equal( - importJson, - '0x5733876abe94146069ce8bcbabbde2677f2e35fa33e875e92041ed2ac87e5bc7', - ); - }); - }); -}); diff --git a/app/scripts/account-import-strategies/index.js b/app/scripts/account-import-strategies/index.js deleted file mode 100644 index 286452c5a76d..000000000000 --- a/app/scripts/account-import-strategies/index.js +++ /dev/null @@ -1,75 +0,0 @@ -import { isValidMnemonic } from '@ethersproject/hdnode'; -import { - bufferToHex, - getBinarySize, - isValidPrivate, - toBuffer, -} from 'ethereumjs-util'; -import Wallet from 'ethereumjs-wallet'; -import importers from 'ethereumjs-wallet/thirdparty'; -import log from 'loglevel'; -import { stripHexPrefix } from '../../../shared/modules/hexstring-utils'; -import { addHexPrefix } from '../lib/util'; - -const accountImporter = { - async importAccount(strategy, args) { - const importer = this.strategies[strategy]; - const privateKeyHex = importer(...args); - return privateKeyHex; - }, - - strategies: { - 'Private Key': (privateKey) => { - if (!privateKey) { - throw new Error('Cannot import an empty key.'); // It should never get here, because this should be stopped in the UI - } - - // Check if the user has entered an SRP by mistake instead of a private key - if (isValidMnemonic(privateKey.trim())) { - throw new Error(`t('importAccountErrorIsSRP')`); - } - - const trimmedPrivateKey = privateKey.replace(/\s+/gu, ''); // Remove all whitespace - - const prefixedPrivateKey = addHexPrefix(trimmedPrivateKey); - let buffer; - try { - buffer = toBuffer(prefixedPrivateKey); - } catch (e) { - throw new Error(`t('importAccountErrorNotHexadecimal')`); - } - - try { - if ( - !isValidPrivate(buffer) || - getBinarySize(prefixedPrivateKey) !== 64 + '0x'.length // Fixes issue #17719 -- isValidPrivate() will let a key of 63 hex digits through without complaining, this line ensures 64 hex digits + '0x' = 66 digits - ) { - throw new Error(`t('importAccountErrorNotAValidPrivateKey')`); - } - } catch (e) { - throw new Error(`t('importAccountErrorNotAValidPrivateKey')`); - } - - const strippedPrivateKey = stripHexPrefix(prefixedPrivateKey); - return strippedPrivateKey; - }, - 'JSON File': (input, password) => { - let wallet; - try { - wallet = importers.fromEtherWallet(input, password); - } catch (e) { - log.debug('Attempt to import as EtherWallet format failed, trying V3'); - wallet = Wallet.fromV3(input, password, true); - } - - return walletToPrivateKey(wallet); - }, - }, -}; - -function walletToPrivateKey(wallet) { - const privateKeyBuffer = wallet.getPrivateKey(); - return bufferToHex(privateKeyBuffer); -} - -export default accountImporter; diff --git a/app/scripts/metamask-controller.actions.test.js b/app/scripts/metamask-controller.actions.test.js index 397648c371da..8c015c9c5c63 100644 --- a/app/scripts/metamask-controller.actions.test.js +++ b/app/scripts/metamask-controller.actions.test.js @@ -172,14 +172,14 @@ describe('MetaMaskController', function () { await metamaskController.createNewVaultAndKeychain('test@123'); await Promise.all([ - metamaskController.importAccountWithStrategy('Private Key', [ + metamaskController.importAccountWithStrategy('privateKey', [ importPrivkey, ]), Promise.resolve(1).then(() => { keyringControllerState1 = JSON.stringify( metamaskController.keyringController.memStore.getState(), ); - metamaskController.importAccountWithStrategy('Private Key', [ + metamaskController.importAccountWithStrategy('privateKey', [ importPrivkey, ]); }), diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 366556d359e8..ba5b6e7a395c 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -190,7 +190,6 @@ import DecryptMessageController from './controllers/decrypt-message'; import TransactionController from './controllers/transactions'; import DetectTokensController from './controllers/detect-tokens'; import SwapsController from './controllers/swaps'; -import accountImporter from './account-import-strategies'; import seedPhraseVerifier from './lib/seed-phrase-verifier'; import MetaMetricsController from './controllers/metametrics'; import { segment } from './lib/segment'; @@ -3548,21 +3547,17 @@ export default class MetamaskController extends EventEmitter { * These are defined in app/scripts/account-import-strategies * Each strategy represents a different way of serializing an Ethereum key pair. * - * @param {string} strategy - A unique identifier for an account import strategy. + * @param {'privateKey' | 'json'} strategy - A unique identifier for an account import strategy. * @param {any} args - The data required by that strategy to import an account. */ async importAccountWithStrategy(strategy, args) { - const privateKey = await accountImporter.importAccount(strategy, args); - const keyring = await this.keyringController.addNewKeyring( - KeyringType.imported, - [privateKey], - ); - const [firstAccount] = await keyring.getAccounts(); - // update accounts in preferences controller - const allAccounts = await this.keyringController.getAccounts(); - this.preferencesController.setAddresses(allAccounts); + const { importedAccountAddress } = + await this.coreKeyringController.importAccountWithStrategy( + strategy, + args, + ); // set new account as selected - this.preferencesController.setSelectedAddress(firstAccount); + this.preferencesController.setSelectedAddress(importedAccountAddress); } // --------------------------------------------------------------------------- diff --git a/app/scripts/metamask-controller.test.js b/app/scripts/metamask-controller.test.js index f2c3fa6adeeb..20f496abaed0 100644 --- a/app/scripts/metamask-controller.test.js +++ b/app/scripts/metamask-controller.test.js @@ -326,7 +326,7 @@ describe('MetaMaskController', function () { beforeEach(async function () { const password = 'a-fake-password'; await metamaskController.createNewVaultAndRestore(password, TEST_SEED); - await metamaskController.importAccountWithStrategy('Private Key', [ + await metamaskController.importAccountWithStrategy('privateKey', [ importPrivkey, ]); }); diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 3207a448f667..988aa2cfc7f4 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -107,9 +107,14 @@ }, "@ensdomains/content-hash>multihashes>multibase": { "packages": { + "@ensdomains/content-hash>multihashes>multibase>base-x": true, "@ensdomains/content-hash>multihashes>web-encoding": true, - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "browserify>buffer": true + } + }, + "@ensdomains/content-hash>multihashes>multibase>base-x": { + "packages": { + "koa>content-disposition>safe-buffer": true } }, "@ensdomains/content-hash>multihashes>web-encoding": { @@ -492,17 +497,17 @@ "packages": { "@ngraveio/bc-ur": true, "browserify>buffer": true, - "ethereumjs-wallet>bs58check": true, - "mockttp>graphql-tag>tslib": true + "ethereumjs-util>ethereum-cryptography>bs58check": true, + "wait-on>rxjs>tslib": true } }, "@keystonehq/bc-ur-registry-eth>hdkey": { "packages": { "browserify>assert": true, "browserify>crypto-browserify": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@keystonehq/metamask-airgapped-keyring": { @@ -1035,7 +1040,7 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "browserify>buffer": true, "browserify>events": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": { @@ -1105,7 +1110,7 @@ "@metamask/eth-trezor-keyring>hdkey>coinstring": true, "browserify>assert": true, "browserify>crypto-browserify": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": { @@ -1409,7 +1414,7 @@ "@metamask/eth-trezor-keyring>hdkey>secp256k1": true, "browserify>assert": true, "browserify>crypto-browserify": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/eth-trezor-keyring>hdkey>coinstring": { @@ -1431,7 +1436,7 @@ }, "@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/etherscan-link": { @@ -1583,11 +1588,11 @@ "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, + "eth-lattice-keyring>gridplus-sdk>aes-js": true, "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>scrypt-js": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, + "mocha>serialize-javascript>randombytes": true, "uuid": true } }, @@ -2486,9 +2491,9 @@ "bn.js": true, "browserify>buffer": true, "ethereumjs-util": true, - "ethereumjs-wallet>randombytes": true, "ethjs>ethjs-unit": true, - "ethjs>number-to-bn": true + "ethjs>number-to-bn": true, + "mocha>serialize-javascript>randombytes": true } }, "@truffle/codec>web3-utils>ethereum-bloom-filters": { @@ -2547,7 +2552,7 @@ "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>js-sha3": true, "browserify>buffer": true, "eth-ens-namehash": true, - "ethereumjs-wallet>bs58check>bs58": true + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>@ensdomains/address-encoder": { @@ -2580,8 +2585,8 @@ }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>cids>multibase": { "packages": { - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "@ensdomains/content-hash>multihashes>multibase>base-x": true, + "browserify>buffer": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>cids>multicodec": { @@ -2605,8 +2610,8 @@ }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>multihashes>multibase": { "packages": { - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "@ensdomains/content-hash>multihashes>multibase>base-x": true, + "browserify>buffer": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>ethers": { @@ -2770,7 +2775,7 @@ }, "addons-linter>sha.js": { "packages": { - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -2860,7 +2865,7 @@ "browserify>crypto-browserify>public-encrypt": true, "browserify>crypto-browserify>randomfill": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>browserify-cipher": { @@ -2887,7 +2892,7 @@ "browserify>crypto-browserify>browserify-cipher>evp_bytestokey": { "packages": { "ethereumjs-util>create-hash>md5.js": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>crypto-browserify>browserify-sign": { @@ -2916,7 +2921,7 @@ "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -2925,7 +2930,7 @@ "bn.js": true, "browserify>buffer": true, "browserify>crypto-browserify>diffie-hellman>miller-rabin": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>diffie-hellman>miller-rabin": { @@ -2947,7 +2952,7 @@ "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>crypto-browserify>public-encrypt": { @@ -2957,14 +2962,14 @@ "browserify>crypto-browserify>public-encrypt>browserify-rsa": true, "browserify>crypto-browserify>public-encrypt>parse-asn1": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>public-encrypt>browserify-rsa": { "packages": { "bn.js": true, "browserify>buffer": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>public-encrypt>parse-asn1": { @@ -2992,8 +2997,8 @@ }, "packages": { "browserify>process": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true } }, "browserify>events": { @@ -3078,7 +3083,7 @@ }, "browserify>string_decoder": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>timers-browserify": { @@ -3347,6 +3352,7 @@ "browserify>buffer": true, "eth-lattice-keyring>gridplus-sdk>@ethereumjs/common": true, "eth-lattice-keyring>gridplus-sdk>@ethereumjs/tx": true, + "eth-lattice-keyring>gridplus-sdk>aes-js": true, "eth-lattice-keyring>gridplus-sdk>bech32": true, "eth-lattice-keyring>gridplus-sdk>bignumber.js": true, "eth-lattice-keyring>gridplus-sdk>bitwise": true, @@ -3356,6 +3362,7 @@ "eth-lattice-keyring>gridplus-sdk>rlp": true, "eth-lattice-keyring>gridplus-sdk>secp256k1": true, "eth-lattice-keyring>gridplus-sdk>uuid": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-wallet>aes-js": true, "ethereumjs-wallet>bs58check": true, @@ -3405,6 +3412,11 @@ "crypto": true } }, + "eth-lattice-keyring>gridplus-sdk>aes-js": { + "globals": { + "define": true + } + }, "eth-lattice-keyring>gridplus-sdk>bignumber.js": { "globals": { "crypto": true, @@ -3603,21 +3615,21 @@ "packages": { "browserify>stream-browserify": true, "browserify>string_decoder": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, "ethereumjs-util>create-hash>md5.js": { "packages": { "ethereumjs-util>create-hash>md5.js>hash-base": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, "ethereumjs-util>create-hash>md5.js>hash-base": { "packages": { "ethereumjs-util>create-hash>md5.js>hash-base>readable-stream": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3644,12 +3656,12 @@ "browserify>assert": true, "browserify>buffer": true, "browserify>crypto-browserify>create-hmac": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-util>ethereum-cryptography>keccak": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true } }, "ethereumjs-util>ethereum-cryptography>browserify-aes": { @@ -3658,7 +3670,7 @@ "browserify>crypto-browserify>browserify-cipher>evp_bytestokey": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>ethereum-cryptography>browserify-aes>buffer-xor": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3667,6 +3679,18 @@ "browserify>buffer": true } }, + "ethereumjs-util>ethereum-cryptography>bs58check": { + "packages": { + "ethereumjs-util>create-hash": true, + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": true, + "koa>content-disposition>safe-buffer": true + } + }, + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": { + "packages": { + "@ensdomains/content-hash>multihashes>multibase>base-x": true + } + }, "ethereumjs-util>ethereum-cryptography>hash.js": { "packages": { "@metamask/ppom-validator>elliptic>minimalistic-assert": true, @@ -3759,29 +3783,7 @@ }, "ethereumjs-wallet>randombytes": { "globals": { - "crypto": true, - "msCrypto": true - }, - "packages": { - "browserify>process": true, - "ethereumjs-wallet>safe-buffer": true - } - }, - "ethereumjs-wallet>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "ethereumjs-wallet>scryptsy": { - "packages": { - "browserify>buffer": true, - "browserify>crypto-browserify>pbkdf2": true - } - }, - "ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true + "crypto.getRandomValues": true } }, "ethers>@ethersproject/random": { @@ -3980,6 +3982,11 @@ "readable-stream": true } }, + "koa>content-disposition>safe-buffer": { + "packages": { + "browserify>buffer": true + } + }, "koa>is-generator-function>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true @@ -4040,9 +4047,14 @@ "Intl": true } }, - "mockttp>graphql-tag>tslib": { + "mocha>serialize-javascript>randombytes": { "globals": { - "define": true + "crypto": true, + "msCrypto": true + }, + "packages": { + "browserify>process": true, + "koa>content-disposition>safe-buffer": true } }, "nanoid": { @@ -4653,4 +4665,4 @@ } } } -} \ No newline at end of file +} diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index cc3765332f8c..9e68134afd57 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -107,9 +107,14 @@ }, "@ensdomains/content-hash>multihashes>multibase": { "packages": { + "@ensdomains/content-hash>multihashes>multibase>base-x": true, "@ensdomains/content-hash>multihashes>web-encoding": true, - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "browserify>buffer": true + } + }, + "@ensdomains/content-hash>multihashes>multibase>base-x": { + "packages": { + "koa>content-disposition>safe-buffer": true } }, "@ensdomains/content-hash>multihashes>web-encoding": { @@ -492,17 +497,17 @@ "packages": { "@ngraveio/bc-ur": true, "browserify>buffer": true, - "ethereumjs-wallet>bs58check": true, - "mockttp>graphql-tag>tslib": true + "ethereumjs-util>ethereum-cryptography>bs58check": true, + "wait-on>rxjs>tslib": true } }, "@keystonehq/bc-ur-registry-eth>hdkey": { "packages": { "browserify>assert": true, "browserify>crypto-browserify": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@keystonehq/metamask-airgapped-keyring": { @@ -1106,7 +1111,7 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "browserify>buffer": true, "browserify>events": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": { @@ -1176,7 +1181,7 @@ "@metamask/eth-trezor-keyring>hdkey>coinstring": true, "browserify>assert": true, "browserify>crypto-browserify": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": { @@ -1537,7 +1542,7 @@ "@metamask/eth-trezor-keyring>hdkey>secp256k1": true, "browserify>assert": true, "browserify>crypto-browserify": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/eth-trezor-keyring>hdkey>coinstring": { @@ -1559,7 +1564,7 @@ }, "@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/etherscan-link": { @@ -1734,11 +1739,11 @@ "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, + "eth-lattice-keyring>gridplus-sdk>aes-js": true, "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>scrypt-js": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, + "mocha>serialize-javascript>randombytes": true, "uuid": true } }, @@ -3021,9 +3026,9 @@ "bn.js": true, "browserify>buffer": true, "ethereumjs-util": true, - "ethereumjs-wallet>randombytes": true, "ethjs>ethjs-unit": true, - "ethjs>number-to-bn": true + "ethjs>number-to-bn": true, + "mocha>serialize-javascript>randombytes": true } }, "@truffle/codec>web3-utils>ethereum-bloom-filters": { @@ -3082,7 +3087,7 @@ "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>js-sha3": true, "browserify>buffer": true, "eth-ens-namehash": true, - "ethereumjs-wallet>bs58check>bs58": true + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>@ensdomains/address-encoder": { @@ -3115,8 +3120,8 @@ }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>cids>multibase": { "packages": { - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "@ensdomains/content-hash>multihashes>multibase>base-x": true, + "browserify>buffer": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>cids>multicodec": { @@ -3140,8 +3145,8 @@ }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>multihashes>multibase": { "packages": { - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "@ensdomains/content-hash>multihashes>multibase>base-x": true, + "browserify>buffer": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>ethers": { @@ -3305,7 +3310,7 @@ }, "addons-linter>sha.js": { "packages": { - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3395,7 +3400,7 @@ "browserify>crypto-browserify>public-encrypt": true, "browserify>crypto-browserify>randomfill": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>browserify-cipher": { @@ -3422,7 +3427,7 @@ "browserify>crypto-browserify>browserify-cipher>evp_bytestokey": { "packages": { "ethereumjs-util>create-hash>md5.js": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>crypto-browserify>browserify-sign": { @@ -3451,7 +3456,7 @@ "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3460,7 +3465,7 @@ "bn.js": true, "browserify>buffer": true, "browserify>crypto-browserify>diffie-hellman>miller-rabin": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>diffie-hellman>miller-rabin": { @@ -3482,7 +3487,7 @@ "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>crypto-browserify>public-encrypt": { @@ -3492,14 +3497,14 @@ "browserify>crypto-browserify>public-encrypt>browserify-rsa": true, "browserify>crypto-browserify>public-encrypt>parse-asn1": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>public-encrypt>browserify-rsa": { "packages": { "bn.js": true, "browserify>buffer": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>public-encrypt>parse-asn1": { @@ -3527,8 +3532,8 @@ }, "packages": { "browserify>process": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true } }, "browserify>events": { @@ -3613,7 +3618,7 @@ }, "browserify>string_decoder": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>timers-browserify": { @@ -3898,6 +3903,7 @@ "browserify>buffer": true, "eth-lattice-keyring>gridplus-sdk>@ethereumjs/common": true, "eth-lattice-keyring>gridplus-sdk>@ethereumjs/tx": true, + "eth-lattice-keyring>gridplus-sdk>aes-js": true, "eth-lattice-keyring>gridplus-sdk>bech32": true, "eth-lattice-keyring>gridplus-sdk>bignumber.js": true, "eth-lattice-keyring>gridplus-sdk>bitwise": true, @@ -3907,6 +3913,7 @@ "eth-lattice-keyring>gridplus-sdk>rlp": true, "eth-lattice-keyring>gridplus-sdk>secp256k1": true, "eth-lattice-keyring>gridplus-sdk>uuid": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-wallet>aes-js": true, "ethereumjs-wallet>bs58check": true, @@ -3956,6 +3963,11 @@ "crypto": true } }, + "eth-lattice-keyring>gridplus-sdk>aes-js": { + "globals": { + "define": true + } + }, "eth-lattice-keyring>gridplus-sdk>bignumber.js": { "globals": { "crypto": true, @@ -4154,21 +4166,21 @@ "packages": { "browserify>stream-browserify": true, "browserify>string_decoder": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, "ethereumjs-util>create-hash>md5.js": { "packages": { "ethereumjs-util>create-hash>md5.js>hash-base": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, "ethereumjs-util>create-hash>md5.js>hash-base": { "packages": { "ethereumjs-util>create-hash>md5.js>hash-base>readable-stream": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -4195,12 +4207,12 @@ "browserify>assert": true, "browserify>buffer": true, "browserify>crypto-browserify>create-hmac": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-util>ethereum-cryptography>keccak": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true } }, "ethereumjs-util>ethereum-cryptography>browserify-aes": { @@ -4209,7 +4221,7 @@ "browserify>crypto-browserify>browserify-cipher>evp_bytestokey": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>ethereum-cryptography>browserify-aes>buffer-xor": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -4218,6 +4230,18 @@ "browserify>buffer": true } }, + "ethereumjs-util>ethereum-cryptography>bs58check": { + "packages": { + "ethereumjs-util>create-hash": true, + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": true, + "koa>content-disposition>safe-buffer": true + } + }, + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": { + "packages": { + "@ensdomains/content-hash>multihashes>multibase>base-x": true + } + }, "ethereumjs-util>ethereum-cryptography>hash.js": { "packages": { "@metamask/ppom-validator>elliptic>minimalistic-assert": true, @@ -4310,29 +4334,7 @@ }, "ethereumjs-wallet>randombytes": { "globals": { - "crypto": true, - "msCrypto": true - }, - "packages": { - "browserify>process": true, - "ethereumjs-wallet>safe-buffer": true - } - }, - "ethereumjs-wallet>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "ethereumjs-wallet>scryptsy": { - "packages": { - "browserify>buffer": true, - "browserify>crypto-browserify>pbkdf2": true - } - }, - "ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true + "crypto.getRandomValues": true } }, "ethers>@ethersproject/random": { @@ -4531,6 +4533,11 @@ "readable-stream": true } }, + "koa>content-disposition>safe-buffer": { + "packages": { + "browserify>buffer": true + } + }, "koa>is-generator-function>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true @@ -4609,9 +4616,14 @@ "readable-stream>util-deprecate": true } }, - "mockttp>graphql-tag>tslib": { + "mocha>serialize-javascript>randombytes": { "globals": { - "define": true + "crypto": true, + "msCrypto": true + }, + "packages": { + "browserify>process": true, + "koa>content-disposition>safe-buffer": true } }, "nanoid": { @@ -5346,4 +5358,4 @@ } } } -} \ No newline at end of file +} diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 08100deb2ff1..42aab6589446 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -107,9 +107,14 @@ }, "@ensdomains/content-hash>multihashes>multibase": { "packages": { + "@ensdomains/content-hash>multihashes>multibase>base-x": true, "@ensdomains/content-hash>multihashes>web-encoding": true, - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "browserify>buffer": true + } + }, + "@ensdomains/content-hash>multihashes>multibase>base-x": { + "packages": { + "koa>content-disposition>safe-buffer": true } }, "@ensdomains/content-hash>multihashes>web-encoding": { @@ -492,17 +497,17 @@ "packages": { "@ngraveio/bc-ur": true, "browserify>buffer": true, - "ethereumjs-wallet>bs58check": true, - "mockttp>graphql-tag>tslib": true + "ethereumjs-util>ethereum-cryptography>bs58check": true, + "wait-on>rxjs>tslib": true } }, "@keystonehq/bc-ur-registry-eth>hdkey": { "packages": { "browserify>assert": true, "browserify>crypto-browserify": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@keystonehq/metamask-airgapped-keyring": { @@ -1106,7 +1111,7 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "browserify>buffer": true, "browserify>events": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": { @@ -1176,7 +1181,7 @@ "@metamask/eth-trezor-keyring>hdkey>coinstring": true, "browserify>assert": true, "browserify>crypto-browserify": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": { @@ -1537,7 +1542,7 @@ "@metamask/eth-trezor-keyring>hdkey>secp256k1": true, "browserify>assert": true, "browserify>crypto-browserify": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/eth-trezor-keyring>hdkey>coinstring": { @@ -1559,7 +1564,7 @@ }, "@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/etherscan-link": { @@ -1734,11 +1739,11 @@ "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, + "eth-lattice-keyring>gridplus-sdk>aes-js": true, "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>scrypt-js": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, + "mocha>serialize-javascript>randombytes": true, "uuid": true } }, @@ -3036,9 +3041,9 @@ "bn.js": true, "browserify>buffer": true, "ethereumjs-util": true, - "ethereumjs-wallet>randombytes": true, "ethjs>ethjs-unit": true, - "ethjs>number-to-bn": true + "ethjs>number-to-bn": true, + "mocha>serialize-javascript>randombytes": true } }, "@truffle/codec>web3-utils>ethereum-bloom-filters": { @@ -3097,7 +3102,7 @@ "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>js-sha3": true, "browserify>buffer": true, "eth-ens-namehash": true, - "ethereumjs-wallet>bs58check>bs58": true + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>@ensdomains/address-encoder": { @@ -3130,8 +3135,8 @@ }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>cids>multibase": { "packages": { - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "@ensdomains/content-hash>multihashes>multibase>base-x": true, + "browserify>buffer": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>cids>multicodec": { @@ -3155,8 +3160,8 @@ }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>multihashes>multibase": { "packages": { - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "@ensdomains/content-hash>multihashes>multibase>base-x": true, + "browserify>buffer": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>ethers": { @@ -3320,7 +3325,7 @@ }, "addons-linter>sha.js": { "packages": { - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3410,7 +3415,7 @@ "browserify>crypto-browserify>public-encrypt": true, "browserify>crypto-browserify>randomfill": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>browserify-cipher": { @@ -3437,7 +3442,7 @@ "browserify>crypto-browserify>browserify-cipher>evp_bytestokey": { "packages": { "ethereumjs-util>create-hash>md5.js": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>crypto-browserify>browserify-sign": { @@ -3466,7 +3471,7 @@ "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3475,7 +3480,7 @@ "bn.js": true, "browserify>buffer": true, "browserify>crypto-browserify>diffie-hellman>miller-rabin": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>diffie-hellman>miller-rabin": { @@ -3497,7 +3502,7 @@ "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>crypto-browserify>public-encrypt": { @@ -3507,14 +3512,14 @@ "browserify>crypto-browserify>public-encrypt>browserify-rsa": true, "browserify>crypto-browserify>public-encrypt>parse-asn1": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>public-encrypt>browserify-rsa": { "packages": { "bn.js": true, "browserify>buffer": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>public-encrypt>parse-asn1": { @@ -3542,8 +3547,8 @@ }, "packages": { "browserify>process": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true } }, "browserify>events": { @@ -3628,7 +3633,7 @@ }, "browserify>string_decoder": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>timers-browserify": { @@ -3913,6 +3918,7 @@ "browserify>buffer": true, "eth-lattice-keyring>gridplus-sdk>@ethereumjs/common": true, "eth-lattice-keyring>gridplus-sdk>@ethereumjs/tx": true, + "eth-lattice-keyring>gridplus-sdk>aes-js": true, "eth-lattice-keyring>gridplus-sdk>bech32": true, "eth-lattice-keyring>gridplus-sdk>bignumber.js": true, "eth-lattice-keyring>gridplus-sdk>bitwise": true, @@ -3922,6 +3928,7 @@ "eth-lattice-keyring>gridplus-sdk>rlp": true, "eth-lattice-keyring>gridplus-sdk>secp256k1": true, "eth-lattice-keyring>gridplus-sdk>uuid": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-wallet>aes-js": true, "ethereumjs-wallet>bs58check": true, @@ -3971,6 +3978,11 @@ "crypto": true } }, + "eth-lattice-keyring>gridplus-sdk>aes-js": { + "globals": { + "define": true + } + }, "eth-lattice-keyring>gridplus-sdk>bignumber.js": { "globals": { "crypto": true, @@ -4169,21 +4181,21 @@ "packages": { "browserify>stream-browserify": true, "browserify>string_decoder": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, "ethereumjs-util>create-hash>md5.js": { "packages": { "ethereumjs-util>create-hash>md5.js>hash-base": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, "ethereumjs-util>create-hash>md5.js>hash-base": { "packages": { "ethereumjs-util>create-hash>md5.js>hash-base>readable-stream": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -4210,12 +4222,12 @@ "browserify>assert": true, "browserify>buffer": true, "browserify>crypto-browserify>create-hmac": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-util>ethereum-cryptography>keccak": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true } }, "ethereumjs-util>ethereum-cryptography>browserify-aes": { @@ -4224,7 +4236,7 @@ "browserify>crypto-browserify>browserify-cipher>evp_bytestokey": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>ethereum-cryptography>browserify-aes>buffer-xor": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -4233,6 +4245,18 @@ "browserify>buffer": true } }, + "ethereumjs-util>ethereum-cryptography>bs58check": { + "packages": { + "ethereumjs-util>create-hash": true, + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": true, + "koa>content-disposition>safe-buffer": true + } + }, + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": { + "packages": { + "@ensdomains/content-hash>multihashes>multibase>base-x": true + } + }, "ethereumjs-util>ethereum-cryptography>hash.js": { "packages": { "@metamask/ppom-validator>elliptic>minimalistic-assert": true, @@ -4325,29 +4349,7 @@ }, "ethereumjs-wallet>randombytes": { "globals": { - "crypto": true, - "msCrypto": true - }, - "packages": { - "browserify>process": true, - "ethereumjs-wallet>safe-buffer": true - } - }, - "ethereumjs-wallet>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "ethereumjs-wallet>scryptsy": { - "packages": { - "browserify>buffer": true, - "browserify>crypto-browserify>pbkdf2": true - } - }, - "ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true + "crypto.getRandomValues": true } }, "ethers>@ethersproject/random": { @@ -4546,6 +4548,11 @@ "readable-stream": true } }, + "koa>content-disposition>safe-buffer": { + "packages": { + "browserify>buffer": true + } + }, "koa>is-generator-function>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true @@ -4624,9 +4631,14 @@ "readable-stream>util-deprecate": true } }, - "mockttp>graphql-tag>tslib": { + "mocha>serialize-javascript>randombytes": { "globals": { - "define": true + "crypto": true, + "msCrypto": true + }, + "packages": { + "browserify>process": true, + "koa>content-disposition>safe-buffer": true } }, "nanoid": { @@ -5361,4 +5373,4 @@ } } } -} \ No newline at end of file +} diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 3207a448f667..988aa2cfc7f4 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -107,9 +107,14 @@ }, "@ensdomains/content-hash>multihashes>multibase": { "packages": { + "@ensdomains/content-hash>multihashes>multibase>base-x": true, "@ensdomains/content-hash>multihashes>web-encoding": true, - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "browserify>buffer": true + } + }, + "@ensdomains/content-hash>multihashes>multibase>base-x": { + "packages": { + "koa>content-disposition>safe-buffer": true } }, "@ensdomains/content-hash>multihashes>web-encoding": { @@ -492,17 +497,17 @@ "packages": { "@ngraveio/bc-ur": true, "browserify>buffer": true, - "ethereumjs-wallet>bs58check": true, - "mockttp>graphql-tag>tslib": true + "ethereumjs-util>ethereum-cryptography>bs58check": true, + "wait-on>rxjs>tslib": true } }, "@keystonehq/bc-ur-registry-eth>hdkey": { "packages": { "browserify>assert": true, "browserify>crypto-browserify": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@keystonehq/metamask-airgapped-keyring": { @@ -1035,7 +1040,7 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "browserify>buffer": true, "browserify>events": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": { @@ -1105,7 +1110,7 @@ "@metamask/eth-trezor-keyring>hdkey>coinstring": true, "browserify>assert": true, "browserify>crypto-browserify": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": { @@ -1409,7 +1414,7 @@ "@metamask/eth-trezor-keyring>hdkey>secp256k1": true, "browserify>assert": true, "browserify>crypto-browserify": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/eth-trezor-keyring>hdkey>coinstring": { @@ -1431,7 +1436,7 @@ }, "@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/etherscan-link": { @@ -1583,11 +1588,11 @@ "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, + "eth-lattice-keyring>gridplus-sdk>aes-js": true, "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>scrypt-js": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, + "mocha>serialize-javascript>randombytes": true, "uuid": true } }, @@ -2486,9 +2491,9 @@ "bn.js": true, "browserify>buffer": true, "ethereumjs-util": true, - "ethereumjs-wallet>randombytes": true, "ethjs>ethjs-unit": true, - "ethjs>number-to-bn": true + "ethjs>number-to-bn": true, + "mocha>serialize-javascript>randombytes": true } }, "@truffle/codec>web3-utils>ethereum-bloom-filters": { @@ -2547,7 +2552,7 @@ "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>js-sha3": true, "browserify>buffer": true, "eth-ens-namehash": true, - "ethereumjs-wallet>bs58check>bs58": true + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>@ensdomains/address-encoder": { @@ -2580,8 +2585,8 @@ }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>cids>multibase": { "packages": { - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "@ensdomains/content-hash>multihashes>multibase>base-x": true, + "browserify>buffer": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>cids>multicodec": { @@ -2605,8 +2610,8 @@ }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>multihashes>multibase": { "packages": { - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "@ensdomains/content-hash>multihashes>multibase>base-x": true, + "browserify>buffer": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>ethers": { @@ -2770,7 +2775,7 @@ }, "addons-linter>sha.js": { "packages": { - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -2860,7 +2865,7 @@ "browserify>crypto-browserify>public-encrypt": true, "browserify>crypto-browserify>randomfill": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>browserify-cipher": { @@ -2887,7 +2892,7 @@ "browserify>crypto-browserify>browserify-cipher>evp_bytestokey": { "packages": { "ethereumjs-util>create-hash>md5.js": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>crypto-browserify>browserify-sign": { @@ -2916,7 +2921,7 @@ "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -2925,7 +2930,7 @@ "bn.js": true, "browserify>buffer": true, "browserify>crypto-browserify>diffie-hellman>miller-rabin": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>diffie-hellman>miller-rabin": { @@ -2947,7 +2952,7 @@ "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>crypto-browserify>public-encrypt": { @@ -2957,14 +2962,14 @@ "browserify>crypto-browserify>public-encrypt>browserify-rsa": true, "browserify>crypto-browserify>public-encrypt>parse-asn1": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>public-encrypt>browserify-rsa": { "packages": { "bn.js": true, "browserify>buffer": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>public-encrypt>parse-asn1": { @@ -2992,8 +2997,8 @@ }, "packages": { "browserify>process": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true } }, "browserify>events": { @@ -3078,7 +3083,7 @@ }, "browserify>string_decoder": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>timers-browserify": { @@ -3347,6 +3352,7 @@ "browserify>buffer": true, "eth-lattice-keyring>gridplus-sdk>@ethereumjs/common": true, "eth-lattice-keyring>gridplus-sdk>@ethereumjs/tx": true, + "eth-lattice-keyring>gridplus-sdk>aes-js": true, "eth-lattice-keyring>gridplus-sdk>bech32": true, "eth-lattice-keyring>gridplus-sdk>bignumber.js": true, "eth-lattice-keyring>gridplus-sdk>bitwise": true, @@ -3356,6 +3362,7 @@ "eth-lattice-keyring>gridplus-sdk>rlp": true, "eth-lattice-keyring>gridplus-sdk>secp256k1": true, "eth-lattice-keyring>gridplus-sdk>uuid": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-wallet>aes-js": true, "ethereumjs-wallet>bs58check": true, @@ -3405,6 +3412,11 @@ "crypto": true } }, + "eth-lattice-keyring>gridplus-sdk>aes-js": { + "globals": { + "define": true + } + }, "eth-lattice-keyring>gridplus-sdk>bignumber.js": { "globals": { "crypto": true, @@ -3603,21 +3615,21 @@ "packages": { "browserify>stream-browserify": true, "browserify>string_decoder": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, "ethereumjs-util>create-hash>md5.js": { "packages": { "ethereumjs-util>create-hash>md5.js>hash-base": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, "ethereumjs-util>create-hash>md5.js>hash-base": { "packages": { "ethereumjs-util>create-hash>md5.js>hash-base>readable-stream": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3644,12 +3656,12 @@ "browserify>assert": true, "browserify>buffer": true, "browserify>crypto-browserify>create-hmac": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-util>ethereum-cryptography>keccak": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true } }, "ethereumjs-util>ethereum-cryptography>browserify-aes": { @@ -3658,7 +3670,7 @@ "browserify>crypto-browserify>browserify-cipher>evp_bytestokey": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>ethereum-cryptography>browserify-aes>buffer-xor": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3667,6 +3679,18 @@ "browserify>buffer": true } }, + "ethereumjs-util>ethereum-cryptography>bs58check": { + "packages": { + "ethereumjs-util>create-hash": true, + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": true, + "koa>content-disposition>safe-buffer": true + } + }, + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": { + "packages": { + "@ensdomains/content-hash>multihashes>multibase>base-x": true + } + }, "ethereumjs-util>ethereum-cryptography>hash.js": { "packages": { "@metamask/ppom-validator>elliptic>minimalistic-assert": true, @@ -3759,29 +3783,7 @@ }, "ethereumjs-wallet>randombytes": { "globals": { - "crypto": true, - "msCrypto": true - }, - "packages": { - "browserify>process": true, - "ethereumjs-wallet>safe-buffer": true - } - }, - "ethereumjs-wallet>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "ethereumjs-wallet>scryptsy": { - "packages": { - "browserify>buffer": true, - "browserify>crypto-browserify>pbkdf2": true - } - }, - "ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true + "crypto.getRandomValues": true } }, "ethers>@ethersproject/random": { @@ -3980,6 +3982,11 @@ "readable-stream": true } }, + "koa>content-disposition>safe-buffer": { + "packages": { + "browserify>buffer": true + } + }, "koa>is-generator-function>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true @@ -4040,9 +4047,14 @@ "Intl": true } }, - "mockttp>graphql-tag>tslib": { + "mocha>serialize-javascript>randombytes": { "globals": { - "define": true + "crypto": true, + "msCrypto": true + }, + "packages": { + "browserify>process": true, + "koa>content-disposition>safe-buffer": true } }, "nanoid": { @@ -4653,4 +4665,4 @@ } } } -} \ No newline at end of file +} diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index d8c191d6d6cc..bee6399393a0 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -107,9 +107,14 @@ }, "@ensdomains/content-hash>multihashes>multibase": { "packages": { + "@ensdomains/content-hash>multihashes>multibase>base-x": true, "@ensdomains/content-hash>multihashes>web-encoding": true, - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "browserify>buffer": true + } + }, + "@ensdomains/content-hash>multihashes>multibase>base-x": { + "packages": { + "koa>content-disposition>safe-buffer": true } }, "@ensdomains/content-hash>multihashes>web-encoding": { @@ -492,17 +497,17 @@ "packages": { "@ngraveio/bc-ur": true, "browserify>buffer": true, - "ethereumjs-wallet>bs58check": true, - "mockttp>graphql-tag>tslib": true + "ethereumjs-util>ethereum-cryptography>bs58check": true, + "wait-on>rxjs>tslib": true } }, "@keystonehq/bc-ur-registry-eth>hdkey": { "packages": { "browserify>assert": true, "browserify>crypto-browserify": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@keystonehq/metamask-airgapped-keyring": { @@ -905,7 +910,7 @@ "browserify>process": true, "browserify>stream-browserify": true, "browserify>util": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask-institutional/sdk>jsonwebtoken>jws>jwa": { @@ -914,7 +919,7 @@ "@metamask-institutional/sdk>jsonwebtoken>jws>jwa>ecdsa-sig-formatter": true, "browserify>crypto-browserify": true, "browserify>util": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask-institutional/sdk>jsonwebtoken>jws>jwa>buffer-equal-constant-time": { @@ -924,7 +929,7 @@ }, "@metamask-institutional/sdk>jsonwebtoken>jws>jwa>ecdsa-sig-formatter": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask-institutional/transaction-update": { @@ -1263,7 +1268,7 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "browserify>buffer": true, "browserify>events": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "@metamask/eth-keyring-controller>@metamask/eth-simple-keyring>ethereum-cryptography": { @@ -1333,7 +1338,7 @@ "@metamask/eth-trezor-keyring>hdkey>coinstring": true, "browserify>assert": true, "browserify>crypto-browserify": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/eth-ledger-bridge-keyring>hdkey>secp256k1": { @@ -1637,7 +1642,7 @@ "@metamask/eth-trezor-keyring>hdkey>secp256k1": true, "browserify>assert": true, "browserify>crypto-browserify": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/eth-trezor-keyring>hdkey>coinstring": { @@ -1659,7 +1664,7 @@ }, "@metamask/eth-trezor-keyring>hdkey>secp256k1>bip66": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "@metamask/etherscan-link": { @@ -1811,11 +1816,11 @@ "@truffle/codec>utf8": true, "browserify>buffer": true, "browserify>crypto-browserify": true, + "eth-lattice-keyring>gridplus-sdk>aes-js": true, "ethereumjs-util>ethereum-cryptography": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>scrypt-js": true, - "ethereumjs-wallet>aes-js": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, + "mocha>serialize-javascript>randombytes": true, "uuid": true } }, @@ -2714,9 +2719,9 @@ "bn.js": true, "browserify>buffer": true, "ethereumjs-util": true, - "ethereumjs-wallet>randombytes": true, "ethjs>ethjs-unit": true, - "ethjs>number-to-bn": true + "ethjs>number-to-bn": true, + "mocha>serialize-javascript>randombytes": true } }, "@truffle/codec>web3-utils>ethereum-bloom-filters": { @@ -2775,7 +2780,7 @@ "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>js-sha3": true, "browserify>buffer": true, "eth-ens-namehash": true, - "ethereumjs-wallet>bs58check>bs58": true + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>@ensdomains/address-encoder": { @@ -2808,8 +2813,8 @@ }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>cids>multibase": { "packages": { - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "@ensdomains/content-hash>multihashes>multibase>base-x": true, + "browserify>buffer": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>cids>multicodec": { @@ -2833,8 +2838,8 @@ }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>content-hash>multihashes>multibase": { "packages": { - "browserify>buffer": true, - "ethereumjs-wallet>bs58check>bs58>base-x": true + "@ensdomains/content-hash>multihashes>multibase>base-x": true, + "browserify>buffer": true } }, "@truffle/decoder>@truffle/encoder>@ensdomains/ensjs>ethers": { @@ -2998,7 +3003,7 @@ }, "addons-linter>sha.js": { "packages": { - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3088,7 +3093,7 @@ "browserify>crypto-browserify>public-encrypt": true, "browserify>crypto-browserify>randomfill": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>browserify-cipher": { @@ -3115,7 +3120,7 @@ "browserify>crypto-browserify>browserify-cipher>evp_bytestokey": { "packages": { "ethereumjs-util>create-hash>md5.js": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>crypto-browserify>browserify-sign": { @@ -3144,7 +3149,7 @@ "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>create-hash>ripemd160": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3153,7 +3158,7 @@ "bn.js": true, "browserify>buffer": true, "browserify>crypto-browserify>diffie-hellman>miller-rabin": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>diffie-hellman>miller-rabin": { @@ -3175,7 +3180,7 @@ "browserify>process": true, "ethereumjs-util>create-hash": true, "ethereumjs-util>create-hash>ripemd160": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>crypto-browserify>public-encrypt": { @@ -3185,14 +3190,14 @@ "browserify>crypto-browserify>public-encrypt>browserify-rsa": true, "browserify>crypto-browserify>public-encrypt>parse-asn1": true, "ethereumjs-util>create-hash": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>public-encrypt>browserify-rsa": { "packages": { "bn.js": true, "browserify>buffer": true, - "ethereumjs-wallet>randombytes": true + "mocha>serialize-javascript>randombytes": true } }, "browserify>crypto-browserify>public-encrypt>parse-asn1": { @@ -3220,8 +3225,8 @@ }, "packages": { "browserify>process": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true } }, "browserify>events": { @@ -3306,7 +3311,7 @@ }, "browserify>string_decoder": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>timers-browserify": { @@ -3575,6 +3580,7 @@ "browserify>buffer": true, "eth-lattice-keyring>gridplus-sdk>@ethereumjs/common": true, "eth-lattice-keyring>gridplus-sdk>@ethereumjs/tx": true, + "eth-lattice-keyring>gridplus-sdk>aes-js": true, "eth-lattice-keyring>gridplus-sdk>bech32": true, "eth-lattice-keyring>gridplus-sdk>bignumber.js": true, "eth-lattice-keyring>gridplus-sdk>bitwise": true, @@ -3584,6 +3590,7 @@ "eth-lattice-keyring>gridplus-sdk>rlp": true, "eth-lattice-keyring>gridplus-sdk>secp256k1": true, "eth-lattice-keyring>gridplus-sdk>uuid": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-wallet>aes-js": true, "ethereumjs-wallet>bs58check": true, @@ -3633,6 +3640,11 @@ "crypto": true } }, + "eth-lattice-keyring>gridplus-sdk>aes-js": { + "globals": { + "define": true + } + }, "eth-lattice-keyring>gridplus-sdk>bignumber.js": { "globals": { "crypto": true, @@ -3831,21 +3843,21 @@ "packages": { "browserify>stream-browserify": true, "browserify>string_decoder": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, "ethereumjs-util>create-hash>md5.js": { "packages": { "ethereumjs-util>create-hash>md5.js>hash-base": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, "ethereumjs-util>create-hash>md5.js>hash-base": { "packages": { "ethereumjs-util>create-hash>md5.js>hash-base>readable-stream": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3872,12 +3884,12 @@ "browserify>assert": true, "browserify>buffer": true, "browserify>crypto-browserify>create-hmac": true, + "ethereumjs-util>ethereum-cryptography>bs58check": true, "ethereumjs-util>ethereum-cryptography>hash.js": true, "ethereumjs-util>ethereum-cryptography>keccak": true, "ethereumjs-util>ethereum-cryptography>secp256k1": true, - "ethereumjs-wallet>bs58check": true, - "ethereumjs-wallet>randombytes": true, - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true, + "mocha>serialize-javascript>randombytes": true } }, "ethereumjs-util>ethereum-cryptography>browserify-aes": { @@ -3886,7 +3898,7 @@ "browserify>crypto-browserify>browserify-cipher>evp_bytestokey": true, "ethereumjs-util>create-hash>cipher-base": true, "ethereumjs-util>ethereum-cryptography>browserify-aes>buffer-xor": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "pumpify>inherits": true } }, @@ -3895,6 +3907,18 @@ "browserify>buffer": true } }, + "ethereumjs-util>ethereum-cryptography>bs58check": { + "packages": { + "ethereumjs-util>create-hash": true, + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": true, + "koa>content-disposition>safe-buffer": true + } + }, + "ethereumjs-util>ethereum-cryptography>bs58check>bs58": { + "packages": { + "@ensdomains/content-hash>multihashes>multibase>base-x": true + } + }, "ethereumjs-util>ethereum-cryptography>hash.js": { "packages": { "@metamask/ppom-validator>elliptic>minimalistic-assert": true, @@ -3987,29 +4011,7 @@ }, "ethereumjs-wallet>randombytes": { "globals": { - "crypto": true, - "msCrypto": true - }, - "packages": { - "browserify>process": true, - "ethereumjs-wallet>safe-buffer": true - } - }, - "ethereumjs-wallet>safe-buffer": { - "packages": { - "browserify>buffer": true - } - }, - "ethereumjs-wallet>scryptsy": { - "packages": { - "browserify>buffer": true, - "browserify>crypto-browserify>pbkdf2": true - } - }, - "ethereumjs-wallet>uuid": { - "globals": { - "crypto": true, - "msCrypto": true + "crypto.getRandomValues": true } }, "ethers>@ethersproject/random": { @@ -4208,6 +4210,11 @@ "readable-stream": true } }, + "koa>content-disposition>safe-buffer": { + "packages": { + "browserify>buffer": true + } + }, "koa>is-generator-function>has-tostringtag": { "packages": { "string.prototype.matchall>has-symbols": true @@ -4268,9 +4275,14 @@ "Intl": true } }, - "mockttp>graphql-tag>tslib": { + "mocha>serialize-javascript>randombytes": { "globals": { - "define": true + "crypto": true, + "msCrypto": true + }, + "packages": { + "browserify>process": true, + "koa>content-disposition>safe-buffer": true } }, "nanoid": { @@ -4881,4 +4893,4 @@ } } } -} \ No newline at end of file +} diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 4db67787cc37..105920a0b050 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -1730,7 +1730,7 @@ "@lavamoat/lavapack>umd": true, "browserify>JSONStream": true, "browserify>browser-pack>through2": true, - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "watchify>defined": true } }, @@ -1947,7 +1947,7 @@ }, "browserify>string_decoder": { "packages": { - "ethereumjs-wallet>safe-buffer": true + "koa>content-disposition>safe-buffer": true } }, "browserify>syntax-error": { @@ -3273,11 +3273,6 @@ "eslint>strip-ansi>ansi-regex": true } }, - "ethereumjs-wallet>safe-buffer": { - "builtin": { - "buffer": true - } - }, "fancy-log": { "builtin": { "console.Console": true @@ -6064,9 +6059,9 @@ }, "gulp>vinyl-fs>remove-bom-stream": { "packages": { - "ethereumjs-wallet>safe-buffer": true, "gulp>vinyl-fs>remove-bom-buffer": true, - "gulp>vinyl-fs>remove-bom-stream>through2": true + "gulp>vinyl-fs>remove-bom-stream>through2": true, + "koa>content-disposition>safe-buffer": true } }, "gulp>vinyl-fs>remove-bom-stream>through2": { @@ -6166,10 +6161,9 @@ "process": true } }, - "jsdom>acorn": { - "globals": { - "console": true, - "define": true + "koa>content-disposition>safe-buffer": { + "builtin": { + "buffer": true } }, "koa>is-generator-function>has-tostringtag": { @@ -8751,7 +8745,7 @@ "util.inherits": true }, "packages": { - "ethereumjs-wallet>safe-buffer": true, + "koa>content-disposition>safe-buffer": true, "readable-stream": true } }, @@ -8992,4 +8986,4 @@ } } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 88a03d3bd9df..7ab36645ed2b 100644 --- a/package.json +++ b/package.json @@ -310,7 +310,6 @@ "ethereum-ens-network-map": "^1.0.2", "ethereumjs-abi": "^0.6.4", "ethereumjs-util": "^7.0.10", - "ethereumjs-wallet": "^0.6.4", "ethjs": "^0.4.0", "ethjs-contract": "^0.2.3", "ethjs-query": "^0.3.4", diff --git a/ui/components/multichain/import-account/import-account.js b/ui/components/multichain/import-account/import-account.js index 478a2e3acba1..6b266425b0af 100644 --- a/ui/components/multichain/import-account/import-account.js +++ b/ui/components/multichain/import-account/import-account.js @@ -79,7 +79,7 @@ export const ImportAccount = ({ onActionComplete }) => { } function getLoadingMessage(strategy) { - if (strategy === 'JSON File') { + if (strategy === 'json') { return ( <> diff --git a/ui/components/multichain/import-account/json.js b/ui/components/multichain/import-account/json.js index 7dd9e0235502..8ba5538323e4 100644 --- a/ui/components/multichain/import-account/json.js +++ b/ui/components/multichain/import-account/json.js @@ -46,7 +46,7 @@ export default function JsonImportSubview({ if (isPrimaryDisabled) { displayWarning(t('needImportFile')); } else { - importAccountFunc('JSON File', [fileContents, password]); + importAccountFunc('json', [fileContents, password]); } } diff --git a/ui/components/multichain/import-account/json.test.tsx b/ui/components/multichain/import-account/json.test.tsx index 26795e830185..5798b68f30dd 100644 --- a/ui/components/multichain/import-account/json.test.tsx +++ b/ui/components/multichain/import-account/json.test.tsx @@ -63,7 +63,7 @@ describe('Json', () => { fireEvent.click(importButton); await waitFor(() => { - expect(mockImportFunc).toHaveBeenCalledWith('JSON File', ['0', '']); + expect(mockImportFunc).toHaveBeenCalledWith('json', ['0', '']); }); }); @@ -102,10 +102,7 @@ describe('Json', () => { fireEvent.click(importButton); await waitFor(() => { - expect(mockImportFunc).toHaveBeenCalledWith('JSON File', [ - '0', - 'password', - ]); + expect(mockImportFunc).toHaveBeenCalledWith('json', ['0', 'password']); }); }); }); diff --git a/ui/components/multichain/import-account/private-key.js b/ui/components/multichain/import-account/private-key.js index 958b4ca8746a..ba0640d2e5f6 100644 --- a/ui/components/multichain/import-account/private-key.js +++ b/ui/components/multichain/import-account/private-key.js @@ -31,7 +31,7 @@ export default function PrivateKeyImportView({ } function _importAccountFunc() { - importAccountFunc('Private Key', [privateKey]); + importAccountFunc('privateKey', [privateKey]); } return ( diff --git a/yarn.lock b/yarn.lock index f9a0a9995956..983c29f6b89f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16278,23 +16278,6 @@ __metadata: languageName: node linkType: hard -"ethereumjs-wallet@npm:^0.6.4": - version: 0.6.5 - resolution: "ethereumjs-wallet@npm:0.6.5" - dependencies: - aes-js: "npm:^3.1.1" - bs58check: "npm:^2.1.2" - ethereum-cryptography: "npm:^0.1.3" - ethereumjs-util: "npm:^6.0.0" - randombytes: "npm:^2.0.6" - safe-buffer: "npm:^5.1.2" - scryptsy: "npm:^1.2.1" - utf8: "npm:^3.0.0" - uuid: "npm:^3.3.2" - checksum: 011d4205dfbf4c405b02fe77b7d4924ed39ab3124bc2d982cc436fd052ccf7392a1a408c704bf159d7fc5b000dfce254b313f7d5a224e6e950f2444de4904953 - languageName: node - linkType: hard - "ethereumjs-wallet@npm:^1.0.1": version: 1.0.2 resolution: "ethereumjs-wallet@npm:1.0.2" @@ -24419,7 +24402,6 @@ __metadata: ethereum-ens-network-map: "npm:^1.0.2" ethereumjs-abi: "npm:^0.6.4" ethereumjs-util: "npm:^7.0.10" - ethereumjs-wallet: "npm:^0.6.4" ethjs: "npm:^0.4.0" ethjs-contract: "npm:^0.2.3" ethjs-query: "npm:^0.3.4" @@ -28642,7 +28624,7 @@ __metadata: languageName: node linkType: hard -"randombytes@npm:2.1.0, randombytes@npm:^2.0.0, randombytes@npm:^2.0.1, randombytes@npm:^2.0.5, randombytes@npm:^2.0.6, randombytes@npm:^2.1.0": +"randombytes@npm:2.1.0, randombytes@npm:^2.0.0, randombytes@npm:^2.0.1, randombytes@npm:^2.0.5, randombytes@npm:^2.1.0": version: 2.1.0 resolution: "randombytes@npm:2.1.0" dependencies: @@ -30688,15 +30670,6 @@ __metadata: languageName: node linkType: hard -"scryptsy@npm:^1.2.1": - version: 1.2.1 - resolution: "scryptsy@npm:1.2.1" - dependencies: - pbkdf2: "npm:^3.0.3" - checksum: ec053305f1da3067269b36ac59f4a76aeb0b3dad1b9dd1b5438a60c9c93da8d09e3886a4dd2395450441df401774c41192c73700931ba38c0f77c000a384a434 - languageName: node - linkType: hard - "scss-parser@npm:^1.0.4": version: 1.0.5 resolution: "scss-parser@npm:1.0.5" @@ -34276,7 +34249,7 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^3.3.2, uuid@npm:^3.3.3": +"uuid@npm:^3.3.3": version: 3.4.0 resolution: "uuid@npm:3.4.0" bin: