From 6ad9cb24fe8bc303977e749be3c32e6222da26bf Mon Sep 17 00:00:00 2001 From: gerlofvanek Date: Wed, 18 Jun 2025 14:43:11 +0200 Subject: [PATCH 1/3] GUI: Various fixes. --- basicswap/static/js/modules/coin-manager.js | 13 +++++++++++++ basicswap/static/js/swaps_in_progress.js | 4 ++-- basicswap/templates/bids_available.html | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/basicswap/static/js/modules/coin-manager.js b/basicswap/static/js/modules/coin-manager.js index 7d0a1e0..773d5bf 100644 --- a/basicswap/static/js/modules/coin-manager.js +++ b/basicswap/static/js/modules/coin-manager.js @@ -203,6 +203,19 @@ const CoinManager = (function() { return coin ? coin.symbol : null; }, getDisplayName: function(identifier) { + if (!identifier) return null; + + const normalizedId = identifier.toString().toLowerCase().trim(); + if (normalizedId === 'particl anon' || normalizedId === 'part_anon' || normalizedId === 'particl_anon') { + return 'Particl Anon'; + } + if (normalizedId === 'particl blind' || normalizedId === 'part_blind' || normalizedId === 'particl_blind') { + return 'Particl Blind'; + } + if (normalizedId === 'litecoin mweb' || normalizedId === 'ltc_mweb' || normalizedId === 'litecoin_mweb') { + return 'Litecoin MWEB'; + } + const coin = getCoinByAnyIdentifier(identifier); return coin ? coin.displayName : null; }, diff --git a/basicswap/static/js/swaps_in_progress.js b/basicswap/static/js/swaps_in_progress.js index 6fc8ff2..5e8dc5d 100644 --- a/basicswap/static/js/swaps_in_progress.js +++ b/basicswap/static/js/swaps_in_progress.js @@ -293,8 +293,8 @@ const createSwapTableRow = async (swap) => { const identity = await IdentityManager.getIdentityData(swap.addr_from); const uniqueId = `${swap.bid_id}_${swap.created_at}`; - const fromSymbol = window.CoinManager.getSymbol(swap.coin_from) || swap.coin_from; - const toSymbol = window.CoinManager.getSymbol(swap.coin_to) || swap.coin_to; + const fromSymbol = window.CoinManager.getDisplayName(swap.coin_from) || swap.coin_from; + const toSymbol = window.CoinManager.getDisplayName(swap.coin_to) || swap.coin_to; const timeColor = getTimeStrokeColor(swap.expire_at); const fromAmount = parseFloat(swap.amount_from) || 0; const toAmount = parseFloat(swap.amount_to) || 0; diff --git a/basicswap/templates/bids_available.html b/basicswap/templates/bids_available.html index 531611b..76b9c1e 100644 --- a/basicswap/templates/bids_available.html +++ b/basicswap/templates/bids_available.html @@ -54,7 +54,7 @@
- You Get + You Receive
From dd53c8e76da71d6e77fd0cbd0bac70f0019ba9ab Mon Sep 17 00:00:00 2001 From: gerlofvanek Date: Wed, 18 Jun 2025 15:40:32 +0200 Subject: [PATCH 2/3] Update test_swap_direction.py --- tests/basicswap/selenium/test_swap_direction.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/basicswap/selenium/test_swap_direction.py b/tests/basicswap/selenium/test_swap_direction.py index 557607a..c2cd4f8 100644 --- a/tests/basicswap/selenium/test_swap_direction.py +++ b/tests/basicswap/selenium/test_swap_direction.py @@ -319,14 +319,14 @@ def test_swap_dir(driver): except Exception as e: print(e) time.sleep(2) - assert "PART" in bid_rows[bid_1_id][0] + assert "Particl" in bid_rows[bid_1_id][0] assert float(bid_rows[bid_1_id][1]) == 1.0 - assert "XMR" in bid_rows[bid_1_id][2] + assert "Monero" in bid_rows[bid_1_id][2] assert float(bid_rows[bid_1_id][3]) == 2.0 - assert "PART" in bid_rows[bid_3_id][0] + assert "Particl" in bid_rows[bid_3_id][0] assert float(bid_rows[bid_3_id][1]) == 6.0 - assert "XMR" in bid_rows[bid_3_id][2] + assert "Monero" in bid_rows[bid_3_id][2] assert float(bid_rows[bid_3_id][3]) == 5.0 logger.info(f"Waiting for {node2_url}/active") @@ -362,14 +362,14 @@ def test_swap_dir(driver): except Exception as e: print(e) time.sleep(2) - assert "XMR" in bid_rows[bid_1_id][0] + assert "Monero" in bid_rows[bid_1_id][0] assert float(bid_rows[bid_1_id][1]) == 2.0 - assert "PART" in bid_rows[bid_1_id][2] + assert "Particl" in bid_rows[bid_1_id][2] assert float(bid_rows[bid_1_id][3]) == 1.0 - assert "XMR" in bid_rows[bid_3_id][0] + assert "Monero" in bid_rows[bid_3_id][0] assert float(bid_rows[bid_3_id][1]) == 5.0 - assert "PART" in bid_rows[bid_3_id][2] + assert "Particl" in bid_rows[bid_3_id][2] assert float(bid_rows[bid_3_id][3]) == 6.0 print("Test Passed!") From 0e19f4139c201c569aa53edc8c146f8de43eb01c Mon Sep 17 00:00:00 2001 From: gerlofvanek Date: Wed, 18 Jun 2025 17:10:18 +0200 Subject: [PATCH 3/3] Fix bid modal show no value when amounts are empty. --- basicswap/templates/bid.html | 58 +++++++++++++++++++++++++++++--- basicswap/templates/bid_xmr.html | 58 +++++++++++++++++++++++++++++--- 2 files changed, 106 insertions(+), 10 deletions(-) diff --git a/basicswap/templates/bid.html b/basicswap/templates/bid.html index 1ab3a4e..3bd66dc 100644 --- a/basicswap/templates/bid.html +++ b/basicswap/templates/bid.html @@ -556,10 +556,39 @@