mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
fix XOSwap pair id (#2143)
This commit is contained in:
parent
a49f1bc8c8
commit
27bfd85ba5
2 changed files with 11 additions and 2 deletions
|
@ -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));
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue