mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
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
This commit is contained in:
parent
4bcf6162f1
commit
4c9c6a1eae
5 changed files with 9 additions and 1 deletions
|
@ -14,6 +14,7 @@ abstract class TransactionInfo extends Object with Keyable {
|
||||||
String fiatAmount();
|
String fiatAmount();
|
||||||
String? feeFormatted();
|
String? feeFormatted();
|
||||||
void changeFiatAmount(String amount);
|
void changeFiatAmount(String amount);
|
||||||
|
String? to;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
dynamic get keyIndex => id;
|
dynamic get keyIndex => id;
|
||||||
|
|
|
@ -14,6 +14,7 @@ class EthereumTransactionInfo extends TransactionInfo {
|
||||||
required this.isPending,
|
required this.isPending,
|
||||||
required this.date,
|
required this.date,
|
||||||
required this.confirmations,
|
required this.confirmations,
|
||||||
|
required this.to,
|
||||||
}) : this.amount = ethAmount.toInt(),
|
}) : this.amount = ethAmount.toInt(),
|
||||||
this.fee = ethFee.toInt();
|
this.fee = ethFee.toInt();
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ class EthereumTransactionInfo extends TransactionInfo {
|
||||||
final int confirmations;
|
final int confirmations;
|
||||||
final String tokenSymbol;
|
final String tokenSymbol;
|
||||||
String? _fiatAmount;
|
String? _fiatAmount;
|
||||||
|
final String? to;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String amountFormatted() =>
|
String amountFormatted() =>
|
||||||
|
@ -56,6 +58,7 @@ class EthereumTransactionInfo extends TransactionInfo {
|
||||||
isPending: data['isPending'] as bool,
|
isPending: data['isPending'] as bool,
|
||||||
confirmations: data['confirmations'] as int,
|
confirmations: data['confirmations'] as int,
|
||||||
tokenSymbol: data['tokenSymbol'] as String,
|
tokenSymbol: data['tokenSymbol'] as String,
|
||||||
|
to: data['to'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,5 +73,6 @@ class EthereumTransactionInfo extends TransactionInfo {
|
||||||
'isPending': isPending,
|
'isPending': isPending,
|
||||||
'confirmations': confirmations,
|
'confirmations': confirmations,
|
||||||
'tokenSymbol': tokenSymbol,
|
'tokenSymbol': tokenSymbol,
|
||||||
|
'to': to,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -283,6 +283,7 @@ abstract class EthereumWalletBase
|
||||||
ethFee: BigInt.from(transactionModel.gasUsed) * transactionModel.gasPrice,
|
ethFee: BigInt.from(transactionModel.gasUsed) * transactionModel.gasPrice,
|
||||||
exponent: transactionModel.tokenDecimal ?? 18,
|
exponent: transactionModel.tokenDecimal ?? 18,
|
||||||
tokenSymbol: transactionModel.tokenSymbol ?? "ETH",
|
tokenSymbol: transactionModel.tokenSymbol ?? "ETH",
|
||||||
|
to: transactionModel.to,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ class SideShiftExchangeProvider extends ExchangeProvider {
|
||||||
final depositNetwork = _networkFor(from);
|
final depositNetwork = _networkFor(from);
|
||||||
final settleNetwork = _networkFor(to);
|
final settleNetwork = _networkFor(to);
|
||||||
|
|
||||||
final url = "$apiBaseUrl$rangePath/$fromCurrency-$depositNetwork/$toCurrency-$settleNetwork";
|
final url = "$apiBaseUrl$rangePath/$fromCurrency-$depositNetwork/$toCurrency-$settleNetwork?amount=$amount";
|
||||||
|
|
||||||
final uri = Uri.parse(url);
|
final uri = Uri.parse(url);
|
||||||
final response = await get(uri);
|
final response = await get(uri);
|
||||||
|
|
|
@ -215,6 +215,8 @@ abstract class TransactionDetailsViewModelBase with Store {
|
||||||
StandartListItem(title: S.current.transaction_details_amount, value: tx.amountFormatted()),
|
StandartListItem(title: S.current.transaction_details_amount, value: tx.amountFormatted()),
|
||||||
if (tx.feeFormatted()?.isNotEmpty ?? false)
|
if (tx.feeFormatted()?.isNotEmpty ?? false)
|
||||||
StandartListItem(title: S.current.transaction_details_fee, value: tx.feeFormatted()!),
|
StandartListItem(title: S.current.transaction_details_fee, value: tx.feeFormatted()!),
|
||||||
|
if (showRecipientAddress && tx.to != null)
|
||||||
|
StandartListItem(title: S.current.transaction_details_recipient_address, value: tx.to!),
|
||||||
];
|
];
|
||||||
|
|
||||||
items.addAll(_items);
|
items.addAll(_items);
|
||||||
|
|
Loading…
Reference in a new issue