Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@metamask/dialog-example-snap

Package Overview
Dependencies
Maintainers
0
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
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
decreased by-18.36%
Maintainers
0
Weekly downloads
 
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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc