Commit Graph

93 Commits

Author SHA1 Message Date
pezkuwichain 042d298426 fix: use Asset Hub API for custom tokens instead of relay chain 2026-02-06 11:32:45 +03:00
pezkuwichain 6ad5e151ea feat: reorganize wallet dashboard and add blockchain token lookup
- Move Recent Activity and NFTs to left column
- Move token balances to right column under action buttons
- Add Token modal now fetches asset info from blockchain
- Shows symbol, name, decimals before adding
- Search by asset ID with Enter key support
2026-02-06 11:26:25 +03:00
pezkuwichain 51976e0e2d fix: add DOT, ETH, BTC support in liquidity modals 2026-02-06 11:13:24 +03:00
pezkuwichain 5749f9a379 feat: add HEZ/DOT pool support and fix user-facing token names
- Add HEZ/DOT pool to PoolDashboard
- Display DOT, ETH, BTC instead of wDOT, wETH, wBTC to users
- Update priceOracle with correct symbol mappings
- Fix lint errors in check_all_pools.mjs
- Extract MINTABLE_ASSETS to separate file for fast refresh
2026-02-06 11:06:28 +03:00
pezkuwichain 269e963a4d feat: implement hybrid oracle AMM with CoinGecko prices
- Add priceOracle service for fetching CoinGecko prices
- Update SwapInterface to use oracle prices instead of pool reserves
- All swaps route through USDT as base currency
- Multi-hop routing for non-USDT pairs (X → USDT → Y)
- Display real-time USD prices from CoinGecko
- Auto-refresh prices every 30 seconds
2026-02-06 10:41:52 +03:00
pezkuwichain 742c3353d2 fix: remove unused events parameter in MintAssetModal 2026-02-06 10:18:08 +03:00
pezkuwichain 2756450222 feat: add wDOT, wETH, wBTC mint functionality to DEX admin panel 2026-02-06 10:10:52 +03:00
pezkuwichain 00ab3793fe fix: fetch collators from parachains and restrict CORS to production domains
- NetworkStats now queries Asset Hub and People Chain for collator data
  instead of relay chain (where collatorSelection doesn't exist)
- Restrict Edge Functions CORS to app.pezkuwichain.io domains only
- Add Access-Control-Allow-Credentials header for secure cross-origin requests
2026-02-06 06:00:01 +03:00
pezkuwichain f09950c22d fix: add decimal correction factor to PoolDashboard reserves
Same fix as TokenSwap - HEZ-USDT pool needs 1000x factor
due to mixed decimals (12 vs 6)
2026-02-05 02:26:25 +03:00
pezkuwichain cef46b373b fix: add decimal correction factor for mixed-decimal pool reserves
HEZ-USDT pool has mixed decimals (12 vs 6). The LP formula
LP = sqrt(r0 * r1) requires correction factor 10^(12-(d0+d1)/2)
to properly estimate reserves in human units.

- HEZ-USDT: factor = 1000 (fixes 1000x undercount)
- HEZ-PEZ: factor = 1 (no change needed)
2026-02-05 02:20:21 +03:00
pezkuwichain 1a82323cd4 fix: correct decimal handling in HEZ-USDT pool calculations
- Fix reserve estimation to use correct decimals (12 for HEZ, 6 for USDT)
- Store decimals in poolReserves state for AMM calculations
- Adjust output formatting based on token decimals
2026-02-05 02:14:50 +03:00
pezkuwichain e342e959f5 fix: add eslint-disable for runtime API any types 2026-02-05 01:41:19 +03:00
pezkuwichain 58d6da393e fix: TokenSwap to use native HEZ with XCM Location format
- Changed HEZ from wHEZ (asset 0) to native token (NATIVE_TOKEN_ID = -1)
- Updated pool query to use XCM MultiLocation format
- Use runtime API quotePriceExactTokensForTokens for exchange rate
- Updated swap transactions to use XCM Location paths
- Added multi-hop support for PEZ ↔ USDT through native HEZ
2026-02-05 01:31:45 +03:00
pezkuwichain 232a4d43be fix: use NATIVE_TOKEN_ID (-1) for pool matching and XCM Location for swaps
- Changed HEZ assetId from 0 to -1 (NATIVE_TOKEN_ID) for correct pool matching
- Updated swap transactions to use XCM MultiLocation format
- Added multi-hop support for PEZ ↔ USDT through HEZ
2026-02-05 01:15:26 +03:00
pezkuwichain a1df2fb6a5 fix: use Asset Hub API for wUSDT and wHEZ transfers
- wUSDT, wHEZ, and PEZ are all on Asset Hub
- Transfer was failing because code used relay chain API for wUSDT
2026-02-05 00:59:23 +03:00
pezkuwichain f32df99c1b fix: display wHEZ, wUSDT and LP tokens in AccountBalance
- Fix wUSDT balance to use Asset Hub API instead of relay chain
- Fix USDT subscription to use correct asset ID (1000)
- Add wHEZ balance display when balance > 0
- Add LP token positions display from poolAssets pallet
- Add LP token logo to public/tokens
2026-02-05 00:50:40 +03:00
pezkuwichain 51a6a39603 fix: DEX improvements - Asset Hub balance fetching and Treasury admin support
- WalletContext: Use Asset Hub API for PEZ/wHEZ/wUSDT balance queries
- AddLiquidityModal: Handle native token balance via system.account
- auth.ts: Add Treasury accounts to admin list for pool creation and minting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 23:27:36 +03:00
pezkuwichain 0f289b4767 fix: add DEVELOPMENT endpoint alias and change Total text to Toplam 2026-02-04 22:11:25 +03:00
pezkuwichain 1e2efbac99 fix: correct LP fee from 3% to 0.3%
Runtime LPFee = 3 means 3/1000 = 0.3%, not 3%.
Updated AMM calculations in TokenSwap, SwapInterface, and PoolDashboard.
2026-02-04 21:53:35 +03:00
pezkuwichain 3a94838937 fix: use Asset Hub native balance for liquidity operations
DEX (assetConversion) is on Asset Hub, but WalletContext fetches
HEZ balance from relay chain. Added separate fetch for Asset Hub
native balance when adding liquidity to native token pools.
2026-02-04 21:48:49 +03:00
pezkuwichain 3534453508 fix: correct fee percentage (3% -> 0.3%) and asset ID mapping in AddLiquidityModal 2026-02-04 20:48:12 +03:00
pezkuwichain 959c171d68 fix: remove unused AssetAccountData interface 2026-02-04 20:17:37 +03:00
pezkuwichain 2bfbbe6d1a fix: resolve DEX pool issues with XCM Location format and slippage calculation
- Fix PoolDashboard reserve fetching (was hardcoded to 0)
- Fix slippage calculation bug in AddLiquidityModal
- Add XCM Location format support for native token (-1) in all liquidity modals
- Update KNOWN_TOKENS with correct wUSDT asset ID (1000) and add NATIVE_TOKEN_ID constant
- Implement dynamic pool discovery in fetchPools() using XCM Location parsing
- Update fetchUserLPPositions() to use correct LP token ID from chain
- Add formatAssetLocation() helper to shared/utils/dex.ts
2026-02-04 20:13:26 +03:00
pezkuwichain c8fcd262c8 feat: add support for all pool combinations (wHEZ-PEZ, PEZ-USDT, wHEZ-USDT) 2026-02-04 19:32:19 +03:00
pezkuwichain c24a133fab fix: fetch real pool price using assetConversionApi.quotePriceExactTokensForTokens 2026-02-04 19:23:13 +03:00
pezkuwichain 574ee52f3b fix: use XCM Location format for native token in liquidity operations 2026-02-04 19:16:51 +03:00
pezkuwichain 4c6f74285c fix: handle native token ID (-1) in display names and fix loading state 2026-02-04 19:02:37 +03:00
pezkuwichain 1124087267 fix: use assetHubApi instead of undefined api in DEX components 2026-02-04 18:38:22 +03:00
pezkuwichain 040bbb595c fix: use assetHubApi instead of undefined api in XCMBridgeSetupModal
The checkBridgeStatus function was being called with `api` which was not
defined in the component scope. Changed to use `assetHubApi` which is
properly imported from PezkuwiContext.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 18:18:05 +03:00
pezkuwichain 9f2ca47af0 fix: force rebuild - DEX migration complete 2026-02-04 17:34:12 +03:00
pezkuwichain a1b4c469d4 fix: replace remaining api references with assetHubApi in XCMBridgeSetupModal 2026-02-04 16:18:32 +03:00
pezkuwichain 7bfa47edd0 fix: migrate remaining DEX components to Asset Hub API
- Update dex/AddLiquidityModal to use assetHubApi
- Update dex/PoolBrowser to use assetHubApi
- Update dex/SwapInterface to use assetHubApi
- Update dex/XCMBridgeSetupModal to use assetHubApi
- Fix all dependency array references
2026-02-04 15:04:25 +03:00
pezkuwichain 9b66f355f5 fix: migrate DEX components from Relay Chain to Asset Hub API
- Update PoolDashboard to use assetHubApi for pool discovery
- Update TokenSwap to use assetHubApi for swap operations
- Update AddLiquidityModal to use assetHubApi
- Update RemoveLiquidityModal (both versions) to use assetHubApi
- Use XCM Location format for pool queries (Native HEZ support)
- Fix all lint errors and dependency array warnings
2026-02-04 14:37:33 +03:00
pezkuwichain 4036ddc743 feat: add bidirectional wrap/unwrap for HEZ and wHEZ tokens
- Add tabs UI for switching between wrap (HEZ → wHEZ) and unwrap (wHEZ → HEZ)
- Display both Native HEZ and wHEZ balances
- Support tokenWrapper.wrap() and tokenWrapper.unwrap() transactions
- Show 1:1 ratio conversion preview
2026-02-04 14:21:34 +03:00
pezkuwichain c2f2de3bbb feat: add Native HEZ support for pool creation
assetConversion pallet requires pools to pair with Native token.

Changes:
- Added NATIVE_TOKEN_ID (-1) constant for relay chain HEZ
- Updated CreatePoolModal to use XCM location format for Native
- Pools can now be created: Native HEZ / PEZ, Native HEZ / wUSDT, etc.
- Fixed balance fetching for Native vs Asset tokens
2026-02-04 14:13:43 +03:00
pezkuwichain 15374dcf7b fix: use correct asset format for assetConversion pallet
assetConversion.createPool expects { Asset: id } format, not raw numbers.
This fixes pool creation on Asset Hub.
2026-02-04 14:05:42 +03:00
pezkuwichain db381c803d fix: correct wHEZ asset ID from 0 to 2
tokenWrapper pallet on Asset Hub creates wHEZ as Asset ID 2, not 0.

Asset IDs on Asset Hub:
- Asset 1: PEZ
- Asset 2: wHEZ (via tokenWrapper)
- Asset 1000: wUSDT

Updated:
- shared/constants/index.ts: KNOWN_TOKENS
- shared/lib/wallet.ts: ASSET_IDS.WHEZ default
- AccountBalance.tsx: pool queries
- InitializeHezPoolModal.tsx: balance query
2026-02-04 13:52:47 +03:00
pezkuwichain c8fef32558 feat: migrate DEX modals to Asset Hub API
DEX pallets (tokenWrapper, assets, assetConversion) are deployed on
Asset Hub teyrchain, not on the relay chain. Updated all DEX modals
to use assetHubApi instead of relay chain api:

- InitializeHezPoolModal: HEZ → wHEZ wrapping via Asset Hub
- InitializeUsdtModal: wUSDT minting via Asset Hub
- CreatePoolModal: Pool creation via Asset Hub
- XCMConfigurationWizard: Steps 5-6 use Asset Hub API

Added pallet availability checks with user-friendly error messages.
2026-02-04 13:13:24 +03:00
pezkuwichain baf91181b2 fix: add People Chain deps to AccountBalance useEffect for proper balance fetch 2026-02-04 12:40:16 +03:00
pezkuwichain 948fe2e87a fix: resolve all lint errors for CI/CD workflow
- Remove unused supabase import from AppLayout.tsx
- Replace any types with proper type assertions in XCMTeleportModal.tsx
- Remove unused events parameter from signAndSend callback
- Fix any types in PezkuwiContext.tsx debug code
- Escape apostrophe in EmailVerification.tsx
- Remove unused ArrowDownRight import from AccountBalance.tsx
2026-02-04 12:00:48 +03:00
pezkuwichain 8f2b5c7136 feat: add XCM teleport and CI/CD deployment workflow
Features:
- Add XCMTeleportModal for cross-chain HEZ transfers
- Support Asset Hub and People Chain teleports
- Add "Fund Fees" button with user-friendly tooltips
- Use correct XCM V3 format with teyrchain junction

Fixes:
- Fix PEZ transfer to use Asset Hub API
- Silence unnecessary pallet availability warnings
- Fix transaction loading performance (10 blocks limit)
- Remove Supabase admin_roles dependency

CI/CD:
- Add auto-deploy to VPS on main branch push
- Add version bumping on deploy
- Upload build artifacts for deployment
2026-02-04 11:35:25 +03:00
pezkuwichain 006be3a28f fix: use price proxy to avoid CORS and rate limits 2026-02-04 09:42:37 +03:00
pezkuwichain 52fb020bf3 fix: query PEZ balance from Asset Hub and prevent localhost WebSocket errors
- Add Asset Hub API connection for PEZ token queries (Asset ID 1 is on Asset Hub)
- Update AccountBalance to fetch PEZ balance from Asset Hub instead of main chain
- WebSocket: Only try localhost endpoints when running locally, use production
  endpoint directly when on domain
2026-02-04 09:24:03 +03:00
pezkuwichain 50331af32d feat: add CoinGecko price logic with DOT-based fallback
- HEZ price: CoinGecko direct > DOT/3 > DEX pool
- PEZ price: CoinGecko direct > DOT/10 > DEX pool
- Added AuthorizeCall signed extension for blockchain connection
- Updated @pezkuwi packages to 16.5.22 and 14.0.13
2026-01-31 18:56:28 +03:00
pezkuwichain dd1e0dc294 feat: add Telegram mini app connect for P2P access 2026-01-29 21:27:13 +03:00
pezkuwichain 3879780c14 feat: smart extension detection - only redirect to Chrome Web Store if not installed 2026-01-29 15:09:28 +03:00
pezkuwichain f23eee2fb9 feat(p2p): OKX-level security upgrade with Edge Functions
- Add process-withdraw Edge Function for blockchain withdrawals
- Update verify-deposit Edge Function with @pezkuwi/api
- Add withdrawal limits (daily/monthly) and fee system
- Add hot wallet configuration with production address
- Add admin roles for dispute resolution
- Add COMBINED SQL migration with full P2P system
- Encrypt payment details with AES-256-GCM
- Prevent TX hash reuse with UNIQUE constraint
2026-01-29 03:12:02 +03:00
pezkuwichain 2276c557e2 Fix lint: remove unused Smartphone import 2026-01-17 18:44:23 +03:00
pezkuwichain 1b29df3379 Reorganize images and update web components 2026-01-17 18:40:21 +03:00
pezkuwichain 5cb2bc1b8e Update extension references to Pezkuwi.js
- Replace "Pezkuwi Wallet" with "Pezkuwi.js" in extension references
- Consistent naming with js.pezkuwichain.io landing page
2026-01-15 11:43:11 +03:00