mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix: incorrect mapping of tokens for DFX (#2348)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user