fix fetching trade state for SideShift

This commit is contained in:
Serhii 2022-11-13 20:06:45 +02:00
parent 1efced7607
commit 6988637266

View file

@ -250,8 +250,10 @@ class SideShiftExchangeProvider extends ExchangeProvider {
final deposits = responseJSON['deposits'] as List?;
TradeState? state;
if (deposits != null && deposits.isNotEmpty) {
final status = deposits[0]['status'] as String;
if (deposits != null && deposits.isEmpty) {
state = TradeState.deserialize(raw: 'created');
} else {
final status = deposits?[0]['status'] as String;
state = TradeState.deserialize(raw: status);
}