changenow api fixes

This commit is contained in:
julian 2022-10-03 17:04:59 -06:00
parent 1bd6166f2c
commit d87c9981c6

View file

@ -290,8 +290,8 @@ class ChangeNowAPI {
final json = Map<String, dynamic>.from(jsonObject as Map);
return ExchangeResponse(
value: Range(
max: Decimal.tryParse(json["maxAmount"] as String? ?? ""),
min: Decimal.tryParse(json["minAmount"] as String? ?? ""),
max: Decimal.tryParse(json["maxAmount"]?.toString() ?? ""),
min: Decimal.tryParse(json["minAmount"]?.toString() ?? ""),
),
);
} catch (e, s) {
@ -366,9 +366,13 @@ class ChangeNowAPI {
required String toTicker,
required Decimal fromAmount,
required bool reversed,
bool useRateId = true,
String? apiKey,
}) async {
Map<String, dynamic> params = {"api_key": apiKey ?? kChangeNowApiKey};
Map<String, dynamic> params = {
"api_key": apiKey ?? kChangeNowApiKey,
"useRateId": useRateId.toString(),
};
late final Uri uri;
if (reversed) {