From c8fcd262c82dadfcef539a4e10e862f975aa21da Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Wed, 4 Feb 2026 19:32:19 +0300 Subject: [PATCH] feat: add support for all pool combinations (wHEZ-PEZ, PEZ-USDT, wHEZ-USDT) --- web/src/components/AddLiquidityModal.tsx | 8 +++++--- web/src/components/PoolDashboard.tsx | 9 +++++++-- web/src/components/RemoveLiquidityModal.tsx | 5 +++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/web/src/components/AddLiquidityModal.tsx b/web/src/components/AddLiquidityModal.tsx index a7951188..7d2f4140 100644 --- a/web/src/components/AddLiquidityModal.tsx +++ b/web/src/components/AddLiquidityModal.tsx @@ -26,9 +26,10 @@ interface Balances { [key: string]: number; } -// Helper to get display name (users see HEZ not wHEZ, PEZ, USDT not wUSDT) +// Helper to get display name for tokens const getDisplayName = (assetId: number): string => { - if (assetId === -1 || assetId === ASSET_IDS.WHEZ || assetId === 0 || assetId === 2) return 'HEZ'; + if (assetId === -1) return 'HEZ'; // Native HEZ from relay chain + if (assetId === ASSET_IDS.WHEZ || assetId === 2) return 'wHEZ'; // Wrapped HEZ if (assetId === ASSET_IDS.PEZ || assetId === 1) return 'PEZ'; if (assetId === ASSET_IDS.WUSDT || assetId === 1000) return 'USDT'; return getAssetSymbol(assetId); @@ -36,7 +37,8 @@ const getDisplayName = (assetId: number): string => { // Helper to get balance key for the asset const getBalanceKey = (assetId: number): string => { - if (assetId === -1 || assetId === ASSET_IDS.WHEZ || assetId === 0 || assetId === 2) return 'HEZ'; + if (assetId === -1) return 'HEZ'; // Native HEZ + if (assetId === ASSET_IDS.WHEZ || assetId === 2) return 'wHEZ'; // Wrapped HEZ if (assetId === ASSET_IDS.PEZ || assetId === 1) return 'PEZ'; if (assetId === ASSET_IDS.WUSDT || assetId === 1000) return 'USDT'; return getAssetSymbol(assetId); diff --git a/web/src/components/PoolDashboard.tsx b/web/src/components/PoolDashboard.tsx index e8c261f3..2efbb651 100644 --- a/web/src/components/PoolDashboard.tsx +++ b/web/src/components/PoolDashboard.tsx @@ -69,12 +69,17 @@ const PoolDashboard = () => { const discoverPools = async () => { try { - // Pools must pair with Native token (relay chain HEZ) - // Valid pools: Native HEZ / PEZ, Native HEZ / wUSDT, Native HEZ / wHEZ + // All possible pool combinations const possiblePools: Array<[number, number]> = [ + // Native HEZ pools [NATIVE_TOKEN_ID, ASSET_IDS.PEZ], // Native HEZ / PEZ [NATIVE_TOKEN_ID, ASSET_IDS.WUSDT], // Native HEZ / wUSDT [NATIVE_TOKEN_ID, ASSET_IDS.WHEZ], // Native HEZ / wHEZ + // wHEZ pools + [ASSET_IDS.WHEZ, ASSET_IDS.PEZ], // wHEZ / PEZ + [ASSET_IDS.WHEZ, ASSET_IDS.WUSDT], // wHEZ / wUSDT + // PEZ pools + [ASSET_IDS.PEZ, ASSET_IDS.WUSDT], // PEZ / wUSDT ]; const existingPools: Array<[number, number]> = []; diff --git a/web/src/components/RemoveLiquidityModal.tsx b/web/src/components/RemoveLiquidityModal.tsx index bad9b759..84018a60 100644 --- a/web/src/components/RemoveLiquidityModal.tsx +++ b/web/src/components/RemoveLiquidityModal.tsx @@ -7,9 +7,10 @@ import { Button } from '@/components/ui/button'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { ASSET_IDS, getAssetSymbol } from '@pezkuwi/lib/wallet'; -// Helper to get display name for tokens (users see HEZ not wHEZ, USDT not wUSDT) +// Helper to get display name for tokens const getDisplayTokenName = (assetId: number): string => { - if (assetId === -1 || assetId === ASSET_IDS.WHEZ || assetId === 0 || assetId === 2) return 'HEZ'; + if (assetId === -1) return 'HEZ'; // Native HEZ from relay chain + if (assetId === ASSET_IDS.WHEZ || assetId === 2) return 'wHEZ'; // Wrapped HEZ if (assetId === ASSET_IDS.PEZ || assetId === 1) return 'PEZ'; if (assetId === ASSET_IDS.WUSDT || assetId === 1000) return 'USDT'; return getAssetSymbol(assetId);