Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement snap_getPreferences on mobile #3199

Open
FrederikBolding opened this issue Mar 5, 2025 · 0 comments
Open

Implement snap_getPreferences on mobile #3199

FrederikBolding opened this issue Mar 5, 2025 · 0 comments
Assignees

Comments

@FrederikBolding
Copy link
Member

We need to add the getPreferences hook on mobile to support snap_getPreferences.

Dustin4444 added a commit to Dustin4444/snaps that referenced this issue Mar 6, 2025
Fixes MetaMask#3199

Implement the `snap_getPreferences` hook on mobile.

* **CronjobController.ts**
  - Add import statement for `getPreferences` from `@metamask/snaps-sdk`
  - Add `getPreferences` to the list of hooks in the `CronjobController` class

* **SnapInterfaceController.ts**
  - Add import statement for `getPreferences` from `@metamask/snaps-sdk`
  - Add `getPreferences` to the list of hooks in the `SnapInterfaceController` class
  - Register action handler for `getPreferences`
  - Implement `getPreferences` method

* **AbstractExecutionService.ts**
  - Add import statement for `getPreferences` from `@metamask/snaps-sdk`
  - Add `getPreferences` to the list of hooks in the `AbstractExecutionService` class
  - Register action handler for `getPreferences`
  - Implement `getPreferences` method

* **ExecutionService.ts**
  - Add import statement for `getPreferences` from `@metamask/snaps-sdk`
  - Add `getPreferences` to the list of hooks in the `ExecutionService` class
  - Register action handler for `getPreferences`
  - Implement `getPreferences` method

* **constants.ts**
  - Add `snap_getPreferences` to the `ALLOWED_PERMISSIONS` array

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/MetaMask/snaps/issues/3199?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants