Connect to blockchain even if the wallet provider hasn’t been enabled or has timed out
vladmee opened this issue · 1 comments
vladmee commented
Hi! I want to set my Infura provider as default for my dapp, regardless of the user having a wallet installed, enabled, or connected. Providing it as a 'customProvider' in the 'drizzleOptions' file doesn't work as it still tries to connect to the wallet provider (ie. MetaMask)
There is a way to have the following priority of providers in drizzle:
- Infura provider ALWAYS
- Wallet provider (ie. Metamask) ONLY IF the user specifically asks to connect within the dapp
- Fallback if everything else fails (the fallback currently works for me)
Here's my drizzleOptions configuration:
const options = { web3: { block: false, customProvider: new Web3("wss://mainnet.infura.io/ws/v3/API_KEY"), fallback: { type: "ws", url: fallbackUrl, }, }, contracts: [Contract], events: {}, syncAlways: true, polls: { accounts: 1500, }, };
Any help is appreciated. Thank you!