From 9052ffe429c4d285793feff74378554a545592a5 Mon Sep 17 00:00:00 2001 From: Nicholas Chikuji <61144399+chiku524@users.noreply.github.com> Date: Thu, 5 Nov 2026 21:37:22 +0000 Subject: [PATCH] fix(ux): honest create-pool success + shared Express connect Point missing-wallet CTAs at boing.express (CWS URL was a literal [REDACTED] path). Route Swap/Pools/Liquidity Connect through the same web-wallet fallback as BoingOnlyGate, and stop claiming pair listing when register was skipped. Co-authored-by: nico.builds --- frontend/src/components/BoingPoolsSection.jsx | 22 +++++-------------- frontend/src/components/BoingSwapCard.jsx | 16 +++++--------- .../src/components/BoingYourLiquidityTab.jsx | 15 ++++--------- .../components/NativeBoingCreatePoolPanel.jsx | 6 ++++- frontend/src/utils/boingWalletDiscovery.js | 13 ++++++----- 5 files changed, 27 insertions(+), 45 deletions(-) diff --git a/frontend/src/components/BoingPoolsSection.jsx b/frontend/src/components/BoingPoolsSection.jsx index 1bcacf55..f76af53c 100644 --- a/frontend/src/components/BoingPoolsSection.jsx +++ b/frontend/src/components/BoingPoolsSection.jsx @@ -5,11 +5,8 @@ import BoingPoolsTab from './BoingPoolsTab'; import BoingYourLiquidityTab from './BoingYourLiquidityTab'; import BoingLiquidityAdvanced from './BoingLiquidityAdvanced'; import { useBoingPools } from '../hooks/useBoingPools'; -import { useWallet } from '../contexts/WalletContext'; -import { BOING_NATIVE_L1_CHAIN_ID } from '../config/networks'; -import { getWindowBoingProvider, boingWalletMissingMessage } from '../utils/boingWalletDiscovery'; -import { formatBoingExpressRpcError } from '../utils/boingExpressRpcError'; import { boingSwapPairHref, parsePoolsTab } from '../utils/swapPoolsRedirect'; +import { useConnectBoingExpress } from './BoingOnlyGate'; const TABS = [ { id: 'all', label: 'All pools' }, @@ -28,7 +25,7 @@ const TABS = [ export default function BoingPoolsSection({ account = null, initialQuery = '' }) { const pools = useBoingPools(account || null); const navigate = useNavigate(); - const { connectWalletWithProvider } = useWallet(); + const { connect: connectBoingExpress } = useConnectBoingExpress(); const [searchParams, setSearchParams] = useSearchParams(); const tab = parsePoolsTab(searchParams.get('tab')); const [addFor, setAddFor] = useState(/** @type {any} */ (null)); @@ -78,18 +75,9 @@ export default function BoingPoolsSection({ account = null, initialQuery = '' }) setTab('liquidity'); return; } - const provider = getWindowBoingProvider(); - if (!provider) { - toast.error(boingWalletMissingMessage()); - return; - } - try { - await connectWalletWithProvider(provider, 'boingExpress', BOING_NATIVE_L1_CHAIN_ID); - // The page re-renders for the connected wallet; the URL carries the pool across. - setTab('liquidity', { addPool: c.poolHex }); - } catch (e) { - toast.error(formatBoingExpressRpcError(e)); - } + await connectBoingExpress(); + // The page re-renders for the connected wallet; the URL carries the pool across. + setTab('liquidity', { addPool: c.poolHex }); }; return ( diff --git a/frontend/src/components/BoingSwapCard.jsx b/frontend/src/components/BoingSwapCard.jsx index f2d02457..c239bf0b 100644 --- a/frontend/src/components/BoingSwapCard.jsx +++ b/frontend/src/components/BoingSwapCard.jsx @@ -38,6 +38,7 @@ import { WBOING_HEX, } from '../services/boingSwapQuote'; import { getWindowBoingProvider, boingWalletMissingMessage } from '../utils/boingWalletDiscovery'; +import { useConnectBoingExpress } from './BoingOnlyGate'; import { formatBoingExpressRpcError } from '../utils/boingExpressRpcError'; import { useWalletNativeValue } from '../hooks/useWalletNativeValue'; import { NATIVE_VALUE_MIN_EXPRESS_VERSION } from '../services/boingWalletNativeValue'; @@ -175,7 +176,8 @@ function TokenSelect({ side, token, tokens, balances, onPick, disabled, otherTok * @param {{ slippagePercent?: number, prefill?: { key: number, tokenIn: string, tokenOut: string } }} props */ export default function BoingSwapCard({ slippagePercent = 0.5, prefill }) { - const { chainId, walletType, isConnected, getWalletProvider, account, connectWalletWithProvider } = useWallet(); + const { chainId, walletType, isConnected, getWalletProvider, account } = useWallet(); + const { connect: connectBoingExpress } = useConnectBoingExpress(); const { indexerPickerTokens } = useBoingNativeDexIntegration(); const client = useMemo(() => getSharedBoingClient(), []); @@ -388,16 +390,8 @@ export default function BoingSwapCard({ slippagePercent = 0.5, prefill }) { const onPrimary = async () => { if (button.kind === 'connect') { - const provider = getWindowBoingProvider(); - if (!provider) { - toast.error(boingWalletMissingMessage()); - return; - } - try { - await connectWalletWithProvider(provider, 'boingExpress', BOING_NATIVE_L1_CHAIN_ID); - } catch (e) { - toast.error(formatBoingExpressRpcError(e)); - } + // Same path as header / BoingOnlyGate: extension first, then boing.express web wallet. + await connectBoingExpress(); return; } if (button.disabled) return; diff --git a/frontend/src/components/BoingYourLiquidityTab.jsx b/frontend/src/components/BoingYourLiquidityTab.jsx index 01d7e5e1..88d61a13 100644 --- a/frontend/src/components/BoingYourLiquidityTab.jsx +++ b/frontend/src/components/BoingYourLiquidityTab.jsx @@ -8,12 +8,13 @@ import { boingExpressContractCallSignSimulateSubmit } from '../services/boingExp import { formatTokenAmount, isNativeBoingId, NATIVE_FEE_RESERVE, parseTokenAmount, sanitizeAmountInput, toAmountInput } from '../services/boingSwapQuote'; import { addLiquidityPreview, pairedAmount, removeLiquidityPreview, withSlippageFloor } from '../services/boingPoolsSimple'; import { executeAddLiquidity, executeRemoveLiquidity } from '../services/boingLiquidityTx'; -import { getWindowBoingProvider, boingWalletMissingMessage } from '../utils/boingWalletDiscovery'; +import { getWindowBoingProvider } from '../utils/boingWalletDiscovery'; import { formatBoingExpressRpcError } from '../utils/boingExpressRpcError'; import { useWalletNativeValue } from '../hooks/useWalletNativeValue'; import { NATIVE_VALUE_MIN_EXPRESS_VERSION } from '../services/boingWalletNativeValue'; import BoingTokenPairIcons from './BoingTokenPairIcons'; import { PoolDetails, PRIMARY_BTN } from './BoingPoolsTab'; +import { useConnectBoingExpress } from './BoingOnlyGate'; const panel = { borderColor: 'var(--border-color)', backgroundColor: 'var(--bg-secondary)' }; const muted = { color: 'var(--text-tertiary)' }; @@ -346,7 +347,8 @@ function RemoveLiquidityPanel({ pools, card, onDone, onCancel }) { /** Your liquidity: positions (share, what you'd get back) with Add / Remove, and the add form. */ export default function BoingYourLiquidityTab({ pools, addFor, onAddForConsumed }) { - const { isConnected, account, chainId, connectWalletWithProvider } = useWallet(); + const { isConnected, account, chainId } = useWallet(); + const { connect } = useConnectBoingExpress(); const connected = Boolean(isConnected && account); const [mode, setMode] = useState(/** @type {null | { kind: 'add' | 'remove', card?: any }} */ (null)); @@ -362,15 +364,6 @@ export default function BoingYourLiquidityTab({ pools, addFor, onAddForConsumed setMode(null); pools.reload(); }; - const connect = async () => { - const provider = getWindowBoingProvider(); - if (!provider) return toast.error(boingWalletMissingMessage()); - try { - await connectWalletWithProvider(provider, 'boingExpress', BOING_NATIVE_L1_CHAIN_ID); - } catch (e) { - toast.error(formatBoingExpressRpcError(e)); - } - }; return (
diff --git a/frontend/src/components/NativeBoingCreatePoolPanel.jsx b/frontend/src/components/NativeBoingCreatePoolPanel.jsx index a4e21b88..2ec09a5c 100644 --- a/frontend/src/components/NativeBoingCreatePoolPanel.jsx +++ b/frontend/src/components/NativeBoingCreatePoolPanel.jsx @@ -574,7 +574,11 @@ export default function NativeBoingCreatePoolPanel() { style={{ borderColor: 'var(--border-color)' }} data-testid="create-pool-success" > -

Pool created. It now shows in the swap token list and on Pools.

+

+ {lastResult.registerSkipped + ? 'Pool created on-chain. Pair listing was skipped — it may not appear in Swap / Pools until an operator registers it.' + : 'Pool created. It now shows in the swap token list and on Pools.'} +