Negate is Fixed rate mode in simpleswap

OmarHatem committed Dec 6, 2022 at 15:40 UTC 8514887da6f48262b8f5ab6aed254167bf43502b
1 file changed +4 -5
lib/exchange/simpleswap/simpleswap_exchange_provider.dart
+4 -5
@@ -20,8 +20,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider {
20 .where((i) => i != CryptoCurrency.zaddr)
21 .map((i) => CryptoCurrency.all
22 .where((i) => i != CryptoCurrency.zaddr)
23 - .map((k) => ExchangePair(from: i, to: k, reverse: true))
24 - .where((c) => c != null))
23 + .map((k) => ExchangePair(from: i, to: k, reverse: true)))
24 .expand((i) => i)
25 .toList());
26
@@ -54,12 +53,12 @@ class SimpleSwapExchangeProvider extends ExchangeProvider {
53 'currency_from': fromCurrency,
54 'currency_to': toCurrency,
55 'amount': amount.toString(),
57 - 'fixed': isFixedRateMode.toString()
56 + 'fixed': (!isFixedRateMode).toString()
57 };
58 final uri = Uri.https(apiAuthority, getEstimatePath, params);
59 final response = await get(uri);
60
62 - if (response.body == null || response.body == "null") return 0.00;
61 + if (response.body == "null") return 0.00;
62 final data = json.decode(response.body) as String;
63 return double.parse(data);
64 } catch (_) {
@@ -87,7 +86,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider {
86 "currency_from": _normalizeCryptoCurrency(_request.from),
87 "currency_to": _normalizeCryptoCurrency(_request.to),
88 "amount": _request.amount,
90 - "fixed": isFixedRateMode,
89 + "fixed": !isFixedRateMode,
90 "user_refund_address": _request.refundAddress,
91 "address_to": _request.address
92 };