Created
October 22, 2021 17:58
-
-
Save xpluscal/39e4e128b715cfe0207c2236c0e72eb0 to your computer and use it in GitHub Desktop.
web3modal
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
let web3Modal = new Web3Modal({ | |
cacheProvider: false, // optional | |
providerOptions: { | |
walletconnect: { | |
package: WalletConnectProvider, | |
options: { | |
infuraId: Infura_Project_ID | |
} | |
}, | |
fortmatic: { | |
package: Fortmatic, // required | |
options: { | |
key: Fortmatic_Key // required | |
} | |
}, | |
authereum: { | |
package: Authereum // required | |
}, | |
torus: { | |
package: Torus // required | |
// options: { | |
// networkParams: { | |
// host: "https://localhost:8545", // optional | |
// chainId: 1337, // optional | |
// networkId: 1337 // optional | |
// }, | |
// config: { | |
// buildEnv: "development" // optional | |
// } | |
// } | |
} | |
}, | |
disableInjectedProvider: false, | |
}) | |
try { | |
provider = await web3Modal.connect() | |
} catch (e) { | |
return; | |
} | |
// Then set the provider for web3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment