@metamask-checker/core

1.0.0 • Public • Published

Metamask Checker — Core

License Build Status Coverage Status

Description

Core part of the react-metamask-checker and vue-metamask-checker components.

Note: only new version of Metamask API is supported. Related links:

Installation

yarn add @metamask-checker/core

# or

npm install --save @metamask-checker/core

Testing

yarn test:jest # Runs Jest with coverage collection
yarn test:coverage # Sends coverage to .coveralls.io
yarn test # yarn test:jest && yarn test:coverage

# or

npm run test:jest
npm run test:coverage
npm test

Usage

import checkMetamask from '@metamask-checker/core'

(async () => {
  try {

    const { selectedNetwork, selectedAccount } = await checkMetamask(
      window.ethereum,
      // networkId or chainId decimal number value,
      // account address string value,
    )

    // ...code

  } catch (error) {
    console.error(error)
  }
})()

Package Sidebar

Install

npm i @metamask-checker/core

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

11.1 kB

Total Files

6

Last publish

Collaborators

  • lordotu