auramascara

0.0.1 • Public • Published

AuraMascara CircleCI

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

Disclaimer:

AuraMascara 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/auramascara.js"></script>

or bring your own:

npm i --save auramascara

const metamask = require('auramascara')
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('auramascara')
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:

Dependents (0)

Package Sidebar

Install

npm i auramascara

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

216 kB

Total Files

24

Last publish

Collaborators

  • irchain-io