How can I access provider in component #568
Answered
by
saihaj
AmanRaj1608
asked this question in
Q&A
-
I have done react setup with the RainbowKitProvider. Now after I connect to my wallet I want to make a new (web3 / ethers) instance from the provider to call my smart contract. But I am unable to get the provider or NetworkId data. Also didn't find this in any examples and docs. Can someone help, please? |
Beta Was this translation helpful? Give feedback.
Answered by
saihaj
Jul 8, 2022
Replies: 2 comments
-
you can use either get |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AmanRaj1608
-
Yup found it! import { useProvider } from "wagmi";
const provider = useProvider(); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can use either get
account?.connector.getProvider()
fromuseAccount
or just use theuseProvider