Wagmi connector write contract is not working

I used wagmi connector with web3auth.
if users call write contract with metamask, it’s working.
but when users call write contract function with the embed wallet, it’s not working.


image

plz help me @Ayush

Hi, @Ayush @TomTom
any response yet?

Hey @devcrypto389, sorry for the delays, we’ll checkout and update. Can you share the RPC you are using, and what’s the RPC error you are getting from network logs?

const chainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: “0x89”,
rpcTarget: “https://rpc.ankr.com/polygon”,
displayName: “Polygon Mainnet”,
blockExplorerUrl: “https://polygon.etherscan.io”,
ticker: “MATIC”,
tickerName: “Polygon”,
};

you mean this?

Hi, @Ayush
what else do you need from me?

As I see, the errors says Internal JSON -RPC error. This error generally happens due to non responsive RPC url being provided to the SDK. I’d recommend you to change your polygon rpcTarget and fetch one from Infura/ Alchemy/ Quicknode or other services.

It’s working on metamask.
you mean I have to use rpc url that web3auth provide?

Hi, @Ayush @yashovardhan
could you provide the any other solution?
I changed and test it with other rpc urls.

Hi, @Ayush @yashovardhan

Hi, @Ayush @yashovardhan
could you plz help me to fix this issue?

Can you share the repo to debug?

sure.
could you send the github username?
let me invite you to the repo.


after connect the embed wallet.
you can see error when click mint button.

I’ll check it out, and update you. Got the invitation, thanks.

Hi, @Ayush
did you check it?

Hi, @Ayush
How are you?
Did you check the code?

Hi, @Ayush
How are you?
Did you find the reason of the issue?

The error is because you don’t have enough funds to do the transaction. You can see the wallet has 0 Matic which is why it’s failing. When you are connecting the Metamask, it might have the funds to submit the on chain transaction. This is the network log from the console.

oh. let me check it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.