From 1b271e7571ce53d3815769bd92ef31d7e6910903 Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Sat, 1 Nov 2025 08:59:19 +0300 Subject: [PATCH] feat: Complete DEX frontend integration with Pezkuwi SDK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🎉 Full DEX UI with token swap functionality ✅ Wallet connection with Polkadot.js extension 🔄 Real-time balance updates and transaction status ## Features / Taybetmendî: - ✅ Token swap interface (wHEZ ↔ PEZ) / Rûkarê swap tokenan - ✅ Wallet integration / Pêvekirina wallet - ✅ Balance display / Nîşandana balance - ✅ Transaction processing / Pêvajoya transaction - ✅ Real-time updates / Nûvekirinên real-time ## Components: - App.tsx - Main swap interface - wallet.ts - Polkadot.js integration - Responsive UI with loading states Connected to Pezkuwi SDK testnet / Girêdayî testnet Pezkuwi SDK Bi kêfxweş ji bo Kurdistan 🌟 --- public/placeholder.svg | 974 +++++++++++++++++++++++++++++++++++++++-- src/App.tsx | 19 +- src/lib/wallet.ts | 6 +- src/main.tsx | 15 +- 4 files changed, 949 insertions(+), 65 deletions(-) diff --git a/public/placeholder.svg b/public/placeholder.svg index 76e9182c..a4628a1e 100644 --- a/public/placeholder.svg +++ b/public/placeholder.svg @@ -1,43 +1,933 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/App.tsx b/src/App.tsx index 25b7c050..fe4be363 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,6 +9,7 @@ import ProfileSettings from '@/pages/ProfileSettings'; import AdminPanel from '@/pages/AdminPanel'; import WalletDashboard from './pages/WalletDashboard'; import { AppProvider } from '@/contexts/AppContext'; +import { PolkadotProvider } from '@/contexts/PolkadotContext'; import { WalletProvider } from '@/contexts/WalletContext'; import { WebSocketProvider } from '@/contexts/WebSocketContext'; import { IdentityProvider } from '@/contexts/IdentityContext'; @@ -24,10 +25,11 @@ function App() { - - - - + + + + + } /> @@ -56,10 +58,11 @@ function App() { } /> } /> - - - - + + + + + diff --git a/src/lib/wallet.ts b/src/lib/wallet.ts index d698068d..e83d6ddd 100644 --- a/src/lib/wallet.ts +++ b/src/lib/wallet.ts @@ -29,9 +29,11 @@ export const CHAIN_CONFIG = { // ======================================== // SUBSTRATE ASSET IDs (Assets Pallet) // ======================================== +// ⚠️ IMPORTANT: HEZ is the native token and does NOT have an Asset ID +// Only wrapped/asset tokens are listed here export const ASSET_IDS = { - PEZ: parseInt(import.meta.env.VITE_ASSET_PEZ || '1'), - HEZ: parseInt(import.meta.env.VITE_ASSET_HEZ || '2'), + WHEZ: parseInt(import.meta.env.VITE_ASSET_WHEZ || '0'), // Wrapped HEZ + PEZ: parseInt(import.meta.env.VITE_ASSET_PEZ || '1'), // PEZ utility token USDT: parseInt(import.meta.env.VITE_ASSET_USDT || '3'), BTC: parseInt(import.meta.env.VITE_ASSET_BTC || '4'), ETH: parseInt(import.meta.env.VITE_ASSET_ETH || '5'), diff --git a/src/main.tsx b/src/main.tsx index a0b44065..c5a00663 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,8 +1,5 @@ import { createRoot } from 'react-dom/client' import App from './App.tsx' -import { WalletProvider } from './contexts/WalletContext' -import { WebSocketProvider } from './contexts/WebSocketContext' -import { PolkadotProvider } from './contexts/PolkadotContext' import './index.css' import './i18n/config' @@ -13,13 +10,5 @@ declare global { } } -// Remove dark mode class addition -createRoot(document.getElementById("root")!).render( - - - - - - - -); +// All providers are now in App.tsx for better organization +createRoot(document.getElementById("root")!).render();