Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding committed Oct 31, 2023
1 parent a03fc27 commit 508d53a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions SIPS/sip-15.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
```
Expand Down

0 comments on commit 508d53a

Please sign in to comment.