mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-03 12:24:19 +01:00
Fix exchange limits issue (#545)
* Allow nullable values from limits API * Handle null values in SideShift limits API response
This commit is contained in:
@@ -85,8 +85,8 @@ class ChangeNowExchangeProvider extends ExchangeProvider {
|
|||||||
|
|
||||||
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
|
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
|
||||||
return Limits(
|
return Limits(
|
||||||
min: responseJSON['minAmount'] as double,
|
min: responseJSON['minAmount'] as double?,
|
||||||
max: responseJSON['maxAmount'] as double);
|
max: responseJSON['maxAmount'] as double?);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -192,8 +192,8 @@ class SideShiftExchangeProvider extends ExchangeProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
|
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
|
||||||
final min = double.parse(responseJSON['min'] as String);
|
final min = double.tryParse(responseJSON['min'] as String? ?? '');
|
||||||
final max = double.parse(responseJSON['max'] as String);
|
final max = double.tryParse(responseJSON['max'] as String? ?? '');
|
||||||
|
|
||||||
return Limits(min: min, max: max);
|
return Limits(min: min, max: max);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user