Skip to content

Instantly share code, notes, and snippets.

@CarlosLanderas
Created August 20, 2020 16:11
Show Gist options
  • Save CarlosLanderas/072605333e04f4f612adae498b588531 to your computer and use it in GitHub Desktop.
Save CarlosLanderas/072605333e04f4f612adae498b588531 to your computer and use it in GitHub Desktop.
import Web3 from 'web3';
const getWeb3 = () => {
return new Promise( (resolve, reject) => {
window.addEventListener('load', function() {
let web3 = window.web3;
web3 = new Web3(web3.currentProvider);
console.log(web3.version);
resolve(web3);
});
});
};
export default getWeb3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment