sparrow-inpage-provider
TypeScript icon, indicating that this package has built-in type declarations

6.3.1 • Public • Published

Sparrow Inpage Provider

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

Installation

yarn add sparrow-inpage-provider

Usage

import { initProvider } from 'sparrow-inpage-provider'

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

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

const { ethereum } = window

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.

Readme

Keywords

Package Sidebar

Install

npm i sparrow-inpage-provider

Weekly Downloads

1

Version

6.3.1

License

MIT

Unpacked Size

43.3 kB

Total Files

11

Last publish

Collaborators

  • jyap808