Generic fixes (#1528)

* update target sdk for android

* make welcome page scrollable
fix moonpay url params

* fix null exception when restoring from backup

* fix ui issues

* hopefully fix the timeout exception error report [skip ci]

* validate electrum addresses

* disable silent payments for hardware wallets

* fixes and enhancements
This commit is contained in:
Omar Hatem
2024-07-21 03:46:43 +03:00
committed by GitHub
parent 7514d851ce
commit 311fff2c44
45 changed files with 280 additions and 271 deletions
@@ -61,7 +61,7 @@ abstract class BalanceViewModelBase with Store {
WalletBase<Balance, TransactionHistoryBase<TransactionInfo>, TransactionInfo> wallet;
@computed
bool get hasSilentPayments => wallet.type == WalletType.bitcoin;
bool get hasSilentPayments => wallet.type == WalletType.bitcoin && !wallet.isHardwareWallet;
@computed
double get price {
@@ -308,7 +308,7 @@ abstract class DashboardViewModelBase with Store {
wallet.type == WalletType.haven;
@computed
bool get hasSilentPayments => wallet.type == WalletType.bitcoin;
bool get hasSilentPayments => wallet.type == WalletType.bitcoin && !wallet.isHardwareWallet;
@computed
bool get showSilentPaymentsCard => hasSilentPayments && settingsStore.silentPaymentsCardDisplay;
@@ -86,7 +86,7 @@ abstract class TransactionDetailsViewModelBase with Store {
if (showRecipientAddress && !isRecipientAddressShown) {
try {
final recipientAddress = transactionDescriptionBox.values
.firstWhere((val) => val.id == transactionInfo.id)
.firstWhere((val) => val.id == transactionInfo.txHash)
.recipientAddress;
if (recipientAddress?.isNotEmpty ?? false) {
@@ -105,14 +105,14 @@ abstract class TransactionDetailsViewModelBase with Store {
value: _explorerDescription(type),
onTap: () async {
try {
final uri = Uri.parse(_explorerUrl(type, tx.id));
final uri = Uri.parse(_explorerUrl(type, tx.txHash));
if (await canLaunchUrl(uri)) await launchUrl(uri, mode: LaunchMode.externalApplication);
} catch (e) {}
}));
final description = transactionDescriptionBox.values.firstWhere(
(val) => val.id == transactionInfo.id,
orElse: () => TransactionDescription(id: transactionInfo.id));
(val) => val.id == transactionInfo.txHash,
orElse: () => TransactionDescription(id: transactionInfo.txHash));
items.add(TextFieldListItem(
title: S.current.note_tap_to_change,
@@ -214,7 +214,7 @@ abstract class TransactionDetailsViewModelBase with Store {
final addressIndex = tx.additionalInfo['addressIndex'] as int;
final feeFormatted = tx.feeFormatted();
final _items = [
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txhash),
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txHash),
StandartListItem(
title: S.current.transaction_details_date, value: dateFormat.format(tx.date)),
StandartListItem(title: S.current.transaction_details_height, value: '${tx.height}'),
@@ -250,7 +250,7 @@ abstract class TransactionDetailsViewModelBase with Store {
void _addElectrumListItems(TransactionInfo tx, DateFormat dateFormat) {
final _items = [
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.id),
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txHash),
StandartListItem(
title: S.current.transaction_details_date, value: dateFormat.format(tx.date)),
StandartListItem(title: S.current.confirmations, value: tx.confirmations.toString()),
@@ -265,7 +265,7 @@ abstract class TransactionDetailsViewModelBase with Store {
void _addHavenListItems(TransactionInfo tx, DateFormat dateFormat) {
items.addAll([
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.id),
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txHash),
StandartListItem(
title: S.current.transaction_details_date, value: dateFormat.format(tx.date)),
StandartListItem(title: S.current.transaction_details_height, value: '${tx.height}'),
@@ -277,7 +277,7 @@ abstract class TransactionDetailsViewModelBase with Store {
void _addEthereumListItems(TransactionInfo tx, DateFormat dateFormat) {
final _items = [
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.id),
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txHash),
StandartListItem(
title: S.current.transaction_details_date, value: dateFormat.format(tx.date)),
StandartListItem(title: S.current.confirmations, value: tx.confirmations.toString()),
@@ -296,7 +296,7 @@ abstract class TransactionDetailsViewModelBase with Store {
void _addNanoListItems(TransactionInfo tx, DateFormat dateFormat) {
final _items = [
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.id),
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txHash),
if (showRecipientAddress && tx.to != null)
StandartListItem(title: S.current.transaction_details_recipient_address, value: tx.to!),
if (showRecipientAddress && tx.from != null)
@@ -313,7 +313,7 @@ abstract class TransactionDetailsViewModelBase with Store {
void _addPolygonListItems(TransactionInfo tx, DateFormat dateFormat) {
final _items = [
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.id),
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txHash),
StandartListItem(
title: S.current.transaction_details_date, value: dateFormat.format(tx.date)),
StandartListItem(title: S.current.confirmations, value: tx.confirmations.toString()),
@@ -332,7 +332,7 @@ abstract class TransactionDetailsViewModelBase with Store {
void _addSolanaListItems(TransactionInfo tx, DateFormat dateFormat) {
final _items = [
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.id),
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txHash),
StandartListItem(
title: S.current.transaction_details_date, value: dateFormat.format(tx.date)),
StandartListItem(title: S.current.transaction_details_amount, value: tx.amountFormatted()),
@@ -396,7 +396,7 @@ abstract class TransactionDetailsViewModelBase with Store {
void _addTronListItems(TransactionInfo tx, DateFormat dateFormat) {
final _items = [
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.id),
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txHash),
StandartListItem(
title: S.current.transaction_details_date, value: dateFormat.format(tx.date)),
StandartListItem(title: S.current.transaction_details_amount, value: tx.amountFormatted()),
@@ -455,7 +455,7 @@ abstract class TransactionDetailsViewModelBase with Store {
final addressIndex = tx.additionalInfo['addressIndex'] as int;
final feeFormatted = tx.feeFormatted();
final _items = [
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txhash),
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.txHash),
StandartListItem(
title: S.current.transaction_details_date, value: dateFormat.format(tx.date)),
StandartListItem(title: S.current.transaction_details_height, value: '${tx.height}'),