metamascara-es5
npm i metamascara-es5

metamascara-es5

(beta) Add MetaMask to your dapp even if the user doesn't have the extension installed

by MetaMask

2.2.6 (see all)License:ISCTypeScript:Not Found
npm i metamascara-es5
Readme

ES5

npm install --save-dev babel-cli
npm install --save-dev babel-preset-es2015
./node_modules/.bin/babel mascara.js --out-file mascara-es5.js --presets=es2015
./node_modules/.bin/babel lib --out-dir dist --presets=es2015

MetaMascara

MetaMascara(mascara) brings metamask when metamask is not installed.

Disclaimer:

MetaMascar is in alpha expect breaking changes

to use as a CDN put this script tag in the <head> of your html file:

<script src="https://wallet.metamask.io/metamascara.js"></script>

or bring your own:

npm i --save metamascara

const metamask = require('metamascara')
const EthJs = require('ethjs')

// mascara will use the environmental provider if the user brings one
// in the form of metamask extension, mist or parity
// other wise it will make one for you :}

const ethereumProvider = metamask.createDefaultProvider()

const eth = new EthJs(ethereumProvider)

// do stuff...

Developing:

For development with metamask-extension/mascara to point the iframe at localhost just do:

const metamask = require('metamascara')
const ethereumProvider = metamask.createDefaultProvider({
    host: 'http://localhost:9001'
  }) // or what ever port you use

How does it work and how to use it:

Mascara is an iframe that acts as a proxy between your dapp and metamask core. The metamask core is the global context housed in a service worker, it does the key management for every dapp the user visits.

nomnom

todo's:

Downloads/wk

1

GitHub Stars

173

LAST COMMIT

4yrs ago

MAINTAINERS

1

CONTRIBUTORS

5

OPEN ISSUES

22

OPEN PRs

1
VersionTagPublished
2.2.6
latest
4yrs ago
No alternatives found
No tutorials found
Add a tutorial