diff --git a/app/scripts/controllers/alert-controller.test.ts b/app/scripts/controllers/alert-controller.test.ts index de314c31f050..190879dc4334 100644 --- a/app/scripts/controllers/alert-controller.test.ts +++ b/app/scripts/controllers/alert-controller.test.ts @@ -163,6 +163,7 @@ describe('AlertController', () => { address: '0x1234567', options: {}, methods: [], + scopes: ['eip155'], type: 'eip155:eoa', metadata: { name: '', diff --git a/app/scripts/lib/snap-keyring/snap-keyring.test.ts b/app/scripts/lib/snap-keyring/snap-keyring.test.ts index 0e778b2268d7..c2ea66cff4fe 100644 --- a/app/scripts/lib/snap-keyring/snap-keyring.test.ts +++ b/app/scripts/lib/snap-keyring/snap-keyring.test.ts @@ -40,6 +40,7 @@ const mockAccount = { id: '3afa663e-0600-4d93-868a-61c2e553013b', address, methods: [], + scopes: ['eip155'], options: {}, }; const mockInternalAccount = { diff --git a/app/scripts/migrations/105.test.ts b/app/scripts/migrations/105.test.ts index b7d5ac0303e6..ffa808e33291 100644 --- a/app/scripts/migrations/105.test.ts +++ b/app/scripts/migrations/105.test.ts @@ -1,8 +1,8 @@ import { v4 as uuid } from 'uuid'; import { sha256FromString } from 'ethereumjs-util'; -import { InternalAccount } from '@metamask/keyring-internal-api'; import { ETH_EOA_METHODS } from '../../../shared/constants/eth-methods'; import { migrate } from './105'; +import type { Identity, InternalAccountV1 } from './105'; const MOCK_ADDRESS = '0x0'; const MOCK_ADDRESS_2 = '0x1'; @@ -22,12 +22,6 @@ function addressToUUID(address: string): string { }); } -type Identity = { - name: string; - address: string; - lastSelected?: number; -}; - type Identities = { [key: string]: Identity; }; @@ -62,7 +56,7 @@ function expectedInternalAccount( address: string, nickname: string, lastSelected?: number, -): InternalAccount { +): InternalAccountV1 { return { address, id: addressToUUID(address), diff --git a/app/scripts/migrations/105.ts b/app/scripts/migrations/105.ts index 5febcb0479f2..05651ad0d0de 100644 --- a/app/scripts/migrations/105.ts +++ b/app/scripts/migrations/105.ts @@ -1,8 +1,8 @@ import { EthAccountType } from '@metamask/keyring-api'; -import { InternalAccount } from '@metamask/keyring-internal-api'; import { sha256FromString } from 'ethereumjs-util'; import { v4 as uuid } from 'uuid'; import { cloneDeep } from 'lodash'; +import { Json } from '@metamask/utils'; import { ETH_EOA_METHODS } from '../../../shared/constants/eth-methods'; type VersionedData = { @@ -10,12 +10,28 @@ type VersionedData = { data: Record; }; -type Identity = { +export type Identity = { name: string; address: string; lastSelected?: number; }; +export type InternalAccountV1 = { + type: string; + id: string; + options: Record; + metadata: { + name: string; + importTime: number; + keyring: { + type: string; + }; + lastSelected?: number; + }; + address: string; + methods: string[]; +}; + export const version = 105; /** @@ -51,11 +67,11 @@ function findInternalAccountByAddress( // eslint-disable-next-line @typescript-eslint/no-explicit-any state: Record, address: string, -): InternalAccount | undefined { - return Object.values( +): InternalAccountV1 | undefined { + return Object.values( state.AccountsController.internalAccounts.accounts, ).find( - (account: InternalAccount) => + (account: InternalAccountV1) => account.address.toLowerCase() === address.toLowerCase(), ); } @@ -84,7 +100,7 @@ function createInternalAccountsForAccountsController( return; } - const accounts: Record = {}; + const accounts: Record = {}; Object.values(identities).forEach((identity) => { const expectedId = uuid({ diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index c4985af54a1d..23bf9053c9c1 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -818,7 +818,7 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { "packages": { "@metamask/utils>@metamask/superstruct": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + "@metamask/eth-snap-keyring>@metamask/utils": true } }, "@metamask/eth-trezor-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { @@ -846,7 +846,7 @@ "@metamask/eth-snap-keyring": true, "@metamask/keyring-api": true, "@metamask/keyring-controller": true, - "@metamask/utils": true, + "@metamask/accounts-controller>@metamask/utils": true, "@ethereumjs/tx>ethereum-cryptography": true, "uuid": true } @@ -1137,7 +1137,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/eth-snap-keyring>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, "@ethereumjs/tx>ethereum-cryptography": true, @@ -1190,13 +1190,15 @@ "@metamask/eth-snap-keyring": { "globals": { "URL": true, - "console.error": true + "console.error": true, + "console.info": true }, "packages": { "@ethereumjs/tx": true, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "@metamask/keyring-api": true, "@metamask/eth-snap-keyring>@metamask/keyring-internal-snap-client": true, + "@metamask/keyring-api>@metamask/keyring-utils": true, "@metamask/utils>@metamask/superstruct": true, "@metamask/eth-snap-keyring>@metamask/utils": true, "webpack>events": true, @@ -1352,14 +1354,6 @@ "@metamask/keyring-api>bech32": true } }, - "@metamask/profile-sync-controller>@metamask/keyring-api": { - "packages": { - "@metamask/keyring-api>@metamask/keyring-utils": true, - "@metamask/utils>@metamask/superstruct": true, - "@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": true, - "@metamask/keyring-api>bech32": true - } - }, "@metamask/keyring-controller": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -1392,7 +1386,8 @@ }, "packages": { "@metamask/utils>@metamask/superstruct": true, - "@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": true + "@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": true, + "bitcoin-address-validation": true } }, "@metamask/logging-controller": { @@ -1612,7 +1607,7 @@ }, "packages": { "@metamask/base-controller": true, - "@metamask/profile-sync-controller>@metamask/keyring-api": true, + "@metamask/keyring-api": true, "@metamask/keyring-controller": true, "@metamask/network-controller": true, "@metamask/profile-sync-controller>@noble/ciphers": true, @@ -1920,7 +1915,7 @@ "semver": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { "globals": { "TextDecoder": true, "TextEncoder": true @@ -1935,7 +1930,7 @@ "semver": true } }, - "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "@metamask/accounts-controller>@metamask/utils": { "globals": { "TextDecoder": true, "TextEncoder": true @@ -2085,21 +2080,6 @@ "semver": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { - "globals": { - "TextDecoder": true, - "TextEncoder": true - }, - "packages": { - "@metamask/utils>@metamask/superstruct": true, - "@noble/hashes": true, - "@metamask/utils>@scure/base": true, - "browserify>buffer": true, - "nock>debug": true, - "@metamask/utils>pony-cause": true, - "semver": true - } - }, "@metamask/eth-trezor-keyring>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2220,21 +2200,6 @@ "semver": true } }, - "@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": { - "globals": { - "TextDecoder": true, - "TextEncoder": true - }, - "packages": { - "@metamask/utils>@metamask/superstruct": true, - "@noble/hashes": true, - "@metamask/utils>@scure/base": true, - "browserify>buffer": true, - "nock>debug": true, - "@metamask/utils>pony-cause": true, - "semver": true - } - }, "@metamask/keyring-controller>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index c4985af54a1d..23bf9053c9c1 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -818,7 +818,7 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { "packages": { "@metamask/utils>@metamask/superstruct": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + "@metamask/eth-snap-keyring>@metamask/utils": true } }, "@metamask/eth-trezor-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { @@ -846,7 +846,7 @@ "@metamask/eth-snap-keyring": true, "@metamask/keyring-api": true, "@metamask/keyring-controller": true, - "@metamask/utils": true, + "@metamask/accounts-controller>@metamask/utils": true, "@ethereumjs/tx>ethereum-cryptography": true, "uuid": true } @@ -1137,7 +1137,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/eth-snap-keyring>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, "@ethereumjs/tx>ethereum-cryptography": true, @@ -1190,13 +1190,15 @@ "@metamask/eth-snap-keyring": { "globals": { "URL": true, - "console.error": true + "console.error": true, + "console.info": true }, "packages": { "@ethereumjs/tx": true, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "@metamask/keyring-api": true, "@metamask/eth-snap-keyring>@metamask/keyring-internal-snap-client": true, + "@metamask/keyring-api>@metamask/keyring-utils": true, "@metamask/utils>@metamask/superstruct": true, "@metamask/eth-snap-keyring>@metamask/utils": true, "webpack>events": true, @@ -1352,14 +1354,6 @@ "@metamask/keyring-api>bech32": true } }, - "@metamask/profile-sync-controller>@metamask/keyring-api": { - "packages": { - "@metamask/keyring-api>@metamask/keyring-utils": true, - "@metamask/utils>@metamask/superstruct": true, - "@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": true, - "@metamask/keyring-api>bech32": true - } - }, "@metamask/keyring-controller": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -1392,7 +1386,8 @@ }, "packages": { "@metamask/utils>@metamask/superstruct": true, - "@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": true + "@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": true, + "bitcoin-address-validation": true } }, "@metamask/logging-controller": { @@ -1612,7 +1607,7 @@ }, "packages": { "@metamask/base-controller": true, - "@metamask/profile-sync-controller>@metamask/keyring-api": true, + "@metamask/keyring-api": true, "@metamask/keyring-controller": true, "@metamask/network-controller": true, "@metamask/profile-sync-controller>@noble/ciphers": true, @@ -1920,7 +1915,7 @@ "semver": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { "globals": { "TextDecoder": true, "TextEncoder": true @@ -1935,7 +1930,7 @@ "semver": true } }, - "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "@metamask/accounts-controller>@metamask/utils": { "globals": { "TextDecoder": true, "TextEncoder": true @@ -2085,21 +2080,6 @@ "semver": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { - "globals": { - "TextDecoder": true, - "TextEncoder": true - }, - "packages": { - "@metamask/utils>@metamask/superstruct": true, - "@noble/hashes": true, - "@metamask/utils>@scure/base": true, - "browserify>buffer": true, - "nock>debug": true, - "@metamask/utils>pony-cause": true, - "semver": true - } - }, "@metamask/eth-trezor-keyring>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2220,21 +2200,6 @@ "semver": true } }, - "@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": { - "globals": { - "TextDecoder": true, - "TextEncoder": true - }, - "packages": { - "@metamask/utils>@metamask/superstruct": true, - "@noble/hashes": true, - "@metamask/utils>@scure/base": true, - "browserify>buffer": true, - "nock>debug": true, - "@metamask/utils>pony-cause": true, - "semver": true - } - }, "@metamask/keyring-controller>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index c4985af54a1d..23bf9053c9c1 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -818,7 +818,7 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { "packages": { "@metamask/utils>@metamask/superstruct": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + "@metamask/eth-snap-keyring>@metamask/utils": true } }, "@metamask/eth-trezor-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { @@ -846,7 +846,7 @@ "@metamask/eth-snap-keyring": true, "@metamask/keyring-api": true, "@metamask/keyring-controller": true, - "@metamask/utils": true, + "@metamask/accounts-controller>@metamask/utils": true, "@ethereumjs/tx>ethereum-cryptography": true, "uuid": true } @@ -1137,7 +1137,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/eth-snap-keyring>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, "@ethereumjs/tx>ethereum-cryptography": true, @@ -1190,13 +1190,15 @@ "@metamask/eth-snap-keyring": { "globals": { "URL": true, - "console.error": true + "console.error": true, + "console.info": true }, "packages": { "@ethereumjs/tx": true, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "@metamask/keyring-api": true, "@metamask/eth-snap-keyring>@metamask/keyring-internal-snap-client": true, + "@metamask/keyring-api>@metamask/keyring-utils": true, "@metamask/utils>@metamask/superstruct": true, "@metamask/eth-snap-keyring>@metamask/utils": true, "webpack>events": true, @@ -1352,14 +1354,6 @@ "@metamask/keyring-api>bech32": true } }, - "@metamask/profile-sync-controller>@metamask/keyring-api": { - "packages": { - "@metamask/keyring-api>@metamask/keyring-utils": true, - "@metamask/utils>@metamask/superstruct": true, - "@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": true, - "@metamask/keyring-api>bech32": true - } - }, "@metamask/keyring-controller": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -1392,7 +1386,8 @@ }, "packages": { "@metamask/utils>@metamask/superstruct": true, - "@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": true + "@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": true, + "bitcoin-address-validation": true } }, "@metamask/logging-controller": { @@ -1612,7 +1607,7 @@ }, "packages": { "@metamask/base-controller": true, - "@metamask/profile-sync-controller>@metamask/keyring-api": true, + "@metamask/keyring-api": true, "@metamask/keyring-controller": true, "@metamask/network-controller": true, "@metamask/profile-sync-controller>@noble/ciphers": true, @@ -1920,7 +1915,7 @@ "semver": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { "globals": { "TextDecoder": true, "TextEncoder": true @@ -1935,7 +1930,7 @@ "semver": true } }, - "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "@metamask/accounts-controller>@metamask/utils": { "globals": { "TextDecoder": true, "TextEncoder": true @@ -2085,21 +2080,6 @@ "semver": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { - "globals": { - "TextDecoder": true, - "TextEncoder": true - }, - "packages": { - "@metamask/utils>@metamask/superstruct": true, - "@noble/hashes": true, - "@metamask/utils>@scure/base": true, - "browserify>buffer": true, - "nock>debug": true, - "@metamask/utils>pony-cause": true, - "semver": true - } - }, "@metamask/eth-trezor-keyring>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2220,21 +2200,6 @@ "semver": true } }, - "@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": { - "globals": { - "TextDecoder": true, - "TextEncoder": true - }, - "packages": { - "@metamask/utils>@metamask/superstruct": true, - "@noble/hashes": true, - "@metamask/utils>@scure/base": true, - "browserify>buffer": true, - "nock>debug": true, - "@metamask/utils>pony-cause": true, - "semver": true - } - }, "@metamask/keyring-controller>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index bc5be17e5a64..354320b13049 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -910,7 +910,7 @@ "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { "packages": { "@metamask/utils>@metamask/superstruct": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": true + "@metamask/eth-snap-keyring>@metamask/utils": true } }, "@metamask/eth-trezor-keyring>@metamask/eth-sig-util>@metamask/abi-utils": { @@ -938,7 +938,7 @@ "@metamask/eth-snap-keyring": true, "@metamask/keyring-api": true, "@metamask/keyring-controller": true, - "@metamask/utils": true, + "@metamask/accounts-controller>@metamask/utils": true, "@ethereumjs/tx>ethereum-cryptography": true, "uuid": true } @@ -1229,7 +1229,7 @@ "packages": { "@ethereumjs/tx>@ethereumjs/util": true, "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils": true, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": true, + "@metamask/eth-snap-keyring>@metamask/utils": true, "@metamask/utils>@scure/base": true, "browserify>buffer": true, "@ethereumjs/tx>ethereum-cryptography": true, @@ -1282,13 +1282,15 @@ "@metamask/eth-snap-keyring": { "globals": { "URL": true, - "console.error": true + "console.error": true, + "console.info": true }, "packages": { "@ethereumjs/tx": true, "@metamask/eth-snap-keyring>@metamask/eth-sig-util": true, "@metamask/keyring-api": true, "@metamask/eth-snap-keyring>@metamask/keyring-internal-snap-client": true, + "@metamask/keyring-api>@metamask/keyring-utils": true, "@metamask/utils>@metamask/superstruct": true, "@metamask/eth-snap-keyring>@metamask/utils": true, "webpack>events": true, @@ -1444,14 +1446,6 @@ "@metamask/keyring-api>bech32": true } }, - "@metamask/profile-sync-controller>@metamask/keyring-api": { - "packages": { - "@metamask/keyring-api>@metamask/keyring-utils": true, - "@metamask/utils>@metamask/superstruct": true, - "@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": true, - "@metamask/keyring-api>bech32": true - } - }, "@metamask/keyring-controller": { "packages": { "@ethereumjs/tx>@ethereumjs/util": true, @@ -1484,7 +1478,8 @@ }, "packages": { "@metamask/utils>@metamask/superstruct": true, - "@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": true + "@metamask/keyring-api>@metamask/keyring-utils>@metamask/utils": true, + "bitcoin-address-validation": true } }, "@metamask/logging-controller": { @@ -1704,7 +1699,7 @@ }, "packages": { "@metamask/base-controller": true, - "@metamask/profile-sync-controller>@metamask/keyring-api": true, + "@metamask/keyring-api": true, "@metamask/keyring-controller": true, "@metamask/network-controller": true, "@metamask/profile-sync-controller>@noble/ciphers": true, @@ -2012,7 +2007,7 @@ "semver": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { "globals": { "TextDecoder": true, "TextEncoder": true @@ -2027,7 +2022,7 @@ "semver": true } }, - "@metamask/signature-controller>@metamask/eth-sig-util>@metamask/abi-utils>@metamask/utils": { + "@metamask/accounts-controller>@metamask/utils": { "globals": { "TextDecoder": true, "TextEncoder": true @@ -2177,21 +2172,6 @@ "semver": true } }, - "@metamask/eth-snap-keyring>@metamask/eth-sig-util>@metamask/utils": { - "globals": { - "TextDecoder": true, - "TextEncoder": true - }, - "packages": { - "@metamask/utils>@metamask/superstruct": true, - "@noble/hashes": true, - "@metamask/utils>@scure/base": true, - "browserify>buffer": true, - "nock>debug": true, - "@metamask/utils>pony-cause": true, - "semver": true - } - }, "@metamask/eth-trezor-keyring>@metamask/eth-sig-util>@metamask/utils": { "globals": { "TextDecoder": true, @@ -2312,21 +2292,6 @@ "semver": true } }, - "@metamask/profile-sync-controller>@metamask/keyring-api>@metamask/utils": { - "globals": { - "TextDecoder": true, - "TextEncoder": true - }, - "packages": { - "@metamask/utils>@metamask/superstruct": true, - "@noble/hashes": true, - "@metamask/utils>@scure/base": true, - "browserify>buffer": true, - "nock>debug": true, - "@metamask/utils>pony-cause": true, - "semver": true - } - }, "@metamask/keyring-controller>@metamask/utils": { "globals": { "TextDecoder": true, diff --git a/package.json b/package.json index 2bc95e4595fb..f0752f2369dc 100644 --- a/package.json +++ b/package.json @@ -286,13 +286,13 @@ "@metamask-institutional/types": "^1.2.0", "@metamask/abi-utils": "^2.0.2", "@metamask/account-watcher": "^4.1.2", - "@metamask/accounts-controller": "^20.0.2", + "@metamask/accounts-controller": "^21.0.1", "@metamask/address-book-controller": "^6.0.0", "@metamask/announcement-controller": "^7.0.0", "@metamask/approval-controller": "^7.0.0", "@metamask/assets-controllers": "patch:@metamask/assets-controllers@patch%3A@metamask/assets-controllers@npm%253A45.1.0%23~/.yarn/patches/@metamask-assets-controllers-npm-45.1.0-d914c453f0.patch%3A%3Aversion=45.1.0&hash=cfcadc#~/.yarn/patches/@metamask-assets-controllers-patch-d6ed5f8213.patch", "@metamask/base-controller": "^7.0.0", - "@metamask/bitcoin-wallet-snap": "^0.8.2", + "@metamask/bitcoin-wallet-snap": "^0.9.0", "@metamask/browser-passworder": "^4.3.0", "@metamask/contract-metadata": "^2.5.0", "@metamask/controller-utils": "^11.4.0", @@ -303,7 +303,7 @@ "@metamask/eth-json-rpc-middleware": "^15.1.2", "@metamask/eth-ledger-bridge-keyring": "^8.0.2", "@metamask/eth-sig-util": "^7.0.1", - "@metamask/eth-snap-keyring": "^7.0.0", + "@metamask/eth-snap-keyring": "^8.1.0", "@metamask/eth-token-tracker": "^9.0.0", "@metamask/eth-trezor-keyring": "^6.0.0", "@metamask/etherscan-link": "^3.0.0", @@ -311,10 +311,10 @@ "@metamask/jazzicon": "^2.0.0", "@metamask/json-rpc-engine": "^10.0.0", "@metamask/json-rpc-middleware-stream": "^8.0.4", - "@metamask/keyring-api": "^12.0.0", - "@metamask/keyring-controller": "^19.0.2", - "@metamask/keyring-internal-api": "^1.0.0", - "@metamask/keyring-snap-client": "^1.0.0", + "@metamask/keyring-api": "^13.0.0", + "@metamask/keyring-controller": "^19.0.3", + "@metamask/keyring-internal-api": "^2.0.0", + "@metamask/keyring-snap-client": "^2.0.0", "@metamask/logging-controller": "^6.0.0", "@metamask/logo": "^3.1.2", "@metamask/message-manager": "^11.0.0", @@ -348,7 +348,7 @@ "@metamask/snaps-rpc-methods": "^11.9.0", "@metamask/snaps-sdk": "^6.15.0", "@metamask/snaps-utils": "^8.8.0", - "@metamask/solana-wallet-snap": "^1.0.4", + "@metamask/solana-wallet-snap": "^1.1.0", "@metamask/transaction-controller": "^42.1.0", "@metamask/user-operation-controller": "^21.0.0", "@metamask/utils": "^10.0.1", diff --git a/privacy-snapshot.json b/privacy-snapshot.json index 5cd9d9d399d1..190d8803e4f6 100644 --- a/privacy-snapshot.json +++ b/privacy-snapshot.json @@ -1,11 +1,13 @@ [ "*.btc*.quiknode.pro", + "*solana*.mainnet.rpcpool.com", "accounts.api.cx.metamask.io", "acl.execution.metamask.io", "api.blockchair.com", "api.devnet.solana.com", "api.lens.dev", "api.segment.io", + "api.simplehash.com", "api.web3modal.com", "app.ens.domains", "arbitrum-mainnet.infura.io", diff --git a/test/data/mock-accounts.ts b/test/data/mock-accounts.ts index eab4cd4aa74d..c65a6b7bd162 100644 --- a/test/data/mock-accounts.ts +++ b/test/data/mock-accounts.ts @@ -4,6 +4,8 @@ import { EthAccountType, BtcMethod, BtcAccountType, + EthScopes, + BtcScopes, } from '@metamask/keyring-api'; import { ETH_EOA_METHODS, @@ -15,6 +17,7 @@ export const MOCK_ACCOUNT_EOA: InternalAccount = { address: '0x123', options: {}, methods: ETH_EOA_METHODS, + scopes: [EthScopes.Namespace], type: EthAccountType.Eoa, metadata: { name: 'Account 1', @@ -29,6 +32,8 @@ export const MOCK_ACCOUNT_ERC4337: InternalAccount = { address: '0x123', options: {}, methods: ETH_EOA_METHODS.concat(ETH_4337_METHODS), + // Smart accounts might not be available on every EVM chains, but that's ok for mock purposes. + scopes: [EthScopes.Namespace], type: EthAccountType.Erc4337, metadata: { name: 'Account 2', @@ -43,6 +48,7 @@ export const MOCK_ACCOUNT_BIP122_P2WPKH: InternalAccount = { address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k', options: {}, methods: [BtcMethod.SendBitcoin], + scopes: [BtcScopes.Mainnet], type: BtcAccountType.P2wpkh, metadata: { name: 'Bitcoin Account', @@ -57,6 +63,7 @@ export const MOCK_ACCOUNT_BIP122_P2WPKH_TESTNET: InternalAccount = { address: 'tb1q6rmsq3vlfdhjdhtkxlqtuhhlr6pmj09y6w43g8', options: {}, methods: [BtcMethod.SendBitcoin], + scopes: [BtcScopes.Testnet], type: BtcAccountType.P2wpkh, metadata: { name: 'Bitcoin Testnet Account', diff --git a/test/data/mock-state.json b/test/data/mock-state.json index 9285d5da2261..c7bea2841a05 100644 --- a/test/data/mock-state.json +++ b/test/data/mock-state.json @@ -483,6 +483,7 @@ "eth_signTypedData_v3", "eth_signTypedData_v4" ], + "scopes": ["eip155"], "type": "eip155:eoa" }, "07c2cfec-36c9-46c4-8115-3836d3ac9047": { @@ -503,6 +504,7 @@ "eth_signTypedData_v3", "eth_signTypedData_v4" ], + "scopes": ["eip155"], "type": "eip155:eoa" }, "15e69915-2a1a-4019-93b3-916e11fd432f": { @@ -523,6 +525,7 @@ "eth_signTypedData_v3", "eth_signTypedData_v4" ], + "scopes": ["eip155"], "type": "eip155:eoa" }, "784225f4-d30b-4e77-a900-c8bbce735b88": { @@ -543,6 +546,7 @@ "eth_signTypedData_v3", "eth_signTypedData_v4" ], + "scopes": ["eip155"], "type": "eip155:eoa" }, "694225f4-d30b-4e77-a900-c8bbce735b42": { @@ -563,6 +567,7 @@ "eth_signTypedData_v3", "eth_signTypedData_v4" ], + "scopes": ["eip155"], "type": "eip155:eoa" }, "c3deeb99-ba0d-4a4e-a0aa-033fc1f79ae3": { @@ -588,6 +593,7 @@ "eth_signTypedData_v3", "eth_signTypedData_v4" ], + "scopes": ["eip155"], "type": "eip155:eoa" } }, diff --git a/test/e2e/constants.ts b/test/e2e/constants.ts index 2826200dc293..23c52a91c653 100644 --- a/test/e2e/constants.ts +++ b/test/e2e/constants.ts @@ -20,7 +20,7 @@ export const BUNDLER_URL = 'http://localhost:3000/rpc'; /* URL of the 4337 account snap site. */ export const ERC_4337_ACCOUNT_SNAP_URL = - 'https://metamask.github.io/snap-account-abstraction-keyring/0.4.2/'; + 'https://metamask.github.io/snap-account-abstraction-keyring/0.5.0/'; /* Salt used to generate the 4337 account. */ export const ERC_4337_ACCOUNT_SALT = '0x1'; @@ -48,6 +48,9 @@ export const DAPP_ONE_URL = 'http://127.0.0.1:8081'; /* Default BTC address created using test SRP */ export const DEFAULT_BTC_ACCOUNT = 'bc1qg6whd6pc0cguh6gpp3ewujm53hv32ta9hdp252'; +/* Default (mocked) block number. */ +export const DEFAULT_BTC_BLOCK_NUMBER = 101100110; + /* Default (mocked) BTC balance used by the Bitcoin RPC provider */ export const DEFAULT_BTC_BALANCE = 1; // BTC diff --git a/test/e2e/flask/btc/common-btc.ts b/test/e2e/flask/btc/common-btc.ts index a9b87f11499a..954742c08b57 100644 --- a/test/e2e/flask/btc/common-btc.ts +++ b/test/e2e/flask/btc/common-btc.ts @@ -8,6 +8,7 @@ import { DEFAULT_BTC_FEES_RATE, DEFAULT_BTC_TRANSACTION_ID, DEFAULT_BTC_CONVERSION_RATE, + DEFAULT_BTC_BLOCK_NUMBER, SATS_IN_1_BTC, } from '../../constants'; import { MultichainNetworks } from '../../../../shared/constants/multichain/networks'; @@ -16,6 +17,7 @@ import { loginWithBalanceValidation } from '../../page-objects/flows/login.flow' import AccountListPage from '../../page-objects/pages/account-list-page'; import HeaderNavbar from '../../page-objects/pages/header-navbar'; +const SIMPLEHASH_URL = 'https://api.simplehash.com'; const QUICKNODE_URL_REGEX = /^https:\/\/.*\.btc.*\.quiknode\.pro(\/|$)/u; export enum SendFlowPlaceHolders { @@ -118,7 +120,7 @@ export async function mockGetUTXO(mockServer: Mockttp) { txid: DEFAULT_BTC_TRANSACTION_ID, vout: 0, value: btcToSats(DEFAULT_BTC_BALANCE).toString(), - height: 101100110, + height: DEFAULT_BTC_BLOCK_NUMBER, confirmations: 6, }, ], @@ -183,6 +185,36 @@ export async function mockRampsDynamicFeatureFlag( })); } +export async function mockBtcSatProtectionService( + mockServer: Mockttp, + address: string = DEFAULT_BTC_ACCOUNT, +) { + // NOTE: This endpoint is also used to compute the total balance if Sat Protection is enabled, so we have + // to compute the set of UTXOS here too. + const utxos = [ + { + output: `${DEFAULT_BTC_TRANSACTION_ID}:0`, + value: btcToSats(DEFAULT_BTC_BALANCE), + block_number: DEFAULT_BTC_BLOCK_NUMBER, + }, + ]; + + return await mockServer + .forGet(`${SIMPLEHASH_URL}/api/v0/custom/wallet_assets_by_utxo/${address}`) + .withQuery({ + without_inscriptions_runes_raresats: '1', + }) + .thenCallback(() => { + return { + statusCode: 200, + json: { + count: utxos.length, + utxos, + }, + }; + }); +} + export async function withBtcAccountSnap( { title, @@ -210,6 +242,8 @@ export async function withBtcAccountSnap( await mockBtcFeeCallQuote(mockServer), await mockGetUTXO(mockServer), await mockSendTransaction(mockServer), + // Sat Protection + await mockBtcSatProtectionService(mockServer), ], }, async ({ driver, mockServer }: { driver: Driver; mockServer: Mockttp }) => { diff --git a/test/e2e/flask/solana/common-solana.ts b/test/e2e/flask/solana/common-solana.ts index 3c3390b55a31..51df080351d5 100644 --- a/test/e2e/flask/solana/common-solana.ts +++ b/test/e2e/flask/solana/common-solana.ts @@ -222,6 +222,22 @@ export async function mockSolanaRatesCall(mockServer: Mockttp) { }); } +export async function mockGetTokenAccountsByOwner(mockServer: Mockttp) { + return await mockServer + .forPost(SOLANA_URL_REGEX) + .withJsonBodyIncluding({ + method: 'getTokenAccountsByOwner', + }) + .thenCallback(() => { + return { + statusCode: 200, + json: { + result: [], // Empty for now, it has been mocked to avoid network calls. + }, + }; + }); +} + export async function withSolanaAccountSnap( { title, @@ -257,6 +273,7 @@ export async function withSolanaAccountSnap( mockList.push([ await mockSolanaBalanceQuote(mockServer), await mockSolanaRatesCall(mockServer), + await mockGetTokenAccountsByOwner(mockServer), await mockGetSignaturesForAddress(mockServer), await mockMultiCoinPrice(mockServer), await mockGetLatestBlockhash(mockServer), diff --git a/test/e2e/mock-e2e.js b/test/e2e/mock-e2e.js index 72809ea62e48..d6d19d972d3b 100644 --- a/test/e2e/mock-e2e.js +++ b/test/e2e/mock-e2e.js @@ -83,7 +83,11 @@ const browserAPIRequestDomains = */ const privateHostMatchers = [ // { pattern: RegExp, host: string } - { pattern: /^.*\.btc.*\.quiknode.pro$/iu, host: '*.btc*.quiknode.pro' }, + { pattern: /^.*\.btc.*\.quiknode\.pro$/iu, host: '*.btc*.quiknode.pro' }, + { + pattern: /^.*-solana.*-.*\.mainnet\.rpcpool\.com/iu, + host: '*solana*.mainnet.rpcpool.com', + }, ]; /** diff --git a/test/jest/mocks.ts b/test/jest/mocks.ts index b165385d8f4b..5bbb9caf4727 100644 --- a/test/jest/mocks.ts +++ b/test/jest/mocks.ts @@ -4,6 +4,11 @@ import { BtcMethod, BtcAccountType, isEvmAccountType, + EthScopes, + BtcScopes, + SolAccountType, + SolScopes, + SolMethod, } from '@metamask/keyring-api'; import { InternalAccount } from '@metamask/keyring-internal-api'; import { KeyringTypes } from '@metamask/keyring-controller'; @@ -17,6 +22,7 @@ import { } from '../../ui/ducks/send'; import { MetaMaskReduxState } from '../../ui/store/store'; import mockState from '../data/mock-state.json'; +import { isBtcMainnetAddress } from '../../shared/lib/multichain'; export type MockState = typeof mockState; @@ -205,10 +211,12 @@ export function createMockInternalAccount({ }; options?: Record; } = {}) { + let scopes; let methods; switch (type) { case EthAccountType.Eoa: + scopes = [EthScopes.Namespace]; methods = [ EthMethod.PersonalSign, EthMethod.SignTransaction, @@ -218,15 +226,27 @@ export function createMockInternalAccount({ ]; break; case EthAccountType.Erc4337: + // NOTE: This is not really valid here, cause a SC account might not be deployed on + // every EVM chains, but for testing purposes we enable everything. + scopes = [EthScopes.Namespace]; methods = [ EthMethod.PatchUserOperation, EthMethod.PrepareUserOperation, EthMethod.SignUserOperation, ]; break; - case BtcAccountType.P2wpkh: + case BtcAccountType.P2wpkh: { + // If no address is given, we fallback to testnet + const isMainnet = Boolean(address) && isBtcMainnetAddress(address); + + scopes = [isMainnet ? BtcScopes.Mainnet : BtcScopes.Testnet]; methods = [BtcMethod.SendBitcoin]; break; + } + case SolAccountType.DataAccount: + scopes = [SolScopes.Mainnet, SolScopes.Testnet, SolScopes.Devnet]; + methods = [SolMethod.SendAndConfirmTransaction]; + break; default: throw new Error(`Unknown account type: ${type}`); } @@ -244,6 +264,7 @@ export function createMockInternalAccount({ lastSelected, }, options: options ?? {}, + scopes, methods, type, }; diff --git a/ui/components/multichain/connect-accounts-modal/connect-accounts-modal-list.test.tsx b/ui/components/multichain/connect-accounts-modal/connect-accounts-modal-list.test.tsx index 090a48f30b79..f0d5852370a0 100644 --- a/ui/components/multichain/connect-accounts-modal/connect-accounts-modal-list.test.tsx +++ b/ui/components/multichain/connect-accounts-modal/connect-accounts-modal-list.test.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { EthAccountType } from '@metamask/keyring-api'; +import { EthAccountType, EthScopes } from '@metamask/keyring-api'; import configureStore from '../../../store/store'; import mockState from '../../../../test/data/mock-state.json'; import { renderWithProvider } from '../../../../test/jest/rendering'; @@ -30,6 +30,7 @@ const render = () => { }, }, methods: ETH_EOA_METHODS, + scopes: [EthScopes.Namespace], type: EthAccountType.Eoa, options: {}, name: 'Custody Account A', diff --git a/ui/components/multichain/permission-details-modal/permission-details-modal.test.tsx b/ui/components/multichain/permission-details-modal/permission-details-modal.test.tsx index 3c3d5ff18bfa..5a2e941c4715 100644 --- a/ui/components/multichain/permission-details-modal/permission-details-modal.test.tsx +++ b/ui/components/multichain/permission-details-modal/permission-details-modal.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; import configureStore from 'redux-mock-store'; -import { EthAccountType, EthMethod } from '@metamask/keyring-api'; +import { EthAccountType, EthMethod, EthScopes } from '@metamask/keyring-api'; import { fireEvent, renderWithProvider } from '../../../../test/jest'; import { mockNetworkState } from '../../../../test/stub/networks'; import { CHAIN_IDS } from '../../../../shared/constants/network'; @@ -45,6 +45,7 @@ describe('PermissionDetailsModal', () => { }, options: {}, methods: [...Object.values(EthMethod)], + scopes: [EthScopes.Namespace], type: EthAccountType.Eoa, }, '07c2cfec-36c9-46c4-8115-3836d3ac9047': { @@ -61,6 +62,7 @@ describe('PermissionDetailsModal', () => { }, options: {}, methods: [...Object.values(EthMethod)], + scopes: [EthScopes.Namespace], type: EthAccountType.Eoa, }, }, @@ -128,6 +130,7 @@ describe('PermissionDetailsModal', () => { }, options: {}, methods: ETH_EOA_METHODS, + scopes: [EthScopes.Namespace], type: EthAccountType.Eoa, label: '', }, diff --git a/ui/hooks/accounts/useMultichainWalletSnapClient.test.ts b/ui/hooks/accounts/useMultichainWalletSnapClient.test.ts index 5efdbfd9b4ea..77a4e7563a2e 100644 --- a/ui/hooks/accounts/useMultichainWalletSnapClient.test.ts +++ b/ui/hooks/accounts/useMultichainWalletSnapClient.test.ts @@ -1,6 +1,13 @@ import { renderHook } from '@testing-library/react-hooks'; import { HandlerType } from '@metamask/snaps-utils'; -import { BtcAccountType, BtcMethod } from '@metamask/keyring-api'; +import { + BtcAccountType, + BtcMethod, + BtcScopes, + SolAccountType, + SolMethod, + SolScopes, +} from '@metamask/keyring-api'; import { MultichainNetworks } from '../../../shared/constants/multichain/networks'; import { BITCOIN_WALLET_SNAP_ID } from '../../../shared/lib/accounts/bitcoin-wallet-snap'; import { SOLANA_WALLET_SNAP_ID } from '../../../shared/lib/accounts/solana-wallet-snap'; @@ -36,6 +43,7 @@ describe('useMultichainWalletSnapClient', () => { id: '11a33c6b-0d46-43f4-a401-01587d575fd0', options: {}, methods: [BtcMethod.SendBitcoin], + scopes: [BtcScopes.Testnet], type: BtcAccountType.P2wpkh, }, }, @@ -47,9 +55,9 @@ describe('useMultichainWalletSnapClient', () => { address: '4mip4tgbhxf8dpqvtb3zhzzapwfvznanhssqzgjyp7ha', id: '22b44d7c-1e57-4b5b-8502-02698e686fd1', options: {}, - methods: ['someMethod'], - // TODO: Update when keyring-api is published with Solana types - type: BtcAccountType.P2wpkh, + methods: [SolMethod.SendAndConfirmTransaction], + scopes: [SolScopes.Mainnet, SolScopes.Testnet, SolScopes.Devnet], + type: SolAccountType.DataAccount, }, }, ]; diff --git a/ui/selectors/accounts.test.ts b/ui/selectors/accounts.test.ts index 033d88c30faa..4c1f85569d0f 100644 --- a/ui/selectors/accounts.test.ts +++ b/ui/selectors/accounts.test.ts @@ -1,4 +1,4 @@ -import { EthAccountType } from '@metamask/keyring-api'; +import { EthAccountType, EthScopes } from '@metamask/keyring-api'; import { ETH_EOA_METHODS } from '../../shared/constants/eth-methods'; import { MOCK_ACCOUNTS, @@ -58,7 +58,8 @@ describe('Accounts Selectors', () => { 'eth_signTypedData_v3', 'eth_signTypedData_v4', ], - type: 'eip155:eoa', + type: EthAccountType.Eoa, + scopes: [EthScopes.Namespace], }); }); @@ -88,6 +89,7 @@ describe('Accounts Selectors', () => { }, options: {}, methods: ETH_EOA_METHODS, + scopes: [EthScopes.Namespace], type: EthAccountType.Eoa, }; expect( diff --git a/ui/selectors/selectors.test.js b/ui/selectors/selectors.test.js index 143f0b9e3d74..08f3c1a6e4fc 100644 --- a/ui/selectors/selectors.test.js +++ b/ui/selectors/selectors.test.js @@ -1423,6 +1423,7 @@ describe('Selectors', () => { 'eth_signTypedData_v4', ], type: 'eip155:eoa', + scopes: ['eip155'], pinned: true, hidden: false, active: false, @@ -1448,6 +1449,7 @@ describe('Selectors', () => { 'eth_signTypedData_v4', ], type: 'eip155:eoa', + scopes: ['eip155'], pinned: true, hidden: false, active: false, @@ -1472,6 +1474,7 @@ describe('Selectors', () => { 'eth_signTypedData_v4', ], type: 'eip155:eoa', + scopes: ['eip155'], balance: '0x0', pinned: false, hidden: false, @@ -1498,6 +1501,7 @@ describe('Selectors', () => { 'eth_signTypedData_v4', ], type: 'eip155:eoa', + scopes: ['eip155'], balance: '0x0', pinned: false, hidden: false, @@ -1531,6 +1535,7 @@ describe('Selectors', () => { pinned: false, active: false, type: 'eip155:eoa', + scopes: ['eip155'], }, { id: '694225f4-d30b-4e77-a900-c8bbce735b42', @@ -1550,6 +1555,7 @@ describe('Selectors', () => { 'eth_signTypedData_v4', ], type: 'eip155:eoa', + scopes: ['eip155'], address: '0xca8f1F0245530118D0cf14a06b01Daf8f76Cf281', balance: '0x0', pinned: false, diff --git a/yarn.lock b/yarn.lock index 6172816a2ad2..41a83785c034 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4890,18 +4890,18 @@ __metadata: languageName: node linkType: hard -"@metamask/accounts-controller@npm:^20.0.2": - version: 20.0.2 - resolution: "@metamask/accounts-controller@npm:20.0.2" +"@metamask/accounts-controller@npm:^21.0.1": + version: 21.0.1 + resolution: "@metamask/accounts-controller@npm:21.0.1" dependencies: "@ethereumjs/util": "npm:^8.1.0" - "@metamask/base-controller": "npm:^7.0.2" - "@metamask/eth-snap-keyring": "npm:^7.0.0" - "@metamask/keyring-api": "npm:^12.0.0" - "@metamask/keyring-internal-api": "npm:^1.0.0" + "@metamask/base-controller": "npm:^7.1.1" + "@metamask/eth-snap-keyring": "npm:^8.1.0" + "@metamask/keyring-api": "npm:^13.0.0" + "@metamask/keyring-internal-api": "npm:^2.0.0" "@metamask/snaps-sdk": "npm:^6.7.0" "@metamask/snaps-utils": "npm:^8.3.0" - "@metamask/utils": "npm:^10.0.0" + "@metamask/utils": "npm:^11.0.1" deepmerge: "npm:^4.2.2" ethereum-cryptography: "npm:^2.1.2" immer: "npm:^9.0.6" @@ -4911,7 +4911,7 @@ __metadata: "@metamask/providers": ^18.1.0 "@metamask/snaps-controllers": ^9.7.0 webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0 - checksum: 10/4376418913fcdebda251c00a2f373ada5c5b26e45617ece3a5624bb0d7440bbfb1fb8332cae0f5f4fa04751fe2ffd8cea40fab342d54591fe21d8cd34c14744c + checksum: 10/1bbc454c6d160d8c67cd184be7533f96c4095969dfafbed7484ced6be90fd9746ec4e86948553f25b2d50b3579144345576d81c5bda508052d7cdcd2d1c723fb languageName: node linkType: hard @@ -5105,10 +5105,10 @@ __metadata: languageName: node linkType: hard -"@metamask/bitcoin-wallet-snap@npm:^0.8.2": - version: 0.8.2 - resolution: "@metamask/bitcoin-wallet-snap@npm:0.8.2" - checksum: 10/42da719ae59b12d7150e513f082351dab8f901587ca12897b43c0b5d9123bbf066a2666c48b81b25e594f97ef237e1d1d7e9ccea8bd9bfb54910c5cd8d43b420 +"@metamask/bitcoin-wallet-snap@npm:^0.9.0": + version: 0.9.0 + resolution: "@metamask/bitcoin-wallet-snap@npm:0.9.0" + checksum: 10/266f4ad6f877c1955957082ec903e2d42dcf6e07f232d7666d85e0808c1bf86fa8ed3664342e8a3a9b2e0681c2caf57904e0c4bdece131c3c0f6c60e30bb7430 languageName: node linkType: hard @@ -5418,27 +5418,28 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-snap-keyring@npm:^7.0.0": - version: 7.0.0 - resolution: "@metamask/eth-snap-keyring@npm:7.0.0" +"@metamask/eth-snap-keyring@npm:^8.1.0": + version: 8.1.0 + resolution: "@metamask/eth-snap-keyring@npm:8.1.0" dependencies: "@ethereumjs/tx": "npm:^4.2.0" - "@metamask/eth-sig-util": "npm:^8.0.0" - "@metamask/keyring-api": "npm:^12.0.0" - "@metamask/keyring-internal-api": "npm:^1.0.0" - "@metamask/keyring-internal-snap-client": "npm:^1.0.0" + "@metamask/eth-sig-util": "npm:^8.1.2" + "@metamask/keyring-api": "npm:^13.0.0" + "@metamask/keyring-internal-api": "npm:^2.0.0" + "@metamask/keyring-internal-snap-client": "npm:^2.0.0" + "@metamask/keyring-utils": "npm:^1.1.0" "@metamask/snaps-controllers": "npm:^9.10.0" "@metamask/snaps-sdk": "npm:^6.7.0" "@metamask/snaps-utils": "npm:^8.3.0" "@metamask/superstruct": "npm:^3.1.0" - "@metamask/utils": "npm:^9.3.0" + "@metamask/utils": "npm:^11.0.1" "@types/uuid": "npm:^9.0.8" uuid: "npm:^9.0.1" webextension-polyfill: "npm:^0.12.0" peerDependencies: - "@metamask/keyring-api": ^12.0.0 - "@metamask/providers": ^18.1.0 - checksum: 10/7a82cd2c19204776d31e29716844ac6f304ce4b136b36728be8e7b19ac2be6b46d0c72cc9707c48669a7a342994ce401aafbfe3f0b47769748ab86ae2169cbbd + "@metamask/keyring-api": ^13.0.0 + "@metamask/providers": ^18.3.1 + checksum: 10/4b758f14540cf8ea892a80d8cf70234305e7f6978ab46dc58b727d6c6944d11dee22841fc17b22a7620662a5051ec189675f2dd06638733b9b1c3e8436c8b623 languageName: node linkType: hard @@ -5653,18 +5654,6 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-api@npm:^12.0.0": - version: 12.0.0 - resolution: "@metamask/keyring-api@npm:12.0.0" - dependencies: - "@metamask/keyring-utils": "npm:^1.0.0" - "@metamask/superstruct": "npm:^3.1.0" - "@metamask/utils": "npm:^9.3.0" - bech32: "npm:^2.0.0" - checksum: 10/ba8b75c55d3fcb9f8b52c58ff141cba81f7c416c3fa684e089965717ea129d50e8df7a73e7ab1c96eaf59d70b6e2dd8a618434939b75ef0d3402b547b5196877 - languageName: node - linkType: hard - "@metamask/keyring-api@npm:^13.0.0": version: 13.0.0 resolution: "@metamask/keyring-api@npm:13.0.0" @@ -5677,7 +5666,7 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-controller@npm:^19.0.2, @metamask/keyring-controller@npm:^19.0.3": +"@metamask/keyring-controller@npm:^19.0.3": version: 19.0.3 resolution: "@metamask/keyring-controller@npm:19.0.3" dependencies: @@ -5699,18 +5688,6 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-internal-api@npm:^1.0.0": - version: 1.0.0 - resolution: "@metamask/keyring-internal-api@npm:1.0.0" - dependencies: - "@metamask/keyring-api": "npm:^12.0.0" - "@metamask/keyring-utils": "npm:^1.0.0" - "@metamask/superstruct": "npm:^3.1.0" - "@metamask/utils": "npm:^9.3.0" - checksum: 10/dd0fff93ddfdce008f1db82d404bd040d09840413723c831819d3a7f4c2819a4303657e4acd7578cfd22bd05ad9c7aa563fc88f13f2f06999e2325ada71b824c - languageName: node - linkType: hard - "@metamask/keyring-internal-api@npm:^2.0.0": version: 2.0.0 resolution: "@metamask/keyring-internal-api@npm:2.0.0" @@ -5723,46 +5700,47 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-internal-snap-client@npm:^1.0.0": - version: 1.0.0 - resolution: "@metamask/keyring-internal-snap-client@npm:1.0.0" +"@metamask/keyring-internal-snap-client@npm:^2.0.0": + version: 2.0.0 + resolution: "@metamask/keyring-internal-snap-client@npm:2.0.0" dependencies: - "@metamask/keyring-api": "npm:^12.0.0" - "@metamask/keyring-snap-client": "npm:^1.0.0" + "@metamask/keyring-api": "npm:^13.0.0" + "@metamask/keyring-snap-client": "npm:^2.0.0" "@metamask/keyring-utils": "npm:^1.0.0" "@metamask/snaps-controllers": "npm:^9.10.0" "@metamask/snaps-sdk": "npm:^6.7.0" "@metamask/snaps-utils": "npm:^8.3.0" webextension-polyfill: "npm:^0.12.0" peerDependencies: - "@metamask/providers": ^18.1.0 - checksum: 10/4c02429235bf5b3609fe2d728f0f976fc87cc276483c092d155b181eeb1f167953a96226c4f6b64f6700084f8a66e5b02944ba0accf201e3514e83df205389e1 + "@metamask/providers": ^18.3.1 + checksum: 10/51c1d9a376af9e0984ae68b3cfe1ee04f710470899a1e5394221148069e9433a2cdd776620ad7e14cebd27d027f3761ad494c373213e9c41bb606dc8a879433c languageName: node linkType: hard -"@metamask/keyring-snap-client@npm:^1.0.0": - version: 1.0.0 - resolution: "@metamask/keyring-snap-client@npm:1.0.0" +"@metamask/keyring-snap-client@npm:^2.0.0": + version: 2.0.0 + resolution: "@metamask/keyring-snap-client@npm:2.0.0" dependencies: - "@metamask/keyring-api": "npm:^12.0.0" + "@metamask/keyring-api": "npm:^13.0.0" "@metamask/keyring-utils": "npm:^1.0.0" "@metamask/superstruct": "npm:^3.1.0" "@types/uuid": "npm:^9.0.8" uuid: "npm:^9.0.1" webextension-polyfill: "npm:^0.12.0" peerDependencies: - "@metamask/providers": ^18.1.0 - checksum: 10/7b3ee4ab6b39f8e06d55dee2c29f778eeb2eeb8bb311eccaab07d1f8a855fa920bf52e78bd2be0f3ddcb66dc475282d740de0cc7337ccd99e956302a706d76a0 + "@metamask/providers": ^18.3.1 + checksum: 10/64fe458beeba190fec5891bcdf2f16ba410131cbd56a04b9276df5f43636b28e0ef9d1b4b9d30acefe4c87a253cc5908954e47666953f6f27a8cc2481758638f languageName: node linkType: hard -"@metamask/keyring-utils@npm:^1.0.0": - version: 1.0.0 - resolution: "@metamask/keyring-utils@npm:1.0.0" +"@metamask/keyring-utils@npm:^1.0.0, @metamask/keyring-utils@npm:^1.1.0": + version: 1.1.0 + resolution: "@metamask/keyring-utils@npm:1.1.0" dependencies: "@metamask/superstruct": "npm:^3.1.0" - "@metamask/utils": "npm:^9.3.0" - checksum: 10/f74f7343a7154b029e0fa4c25735c589eba4dc25a9e323d43b7c733ce5dbb23ce603a4f02aac455163993649ceeaf714b8b843985ba7a9cb00b926b3b8dc6b51 + "@metamask/utils": "npm:^11.0.1" + bitcoin-address-validation: "npm:^2.2.3" + checksum: 10/327eb37dcee41f47df212a9790672deec15c11692e370c15bb5687a2c90078b4d14dc61a9d7ce317e4bda03f18284731229feee19c1adae35bc859313da37ba5 languageName: node linkType: hard @@ -6403,10 +6381,10 @@ __metadata: languageName: node linkType: hard -"@metamask/solana-wallet-snap@npm:^1.0.4": - version: 1.0.4 - resolution: "@metamask/solana-wallet-snap@npm:1.0.4" - checksum: 10/4d3b2a400607299fb4200e409f151e999e980e30521e63dcbbb5b658a4fdcfd6be341452695de32d985e14e8f8d4c5c24169f84dfd1a2063d3bc35f0c4903f74 +"@metamask/solana-wallet-snap@npm:^1.1.0": + version: 1.1.0 + resolution: "@metamask/solana-wallet-snap@npm:1.1.0" + checksum: 10/eaad44e647e06664725e237cb7f3d24f6125756b2acf36154f207bf5944946b7f559fcdb7afe969090a46ce43417d7cb46ca3b2a91ea46b50b1cbaf4b73b0b02 languageName: node linkType: hard @@ -6565,7 +6543,7 @@ __metadata: languageName: node linkType: hard -"@metamask/utils@npm:^9.0.0, @metamask/utils@npm:^9.1.0, @metamask/utils@npm:^9.2.1, @metamask/utils@npm:^9.3.0": +"@metamask/utils@npm:^9.0.0, @metamask/utils@npm:^9.1.0, @metamask/utils@npm:^9.2.1": version: 9.3.0 resolution: "@metamask/utils@npm:9.3.0" dependencies: @@ -7831,9 +7809,9 @@ __metadata: linkType: hard "@scure/base@npm:^1.0.0, @scure/base@npm:^1.1.1, @scure/base@npm:^1.1.3, @scure/base@npm:~1.1.0, @scure/base@npm:~1.1.3, @scure/base@npm:~1.1.6": - version: 1.1.9 - resolution: "@scure/base@npm:1.1.9" - checksum: 10/f0ab7f687bbcdee2a01377fe3cd808bf63977999672751295b6a92625d5322f4754a96d40f6bd579bc367aad48ecf8a4e6d0390e70296e6ded1076f52adb16bb + version: 1.1.7 + resolution: "@scure/base@npm:1.1.7" + checksum: 10/fc50ffaab36cb46ff9fa4dc5052a06089ab6a6707f63d596bb34aaaec76173c9a564ac312a0b981b5e7a5349d60097b8878673c75d6cbfc4da7012b63a82099b languageName: node linkType: hard @@ -15901,11 +15879,14 @@ __metadata: linkType: hard "crc-32@npm:^1.2.0": - version: 1.2.2 - resolution: "crc-32@npm:1.2.2" + version: 1.2.0 + resolution: "crc-32@npm:1.2.0" + dependencies: + exit-on-epipe: "npm:~1.0.1" + printj: "npm:~1.1.0" bin: - crc32: bin/crc32.njs - checksum: 10/824f696a5baaf617809aa9cd033313c8f94f12d15ebffa69f10202480396be44aef9831d900ab291638a8022ed91c360696dd5b1ba691eb3f34e60be8835b7c3 + crc32: ./bin/crc32.njs + checksum: 10/10c648c986b005ed0ea8393bb0d1ccb99e7a102505b136d313dee6abe204aa682d9bb9bc6fd180f9cd98ef92aa029964f1cc96a2a85eb50507dedd9ead1a262f languageName: node linkType: hard @@ -19170,6 +19151,13 @@ __metadata: languageName: node linkType: hard +"exit-on-epipe@npm:~1.0.1": + version: 1.0.1 + resolution: "exit-on-epipe@npm:1.0.1" + checksum: 10/b180aa277aec5bef2609b34e5876061f421a1f81bf343beb213c4d60b382ddcb6b83012833f0ba329d6bc38042685c8d89b1c52ea495b9b6327948ea80627398 + languageName: node + linkType: hard + "exit@npm:^0.1.2": version: 0.1.2 resolution: "exit@npm:0.1.2" @@ -26618,7 +26606,7 @@ __metadata: "@metamask-institutional/types": "npm:^1.2.0" "@metamask/abi-utils": "npm:^2.0.2" "@metamask/account-watcher": "npm:^4.1.2" - "@metamask/accounts-controller": "npm:^20.0.2" + "@metamask/accounts-controller": "npm:^21.0.1" "@metamask/address-book-controller": "npm:^6.0.0" "@metamask/announcement-controller": "npm:^7.0.0" "@metamask/api-specs": "npm:^0.9.3" @@ -26626,7 +26614,7 @@ __metadata: "@metamask/assets-controllers": "patch:@metamask/assets-controllers@patch%3A@metamask/assets-controllers@npm%253A45.1.0%23~/.yarn/patches/@metamask-assets-controllers-npm-45.1.0-d914c453f0.patch%3A%3Aversion=45.1.0&hash=cfcadc#~/.yarn/patches/@metamask-assets-controllers-patch-d6ed5f8213.patch" "@metamask/auto-changelog": "npm:^2.1.0" "@metamask/base-controller": "npm:^7.0.0" - "@metamask/bitcoin-wallet-snap": "npm:^0.8.2" + "@metamask/bitcoin-wallet-snap": "npm:^0.9.0" "@metamask/browser-passworder": "npm:^4.3.0" "@metamask/build-utils": "npm:^3.0.0" "@metamask/contract-metadata": "npm:^2.5.0" @@ -26645,7 +26633,7 @@ __metadata: "@metamask/eth-json-rpc-provider": "npm:^4.1.6" "@metamask/eth-ledger-bridge-keyring": "npm:^8.0.2" "@metamask/eth-sig-util": "npm:^7.0.1" - "@metamask/eth-snap-keyring": "npm:^7.0.0" + "@metamask/eth-snap-keyring": "npm:^8.1.0" "@metamask/eth-token-tracker": "npm:^9.0.0" "@metamask/eth-trezor-keyring": "npm:^6.0.0" "@metamask/etherscan-link": "npm:^3.0.0" @@ -26654,10 +26642,10 @@ __metadata: "@metamask/jazzicon": "npm:^2.0.0" "@metamask/json-rpc-engine": "npm:^10.0.0" "@metamask/json-rpc-middleware-stream": "npm:^8.0.4" - "@metamask/keyring-api": "npm:^12.0.0" - "@metamask/keyring-controller": "npm:^19.0.2" - "@metamask/keyring-internal-api": "npm:^1.0.0" - "@metamask/keyring-snap-client": "npm:^1.0.0" + "@metamask/keyring-api": "npm:^13.0.0" + "@metamask/keyring-controller": "npm:^19.0.3" + "@metamask/keyring-internal-api": "npm:^2.0.0" + "@metamask/keyring-snap-client": "npm:^2.0.0" "@metamask/logging-controller": "npm:^6.0.0" "@metamask/logo": "npm:^3.1.2" "@metamask/message-manager": "npm:^11.0.0" @@ -26693,7 +26681,7 @@ __metadata: "@metamask/snaps-rpc-methods": "npm:^11.9.0" "@metamask/snaps-sdk": "npm:^6.15.0" "@metamask/snaps-utils": "npm:^8.8.0" - "@metamask/solana-wallet-snap": "npm:^1.0.4" + "@metamask/solana-wallet-snap": "npm:^1.1.0" "@metamask/test-bundler": "npm:^1.0.0" "@metamask/test-dapp": "npm:8.13.0" "@metamask/transaction-controller": "npm:^42.1.0" @@ -30362,6 +30350,15 @@ __metadata: languageName: node linkType: hard +"printj@npm:~1.1.0": + version: 1.1.2 + resolution: "printj@npm:1.1.2" + bin: + printj: ./bin/printj.njs + checksum: 10/45376a5ee7ef2e0d7ff0b4fecc893d73995a332e63d7e0622a544fe662c8213d22f0c9750e627c6d732a7d7a543266be960e6cd51cf19485cce87cf80468bb41 + languageName: node + linkType: hard + "prismjs@npm:^1.27.0": version: 1.29.0 resolution: "prismjs@npm:1.29.0"