mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02: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>;
|
||||
return Limits(
|
||||
min: responseJSON['minAmount'] as double,
|
||||
max: responseJSON['maxAmount'] as double);
|
||||
min: responseJSON['minAmount'] as double?,
|
||||
max: responseJSON['maxAmount'] as double?);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -192,8 +192,8 @@ class SideShiftExchangeProvider extends ExchangeProvider {
|
||||
}
|
||||
|
||||
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
|
||||
final min = double.parse(responseJSON['min'] as String);
|
||||
final max = double.parse(responseJSON['max'] as String);
|
||||
final min = double.tryParse(responseJSON['min'] as String? ?? '');
|
||||
final max = double.tryParse(responseJSON['max'] as String? ?? '');
|
||||
|
||||
return Limits(min: min, max: max);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user