wakumo / flutter-wallet-connect-v2 Goto Github PK
View Code? Open in Web Editor NEWWalletConnect V2 for Flutter
License: MIT License
WalletConnect V2 for Flutter
License: MIT License
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.
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
![image](https://user-images.githubusercontent.com/43994963/222873922-910016e3-536f-4c1e-865b-445ed35f2c7b.png
Can you explain this error to me?
I try run example
Hello, thanks for your continued contribution on this project. I am wondering how to support namespaces as per this document https://docs.walletconnect.com/web3wallet/namespaces
https://docs.walletconnect.com/web3wallet/wallet-usage#namespace-builder
There appears to be a deadline of Nov 27th, any information or documentation would be greatly appreciated.
Rich
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);
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:
Issue Details:
Additional Observations:
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.
await _client.init(projectId: "my_project_id", appMetadata: metadata);
await _client.connect();
await _client.pair(uri: wcUri);
I always got the TimeoutCancellationException from kotlin. anyone has the same issue?
How to reconnect to WalletConnect V2 when the app cold start?
Do you have any good ideas?
The doubt is very simple, this package connects only with Eth? If no, how to connect with Btc and the others?
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
E/flutter (11903): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method init on channel wallet_connect_v2)
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?
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.
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
The flow I have created:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.