mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-24 06:48:38 +02:00
fix: incorrect restore height sometimes being set on monero (#2390)
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
@@ -297,14 +297,14 @@ class ChainflipExchangeProvider extends ExchangeProvider {
|
||||
throw Exception('Unexpected response: ${response.statusCode} / ${uri.toString()} / ${response.body}');
|
||||
}
|
||||
|
||||
final quotes = json.decode(response.body) as List<dynamic>;
|
||||
final quotes = json.decode(response.body) as List<Map<String, dynamic>>;
|
||||
|
||||
Map<String, dynamic> highestQuote = quotes.reduce((current, next) {
|
||||
final currentAmount = current['egressAmount'] as double;
|
||||
final nextAmount = next['egressAmount'] as double;
|
||||
double currentAmount = current['egressAmount'] as double;
|
||||
double nextAmount = next['egressAmount'] as double;
|
||||
|
||||
return currentAmount > nextAmount ? current : next;
|
||||
}) as Map<String, dynamic>;
|
||||
});
|
||||
|
||||
return highestQuote;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user