fix: incorrect restore height sometimes being set on monero (#2390)

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
cyan
2025-07-17 06:41:34 +03:00
committed by GitHub
co-authored by Omar Hatem
parent c5bf8d1363
commit 0da7047c2a
3 changed files with 26 additions and 11 deletions
@@ -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;
}