0
I'm using rainbowkit wallet which offers various wallet options such as walletconnect and coinbase.
My question is, if I'm connected via metamask then my web3 instance can use window.ethereum as provider.
But if I'm connected to other wallets like walletconnect or coinbase, can I still go with window.ethereum as provider?
i.e. let web3 = new Web3(window.ethereum);
if not, for other wallets where can I get its provider? is there an option to grab currently connected provider using wagmi?
i am also using
const { data: signer } = useSigner();
const provider = useProvider();
what i tried doing is instead of this :
const web3 = new Web3(Web3.givenProvider);
I was trying this below :
const web3 = new Web3((signer?.provider).provider);
this throws error like :
can someone help me with this issue ?
Tx