mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-23 19:05:51 +00:00
use _buildUri in supported_fiats and don't use compute there
This commit is contained in:
parent
61748b4b2f
commit
e2ec733211
1 changed files with 5 additions and 3 deletions
|
@ -101,8 +101,10 @@ class SimplexAPI {
|
||||||
Map<String, String> headers = {
|
Map<String, String> headers = {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
||||||
};
|
};
|
||||||
Uri url = Uri.parse(
|
Map<String, String> data = {
|
||||||
'https://simplex-sandbox.stackwallet.com/api.php?ROUTE=supported_fiats');
|
'ROUTE': 'supported_fiats',
|
||||||
|
};
|
||||||
|
Uri url = _buildUri('api.php', data);
|
||||||
|
|
||||||
var res = await http.post(url, headers: headers);
|
var res = await http.post(url, headers: headers);
|
||||||
if (res.statusCode != 200) {
|
if (res.statusCode != 200) {
|
||||||
|
@ -111,7 +113,7 @@ class SimplexAPI {
|
||||||
}
|
}
|
||||||
final jsonArray = jsonDecode(res.body); // TODO validate json
|
final jsonArray = jsonDecode(res.body); // TODO validate json
|
||||||
|
|
||||||
return await compute(_parseSupportedFiats, jsonArray);
|
return _parseSupportedFiats(jsonArray);
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
Logging.instance.log("getAvailableCurrencies exception: $e\n$s",
|
Logging.instance.log("getAvailableCurrencies exception: $e\n$s",
|
||||||
level: LogLevel.Error);
|
level: LogLevel.Error);
|
||||||
|
|
Loading…
Reference in a new issue