web3modal: [bug] Send transactions / tokens with v2 issue

Link to minimal reproducible example

https://walletconnect-check.chikhrai.xyz

Summary

Hello. Have some issues with try send ETH/tokens with v2 when try to interact with TrustWallet. And on iOS not work sign message. Same code work correct with metamask on v1 on Android. On iOS it not create transactions… On Android sign message with v2 with TrustWallet work correct too.

Create some demo-stand to reproduce full cicle with v1/v2 modal with this wallets.

Full code can be found here: https://github.com/YuriiChikhrai/walletconnect_check

List of related npm package versions

  • wagmi / @wagmi/core v1.3.4
  • viem v1.2.9
  • @web3modal/ethereum / @web3modal/react v2.6.2
  • react v16.14.0
  • webpack v5.87.0
  • typescript v5.1.6

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 25 (5 by maintainers)

Most upvoted comments

We are still looking into this, a bit of a tricky issue, not sure why this happens only on some wallelts atm.

Em… I doesn’t know how it can be, but solution is add data: "0x" to usePrepareSendTransaction:

const { config } = usePrepareSendTransaction({
    to,
    value,
    chainId,
    gas: BigInt(10000),
    
    data: "0x",
});

Solution take from here: wagmi-dev/wagmi#2161

I just tried it. It worked very well. Finally got some workaround. Thak you so much