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

@metamask/inpage-provider

Package Overview
Dependencies
Maintainers
6
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/inpage-provider

A JavaScript Ethereum provider that connects to the wallet over a stream.

  • 8.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
88
decreased by-25.42%
Maintainers
6
Weekly downloads
 
Created
Source

MetaMask Inpage Provider

The inpage Ethereum provider object injected by MetaMask into web pages. Contains a lot of implementation details specific to MetaMask, and is probably not suitable for out-of-the-box use with other wallets.

Implements the Ethereum JavaScript provider specification, EIP-1193.

Installation

yarn add @metamask/inpage-provider

Usage

import { initializeProvider } from '@metamask/inpage-provider'

// Create a stream to a remote provider:
const metamaskStream = new LocalMessageDuplexStream({
  name: 'inpage',
  target: 'contentscript',
})

// this will initialize the provider and set it as window.ethereum
initializeProvider({
  connectionStream: metamaskStream,
})

const { ethereum } = window

Types

Types are exposed at index.d.ts. They require Node.js EventEmitter and Duplex stream types, which you can grab from e.g. @types/node.

Do Not Modify the Provider

The Provider object should not be mutated by consumers under any circumstances. The maintainers of this package will neither fix nor take responsbility for bugs caused by third parties mutating the provider object.

Keywords

FAQs

Package last updated on 20 Jan 2021

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