diff --git a/app/scripts/lib/snap-keyring/snap-keyring.ts b/app/scripts/lib/snap-keyring/snap-keyring.ts index 5ceddd6a877a..213c2f1f4b5f 100644 --- a/app/scripts/lib/snap-keyring/snap-keyring.ts +++ b/app/scripts/lib/snap-keyring/snap-keyring.ts @@ -14,6 +14,7 @@ import type { KeyringControllerGetAccountsAction } from '@metamask/keyring-contr import browser from 'webextension-polyfill'; import { RestrictedControllerMessenger } from '@metamask/base-controller'; import { MaybeUpdateState, TestOrigin } from '@metamask/phishing-controller'; +import { SnapId } from '@metamask/snaps-sdk'; import { SNAP_MANAGE_ACCOUNTS_CONFIRMATION_TYPES } from '../../../../shared/constants/app'; import { t } from '../../translate'; import MetamaskController from '../../metamask-controller'; @@ -28,7 +29,7 @@ import { isBlockedUrl } from './utils/isBlockedUrl'; */ export const getAccountsBySnapId = async ( controller: MetamaskController, - snapId: string, + snapId: SnapId, ) => { const snapKeyring: SnapKeyring = await controller.getSnapKeyring(); return await snapKeyring.getAccountsBySnapId(snapId); diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 52ab7b6c6c68..f3f9157c4ed2 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -1064,14 +1064,21 @@ }, "packages": { "@ethereumjs/tx": true, + "@metamask/eth-snap-keyring>@metamask/keyring-api": true, "@metamask/eth-snap-keyring>uuid": true, - "@metamask/keyring-api": true, "@metamask/message-manager>@metamask/eth-sig-util": true, "@metamask/utils": true, "superstruct": true, "webpack>events": true } }, + "@metamask/eth-snap-keyring>@metamask/keyring-api": { + "packages": { + "@metamask/eth-snap-keyring>uuid": true, + "@metamask/utils": true, + "superstruct": true + } + }, "@metamask/eth-snap-keyring>uuid": { "globals": { "crypto": true diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index d2350de288b4..381a03e1f718 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -1141,14 +1141,21 @@ }, "packages": { "@ethereumjs/tx": true, + "@metamask/eth-snap-keyring>@metamask/keyring-api": true, "@metamask/eth-snap-keyring>uuid": true, - "@metamask/keyring-api": true, "@metamask/message-manager>@metamask/eth-sig-util": true, "@metamask/utils": true, "superstruct": true, "webpack>events": true } }, + "@metamask/eth-snap-keyring>@metamask/keyring-api": { + "packages": { + "@metamask/eth-snap-keyring>uuid": true, + "@metamask/utils": true, + "superstruct": true + } + }, "@metamask/eth-snap-keyring>uuid": { "globals": { "crypto": true diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 9a47d44a12e2..3b71f9b2b157 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -1141,14 +1141,21 @@ }, "packages": { "@ethereumjs/tx": true, + "@metamask/eth-snap-keyring>@metamask/keyring-api": true, "@metamask/eth-snap-keyring>uuid": true, - "@metamask/keyring-api": true, "@metamask/message-manager>@metamask/eth-sig-util": true, "@metamask/utils": true, "superstruct": true, "webpack>events": true } }, + "@metamask/eth-snap-keyring>@metamask/keyring-api": { + "packages": { + "@metamask/eth-snap-keyring>uuid": true, + "@metamask/utils": true, + "superstruct": true + } + }, "@metamask/eth-snap-keyring>uuid": { "globals": { "crypto": true diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index f02deda76dff..bdfc12707e07 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -1064,14 +1064,21 @@ }, "packages": { "@ethereumjs/tx": true, + "@metamask/eth-snap-keyring>@metamask/keyring-api": true, "@metamask/eth-snap-keyring>uuid": true, - "@metamask/keyring-api": true, "@metamask/message-manager>@metamask/eth-sig-util": true, "@metamask/utils": true, "superstruct": true, "webpack>events": true } }, + "@metamask/eth-snap-keyring>@metamask/keyring-api": { + "packages": { + "@metamask/eth-snap-keyring>uuid": true, + "@metamask/utils": true, + "superstruct": true + } + }, "@metamask/eth-snap-keyring>uuid": { "globals": { "crypto": true diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 33def388e930..66879974c9bd 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -1196,14 +1196,21 @@ }, "packages": { "@ethereumjs/tx": true, + "@metamask/eth-snap-keyring>@metamask/keyring-api": true, "@metamask/eth-snap-keyring>uuid": true, - "@metamask/keyring-api": true, "@metamask/message-manager>@metamask/eth-sig-util": true, "@metamask/utils": true, "superstruct": true, "webpack>events": true } }, + "@metamask/eth-snap-keyring>@metamask/keyring-api": { + "packages": { + "@metamask/eth-snap-keyring>uuid": true, + "@metamask/utils": true, + "superstruct": true + } + }, "@metamask/eth-snap-keyring>uuid": { "globals": { "crypto": true diff --git a/package.json b/package.json index c602bdc87e2a..13e854136bed 100644 --- a/package.json +++ b/package.json @@ -260,7 +260,7 @@ "@metamask/eth-keyring-controller": "^15.1.0", "@metamask/eth-ledger-bridge-keyring": "^2.0.1", "@metamask/eth-query": "^3.0.1", - "@metamask/eth-snap-keyring": "^2.0.0", + "@metamask/eth-snap-keyring": "^2.1.1", "@metamask/eth-token-tracker": "^4.0.0", "@metamask/eth-trezor-keyring": "^3.0.0", "@metamask/etherscan-link": "^2.2.0", diff --git a/yarn.lock b/yarn.lock index ce6fb3d57e4e..7b3e6cd2002c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4202,19 +4202,20 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-snap-keyring@npm:^2.0.0": - version: 2.0.0 - resolution: "@metamask/eth-snap-keyring@npm:2.0.0" +"@metamask/eth-snap-keyring@npm:^2.0.0, @metamask/eth-snap-keyring@npm:^2.1.1": + version: 2.1.1 + resolution: "@metamask/eth-snap-keyring@npm:2.1.1" dependencies: "@ethereumjs/tx": "npm:^4.2.0" "@metamask/eth-sig-util": "npm:^7.0.0" - "@metamask/keyring-api": "npm:^1.0.0" - "@metamask/snaps-controllers": "npm:^3.0.0" + "@metamask/keyring-api": "npm:^2.0.0" + "@metamask/snaps-controllers": "npm:^3.4.1" + "@metamask/snaps-sdk": "npm:^1.2.0" "@metamask/utils": "npm:^8.1.0" "@types/uuid": "npm:^9.0.1" superstruct: "npm:^1.0.3" uuid: "npm:^9.0.0" - checksum: fede2a3c0b32ad7efb7eccd2795d1facb255930122a2bee49343669d8e54b34552925aff0908766bbd2d8d9d1e3a94b1921dbc77420f1130b080ec7c22bf6c73 + checksum: 7958f5beedddee9d74b46ee91e214e0e4893ddc981b7d713f85037b3efddd3368954b946b21056f1bdde08aa93c0a088e848d21ba6f06c9d8643bd39cc29a2c2 languageName: node linkType: hard @@ -4375,6 +4376,22 @@ __metadata: languageName: node linkType: hard +"@metamask/keyring-api@npm:^2.0.0": + version: 2.0.0 + resolution: "@metamask/keyring-api@npm:2.0.0" + dependencies: + "@metamask/providers": "npm:^14.0.1" + "@metamask/snaps-controllers": "npm:^3.4.1" + "@metamask/snaps-sdk": "npm:^1.2.0" + "@metamask/snaps-utils": "npm:^5.0.0" + "@metamask/utils": "npm:^8.1.0" + "@types/uuid": "npm:^9.0.1" + superstruct: "npm:^1.0.3" + uuid: "npm:^9.0.0" + checksum: 65dcca4d7f94102fafbccbb3ee79647f94f92985e8e3dab795fde5ee563fd3ff050ec59ee16c0276d06bb7d474a2281c504d2dc7cac60df3b2bfc918aa17615f + languageName: node + linkType: hard + "@metamask/keyring-controller@npm:9.0.0": version: 9.0.0 resolution: "@metamask/keyring-controller@npm:9.0.0" @@ -4803,7 +4820,7 @@ __metadata: languageName: node linkType: hard -"@metamask/providers@npm:^14.0.2": +"@metamask/providers@npm:^14.0.1, @metamask/providers@npm:^14.0.2": version: 14.0.2 resolution: "@metamask/providers@npm:14.0.2" dependencies: @@ -4984,7 +5001,7 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-controllers@npm:^3.0.0, @metamask/snaps-controllers@npm:^3.5.1": +"@metamask/snaps-controllers@npm:^3.0.0, @metamask/snaps-controllers@npm:^3.4.1, @metamask/snaps-controllers@npm:^3.5.1": version: 3.5.1 resolution: "@metamask/snaps-controllers@npm:3.5.1" dependencies: @@ -5113,7 +5130,7 @@ __metadata: languageName: node linkType: hard -"@metamask/snaps-utils@npm:^5.1.0": +"@metamask/snaps-utils@npm:^5.0.0, @metamask/snaps-utils@npm:^5.1.0": version: 5.1.0 resolution: "@metamask/snaps-utils@npm:5.1.0" dependencies: @@ -24349,7 +24366,7 @@ __metadata: "@metamask/eth-keyring-controller": "npm:^15.1.0" "@metamask/eth-ledger-bridge-keyring": "npm:^2.0.1" "@metamask/eth-query": "npm:^3.0.1" - "@metamask/eth-snap-keyring": "npm:^2.0.0" + "@metamask/eth-snap-keyring": "npm:^2.1.1" "@metamask/eth-token-tracker": "npm:^4.0.0" "@metamask/eth-trezor-keyring": "npm:^3.0.0" "@metamask/etherscan-link": "npm:^2.2.0"