diff --git a/app/scripts/migrations/105.test.ts b/app/scripts/migrations/105.test.ts index 944606043075..168fe8dd0916 100644 --- a/app/scripts/migrations/105.test.ts +++ b/app/scripts/migrations/105.test.ts @@ -72,6 +72,7 @@ function expectedInternalAccount( type: 'HD Key Tree', }, lastSelected: lastSelected ? expect.any(Number) : undefined, + importTime: 0, }, options: {}, methods: ETH_EOA_METHODS, diff --git a/app/scripts/migrations/105.ts b/app/scripts/migrations/105.ts index d4f5f2985215..a54b3e6457a7 100644 --- a/app/scripts/migrations/105.ts +++ b/app/scripts/migrations/105.ts @@ -97,6 +97,7 @@ function createInternalAccountsForAccountsController( metadata: { name: identity.name, lastSelected: identity.lastSelected ?? undefined, + importTime: 0, keyring: { // This is default HD Key Tree type because the keyring is encrypted // during migration, the type will get updated when the during the diff --git a/app/scripts/migrations/119.ts b/app/scripts/migrations/119.ts index 6e0f66687350..8cb0d2c04b97 100644 --- a/app/scripts/migrations/119.ts +++ b/app/scripts/migrations/119.ts @@ -46,13 +46,13 @@ function transformState(state: Record) { .accounts, ).length > 0 ) { - Object.values(accountsController.internalAccounts.accounts).forEach( - (internalAccount: InternalAccount) => { - if (!internalAccount.metadata?.importTime) { - internalAccount.metadata.importTime = Date.now(); - } - }, - ); + Object.values( + accountsController.internalAccounts.accounts, + ).forEach((internalAccount) => { + if (!internalAccount.metadata?.importTime) { + internalAccount.metadata.importTime = Date.now(); + } + }); } return { diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index a892ddff8b2f..831b12bedd76 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -797,11 +797,10 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@ethereumjs/tx>ethereum-cryptography": true, "@metamask/accounts-controller>@metamask/base-controller": true, + "@metamask/accounts-controller>@metamask/utils": true, "@metamask/eth-snap-keyring": true, "@metamask/keyring-api": true, "@metamask/keyring-controller": true, - "@metamask/snaps-utils": true, - "@metamask/utils": true, "uuid": true } }, @@ -813,6 +812,21 @@ "immer": true } }, + "@metamask/accounts-controller>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/address-book-controller": { "packages": { "@metamask/address-book-controller>@metamask/controller-utils": true, @@ -926,15 +940,30 @@ }, "packages": { "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/assets-controllers>@metamask/controller-utils>@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/assets-controllers>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>@metamask/polling-controller": { "globals": { "clearTimeout": true, @@ -1592,10 +1621,25 @@ "URL": true }, "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/keyring-api>@metamask/utils": true, "@metamask/keyring-api>bech32": true, - "@metamask/keyring-api>uuid": true, - "@metamask/utils": true, - "superstruct": true + "@metamask/keyring-api>uuid": true + } + }, + "@metamask/keyring-api>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/keyring-api>uuid": { @@ -1778,13 +1822,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/name-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/name-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/name-controller>async-mutex": { "globals": { "clearTimeout": true, @@ -1836,13 +1895,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/network-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/network-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/network-controller>@metamask/eth-json-rpc-infura": { "globals": { "setTimeout": true @@ -1934,13 +2008,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/permission-controller>nanoid": { "globals": { "crypto.getRandomValues": true @@ -2092,10 +2181,25 @@ }, "@metamask/rpc-errors": { "packages": { - "@metamask/utils": true, + "@metamask/rpc-errors>@metamask/utils": true, "eth-rpc-errors>fast-safe-stringify": true } }, + "@metamask/rpc-errors>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/rpc-methods-flask>nanoid": { "globals": { "crypto.getRandomValues": true @@ -2364,13 +2468,28 @@ "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { "globals": { "clearInterval": true, @@ -2405,7 +2524,7 @@ "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@ethereumjs/util": true, - "@metamask/utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, @@ -2425,6 +2544,21 @@ "webpack>events": true } }, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/polling-controller": { "globals": { "clearTimeout": true, @@ -2545,7 +2679,22 @@ "packages": { "@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/utils": true + "@metamask/snaps-controllers>@metamask/json-rpc-engine>@metamask/utils": true + } + }, + "@metamask/snaps-controllers>@metamask/json-rpc-engine>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": { @@ -2639,11 +2788,26 @@ "packages": { "@metamask/message-signing-snap>@noble/curves": true, "@metamask/scure-bip39": true, - "@metamask/utils": true, + "@metamask/snaps-sdk>@metamask/key-tree>@metamask/utils": true, "@metamask/utils>@scure/base": true, "@noble/hashes": true } }, + "@metamask/snaps-sdk>@metamask/key-tree>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/snaps-utils": { "globals": { "File": true, @@ -2681,10 +2845,25 @@ }, "@metamask/snaps-utils>@metamask/snaps-registry": { "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, "@metamask/message-signing-snap>@noble/curves": true, - "@metamask/utils": true, + "@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": true, + "@noble/hashes": true + } + }, + "@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, "@noble/hashes": true, - "superstruct": true + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/snaps-utils>cron-parser": { @@ -2782,13 +2961,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/transaction-controller>@metamask/nonce-tracker": { "packages": { "@ethersproject/providers": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index a892ddff8b2f..831b12bedd76 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -797,11 +797,10 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@ethereumjs/tx>ethereum-cryptography": true, "@metamask/accounts-controller>@metamask/base-controller": true, + "@metamask/accounts-controller>@metamask/utils": true, "@metamask/eth-snap-keyring": true, "@metamask/keyring-api": true, "@metamask/keyring-controller": true, - "@metamask/snaps-utils": true, - "@metamask/utils": true, "uuid": true } }, @@ -813,6 +812,21 @@ "immer": true } }, + "@metamask/accounts-controller>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/address-book-controller": { "packages": { "@metamask/address-book-controller>@metamask/controller-utils": true, @@ -926,15 +940,30 @@ }, "packages": { "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/assets-controllers>@metamask/controller-utils>@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/assets-controllers>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>@metamask/polling-controller": { "globals": { "clearTimeout": true, @@ -1592,10 +1621,25 @@ "URL": true }, "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/keyring-api>@metamask/utils": true, "@metamask/keyring-api>bech32": true, - "@metamask/keyring-api>uuid": true, - "@metamask/utils": true, - "superstruct": true + "@metamask/keyring-api>uuid": true + } + }, + "@metamask/keyring-api>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/keyring-api>uuid": { @@ -1778,13 +1822,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/name-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/name-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/name-controller>async-mutex": { "globals": { "clearTimeout": true, @@ -1836,13 +1895,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/network-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/network-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/network-controller>@metamask/eth-json-rpc-infura": { "globals": { "setTimeout": true @@ -1934,13 +2008,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/permission-controller>nanoid": { "globals": { "crypto.getRandomValues": true @@ -2092,10 +2181,25 @@ }, "@metamask/rpc-errors": { "packages": { - "@metamask/utils": true, + "@metamask/rpc-errors>@metamask/utils": true, "eth-rpc-errors>fast-safe-stringify": true } }, + "@metamask/rpc-errors>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/rpc-methods-flask>nanoid": { "globals": { "crypto.getRandomValues": true @@ -2364,13 +2468,28 @@ "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { "globals": { "clearInterval": true, @@ -2405,7 +2524,7 @@ "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@ethereumjs/util": true, - "@metamask/utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, @@ -2425,6 +2544,21 @@ "webpack>events": true } }, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/polling-controller": { "globals": { "clearTimeout": true, @@ -2545,7 +2679,22 @@ "packages": { "@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/utils": true + "@metamask/snaps-controllers>@metamask/json-rpc-engine>@metamask/utils": true + } + }, + "@metamask/snaps-controllers>@metamask/json-rpc-engine>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": { @@ -2639,11 +2788,26 @@ "packages": { "@metamask/message-signing-snap>@noble/curves": true, "@metamask/scure-bip39": true, - "@metamask/utils": true, + "@metamask/snaps-sdk>@metamask/key-tree>@metamask/utils": true, "@metamask/utils>@scure/base": true, "@noble/hashes": true } }, + "@metamask/snaps-sdk>@metamask/key-tree>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/snaps-utils": { "globals": { "File": true, @@ -2681,10 +2845,25 @@ }, "@metamask/snaps-utils>@metamask/snaps-registry": { "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, "@metamask/message-signing-snap>@noble/curves": true, - "@metamask/utils": true, + "@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": true, + "@noble/hashes": true + } + }, + "@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, "@noble/hashes": true, - "superstruct": true + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/snaps-utils>cron-parser": { @@ -2782,13 +2961,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/transaction-controller>@metamask/nonce-tracker": { "packages": { "@ethersproject/providers": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index a892ddff8b2f..831b12bedd76 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -797,11 +797,10 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@ethereumjs/tx>ethereum-cryptography": true, "@metamask/accounts-controller>@metamask/base-controller": true, + "@metamask/accounts-controller>@metamask/utils": true, "@metamask/eth-snap-keyring": true, "@metamask/keyring-api": true, "@metamask/keyring-controller": true, - "@metamask/snaps-utils": true, - "@metamask/utils": true, "uuid": true } }, @@ -813,6 +812,21 @@ "immer": true } }, + "@metamask/accounts-controller>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/address-book-controller": { "packages": { "@metamask/address-book-controller>@metamask/controller-utils": true, @@ -926,15 +940,30 @@ }, "packages": { "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/assets-controllers>@metamask/controller-utils>@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/assets-controllers>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>@metamask/polling-controller": { "globals": { "clearTimeout": true, @@ -1592,10 +1621,25 @@ "URL": true }, "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/keyring-api>@metamask/utils": true, "@metamask/keyring-api>bech32": true, - "@metamask/keyring-api>uuid": true, - "@metamask/utils": true, - "superstruct": true + "@metamask/keyring-api>uuid": true + } + }, + "@metamask/keyring-api>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/keyring-api>uuid": { @@ -1778,13 +1822,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/name-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/name-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/name-controller>async-mutex": { "globals": { "clearTimeout": true, @@ -1836,13 +1895,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/network-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/network-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/network-controller>@metamask/eth-json-rpc-infura": { "globals": { "setTimeout": true @@ -1934,13 +2008,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/permission-controller>nanoid": { "globals": { "crypto.getRandomValues": true @@ -2092,10 +2181,25 @@ }, "@metamask/rpc-errors": { "packages": { - "@metamask/utils": true, + "@metamask/rpc-errors>@metamask/utils": true, "eth-rpc-errors>fast-safe-stringify": true } }, + "@metamask/rpc-errors>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/rpc-methods-flask>nanoid": { "globals": { "crypto.getRandomValues": true @@ -2364,13 +2468,28 @@ "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { "globals": { "clearInterval": true, @@ -2405,7 +2524,7 @@ "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@ethereumjs/util": true, - "@metamask/utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, @@ -2425,6 +2544,21 @@ "webpack>events": true } }, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/polling-controller": { "globals": { "clearTimeout": true, @@ -2545,7 +2679,22 @@ "packages": { "@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/utils": true + "@metamask/snaps-controllers>@metamask/json-rpc-engine>@metamask/utils": true + } + }, + "@metamask/snaps-controllers>@metamask/json-rpc-engine>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": { @@ -2639,11 +2788,26 @@ "packages": { "@metamask/message-signing-snap>@noble/curves": true, "@metamask/scure-bip39": true, - "@metamask/utils": true, + "@metamask/snaps-sdk>@metamask/key-tree>@metamask/utils": true, "@metamask/utils>@scure/base": true, "@noble/hashes": true } }, + "@metamask/snaps-sdk>@metamask/key-tree>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/snaps-utils": { "globals": { "File": true, @@ -2681,10 +2845,25 @@ }, "@metamask/snaps-utils>@metamask/snaps-registry": { "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, "@metamask/message-signing-snap>@noble/curves": true, - "@metamask/utils": true, + "@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": true, + "@noble/hashes": true + } + }, + "@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, "@noble/hashes": true, - "superstruct": true + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/snaps-utils>cron-parser": { @@ -2782,13 +2961,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/transaction-controller>@metamask/nonce-tracker": { "packages": { "@ethersproject/providers": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index c7975844f736..f43b33a6f535 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -889,11 +889,10 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@ethereumjs/tx>ethereum-cryptography": true, "@metamask/accounts-controller>@metamask/base-controller": true, + "@metamask/accounts-controller>@metamask/utils": true, "@metamask/eth-snap-keyring": true, "@metamask/keyring-api": true, "@metamask/keyring-controller": true, - "@metamask/snaps-utils": true, - "@metamask/utils": true, "uuid": true } }, @@ -905,6 +904,21 @@ "immer": true } }, + "@metamask/accounts-controller>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/address-book-controller": { "packages": { "@metamask/address-book-controller>@metamask/controller-utils": true, @@ -1018,15 +1032,30 @@ }, "packages": { "@ethereumjs/tx>@ethereumjs/util": true, + "@metamask/assets-controllers>@metamask/controller-utils>@metamask/utils": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/assets-controllers>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/assets-controllers>@metamask/polling-controller": { "globals": { "clearTimeout": true, @@ -1684,10 +1713,25 @@ "URL": true }, "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/keyring-api>@metamask/utils": true, "@metamask/keyring-api>bech32": true, - "@metamask/keyring-api>uuid": true, - "@metamask/utils": true, - "superstruct": true + "@metamask/keyring-api>uuid": true + } + }, + "@metamask/keyring-api>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/keyring-api>uuid": { @@ -1870,13 +1914,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/name-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/name-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/name-controller>async-mutex": { "globals": { "clearTimeout": true, @@ -1928,13 +1987,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/network-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/network-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/network-controller>@metamask/eth-json-rpc-infura": { "globals": { "setTimeout": true @@ -2026,13 +2100,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/permission-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/permission-controller>nanoid": { "globals": { "crypto.getRandomValues": true @@ -2184,10 +2273,25 @@ }, "@metamask/rpc-errors": { "packages": { - "@metamask/utils": true, + "@metamask/rpc-errors>@metamask/utils": true, "eth-rpc-errors>fast-safe-stringify": true } }, + "@metamask/rpc-errors>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/rpc-methods-flask>nanoid": { "globals": { "crypto.getRandomValues": true @@ -2456,13 +2560,28 @@ "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@ethereumjs/util": true, - "@metamask/utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller": { "globals": { "clearInterval": true, @@ -2497,7 +2616,7 @@ "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@ethereumjs/util": true, - "@metamask/utils": true, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, @@ -2517,6 +2636,21 @@ "webpack>events": true } }, + "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/smart-transactions-controller>@metamask/transaction-controller>@metamask/gas-fee-controller>@metamask/polling-controller": { "globals": { "clearTimeout": true, @@ -2637,7 +2771,22 @@ "packages": { "@metamask/rpc-errors": true, "@metamask/safe-event-emitter": true, - "@metamask/utils": true + "@metamask/snaps-controllers>@metamask/json-rpc-engine>@metamask/utils": true + } + }, + "@metamask/snaps-controllers>@metamask/json-rpc-engine>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/snaps-controllers>@metamask/json-rpc-middleware-stream": { @@ -2731,11 +2880,26 @@ "packages": { "@metamask/message-signing-snap>@noble/curves": true, "@metamask/scure-bip39": true, - "@metamask/utils": true, + "@metamask/snaps-sdk>@metamask/key-tree>@metamask/utils": true, "@metamask/utils>@scure/base": true, "@noble/hashes": true } }, + "@metamask/snaps-sdk>@metamask/key-tree>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/snaps-utils": { "globals": { "File": true, @@ -2773,10 +2937,25 @@ }, "@metamask/snaps-utils>@metamask/snaps-registry": { "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, "@metamask/message-signing-snap>@noble/curves": true, - "@metamask/utils": true, + "@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": true, + "@noble/hashes": true + } + }, + "@metamask/snaps-utils>@metamask/snaps-registry>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, "@noble/hashes": true, - "superstruct": true + "browserify>buffer": true, + "nock>debug": true, + "semver": true } }, "@metamask/snaps-utils>cron-parser": { @@ -2874,13 +3053,28 @@ "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/controller-utils>@spruceid/siwe-parser": true, "@metamask/ethjs>@metamask/ethjs-unit": true, - "@metamask/utils": true, + "@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": true, "bn.js": true, "browserify>buffer": true, "eslint>fast-deep-equal": true, "eth-ens-namehash": true } }, + "@metamask/transaction-controller>@metamask/controller-utils>@metamask/utils": { + "globals": { + "TextDecoder": true, + "TextEncoder": true + }, + "packages": { + "@metamask/keyring-api>@metamask/superstruct": true, + "@metamask/utils>@scure/base": true, + "@metamask/utils>pony-cause": true, + "@noble/hashes": true, + "browserify>buffer": true, + "nock>debug": true, + "semver": true + } + }, "@metamask/transaction-controller>@metamask/nonce-tracker": { "packages": { "@ethersproject/providers": true, diff --git a/package.json b/package.json index 814ce18ffbb8..c40ef61a7a2e 100644 --- a/package.json +++ b/package.json @@ -291,7 +291,7 @@ "@metamask-institutional/sdk": "^0.1.30", "@metamask-institutional/transaction-update": "^0.2.5", "@metamask/abi-utils": "^2.0.2", - "@metamask/accounts-controller": "^17.0.0", + "@metamask/accounts-controller": "^18.1.0", "@metamask/address-book-controller": "^4.0.1", "@metamask/announcement-controller": "^6.1.0", "@metamask/approval-controller": "^7.0.0", diff --git a/ui/components/multichain/connect-accounts-modal/connect-accounts-modal.test.tsx b/ui/components/multichain/connect-accounts-modal/connect-accounts-modal.test.tsx index e365acdd36bd..9dbba6dd4484 100644 --- a/ui/components/multichain/connect-accounts-modal/connect-accounts-modal.test.tsx +++ b/ui/components/multichain/connect-accounts-modal/connect-accounts-modal.test.tsx @@ -1,7 +1,10 @@ import React from 'react'; +import { EthAccountType } from '@metamask/keyring-api'; +import { KeyringTypes } from '@metamask/keyring-controller'; import configureStore from '../../../store/store'; import mockState from '../../../../test/data/mock-state.json'; import { renderWithProvider } from '../../../../test/jest/rendering'; +import { ETH_EOA_METHODS } from '../../../../shared/constants/eth-methods'; import { ConnectAccountsModalList } from './connect-accounts-modal-list'; const render = () => { @@ -24,9 +27,16 @@ const render = () => { keyring: { type: 'Custody', }, + importTime: 1631610000000, }, - type: 'eip155:eoa', + type: EthAccountType.Eoa, options: {}, + methods: ETH_EOA_METHODS, + keyring: { + type: KeyringTypes.hd, + }, + name: 'Custody Account A', + balance: '0x0', }, ], selectedAccounts: [], diff --git a/ui/components/multichain/pages/connections/connections.tsx b/ui/components/multichain/pages/connections/connections.tsx index 6e75c222c59d..ae1f5b88193e 100644 --- a/ui/components/multichain/pages/connections/connections.tsx +++ b/ui/components/multichain/pages/connections/connections.tsx @@ -110,7 +110,10 @@ export const Connections = () => { ); const selectedAccount = useSelector(getSelectedAccount); const internalAccounts = useSelector(getInternalAccounts); - const mergedAccounts = mergeAccounts(connectedAccounts, internalAccounts); + const mergedAccounts = mergeAccounts( + connectedAccounts, + internalAccounts, + ) as AccountType[]; const permittedAccountsByOrigin = useSelector( getPermittedAccountsByOrigin, @@ -174,16 +177,24 @@ export const Connections = () => { index === mergedAccounts.reduce( ( - acc: string | number, - cur: { metadata: { lastSelected: number } }, + indexOfAccountWIthHighestLastSelected: number, + currentAccountToCompare: AccountType, // TODO: Replace `any` with type // eslint-disable-next-line @typescript-eslint/no-explicit-any i: any, - ) => - cur.metadata.lastSelected > - mergedAccounts[acc].metadata.lastSelected + ) => { + const currentLastSelected = + currentAccountToCompare.metadata.lastSelected ?? 0; + const accountAtIndexLastSelected = mergedAccounts[ + indexOfAccountWIthHighestLastSelected + ].metadata.lastSelected ? i - : acc, + : indexOfAccountWIthHighestLastSelected; + + return currentLastSelected > accountAtIndexLastSelected + ? i + : indexOfAccountWIthHighestLastSelected; + }, 0, ) ); @@ -252,12 +263,10 @@ export const Connections = () => { const isSelectedAccount = selectedAccount.address === account.address; // Match the index of latestSelected Account with the index of all the accounts and set the active status - let mergedAccountsProps; - if (index === latestSelected) { - mergedAccountsProps = { ...account, isAccountActive: true }; - } else { - mergedAccountsProps = { ...account }; - } + const mergedAccountsProps = { + ...account, + isAccountActive: index === latestSelected, + }; return ( { @@ -34,6 +35,8 @@ describe('PermissionDetailsModal', () => { id: 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3', metadata: { name: 'Really Long Name That Should Be Truncated', + importTime: 1724252448, + lastSelected: 1724252448, keyring: { type: 'HD Key Tree', }, @@ -48,6 +51,7 @@ describe('PermissionDetailsModal', () => { metadata: { name: 'Account 1', lastSelected: 1586359844192, + importTime: 1586359844192, lastActive: 1586359844192, keyring: { type: 'HD Key Tree', @@ -112,10 +116,14 @@ describe('PermissionDetailsModal', () => { id: 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3', metadata: { name: 'mockName', + importTime: 1724256979, keyring: { type: 'HD Key Tree', }, }, + options: {}, + methods: ETH_EOA_METHODS, + type: EthAccountType.Eoa, label: '', }, isOpen: true, diff --git a/ui/components/multichain/toast/toast.test.tsx b/ui/components/multichain/toast/toast.test.tsx index d1541587694e..eb208d41e122 100644 --- a/ui/components/multichain/toast/toast.test.tsx +++ b/ui/components/multichain/toast/toast.test.tsx @@ -12,10 +12,6 @@ const mockInternalAccount = createMockInternalAccount(); const CHAOS_ACCOUNT: InternalAccount = { ...mockInternalAccount, address: '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4', - balance: '0x152387ad22c3f0', - keyring: { - type: 'HD Key Tree', - }, }; const onActionClick = jest.fn(); diff --git a/ui/hooks/useMultichainSelector.test.ts b/ui/hooks/useMultichainSelector.test.ts index e4469a9f05db..0f66030ae100 100644 --- a/ui/hooks/useMultichainSelector.test.ts +++ b/ui/hooks/useMultichainSelector.test.ts @@ -60,6 +60,7 @@ describe('useMultichainSelector', () => { }); it('uses selectedAccount if account is not provided', () => { + // @ts-expect-error: intentionally testing without account const { result } = renderUseMultichainHook(getMultichainIsEvm, null); expect(result.current).toBe(true); diff --git a/ui/pages/remove-snap-account/snap-account-card.tsx b/ui/pages/remove-snap-account/snap-account-card.tsx index aaef89c844ca..fcf946639077 100644 --- a/ui/pages/remove-snap-account/snap-account-card.tsx +++ b/ui/pages/remove-snap-account/snap-account-card.tsx @@ -8,6 +8,7 @@ import { BlockSize, BorderRadius } from '../../helpers/constants/design-system'; import { Box } from '../../components/component-library'; import { AccountListItem } from '../../components/multichain'; import { mergeAccounts } from '../../components/multichain/account-list-menu/account-list-menu'; +import { MergedInternalAccount } from '../../selectors/selectors.types'; // Wrapper component of AccountListItem with proper styling and auto populating information for the selected account export const SnapAccountCard = ({ @@ -24,7 +25,7 @@ export const SnapAccountCard = ({ const account = mergedAccounts.find( (internalAccount: { address: string }) => internalAccount.address === address, - ); + ) as MergedInternalAccount; return ( =15 <18" - checksum: 10/0c8546a4e980c70a7d4a6dcc470fa4968ca36d3e05f8fa8974e980c2b02616ada8ed416aa49f2801f883c08455453b2386d393e3b41c853d2dd45c226f8c360f + checksum: 10/15711ddaa0007794cc23f9c02f6cfbee85aa1cf79a46468a0398404c295eef1511555ce6bd60a691081d33864d288ea8b309ee9ac9c4d6f277ab22e4d97cb76e languageName: node linkType: hard @@ -5949,6 +5971,25 @@ __metadata: languageName: node linkType: hard +"@metamask/permission-controller@npm:^11.0.0": + version: 11.0.0 + resolution: "@metamask/permission-controller@npm:11.0.0" + dependencies: + "@metamask/base-controller": "npm:^6.0.2" + "@metamask/controller-utils": "npm:^11.0.2" + "@metamask/json-rpc-engine": "npm:^9.0.2" + "@metamask/rpc-errors": "npm:^6.3.1" + "@metamask/utils": "npm:^9.1.0" + "@types/deep-freeze-strict": "npm:^1.1.0" + deep-freeze-strict: "npm:^1.1.1" + immer: "npm:^9.0.6" + nanoid: "npm:^3.1.31" + peerDependencies: + "@metamask/approval-controller": ^7.0.0 + checksum: 10/3bd957b72ac4ed307566b650b5531e739732b9e6a414ec630bd43fc86c7c99b446eb5666f744abfb30c043824fe1b5a13681df8bd7c2244640b8996eec8e927a + languageName: node + linkType: hard + "@metamask/permission-controller@npm:^9.0.2": version: 9.1.0 resolution: "@metamask/permission-controller@npm:9.1.0" @@ -6173,13 +6214,13 @@ __metadata: languageName: node linkType: hard -"@metamask/rpc-errors@npm:^6.0.0, @metamask/rpc-errors@npm:^6.2.1": - version: 6.2.1 - resolution: "@metamask/rpc-errors@npm:6.2.1" +"@metamask/rpc-errors@npm:^6.0.0, @metamask/rpc-errors@npm:^6.2.1, @metamask/rpc-errors@npm:^6.3.1": + version: 6.3.1 + resolution: "@metamask/rpc-errors@npm:6.3.1" dependencies: - "@metamask/utils": "npm:^8.3.0" + "@metamask/utils": "npm:^9.0.0" fast-safe-stringify: "npm:^2.0.6" - checksum: 10/789f0a2090339c1aa43d45ee496f4f115e141bc55b98e4ce27498497568f9e85fb5527ecf1f113b156d88fc4f1e63a572ced74bdc1ba16826bf648391b223f7b + checksum: 10/f968fb490b13b632c2ad4770a144d67cecdff8d539cb8b489c732b08dab7a62fae65d7a2908ce8c5b77260317aa618948a52463f093fa8d9f84aee1c5f6f5daf languageName: node linkType: hard @@ -6367,15 +6408,15 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-registry@npm:^3.1.0": - version: 3.1.0 - resolution: "@metamask/snaps-registry@npm:3.1.0" +"@metamask/snaps-registry@npm:^3.1.0, @metamask/snaps-registry@npm:^3.2.1": + version: 3.2.1 + resolution: "@metamask/snaps-registry@npm:3.2.1" dependencies: - "@metamask/utils": "npm:^8.3.0" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^9.0.0" "@noble/curves": "npm:^1.2.0" "@noble/hashes": "npm:^1.3.2" - superstruct: "npm:^1.0.3" - checksum: 10/28b5a8685f20801e64265687f3cd3d4bd202e8fe1f0cc044fcc8ad6af94d1a1d354f98a866235a1b827f414c067f6ae4bf0c18f26603804db53f3869722d957e + checksum: 10/b2a413f27db9b5701d3773017035ee1e153734a25363e3877f44be4a70f51c48d77ad0ac8f1e96a7d732d2079a4b259896f361b3cba1ae0bf0bbc1075406f178 languageName: node linkType: hard @@ -6439,6 +6480,37 @@ __metadata: languageName: node linkType: hard +"@metamask/snaps-utils@npm:^7.8.1": + version: 7.8.1 + resolution: "@metamask/snaps-utils@npm:7.8.1" + dependencies: + "@babel/core": "npm:^7.23.2" + "@babel/types": "npm:^7.23.0" + "@metamask/base-controller": "npm:^6.0.2" + "@metamask/key-tree": "npm:^9.1.2" + "@metamask/permission-controller": "npm:^11.0.0" + "@metamask/rpc-errors": "npm:^6.3.1" + "@metamask/slip44": "npm:^3.1.0" + "@metamask/snaps-registry": "npm:^3.2.1" + "@metamask/snaps-sdk": "npm:^6.1.0" + "@metamask/superstruct": "npm:^3.1.0" + "@metamask/utils": "npm:^9.1.0" + "@noble/hashes": "npm:^1.3.1" + "@scure/base": "npm:^1.1.1" + chalk: "npm:^4.1.2" + cron-parser: "npm:^4.5.0" + fast-deep-equal: "npm:^3.1.3" + fast-json-stable-stringify: "npm:^2.1.0" + fast-xml-parser: "npm:^4.3.4" + marked: "npm:^12.0.1" + rfdc: "npm:^1.3.0" + semver: "npm:^7.5.4" + ses: "npm:^1.1.0" + validate-npm-package-name: "npm:^5.0.0" + checksum: 10/572108aafbad970910ffb3605cf9eb4675ede0d69ff2bd37515da7f071de2065a55c73d6dc44dbe70bbd9c3ff0dfe29d40fd16badd925a4b8504db293265ca2f + languageName: node + linkType: hard + "@metamask/snaps-utils@patch:@metamask/snaps-utils@npm%3A7.7.0#~/.yarn/patches/@metamask-snaps-utils-npm-7.7.0-2cc1f044af.patch": version: 7.7.0 resolution: "@metamask/snaps-utils@patch:@metamask/snaps-utils@npm%3A7.7.0#~/.yarn/patches/@metamask-snaps-utils-npm-7.7.0-2cc1f044af.patch::version=7.7.0&hash=5f2735" @@ -6470,6 +6542,13 @@ __metadata: languageName: node linkType: hard +"@metamask/superstruct@npm:^3.1.0": + version: 3.1.0 + resolution: "@metamask/superstruct@npm:3.1.0" + checksum: 10/5066fe228d5f11da387606d7f9545de2b473ab5a9e0f1bb8aea2f52d3e2c9d25e427151acde61f4a2de80a07a9871fe9505ad06abca6a61b7c3b54ed5c403b01 + languageName: node + linkType: hard + "@metamask/swappable-obj-proxy@npm:^2.2.0": version: 2.2.0 resolution: "@metamask/swappable-obj-proxy@npm:2.2.0" @@ -6637,6 +6716,23 @@ __metadata: languageName: node linkType: hard +"@metamask/utils@npm:^9.0.0, @metamask/utils@npm:^9.1.0": + version: 9.2.1 + resolution: "@metamask/utils@npm:9.2.1" + dependencies: + "@ethereumjs/tx": "npm:^4.2.0" + "@metamask/superstruct": "npm:^3.1.0" + "@noble/hashes": "npm:^1.3.1" + "@scure/base": "npm:^1.1.3" + "@types/debug": "npm:^4.1.7" + debug: "npm:^4.3.4" + pony-cause: "npm:^2.1.10" + semver: "npm:^7.5.4" + uuid: "npm:^9.0.1" + checksum: 10/2192797afd91af19898e107afeaf63e89b61dc7285e0a75d0cc814b5b288e4cdfc856781b01904034c4d2c1efd9bdab512af24c7e4dfe7b77a03f1f3d9dec7e8 + languageName: node + linkType: hard + "@mobily/ts-belt@npm:^3.13.1": version: 3.13.1 resolution: "@mobily/ts-belt@npm:3.13.1" @@ -25275,7 +25371,7 @@ __metadata: "@metamask-institutional/sdk": "npm:^0.1.30" "@metamask-institutional/transaction-update": "npm:^0.2.5" "@metamask/abi-utils": "npm:^2.0.2" - "@metamask/accounts-controller": "npm:^17.0.0" + "@metamask/accounts-controller": "npm:^18.1.0" "@metamask/address-book-controller": "npm:^4.0.1" "@metamask/announcement-controller": "npm:^6.1.0" "@metamask/api-specs": "npm:^0.9.3"