Skip to content

Commit

Permalink
Add mock EIP-1102 support
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpshr committed Sep 13, 2018
1 parent ce1975f commit 4929d16
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/scripts/inpage.js
Expand Up @@ -22,6 +22,15 @@ var metamaskStream = new LocalMessageDuplexStream({
// compose the inpage provider
var inpageProvider = new MetamaskInpageProvider(metamaskStream)

// Augment the provider with its enable method
inpageProvider.enable = function () {
return new Promise((resolve) => {
resolve(inpageProvider.send({ method: 'eth_accounts' }).result)
})
}

window.ethereum = inpageProvider

//
// setup web3
//
Expand Down

0 comments on commit 4929d16

Please sign in to comment.