Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeRx committed Dec 6, 2024
1 parent 2a55e04 commit f2afbf9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export function getHandlerArguments(
return { origin };

case HandlerType.OnHomePage:
return {};
case HandlerType.OnSettingsPage:
return {};
case HandlerType.OnUserInput: {
Expand Down
4 changes: 2 additions & 2 deletions packages/snaps-rpc-methods/src/endowments/settings-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,7 +28,7 @@ type HomePageEndowmentSpecification = ValidPermissionSpecification<{
const specificationBuilder: PermissionSpecificationBuilder<
PermissionType.Endowment,
any,
HomePageEndowmentSpecification
SettingsPageEndowmentSpecification
> = (_builderOptions?: unknown) => {
return {
permissionType: PermissionType.Endowment,
Expand Down
23 changes: 7 additions & 16 deletions packages/snaps-utils/src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit f2afbf9

Please sign in to comment.