From 508d53a186cfe68c85bb792c3330f1b5b4a3c107 Mon Sep 17 00:00:00 2001 From: Frederik Bolding Date: Tue, 31 Oct 2023 11:23:41 +0100 Subject: [PATCH] Address feedback --- SIPS/sip-15.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/SIPS/sip-15.md b/SIPS/sip-15.md index a23a8db..3d7c31d 100644 --- a/SIPS/sip-15.md +++ b/SIPS/sip-15.md @@ -29,40 +29,40 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", ### Snap Manifest -This SIP specifies a permission named `endowment:home-page`. -The permission signals to the platform that the snap wants to use the home page functionality. This MAY change routing in the client or change how the snap is displayed to the user. +This SIP specifies a permission named `endowment:page-home`. +The permission signals to the platform that the snap wants to use the home page functionality. This permission is specified as follows in `snap.manifest.json` files: ```json { "initialPermissions": { - "endowment:home-page": {} + "endowment:page-home": {} } } ``` ### Snap Implementation -When a user navigates to the snap home page, the `onHome` handler will be invoked. This handler MUST be used to generate the static UI content for the home page. +When a user navigates to the snap home page, the `onHomePage` handler will be invoked. This handler MUST be used to generate the static UI content for the home page. Any snap that wishes to expose a home page MUST implement the following API: ```typescript import { panel, text } from "@metamask/snap-ui"; -import { OnHomeHandler } from "@metamask/snap-types"; +import { OnHomePageHandler } from "@metamask/snap-types"; -export const onHome: OnHomeHandler = async () => { +export const onHomePage: OnHomePageHandler = async () => { const content = panel([text('Hello world!')]) return { content }; }; ``` -The `onHome` handler takes no arguments and MUST return a value that matches the following interface: +The `onHomePage` handler takes no arguments and MUST return a value that matches the following interface: ```typescript import { Component } from "@metamask/snap-ui"; -interface OnHomeResponse { +interface OnHomePageResponse { content: Component; } ```