diff --git a/cw_bitcoin/lib/bitcoin_wallet_addresses.dart b/cw_bitcoin/lib/bitcoin_wallet_addresses.dart index b33d722ab..d84d958be 100644 --- a/cw_bitcoin/lib/bitcoin_wallet_addresses.dart +++ b/cw_bitcoin/lib/bitcoin_wallet_addresses.dart @@ -67,6 +67,8 @@ abstract class BitcoinWalletAddressesBase extends ElectrumWalletAddresses with S payjoinManager.resumeSessions(); } catch (e) { printV(e); + // Ignore Connectivity errors + if (!e.toString().contains("error sending request for url")) rethrow; } } @@ -79,6 +81,8 @@ abstract class BitcoinWalletAddressesBase extends ElectrumWalletAddresses with S payjoinManager.spawnReceiver(receiver: currentPayjoinReceiver!); } catch (e) { printV(e); + // Ignore Connectivity errors + if (!e.toString().contains("error sending request for url")) rethrow; } } } diff --git a/cw_bitcoin/lib/payjoin/payjoin_send_worker.dart b/cw_bitcoin/lib/payjoin/payjoin_send_worker.dart index c11342800..7e85cc773 100644 --- a/cw_bitcoin/lib/payjoin/payjoin_send_worker.dart +++ b/cw_bitcoin/lib/payjoin/payjoin_send_worker.dart @@ -106,8 +106,8 @@ class PayjoinSenderWorker { sendPort.send({'type': PayjoinSenderRequestTypes.requestPosted}); return await postRequest.$2.processResponse(response: response); - } catch (e) { - throw PayjoinSessionError.unrecoverable('Send V1 payjoin error: $e'); + } catch (e, stack) { + throw PayjoinSessionError.unrecoverable('Send V1 payjoin error: $e, $stack'); } } diff --git a/lib/view_model/payjoin_details_view_model.dart b/lib/view_model/payjoin_details_view_model.dart index b19207373..7d63aaae3 100644 --- a/lib/view_model/payjoin_details_view_model.dart +++ b/lib/view_model/payjoin_details_view_model.dart @@ -4,7 +4,9 @@ import 'package:cake_wallet/bitcoin/bitcoin.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/screens/trade_details/trade_details_list_card.dart'; import 'package:cake_wallet/src/screens/trade_details/trade_details_status_item.dart'; +import 'package:cake_wallet/src/screens/transaction_details/blockexplorer_list_item.dart'; import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart'; +import 'package:cake_wallet/src/screens/transaction_details/transaction_details_list_item.dart'; import 'package:cake_wallet/themes/core/theme_store.dart'; import 'package:cake_wallet/utils/date_formatter.dart'; import 'package:cw_core/payjoin_session.dart'; @@ -12,6 +14,7 @@ import 'package:cw_core/transaction_info.dart'; import 'package:flutter/widgets.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:mobx/mobx.dart'; +import 'package:url_launcher/url_launcher.dart'; part 'payjoin_details_view_model.g.dart'; @@ -40,7 +43,7 @@ abstract class PayjoinDetailsViewModelBase with Store { @observable late PayjoinSession payjoinSession; - final ObservableList items; + final ObservableList items; late final StreamSubscription listener; @@ -69,12 +72,25 @@ abstract class PayjoinDetailsViewModelBase with Store { title: S.current.error, value: payjoinSession.error!, ), - if (payjoinSession.txId?.isNotEmpty == true && transactionInfo != null) + if (payjoinSession.txId?.isNotEmpty == true && transactionInfo != null) ...[ StandartListItem( title: S.current.transaction_details_transaction_id, value: payjoinSession.txId!, key: ValueKey('standard_list_item_transaction_details_id_key'), + ), + BlockExplorerListItem( + title: S.current.view_in_block_explorer, + value: '${S.current.view_transaction_on}mempool.space', + onTap: () async { + try { + final uri = Uri.parse('https://mempool.cakewallet.com/tx/${payjoinSession.txId!}'); + if (await canLaunchUrl(uri)) + await launchUrl(uri, mode: LaunchMode.externalApplication); + } catch (e) {} + }, + key: ValueKey('block_explorer_list_item_wallet_type_key'), ) + ] ]); if (transactionInfo != null) {