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

7.0.1 • Public • Published

TronMask Inpage Provider

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

Installation

yarn add @tronmask/inpage-provider

Usage

import { initProvider } from "@tronmask/inpage-provider";

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

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

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

/@tronmask/inpage-provider/

    Package Sidebar

    Install

    npm i @tronmask/inpage-provider

    Weekly Downloads

    0

    Version

    7.0.1

    License

    MIT

    Unpacked Size

    44.5 kB

    Total Files

    11

    Last publish

    Collaborators

    • kevholder