Hook into Metamask's state events observers array to be able to act on account changes from the UI
It's a wrapper around the setStateEventObserver()
helper method
Function to add the state events update array It receives the state object as an only argument
Does not return noting
Check if Metamask's injected web3 proxy instance is available in the global object.
Makes use of the detect()
helper, basically it's a wrapper
that exposes it from the module.
Only returns true if it's available, otherwise it will throw.
Open the Metamask Wallet instance
The wallet object resulted by instantiating the class (Object is wrapped in a promise).
Generated using TypeDoc
@purser/metamask
A
javascript
library to interact with the a Metamask based Ethereum wallet. It extracts all the complexity from setting up, maintaining and interacting with it, while providing you with a predictable interface.Installation
Quick Usage
import { open } from '@purser/metamask' const wallet = await open(); console.log(wallet); // { address: '...', chainId: '...', publicKey: '...' }
Documentation
You can find more in-depth description for this module's API in the purser docs.
Contributing
This package is part of the purser monorepo package.
Please read our Contributing Guidelines for how to get started.
License
The
@purser/metamask
library along with the whole purser monorepo are MIT licensed.