Skip to content

Commit f2afbf9

Browse files
committed
address comments
1 parent 2a55e04 commit f2afbf9

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

packages/snaps-execution-environments/src/common/commands.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export function getHandlerArguments(
8686
return { origin };
8787

8888
case HandlerType.OnHomePage:
89-
return {};
9089
case HandlerType.OnSettingsPage:
9190
return {};
9291
case HandlerType.OnUserInput: {

packages/snaps-rpc-methods/src/endowments/settings-page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { SnapEndowments } from './enum';
1010

1111
const permissionName = SnapEndowments.SettingsPage;
1212

13-
type HomePageEndowmentSpecification = ValidPermissionSpecification<{
13+
type SettingsPageEndowmentSpecification = ValidPermissionSpecification<{
1414
permissionType: PermissionType.Endowment;
1515
targetName: typeof permissionName;
1616
endowmentGetter: (_options?: EndowmentGetterParams) => null;
@@ -28,7 +28,7 @@ type HomePageEndowmentSpecification = ValidPermissionSpecification<{
2828
const specificationBuilder: PermissionSpecificationBuilder<
2929
PermissionType.Endowment,
3030
any,
31-
HomePageEndowmentSpecification
31+
SettingsPageEndowmentSpecification
3232
> = (_builderOptions?: unknown) => {
3333
return {
3434
permissionType: PermissionType.Endowment,

packages/snaps-utils/src/handlers.ts

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -140,31 +140,22 @@ export const OnTransactionResponseStruct = nullable(
140140

141141
export const OnSignatureResponseStruct = OnTransactionResponseStruct;
142142

143-
export const OnHomePageResponseWithContentStruct = object({
143+
export const OnPageResponseWithContentStruct = object({
144144
content: ComponentOrElementStruct,
145145
});
146146

147-
export const OnHomePageResponseWithIdStruct = object({
147+
export const OnPageResponseWithIdStruct = object({
148148
id: string(),
149149
});
150150

151-
export const OnHomePageResponseStruct = union([
152-
OnHomePageResponseWithContentStruct,
153-
OnHomePageResponseWithIdStruct,
151+
export const OnPageResponseStruct = union([
152+
OnPageResponseWithContentStruct,
153+
OnPageResponseWithIdStruct,
154154
]);
155155

156-
export const OnSettingsPageResponseWithContentStruct = object({
157-
content: ComponentOrElementStruct,
158-
});
159-
160-
export const OnSettingsPageResponseWithIdStruct = object({
161-
id: string(),
162-
});
156+
export const OnHomePageResponseStruct = OnPageResponseStruct;
163157

164-
export const OnSettingsPageResponseStruct = union([
165-
OnSettingsPageResponseWithContentStruct,
166-
OnSettingsPageResponseWithIdStruct,
167-
]);
158+
export const OnSettingsPageResponseStruct = OnPageResponseStruct;
168159

169160
export const AddressResolutionStruct = object({
170161
protocol: string(),

0 commit comments

Comments
 (0)