mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
skip swaptrade if trade is larger than 2k
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user