diff --git a/lib/exchange/simpleswap/simpleswap_exchange_provider.dart b/lib/exchange/simpleswap/simpleswap_exchange_provider.dart index f1183166b..c6e1baeea 100644 --- a/lib/exchange/simpleswap/simpleswap_exchange_provider.dart +++ b/lib/exchange/simpleswap/simpleswap_exchange_provider.dart @@ -35,7 +35,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider { @override ExchangeProviderDescription get description => ExchangeProviderDescription.simpleSwap; - + @override Future calculateAmount( {required CryptoCurrency from, @@ -61,7 +61,6 @@ class SimpleSwapExchangeProvider extends ExchangeProvider { if (response.body == null || response.body == "null") return 0.00; final data = json.decode(response.body) as String; - return double.parse(data); } catch (_) { return 0.00; @@ -79,7 +78,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider { @override Future createTrade({required TradeRequest request, required bool isFixedRateMode}) async { final _request = request as SimpleSwapRequest; - final headers = { + final headers = { 'Content-Type': 'application/json'}; final params = { 'api_key': apiKey, @@ -111,7 +110,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider { final id = responseJSON['id'] as String; final inputAddress = responseJSON['address_from'] as String; final settleAddress = responseJSON['user_refund_address'] as String; - + final extraId = responseJSON['extra_id_from'] as String?; return Trade( id: id, provider: description, @@ -119,6 +118,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider { to: _request.to, inputAddress: inputAddress, refundAddress: settleAddress, + extraId: extraId, state: TradeState.created, amount: _request.amount, createdAt: DateTime.now(), @@ -188,6 +188,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider { final to = CryptoCurrency.fromString(toCurrency); final inputAddress = responseJSON['address_from'] as String; final expectedSendAmount = responseJSON['expected_amount'].toString(); + final extraId = responseJSON['extra_id_from'] as String?; final status = responseJSON['status'] as String; final state = TradeState.deserialize(raw: status); @@ -195,6 +196,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider { id: id, from: from, to: to, + extraId: extraId, provider: description, inputAddress: inputAddress, amount: expectedSendAmount,