mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-05-08 03:32:16 +00:00
Negate is Fixed rate mode in simpleswap
This commit is contained in:
parent
36c2702688
commit
8514887da6
1 changed files with 4 additions and 5 deletions
|
@ -20,8 +20,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider {
|
||||||
.where((i) => i != CryptoCurrency.zaddr)
|
.where((i) => i != CryptoCurrency.zaddr)
|
||||||
.map((i) => CryptoCurrency.all
|
.map((i) => CryptoCurrency.all
|
||||||
.where((i) => i != CryptoCurrency.zaddr)
|
.where((i) => i != CryptoCurrency.zaddr)
|
||||||
.map((k) => ExchangePair(from: i, to: k, reverse: true))
|
.map((k) => ExchangePair(from: i, to: k, reverse: true)))
|
||||||
.where((c) => c != null))
|
|
||||||
.expand((i) => i)
|
.expand((i) => i)
|
||||||
.toList());
|
.toList());
|
||||||
|
|
||||||
|
@ -54,12 +53,12 @@ class SimpleSwapExchangeProvider extends ExchangeProvider {
|
||||||
'currency_from': fromCurrency,
|
'currency_from': fromCurrency,
|
||||||
'currency_to': toCurrency,
|
'currency_to': toCurrency,
|
||||||
'amount': amount.toString(),
|
'amount': amount.toString(),
|
||||||
'fixed': isFixedRateMode.toString()
|
'fixed': (!isFixedRateMode).toString()
|
||||||
};
|
};
|
||||||
final uri = Uri.https(apiAuthority, getEstimatePath, params);
|
final uri = Uri.https(apiAuthority, getEstimatePath, params);
|
||||||
final response = await get(uri);
|
final response = await get(uri);
|
||||||
|
|
||||||
if (response.body == null || response.body == "null") return 0.00;
|
if (response.body == "null") return 0.00;
|
||||||
final data = json.decode(response.body) as String;
|
final data = json.decode(response.body) as String;
|
||||||
return double.parse(data);
|
return double.parse(data);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
|
@ -87,7 +86,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider {
|
||||||
"currency_from": _normalizeCryptoCurrency(_request.from),
|
"currency_from": _normalizeCryptoCurrency(_request.from),
|
||||||
"currency_to": _normalizeCryptoCurrency(_request.to),
|
"currency_to": _normalizeCryptoCurrency(_request.to),
|
||||||
"amount": _request.amount,
|
"amount": _request.amount,
|
||||||
"fixed": isFixedRateMode,
|
"fixed": !isFixedRateMode,
|
||||||
"user_refund_address": _request.refundAddress,
|
"user_refund_address": _request.refundAddress,
|
||||||
"address_to": _request.address
|
"address_to": _request.address
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue