Coder Social home page Coder Social logo

flutter-wallet-connect-v2's People

Contributors

ludowkm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flutter-wallet-connect-v2's Issues

onSessionRequest Not Triggered When Connecting to Tron Network

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.

Does this work with Flutter Web?

I'm working on a flutter app(android/ios/web), I want to use this package but quite unsure if it works fine with web as well.
I could not find any place where I could communicate so creating this issue.

Thank you

IOS app crash when initialising wallet

I encountered unexpected app crashes on IOS only (android works fine).
Error message: Could not cast value of type 'NSNull' to 'NSString'. Then app crashes.
Caused when calling init method. Issue arises only when redirect field of appMetadata is null, while if I assign redirect an empty string, it works fine.
Code samples: final AppMetadata walletMetadata = AppMetadata( name:name, url: url, description: description, icons: <String>[ icon, ], redirect: "", );
await _walletConnect.init(projectId: 'yourid', appMetadata: walletMetadata);

[Android] _onSessionProposal event not received with certain DApps

Issue with flutter-wallet-connect-v2: _onSessionProposal event not received on Android for certain DApps (PancakeSwap and Uniswap)

Description:
I'm reaching out for support regarding an issue I'm facing with the flutter-wallet-connect-v2 library. After updating to the latest version 1.0.6, I've encountered a problem where the _onSessionProposal event is not being received when connecting with certain DApps on the Android platform. The affected DApps include PancakeSwap and Uniswap.

Platform and Environment:

  • Device: Android ADV 12L (SDK 32) arm64 v8a
  • Operating Mode: Debug
  • Proguard: The proguard-rules.pro file has been updated following the library's demo for proper obfuscation.

Issue Details:

  1. Upon calling the function await _wcClientV2.pair(uri: url);, no events are triggered when connecting with PancakeSwap and Uniswap DApps.
  2. The first log received after the function call is: onEvent data = {name: connection_status, data: {isConnected: true}}.
  3. Subsequent events, including the _onSessionProposal event, are not received, even after restarting the application and reconnecting.

Additional Observations:

  • The flutter-wallet-connect-v2 library functions as expected on iOS, and the events are received without any issues on that platform.
  • Interestingly, some other DApps, such as https://react-app.walletconnect.com/, work perfectly fine, and the events are received as expected on Android.

Request for Assistance:
I kindly request your support in resolving this issue with the flutter-wallet-connect-v2 library on the Android platform. As other DApps work fine, it seems to be specific to PancakeSwap and Uniswap connections. If there are any specific configurations, customizations, or logs needed from my side to facilitate the investigation, please let me know, and I'll be glad to provide them.

Thank you for your attention and assistance in resolving this matter.

Reconnect problem

How to reconnect to WalletConnect V2 when the app cold start?
Do you have any good ideas?

Doubt about connections

The doubt is very simple, this package connects only with Eth? If no, how to connect with Btc and the others?

username error

 Required by:
     project :app > project :wallet_connect_v2 > com.walletconnect:android-core:1.24.0 > com.walletconnect:foundation:1.12.0
  > Could not resolve com.github.multiformats:java-multibase:1.1.1.
     > Could not get resource 'https://maven.pkg.github.com/trustwallet/wallet-core/com/github/multiformats/java-multibase/1.1.1/java-multibase-1.1.1.pom'.
        > Username must not be null!

I am getting this error on android, iOS works fine

Doubt for chain switching.

