mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
CW-515-WalletConnect-deeplink (#1153)
* feat: WalletConnect deeplink WIP * fix: Handle cases where a non ethereum address is in use when the trigger is made * fix: edgecases fixes for walletconect * fix: edgecases fixes for walletconect * Update pubspec_base.yaml * remove unused dependency * remove unused dependency --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
cef3029f6f
commit
745607aa73
38 changed files with 180 additions and 62 deletions
|
@ -1 +1 @@
|
||||||
C:/Users/borod/AppData/Local/Pub/Cache/hosted/pub.dev/path_provider_linux-2.2.0/
|
/Users/blazebrain/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
|
|
@ -115,6 +115,9 @@ PODS:
|
||||||
- Flutter
|
- Flutter
|
||||||
- flutter_secure_storage (6.0.0):
|
- flutter_secure_storage (6.0.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- fluttertoast (0.0.2):
|
||||||
|
- Flutter
|
||||||
|
- Toast
|
||||||
- in_app_review (0.2.0):
|
- in_app_review (0.2.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- local_auth_ios (0.0.1):
|
- local_auth_ios (0.0.1):
|
||||||
|
@ -143,6 +146,7 @@ PODS:
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- SwiftProtobuf (1.22.0)
|
- SwiftProtobuf (1.22.0)
|
||||||
- SwiftyGif (5.4.4)
|
- SwiftyGif (5.4.4)
|
||||||
|
- Toast (4.0.0)
|
||||||
- uni_links (0.0.1):
|
- uni_links (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- UnstoppableDomainsResolution (4.0.0):
|
- UnstoppableDomainsResolution (4.0.0):
|
||||||
|
@ -171,6 +175,7 @@ DEPENDENCIES:
|
||||||
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
|
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
|
||||||
- flutter_mailer (from `.symlinks/plugins/flutter_mailer/ios`)
|
- flutter_mailer (from `.symlinks/plugins/flutter_mailer/ios`)
|
||||||
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
|
- flutter_secure_storage (from `.symlinks/plugins/flutter_secure_storage/ios`)
|
||||||
|
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
|
||||||
- in_app_review (from `.symlinks/plugins/in_app_review/ios`)
|
- in_app_review (from `.symlinks/plugins/in_app_review/ios`)
|
||||||
- local_auth_ios (from `.symlinks/plugins/local_auth_ios/ios`)
|
- local_auth_ios (from `.symlinks/plugins/local_auth_ios/ios`)
|
||||||
- package_info (from `.symlinks/plugins/package_info/ios`)
|
- package_info (from `.symlinks/plugins/package_info/ios`)
|
||||||
|
@ -198,6 +203,7 @@ SPEC REPOS:
|
||||||
- SDWebImage
|
- SDWebImage
|
||||||
- SwiftProtobuf
|
- SwiftProtobuf
|
||||||
- SwiftyGif
|
- SwiftyGif
|
||||||
|
- Toast
|
||||||
- UnstoppableDomainsResolution
|
- UnstoppableDomainsResolution
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
|
@ -229,6 +235,8 @@ EXTERNAL SOURCES:
|
||||||
:path: ".symlinks/plugins/flutter_mailer/ios"
|
:path: ".symlinks/plugins/flutter_mailer/ios"
|
||||||
flutter_secure_storage:
|
flutter_secure_storage:
|
||||||
:path: ".symlinks/plugins/flutter_secure_storage/ios"
|
:path: ".symlinks/plugins/flutter_secure_storage/ios"
|
||||||
|
fluttertoast:
|
||||||
|
:path: ".symlinks/plugins/fluttertoast/ios"
|
||||||
in_app_review:
|
in_app_review:
|
||||||
:path: ".symlinks/plugins/in_app_review/ios"
|
:path: ".symlinks/plugins/in_app_review/ios"
|
||||||
local_auth_ios:
|
local_auth_ios:
|
||||||
|
@ -275,6 +283,7 @@ SPEC CHECKSUMS:
|
||||||
flutter_inappwebview: 3d32228f1304635e7c028b0d4252937730bbc6cf
|
flutter_inappwebview: 3d32228f1304635e7c028b0d4252937730bbc6cf
|
||||||
flutter_mailer: 2ef5a67087bc8c6c4cefd04a178bf1ae2c94cd83
|
flutter_mailer: 2ef5a67087bc8c6c4cefd04a178bf1ae2c94cd83
|
||||||
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
|
flutter_secure_storage: 23fc622d89d073675f2eaa109381aefbcf5a49be
|
||||||
|
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
|
||||||
in_app_review: 318597b3a06c22bb46dc454d56828c85f444f99d
|
in_app_review: 318597b3a06c22bb46dc454d56828c85f444f99d
|
||||||
local_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605
|
local_auth_ios: c6cf091ded637a88f24f86a8875d8b0f526e2605
|
||||||
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
|
||||||
|
@ -290,6 +299,7 @@ SPEC CHECKSUMS:
|
||||||
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
|
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
|
||||||
SwiftProtobuf: 40bd808372cb8706108f22d28f8ab4a6b9bc6989
|
SwiftProtobuf: 40bd808372cb8706108f22d28f8ab4a6b9bc6989
|
||||||
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
|
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
|
||||||
|
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
|
||||||
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
|
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
|
||||||
UnstoppableDomainsResolution: c3c67f4d0a5e2437cb00d4bd50c2e00d6e743841
|
UnstoppableDomainsResolution: c3c67f4d0a5e2437cb00d4bd50c2e00d6e743841
|
||||||
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
||||||
|
|
|
@ -6,7 +6,7 @@ import 'package:cake_wallet/core/wallet_connect/eth_transaction_model.dart';
|
||||||
import 'package:cake_wallet/core/wallet_connect/evm_chain_id.dart';
|
import 'package:cake_wallet/core/wallet_connect/evm_chain_id.dart';
|
||||||
import 'package:cake_wallet/core/wallet_connect/wc_bottom_sheet_service.dart';
|
import 'package:cake_wallet/core/wallet_connect/wc_bottom_sheet_service.dart';
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
import 'package:cake_wallet/src/screens/wallet_connect/widgets/error_display_widget.dart';
|
import 'package:cake_wallet/src/screens/wallet_connect/widgets/message_display_widget.dart';
|
||||||
import 'package:cake_wallet/store/app_store.dart';
|
import 'package:cake_wallet/store/app_store.dart';
|
||||||
import 'package:cake_wallet/core/wallet_connect/models/chain_key_model.dart';
|
import 'package:cake_wallet/core/wallet_connect/models/chain_key_model.dart';
|
||||||
import 'package:cake_wallet/core/wallet_connect/models/connection_model.dart';
|
import 'package:cake_wallet/core/wallet_connect/models/connection_model.dart';
|
||||||
|
|
|
@ -10,7 +10,7 @@ import 'package:cake_wallet/core/wallet_connect/models/auth_request_model.dart';
|
||||||
import 'package:cake_wallet/core/wallet_connect/models/chain_key_model.dart';
|
import 'package:cake_wallet/core/wallet_connect/models/chain_key_model.dart';
|
||||||
import 'package:cake_wallet/core/wallet_connect/models/session_request_model.dart';
|
import 'package:cake_wallet/core/wallet_connect/models/session_request_model.dart';
|
||||||
import 'package:cake_wallet/src/screens/wallet_connect/widgets/connection_request_widget.dart';
|
import 'package:cake_wallet/src/screens/wallet_connect/widgets/connection_request_widget.dart';
|
||||||
import 'package:cake_wallet/src/screens/wallet_connect/widgets/error_display_widget.dart';
|
import 'package:cake_wallet/src/screens/wallet_connect/widgets/message_display_widget.dart';
|
||||||
import 'package:cake_wallet/src/screens/wallet_connect/widgets/modals/web3_request_modal.dart';
|
import 'package:cake_wallet/src/screens/wallet_connect/widgets/modals/web3_request_modal.dart';
|
||||||
import 'package:cake_wallet/store/app_store.dart';
|
import 'package:cake_wallet/store/app_store.dart';
|
||||||
import 'package:eth_sig_util/eth_sig_util.dart';
|
import 'package:eth_sig_util/eth_sig_util.dart';
|
||||||
|
@ -200,6 +200,24 @@ abstract class Web3WalletServiceBase with Store {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
Future<void> pairWithUri(Uri uri) async {
|
||||||
|
try {
|
||||||
|
log('Pairing with URI: $uri');
|
||||||
|
await _web3Wallet.pair(uri: uri);
|
||||||
|
} on WalletConnectError catch (e) {
|
||||||
|
_bottomSheetHandler.queueBottomSheet(
|
||||||
|
isModalDismissible: true,
|
||||||
|
widget: BottomSheetMessageDisplayWidget(message: e.message),
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
_bottomSheetHandler.queueBottomSheet(
|
||||||
|
isModalDismissible: true,
|
||||||
|
widget: BottomSheetMessageDisplayWidget(message: e.toString()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void _onPairingCreate(PairingEvent? args) {
|
void _onPairingCreate(PairingEvent? args) {
|
||||||
log('Pairing Create Event: $args');
|
log('Pairing Create Event: $args');
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ import 'package:cake_wallet/src/screens/setup_2fa/setup_2fa_enter_code_page.dart
|
||||||
import 'package:cake_wallet/src/screens/support_chat/support_chat_page.dart';
|
import 'package:cake_wallet/src/screens/support_chat/support_chat_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/support_other_links/support_other_links_page.dart';
|
import 'package:cake_wallet/src/screens/support_other_links/support_other_links_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/wallet/wallet_edit_page.dart';
|
import 'package:cake_wallet/src/screens/wallet/wallet_edit_page.dart';
|
||||||
|
import 'package:cake_wallet/src/screens/wallet_connect/wc_connections_listing_view.dart';
|
||||||
import 'package:cake_wallet/themes/theme_list.dart';
|
import 'package:cake_wallet/themes/theme_list.dart';
|
||||||
import 'package:cake_wallet/utils/device_info.dart';
|
import 'package:cake_wallet/utils/device_info.dart';
|
||||||
import 'package:cake_wallet/store/anonpay/anonpay_transactions_store.dart';
|
import 'package:cake_wallet/store/anonpay/anonpay_transactions_store.dart';
|
||||||
|
@ -1153,5 +1154,9 @@ Future<void> setup({
|
||||||
return ManageNodesPage(isPow, nodeListViewModel: getIt.get<NodeListViewModel>());
|
return ManageNodesPage(isPow, nodeListViewModel: getIt.get<NodeListViewModel>());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
getIt.registerFactory(
|
||||||
|
() => WalletConnectConnectionsView(web3walletService: getIt.get<Web3WalletService>()));
|
||||||
|
|
||||||
|
|
||||||
_isSetupFinished = true;
|
_isSetupFinished = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import 'package:cake_wallet/anonpay/anonpay_info_base.dart';
|
import 'package:cake_wallet/anonpay/anonpay_info_base.dart';
|
||||||
import 'package:cake_wallet/anonpay/anonpay_invoice_info.dart';
|
import 'package:cake_wallet/anonpay/anonpay_invoice_info.dart';
|
||||||
import 'package:cake_wallet/core/totp_request_details.dart';
|
import 'package:cake_wallet/core/totp_request_details.dart';
|
||||||
|
import 'package:cake_wallet/core/wallet_connect/web3wallet_service.dart';
|
||||||
import 'package:cake_wallet/entities/contact_record.dart';
|
import 'package:cake_wallet/entities/contact_record.dart';
|
||||||
import 'package:cake_wallet/buy/order.dart';
|
import 'package:cake_wallet/buy/order.dart';
|
||||||
import 'package:cake_wallet/entities/qr_view_data.dart';
|
import 'package:cake_wallet/entities/qr_view_data.dart';
|
||||||
|
@ -49,6 +50,7 @@ import 'package:cake_wallet/src/screens/support_chat/support_chat_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/support_other_links/support_other_links_page.dart';
|
import 'package:cake_wallet/src/screens/support_other_links/support_other_links_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_details_page.dart';
|
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_details_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_list_page.dart';
|
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_list_page.dart';
|
||||||
|
import 'package:cake_wallet/src/screens/wallet_connect/wc_connections_listing_view.dart';
|
||||||
import 'package:cake_wallet/utils/payment_request.dart';
|
import 'package:cake_wallet/utils/payment_request.dart';
|
||||||
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
||||||
import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart';
|
import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart';
|
||||||
|
@ -594,6 +596,12 @@ Route<dynamic> createRoute(RouteSettings settings) {
|
||||||
case Routes.managePowNodes:
|
case Routes.managePowNodes:
|
||||||
return MaterialPageRoute<void>(builder: (_) => getIt.get<ManageNodesPage>(param1: true));
|
return MaterialPageRoute<void>(builder: (_) => getIt.get<ManageNodesPage>(param1: true));
|
||||||
|
|
||||||
|
case Routes.walletConnectConnectionsListing:
|
||||||
|
return MaterialPageRoute<void>(
|
||||||
|
builder: (_) => WalletConnectConnectionsView(
|
||||||
|
web3walletService: getIt.get<Web3WalletService>(),
|
||||||
|
launchUri: settings.arguments as Uri?,
|
||||||
|
));
|
||||||
default:
|
default:
|
||||||
return MaterialPageRoute<void>(
|
return MaterialPageRoute<void>(
|
||||||
builder: (_) => Scaffold(
|
builder: (_) => Scaffold(
|
||||||
|
|
|
@ -98,5 +98,5 @@ class Routes {
|
||||||
static const editToken = '/edit_token';
|
static const editToken = '/edit_token';
|
||||||
static const manageNodes = '/manage_nodes';
|
static const manageNodes = '/manage_nodes';
|
||||||
static const managePowNodes = '/manage_pow_nodes';
|
static const managePowNodes = '/manage_pow_nodes';
|
||||||
|
static const walletConnectConnectionsListing = '/wallet-connect-connections-listing';
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:cake_wallet/core/auth_service.dart';
|
import 'package:cake_wallet/core/auth_service.dart';
|
||||||
import 'package:cake_wallet/core/totp_request_details.dart';
|
import 'package:cake_wallet/core/totp_request_details.dart';
|
||||||
import 'package:cake_wallet/core/wallet_connect/wc_bottom_sheet_service.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
import 'package:cake_wallet/utils/device_info.dart';
|
import 'package:cake_wallet/utils/device_info.dart';
|
||||||
import 'package:cake_wallet/utils/payment_request.dart';
|
import 'package:cake_wallet/utils/payment_request.dart';
|
||||||
|
import 'package:cw_core/wallet_type.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:cake_wallet/routes.dart';
|
import 'package:cake_wallet/routes.dart';
|
||||||
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
|
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
|
||||||
import 'package:cake_wallet/store/app_store.dart';
|
import 'package:cake_wallet/store/app_store.dart';
|
||||||
import 'package:cake_wallet/store/authentication_store.dart';
|
import 'package:cake_wallet/store/authentication_store.dart';
|
||||||
import 'package:cake_wallet/entities/qr_scanner.dart';
|
import 'package:cake_wallet/entities/qr_scanner.dart';
|
||||||
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:uni_links/uni_links.dart';
|
import 'package:uni_links/uni_links.dart';
|
||||||
|
|
||||||
import '../setup_2fa/setup_2fa_enter_code_page.dart';
|
import '../setup_2fa/setup_2fa_enter_code_page.dart';
|
||||||
|
@ -139,8 +141,9 @@ class RootState extends State<Root> with WidgetsBindingObserver {
|
||||||
}
|
}
|
||||||
_reset();
|
_reset();
|
||||||
totpAuth.close(
|
totpAuth.close(
|
||||||
route: _isValidPaymentUri() ? Routes.send : null,
|
route: _getRouteToGo(),
|
||||||
arguments: PaymentRequest.fromUri(launchUri),
|
arguments:
|
||||||
|
isWalletConnectLink ? launchUri : PaymentRequest.fromUri(launchUri),
|
||||||
);
|
);
|
||||||
launchUri = null;
|
launchUri = null;
|
||||||
},
|
},
|
||||||
|
@ -151,8 +154,8 @@ class RootState extends State<Root> with WidgetsBindingObserver {
|
||||||
} else {
|
} else {
|
||||||
_reset();
|
_reset();
|
||||||
auth.close(
|
auth.close(
|
||||||
route: _isValidPaymentUri() ? Routes.send : null,
|
route: _getRouteToGo(),
|
||||||
arguments: PaymentRequest.fromUri(launchUri),
|
arguments: isWalletConnectLink ? launchUri : PaymentRequest.fromUri(launchUri),
|
||||||
);
|
);
|
||||||
launchUri = null;
|
launchUri = null;
|
||||||
}
|
}
|
||||||
|
@ -166,8 +169,19 @@ class RootState extends State<Root> with WidgetsBindingObserver {
|
||||||
arguments: PaymentRequest.fromUri(launchUri),
|
arguments: PaymentRequest.fromUri(launchUri),
|
||||||
);
|
);
|
||||||
launchUri = null;
|
launchUri = null;
|
||||||
|
} else if (isWalletConnectLink) {
|
||||||
|
if (widget.appStore.wallet!.type == WalletType.ethereum) {
|
||||||
|
widget.navigatorKey.currentState?.pushNamed(
|
||||||
|
Routes.walletConnectConnectionsListing,
|
||||||
|
arguments: launchUri,
|
||||||
|
);
|
||||||
|
launchUri = null;
|
||||||
|
} else {
|
||||||
|
_nonETHWalletErrorToast(S.current.switchToETHWallet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
launchUri = null;
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () async => false,
|
onWillPop: () async => false,
|
||||||
child: widget.child,
|
child: widget.child,
|
||||||
|
@ -187,4 +201,31 @@ class RootState extends State<Root> with WidgetsBindingObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _isValidPaymentUri() => launchUri?.path.isNotEmpty ?? false;
|
bool _isValidPaymentUri() => launchUri?.path.isNotEmpty ?? false;
|
||||||
|
|
||||||
|
bool get isWalletConnectLink => launchUri?.authority == 'wc';
|
||||||
|
|
||||||
|
String? _getRouteToGo() {
|
||||||
|
if (isWalletConnectLink) {
|
||||||
|
if (widget.appStore.wallet!.type != WalletType.ethereum) {
|
||||||
|
_nonETHWalletErrorToast(S.current.switchToETHWallet);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return Routes.walletConnectConnectionsListing;
|
||||||
|
} else if (_isValidPaymentUri()) {
|
||||||
|
return Routes.send;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _nonETHWalletErrorToast(String message) async {
|
||||||
|
Fluttertoast.showToast(
|
||||||
|
msg: message,
|
||||||
|
toastLength: Toast.LENGTH_LONG,
|
||||||
|
gravity: ToastGravity.SNACKBAR,
|
||||||
|
backgroundColor: Colors.black,
|
||||||
|
textColor: Colors.white,
|
||||||
|
fontSize: 16.0,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,15 +87,7 @@ class ConnectionSyncPage extends BasePage {
|
||||||
),
|
),
|
||||||
if (dashboardViewModel.wallet.type == WalletType.ethereum) ...[
|
if (dashboardViewModel.wallet.type == WalletType.ethereum) ...[
|
||||||
WalletConnectTile(
|
WalletConnectTile(
|
||||||
onTap: () async {
|
onTap: () => Navigator.of(context).pushNamed(Routes.walletConnectConnectionsListing),
|
||||||
Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) {
|
|
||||||
return WalletConnectConnectionsView(web3walletService: web3walletService!);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
const StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
|
const StandardListSeparator(padding: EdgeInsets.symmetric(horizontal: 24)),
|
||||||
]
|
]
|
||||||
|
|
|
@ -19,7 +19,24 @@ import 'wc_pairing_detail_page.dart';
|
||||||
class WalletConnectConnectionsView extends StatelessWidget {
|
class WalletConnectConnectionsView extends StatelessWidget {
|
||||||
final Web3WalletService web3walletService;
|
final Web3WalletService web3walletService;
|
||||||
|
|
||||||
WalletConnectConnectionsView({required this.web3walletService, Key? key}) : super(key: key);
|
WalletConnectConnectionsView({required this.web3walletService, Uri? launchUri, Key? key})
|
||||||
|
: super(key: key) {
|
||||||
|
_triggerPairingFromDeeplink(launchUri);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _triggerPairingFromDeeplink(Uri? launchUri) async {
|
||||||
|
if (launchUri == null) return;
|
||||||
|
|
||||||
|
final actualLinkList = launchUri.query.split("uri=");
|
||||||
|
|
||||||
|
final query = actualLinkList[1];
|
||||||
|
|
||||||
|
final uri = Uri.decodeComponent(query);
|
||||||
|
|
||||||
|
final uriData = Uri.parse(uri);
|
||||||
|
|
||||||
|
await web3walletService.pairWithUri(uriData);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -48,15 +65,9 @@ class WCPairingsWidget extends BasePage {
|
||||||
|
|
||||||
if (uri == null) return _invalidUriToast(context, S.current.nullURIError);
|
if (uri == null) return _invalidUriToast(context, S.current.nullURIError);
|
||||||
|
|
||||||
try {
|
|
||||||
log('_onFoundUri: $uri');
|
log('_onFoundUri: $uri');
|
||||||
final Uri uriData = Uri.parse(uri);
|
final Uri uriData = Uri.parse(uri);
|
||||||
await web3Wallet.pair(uri: uriData);
|
await web3walletService.pairWithUri(uriData);
|
||||||
} on WalletConnectError catch (e) {
|
|
||||||
await _invalidUriToast(context, e.message);
|
|
||||||
} catch (e) {
|
|
||||||
await _invalidUriToast(context, e.toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String?> _showEnterWalletConnectURIPopUp(BuildContext context) async {
|
Future<String?> _showEnterWalletConnectURIPopUp(BuildContext context) async {
|
||||||
|
|
|
@ -22,7 +22,10 @@ class BottomSheetMessageDisplayWidget extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
Text(
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
message,
|
message,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
|
@ -30,6 +33,9 @@ class BottomSheetMessageDisplayWidget extends StatelessWidget {
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
|
@ -92,6 +92,7 @@ dependencies:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/cake-tech/bitcoin_flutter.git
|
url: https://github.com/cake-tech/bitcoin_flutter.git
|
||||||
ref: cake-update-v3
|
ref: cake-update-v3
|
||||||
|
fluttertoast: 8.1.4
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
|
@ -722,5 +722,6 @@
|
||||||
"seed_key": "مفتاح البذور",
|
"seed_key": "مفتاح البذور",
|
||||||
"enter_seed_phrase": "أدخل عبارة البذور الخاصة بك",
|
"enter_seed_phrase": "أدخل عبارة البذور الخاصة بك",
|
||||||
"add_contact": "ﻝﺎﺼﺗﺍ ﺔﻬﺟ ﺔﻓﺎﺿﺇ",
|
"add_contact": "ﻝﺎﺼﺗﺍ ﺔﻬﺟ ﺔﻓﺎﺿﺇ",
|
||||||
"exchange_provider_unsupported": "${providerName} لم يعد مدعومًا!"
|
"exchange_provider_unsupported": "${providerName} لم يعد مدعومًا!",
|
||||||
|
"switchToETHWallet": "ﻯﺮﺧﺃ ﺓﺮﻣ ﺔﻟﻭﺎﺤﻤﻟﺍﻭ Ethereum ﺔﻈﻔﺤﻣ ﻰﻟﺇ ﻞﻳﺪﺒﺘﻟﺍ ﻰﺟﺮﻳ"
|
||||||
}
|
}
|
||||||
|
|
|
@ -718,5 +718,6 @@
|
||||||
"seed_key": "Ключ за семена",
|
"seed_key": "Ключ за семена",
|
||||||
"enter_seed_phrase": "Въведете вашата фраза за семена",
|
"enter_seed_phrase": "Въведете вашата фраза за семена",
|
||||||
"add_contact": "Добави контакт",
|
"add_contact": "Добави контакт",
|
||||||
"exchange_provider_unsupported": "${providerName} вече не се поддържа!"
|
"exchange_provider_unsupported": "${providerName} вече не се поддържа!",
|
||||||
|
"switchToETHWallet": "Моля, преминете към портфейл Ethereum и опитайте отново"
|
||||||
}
|
}
|
||||||
|
|
|
@ -718,5 +718,6 @@
|
||||||
"seed_key": "Klíč semen",
|
"seed_key": "Klíč semen",
|
||||||
"enter_seed_phrase": "Zadejte svou frázi semen",
|
"enter_seed_phrase": "Zadejte svou frázi semen",
|
||||||
"add_contact": "Přidat kontakt",
|
"add_contact": "Přidat kontakt",
|
||||||
"exchange_provider_unsupported": "${providerName} již není podporováno!"
|
"exchange_provider_unsupported": "${providerName} již není podporováno!",
|
||||||
|
"switchToETHWallet": "Přejděte na peněženku Ethereum a zkuste to znovu"
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,5 +726,6 @@
|
||||||
"seed_key": "Seed-Schlüssel",
|
"seed_key": "Seed-Schlüssel",
|
||||||
"enter_seed_phrase": "Geben Sie Ihre Seed-Phrase ein",
|
"enter_seed_phrase": "Geben Sie Ihre Seed-Phrase ein",
|
||||||
"add_contact": "Kontakt hinzufügen",
|
"add_contact": "Kontakt hinzufügen",
|
||||||
"exchange_provider_unsupported": "${providerName} wird nicht mehr unterstützt!"
|
"exchange_provider_unsupported": "${providerName} wird nicht mehr unterstützt!",
|
||||||
|
"switchToETHWallet": "Bitte wechseln Sie zu einem Ethereum-Wallet und versuchen Sie es erneut"
|
||||||
}
|
}
|
||||||
|
|
|
@ -727,5 +727,6 @@
|
||||||
"seed_key": "Seed key",
|
"seed_key": "Seed key",
|
||||||
"enter_seed_phrase": "Enter your seed phrase",
|
"enter_seed_phrase": "Enter your seed phrase",
|
||||||
"add_contact": "Add contact",
|
"add_contact": "Add contact",
|
||||||
"exchange_provider_unsupported": "${providerName} is no longer supported!"
|
"exchange_provider_unsupported": "${providerName} is no longer supported!",
|
||||||
|
"switchToETHWallet": "Please switch to an Ethereum wallet and try again"
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,5 +726,6 @@
|
||||||
"seed_key": "Llave de semilla",
|
"seed_key": "Llave de semilla",
|
||||||
"enter_seed_phrase": "Ingrese su frase de semillas",
|
"enter_seed_phrase": "Ingrese su frase de semillas",
|
||||||
"add_contact": "Agregar contacto",
|
"add_contact": "Agregar contacto",
|
||||||
"exchange_provider_unsupported": "¡${providerName} ya no es compatible!"
|
"exchange_provider_unsupported": "¡${providerName} ya no es compatible!",
|
||||||
|
"switchToETHWallet": "Cambie a una billetera Ethereum e inténtelo nuevamente."
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,5 +726,6 @@
|
||||||
"seed_key": "Clé de graines",
|
"seed_key": "Clé de graines",
|
||||||
"enter_seed_phrase": "Entrez votre phrase de semence",
|
"enter_seed_phrase": "Entrez votre phrase de semence",
|
||||||
"add_contact": "Ajouter le contact",
|
"add_contact": "Ajouter le contact",
|
||||||
"exchange_provider_unsupported": "${providerName} n'est plus pris en charge!"
|
"exchange_provider_unsupported": "${providerName} n'est plus pris en charge!",
|
||||||
|
"switchToETHWallet": "Veuillez passer à un portefeuille Ethereum et réessayer"
|
||||||
}
|
}
|
||||||
|
|
|
@ -704,5 +704,6 @@
|
||||||
"seed_key": "Maɓallin iri",
|
"seed_key": "Maɓallin iri",
|
||||||
"enter_seed_phrase": "Shigar da Sert Sentarku",
|
"enter_seed_phrase": "Shigar da Sert Sentarku",
|
||||||
"add_contact": "Ƙara lamba",
|
"add_contact": "Ƙara lamba",
|
||||||
"exchange_provider_unsupported": "${providerName}"
|
"exchange_provider_unsupported": "${providerName}",
|
||||||
|
"switchToETHWallet": "Da fatan za a canza zuwa walat ɗin Ethereum kuma a sake gwadawa"
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,5 +726,6 @@
|
||||||
"seed_key": "बीज कुंजी",
|
"seed_key": "बीज कुंजी",
|
||||||
"enter_seed_phrase": "अपना बीज वाक्यांश दर्ज करें",
|
"enter_seed_phrase": "अपना बीज वाक्यांश दर्ज करें",
|
||||||
"add_contact": "संपर्क जोड़ें",
|
"add_contact": "संपर्क जोड़ें",
|
||||||
"exchange_provider_unsupported": "${providerName} अब समर्थित नहीं है!"
|
"exchange_provider_unsupported": "${providerName} अब समर्थित नहीं है!",
|
||||||
|
"switchToETHWallet": "कृपया एथेरियम वॉलेट पर स्विच करें और पुनः प्रयास करें"
|
||||||
}
|
}
|
||||||
|
|
|
@ -724,5 +724,6 @@
|
||||||
"seed_key": "Sjemenski ključ",
|
"seed_key": "Sjemenski ključ",
|
||||||
"enter_seed_phrase": "Unesite svoju sjemensku frazu",
|
"enter_seed_phrase": "Unesite svoju sjemensku frazu",
|
||||||
"add_contact": "Dodaj kontakt",
|
"add_contact": "Dodaj kontakt",
|
||||||
"exchange_provider_unsupported": "${providerName} više nije podržan!"
|
"exchange_provider_unsupported": "${providerName} više nije podržan!",
|
||||||
|
"switchToETHWallet": "Prijeđite na Ethereum novčanik i pokušajte ponovno"
|
||||||
}
|
}
|
||||||
|
|
|
@ -714,5 +714,6 @@
|
||||||
"seed_key": "Kunci benih",
|
"seed_key": "Kunci benih",
|
||||||
"enter_seed_phrase": "Masukkan frasa benih Anda",
|
"enter_seed_phrase": "Masukkan frasa benih Anda",
|
||||||
"add_contact": "Tambah kontak",
|
"add_contact": "Tambah kontak",
|
||||||
"exchange_provider_unsupported": "${providerName} tidak lagi didukung!"
|
"exchange_provider_unsupported": "${providerName} tidak lagi didukung!",
|
||||||
|
"switchToETHWallet": "Silakan beralih ke dompet Ethereum dan coba lagi"
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,5 +726,6 @@
|
||||||
"seed_key": "Chiave di semi",
|
"seed_key": "Chiave di semi",
|
||||||
"enter_seed_phrase": "Inserisci la tua frase di semi",
|
"enter_seed_phrase": "Inserisci la tua frase di semi",
|
||||||
"add_contact": "Aggiungi contatto",
|
"add_contact": "Aggiungi contatto",
|
||||||
"exchange_provider_unsupported": "${providerName} non è più supportato!"
|
"exchange_provider_unsupported": "${providerName} non è più supportato!",
|
||||||
|
"switchToETHWallet": "Passa a un portafoglio Ethereum e riprova"
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,5 +726,6 @@
|
||||||
"seed_key": "シードキー",
|
"seed_key": "シードキー",
|
||||||
"enter_seed_phrase": "シードフレーズを入力してください",
|
"enter_seed_phrase": "シードフレーズを入力してください",
|
||||||
"add_contact": "連絡先を追加",
|
"add_contact": "連絡先を追加",
|
||||||
"exchange_provider_unsupported": "${providerName}はサポートされなくなりました!"
|
"exchange_provider_unsupported": "${providerName}はサポートされなくなりました!",
|
||||||
|
"switchToETHWallet": "イーサリアムウォレットに切り替えてもう一度お試しください"
|
||||||
}
|
}
|
||||||
|
|
|
@ -724,5 +724,6 @@
|
||||||
"seed_key": "시드 키",
|
"seed_key": "시드 키",
|
||||||
"enter_seed_phrase": "시드 문구를 입력하십시오",
|
"enter_seed_phrase": "시드 문구를 입력하십시오",
|
||||||
"add_contact": "주소록에 추가",
|
"add_contact": "주소록에 추가",
|
||||||
"exchange_provider_unsupported": "${providerName}은 더 이상 지원되지 않습니다!"
|
"exchange_provider_unsupported": "${providerName}은 더 이상 지원되지 않습니다!",
|
||||||
|
"switchToETHWallet": "이더리움 지갑으로 전환한 후 다시 시도해 주세요."
|
||||||
}
|
}
|
||||||
|
|
|
@ -724,5 +724,6 @@
|
||||||
"seed_key": "မျိုးစေ့သော့",
|
"seed_key": "မျိုးစေ့သော့",
|
||||||
"enter_seed_phrase": "သင့်ရဲ့မျိုးစေ့စကားစုကိုရိုက်ထည့်ပါ",
|
"enter_seed_phrase": "သင့်ရဲ့မျိုးစေ့စကားစုကိုရိုက်ထည့်ပါ",
|
||||||
"add_contact": "အဆက်အသွယ်ထည့်ပါ။",
|
"add_contact": "အဆက်အသွယ်ထည့်ပါ။",
|
||||||
"exchange_provider_unsupported": "${providerName} မရှိတော့ပါ!"
|
"exchange_provider_unsupported": "${providerName} မရှိတော့ပါ!",
|
||||||
|
"switchToETHWallet": "ကျေးဇူးပြု၍ Ethereum ပိုက်ဆံအိတ်သို့ ပြောင်းပြီး ထပ်စမ်းကြည့်ပါ။"
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,5 +726,6 @@
|
||||||
"seed_key": "Zaadsleutel",
|
"seed_key": "Zaadsleutel",
|
||||||
"enter_seed_phrase": "Voer uw zaadzin in",
|
"enter_seed_phrase": "Voer uw zaadzin in",
|
||||||
"add_contact": "Contactpersoon toevoegen",
|
"add_contact": "Contactpersoon toevoegen",
|
||||||
"exchange_provider_unsupported": "${providerName} wordt niet langer ondersteund!"
|
"exchange_provider_unsupported": "${providerName} wordt niet langer ondersteund!",
|
||||||
|
"switchToETHWallet": "Schakel over naar een Ethereum-portemonnee en probeer het opnieuw"
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,5 +726,6 @@
|
||||||
"seed_key": "Klucz nasion",
|
"seed_key": "Klucz nasion",
|
||||||
"enter_seed_phrase": "Wprowadź swoją frazę nasienną",
|
"enter_seed_phrase": "Wprowadź swoją frazę nasienną",
|
||||||
"add_contact": "Dodaj kontakt",
|
"add_contact": "Dodaj kontakt",
|
||||||
"exchange_provider_unsupported": "${providerName} nie jest już obsługiwany!"
|
"exchange_provider_unsupported": "${providerName} nie jest już obsługiwany!",
|
||||||
|
"switchToETHWallet": "Przejdź na portfel Ethereum i spróbuj ponownie"
|
||||||
}
|
}
|
||||||
|
|
|
@ -725,5 +725,6 @@
|
||||||
"seed_key": "Chave de semente",
|
"seed_key": "Chave de semente",
|
||||||
"enter_seed_phrase": "Digite sua frase de semente",
|
"enter_seed_phrase": "Digite sua frase de semente",
|
||||||
"add_contact": "Adicionar contato",
|
"add_contact": "Adicionar contato",
|
||||||
"exchange_provider_unsupported": "${providerName} não é mais suportado!"
|
"exchange_provider_unsupported": "${providerName} não é mais suportado!",
|
||||||
|
"switchToETHWallet": "Mude para uma carteira Ethereum e tente novamente"
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,5 +726,6 @@
|
||||||
"seed_key": "Ключ семян",
|
"seed_key": "Ключ семян",
|
||||||
"enter_seed_phrase": "Введите свою семенную фразу",
|
"enter_seed_phrase": "Введите свою семенную фразу",
|
||||||
"add_contact": "Добавить контакт",
|
"add_contact": "Добавить контакт",
|
||||||
"exchange_provider_unsupported": "${providerName} больше не поддерживается!"
|
"exchange_provider_unsupported": "${providerName} больше не поддерживается!",
|
||||||
|
"switchToETHWallet": "Пожалуйста, переключитесь на кошелек Ethereum и повторите попытку."
|
||||||
}
|
}
|
||||||
|
|
|
@ -724,5 +724,6 @@
|
||||||
"seed_key": "คีย์เมล็ดพันธุ์",
|
"seed_key": "คีย์เมล็ดพันธุ์",
|
||||||
"enter_seed_phrase": "ป้อนวลีเมล็ดพันธุ์ของคุณ",
|
"enter_seed_phrase": "ป้อนวลีเมล็ดพันธุ์ของคุณ",
|
||||||
"add_contact": "เพิ่มผู้ติดต่อ",
|
"add_contact": "เพิ่มผู้ติดต่อ",
|
||||||
"exchange_provider_unsupported": "${providerName} ไม่ได้รับการสนับสนุนอีกต่อไป!"
|
"exchange_provider_unsupported": "${providerName} ไม่ได้รับการสนับสนุนอีกต่อไป!",
|
||||||
|
"switchToETHWallet": "โปรดเปลี่ยนไปใช้กระเป๋าเงิน Ethereum แล้วลองอีกครั้ง"
|
||||||
}
|
}
|
||||||
|
|
|
@ -721,5 +721,6 @@
|
||||||
"seed_key": "Seed Key",
|
"seed_key": "Seed Key",
|
||||||
"enter_seed_phrase": "Ipasok ang iyong pariralang binhi",
|
"enter_seed_phrase": "Ipasok ang iyong pariralang binhi",
|
||||||
"add_contact": "Magdagdag ng contact",
|
"add_contact": "Magdagdag ng contact",
|
||||||
"exchange_provider_unsupported": "Ang ${providerName} ay hindi na suportado!"
|
"exchange_provider_unsupported": "Ang ${providerName} ay hindi na suportado!",
|
||||||
|
"switchToETHWallet": "Mangyaring lumipat sa isang Ethereum wallet at subukang muli"
|
||||||
}
|
}
|
||||||
|
|
|
@ -724,5 +724,6 @@
|
||||||
"seed_key": "Tohum",
|
"seed_key": "Tohum",
|
||||||
"enter_seed_phrase": "Tohum ifadenizi girin",
|
"enter_seed_phrase": "Tohum ifadenizi girin",
|
||||||
"add_contact": "Kişi ekle",
|
"add_contact": "Kişi ekle",
|
||||||
"exchange_provider_unsupported": "${providerName} artık desteklenmiyor!"
|
"exchange_provider_unsupported": "${providerName} artık desteklenmiyor!",
|
||||||
|
"switchToETHWallet": "Lütfen bir Ethereum cüzdanına geçin ve tekrar deneyin"
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,5 +726,6 @@
|
||||||
"seed_key": "Насіннєвий ключ",
|
"seed_key": "Насіннєвий ключ",
|
||||||
"enter_seed_phrase": "Введіть свою насіннєву фразу",
|
"enter_seed_phrase": "Введіть свою насіннєву фразу",
|
||||||
"add_contact": "Додати контакт",
|
"add_contact": "Додати контакт",
|
||||||
"exchange_provider_unsupported": "${providerName} більше не підтримується!"
|
"exchange_provider_unsupported": "${providerName} більше не підтримується!",
|
||||||
|
"switchToETHWallet": "Перейдіть на гаманець Ethereum і повторіть спробу"
|
||||||
}
|
}
|
||||||
|
|
|
@ -718,5 +718,6 @@
|
||||||
"seed_key": "بیج کی کلید",
|
"seed_key": "بیج کی کلید",
|
||||||
"enter_seed_phrase": "اپنے بیج کا جملہ درج کریں",
|
"enter_seed_phrase": "اپنے بیج کا جملہ درج کریں",
|
||||||
"add_contact": "۔ﮟﯾﺮﮐ ﻞﻣﺎﺷ ﮧﻄﺑﺍﺭ",
|
"add_contact": "۔ﮟﯾﺮﮐ ﻞﻣﺎﺷ ﮧﻄﺑﺍﺭ",
|
||||||
"exchange_provider_unsupported": "${providerName} اب تعاون نہیں کیا جاتا ہے!"
|
"exchange_provider_unsupported": "${providerName} اب تعاون نہیں کیا جاتا ہے!",
|
||||||
|
"switchToETHWallet": "۔ﮟﯾﺮﮐ ﺶﺷﻮﮐ ﮦﺭﺎﺑﻭﺩ ﺭﻭﺍ ﮟﯾﺮﮐ ﭻﺋﻮﺳ ﺮﭘ ﭧﯿﻟﺍﻭ Ethereum ﻡﺮﮐ ﮦﺍﺮﺑ"
|
||||||
}
|
}
|
||||||
|
|
|
@ -720,5 +720,6 @@
|
||||||
"seed_key": "Bọtini Ose",
|
"seed_key": "Bọtini Ose",
|
||||||
"enter_seed_phrase": "Tẹ ọrọ-iru irugbin rẹ",
|
"enter_seed_phrase": "Tẹ ọrọ-iru irugbin rẹ",
|
||||||
"add_contact": "Fi olubasọrọ kun",
|
"add_contact": "Fi olubasọrọ kun",
|
||||||
"exchange_provider_unsupported": "${providerName} ko ni atilẹyin mọ!"
|
"exchange_provider_unsupported": "${providerName} ko ni atilẹyin mọ!",
|
||||||
|
"switchToETHWallet": "Jọwọ yipada si apamọwọ Ethereum ki o tun gbiyanju lẹẹkansi"
|
||||||
}
|
}
|
||||||
|
|
|
@ -725,5 +725,6 @@
|
||||||
"seed_key": "种子钥匙",
|
"seed_key": "种子钥匙",
|
||||||
"enter_seed_phrase": "输入您的种子短语",
|
"enter_seed_phrase": "输入您的种子短语",
|
||||||
"add_contact": "增加联系人",
|
"add_contact": "增加联系人",
|
||||||
"exchange_provider_unsupported": "${providerName}不再支持!"
|
"exchange_provider_unsupported": "${providerName}不再支持!",
|
||||||
|
"switchToETHWallet": "请切换到以太坊钱包并重试"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue