Add support for HBAR, RUNE, and SCRT extra info in exchange (#2411)

* Add support for HBAR, RUNE, and SCRT extra info in exchange

* remove shouldAddExtraId
This commit is contained in:
Serhii
2025-07-26 19:06:10 +03:00
committed by GitHub
parent 995a3bb750
commit 888319dd7a
29 changed files with 40 additions and 103 deletions
@@ -95,13 +95,9 @@ abstract class ExchangeTradeViewModelBase with Store {
@observable
bool isSendable;
@computed
String get extraInfo => switch (trade.from) {
CryptoCurrency.xlm => '\n\n' + S.current.xlm_extra_info,
CryptoCurrency.xrp => '\n\n' + S.current.xrp_extra_info,
CryptoCurrency.ton => '\n\n' + S.current.ton_extra_info,
_ => ''
};
String get extraInfo => trade.extraId != null && trade.extraId!.isNotEmpty
? '\n\n' + S.current.exchange_extra_info
: '';
@computed
String get pendingTransactionFiatAmountValueFormatted => sendViewModel.isFiatDisabled
@@ -203,10 +199,9 @@ abstract class ExchangeTradeViewModelBase with Store {
),
]);
if (trade.extraId != null) {
final shouldAddExtraId = trade.from == CryptoCurrency.xrp || trade.from == CryptoCurrency.xlm || trade.from == CryptoCurrency.ton;
final isExtraIdExist = trade.extraId != null && trade.extraId!.isNotEmpty;
if (shouldAddExtraId) {
if (isExtraIdExist) {
final title = trade.from == CryptoCurrency.xrp
? S.current.destination_tag
: trade.from == CryptoCurrency.xlm || trade.from == CryptoCurrency.ton
@@ -215,14 +210,12 @@ abstract class ExchangeTradeViewModelBase with Store {
items.add(
ExchangeTradeItem(
title: title,
data: '${trade.extraId}',
isCopied: true,
isReceiveDetail: !shouldAddExtraId,
isExternalSendDetail: shouldAddExtraId
),
title: title,
data: trade.extraId ?? '',
isCopied: true,
isReceiveDetail: !isExtraIdExist,
isExternalSendDetail: isExtraIdExist),
);
}
}
items.add(