Commit Graph

123 Commits

Author SHA1 Message Date
pezkuwichain 6a33b9ccb1 fix: hide hero background image on mobile, improve responsive sizing 2026-02-16 03:19:53 +03:00
pezkuwichain 86dc8c1fcd fix: rewrite citizenship workflow to referral-based model
- Replace governance-based KYC with trustless referral workflow
- New 3-step flow: applyForCitizenship -> approveReferral -> confirmCitizenship
- Fix FOUNDER_ADDRESS (was Alice test address)
- Use applications storage instead of legacy pendingKycApplications
- Add approveReferral, cancelApplication, confirmCitizenship functions
- Rewrite KycApprovalTab as referrer approval panel (no governance)
- Fix InviteUserModal to use peopleApi for referral pallet
- Add pending approvals section to ReferralDashboard
2026-02-16 02:56:27 +03:00
pezkuwichain 59442e58ae fix: broken image paths and staking signer reconnect 2026-02-16 01:30:21 +03:00
pezkuwichain f3450d1207 feat: align frontend scoring with People Chain pallet queries
- Update staking score/tracking calls from relayApi to peopleApi
- Fix referral score to use on-chain tiered scoring with penalties
- Fix perwerde score to query studentCourses + enrollments storage
- Update Dashboard and StakingDashboard for People Chain API
2026-02-13 20:13:55 +03:00
pezkuwichain 9963a759d3 fix: fix Zagros endpoints, hide PEZ Rewards when pallet unavailable
- Remove Asset Hub and People Chain endpoints from Zagros/Development config (relay chain only)
- Default network now always mainnet
- PEZ Rewards card only renders when pallet is available on chain
- Dynamic grid layout when PEZ Rewards card is hidden
2026-02-13 18:11:24 +03:00
pezkuwichain 6fe061cef2 feat(pez-rewards): align frontend with blockchain pallet storage queries
- Fix storage query names: getCurrentEpochInfo, epochStatus, getUserTrustScoreForEpoch, getClaimedReward, getEpochRewardPool
- Add recordTrustScore() and claimPezReward() extrinsic functions
- Add EpochStatus type and epoch status display (Open/ClaimPeriod/Closed)
- Move PezRewardInfo and getPezRewards from staking.ts to scores.ts
- Add PEZ Rewards error/success messages to error-handler.ts
- Add PEZ Rewards card with Record/Claim to Dashboard, Wallet, and Staking pages
- Add recordTrustScore to TransactionHistory tracking
2026-02-13 17:37:10 +03:00
pezkuwichain b378aeb171 refactor(scores): remove frontend fallback, read all scores from blockchain
Remove all frontend staking/trust score calculation and localStorage
fallback code. All scores now read directly from People Chain pallets
(pezpallet-trust, pezpallet-referral, pezpallet-tiki). Trust pallet
computes composite score on-chain.
2026-02-13 03:14:57 +03:00
pezkuwichain 12874822fc fix(mobile): comprehensive mobile UI redesign for better UX
- Header: icon-only wallet button on mobile, fix hamburger overflow
- Dashboard: responsive tabs with flex-wrap and smaller text
- Citizens: responsive ID card layout, stack NFT badges on mobile
- BeCitizen: stack header buttons vertically on mobile
- GovernanceInterface: add scrollable tabs
- DEXDashboard: responsive admin buttons grid (2 cols on mobile)
- P2PDashboard: responsive header and scrollable tabs
- Dialog: mobile-first sizing with proper padding and max-height
- Tabs UI: base responsive classes for all tab components
- Add xs:480px breakpoint and scrollbar-hide utility
- Fix vite polyfills config to prevent initialization errors
2026-02-11 02:14:32 +03:00
pezkuwichain b173810c27 refactor: remove WalletConnect, add mobile menu with wallet button
- Remove WalletConnectModal component (WalletConnect not ready)
- Restore PezkuwiWalletButton for extension-only connection
- Hide logo on mobile to save header space
- Add hamburger menu for mobile navigation
2026-02-11 01:14:38 +03:00
pezkuwichain 11241e8252 feat: add wallet connection options and mobile navigation
- New WalletConnectModal with Extension/WalletConnect options
- Mobile detection: shows only Pezkuwi Wallet on mobile
- Deep link support for pezkuwiwallet:// scheme
- Hamburger menu for mobile navigation
- Full mobile menu with all navigation items
2026-02-11 00:41:45 +03:00
pezkuwichain fbbb0486eb fix: remove unused variables (lint errors) 2026-02-10 18:14:33 +03:00
pezkuwichain 82a6a51b22 fix: use People Chain API for tiki and identityKyc pallets
- DashboardContext: query tiki/kyc from peopleApi instead of relay api
- KycApprovalTab: use peopleApi for identityKyc.pendingKycApplications
- NewCitizenApplication: all KYC operations now use People Chain

