7.0.1 • Published 4 years ago
@tronmask/inpage-provider v7.0.1
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.
7.0.1
4 years ago