I am trying to create a mobile app that can connect to mobile wallets (ex: Metamask, TrustWalet,...) via WalletConnect, but i can't find anything.
Is there any way to implement walletconnect on flutter app yet?
I am trying to create a mobile app that can connect to mobile wallets (ex: Metamask, TrustWalet,...) via WalletConnect, but i can't find anything.
Is there any way to implement walletconnect on flutter app yet?
You need walletconnect_dart and url_launcher
import 'package:url_launcher/url_launcher_string.dart';
import 'package:walletconnect_dart/walletconnect_dart.dart';
// Create a connector
final connector = WalletConnect(
bridge: 'https://bridge.walletconnect.org',
clientMeta: PeerMeta(
name: 'WalletConnect',
description: 'WalletConnect Developer App',
url: 'https://walletconnect.org',
icons: [
'https://gblobscdn.gitbook.com/spaces%2F-LJJeCjcLrr53DcT1Ml7%2Favatar.png?alt=media'
],
),
);
// Subscribe to events
connector.on('connect', (session) => print(session));
connector.on('session_update', (payload) => print(payload));
connector.on('disconnect', (session) => print(session));
// Create a new session
if (!connector.connected) {
final session = await connector.createSession(
onDisplayUri: (uri) async {
_uri = uri;
await launchUrlString(uri, mode: LaunchMode.externalApplication);
}
);
}
For more information please visit walletconnect_dart
For More Check : Link