Cw 807 add extra fields for xrp and xlm exchanges (#1869)

* show extra id for xrp/xlm Stealth

* extra id for xrp/xlm LetsExchange

* extra id xrp/xml for Sideshift and Trocador

* fix Exolix min amount issue

* fix extra id ui
This commit is contained in:
Serhii
2024-12-13 01:24:37 +02:00
committed by GitHub
parent df6ea551aa
commit 489a409bea
11 changed files with 102 additions and 27 deletions
@@ -146,7 +146,7 @@ abstract class ExchangeTradeViewModelBase with Store {
void _updateItems() {
final tagFrom =
tradesStore.trade!.from.tag != null ? '${tradesStore.trade!.from.tag}' + ' ' : '';
tradesStore.trade!.from.tag != null ? '${tradesStore.trade!.from.tag}' + ' ' : '';
final tagTo = tradesStore.trade!.to.tag != null ? '${tradesStore.trade!.to.tag}' + ' ' : '';
items.clear();
@@ -159,16 +159,6 @@ abstract class ExchangeTradeViewModelBase with Store {
),
);
if (trade.extraId != null) {
final title = trade.from == CryptoCurrency.xrp
? S.current.destination_tag
: trade.from == CryptoCurrency.xlm
? S.current.memo
: S.current.extra_id;
items.add(ExchangeTradeItem(title: title, data: '${trade.extraId}', isCopied: false));
}
items.addAll([
ExchangeTradeItem(
title: S.current.amount,
@@ -176,7 +166,7 @@ abstract class ExchangeTradeViewModelBase with Store {
isCopied: true,
),
ExchangeTradeItem(
title: S.current.estimated_receive_amount +':',
title: S.current.estimated_receive_amount + ':',
data: '${tradesStore.trade?.receiveAmount} ${trade.to}',
isCopied: true,
),
@@ -185,12 +175,25 @@ abstract class ExchangeTradeViewModelBase with Store {
data: trade.inputAddress ?? '',
isCopied: true,
),
]);
if (trade.extraId != null) {
final title = trade.from == CryptoCurrency.xrp
? S.current.destination_tag
: trade.from == CryptoCurrency.xlm
? S.current.memo
: S.current.extra_id;
items.add(ExchangeTradeItem(title: title, data: '${trade.extraId}', isCopied: true));
}
items.add(
ExchangeTradeItem(
title: S.current.arrive_in_this_address('${tradesStore.trade!.to}', tagTo) + ':',
data: trade.payoutAddress ?? '',
isCopied: true,
),
]);
);
}
static bool _checkIfCanSend(TradesStore tradesStore, WalletBase wallet) {
@@ -153,6 +153,7 @@ abstract class TradeDetailsViewModelBase with Store {
items.add(TradeDetailsListCardItem.tradeDetails(
id: trade.id,
extraId: trade.extraId,
createdAt: trade.createdAt != null ? dateFormat.format(trade.createdAt!) : '',
from: trade.from,
to: trade.to,