From e2ec7332115f9c7b4d65cbceaf5485e5c363838f Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 25 Jan 2023 11:05:51 -0600 Subject: [PATCH] use _buildUri in supported_fiats and don't use compute there --- lib/services/buy/simplex/simplex_api.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/services/buy/simplex/simplex_api.dart b/lib/services/buy/simplex/simplex_api.dart index 8f4bd0bda..45b7c04a3 100644 --- a/lib/services/buy/simplex/simplex_api.dart +++ b/lib/services/buy/simplex/simplex_api.dart @@ -101,8 +101,10 @@ class SimplexAPI { Map headers = { 'Content-Type': 'application/x-www-form-urlencoded', }; - Uri url = Uri.parse( - 'https://simplex-sandbox.stackwallet.com/api.php?ROUTE=supported_fiats'); + Map data = { + 'ROUTE': 'supported_fiats', + }; + Uri url = _buildUri('api.php', data); var res = await http.post(url, headers: headers); if (res.statusCode != 200) { @@ -111,7 +113,7 @@ class SimplexAPI { } final jsonArray = jsonDecode(res.body); // TODO validate json - return await compute(_parseSupportedFiats, jsonArray); + return _parseSupportedFiats(jsonArray); } catch (e, s) { Logging.instance.log("getAvailableCurrencies exception: $e\n$s", level: LogLevel.Error);