Yes, you can use web3. eth. currentProvider. disconnect() to disconnect from wallet and onDisconnect to add listener to the disconnect.