fix: incorrect mapping of tokens for DFX (#2348)
cyan committed
Jul 3, 2025 at 19:22 UTC
f1acc439275676085b109bae67cdf234afda1e21
1 file changed
+5
-2
lib/buy/dfx/dfx_buy_provider.dart
+5
-2
@@ -172,6 +172,11 @@ class DFXBuyProvider extends BuyProvider {
172
final responseData = jsonDecode(response.body);
173
174
if (responseData is List && responseData.isNotEmpty) {
175
+ for (final i in responseData) {
176
+ if (assetsName.toLowerCase() == i["dexName"].toString().toLowerCase()) {
177
+ return i as Map<String, dynamic>;
178
+ }
179
+ }
180
return responseData.first as Map<String, dynamic>;
181
} else if (responseData is Map<String, dynamic>) {
182
return responseData;
@@ -255,8 +260,6 @@ class DFXBuyProvider extends BuyProvider {
260
261
final action = isBuyAction ? 'buy' : 'sell';
262
258
- if (isBuyAction && cryptoCurrency != wallet.currency) return null;
259
-
263
final fiatCredentials = await fetchFiatCredentials(fiatCurrency.name.toString());
264
if (fiatCredentials['id'] == null) return null;
265