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

@metamask/ethereum-provider-example-snap

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/ethereum-provider-example-snap

MetaMask example snap demonstrating the use of the Ethereum Provider API and `endowment:ethereum-provider` permission.

  • 2.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@metamask/ethereum-provider-example-snap

This snap demonstrates the use of the endowment:ethereum-provider permission and the corresponding ethereum global. This is similar to the window.ethereum API, but it does not have access to all methods.

Snap manifest

Note: Using ethereum requires the endowment:ethereum-provider permissions. Refer to the documentation for more information.

Along with other permissions, the manifest of this snap includes the endowment:ethereum-provider permission:

{
  "initialPermissions": {
    "endowment:ethereum-provider": {}
  }
}

This permission does not require any additional configuration.

Snap usage

This snap exposes an onRpcRequest handler, which supports the following JSON-RPC methods:

  • getGasPrice: Get the current recommended gas price from an Ethereum provider.
  • getVersion: Get the Ethereum network version from an Ethereum provider.
  • getAccounts: Get the Ethereum accounts made available to the snap from an Ethereum provider.

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