Skip to content

Instantly share code, notes, and snippets.

@nedrocks
Created April 8, 2022 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nedrocks/4af0fd47d489a027f4bf582edbfb3b61 to your computer and use it in GitHub Desktop.
Save nedrocks/4af0fd47d489a027f4bf582edbfb3b61 to your computer and use it in GitHub Desktop.
Use wallet connect 2
const getWeb3Modal = () => {
const providerOptions = {
injected: {
display: {
name: 'Metamask',
description: 'Connect with the provider in your Browser',
},
package: null,
},
walletconnect: {
package: WalletConnectProvider,
options: {
bridge: 'https://bridge.walletconnect.org',
//infuraId: process.env.REACT_PUBLIC_INFURA_ID,
},
},
};
const web3Modal = new Web3Modal({
network: 'mainnet',
cacheProvider: true,
disableInjectedProvider: false,
providerOptions,
});
return web3Modal;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment