Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const initialize = () => {
const provider =
window.web3 && window.web3.currentProvider
? new Web3Provider(window.web3.currentProvider)
: new FallbackProvider([
new JsonRpcProvider('https://api.mycryptoapi.com/eth'),
new InfuraProvider(),
new EtherscanProvider()
]);
handleConnect(provider);
};
function getLibrary(provider: any): Web3Provider {
const library = new Web3Provider(provider)
library.pollingInterval = 8000
return library
}