diff --git a/packages/snaps-controllers/src/multichain/MultichainRoutingController.ts b/packages/snaps-controllers/src/multichain/MultichainRoutingController.ts index c759db8deb..106d249892 100644 --- a/packages/snaps-controllers/src/multichain/MultichainRoutingController.ts +++ b/packages/snaps-controllers/src/multichain/MultichainRoutingController.ts @@ -274,13 +274,10 @@ export class MultichainRoutingController extends BaseController< if (protocolSnap) { return this.messagingSystem.call('SnapController:handleRequest', { snapId: protocolSnap.snapId, - origin: 'metamask', + origin, request: { method: '', params: { - // We are overriding the origin here, so that the Snap gets the proper origin - // while the permissions check is skipped due to the requesting origin being metamask. - origin, request, scope, }, diff --git a/packages/snaps-execution-environments/src/common/commands.ts b/packages/snaps-execution-environments/src/common/commands.ts index 0a5a965f0e..d05ac67feb 100644 --- a/packages/snaps-execution-environments/src/common/commands.ts +++ b/packages/snaps-execution-environments/src/common/commands.ts @@ -79,13 +79,8 @@ export function getHandlerArguments( case HandlerType.OnProtocolRequest: { assertIsOnProtocolRequestArguments(request.params); - // For this specific handler we extract the origin from the parameters. - const { - origin: nestedOrigin, - request: nestedRequest, - scope, - } = request.params; - return { origin: nestedOrigin, request: nestedRequest, scope }; + const { request: nestedRequest, scope } = request.params; + return { request: nestedRequest, scope }; } case HandlerType.OnRpcRequest: diff --git a/packages/snaps-execution-environments/src/common/validation.ts b/packages/snaps-execution-environments/src/common/validation.ts index 0fabe6d4cb..4d2f0e855e 100644 --- a/packages/snaps-execution-environments/src/common/validation.ts +++ b/packages/snaps-execution-environments/src/common/validation.ts @@ -245,7 +245,6 @@ export function assertIsOnUserInputRequestArguments( } export const OnProtocolRequestArgumentsStruct = object({ - origin: string(), scope: ChainIdStruct, request: JsonRpcRequestStruct, });