Closed sethitanay closed 4 weeks ago
Hello @sethitanay!
For starter Dart's initState()
function shouldn't be async, so you should find a better way of initializing W3MService()
, check the sample app.
Second, please move to web3modal_flutter: 3.1.2
and then add this dependency override
dependency_overrides:
walletconnect_flutter_v2: 2.2.2
Null check operator used on a null value
, which could totally be happening on this line topic: _w3mService.session!.topic.toString(),
. If you are not connected you won't have a session
.Please follow documentation (there's a handy video at the bottom) and get back it you still have issues. https://docs.walletconnect.com/web3modal/flutter/installation
Hi, thank you for your reply. I have written the connection logic in a separate file. Below I have given the code of both my files. The application runs and Metamask is opened whenever the connect button is pressed. However, whenever a writeContract or readContract transaction is initiated, Metamask opens up as expected, but the transaction confirmation pop-up is not being displayed.
Code for connection logic file:
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';
class MetamaskConnector extends StatefulWidget {
const MetamaskConnector({super.key});
@override
State<MetamaskConnector> createState() => _MetamaskConnectorState();
}
class _MetamaskConnectorState extends State<MetamaskConnector> {
late W3MService _w3mService;
@override
void initState(){
super.initState();
W3MChainPresets.chains.putIfAbsent(_chainId, () => _sepoliaChain);
_w3mService = W3MService(
projectId: '001b66692e8d25adb3d5f7d189550651',
metadata: const PairingMetadata(
name: 'W3m Flutter',
description: 'Web3Modal Flutter Example',
url: 'https://www.walletconnect.com/',
icons: ['https://walletconnect.com/walletconnect-logo.png'],
redirect: Redirect(
native: 'flutterdapp://',
universal: 'https://www.walletconnect.com',
),
),
includedWalletIds : {
'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96',// Coinbase Wallet
},
excludedWalletIds : {
'4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
},
);
_w3mService.init();
}
@override
Widget build(BuildContext context) {
return Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
W3MNetworkSelectButton(service: _w3mService),
W3MConnectWalletButton(service: _w3mService),
],
),
);
}
}
const _chainId = "11155111";
final _sepoliaChain = W3MChainInfo(
chainName: 'Sepolia',
chainId: _chainId,
namespace: 'eip155:$_chainId',
tokenName: 'ETH',
rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
blockExplorer: W3MBlockExplorer(
name: 'Sepolia Explorer',
url: 'https://sepolia.etherscan.io/'
)
);
File in which I am trying to implement write function:
import 'package:flutter/material.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';
import 'package:flutter/services.dart';
import 'package:voter_booth/utils/constants.dart';
class AuthorizeVoterScreen extends StatefulWidget {
const AuthorizeVoterScreen({super.key});
@override
State<AuthorizeVoterScreen> createState() => _AuthorizeVoterScreenState();
}
class _AuthorizeVoterScreenState extends State<AuthorizeVoterScreen> {
late TextEditingController nameController;
late TextEditingController addressController;
late TextEditingController ageController;
late TextEditingController genderController;
late W3MService _w3mService;
@override
void initState() {
super.initState();
try {
_w3mService = W3MService(
projectId: '001b66692e8d25adb3d5f7d189550651',
metadata: const PairingMetadata(
name: 'W3m Flutter',
description: 'Web3Modal Flutter Example',
url: 'https://www.walletconnect.com/',
icons: ['https://walletconnect.com/walletconnect-logo.png'],
redirect: Redirect(
native: 'flutterdapp://',
universal: 'https://www.walletconnect.com',
),
),
includedWalletIds: {
'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96',
// Metamask Wallet
},
excludedWalletIds: {
'4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
},
);
_w3mService.init();
} catch (e) {
print("Error initializing _w3mService: $e");
// Handle initialization error gracefully
}
nameController = TextEditingController();
addressController = TextEditingController();
ageController = TextEditingController();
genderController = TextEditingController();
}
Future<void> callWriteFunction1() async {
print("_w3mService: $_w3mService");
String abi = await rootBundle.loadString('assets/abi.json');
String contractAddress = contractAddress1;
try {
final deployedContract = DeployedContract(
ContractAbi.fromJson(abi, 'Voting'),
EthereumAddress.fromHex(contractAddress),
);
await _w3mService.launchConnectedWallet();
print("Session: ${_w3mService.session}");
if (_w3mService.session != null) {
await _w3mService.requestWriteContract(
topic: _w3mService.session!.topic.toString(),
chainId: 'eip155:11155111',
rpcUrl:
'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
deployedContract: deployedContract,
functionName: 'authorizeVoter',
parameters: [
addressController.text,
nameController.text,
ageController.text,
genderController.text
],
transaction: Transaction(),
);
} else {
print("Session is null");
}
} catch (e) {
print("Error calling write function: $e");
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Authorize Voter'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
TextFormField(
controller: nameController,
decoration: const InputDecoration(labelText: 'Voter Name'),
),
const SizedBox(height: 16),
TextFormField(
controller: addressController,
decoration:
const InputDecoration(labelText: 'Voter Address'),
),
const SizedBox(height: 16),
TextFormField(
controller: ageController,
decoration: const InputDecoration(labelText: 'Age'),
keyboardType: TextInputType.number,
),
const SizedBox(height: 16),
TextFormField(
controller: genderController,
decoration: const InputDecoration(labelText: 'Gender'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
callWriteFunction1();
},
child: const Text('Authorize Voter'),
),
],
),
),
),
),
);
}
}
Dependencies: walletconnect_flutter_v2: ^2.2.2 web3modal_flutter: ^3.1.2 dependency_overrides: walletconnect_flutter_v2: 2.2.2
Terminal Status:
Launching lib\main.dart on Redmi Note 9 Pro Max in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Debug service listening on ws://127.0.0.1:55132/RE9kVPUrlPY=/ws
Syncing files to device Redmi Note 9 Pro Max...
W/DynamiteModule(31666): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
I/DynamiteModule(31666): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
W/ProviderInstaller(31666): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
W/ziparchive(31666): Unable to open '/system/framework/org.apache.http.legacy.dm': No such file or directory
W/ziparchive(31666): Unable to open '/system/framework/org.apache.http.legacy.dm': No such file or directory
D/nativeloader(31666): Configuring clns-6 for other apk /system/framework/org.apache.http.legacy.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/lib/arm64:/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/nativeloader(31666): Extending system_exposed_libraries: libvraudio_client.qti.so:libbinauralrenderer_wrapper.qti.so:libhoaeffects.qti.so:libQOC.qti.so:libcamera_algoup_jni.xiaomi.so:libcamera_mianode_jni.xiaomi.so:libupdateprof.qti.so:libthermalclient.qti.so:libQOC.qti.so:libdiag_system.qti.so:libqape.qti.so:libqesdk_ndk_platform.qti.so:liblistenjni.qti.so
W/ziparchive(31666): Unable to open '/system/framework/com.android.media.remotedisplay.dm': No such file or directory
W/ziparchive(31666): Unable to open '/system/framework/com.android.media.remotedisplay.dm': No such file or directory
D/nativeloader(31666): Configuring clns-7 for other apk /system/framework/com.android.media.remotedisplay.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/lib/arm64:/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/nativeloader(31666): Extending system_exposed_libraries: libvraudio_client.qti.so:libbinauralrenderer_wrapper.qti.so:libhoaeffects.qti.so:libQOC.qti.so:libcamera_algoup_jni.xiaomi.so:libcamera_mianode_jni.xiaomi.so:libupdateprof.qti.so:libthermalclient.qti.so:libQOC.qti.so:libdiag_system.qti.so:libqape.qti.so:libqesdk_ndk_platform.qti.so:liblistenjni.qti.so
W/ple.voter_boot(31666): Loading /data/misc/apexdata/com.android.art/dalvik-cache/arm64/system@framework@com.android.location.provider.jar@classes.odex non-executable as it requires an image which we failed to load
D/nativeloader(31666): Configuring clns-8 for other apk /system/framework/com.android.location.provider.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/lib/arm64:/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/nativeloader(31666): Extending system_exposed_libraries: libvraudio_client.qti.so:libbinauralrenderer_wrapper.qti.so:libhoaeffects.qti.so:libQOC.qti.so:libcamera_algoup_jni.xiaomi.so:libcamera_mianode_jni.xiaomi.so:libupdateprof.qti.so:libthermalclient.qti.so:libQOC.qti.so:libdiag_system.qti.so:libqape.qti.so:libqesdk_ndk_platform.qti.so:liblistenjni.qti.so
D/nativeloader(31666): Configuring clns-9 for other apk /data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/lib/arm64:/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
V/NativeCrypto(31666): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 305 native methods...
W/ple.voter_boot(31666): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (unsupported, reflection, allowed)
I/ProviderInstaller(31666): Installed default security provider GmsCore_OpenSSL
W/ple.voter_boot(31666): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (unsupported, reflection, allowed)
E/ple.voter_boot(31666): open libmigui.so failed! dlopen - dlopen failed: library "libmigui.so" not found
W/ple.voter_boot(31666): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (unsupported, reflection, allowed)
D/DecorView[](31666): onWindowFocusChanged hasWindowFocus true
[GETX] Instance "GetMaterialController" has been created
[GETX] Instance "GetMaterialController" has been initialized
[GETX] REPLACE ROUTE /
[GETX] NEW ROUTE null
D/DecorView[](31666): getWindowModeFromSystem windowmode is 1
D/DecorView[](31666): updateDecorCaptionStatus displayWindowDecor is false
I/flutter (31666): RelayClient Internal: Connecting to relay
I/flutter (31666): RelayClient Internal: Disconnecting from relay
I/flutter (31666): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6ImRiZmNiMWRhODc1ZGI1YTRkYWZmYzkyNzUzYWI0YWZiZGQ0NDA5NDYyYjUxNTM4NTkxNDRlZmM2Mzc0MmY4YjYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMwMiwiZXhwIjoxNzEzNjY2NzAyfQ.cIdAbC_fEXcXxdu0lX6Qr9QV0mKFKTRmb0S1sMTyY0ViEd0CRq4lqsVmb42DKcRL5GLGou2nun7nXJRinLjMAQ
I/flutter (31666): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6ImRiZmNiMWRhODc1ZGI1YTRkYWZmYzkyNzUzYWI0YWZiZGQ0NDA5NDYyYjUxNTM4NTkxNDRlZmM2Mzc0MmY4YjYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMwMiwiZXhwIjoxNzEzNjY2NzAyfQ.cIdAbC_fEXcXxdu0lX6Qr9QV0mKFKTRmb0S1sMTyY0ViEd0CRq4lqsVmb42DKcRL5GLGou2nun7nXJRinLjMAQ&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (31666): [ExplorerService] init()
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 null
I/flutter (31666): [ExplorerService] init() done
I/flutter (31666): [W3MService] initialized
I/flutter (31666): [W3MService] set chain eip155:11155111
I/flutter (31666): [W3MService] Connecting to WalletConnect, required namespaces: {}, optional namespaces: {eip155: RequiredNamespace(chains: [eip155:1, eip155:42161, eip155:137, eip155:43114, eip155:56, eip155:10, eip155:250, eip155:9001, eip155:4689, eip155:1088, eip155:11155111], methods: [eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_registerOnboarding, wallet_watchAsset, wallet_scanQRCode], events: [chainChanged, accountsChanged, message, disconnect, connect])}
I/flutter (31666): pairing sendRequest, id: 1713580370003642 topic: 20d144fcf5fb5f8d152f6a03d96c770e109be1521de03a0c1b5a85457c6065fe, method: wc_sessionPropose, params: WcSessionProposeRequest(relays: [Instance of 'Relay'], requiredNamespaces: {}, optionalNamespaces: {eip155: RequiredNamespace(chains: [eip155:1, eip155:42161, eip155:137, eip155:43114, eip155:56, eip155:10, eip155:250, eip155:9001, eip155:4689, eip155:1088, eip155:11155111], methods: [eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_registerOnboarding, wallet_watchAsset, wallet_scanQRCode], events: [chainChanged, accountsChanged, message, disconnect, connect])}, sessionProperties: null, proposer: ConnectionMetadata(publicKey: 1023f7f1c65fdfd8a7df1d0f9ca4c2c35b97e9ab720803f6f3b10ef11ce3ec01, metadata: PairingMetadata
I/flutter (31666): [CoreUtils] Encoded WC URL: wc%3A20d144fcf5fb5f8d152f6a03d96c770e109be1521de03a0c1b5a85457c6065fe%402%3Frelay-protocol%3Dirn%26symKey%3D17efe1cd61a25c09eab14b00f6adbeb6975016f55b7c6d7fcff965e50c877dcd%26methods%3D%255Bwc_sessionPropose%252Cwc_sessionRequest%255D%252C%255Bwc_authRequest%255D
D/DecorView[](31666): onWindowFocusChanged hasWindowFocus false
I/FA (31666): Application backgrounded at: timestamp_millis: 1713580370441
I/flutter (31666): Handling Publish Message: 20d144fcf5fb5f8d152f6a03d96c770e109be1521de03a0c1b5a85457c6065fe, ADvy2YLXMD7yZohivuG/jZ90wsd/rquyq8JpetBYS3r9AcxHyMxiZxHDBbu/kyiyy4iRKaojB5fFpJCc0P1eaU49v/G60SonF0k9EApsTbbVWiuqstHYTgAAdjHXcUQEZXIL2KdYrM4ZqUY2puwrl6YgpA4JLTP6e1FVIcvLbB9GB7lHe4L9qpQb5WVZneBOnGsv8+C9COWUymrccxInaG46wloBR2dn4soF9R/yAbwT1C/GEEkHWI19CSp3URvLTag=
I/flutter (31666): Pairing _onMessageEvent, Received data: {id: 1713580370003642, jsonrpc: 2.0, result: {relay: {protocol: irn}, responderPublicKey: b888632ac8d1e11e4824b505709349e45ee930d3cc9d683d8164b0b9e3600e2b}}
D/AppScoutStateMachine(31666): 31666-ScoutStateMachinecreated
D/SurfaceView(31666): UPDATE Surface(name=SurfaceView[com.example.voter_booth/com.example.voter_booth.MainActivity])/@0x5317f2c, mIsProjectionMode = false
I/OpenGLRenderer(31666): Davey! duration=20929ms; Flags=1, FrameTimelineVsyncId=1979634, IntendedVsync=33416768581227, Vsync=33416768581227, InputEventId=0, HandleInputStart=33416772206209, AnimationStart=33416772217980, PerformTraversalsStart=33416772227512, DrawStart=33416775681626, FrameDeadline=33416801914559, FrameInterval=33416772134126, FrameStartTime=16666666, SyncQueued=33416777286470, SyncStart=33416777381105, IssueDrawCommandsStart=33416777737720, SwapBuffers=33416784032668, FrameCompleted=33437697875941, DequeueBufferDuration=1894583, QueueBufferDuration=2578230, GpuCompleted=33437697875941, SwapBuffersCompleted=33416787254334, DisplayPresentTime=0,
D/DecorView[](31666): onWindowFocusChanged hasWindowFocus true
I/flutter (31666): Handling Publish Message: 3ec4abce023f36b2e808db72f54afc18e5888a60d4630675b0e7d2fc7d558ac8, AC/VVFf/U55rBL9CR/jrugNRTNKdwe3mX7tqKhB6NaY/pvRCw9CUdbcXDXbNEmmgf3Nw+iB3dHmfaQ11eHneauSfxJU+JFhJBoeUJHdoMTFzgizMkXXOf7dT+BJ57RS82U97qrUIFp0KWi2CdnGdfWIaJg8Y0QOe4Dg3YUhptvJyeDBmr/jAb9sRzJaREo0me540rLPTESnTvLEmCcVqvD0vySuL/sjP60InMXV9vF1VGfH8TKaJoxEy8JPLsz0xK9uYpruqbnab4RGYBsNB4MJZFak3dJDkGfYSW44YscNDdcCGgY+BODmuYgAmHwEMsltQIxm4LghsCBcVlMLEd2IRc2b71fiQELXGyiQXcU8f7VRMgdO/4Z2GGT9Z7OFQESGeg0RDQeBWTR7gkShf0TdQuOcIpKOsDiIksOBASesa8lBFCtH8PaQQP9U/5kyzEA0bDGlP/JtIyIiYIcdtpKPDfXuuY6DwhT6nXAWI+xcJqNE50zeaGlK7ChJ+KMxoY8SFS2/7J52CyU4NZYGwsWyfy4WAFMgvBWE2iJV1ayzdsQHjFhRXkDP9Ql/y+DLUsbeHbvrPy4RRyQa7nuy8Yp0x+Z586ovf0nFlqr10bXOSDXCwFcPM0tLAl7zXEau/yjVrSgTlxO/U1m9tyMwedCLz+Tb7QnyVt59kFkXC0XgPiTNmVlzl9v5KySUUkT08lHHpTT5Yo8gM3VLWbbo0RGEQmfVUSH15QQgFMtl45y76OvHT1IvDzp19iJ9sF89hWCHCE0tEgsSUTNVEJLaK5i878sfirMy78CxQPswFoG6WQLmykdQQ+mZFVDT61UgubIXGp+hqV/giUHdIvebLKMqzfe2hJkoYoqfbQCaHE/y8jh9NxTSCwn3LnC22YZPYRxROenhI/xl+vp6jnMsigltsO2XjKBkYn74
I/flutter (31666): Pairing _onMessageEvent, Received data: {id: 1713580374956837, jsonrpc: 2.0, method: wc_sessionSettle, params: {relay: {protocol: irn}, namespaces: {eip155: {accounts: [eip155:11155111:0x17aed66b741580b4079a086241680807669a42e2], chains: [eip155:11155111], methods: [eth_sendTransaction, personal_sign, eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_registerOnboarding, wallet_watchAsset, wallet_scanQRCode], events: [chainChanged, accountsChanged]}}, requiredNamespaces: {eip155: {methods: [eth_sendTransaction, personal_sign, eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, w
I/flutter (31666): pairing sendResult, id: 1713580374956837 topic: 3ec4abce023f36b2e808db72f54afc18e5888a60d4630675b0e7d2fc7d558ac8, method: wc_sessionSettle, result: true
I/flutter (31666): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: true}
I/flutter (31666): [W3MService] Connected with session {topic: 3ec4abce023f36b2e808db72f54afc18e5888a60d4630675b0e7d2fc7d558ac8, pairingTopic: 20d144fcf5fb5f8d152f6a03d96c770e109be1521de03a0c1b5a85457c6065fe, relay: {protocol: irn, data: null}, expiry: 1714185174, acknowledged: true, controller: b888632ac8d1e11e4824b505709349e45ee930d3cc9d683d8164b0b9e3600e2b, namespaces: {eip155: {accounts: [eip155:11155111:0x17aed66b741580b4079a086241680807669a42e2], methods: [eth_sendTransaction, personal_sign, eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_registerOnboarding, wallet_watchAsset, wallet_scanQRCode], events: [chainChanged, accountsChanged]}}, requiredNamespaces: {eip155: {chains: [eip155:11155111], methods: [eth_sendTransaction, personal_sign, eth_sendTransaction, personal_sign,
I/flutter (31666): [W3MService] onSessionConnect: SessionConnect(session: SessionData(topic: 3ec4abce023f36b2e808db72f54afc18e5888a60d4630675b0e7d2fc7d558ac8, pairingTopic: 20d144fcf5fb5f8d152f6a03d96c770e109be1521de03a0c1b5a85457c6065fe, relay: Instance of 'Relay', expiry: 1714185174, acknowledged: true, controller: b888632ac8d1e11e4824b505709349e45ee930d3cc9d683d8164b0b9e3600e2b, namespaces: {eip155: Namespace(accounts: [eip155:11155111:0x17aed66b741580b4079a086241680807669a42e2], methods: [eth_sendTransaction, personal_sign, eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_registerOnboarding, wallet_watchAsset, wallet_scanQRCode], events: [chainChanged, accountsChanged])}, requiredNamespaces: {eip155: RequiredNamespace(chains: [eip155:11155111], methods: [eth_sendTransaction, pe
I/flutter (31666): [W3MService] _loadAccountData
I/flutter (31666): [W3MService] account data laoded
I/flutter (31666): RelayClient Internal: Connecting to relay
I/flutter (31666): RelayClient Internal: Connecting to relay
I/flutter (31666): RelayClient Internal: Disconnecting from relay
I/flutter (31666): RelayClient Internal: Disconnecting from relay
I/flutter (31666): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6IjcyMGU2N2M3NjNjYjdmOGY2MzBkNGJmOTRlNGEwMTllMGRmOTNmMjkyZjFmNjUxZGRhZjA2YmU5YTFmYjk1YmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMyOCwiZXhwIjoxNzEzNjY2NzI4fQ.QYn-7jGJevNko_j401IIlM81k6neDKE19xLAZgfPBdlKmaL0CgjP72s0ii12bLTtDuEepveiiq_4u7Gv2EzbAg
I/flutter (31666): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6IjcyMGU2N2M3NjNjYjdmOGY2MzBkNGJmOTRlNGEwMTllMGRmOTNmMjkyZjFmNjUxZGRhZjA2YmU5YTFmYjk1YmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMyOCwiZXhwIjoxNzEzNjY2NzI4fQ.QYn-7jGJevNko_j401IIlM81k6neDKE19xLAZgfPBdlKmaL0CgjP72s0ii12bLTtDuEepveiiq_4u7Gv2EzbAg
I/flutter (31666): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6IjcyMGU2N2M3NjNjYjdmOGY2MzBkNGJmOTRlNGEwMTllMGRmOTNmMjkyZjFmNjUxZGRhZjA2YmU5YTFmYjk1YmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMyOCwiZXhwIjoxNzEzNjY2NzI4fQ.QYn-7jGJevNko_j401IIlM81k6neDKE19xLAZgfPBdlKmaL0CgjP72s0ii12bLTtDuEepveiiq_4u7Gv2EzbAg&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (31666): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6IjcyMGU2N2M3NjNjYjdmOGY2MzBkNGJmOTRlNGEwMTllMGRmOTNmMjkyZjFmNjUxZGRhZjA2YmU5YTFmYjk1YmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMyOCwiZXhwIjoxNzEzNjY2NzI4fQ.QYn-7jGJevNko_j401IIlM81k6neDKE19xLAZgfPBdlKmaL0CgjP72s0ii12bLTtDuEepveiiq_4u7Gv2EzbAg&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (31666): [ExplorerService] init()
I/flutter (31666): [ExplorerService] init()
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F....ID 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/OpenGLRenderer(31666): Davey! duration=31987ms; Flags=0, FrameTimelineVsyncId=-1, IntendedVsync=33418262754178, Vsync=33418262760584, InputEventId=0, HandleInputStart=33418262786886, AnimationStart=33418262790480, PerformTraversalsStart=33418262793344, DrawStart=33418271659490, FrameDeadline=-9223372036838109143, FrameInterval=33418262760584, FrameStartTime=16666666, SyncQueued=33418271940584, SyncStart=33418271980844, IssueDrawCommandsStart=33418272017980, SwapBuffers=33418273226001, FrameCompleted=33450250130468, DequeueBufferDuration=639895, QueueBufferDuration=1027343, GpuCompleted=33450250130468, SwapBuffersCompleted=33418274636417, DisplayPresentTime=0,
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InsetsController(31666): show(ime(), fromIme=true)
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: true}
I/flutter (31666): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: true}
I/flutter (31666): [ExplorerService] init() done
I/flutter (31666): [ExplorerService] init() done
I/flutter (31666): [W3MService] set chain eip155:11155111
I/flutter (31666): [W3MService] set chain eip155:11155111
I/flutter (31666): [W3MService] initialized
I/flutter (31666): [W3MService] initialized
I/flutter (31666): [W3MService] _loadAccountData
I/flutter (31666): [W3MService] _loadAccountData
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
I/flutter (31666): [W3MService] account data laoded
I/flutter (31666): [W3MService] account data laoded
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InsetsController(31666): show(ime(), fromIme=true)
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InsetsController(31666): show(ime(), fromIme=true)
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InsetsController(31666): show(ime(), fromIme=true)
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
I/flutter (31666): _w3mService: Instance of 'W3MService'
I/flutter (31666): [CoreUtils] Encoded WC URL: metamask%3A%2F%2F
I/flutter (31666): [CoreUtils] Encoded WC URL: metamask%3A%2F%2F
I/flutter (31666): Session: Instance of 'W3MSession'
I/flutter (31666): Error calling write function: Null check operator used on a null value
D/DecorView[](31666): onWindowFocusChanged hasWindowFocus false
I/FA (31666): Application backgrounded at: timestamp_millis: 1713580401504
Application finished.
Here is the video of the application:
Hello @sethitanay ! Thanks for the detailed response. Btw, if you use dependency_overrides
dependency_overrides:
walletconnect_flutter_v2: 2.2.2
You don't need to add the same dependency in main dependencies This is what you need:
dependencies:
web3modal_flutter: ^3.1.2
dependency_overrides:
walletconnect_flutter_v2: 2.2.2
That being said, do you see the same issues with other wallets? I can't not help to much without the ABI file and the contract address but I see Error calling write function: Null check operator used on a null value
so I would say you are missing the from
value in your Transaction. Can you try this?
await _w3mService.requestWriteContract(
topic: _w3mService.session!.topic.toString(),
chainId: 'eip155:11155111',
rpcUrl:
'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
deployedContract: deployedContract,
functionName: 'authorizeVoter',
parameters: [
addressController.text,
nameController.text,
ageController.text,
genderController.text
],
transaction: Transaction(
from: EthereumAddress.fromHex(_w3mService.session!.address!),
),
);
I did the changes as suggested by you but still my problem is not solved.
abi.json:
contract address: 0xe391ddD24b24eC381347406AB7F16e1a6359Ae10 Error:
D/DecorView[](19347): getWindowModeFromSystem windowmode is 1
D/DecorView[](19347): updateDecorCaptionStatus displayWindowDecor is false
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6ImUzMWI1ZGMxYTJhMzk5NTE1NmM4OTJmYjAzNWNiM2Y1NDM2ZGMyOGE4OTJmMDY2NWM0YjFhMWZhZTJjNDc2ZDMiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjQ5OCwiZXhwIjoxNzEzNzg4ODk4fQ.cYQ_DHCo7UBx7KuSasYIEM7krb0bv2JnssJW-A37-O-dCryLA28u8v55w3Qx_ahVS847AUFa9bvtecekpnceAg
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6ImUzMWI1ZGMxYTJhMzk5NTE1NmM4OTJmYjAzNWNiM2Y1NDM2ZGMyOGE4OTJmMDY2NWM0YjFhMWZhZTJjNDc2ZDMiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjQ5OCwiZXhwIjoxNzEzNzg4ODk4fQ.cYQ_DHCo7UBx7KuSasYIEM7krb0bv2JnssJW-A37-O-dCryLA28u8v55w3Qx_ahVS847AUFa9bvtecekpnceAg&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): [ExplorerService] init()
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjY4NjRmYThlNDRiYjE1Y2UzNzUyMGM3NjljODUwNDk0YTU1YTA5NDc1MTY3NTg5ZDRkNmJjZGZkM2Q3YjMxNDAiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwMCwiZXhwIjoxNzEzNzg4OTAwfQ.o0CIWsY85sFH6AKg2Gm6fYl-OeOhPDdLkqD50GEy8IVU0yPlRiriL6e7YQxRv6bszKSSABaq-yeUbl6gzTJiDQ
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjY4NjRmYThlNDRiYjE1Y2UzNzUyMGM3NjljODUwNDk0YTU1YTA5NDc1MTY3NTg5ZDRkNmJjZGZkM2Q3YjMxNDAiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwMCwiZXhwIjoxNzEzNzg4OTAwfQ.o0CIWsY85sFH6AKg2Gm6fYl-OeOhPDdLkqD50GEy8IVU0yPlRiriL6e7YQxRv6bszKSSABaq-yeUbl6gzTJiDQ
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjY4NjRmYThlNDRiYjE1Y2UzNzUyMGM3NjljODUwNDk0YTU1YTA5NDc1MTY3NTg5ZDRkNmJjZGZkM2Q3YjMxNDAiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwMCwiZXhwIjoxNzEzNzg4OTAwfQ.o0CIWsY85sFH6AKg2Gm6fYl-OeOhPDdLkqD50GEy8IVU0yPlRiriL6e7YQxRv6bszKSSABaq-yeUbl6gzTJiDQ&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjY4NjRmYThlNDRiYjE1Y2UzNzUyMGM3NjljODUwNDk0YTU1YTA5NDc1MTY3NTg5ZDRkNmJjZGZkM2Q3YjMxNDAiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwMCwiZXhwIjoxNzEzNzg4OTAwfQ.o0CIWsY85sFH6AKg2Gm6fYl-OeOhPDdLkqD50GEy8IVU0yPlRiriL6e7YQxRv6bszKSSABaq-yeUbl6gzTJiDQ&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): [ExplorerService] init()
I/flutter (19347): [ExplorerService] init()
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [W3MService] account data laoded
I/flutter (19347): [W3MService] account data laoded
I/flutter (19347): [W3MService] account data laoded
I/flutter (19347): [W3MService] account data laoded
W/FirebaseAuth(19347): [SmsRetrieverHelper] Timed out waiting for SMS.
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): [ExplorerService] init()
I/flutter (19347): [ExplorerService] init()
I/flutter (19347): [ExplorerService] init()
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [W3MService] _loadAccountData
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
I/flutter (19347): [W3MService] account data laoded
I/flutter (19347): [W3MService] account data laoded
I/flutter (19347): [W3MService] account data laoded
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InsetsController(19347): show(ime(), fromIme=true)
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InsetsController(19347): show(ime(), fromIme=true)
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InsetsController(19347): show(ime(), fromIme=true)
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
I/flutter (19347): _w3mService: Instance of 'W3MService'
I/flutter (19347): [CoreUtils] Encoded WC URL: metamask%3A%2F%2F
I/flutter (19347): [CoreUtils] Encoded WC URL: metamask%3A%2F%2F
I/flutter (19347): [CoreUtils] Encoded WC URL: metamask%3A%2F%2F
I/flutter (19347): Session: Instance of 'W3MSession'
I/flutter (19347): Error calling write function: type 'String' is not a subtype of type 'EthereumAddress' of 'data'
D/DecorView[](19347): onWindowFocusChanged hasWindowFocus false
I/FA (19347): Application backgrounded at: timestamp_millis: 1713702580898
authorizevoter.dart:
import 'package:flutter/material.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';
import 'package:flutter/services.dart';
import 'package:voter_booth/utils/constants.dart';
class AuthorizeVoterScreen extends StatefulWidget {
const AuthorizeVoterScreen({super.key});
@override
State<AuthorizeVoterScreen> createState() => _AuthorizeVoterScreenState();
}
class _AuthorizeVoterScreenState extends State<AuthorizeVoterScreen> {
late TextEditingController nameController;
late TextEditingController addressController;
late TextEditingController ageController;
late TextEditingController genderController;
late W3MService _w3mService;
@override
void initState() {
super.initState();
try {
_w3mService = W3MService(
projectId: '001b66692e8d25adb3d5f7d189550651',
metadata: const PairingMetadata(
name: 'W3m Flutter',
description: 'Web3Modal Flutter Example',
url: 'https://www.walletconnect.com/',
icons: ['https://walletconnect.com/walletconnect-logo.png'],
redirect: Redirect(
native: 'flutterdapp://',
universal: 'https://www.walletconnect.com',
),
),
includedWalletIds: {
'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96',
// Metamask Wallet
},
excludedWalletIds: {
'4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
},
);
_w3mService.init();
} catch (e) {
print("Error initializing _w3mService: $e");
// Handle initialization error gracefully
}
nameController = TextEditingController();
addressController = TextEditingController();
ageController = TextEditingController();
genderController = TextEditingController();
}
Future<void> callWriteFunction1() async {
print("_w3mService: $_w3mService");
String abi = await rootBundle.loadString('assets/abi.json');
try {
final deployedContract = DeployedContract(
ContractAbi.fromJson(abi, 'Voting'),
EthereumAddress.fromHex('0xe391ddD24b24eC381347406AB7F16e1a6359Ae10'),
);
await _w3mService.launchConnectedWallet();
print("Session: ${_w3mService.session}");
if (_w3mService.session != null) {
await _w3mService.requestWriteContract(
topic: _w3mService.session!.topic.toString(),
chainId: 'eip155:11155111',
rpcUrl:
'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
deployedContract: deployedContract,
functionName: 'authorizeVoter',
parameters: [
addressController.text,
nameController.text,
ageController.text,
genderController.text
],
transaction: Transaction(
from: EthereumAddress.fromHex(_w3mService.session!.address!)
),
);
} else {
print("Session is null");
}
} catch (e) {
print("Error calling write function: $e");
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Authorize Voter'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
TextFormField(
controller: nameController,
decoration: const InputDecoration(labelText: 'Voter Name'),
),
const SizedBox(height: 16),
TextFormField(
controller: addressController,
decoration:
const InputDecoration(labelText: 'Voter Address'),
),
const SizedBox(height: 16),
TextFormField(
controller: ageController,
decoration: const InputDecoration(labelText: 'Age'),
keyboardType: TextInputType.number,
),
const SizedBox(height: 16),
TextFormField(
controller: genderController,
decoration: const InputDecoration(labelText: 'Gender'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
callWriteFunction1();
},
child: const Text('Authorize Voter'),
),
],
),
),
),
),
);
}
}
metamaskconnector.dart:
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';
class MetamaskConnector extends StatefulWidget {
const MetamaskConnector({super.key});
@override
State<MetamaskConnector> createState() => _MetamaskConnectorState();
}
class _MetamaskConnectorState extends State<MetamaskConnector> {
late W3MService _w3mService;
@override
void initState(){
super.initState();
W3MChainPresets.chains.putIfAbsent(_chainId, () => _sepoliaChain);
_w3mService = W3MService(
projectId: '001b66692e8d25adb3d5f7d189550651',
metadata: const PairingMetadata(
name: 'W3m Flutter',
description: 'Web3Modal Flutter Example',
url: 'https://www.walletconnect.com/',
icons: ['https://walletconnect.com/walletconnect-logo.png'],
redirect: Redirect(
native: 'flutterdapp://',
universal: 'https://www.walletconnect.com',
),
),
includedWalletIds : {
'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96',// Coinbase Wallet
},
excludedWalletIds : {
'4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
},
);
_w3mService.init();
}
@override
Widget build(BuildContext context) {
return Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
W3MNetworkSelectButton(service: _w3mService),
W3MConnectWalletButton(service: _w3mService),
],
),
);
}
}
const _chainId = "11155111";
final _sepoliaChain = W3MChainInfo(
chainName: 'Sepolia',
chainId: _chainId,
namespace: 'eip155:$_chainId',
tokenName: 'ETH',
rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
blockExplorer: W3MBlockExplorer(
name: 'Sepolia Explorer',
url: 'https://sepolia.etherscan.io/'
)
);
Hello @sethitanay! A few things....
init()
method of _w3mService
, and since this can not be don in initState()
because, like I said before, that function shouldn't be async, you should find a better way of initializing W3MService(), check the sample app._w3mService
TWICE. On your MetamaskConnector
and AuthorizeVoterScreen
, why? You shouldn't do that.includedWalletIds
you don't need to use excludedWalletIds
from
value (and you have added it) but the parameters you are passing are not of the type requested by the contract function. You are passing ALL STRINGS while your contract function is defined as follows (type address, type string, type uint256, type string):{
"inputs": [
{
"internalType": "address",
"name": "_voterAddress",
"type": "address"
},
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "uint256",
"name": "_age",
"type": "uint256"
},
{
"internalType": "string",
"name": "_gender",
"type": "string"
}
],
"name": "authorizeVoter",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
therefor this is completely wrong:
parameters: [
addressController.text,
nameController.text,
ageController.text,
genderController.text
],
Here it is a complete working example of your code (tested it with Zerion Wallet):
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:web3modal_flutter/services/w3m_service/i_w3m_service.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Flutter Demo',
home: MetamaskConnector(),
);
}
}
class MetamaskConnector extends StatefulWidget {
const MetamaskConnector({super.key});
@override
State<MetamaskConnector> createState() => _MetamaskConnectorState();
}
class _MetamaskConnectorState extends State<MetamaskConnector> {
late W3MService _w3mService;
@override
void initState() {
super.initState();
W3MChainPresets.chains.putIfAbsent(_chainId, () => _sepoliaChain);
_initialize();
}
Future<void> _initialize() async {
_w3mService = W3MService(
projectId: '001b66692e8d25adb3d5f7d189550651',
metadata: const PairingMetadata(
name: 'W3m Flutter',
description: 'Web3Modal Flutter Example',
url: 'https://www.walletconnect.com/',
icons: ['https://walletconnect.com/walletconnect-logo.png'],
redirect: Redirect(
native: 'flutterdapp://',
universal: 'https://www.walletconnect.com',
),
),
includedWalletIds: {
'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // Metamask
},
);
await _w3mService.init();
setState(() {});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
W3MNetworkSelectButton(service: _w3mService),
W3MConnectWalletButton(service: _w3mService),
if (_w3mService.isConnected)
ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
fullscreenDialog: true,
builder: (context) => AuthorizeVoterScreen(
w3mService: _w3mService,
),
),
);
},
child: const Text('Authorize Voter'),
),
],
),
),
);
}
}
const _chainId = "11155111";
final _sepoliaChain = W3MChainInfo(
chainName: 'Sepolia',
chainId: _chainId,
namespace: 'eip155:$_chainId',
tokenName: 'ETH',
rpcUrl:
'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
blockExplorer: W3MBlockExplorer(
name: 'Sepolia Explorer', url: 'https://sepolia.etherscan.io/'));
class AuthorizeVoterScreen extends StatefulWidget {
final IW3MService w3mService;
const AuthorizeVoterScreen({super.key, required this.w3mService});
@override
State<AuthorizeVoterScreen> createState() => _AuthorizeVoterScreenState();
}
class _AuthorizeVoterScreenState extends State<AuthorizeVoterScreen> {
late TextEditingController nameController;
late TextEditingController addressController;
late TextEditingController ageController;
late TextEditingController genderController;
late IW3MService _w3mService;
@override
void initState() {
super.initState();
_w3mService = widget.w3mService;
nameController = TextEditingController();
addressController = TextEditingController();
ageController = TextEditingController();
genderController = TextEditingController();
}
Future<void> callWriteFunction1() async {
print("_w3mService: $_w3mService");
String abi = await rootBundle.loadString('lib/services/issue112.abi.json');
String contractAddress = '0xe391ddD24b24eC381347406AB7F16e1a6359Ae10';
try {
final deployedContract = DeployedContract(
ContractAbi.fromJson(abi, 'Voting'),
EthereumAddress.fromHex(contractAddress),
);
await _w3mService.launchConnectedWallet();
print("Session: ${_w3mService.session}");
if (_w3mService.session != null) {
await _w3mService.requestWriteContract(
topic: _w3mService.session!.topic.toString(),
chainId: 'eip155:11155111',
rpcUrl:
'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
deployedContract: deployedContract,
functionName: 'authorizeVoter',
parameters: [
EthereumAddress.fromHex(addressController.text),
nameController.text,
BigInt.from(int.parse(ageController.text)),
genderController.text
],
transaction: Transaction(
from: EthereumAddress.fromHex(_w3mService.session!.address!),
),
);
} else {
print("Session is null");
}
} catch (e) {
print("Error calling write function: $e");
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Authorize Voter'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
TextFormField(
controller: nameController,
decoration: const InputDecoration(labelText: 'Voter Name'),
),
const SizedBox(height: 16),
TextFormField(
controller: addressController,
decoration: const InputDecoration(labelText: 'Voter Address'),
),
const SizedBox(height: 16),
TextFormField(
controller: ageController,
decoration: const InputDecoration(labelText: 'Age'),
keyboardType: TextInputType.number,
),
const SizedBox(height: 16),
TextFormField(
controller: genderController,
decoration: const InputDecoration(labelText: 'Gender'),
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () {
callWriteFunction1();
},
child: const Text('Authorize Voter'),
),
],
),
),
),
),
);
}
}
Hope this help!
I am trying to connect my flutter mobile application with the metamask mobile application using web3modal_flutter and walletconnect. Basically, I am trying to interact with the smart contract and also want to pass the arguments for the functions that are required. Connecting on Sepolia test network. using: web3modal_flutter: ^3.1.1-beta02 walletconnect_flutter_v2: ^2.1.11 this is my code for the file:
After entering all the data when I press the add candidate button then the terminal status is as follows: