wakumo / flutter-wallet-connect-v2

WalletConnect V2 for Flutter
MIT License
24 stars 7 forks source link

onSessionRequest Not Triggered When Connecting to Tron Network #20

Open huantd0111 opened 1 year ago

huantd0111 commented 1 year ago

I am facing an issue: onSessionRequest callback is not being invoked when attempting to request with the Tron Network. Specifically, while implementing the library, everything works fine with EVM networks. However, when I try to connect to the Tron Network and perform requests like tron_signMessage or tron_sendTransaction on the Wallet Connect test web page (https://react-app.walletconnect.com/), I receive the exception _onEventError general_error Internal error, despite having logs for the event. I will provide the log details below.

flutter: onEvent data = {data: {id: 1690519104119551, chainId: tron:0x2b6653dc, topic: c354d7d0793aeeae185ad655fb83fa27011b130a86802d3a71d4dfd50c43bac7, method: tron_signMessage, params: {"message":"This is a message to be signed for Tron","address":"TJfNLvxFeWDzuVgkrjhx1sjHSNnEFFrvTf"}}, name: session_request}
flutter: My Wallet: _onEventError general_error Internal error

Steps to Reproduce:

  • Import the library into a Flutter project.
  • Set up configurations to connect to the Tron Network using the library's provided methods.
  • Open the Wallet Connect test web page (https://react-app.walletconnect.com/) and select the Tron Network.
  • Attempt to initiate a connection with the Tron Network using the Wallet Connect test web page.
  • Observe the behavior and error messages, if any.

Expected Behavior: The onSessionRequest callback should be triggered when attempting to connect to the Tron Network, allowing the app to interact with the Tron wallet seamlessly.

Actual Behavior: The onSessionRequest callback is not triggered, and upon performing actions like tron_signMessage or tron_sendTransaction, I receive the exception _onEventError general_error Internal error. Despite this error, I can still see logs for the event, suggesting that there might be an internal issue within the library.

ludowkm commented 1 year ago

Hello @huantd0111 , thank you for filling the issue. As the moment, we just officially support Ethereum networks only so we don't guarantee it works for other networks because we have not yet tested. From your console log, it may missing and not correct model so i think you should fork this lib to support Tron network as well as your demand for more better.