fix: incorrect mapping of tokens for DFX (#2348)

This commit is contained in:
cyan
2025-07-03 20:22:50 +03:00
committed by GitHub
parent 182bd2937b
commit f1acc43927
+5 -2
View File
@@ -172,6 +172,11 @@ class DFXBuyProvider extends BuyProvider {
final responseData = jsonDecode(response.body);
if (responseData is List && responseData.isNotEmpty) {
for (final i in responseData) {
if (assetsName.toLowerCase() == i["dexName"].toString().toLowerCase()) {
return i as Map<String, dynamic>;
}
}
return responseData.first as Map<String, dynamic>;
} else if (responseData is Map<String, dynamic>) {
return responseData;
@@ -255,8 +260,6 @@ class DFXBuyProvider extends BuyProvider {
final action = isBuyAction ? 'buy' : 'sell';
if (isBuyAction && cryptoCurrency != wallet.currency) return null;
final fiatCredentials = await fetchFiatCredentials(fiatCurrency.name.toString());
if (fiatCredentials['id'] == null) return null;