correct way to use matic.js in browser client? #338
Unanswered
dellwatson
asked this question in
Q&A
Replies: 1 comment
-
@dellwatson at the place of provider, you need to provide the wallet provider e.g - metamask or walletconnect. So at a time you need to pass two provider, one child and one parent. But in case of wallet, you have access to one chain at a time means one provider at a time, so you can initialize one child or parent with the current chain provider. Generally we initialize the provider with wallet provider in case user need to execute some transaction, that is write transaction. e.g - Let's user is using metamask wallet and he is on polygon mainnet, then in this case you can initialize the child provider with the metamask provider and parent provider with rpc.
|
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
-
hello, since the examples only provide for node.js, I'm wondering how do I use it on client browser(like react)? since it will need metamask/other wallet interaction, and cannot use HDWallet
so I initialize first Posclient first
then I use normally on my button function
Beta Was this translation helpful? Give feedback.
All reactions