These pallets are on People Chain, not Relay Chain. This fixes the
"mafe te tuneye" error when accessing Citizens portal.
2026-02-10 18:09:26 +03:00
pezkuwichain 90b8204c25 feat: add frontend fallback for staking and trust scores
Until runtime upgrade is deployed, calculate scores on frontend:

shared/lib/scores.ts:
- getFrontendStakingScore: Read stake from Relay Chain, track in localStorage
- getFrontendTrustScore: Calculate using pallet formula
- getAllScoresWithFallback: Combined score fetching with fallback

Formula (matching pezpallet-trust):
- weighted_sum = staking*100 + referral*300 + perwerde*300 + tiki*300
- trust_score = (staking * weighted_sum) / 100

Components updated:
- AccountBalance.tsx: Use getAllScoresWithFallback
- HeroSection.tsx: Use getTrustScoreWithFallback
2026-02-07 00:44:04 +03:00
pezkuwichain 6b26f434dd fix: query pezRewards and stakingScore from People Chain
- pezRewards pallet is on People Chain, not Relay Chain
- stakingScore pallet is also on People Chain
- Update getStakingInfo to accept optional peopleApi parameter
- Update StakingDashboard to pass peopleApi
2026-02-06 21:28:56 +03:00
pezkuwichain b0c3626e7a feat: add LP staking score and DOT/ETH/BTC tokens 2026-02-06 20:01:12 +03:00
pezkuwichain 215f492c76 fix: dynamic token dropdown based on available pools, add PEZ token 2026-02-06 19:30:33 +03:00
pezkuwichain dff6d69673 fix: use People Chain API for citizen verification, improve input UI 2026-02-06 19:21:49 +03:00
pezkuwichain 6f3c1abdca fix: make LP stake button always visible with contrasting colors 2026-02-06 16:06:51 +03:00
pezkuwichain 30ea31dd64 feat: add LP token staking with duration selection 2026-02-06 15:56:14 +03:00
pezkuwichain c0e3df9801 feat: add LP staking UI for reward pools 2026-02-06 14:54:41 +03:00
pezkuwichain b05e93cdf6 Revert "feat: add LP staking modal and reward pools creation script"
This reverts commit d81342e94d.
2026-02-06 14:47:08 +03:00
pezkuwichain d81342e94d feat: add LP staking modal and reward pools creation script 2026-02-06 14:46:11 +03:00
pezkuwichain 85a29723f3 fix: check both assets and poolAssets pallets for LP tokens, use getReserves API 2026-02-06 14:34:08 +03:00
pezkuwichain 957df59a58 fix: remove unused variable lint errors 2026-02-06 14:22:54 +03:00
pezkuwichain 0a2e38cb27 fix: use pool reserves ratio for liquidity calculation instead of swap quotes 2026-02-06 14:17:23 +03:00
pezkuwichain dcb5a2c313 fix: calculate minimum deposits based on pool ratio for Add Liquidity 2026-02-06 13:39:39 +03:00
pezkuwichain 7641c24fdd fix: fetch DOT/ETH/BTC balances from Asset Hub for Add Liquidity modal 2026-02-06 13:19:32 +03:00
pezkuwichain 0d520592a4 fix: verify asset exists on blockchain before displaying in Other Assets 2026-02-06 11:50:27 +03:00
pezkuwichain a8c75e9911 fix: exclude old USDT (asset #3) from Other Assets 2026-02-06 11:45:46 +03:00
pezkuwichain 6340830ba8 fix: exclude core tokens from Other Assets using hardcoded IDs 2026-02-06 11:38:13 +03:00
pezkuwichain 1aed7dedf8 fix: use Asset Hub API for custom tokens instead of relay chain 2026-02-06 11:32:45 +03:00
pezkuwichain 755c618fc8 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 7d1a330d4c fix: add DOT, ETH, BTC support in liquidity modals 2026-02-06 11:13:24 +03:00
pezkuwichain 842dc9d8c2 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 884d68714b 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 c08a3887be fix: remove unused events parameter in MintAssetModal 2026-02-06 10:18:08 +03:00
pezkuwichain 800b956c91 feat: add wDOT, wETH, wBTC mint functionality to DEX admin panel 2026-02-06 10:10:52 +03:00
pezkuwichain f4f50e7abf 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 5da1fbd2c6 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 22b3df16de 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 745cb81758 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 6582f9df0b fix: add eslint-disable for runtime API any types 2026-02-05 01:41:19 +03:00
pezkuwichain da3a3ff44b 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 7f5fcc95f4 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 cc46687b94 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 d82ffaca74 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 cd6da00ef8 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 6d0437a3af fix: add DEVELOPMENT endpoint alias and change Total text to Toplam 2026-02-04 22:11:25 +03:00
pezkuwichain 089e4918f1 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 e34d7245e4 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