fix XOSwap pair id (#2143)

Serhii committed Apr 1, 2025 at 16:33 UTC 27bfd85ba504f7a0be6cb05467da6e83aa3a81b9
2 files changed +11 -2
lib/exchange/provider/xoswap_exchange_provider.dart
+10 -1
@@ -188,12 +188,21 @@ class XOSwapExchangeProvider extends ExchangeProvider {
188 try {
189 final uri = Uri.https(_apiAuthority, '$_apiPath$_orders');
190
191 + final curFrom = await _getAssets(request.fromCurrency);
192 + final curTo = await _getAssets(request.toCurrency);
193 +
194 + if (curFrom == null || curTo == null) {
195 + throw TradeNotCreatedException(description);
196 + }
197 +
198 + final pairId = curFrom + '_' + curTo;
199 +
200 final payload = {
201 'fromAmount': request.fromAmount,
202 'fromAddress': request.refundAddress,
203 'toAmount': request.toAmount,
204 'toAddress': request.toAddress,
196 - 'pairId': '${request.fromCurrency.title}_${request.toCurrency.title}',
205 + 'pairId': pairId,
206 };
207
208 final response = await http.post(uri, headers: _headers, body: json.encode(payload));
lib/src/screens/exchange_trade/exchange_confirm_page.dart
+1 -1
@@ -118,7 +118,7 @@ class ExchangeConfirmPage extends BasePage {
118 mainAxisAlignment: MainAxisAlignment.center,
119 children: [
120 (trade.provider.image?.isNotEmpty ?? false)
121 - ? Image.asset(trade.provider.image, height: 50)
121 + ? ImageUtil.getImageFromPath(imagePath: trade.provider.image, height: 50, width: 50)
122 : const SizedBox(),
123 if (!trade.provider.horizontalLogo)
124 Padding(