From 69886372660be5e204083e9e05e2dbb789a4c597 Mon Sep 17 00:00:00 2001 From: Serhii Date: Sun, 13 Nov 2022 20:06:45 +0200 Subject: [PATCH] fix fetching trade state for SideShift --- lib/exchange/sideshift/sideshift_exchange_provider.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/exchange/sideshift/sideshift_exchange_provider.dart b/lib/exchange/sideshift/sideshift_exchange_provider.dart index a732f7ef2..8cd4593c1 100644 --- a/lib/exchange/sideshift/sideshift_exchange_provider.dart +++ b/lib/exchange/sideshift/sideshift_exchange_provider.dart @@ -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); }