skip swaptrade if trade is larger than 2k

This commit is contained in:
OmarHatem
2025-09-23 13:21:28 +03:00
parent e4726c2242
commit bbb9246c5c
@@ -669,12 +669,20 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
if (limitsState is LimitsLoadedSuccessfully) {
if (double.tryParse(amount) == null) continue;
if (limits.min != null && double.parse(amount) < limits.min!)
if (limits.min != null && double.parse(amount) < limits.min!) {
continue;
else if (limits.max != null && double.parse(amount) > limits.max!)
} else if (limits.max != null && double.parse(amount) > limits.max!) {
continue;
else {
} else {
try {
if (provider is SwapTradeExchangeProvider) {
final destinationAmount = (fiatConversionStore.prices[request.toCurrency] ?? 0.00) * (double.tryParse(request.toAmount) ?? 0.00);
final sendingAmount = (fiatConversionStore.prices[request.fromCurrency] ?? 0.00) * (double.tryParse(request.fromAmount) ?? 0.00);
if (destinationAmount > 2000 || sendingAmount > 2000) {
continue;
}
}
tradeState = TradeIsCreating();
final trade = await provider.createTrade(
request: request,