diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3d9f7b16..7b918152 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 3.0.21
+
+- Fix an Android bug happening when sending a request from a dApp in a different device than the paired wallet
+
## 3.0.20
- Minor improvements
diff --git a/example/android/gradle.properties b/example/android/gradle.properties
index 8cd29c5f..68b9b0ae 100644
--- a/example/android/gradle.properties
+++ b/example/android/gradle.properties
@@ -1,5 +1,5 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
-versionName=3.0.20
-versionCode=20
+versionName=3.0.21
+versionCode=21
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index 80624b43..9897cced 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -470,7 +470,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
@@ -496,7 +496,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
@@ -514,7 +514,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
@@ -530,7 +530,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
@@ -655,7 +655,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
@@ -686,7 +686,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 20;
+ CURRENT_PROJECT_VERSION = 21;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist
index 78c62300..94206223 100644
--- a/example/ios/Runner/Info.plist
+++ b/example/ios/Runner/Info.plist
@@ -19,7 +19,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 3.0.20
+ 3.0.21
CFBundleSignature
????
CFBundleURLTypes
@@ -34,7 +34,7 @@
CFBundleVersion
- 20
+ 21
ITSAppUsesNonExemptEncryption
LSApplicationQueriesSchemes
diff --git a/example/pubspec.lock b/example/pubspec.lock
index b697a376..07b7d9cc 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -1115,7 +1115,7 @@ packages:
path: ".."
relative: true
source: path
- version: "3.0.20"
+ version: "3.0.21"
web_socket_channel:
dependency: transitive
description:
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index d61ad5ab..6e82dcaa 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -3,7 +3,7 @@ description: A dApp showing how to use WalletConnect v2 with Flutter
publish_to: "none"
-version: 3.0.20
+version: 3.0.21
environment:
sdk: ">=3.0.1 <4.0.0"
diff --git a/lib/constants/string_constants.dart b/lib/constants/string_constants.dart
index 2b37326e..6fab07c6 100644
--- a/lib/constants/string_constants.dart
+++ b/lib/constants/string_constants.dart
@@ -29,7 +29,7 @@ class StringConstants {
// Storage
static const String recentWalletId = 'w3m_recentWallet';
- static const String walletData = 'w3m_walletData';
+ static const String connectedWalletData = 'w3m_walletData';
static const String selectedChainId = 'w3m_selectedChainId';
// Urls
diff --git a/lib/pages/connect_wallet_page.dart b/lib/pages/connect_wallet_page.dart
index 46a70f46..c15e68b9 100644
--- a/lib/pages/connect_wallet_page.dart
+++ b/lib/pages/connect_wallet_page.dart
@@ -82,7 +82,9 @@ class _ConnectWalletPageState extends State
kNavbarHeight -
(kPadding16 * 2);
//
- final walletRedirect = _service!.selectedWalletRedirect;
+ final walletRedirect = explorerService.instance?.getWalletRedirect(
+ _service!.selectedWallet,
+ );
final webOnlyWallet = walletRedirect?.webOnly == true;
final mobileOnlyWallet = walletRedirect?.mobileOnly == true;
//
diff --git a/lib/services/explorer_service/explorer_service.dart b/lib/services/explorer_service/explorer_service.dart
index 79af140b..a21955cd 100644
--- a/lib/services/explorer_service/explorer_service.dart
+++ b/lib/services/explorer_service/explorer_service.dart
@@ -125,7 +125,7 @@ class ExplorerService implements IExplorerService {
Future _getRecentWalletAndOrder() async {
W3MWalletInfo? walletInfo;
final walletString = storageService.instance.getString(
- StringConstants.walletData,
+ StringConstants.connectedWalletData,
);
final recentWalletId = storageService.instance.getString(
StringConstants.recentWalletId,
@@ -234,16 +234,41 @@ class ExplorerService implements IExplorerService {
}
@override
- Future storeConnectedWalletData(W3MWalletInfo? walletInfo) async {
+ Future storeConnectedWallet(W3MWalletInfo? walletInfo) async {
if (walletInfo == null) return;
final walletDataString = jsonEncode(walletInfo.toJson());
await storageService.instance.setString(
- StringConstants.walletData,
+ StringConstants.connectedWalletData,
walletDataString,
);
await _updateRecentWalletId(walletInfo);
}
+ @override
+ W3MWalletInfo? getConnectedWallet() {
+ try {
+ final walletString = storageService.instance.getString(
+ StringConstants.connectedWalletData,
+ defaultValue: '',
+ );
+ if (walletString!.isNotEmpty) {
+ return W3MWalletInfo.fromJson(jsonDecode(walletString));
+ }
+ } catch (e, s) {
+ W3MLoggerUtil.logger.e(
+ '[$runtimeType] error getConnectedWallet:',
+ error: e,
+ stackTrace: s,
+ );
+ }
+ return null;
+ }
+
+ @override
+ Future deleteConnectedWallet() async {
+ await storageService.instance.clearKey(StringConstants.connectedWalletData);
+ }
+
Future _updateRecentWalletId(
W3MWalletInfo? walletInfo, {
String? walletId,
@@ -322,29 +347,11 @@ class ExplorerService implements IExplorerService {
}
@override
- WalletRedirect? getWalletRedirect(Listing listing) {
- final wallet = listings.value.firstWhereOrNull(
- (item) => listing.id == item.listing.id,
- );
- if (wallet == null) {
- return null;
- }
- return WalletRedirect(
- mobile: wallet.listing.mobileLink,
- desktop: wallet.listing.desktopLink,
- web: wallet.listing.webappLink,
- );
- }
+ WalletRedirect? getWalletRedirect(W3MWalletInfo? walletInfo) {
+ if (walletInfo == null) return null;
- @override
- Future tryWalletRedirectByName(String? name) async {
- if (name == null) return null;
- final results = await _fetchListings(
- params: RequestParams(page: 1, entries: 100, search: name),
- updateCount: false,
- );
- final wallet = results.firstWhereOrNull(
- (item) => item.listing.name.toLowerCase() == name.toLowerCase(),
+ final wallet = listings.value.firstWhereOrNull(
+ (item) => walletInfo.listing.id == item.listing.id,
);
if (wallet == null) {
return null;
diff --git a/lib/services/explorer_service/i_explorer_service.dart b/lib/services/explorer_service/i_explorer_service.dart
index 06d53fb5..29ccd31e 100644
--- a/lib/services/explorer_service/i_explorer_service.dart
+++ b/lib/services/explorer_service/i_explorer_service.dart
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
-import 'package:web3modal_flutter/services/explorer_service/models/api_response.dart';
import 'package:web3modal_flutter/services/explorer_service/models/redirect.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';
@@ -38,13 +37,20 @@ abstract class IExplorerService {
String get searchValue;
/// update the recently used position to the top list
- Future storeConnectedWalletData(W3MWalletInfo? walletInfo);
+ Future storeConnectedWallet(W3MWalletInfo? walletInfo);
- String getWalletImageUrl(String imageId);
+ /// Get connected wallet data from local storage
+ W3MWalletInfo? getConnectedWallet();
- String getAssetImageUrl(String imageId);
+ /// Removes connected wallet data from local storage
+ Future deleteConnectedWallet();
- WalletRedirect? getWalletRedirect(Listing listing);
+ /// Gets the WalletRedirect object from a wallet info data
+ WalletRedirect? getWalletRedirect(W3MWalletInfo? walletInfo);
- Future tryWalletRedirectByName(String? name);
+ /// Given an imageId it return the wallet app icon from our services
+ String getWalletImageUrl(String imageId);
+
+ /// Given an imageId it return the chain icon from our services
+ String getAssetImageUrl(String imageId);
}
diff --git a/lib/services/storage_service/i_storage_service.dart b/lib/services/storage_service/i_storage_service.dart
index fc93ed7a..c724cae3 100644
--- a/lib/services/storage_service/i_storage_service.dart
+++ b/lib/services/storage_service/i_storage_service.dart
@@ -2,4 +2,5 @@ abstract class IStorageService {
Future init();
String? getString(String key, {String? defaultValue});
Future setString(String key, String value);
+ Future clearKey(String key);
}
diff --git a/lib/services/storage_service/storage_service.dart b/lib/services/storage_service/storage_service.dart
index 011b086f..7dc501ea 100644
--- a/lib/services/storage_service/storage_service.dart
+++ b/lib/services/storage_service/storage_service.dart
@@ -18,4 +18,9 @@ class StorageService implements IStorageService {
Future setString(String key, String value) async {
return _prefs!.setString(key, value);
}
+
+ @override
+ Future clearKey(String key) async {
+ return _prefs!.remove(key);
+ }
}
diff --git a/lib/services/w3m_service/i_w3m_service.dart b/lib/services/w3m_service/i_w3m_service.dart
index 5d38277c..6746babb 100644
--- a/lib/services/w3m_service/i_w3m_service.dart
+++ b/lib/services/w3m_service/i_w3m_service.dart
@@ -1,6 +1,5 @@
import 'package:event/event.dart';
import 'package:flutter/material.dart';
-import 'package:web3modal_flutter/services/explorer_service/models/redirect.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';
enum W3MServiceStatus {
@@ -99,14 +98,6 @@ abstract class IW3MService with ChangeNotifier {
/// This will do nothing if [isConnected] is true.
Future buildConnectionUri();
- /// Subscribe to listen to pairing expirations
- final Event onPairingExpire = Event();
-
- WalletRedirect? get selectedWalletRedirect;
-
- /// When users rejects connection or an error occurs this will event
- final Event onWalletConnectionError = Event();
-
/// Connects the [selectedWallet] previously selected
Future connectSelectedWallet({bool inBrowser = false});
@@ -121,13 +112,19 @@ abstract class IW3MService with ChangeNotifier {
/// Gets the name of the currently connected wallet.
String getReferer();
- /// Closes the modal.
- void closeModal();
-
/// Disconnects the session and pairing, if any.
/// If there is no session, this does nothing.
Future disconnect({bool disconnectAllSessions = true});
+ /// Closes the modal.
+ void closeModal();
+
@override
void dispose();
+
+ /// Subscribe to listen to pairing expirations
+ final Event onPairingExpire = Event();
+
+ /// When users rejects connection or an error occurs this will event
+ final Event onWalletConnectionError = Event();
}
diff --git a/lib/services/w3m_service/w3m_service.dart b/lib/services/w3m_service/w3m_service.dart
index e774e7be..9fac562e 100644
--- a/lib/services/w3m_service/w3m_service.dart
+++ b/lib/services/w3m_service/w3m_service.dart
@@ -1,5 +1,4 @@
import 'dart:async';
-import 'dart:convert';
import 'package:event/event.dart';
import 'package:flutter/material.dart';
@@ -8,7 +7,6 @@ import 'package:url_launcher/url_launcher.dart';
import 'package:web3modal_flutter/constants/string_constants.dart';
import 'package:web3modal_flutter/services/explorer_service/explorer_service.dart';
import 'package:web3modal_flutter/services/explorer_service/explorer_service_singleton.dart';
-import 'package:web3modal_flutter/services/explorer_service/models/redirect.dart';
import 'package:web3modal_flutter/services/ledger_service/ledger_service_singleton.dart';
import 'package:web3modal_flutter/utils/asset_util.dart';
import 'package:web3modal_flutter/utils/core/core_utils_singleton.dart';
@@ -429,15 +427,16 @@ class W3MService with ChangeNotifier implements IW3MService {
Future connectSelectedWallet({bool inBrowser = false}) async {
_checkInitialized();
+ final selectedWalletRedirect = explorerService.instance?.getWalletRedirect(
+ selectedWallet,
+ );
if (selectedWalletRedirect == null) {
throw W3MServiceException(
'You didn\'t select a wallet or walletInfo argument is null',
);
}
- if (_connectingWallet) {
- return;
- }
+ if (_connectingWallet) return;
_connectingWallet = true;
var pType = platformUtils.instance.getPlatformType();
@@ -447,14 +446,13 @@ class W3MService with ChangeNotifier implements IW3MService {
try {
await buildConnectionUri();
await urlUtils.instance.openRedirect(
- selectedWalletRedirect!,
+ selectedWalletRedirect,
wcURI: wcUri!,
pType: pType,
);
} on LaunchUrlException catch (e) {
W3MLoggerUtil.logger.e(
- '[$runtimeType] error launching wallet. '
- '${selectedWalletRedirect?.toString()}',
+ '[$runtimeType] error launching wallet $selectedWalletRedirect',
);
if (e.message.toLowerCase() != 'app not installed') {
toastUtils.instance.show(
@@ -513,7 +511,7 @@ class W3MService with ChangeNotifier implements IW3MService {
try {
_currentSession = await connectResponse!.session.future;
_setSessionValues(_currentSession!);
- await explorerService.instance!.storeConnectedWalletData(_selectedWallet);
+ await explorerService.instance!.storeConnectedWallet(_selectedWallet);
} on TimeoutException {
W3MLoggerUtil.logger
.i('[$runtimeType] Rebuilding session, ending future');
@@ -531,17 +529,21 @@ class W3MService with ChangeNotifier implements IW3MService {
Future launchConnectedWallet() async {
_checkInitialized();
- final sessionRedirect = await sessionWalletRedirect();
- if (sessionRedirect == null) {
+ final walletInfo = explorerService.instance!.getConnectedWallet();
+ if (walletInfo == null) {
+ // if walletInfo is null could mean that either
+ // 1. There's no wallet connected (shouldn't happen)
+ // 2. Wallet is connected on another device through qr code
return;
}
- W3MLoggerUtil.logger.t(
- '[$runtimeType] Launching wallet: $sessionWalletRedirect, ${_currentSession?.peer.metadata}',
- );
+ final redirect = explorerService.instance!.getWalletRedirect(walletInfo);
+ if (redirect == null) {
+ return;
+ }
return await urlUtils.instance.openRedirect(
- sessionRedirect,
+ redirect,
pType: platformUtils.instance.getPlatformType(),
);
}
@@ -808,6 +810,7 @@ class W3MService with ChangeNotifier implements IW3MService {
}
void _cleanSession() {
+ explorerService.instance!.deleteConnectedWallet();
_currentSelectedChain = null;
_isConnected = false;
_address = null;
@@ -815,38 +818,6 @@ class W3MService with ChangeNotifier implements IW3MService {
_notify();
}
- @override
- WalletRedirect? get selectedWalletRedirect {
- final listing = _selectedWallet?.listing;
- if (listing == null) return null;
-
- return explorerService.instance?.getWalletRedirect(listing);
- }
-
- Future sessionWalletRedirect() async {
- final metadata = _currentSession?.peer.metadata;
- final sessionRedirect = metadata?.redirect;
- if (sessionRedirect == null) {
- final walletString = storageService.instance.getString(
- StringConstants.walletData,
- );
- if ((walletString ?? '').isNotEmpty) {
- final walletInfo = W3MWalletInfo.fromJson(jsonDecode(walletString!));
- return explorerService.instance!.getWalletRedirect(walletInfo.listing);
- }
-
- return await explorerService.instance?.tryWalletRedirectByName(
- metadata?.name,
- );
- }
-
- return WalletRedirect(
- mobile: sessionRedirect.native,
- desktop: sessionRedirect.native,
- web: sessionRedirect.universal,
- );
- }
-
void _checkInitialized() {
if (_status != W3MServiceStatus.initialized &&
_status != W3MServiceStatus.initializing) {
diff --git a/lib/version.dart b/lib/version.dart
index 6e622a8f..71eaabf7 100644
--- a/lib/version.dart
+++ b/lib/version.dart
@@ -1,2 +1,2 @@
// Generated code. Do not modify.
-const packageVersion = '3.0.20';
+const packageVersion = '3.0.21';
diff --git a/pubspec.yaml b/pubspec.yaml
index 867e528a..2752f06a 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: web3modal_flutter
description: "WalletConnect Web3Modal: Simple, intuitive wallet login. With this drop-in UI SDK, enable any wallet's users to seamlessly log in to your app and enjoy a unified experience"
-version: 3.0.20
+version: 3.0.21
repository: https://github.com/WalletConnect/Web3ModalFlutter
environment:
diff --git a/test/mock_classes.mocks.dart b/test/mock_classes.mocks.dart
index 5311b364..1539645d 100644
--- a/test/mock_classes.mocks.dart
+++ b/test/mock_classes.mocks.dart
@@ -4,9 +4,9 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i15;
-import 'dart:convert' as _i28;
-import 'dart:typed_data' as _i29;
-import 'dart:ui' as _i19;
+import 'dart:convert' as _i27;
+import 'dart:typed_data' as _i28;
+import 'dart:ui' as _i17;
import 'package:event/event.dart' as _i3;
import 'package:flutter/foundation.dart' as _i2;
@@ -14,46 +14,44 @@ import 'package:flutter/material.dart' as _i12;
import 'package:http/http.dart' as _i10;
import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i14;
-import 'package:url_launcher/url_launcher.dart' as _i21;
+import 'package:url_launcher/url_launcher.dart' as _i19;
import 'package:walletconnect_flutter_v2/apis/core/relay_client/i_message_tracker.dart'
as _i8;
import 'package:walletconnect_flutter_v2/apis/core/relay_client/json_rpc_2/src/peer.dart'
- as _i27;
-import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client.dart'
as _i26;
+import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client.dart'
+ as _i25;
import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_websocket_handler.dart'
as _i9;
import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart'
as _i5;
import 'package:walletconnect_flutter_v2/apis/core/store/i_store.dart' as _i7;
import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart' as _i6;
-import 'package:web3modal_flutter/models/grid_item.dart' as _i31;
+import 'package:web3modal_flutter/models/grid_item.dart' as _i30;
import 'package:web3modal_flutter/services/blockchain_api_service/blockchain_api_utils.dart'
- as _i32;
+ as _i31;
import 'package:web3modal_flutter/services/blockchain_api_service/blockchain_identity.dart'
as _i11;
import 'package:web3modal_flutter/services/explorer_service/explorer_service.dart'
as _i13;
-import 'package:web3modal_flutter/services/explorer_service/models/api_response.dart'
- as _i17;
import 'package:web3modal_flutter/services/explorer_service/models/redirect.dart'
- as _i16;
+ as _i20;
import 'package:web3modal_flutter/services/ledger_service/ledger_service.dart'
- as _i33;
+ as _i32;
import 'package:web3modal_flutter/services/network_service/network_service.dart'
- as _i30;
+ as _i29;
import 'package:web3modal_flutter/services/storage_service/storage_service.dart'
- as _i34;
+ as _i33;
import 'package:web3modal_flutter/services/w3m_service/i_w3m_service.dart'
- as _i18;
-import 'package:web3modal_flutter/utils/platform/i_platform_utils.dart' as _i22;
-import 'package:web3modal_flutter/utils/platform/platform_utils.dart' as _i23;
-import 'package:web3modal_flutter/utils/toast/toast_message.dart' as _i25;
-import 'package:web3modal_flutter/utils/toast/toast_utils.dart' as _i24;
-import 'package:web3modal_flutter/utils/url/url_utils.dart' as _i20;
+ as _i16;
+import 'package:web3modal_flutter/utils/platform/i_platform_utils.dart' as _i21;
+import 'package:web3modal_flutter/utils/platform/platform_utils.dart' as _i22;
+import 'package:web3modal_flutter/utils/toast/toast_message.dart' as _i24;
+import 'package:web3modal_flutter/utils/toast/toast_utils.dart' as _i23;
+import 'package:web3modal_flutter/utils/url/url_utils.dart' as _i18;
import 'package:web3modal_flutter/web3modal_flutter.dart' as _i4;
import 'package:web3modal_flutter/widgets/widget_stack/widget_stack.dart'
- as _i35;
+ as _i34;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
@@ -411,16 +409,25 @@ class MockExplorerService extends _i1.Mock implements _i13.ExplorerService {
returnValueForMissingStub: _i15.Future.value(),
) as _i15.Future);
@override
- _i15.Future storeConnectedWalletData(_i4.W3MWalletInfo? walletInfo) =>
+ _i15.Future storeConnectedWallet(_i4.W3MWalletInfo? walletInfo) =>
(super.noSuchMethod(
Invocation.method(
- #storeConnectedWalletData,
+ #storeConnectedWallet,
[walletInfo],
),
returnValue: _i15.Future.value(),
returnValueForMissingStub: _i15.Future.value(),
) as _i15.Future);
@override
+ _i15.Future deleteConnectedWallet() => (super.noSuchMethod(
+ Invocation.method(
+ #deleteConnectedWallet,
+ [],
+ ),
+ returnValue: _i15.Future.value(),
+ returnValueForMissingStub: _i15.Future.value(),
+ ) as _i15.Future);
+ @override
void search({String? query}) => super.noSuchMethod(
Invocation.method(
#search,
@@ -457,21 +464,6 @@ class MockExplorerService extends _i1.Mock implements _i13.ExplorerService {
),
),
) as String);
- @override
- _i16.WalletRedirect? getWalletRedirect(_i17.Listing? listing) =>
- (super.noSuchMethod(Invocation.method(
- #getWalletRedirect,
- [listing],
- )) as _i16.WalletRedirect?);
- @override
- _i15.Future<_i16.WalletRedirect?> tryWalletRedirectByName(String? name) =>
- (super.noSuchMethod(
- Invocation.method(
- #tryWalletRedirectByName,
- [name],
- ),
- returnValue: _i15.Future<_i16.WalletRedirect?>.value(),
- ) as _i15.Future<_i16.WalletRedirect?>);
}
/// A class which mocks [W3MService].
@@ -500,19 +492,19 @@ class MockW3MService extends _i1.Mock implements _i4.W3MService {
),
) as _i3.Event<_i3.EventArgs>);
@override
- _i3.Event<_i18.WalletErrorEvent> get onWalletConnectionError =>
+ _i3.Event<_i16.WalletErrorEvent> get onWalletConnectionError =>
(super.noSuchMethod(
Invocation.getter(#onWalletConnectionError),
- returnValue: _FakeEvent_1<_i18.WalletErrorEvent>(
+ returnValue: _FakeEvent_1<_i16.WalletErrorEvent>(
this,
Invocation.getter(#onWalletConnectionError),
),
- ) as _i3.Event<_i18.WalletErrorEvent>);
+ ) as _i3.Event<_i16.WalletErrorEvent>);
@override
- _i18.W3MServiceStatus get status => (super.noSuchMethod(
+ _i16.W3MServiceStatus get status => (super.noSuchMethod(
Invocation.getter(#status),
- returnValue: _i18.W3MServiceStatus.idle,
- ) as _i18.W3MServiceStatus);
+ returnValue: _i16.W3MServiceStatus.idle,
+ ) as _i16.W3MServiceStatus);
@override
bool get hasNamespaces => (super.noSuchMethod(
Invocation.getter(#hasNamespaces),
@@ -677,16 +669,7 @@ class MockW3MService extends _i1.Mock implements _i4.W3MService {
returnValueForMissingStub: null,
);
@override
- _i15.Future<_i16.WalletRedirect?> sessionWalletRedirect() =>
- (super.noSuchMethod(
- Invocation.method(
- #sessionWalletRedirect,
- [],
- ),
- returnValue: _i15.Future<_i16.WalletRedirect?>.value(),
- ) as _i15.Future<_i16.WalletRedirect?>);
- @override
- void addListener(_i19.VoidCallback? listener) => super.noSuchMethod(
+ void addListener(_i17.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
[listener],
@@ -694,7 +677,7 @@ class MockW3MService extends _i1.Mock implements _i4.W3MService {
returnValueForMissingStub: null,
);
@override
- void removeListener(_i19.VoidCallback? listener) => super.noSuchMethod(
+ void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#removeListener,
[listener],
@@ -714,7 +697,7 @@ class MockW3MService extends _i1.Mock implements _i4.W3MService {
/// A class which mocks [UrlUtils].
///
/// See the documentation for Mockito's code generation for more information.
-class MockUrlUtils extends _i1.Mock implements _i20.UrlUtils {
+class MockUrlUtils extends _i1.Mock implements _i18.UrlUtils {
MockUrlUtils() {
_i1.throwOnMissingStub(this);
}
@@ -727,17 +710,17 @@ class MockUrlUtils extends _i1.Mock implements _i20.UrlUtils {
@override
_i15.Future Function(
Uri, {
- _i21.LaunchMode? mode,
+ _i19.LaunchMode? mode,
}) get launchUrlFunc => (super.noSuchMethod(
Invocation.getter(#launchUrlFunc),
returnValue: (
Uri url, {
- _i21.LaunchMode? mode,
+ _i19.LaunchMode? mode,
}) =>
_i15.Future.value(false),
) as _i15.Future Function(
Uri, {
- _i21.LaunchMode? mode,
+ _i19.LaunchMode? mode,
}));
@override
_i15.Future Function(Uri) get canLaunchUrlFunc => (super.noSuchMethod(
@@ -755,7 +738,7 @@ class MockUrlUtils extends _i1.Mock implements _i20.UrlUtils {
@override
_i15.Future launchUrl(
Uri? url, {
- _i21.LaunchMode? mode,
+ _i19.LaunchMode? mode,
}) =>
(super.noSuchMethod(
Invocation.method(
@@ -767,9 +750,9 @@ class MockUrlUtils extends _i1.Mock implements _i20.UrlUtils {
) as _i15.Future);
@override
_i15.Future openRedirect(
- _i16.WalletRedirect? redirect, {
+ _i20.WalletRedirect? redirect, {
String? wcURI,
- _i22.PlatformType? pType,
+ _i21.PlatformType? pType,
}) =>
(super.noSuchMethod(
Invocation.method(
@@ -788,27 +771,27 @@ class MockUrlUtils extends _i1.Mock implements _i20.UrlUtils {
/// A class which mocks [PlatformUtils].
///
/// See the documentation for Mockito's code generation for more information.
-class MockPlatformUtils extends _i1.Mock implements _i23.PlatformUtils {
+class MockPlatformUtils extends _i1.Mock implements _i22.PlatformUtils {
MockPlatformUtils() {
_i1.throwOnMissingStub(this);
}
@override
- _i22.PlatformExact getPlatformExact() => (super.noSuchMethod(
+ _i21.PlatformExact getPlatformExact() => (super.noSuchMethod(
Invocation.method(
#getPlatformExact,
[],
),
- returnValue: _i22.PlatformExact.iOS,
- ) as _i22.PlatformExact);
+ returnValue: _i21.PlatformExact.iOS,
+ ) as _i21.PlatformExact);
@override
- _i22.PlatformType getPlatformType() => (super.noSuchMethod(
+ _i21.PlatformType getPlatformType() => (super.noSuchMethod(
Invocation.method(
#getPlatformType,
[],
),
- returnValue: _i22.PlatformType.mobile,
- ) as _i22.PlatformType);
+ returnValue: _i21.PlatformType.mobile,
+ ) as _i21.PlatformType);
@override
bool canDetectInstalledApps() => (super.noSuchMethod(
Invocation.method(
@@ -846,18 +829,18 @@ class MockPlatformUtils extends _i1.Mock implements _i23.PlatformUtils {
/// A class which mocks [ToastUtils].
///
/// See the documentation for Mockito's code generation for more information.
-class MockToastUtils extends _i1.Mock implements _i24.ToastUtils {
+class MockToastUtils extends _i1.Mock implements _i23.ToastUtils {
MockToastUtils() {
_i1.throwOnMissingStub(this);
}
@override
- _i15.Stream<_i25.ToastMessage?> get toasts => (super.noSuchMethod(
+ _i15.Stream<_i24.ToastMessage?> get toasts => (super.noSuchMethod(
Invocation.getter(#toasts),
- returnValue: _i15.Stream<_i25.ToastMessage?>.empty(),
- ) as _i15.Stream<_i25.ToastMessage?>);
+ returnValue: _i15.Stream<_i24.ToastMessage?>.empty(),
+ ) as _i15.Stream<_i24.ToastMessage?>);
@override
- void show(_i25.ToastMessage? message) => super.noSuchMethod(
+ void show(_i24.ToastMessage? message) => super.noSuchMethod(
Invocation.method(
#show,
[message],
@@ -1497,7 +1480,7 @@ class MockSessions extends _i1.Mock implements _i4.Sessions {
/// A class which mocks [RelayClient].
///
/// See the documentation for Mockito's code generation for more information.
-class MockRelayClient extends _i1.Mock implements _i26.RelayClient {
+class MockRelayClient extends _i1.Mock implements _i25.RelayClient {
MockRelayClient() {
_i1.throwOnMissingStub(this);
}
@@ -1570,7 +1553,7 @@ class MockRelayClient extends _i1.Mock implements _i26.RelayClient {
),
) as _i3.Event<_i3.EventArgs>);
@override
- set jsonRPC(_i27.Peer? _jsonRPC) => super.noSuchMethod(
+ set jsonRPC(_i26.Peer? _jsonRPC) => super.noSuchMethod(
Invocation.setter(
#jsonRPC,
_jsonRPC,
@@ -1802,7 +1785,7 @@ class MockClient extends _i1.Mock implements _i10.Client {
Uri? url, {
Map? headers,
Object? body,
- _i28.Encoding? encoding,
+ _i27.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
@@ -1832,7 +1815,7 @@ class MockClient extends _i1.Mock implements _i10.Client {
Uri? url, {
Map? headers,
Object? body,
- _i28.Encoding? encoding,
+ _i27.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
@@ -1862,7 +1845,7 @@ class MockClient extends _i1.Mock implements _i10.Client {
Uri? url, {
Map? headers,
Object? body,
- _i28.Encoding? encoding,
+ _i27.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
@@ -1892,7 +1875,7 @@ class MockClient extends _i1.Mock implements _i10.Client {
Uri? url, {
Map? headers,
Object? body,
- _i28.Encoding? encoding,
+ _i27.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
@@ -1938,7 +1921,7 @@ class MockClient extends _i1.Mock implements _i10.Client {
)),
) as _i15.Future);
@override
- _i15.Future<_i29.Uint8List> readBytes(
+ _i15.Future<_i28.Uint8List> readBytes(
Uri? url, {
Map? headers,
}) =>
@@ -1948,8 +1931,8 @@ class MockClient extends _i1.Mock implements _i10.Client {
[url],
{#headers: headers},
),
- returnValue: _i15.Future<_i29.Uint8List>.value(_i29.Uint8List(0)),
- ) as _i15.Future<_i29.Uint8List>);
+ returnValue: _i15.Future<_i28.Uint8List>.value(_i28.Uint8List(0)),
+ ) as _i15.Future<_i28.Uint8List>);
@override
_i15.Future<_i10.StreamedResponse> send(_i10.BaseRequest? request) =>
(super.noSuchMethod(
@@ -1979,7 +1962,7 @@ class MockClient extends _i1.Mock implements _i10.Client {
/// A class which mocks [NetworkService].
///
/// See the documentation for Mockito's code generation for more information.
-class MockNetworkService extends _i1.Mock implements _i30.NetworkService {
+class MockNetworkService extends _i1.Mock implements _i29.NetworkService {
MockNetworkService() {
_i1.throwOnMissingStub(this);
}
@@ -2001,14 +1984,14 @@ class MockNetworkService extends _i1.Mock implements _i30.NetworkService {
returnValueForMissingStub: null,
);
@override
- List<_i31.GridItem<_i4.W3MChainInfo>> get itemListComplete =>
+ List<_i30.GridItem<_i4.W3MChainInfo>> get itemListComplete =>
(super.noSuchMethod(
Invocation.getter(#itemListComplete),
- returnValue: <_i31.GridItem<_i4.W3MChainInfo>>[],
- ) as List<_i31.GridItem<_i4.W3MChainInfo>>);
+ returnValue: <_i30.GridItem<_i4.W3MChainInfo>>[],
+ ) as List<_i30.GridItem<_i4.W3MChainInfo>>);
@override
set itemListComplete(
- List<_i31.GridItem<_i4.W3MChainInfo>>? _itemListComplete) =>
+ List<_i30.GridItem<_i4.W3MChainInfo>>? _itemListComplete) =>
super.noSuchMethod(
Invocation.setter(
#itemListComplete,
@@ -2017,18 +2000,18 @@ class MockNetworkService extends _i1.Mock implements _i30.NetworkService {
returnValueForMissingStub: null,
);
@override
- _i2.ValueNotifier>> get itemList =>
+ _i2.ValueNotifier>> get itemList =>
(super.noSuchMethod(
Invocation.getter(#itemList),
returnValue:
- _FakeValueNotifier_0>>(
+ _FakeValueNotifier_0>>(
this,
Invocation.getter(#itemList),
),
- ) as _i2.ValueNotifier>>);
+ ) as _i2.ValueNotifier>>);
@override
set itemList(
- _i2.ValueNotifier>>?
+ _i2.ValueNotifier>>?
_itemList) =>
super.noSuchMethod(
Invocation.setter(
@@ -2061,7 +2044,7 @@ class MockNetworkService extends _i1.Mock implements _i30.NetworkService {
///
/// See the documentation for Mockito's code generation for more information.
class MockBlockchainApiUtils extends _i1.Mock
- implements _i32.BlockchainApiUtils {
+ implements _i31.BlockchainApiUtils {
MockBlockchainApiUtils() {
_i1.throwOnMissingStub(this);
}
@@ -2112,7 +2095,7 @@ class MockBlockchainApiUtils extends _i1.Mock
/// A class which mocks [LedgerService].
///
/// See the documentation for Mockito's code generation for more information.
-class MockLedgerService extends _i1.Mock implements _i33.LedgerService {
+class MockLedgerService extends _i1.Mock implements _i32.LedgerService {
MockLedgerService() {
_i1.throwOnMissingStub(this);
}
@@ -2185,7 +2168,7 @@ class MockLedgerService extends _i1.Mock implements _i33.LedgerService {
/// A class which mocks [StorageService].
///
/// See the documentation for Mockito's code generation for more information.
-class MockStorageService extends _i1.Mock implements _i34.StorageService {
+class MockStorageService extends _i1.Mock implements _i33.StorageService {
MockStorageService() {
_i1.throwOnMissingStub(this);
}
@@ -2224,12 +2207,20 @@ class MockStorageService extends _i1.Mock implements _i34.StorageService {
),
returnValue: _i15.Future.value(false),
) as _i15.Future);
+ @override
+ _i15.Future clearKey(String? key) => (super.noSuchMethod(
+ Invocation.method(
+ #clearKey,
+ [key],
+ ),
+ returnValue: _i15.Future.value(false),
+ ) as _i15.Future);
}
/// A class which mocks [WidgetStack].
///
/// See the documentation for Mockito's code generation for more information.
-class MockWidgetStack extends _i1.Mock implements _i35.WidgetStack {
+class MockWidgetStack extends _i1.Mock implements _i34.WidgetStack {
MockWidgetStack() {
_i1.throwOnMissingStub(this);
}
@@ -2323,7 +2314,7 @@ class MockWidgetStack extends _i1.Mock implements _i35.WidgetStack {
returnValueForMissingStub: null,
);
@override
- void addListener(_i19.VoidCallback? listener) => super.noSuchMethod(
+ void addListener(_i17.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
[listener],
@@ -2331,7 +2322,7 @@ class MockWidgetStack extends _i1.Mock implements _i35.WidgetStack {
returnValueForMissingStub: null,
);
@override
- void removeListener(_i19.VoidCallback? listener) => super.noSuchMethod(
+ void removeListener(_i17.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#removeListener,
[listener],