disable swapsxyz and stealthex (#3116)

This commit is contained in:
Omar Hatem
2026-03-21 02:12:19 +01:00
committed by GitHub
parent 9cbfeaaa86
commit 081bb8007e
5 changed files with 25 additions and 13 deletions
+15 -3
View File
@@ -599,6 +599,18 @@ Future<void> defaultSettingsMigration(
// reset force dex option only 1 time and let users pick it from the swap settings preference
await sharedPreferences.setBool(PreferencesKey.forceDecentralizedExchanges, false);
break;
case 62:
await _changeExchangeProviderAvailability(
sharedPreferences,
providerName: "Swaps.XYZ",
enabled: false,
);
_changeExchangeProviderAvailability(
sharedPreferences,
providerName: "StealthEX",
enabled: false,
);
break;
default:
break;
}
@@ -721,15 +733,15 @@ String _getDefaultNodeUri(WalletType type) {
}
}
void _changeExchangeProviderAvailability(SharedPreferences sharedPreferences,
{required String providerName, required bool enabled}) {
Future<void> _changeExchangeProviderAvailability(SharedPreferences sharedPreferences,
{required String providerName, required bool enabled}) async {
final Map<String, dynamic> exchangeProvidersSelection =
json.decode(sharedPreferences.getString(PreferencesKey.exchangeProvidersSelection) ?? "{}")
as Map<String, dynamic>;
exchangeProvidersSelection[providerName] = enabled;
sharedPreferences.setString(
await sharedPreferences.setString(
PreferencesKey.exchangeProvidersSelection,
json.encode(exchangeProvidersSelection),
);