CW- 463 Fix transaction receive address not showing for Eth/Erc20 (#1076)
* Fix transaction receive address not showing for Eth/Erc20 [skip ci] * Fix transaction receive address for Eth/Erc20
Omar Hatem committed
Sep 14, 2023 at 22:12 UTC
4c9c6a1eae2bf056e090272842abd328ddf62b23
5 files changed
+9
-1
cw_core/lib/transaction_info.dart
+1
@@ -14,6 +14,7 @@ abstract class TransactionInfo extends Object with Keyable {
14
String fiatAmount();
15
String? feeFormatted();
16
void changeFiatAmount(String amount);
17
+ String? to;
18
19
@override
20
dynamic get keyIndex => id;
cw_ethereum/lib/ethereum_transaction_info.dart
+4
@@ -14,6 +14,7 @@ class EthereumTransactionInfo extends TransactionInfo {
14
required this.isPending,
15
required this.date,
16
required this.confirmations,
17
+ required this.to,
18
}) : this.amount = ethAmount.toInt(),
19
this.fee = ethFee.toInt();
20
@@ -30,6 +31,7 @@ class EthereumTransactionInfo extends TransactionInfo {
31
final int confirmations;
32
final String tokenSymbol;
33
String? _fiatAmount;
34
+ final String? to;
35
36
@override
37
String amountFormatted() =>
@@ -56,6 +58,7 @@ class EthereumTransactionInfo extends TransactionInfo {
58
isPending: data['isPending'] as bool,
59
confirmations: data['confirmations'] as int,
60
tokenSymbol: data['tokenSymbol'] as String,
61
+ to: data['to'],
62
);
63
}
64
@@ -70,5 +73,6 @@ class EthereumTransactionInfo extends TransactionInfo {
73
'isPending': isPending,
74
'confirmations': confirmations,
75
'tokenSymbol': tokenSymbol,
76
+ 'to': to,
77
};
78
}
cw_ethereum/lib/ethereum_wallet.dart
+1
@@ -283,6 +283,7 @@ abstract class EthereumWalletBase
283
ethFee: BigInt.from(transactionModel.gasUsed) * transactionModel.gasPrice,
284
exponent: transactionModel.tokenDecimal ?? 18,
285
tokenSymbol: transactionModel.tokenSymbol ?? "ETH",
286
+ to: transactionModel.to,
287
);
288
}
289
lib/exchange/sideshift/sideshift_exchange_provider.dart
+1
-1
@@ -69,7 +69,7 @@ class SideShiftExchangeProvider extends ExchangeProvider {
69
final depositNetwork = _networkFor(from);
70
final settleNetwork = _networkFor(to);
71
72
- final url = "$apiBaseUrl$rangePath/$fromCurrency-$depositNetwork/$toCurrency-$settleNetwork";
72
+ final url = "$apiBaseUrl$rangePath/$fromCurrency-$depositNetwork/$toCurrency-$settleNetwork?amount=$amount";
73
74
final uri = Uri.parse(url);
75
final response = await get(uri);
lib/view_model/transaction_details_view_model.dart
+2
@@ -215,6 +215,8 @@ abstract class TransactionDetailsViewModelBase with Store {
215
StandartListItem(title: S.current.transaction_details_amount, value: tx.amountFormatted()),
216
if (tx.feeFormatted()?.isNotEmpty ?? false)
217
StandartListItem(title: S.current.transaction_details_fee, value: tx.feeFormatted()!),
218
+ if (showRecipientAddress && tx.to != null)
219
+ StandartListItem(title: S.current.transaction_details_recipient_address, value: tx.to!),
220
];
221
222
items.addAll(_items);