You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@metamask/dialog-example-snap

Package Overview
Dependencies
Maintainers
11
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/dialog-example-snap

MetaMask example snap demonstrating the use of `snap_dialog`.

2.3.1
latest
Source
npmnpm
Version published
Maintainers
11
Created
Source

@metamask/dialog-example-snap

This snap demonstrates the use of snap_dialog to display a dialog to the user.

Snap manifest

Note: Using snap_dialog requires the snap_dialog permission. Refer to the documentation for more information.

Along with other permissions, the manifest of this snap includes the snap_dialog permission:

{
  "initialPermissions": {
    "snap_dialog": {}
  }
}

This permission does not require any additional configuration.

Snap usage

This snap exposes an onRpcRequest handler, which supports the following JSON-RPC methods, one for each type of dialog:

  • showAlert: Displays an alert dialog to the user.
  • showConfirmation: Displays a confirmation dialog to the user.
  • showPrompt: Displays a prompt dialog to the user.

For the sake of simplicity, the methods do not accept any parameters, and return the value returned by snap_dialog directly.

For more information, you can refer to the end-to-end tests.

FAQs

Package last updated on 11 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.