By default my remix is connected to chainID: 42161 but I wanted to connect it with Goerli(ChainID: 5). When I try to switch network on remix, it shows me no implementation for wallet_addEthereumChain method(when I'm using example inside this repo).
I'm unable to understand how it handles the switching of chains? Any snippet/ function for this?

Issue with accepting connection - "Unsupported methods for namespace" - wallet_connect_v2

Hello,

I hope this message finds you well. I am facing an issue with the wallet_connect_v2 Flutter library when trying to accept a connection. Specifically, I receive the error message "Unsupported methods for namespace." I have attempted to upgrade to the latest version of the library but encountered this problem during the approval process.

To provide more context, I have followed your example for implementing the connection approval process, and it seems to be working fine with the older version. However, after upgrading to the latest version, when I reach the "approve" step and build a SessionApproval object, it looks like this:

{
  "id": "c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969",
  "namespaces": {
    "eip155": {
      "accounts": ["eip155:5:0x5d35c1b9b2ae614bf9b470af9ae4a544f355afc1"],
      "methods": ["eth_signTypedData_v4", "eth_sign", "eth_signTransaction", "eth_signTypedData"],
      "events": ["chainChanged", "accountsChanged"]
    }
  }
}

However, when I call wcClientV2.approveSession(approval: approval);, I get the following error message:

_onEventError approve_error Unsupported methods for namespace.

To further assist you in troubleshooting, I've included some relevant log information during the connection process:

`

flutter: onEvent data = {name: connection_status, data: {isConnected: true}}

flutter: onEvent data = {name: proposal, data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}}

flutter: My Wallet: _onSessionProposal {"id":"c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969","proposer":{"name":"React App","url":"https://react-app.walletconnect.com","description":"React App for WalletConnect","icons":["https://avatars.githubusercontent.com/u/37784886"],"redirect":null},"namespaces":{"eip155":{"chains":["eip155:5"],"methods":["eth_sendTransaction","personal_sign"],"events":["chainChanged","accountsChanged"]}},"optionalNamespaces":{"eip155":{"chains":["eip155:5"],"methods":["eth_signTypedData_v4","eth_sign","eth_signTransaction","eth_signTypedData"],"events":[]}}}
flutter: My Wallet: [{network: Instance of 'NetworkSupport', currency: _code: eth_test eth_test,, account: Account{address: 0x5d35c1b9b2ae614bf9b470af9ae4a544f355afc1, index: 0, addressName: null, balance: Balance{_decimal: 0, _balance: 0, _decimalBalance: 0.0, _beautyBalance: 0, _displayBalance: null, _precision: 6, _usdtBalance: null}}}]

flutter: onEvent data = {name: proposal, data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}}

flutter: onEvent data = {name: proposal, data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}}

flutter: onEvent data = {name: proposal, data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}}

flutter: onEvent data = {name: proposal, data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}}

flutter: onEvent data = {name: proposal, data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}}

flutter: onEvent data = {name: proposal, data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}}

flutter: onEvent data = {name: proposal, data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}}

flutter: onEvent data = {name: proposal, data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}}
flutter: onEvent data = {data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}, name: proposal}

flutter: onEvent data = {name: proposal, data: {id: c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969, namespaces: {eip155: {chains: [eip155:5], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged]}}, proposer: {icons: [https://avatars.githubusercontent.com/u/37784886], redirect: null, name: React App, description: React App for WalletConnect, url: https://react-app.walletconnect.com}, optionalNamespaces: {eip155: {chains: [eip155:5], methods: [eth_signTypedData_v4, eth_sign, eth_signTransaction, eth_signTypedData], events: []}}}}

flutter: My Wallet: ----------

flutter: My Wallet: {"id":"c4cfa7d03950e101abcc116cace0814f6bc7e555dd2129ff3639b829b9717969","namespaces":{"eip155":{"accounts":["eip155:5:0x5d35c1b9b2ae614bf9b470af9ae4a544f355afc1"],"methods":["eth_signTypedData_v4","eth_sign","eth_signTransaction","eth_signTypedData"],"events":["chainChanged","accountsChanged"]}}}

flutter: My Wallet: ----------

flutter: My Wallet: _onEventError approve_error Unsupported methods for namespace`

As you can see from the logs, the object I created seems to be fine. I have verified it and compared it with the previous version, and they are identical.

Could you please help me troubleshoot this issue? I have noticed some asset loading errors, but I'm not sure if they are related to the problem. I appreciate any insights or guidance you can provide to resolve this.

How to connect with DApp (MetaMask, ....)

OS: IOS, Android
Device: Mobile
*Precondition:

Connect with MetaMask

*Data test: Account

*Reproduce Step:
1, Use createPair to send request connect to MetaMask

final uri = await _walletConnectV2Plugin
            .createPair(namespaces: {
          'eip155': ProposalNamespace(chains: [
            'eip155:1'
          ], methods: [
            "eth_signTransaction",
          ], events: ["connect", "disconnect"])
        });
        launchUrlString(
          uri!,
          mode: LaunchMode.externalApplication,
        );

2, Redirect to MetaMask app but can't show popup request

Actual:
Don't show popup to confirm sign connect

Expected:
How to work for metaMask

Android issue

The flow I have created:

  1. Initialize wallet connect using init(projectId: _projectId, appMetadata: _walletMetadata)
  2. Then I connect using connect();
  3. Then I pair using pair(uri: uri);
  4. When I have to disconnect the session, I use .disconnectSession(topic: widget.session.topic)

It works fine till this point. But if I try to pair again, it takes way too long. But if I restart the app and try again, it works fine till step 4.

It is happening on android only, iOS works fine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.