Test!
View provider-enable-promise.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise.resolve(window.web3 || window.ethereum) | |
.then(() => { | |
// using this will wrap the return values in promises despite the first condition being synchronous | |
return window.web3.eth.defaultAccount || window.ethereum.enable(); | |
}) | |
.then(account => { | |
// either method will return the default account address | |
}) | |
.catch(err => { | |
// no web3 or ethereum |
View keybase.md
Keybase proof
I hereby claim:
- I am jackleslie on github.
- I am jackleslie (https://keybase.io/jackleslie) on keybase.
- I have a public key ASBawO-etYcX-mx9UVlkyV8AmGcXg3jbx-jpc7KS5X5xzQo
To claim this, I am signing this object: