I am using the web3modal
import { useWeb3Modal } from "@web3modal/react";
const foo = () => {
const { open, close } = useWeb3Modal();
async function connect_wallet() {
try {
await open(); // Open the web3modal provider selection modal
console.log("web3 and provider")
// provider
} catch (error) {
console.error("Error connecting to provider:", error);
}
}
return(
<div>
<button onClick={connect_wallet}>
Connect Wallet
</button>
</div>
)
}
so the web3modal pops up fine and gets connected, but how to grab the values of provider and web3 from it ?