This package has been deprecated

Author message:

Renamed to @metamask/inpage-provider

metamask-inpage-provider

5.0.0 • Public • Published

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.

Installation

yarn add metamask-inpage-provider

Usage

import { initProvider } 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
initProvider({
  connectionStream: metamaskStream,
})
 
const { ethereum } = window

Package Sidebar

Install

npm i metamask-inpage-provider

Weekly Downloads

11

Version

5.0.0

License

MIT

Unpacked Size

34.5 kB

Total Files

15

Last publish

Collaborators

  • mcmire
  • nicholasellul
  • lgbot
  • naugtur
  • ritave
  • danfinlay
  • kumavis
  • rekmarks
  • metamaskbot
  • gudahtt
  • sethkfman