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