Imported @walletconnect/ethereum-provider which is the recommended lib to use WCv2 if previously using @walletconnect/web3-provider for WCv1
Imported @web3modal/standalone which is required by ethereum provider to display the connection modal
Changes
Moved this.setConnectionData(providerType, chainId) on the connect function downwards because if you clicked on wallet connect and refreshed the app without connecting, the wallet connect modal would just popup.
Now handling the Web3ReactDeactivate event to trigger a disconnect when the wallet emits the disconnect event. Useful to clear persisted storage and prevent undesired behavior on refresh.
Added the WalletConnectV2Connector which adapts @walletconnect/ethereum-provider to be used as an AbstractConnector
Added removeRegExp function to delete various keys from local storage at once that match a certain pattern.
Dependencies
@walletconnect/ethereum-provider
which is the recommended lib to use WCv2 if previously using@walletconnect/web3-provider
for WCv1@web3modal/standalone
which is required by ethereum provider to display the connection modalChanges
this.setConnectionData(providerType, chainId)
on the connect function downwards because if you clicked on wallet connect and refreshed the app without connecting, the wallet connect modal would just popup.@walletconnect/ethereum-provider
to be used as an AbstractConnectorremoveRegExp
function to delete various keys from local storage at once that match a certain pattern.