@wanchainmask/inpage-provider
TypeScript icon, indicating that this package has built-in type declarations

6.4.5 • Public • Published

WanchainMask Inpage Provider

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

Installation

yarn add @wanchainmask/inpage-provider

Usage

import { initProvider } from '@wanchainmask/inpage-provider'

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

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

const { wanchain } = 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.

Package Sidebar

Install

npm i @wanchainmask/inpage-provider

Weekly Downloads

0

Version

6.4.5

License

MIT

Unpacked Size

44.8 kB

Total Files

11

Last publish

Collaborators

  • mutouji
  • wanfans