fix XOSwap pair id (#2143)

This commit is contained in:
Serhii 2025-04-01 16:33:49 +03:00 committed by GitHub
parent a49f1bc8c8
commit 27bfd85ba5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -188,12 +188,21 @@ class XOSwapExchangeProvider extends ExchangeProvider {
try {
final uri = Uri.https(_apiAuthority, '$_apiPath$_orders');
final curFrom = await _getAssets(request.fromCurrency);
final curTo = await _getAssets(request.toCurrency);
if (curFrom == null || curTo == null) {
throw TradeNotCreatedException(description);
}
final pairId = curFrom + '_' + curTo;
final payload = {
'fromAmount': request.fromAmount,
'fromAddress': request.refundAddress,
'toAmount': request.toAmount,
'toAddress': request.toAddress,
'pairId': '${request.fromCurrency.title}_${request.toCurrency.title}',
'pairId': pairId,
};
final response = await http.post(uri, headers: _headers, body: json.encode(payload));

View file

@ -118,7 +118,7 @@ class ExchangeConfirmPage extends BasePage {
mainAxisAlignment: MainAxisAlignment.center,
children: [
(trade.provider.image?.isNotEmpty ?? false)
? Image.asset(trade.provider.image, height: 50)
? ImageUtil.getImageFromPath(imagePath: trade.provider.image, height: 50, width: 50)
: const SizedBox(),
if (!trade.provider.horizontalLogo)
Padding(