mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-22 06:28:39 +02:00
CW-994 mweb enhancements (#2204)
* add mweb block explorer * potential fix for #2 * fix spending when mweb is disabled * Update cw_bitcoin/lib/litecoin_wallet.dart * fix resolving conflict missing brackets --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
co-authored by
Omar Hatem
parent
3e4409d2ba
commit
20022c0393
@@ -59,6 +59,7 @@ abstract class TransactionDetailsViewModelBase with Store {
|
||||
if (!canReplaceByFee) _checkForRBF(tx);
|
||||
break;
|
||||
case WalletType.litecoin:
|
||||
_addLitecoinListItems(tx, dateFormat);
|
||||
case WalletType.bitcoinCash:
|
||||
_addElectrumListItems(tx, dateFormat);
|
||||
break;
|
||||
@@ -388,6 +389,30 @@ abstract class TransactionDetailsViewModelBase with Store {
|
||||
items.addAll(_items);
|
||||
}
|
||||
|
||||
void _addLitecoinListItems(TransactionInfo tx, DateFormat dateFormat) {
|
||||
_addElectrumListItems(tx, dateFormat);
|
||||
|
||||
bool isMweb = bitcoin!.txIsMweb(tx);
|
||||
|
||||
final _items = [
|
||||
if (isMweb)
|
||||
BlockExplorerListItem(
|
||||
title: S.current.view_in_block_explorer,
|
||||
value: S.current.view_transaction_on + 'mwebexplorer.com',
|
||||
onTap: () async {
|
||||
try {
|
||||
final uri = Uri.parse('https://www.mwebexplorer.com/blocks/block/${tx.height}');
|
||||
if (await canLaunchUrl(uri))
|
||||
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||
} catch (e) {}
|
||||
},
|
||||
key: ValueKey('block_explorer_list_item_mweb_wallet_type_key'),
|
||||
),
|
||||
];
|
||||
|
||||
items.addAll(_items);
|
||||
}
|
||||
|
||||
void _addHavenListItems(TransactionInfo tx, DateFormat dateFormat) {
|
||||
items.addAll([
|
||||
StandartListItem(
|
||||
|
||||
Reference in New Issue
Block a user