diff --git a/packages/snaps-controllers/package.json b/packages/snaps-controllers/package.json index 586eb707e0..2d5c83302a 100644 --- a/packages/snaps-controllers/package.json +++ b/packages/snaps-controllers/package.json @@ -53,13 +53,13 @@ "build:ci": "tsup --clean" }, "dependencies": { - "@metamask/approval-controller": "^6.0.2", - "@metamask/base-controller": "^5.0.2", - "@metamask/json-rpc-engine": "^8.0.1", - "@metamask/json-rpc-middleware-stream": "^7.0.1", + "@metamask/approval-controller": "^7.0.0", + "@metamask/base-controller": "^6.0.0", + "@metamask/json-rpc-engine": "^9.0.0", + "@metamask/json-rpc-middleware-stream": "^8.0.0", "@metamask/object-multiplex": "^2.0.0", - "@metamask/permission-controller": "^9.0.2", - "@metamask/phishing-controller": "^9.0.1", + "@metamask/permission-controller": "^10.0.0", + "@metamask/phishing-controller": "^10.0.0", "@metamask/post-message-stream": "^8.1.0", "@metamask/rpc-errors": "^6.2.1", "@metamask/snaps-registry": "^3.1.0", diff --git a/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json index 05f54b1c44..0dfa39a79b 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/iframe/policy.json @@ -42,8 +42,8 @@ "console": true }, "packages": { - "@metamask/json-rpc-engine": true, "@metamask/object-multiplex": true, + "@metamask/providers>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/json-rpc-middleware-stream": true, "@metamask/providers>@metamask/safe-event-emitter": true, "@metamask/providers>is-stream": true, @@ -52,6 +52,13 @@ "readable-stream": true } }, + "@metamask/providers>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/rpc-errors": true, + "@metamask/utils": true + } + }, "@metamask/providers>@metamask/json-rpc-middleware-stream": { "globals": { "console.warn": true, diff --git a/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json index 031910b1cc..ae4dafe535 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/node-process/policy.json @@ -49,8 +49,8 @@ "console": true }, "packages": { - "@metamask/json-rpc-engine": true, "@metamask/object-multiplex": true, + "@metamask/providers>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/json-rpc-middleware-stream": true, "@metamask/providers>@metamask/safe-event-emitter": true, "@metamask/providers>is-stream": true, @@ -59,6 +59,13 @@ "readable-stream": true } }, + "@metamask/providers>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/rpc-errors": true, + "@metamask/utils": true + } + }, "@metamask/providers>@metamask/json-rpc-middleware-stream": { "globals": { "console.warn": true, diff --git a/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json index 031910b1cc..ae4dafe535 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/node-thread/policy.json @@ -49,8 +49,8 @@ "console": true }, "packages": { - "@metamask/json-rpc-engine": true, "@metamask/object-multiplex": true, + "@metamask/providers>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/json-rpc-middleware-stream": true, "@metamask/providers>@metamask/safe-event-emitter": true, "@metamask/providers>is-stream": true, @@ -59,6 +59,13 @@ "readable-stream": true } }, + "@metamask/providers>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/rpc-errors": true, + "@metamask/utils": true + } + }, "@metamask/providers>@metamask/json-rpc-middleware-stream": { "globals": { "console.warn": true, diff --git a/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json b/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json index 05f54b1c44..0dfa39a79b 100644 --- a/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json +++ b/packages/snaps-execution-environments/lavamoat/browserify/worker-executor/policy.json @@ -42,8 +42,8 @@ "console": true }, "packages": { - "@metamask/json-rpc-engine": true, "@metamask/object-multiplex": true, + "@metamask/providers>@metamask/json-rpc-engine": true, "@metamask/providers>@metamask/json-rpc-middleware-stream": true, "@metamask/providers>@metamask/safe-event-emitter": true, "@metamask/providers>is-stream": true, @@ -52,6 +52,13 @@ "readable-stream": true } }, + "@metamask/providers>@metamask/json-rpc-engine": { + "packages": { + "@metamask/providers>@metamask/safe-event-emitter": true, + "@metamask/rpc-errors": true, + "@metamask/utils": true + } + }, "@metamask/providers>@metamask/json-rpc-middleware-stream": { "globals": { "console.warn": true, diff --git a/packages/snaps-execution-environments/package.json b/packages/snaps-execution-environments/package.json index a647060072..f285c990b3 100644 --- a/packages/snaps-execution-environments/package.json +++ b/packages/snaps-execution-environments/package.json @@ -51,7 +51,7 @@ "build:ci": "tsup --clean" }, "dependencies": { - "@metamask/json-rpc-engine": "^8.0.1", + "@metamask/json-rpc-engine": "^9.0.0", "@metamask/object-multiplex": "^2.0.0", "@metamask/post-message-stream": "^8.1.0", "@metamask/providers": "^17.0.0", diff --git a/packages/snaps-jest/package.json b/packages/snaps-jest/package.json index 4a7bd3d368..4720197e05 100644 --- a/packages/snaps-jest/package.json +++ b/packages/snaps-jest/package.json @@ -40,12 +40,12 @@ "@jest/environment": "^29.5.0", "@jest/expect": "^29.5.0", "@jest/globals": "^29.5.0", - "@metamask/base-controller": "^5.0.2", + "@metamask/base-controller": "^6.0.0", "@metamask/eth-json-rpc-middleware": "^12.1.1", - "@metamask/json-rpc-engine": "^8.0.1", - "@metamask/json-rpc-middleware-stream": "^7.0.1", + "@metamask/json-rpc-engine": "^9.0.0", + "@metamask/json-rpc-middleware-stream": "^8.0.0", "@metamask/key-tree": "^9.1.1", - "@metamask/permission-controller": "^9.0.2", + "@metamask/permission-controller": "^10.0.0", "@metamask/snaps-controllers": "workspace:^", "@metamask/snaps-execution-environments": "workspace:^", "@metamask/snaps-rpc-methods": "workspace:^", diff --git a/packages/snaps-rpc-methods/package.json b/packages/snaps-rpc-methods/package.json index 71626c10ca..cab8fce285 100644 --- a/packages/snaps-rpc-methods/package.json +++ b/packages/snaps-rpc-methods/package.json @@ -40,7 +40,7 @@ }, "dependencies": { "@metamask/key-tree": "^9.1.1", - "@metamask/permission-controller": "^9.0.2", + "@metamask/permission-controller": "^10.0.0", "@metamask/rpc-errors": "^6.2.1", "@metamask/snaps-sdk": "workspace:^", "@metamask/snaps-utils": "workspace:^", @@ -55,7 +55,7 @@ "@metamask/eslint-config-jest": "^12.1.0", "@metamask/eslint-config-nodejs": "^12.1.0", "@metamask/eslint-config-typescript": "^12.1.0", - "@metamask/json-rpc-engine": "^8.0.1", + "@metamask/json-rpc-engine": "^9.0.0", "@swc/core": "1.3.78", "@swc/jest": "^0.2.26", "@types/node": "18.14.2", diff --git a/packages/snaps-rpc-methods/src/endowments/cronjob.test.ts b/packages/snaps-rpc-methods/src/endowments/cronjob.test.ts index f16bd7ae04..632ce04326 100644 --- a/packages/snaps-rpc-methods/src/endowments/cronjob.test.ts +++ b/packages/snaps-rpc-methods/src/endowments/cronjob.test.ts @@ -22,7 +22,7 @@ describe('endowment:cronjob', () => { subjectTypes: [SubjectType.Snap], }); - expect(specification.endowmentGetter()).toBeUndefined(); + expect(specification.endowmentGetter()).toBeNull(); }); }); diff --git a/packages/snaps-rpc-methods/src/endowments/cronjob.ts b/packages/snaps-rpc-methods/src/endowments/cronjob.ts index fbe9957636..380b98409f 100644 --- a/packages/snaps-rpc-methods/src/endowments/cronjob.ts +++ b/packages/snaps-rpc-methods/src/endowments/cronjob.ts @@ -23,7 +23,7 @@ const permissionName = SnapEndowments.Cronjob; type CronjobEndowmentSpecification = ValidPermissionSpecification<{ permissionType: PermissionType.Endowment; targetName: typeof permissionName; - endowmentGetter: (_options?: any) => undefined; + endowmentGetter: (_options?: any) => null; allowedCaveats: Readonly> | null; }>; @@ -42,7 +42,7 @@ const specificationBuilder: PermissionSpecificationBuilder< permissionType: PermissionType.Endowment, targetName: permissionName, allowedCaveats: [SnapCaveatType.SnapCronjob], - endowmentGetter: (_getterOptions?: EndowmentGetterParams) => undefined, + endowmentGetter: (_getterOptions?: EndowmentGetterParams) => null, subjectTypes: [SubjectType.Snap], }; }; diff --git a/packages/snaps-rpc-methods/src/endowments/home-page.test.ts b/packages/snaps-rpc-methods/src/endowments/home-page.test.ts index 109eb651b5..1ff7c73152 100644 --- a/packages/snaps-rpc-methods/src/endowments/home-page.test.ts +++ b/packages/snaps-rpc-methods/src/endowments/home-page.test.ts @@ -14,6 +14,6 @@ describe('endowment:page-home', () => { subjectTypes: [SubjectType.Snap], }); - expect(specification.endowmentGetter()).toBeUndefined(); + expect(specification.endowmentGetter()).toBeNull(); }); }); diff --git a/packages/snaps-rpc-methods/src/endowments/home-page.ts b/packages/snaps-rpc-methods/src/endowments/home-page.ts index 80cc4b5c40..9371c5b01a 100644 --- a/packages/snaps-rpc-methods/src/endowments/home-page.ts +++ b/packages/snaps-rpc-methods/src/endowments/home-page.ts @@ -13,7 +13,7 @@ const permissionName = SnapEndowments.HomePage; type HomePageEndowmentSpecification = ValidPermissionSpecification<{ permissionType: PermissionType.Endowment; targetName: typeof permissionName; - endowmentGetter: (_options?: EndowmentGetterParams) => undefined; + endowmentGetter: (_options?: EndowmentGetterParams) => null; allowedCaveats: Readonly> | null; }>; @@ -34,7 +34,7 @@ const specificationBuilder: PermissionSpecificationBuilder< permissionType: PermissionType.Endowment, targetName: permissionName, allowedCaveats: null, - endowmentGetter: (_getterOptions?: EndowmentGetterParams) => undefined, + endowmentGetter: (_getterOptions?: EndowmentGetterParams) => null, subjectTypes: [SubjectType.Snap], }; }; diff --git a/packages/snaps-rpc-methods/src/endowments/keyring.ts b/packages/snaps-rpc-methods/src/endowments/keyring.ts index 3d53ebb210..304fc11137 100644 --- a/packages/snaps-rpc-methods/src/endowments/keyring.ts +++ b/packages/snaps-rpc-methods/src/endowments/keyring.ts @@ -22,7 +22,7 @@ const permissionName = SnapEndowments.Keyring; type KeyringEndowmentSpecification = ValidPermissionSpecification<{ permissionType: PermissionType.Endowment; targetName: typeof permissionName; - endowmentGetter: (_options?: EndowmentGetterParams) => undefined; + endowmentGetter: (_options?: EndowmentGetterParams) => null; allowedCaveats: Readonly> | null; validator: PermissionValidatorConstraint; subjectTypes: readonly SubjectType[]; @@ -47,7 +47,7 @@ const specificationBuilder: PermissionSpecificationBuilder< SnapCaveatType.KeyringOrigin, SnapCaveatType.MaxRequestTime, ], - endowmentGetter: (_getterOptions?: EndowmentGetterParams) => undefined, + endowmentGetter: (_getterOptions?: EndowmentGetterParams) => null, validator: createGenericPermissionValidator([ { type: SnapCaveatType.KeyringOrigin }, { type: SnapCaveatType.MaxRequestTime, optional: true }, diff --git a/packages/snaps-rpc-methods/src/endowments/lifecycle-hooks.ts b/packages/snaps-rpc-methods/src/endowments/lifecycle-hooks.ts index c1006c392b..fba216003f 100644 --- a/packages/snaps-rpc-methods/src/endowments/lifecycle-hooks.ts +++ b/packages/snaps-rpc-methods/src/endowments/lifecycle-hooks.ts @@ -13,7 +13,7 @@ const permissionName = SnapEndowments.LifecycleHooks; type LifecycleHooksEndowmentSpecification = ValidPermissionSpecification<{ permissionType: PermissionType.Endowment; targetName: typeof permissionName; - endowmentGetter: (_options?: EndowmentGetterParams) => undefined; + endowmentGetter: (_options?: EndowmentGetterParams) => null; allowedCaveats: Readonly> | null; }>; @@ -34,7 +34,7 @@ const specificationBuilder: PermissionSpecificationBuilder< permissionType: PermissionType.Endowment, targetName: permissionName, allowedCaveats: null, - endowmentGetter: (_getterOptions?: EndowmentGetterParams) => undefined, + endowmentGetter: (_getterOptions?: EndowmentGetterParams) => null, subjectTypes: [SubjectType.Snap], }; }; diff --git a/packages/snaps-rpc-methods/src/endowments/name-lookup.test.ts b/packages/snaps-rpc-methods/src/endowments/name-lookup.test.ts index 1363c97858..16caf5d591 100644 --- a/packages/snaps-rpc-methods/src/endowments/name-lookup.test.ts +++ b/packages/snaps-rpc-methods/src/endowments/name-lookup.test.ts @@ -27,7 +27,7 @@ describe('endowment:name-lookup', () => { validator: expect.any(Function), }); - expect(specification.endowmentGetter()).toBeUndefined(); + expect(specification.endowmentGetter()).toBeNull(); }); describe('validator', () => { diff --git a/packages/snaps-rpc-methods/src/endowments/name-lookup.ts b/packages/snaps-rpc-methods/src/endowments/name-lookup.ts index 17fd7bf07b..33926b90c4 100644 --- a/packages/snaps-rpc-methods/src/endowments/name-lookup.ts +++ b/packages/snaps-rpc-methods/src/endowments/name-lookup.ts @@ -32,7 +32,7 @@ const permissionName = SnapEndowments.NameLookup; type NameLookupEndowmentSpecification = ValidPermissionSpecification<{ permissionType: PermissionType.Endowment; targetName: typeof permissionName; - endowmentGetter: (_options?: EndowmentGetterParams) => undefined; + endowmentGetter: (_options?: EndowmentGetterParams) => null; allowedCaveats: Readonly> | null; validator: PermissionValidatorConstraint; }>; @@ -57,7 +57,7 @@ const specificationBuilder: PermissionSpecificationBuilder< SnapCaveatType.LookupMatchers, SnapCaveatType.MaxRequestTime, ], - endowmentGetter: (_getterOptions?: EndowmentGetterParams) => undefined, + endowmentGetter: (_getterOptions?: EndowmentGetterParams) => null, validator: createGenericPermissionValidator([ { type: SnapCaveatType.ChainIds, optional: true }, { type: SnapCaveatType.LookupMatchers, optional: true }, diff --git a/packages/snaps-rpc-methods/src/endowments/rpc.test.ts b/packages/snaps-rpc-methods/src/endowments/rpc.test.ts index 184e955e72..d0ab6b8889 100644 --- a/packages/snaps-rpc-methods/src/endowments/rpc.test.ts +++ b/packages/snaps-rpc-methods/src/endowments/rpc.test.ts @@ -21,7 +21,7 @@ describe('endowment:rpc', () => { subjectTypes: [SubjectType.Snap], }); - expect(specification.endowmentGetter()).toBeUndefined(); + expect(specification.endowmentGetter()).toBeNull(); }); describe('validator', () => { diff --git a/packages/snaps-rpc-methods/src/endowments/rpc.ts b/packages/snaps-rpc-methods/src/endowments/rpc.ts index 6a36b2ce13..3628c2f30b 100644 --- a/packages/snaps-rpc-methods/src/endowments/rpc.ts +++ b/packages/snaps-rpc-methods/src/endowments/rpc.ts @@ -22,7 +22,7 @@ const targetName = SnapEndowments.Rpc; type RpcSpecification = ValidPermissionSpecification<{ permissionType: PermissionType.Endowment; targetName: typeof targetName; - endowmentGetter: (_options?: any) => undefined; + endowmentGetter: (_options?: any) => null; allowedCaveats: Readonly> | null; validator: PermissionValidatorConstraint; subjectTypes: readonly SubjectType[]; @@ -47,7 +47,7 @@ const specificationBuilder: PermissionSpecificationBuilder< permissionType: PermissionType.Endowment, targetName, allowedCaveats: [SnapCaveatType.RpcOrigin, SnapCaveatType.MaxRequestTime], - endowmentGetter: (_getterOptions?: EndowmentGetterParams) => undefined, + endowmentGetter: (_getterOptions?: EndowmentGetterParams) => null, validator: createGenericPermissionValidator([ { type: SnapCaveatType.RpcOrigin }, { type: SnapCaveatType.MaxRequestTime, optional: true }, diff --git a/packages/snaps-rpc-methods/src/endowments/signature-insight.test.ts b/packages/snaps-rpc-methods/src/endowments/signature-insight.test.ts index d90550d924..87e0ac3c87 100644 --- a/packages/snaps-rpc-methods/src/endowments/signature-insight.test.ts +++ b/packages/snaps-rpc-methods/src/endowments/signature-insight.test.ts @@ -24,7 +24,7 @@ describe('endowment:signature-insight', () => { subjectTypes: [SubjectType.Snap], }); - expect(specification.endowmentGetter()).toBeUndefined(); + expect(specification.endowmentGetter()).toBeNull(); }); describe('validator', () => { diff --git a/packages/snaps-rpc-methods/src/endowments/signature-insight.ts b/packages/snaps-rpc-methods/src/endowments/signature-insight.ts index 3d43ad3a26..f6c1735553 100644 --- a/packages/snaps-rpc-methods/src/endowments/signature-insight.ts +++ b/packages/snaps-rpc-methods/src/endowments/signature-insight.ts @@ -21,7 +21,7 @@ const permissionName = SnapEndowments.SignatureInsight; type SignatureInsightEndowmentSpecification = ValidPermissionSpecification<{ permissionType: PermissionType.Endowment; targetName: typeof permissionName; - endowmentGetter: (_options?: EndowmentGetterParams) => undefined; + endowmentGetter: (_options?: EndowmentGetterParams) => null; allowedCaveats: Readonly> | null; validator: PermissionValidatorConstraint; }>; @@ -42,7 +42,7 @@ const specificationBuilder: PermissionSpecificationBuilder< permissionType: PermissionType.Endowment, targetName: permissionName, allowedCaveats: [SnapCaveatType.SignatureOrigin], - endowmentGetter: (_getterOptions?: EndowmentGetterParams) => undefined, + endowmentGetter: (_getterOptions?: EndowmentGetterParams) => null, validator: createGenericPermissionValidator([ { type: SnapCaveatType.SignatureOrigin, optional: true }, { type: SnapCaveatType.MaxRequestTime, optional: true }, diff --git a/packages/snaps-rpc-methods/src/endowments/transaction-insight.test.ts b/packages/snaps-rpc-methods/src/endowments/transaction-insight.test.ts index d63959d59c..487e04590b 100644 --- a/packages/snaps-rpc-methods/src/endowments/transaction-insight.test.ts +++ b/packages/snaps-rpc-methods/src/endowments/transaction-insight.test.ts @@ -27,7 +27,7 @@ describe('endowment:transaction-insight', () => { subjectTypes: [SubjectType.Snap], }); - expect(specification.endowmentGetter()).toBeUndefined(); + expect(specification.endowmentGetter()).toBeNull(); }); describe('validator', () => { diff --git a/packages/snaps-rpc-methods/src/endowments/transaction-insight.ts b/packages/snaps-rpc-methods/src/endowments/transaction-insight.ts index 4c068996ba..d54b718e53 100644 --- a/packages/snaps-rpc-methods/src/endowments/transaction-insight.ts +++ b/packages/snaps-rpc-methods/src/endowments/transaction-insight.ts @@ -21,7 +21,7 @@ const permissionName = SnapEndowments.TransactionInsight; type TransactionInsightEndowmentSpecification = ValidPermissionSpecification<{ permissionType: PermissionType.Endowment; targetName: typeof permissionName; - endowmentGetter: (_options?: EndowmentGetterParams) => undefined; + endowmentGetter: (_options?: EndowmentGetterParams) => null; allowedCaveats: Readonly> | null; validator: PermissionValidatorConstraint; }>; @@ -45,7 +45,7 @@ const specificationBuilder: PermissionSpecificationBuilder< SnapCaveatType.TransactionOrigin, SnapCaveatType.MaxRequestTime, ], - endowmentGetter: (_getterOptions?: EndowmentGetterParams) => undefined, + endowmentGetter: (_getterOptions?: EndowmentGetterParams) => null, validator: createGenericPermissionValidator([ { type: SnapCaveatType.TransactionOrigin, optional: true }, { type: SnapCaveatType.MaxRequestTime, optional: true }, diff --git a/packages/snaps-rpc-methods/src/restricted/caveats/permittedCoinTypes.ts b/packages/snaps-rpc-methods/src/restricted/caveats/permittedCoinTypes.ts index 8088168cf0..5937928326 100644 --- a/packages/snaps-rpc-methods/src/restricted/caveats/permittedCoinTypes.ts +++ b/packages/snaps-rpc-methods/src/restricted/caveats/permittedCoinTypes.ts @@ -91,18 +91,12 @@ export const PermittedCoinTypesCaveatSpecification: Record< > = { [SnapCaveatType.PermittedCoinTypes]: Object.freeze({ type: SnapCaveatType.PermittedCoinTypes, - decorator: ( - method, - caveat: Caveat< - SnapCaveatType.PermittedCoinTypes, - GetBip44EntropyParams[] - >, - ) => { + decorator: (method, caveat) => { return async (args) => { const { params } = args; validateBIP44Params(params); - const coinType = caveat.value.find( + const coinType = (caveat.value as GetBip44EntropyParams[]).find( (caveatValue) => caveatValue.coinType === params.coinType, ); diff --git a/packages/snaps-rpc-methods/src/restricted/caveats/permittedDerivationPaths.ts b/packages/snaps-rpc-methods/src/restricted/caveats/permittedDerivationPaths.ts index 8c4c76c81f..adeecf2790 100644 --- a/packages/snaps-rpc-methods/src/restricted/caveats/permittedDerivationPaths.ts +++ b/packages/snaps-rpc-methods/src/restricted/caveats/permittedDerivationPaths.ts @@ -79,15 +79,12 @@ export const PermittedDerivationPathsCaveatSpecification: Record< > = { [SnapCaveatType.PermittedDerivationPaths]: Object.freeze({ type: SnapCaveatType.PermittedDerivationPaths, - decorator: ( - method, - caveat: Caveat, - ) => { + decorator: (method, caveat) => { return async (args) => { const { params } = args; validateBIP32Path(params); - const path = caveat.value.find( + const path = (caveat.value as Bip32Entropy[]).find( (caveatPath) => isEqual( params.path.slice(0, caveatPath.path.length), diff --git a/packages/snaps-rpc-methods/src/restricted/caveats/snapIds.ts b/packages/snaps-rpc-methods/src/restricted/caveats/snapIds.ts index e41f2cedc3..192bb07822 100644 --- a/packages/snaps-rpc-methods/src/restricted/caveats/snapIds.ts +++ b/packages/snaps-rpc-methods/src/restricted/caveats/snapIds.ts @@ -67,7 +67,7 @@ export const SnapIdsCaveatSpecification: Record< params, context: { origin }, }: RestrictedMethodOptions = args; - const snapIds = caveat.value; + const snapIds = caveat.value as SnapIds; const { snapId } = params as InvokeSnapParams; if (!hasProperty(snapIds, snapId)) { throw new Error( diff --git a/packages/snaps-simulator/package.json b/packages/snaps-simulator/package.json index 1469474de9..21e98f40f8 100644 --- a/packages/snaps-simulator/package.json +++ b/packages/snaps-simulator/package.json @@ -30,12 +30,12 @@ "@emotion/react": "^11.10.8", "@emotion/styled": "^11.10.8", "@ethersproject/units": "^5.7.0", - "@metamask/base-controller": "^5.0.2", + "@metamask/base-controller": "^6.0.0", "@metamask/eth-json-rpc-middleware": "^12.1.1", - "@metamask/json-rpc-engine": "^8.0.1", - "@metamask/json-rpc-middleware-stream": "^7.0.1", + "@metamask/json-rpc-engine": "^9.0.0", + "@metamask/json-rpc-middleware-stream": "^8.0.0", "@metamask/key-tree": "^9.1.1", - "@metamask/permission-controller": "^9.0.2", + "@metamask/permission-controller": "^10.0.0", "@metamask/snaps-controllers": "workspace:^", "@metamask/snaps-execution-environments": "workspace:^", "@metamask/snaps-rpc-methods": "workspace:^", diff --git a/packages/snaps-utils/package.json b/packages/snaps-utils/package.json index f0954da642..2eb9077f2a 100644 --- a/packages/snaps-utils/package.json +++ b/packages/snaps-utils/package.json @@ -52,9 +52,9 @@ "dependencies": { "@babel/core": "^7.23.2", "@babel/types": "^7.23.0", - "@metamask/base-controller": "^5.0.2", + "@metamask/base-controller": "^6.0.0", "@metamask/key-tree": "^9.1.1", - "@metamask/permission-controller": "^9.0.2", + "@metamask/permission-controller": "^10.0.0", "@metamask/rpc-errors": "^6.2.1", "@metamask/slip44": "^3.1.0", "@metamask/snaps-registry": "^3.1.0", diff --git a/yarn.lock b/yarn.lock index f53c7600df..978f56cfa8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3822,15 +3822,15 @@ __metadata: languageName: node linkType: hard -"@metamask/approval-controller@npm:^6.0.2": - version: 6.0.2 - resolution: "@metamask/approval-controller@npm:6.0.2" +"@metamask/approval-controller@npm:^7.0.0": + version: 7.0.0 + resolution: "@metamask/approval-controller@npm:7.0.0" dependencies: - "@metamask/base-controller": ^5.0.2 + "@metamask/base-controller": ^6.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 nanoid: ^3.1.31 - checksum: 662365ec460edc1e3839c2f9f427d44a707350ecca7fa3524d75da3652306b61fc69f7336154142b4a38657c272624232ea40bf218427ba15b11fd89c5a5ae42 + checksum: fa9c08959dbd89563fe8f07d0086703854d1f645ac00fe58eae62cc8a4eb344de7c26744baa9f2c2ad7a10999dd522bcb822692f76f76f1c84189550c6c80cdf languageName: node linkType: hard @@ -3864,13 +3864,13 @@ __metadata: languageName: node linkType: hard -"@metamask/base-controller@npm:^5.0.1, @metamask/base-controller@npm:^5.0.2": - version: 5.0.2 - resolution: "@metamask/base-controller@npm:5.0.2" +"@metamask/base-controller@npm:^6.0.0": + version: 6.0.0 + resolution: "@metamask/base-controller@npm:6.0.0" dependencies: "@metamask/utils": ^8.3.0 immer: ^9.0.6 - checksum: 22c43c3147c7da1c1b87de4d41948e275f8e0adcdb1210a55a62aa497db4fa82399750901729d9dc6285d89e68f18e5bd15095ee4d4c6cfc169035173e69a1d2 + checksum: ff5c4acedc698e2477f1d719f64363d8763b21836dcea4675214c078457cd47dde068aa336b249663f3c7fb3c0f536ce420870811e00ca3a410646740a9f5934 languageName: node linkType: hard @@ -4114,9 +4114,9 @@ __metadata: languageName: unknown linkType: soft -"@metamask/controller-utils@npm:^9.0.1": - version: 9.1.0 - resolution: "@metamask/controller-utils@npm:9.1.0" +"@metamask/controller-utils@npm:^11.0.0": + version: 11.0.0 + resolution: "@metamask/controller-utils@npm:11.0.0" dependencies: "@ethereumjs/util": ^8.1.0 "@metamask/eth-query": ^4.0.0 @@ -4127,7 +4127,7 @@ __metadata: bn.js: ^5.2.1 eth-ens-namehash: ^2.0.8 fast-deep-equal: ^3.1.3 - checksum: 2a6adf8db232c38211301887260274324888d60beead8d4e528a19c70ca4b659391ea01d9382e355fc943af3963f78766fa3c6bb9487281c24012949192a0a91 + checksum: ce77d9006c34109d78787d91036b605c2e401f51bae58a60cfd955905ebd63ebe5a007b93861a1fcc51bb7e57b69ec2a6dd6142656c1ee2d87d74e397752dffa languageName: node linkType: hard @@ -4874,6 +4874,17 @@ __metadata: languageName: node linkType: hard +"@metamask/json-rpc-engine@npm:^9.0.0": + version: 9.0.0 + resolution: "@metamask/json-rpc-engine@npm:9.0.0" + dependencies: + "@metamask/rpc-errors": ^6.2.1 + "@metamask/safe-event-emitter": ^3.0.0 + "@metamask/utils": ^8.3.0 + checksum: b97170b36843145361015dabc5651df1d2c7f28f0756d3c9c05aef6a483098d562a9983cbe0e15f7fd1a66aa26481132b03ccb9061a2c48f0d3249c1f2348e97 + languageName: node + linkType: hard + "@metamask/json-rpc-example-snap@workspace:^, @metamask/json-rpc-example-snap@workspace:packages/examples/packages/json-rpc": version: 0.0.0-use.local resolution: "@metamask/json-rpc-example-snap@workspace:packages/examples/packages/json-rpc" @@ -4922,6 +4933,18 @@ __metadata: languageName: node linkType: hard +"@metamask/json-rpc-middleware-stream@npm:^8.0.0": + version: 8.0.0 + resolution: "@metamask/json-rpc-middleware-stream@npm:8.0.0" + dependencies: + "@metamask/json-rpc-engine": ^9.0.0 + "@metamask/safe-event-emitter": ^3.0.0 + "@metamask/utils": ^8.3.0 + readable-stream: ^3.6.2 + checksum: 4bf809366da41744c841dd50d68cf126e1cccda0d78a812154489faa2b0a56bbd511a7bb4e9ccc7c68f2a9a6437f00561bc9423a5b5596badd511a4ff6244c9e + languageName: node + linkType: hard + "@metamask/jsx-example-snap@workspace:^, @metamask/jsx-example-snap@workspace:packages/examples/packages/jsx": version: 0.0.0-use.local resolution: "@metamask/jsx-example-snap@workspace:packages/examples/packages/jsx" @@ -5211,13 +5234,13 @@ __metadata: languageName: node linkType: hard -"@metamask/permission-controller@npm:^9.0.2": - version: 9.0.2 - resolution: "@metamask/permission-controller@npm:9.0.2" +"@metamask/permission-controller@npm:^10.0.0": + version: 10.0.0 + resolution: "@metamask/permission-controller@npm:10.0.0" dependencies: - "@metamask/base-controller": ^5.0.1 - "@metamask/controller-utils": ^9.0.1 - "@metamask/json-rpc-engine": ^8.0.1 + "@metamask/base-controller": ^6.0.0 + "@metamask/controller-utils": ^11.0.0 + "@metamask/json-rpc-engine": ^9.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 "@types/deep-freeze-strict": ^1.1.0 @@ -5225,21 +5248,21 @@ __metadata: immer: ^9.0.6 nanoid: ^3.1.31 peerDependencies: - "@metamask/approval-controller": ^6.0.0 - checksum: c4c81f04ecebe5db2d5848709b2c8d89ebe90098e4f8dd48392f49826e4666681a78f9b89a85cc597944f85b1bdfdd4fb8411489e7110586edf362ef17b4086e + "@metamask/approval-controller": ^7.0.0 + checksum: 9b05ebac86a5d028388eca35861357561298ea938f3adb5e134566f5d16a9a01cc582cffdc14f3680f103ba770827f108a066bc48fcb13da984a04da0af178f7 languageName: node linkType: hard -"@metamask/phishing-controller@npm:^9.0.1": - version: 9.0.1 - resolution: "@metamask/phishing-controller@npm:9.0.1" +"@metamask/phishing-controller@npm:^10.0.0": + version: 10.0.0 + resolution: "@metamask/phishing-controller@npm:10.0.0" dependencies: - "@metamask/base-controller": ^5.0.1 - "@metamask/controller-utils": ^9.0.1 + "@metamask/base-controller": ^6.0.0 + "@metamask/controller-utils": ^11.0.0 "@types/punycode": ^2.1.0 eth-phishing-detect: ^1.2.0 punycode: ^2.1.1 - checksum: f8770b94d9d4e7f7daa5619d9bf32bc0909b6947dd72172ba76f085ca6e29bafa9d728f57e6ed296355f589ec6d267ee537587a7a70ccc2b2b971604e3ad0c8b + checksum: c9da583e8620dc0bb82e799305cccd1b0f54501c9a5b9321295049d08d16fff3bf4111d4c81c76c5d0f292d4c8e1113b3baef18d011bd09e6c2b2404c3d43557 languageName: node linkType: hard @@ -5533,19 +5556,19 @@ __metadata: "@esbuild-plugins/node-globals-polyfill": ^0.2.3 "@esbuild-plugins/node-modules-polyfill": ^0.2.2 "@lavamoat/allow-scripts": ^3.0.4 - "@metamask/approval-controller": ^6.0.2 + "@metamask/approval-controller": ^7.0.0 "@metamask/auto-changelog": ^3.4.4 - "@metamask/base-controller": ^5.0.2 + "@metamask/base-controller": ^6.0.0 "@metamask/browser-passworder": ^5.0.0 "@metamask/eslint-config": ^12.1.0 "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 - "@metamask/json-rpc-engine": ^8.0.1 - "@metamask/json-rpc-middleware-stream": ^7.0.1 + "@metamask/json-rpc-engine": ^9.0.0 + "@metamask/json-rpc-middleware-stream": ^8.0.0 "@metamask/object-multiplex": ^2.0.0 - "@metamask/permission-controller": ^9.0.2 - "@metamask/phishing-controller": ^9.0.1 + "@metamask/permission-controller": ^10.0.0 + "@metamask/phishing-controller": ^10.0.0 "@metamask/post-message-stream": ^8.1.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/snaps-registry": ^3.1.0 @@ -5636,7 +5659,7 @@ __metadata: "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 - "@metamask/json-rpc-engine": ^8.0.1 + "@metamask/json-rpc-engine": ^9.0.0 "@metamask/object-multiplex": ^2.0.0 "@metamask/post-message-stream": ^8.1.0 "@metamask/providers": ^17.0.0 @@ -5711,16 +5734,16 @@ __metadata: "@jest/types": ^29.6.3 "@lavamoat/allow-scripts": ^3.0.4 "@metamask/auto-changelog": ^3.4.4 - "@metamask/base-controller": ^5.0.2 + "@metamask/base-controller": ^6.0.0 "@metamask/eslint-config": ^12.1.0 "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 "@metamask/eth-json-rpc-middleware": ^12.1.1 - "@metamask/json-rpc-engine": ^8.0.1 - "@metamask/json-rpc-middleware-stream": ^7.0.1 + "@metamask/json-rpc-engine": ^9.0.0 + "@metamask/json-rpc-middleware-stream": ^8.0.0 "@metamask/key-tree": ^9.1.1 - "@metamask/permission-controller": ^9.0.2 + "@metamask/permission-controller": ^10.0.0 "@metamask/snaps-controllers": "workspace:^" "@metamask/snaps-execution-environments": "workspace:^" "@metamask/snaps-rpc-methods": "workspace:^" @@ -5822,9 +5845,9 @@ __metadata: "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 - "@metamask/json-rpc-engine": ^8.0.1 + "@metamask/json-rpc-engine": ^9.0.0 "@metamask/key-tree": ^9.1.1 - "@metamask/permission-controller": ^9.0.2 + "@metamask/permission-controller": ^10.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/snaps-sdk": "workspace:^" "@metamask/snaps-utils": "workspace:^" @@ -5909,17 +5932,17 @@ __metadata: "@emotion/styled": ^11.10.8 "@ethersproject/units": ^5.7.0 "@metamask/auto-changelog": ^3.4.4 - "@metamask/base-controller": ^5.0.2 + "@metamask/base-controller": ^6.0.0 "@metamask/eslint-config": ^12.1.0 "@metamask/eslint-config-browser": ^11.1.0 "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 "@metamask/eth-json-rpc-middleware": ^12.1.1 - "@metamask/json-rpc-engine": ^8.0.1 - "@metamask/json-rpc-middleware-stream": ^7.0.1 + "@metamask/json-rpc-engine": ^9.0.0 + "@metamask/json-rpc-middleware-stream": ^8.0.0 "@metamask/key-tree": ^9.1.1 - "@metamask/permission-controller": ^9.0.2 + "@metamask/permission-controller": ^10.0.0 "@metamask/snaps-controllers": "workspace:^" "@metamask/snaps-execution-environments": "workspace:^" "@metamask/snaps-rpc-methods": "workspace:^" @@ -6011,13 +6034,13 @@ __metadata: "@esbuild-plugins/node-modules-polyfill": ^0.2.2 "@lavamoat/allow-scripts": ^3.0.4 "@metamask/auto-changelog": ^3.4.4 - "@metamask/base-controller": ^5.0.2 + "@metamask/base-controller": ^6.0.0 "@metamask/eslint-config": ^12.1.0 "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 "@metamask/key-tree": ^9.1.1 - "@metamask/permission-controller": ^9.0.2 + "@metamask/permission-controller": ^10.0.0 "@metamask/post-message-stream": ^8.1.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/slip44": ^3.1.0