@mimirdev/apps-inject
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

@mimirdev/apps-inject

Inject the Mimir Wallet into the window.injectedWeb3 of apps.

Usage

Installation -

yarn add @mimirdev/apps-inject

Functions can be imported as follows:

import { inject, isMimirReady, MIMIR_REGEXP } from '@mimirdev/apps-inject';
isMimirReady().then(origin => {
  if (!origin) {
    // not open in mimir

    return;
  }
  // check is "https://app.mimir.global" or "https://dev.mimir.global"
  if (MIMIR_REGEXP.test(origin)) {
    // inject to window.injectedWeb3.mimir
    inject();
    // now. you can use polkadot extension functions
  }
})

Readme

Keywords

none

Package Sidebar

Install

npm i @mimirdev/apps-inject

Weekly Downloads

72

Version

0.2.1

License

Apache-2.0

Unpacked Size

17 kB

Total Files

13

Last publish

Collaborators

  • jarvan.dev