diff --git a/packages/snaps-execution-environments/src/common/commands.ts b/packages/snaps-execution-environments/src/common/commands.ts index 273d4ff51b..b03a32d23d 100644 --- a/packages/snaps-execution-environments/src/common/commands.ts +++ b/packages/snaps-execution-environments/src/common/commands.ts @@ -86,7 +86,6 @@ export function getHandlerArguments( return { origin }; case HandlerType.OnHomePage: - return {}; case HandlerType.OnSettingsPage: return {}; case HandlerType.OnUserInput: { diff --git a/packages/snaps-rpc-methods/src/endowments/settings-page.ts b/packages/snaps-rpc-methods/src/endowments/settings-page.ts index dc4dd8c42b..ec6a1de592 100644 --- a/packages/snaps-rpc-methods/src/endowments/settings-page.ts +++ b/packages/snaps-rpc-methods/src/endowments/settings-page.ts @@ -10,7 +10,7 @@ import { SnapEndowments } from './enum'; const permissionName = SnapEndowments.SettingsPage; -type HomePageEndowmentSpecification = ValidPermissionSpecification<{ +type SettingsPageEndowmentSpecification = ValidPermissionSpecification<{ permissionType: PermissionType.Endowment; targetName: typeof permissionName; endowmentGetter: (_options?: EndowmentGetterParams) => null; @@ -28,7 +28,7 @@ type HomePageEndowmentSpecification = ValidPermissionSpecification<{ const specificationBuilder: PermissionSpecificationBuilder< PermissionType.Endowment, any, - HomePageEndowmentSpecification + SettingsPageEndowmentSpecification > = (_builderOptions?: unknown) => { return { permissionType: PermissionType.Endowment, diff --git a/packages/snaps-utils/src/handlers.ts b/packages/snaps-utils/src/handlers.ts index 265a2c98d8..3d329f33d4 100644 --- a/packages/snaps-utils/src/handlers.ts +++ b/packages/snaps-utils/src/handlers.ts @@ -140,31 +140,22 @@ export const OnTransactionResponseStruct = nullable( export const OnSignatureResponseStruct = OnTransactionResponseStruct; -export const OnHomePageResponseWithContentStruct = object({ +export const OnPageResponseWithContentStruct = object({ content: ComponentOrElementStruct, }); -export const OnHomePageResponseWithIdStruct = object({ +export const OnPageResponseWithIdStruct = object({ id: string(), }); -export const OnHomePageResponseStruct = union([ - OnHomePageResponseWithContentStruct, - OnHomePageResponseWithIdStruct, +export const OnPageResponseStruct = union([ + OnPageResponseWithContentStruct, + OnPageResponseWithIdStruct, ]); -export const OnSettingsPageResponseWithContentStruct = object({ - content: ComponentOrElementStruct, -}); - -export const OnSettingsPageResponseWithIdStruct = object({ - id: string(), -}); +export const OnHomePageResponseStruct = OnPageResponseStruct; -export const OnSettingsPageResponseStruct = union([ - OnSettingsPageResponseWithContentStruct, - OnSettingsPageResponseWithIdStruct, -]); +export const OnSettingsPageResponseStruct = OnPageResponseStruct; export const AddressResolutionStruct = object({ protocol: string(),