Created
November 19, 2017 16:52
-
-
Save tomericco/814031c9857bb50d62a1855041f63863 to your computer and use it in GitHub Desktop.
Using an injected Web3 instance
This file contains hidden or 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
if (typeof web3 !== 'undefined') { | |
web3 = new Web3(web3.currentProvider); | |
} else { | |
web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment