Commit Graph

71 Commits

Author SHA1 Message Date
Claude 7e4011e615 Complete modern forum UI with admin announcements and moderation
- Redesigned ForumOverview with modern, professional UI
- Added admin announcements banner with 4 priority types (info/warning/success/critical)
- Implemented upvote/downvote system with real-time updates
- Added forum statistics dashboard showing discussions, categories, users, replies
- Created category grid with visual icons and discussion counts
- Enhanced discussion cards with pin/lock/trending badges
- Integrated search, filtering, and sorting functionality
- Added comprehensive moderation panel with:
  - Reports queue management
  - Auto-moderation settings with AI sentiment analysis
  - User management with warn/suspend/ban actions
  - Moderation stats dashboard
- Created useForum hook with real-time Supabase subscriptions
- All data connected to Supabase with RLS policies for security

This completes the modern forum implementation as requested.
2025-11-14 01:19:11 +00:00
Claude e1d4d9d8a2 Integrate live blockchain data for governance features
Added:
- useGovernance hook: Fetches live proposals and referenda from blockchain
- useTreasury hook: Fetches live treasury balance and proposals
- TreasuryOverview: Now uses real blockchain data with loading/error states
- Forum database schema: Admin announcements, categories, discussions, replies, reactions

Features:
- Live data badge shows active blockchain connection
- Automatic refresh every 30 seconds for treasury data
- Secure RLS policies for forum access control
- Admin announcements system with priority and expiry
- Forum reactions (upvote/downvote) support

Next: Complete forum UI with admin banner and moderation panel
2025-11-14 01:10:35 +00:00
Claude 8f5dd3814e Apply Kurdistan colors to Pezkuwi SDK UI branding
Changes:
- Update Pezkuwi endpoint color to Kurdistan Green (Kesk: #00A94F)
- Document complete Kurdistan color palette in README:
  * Kesk (Green): #00A94F - Primary color
  * Sor (Red): #EE2A35 - Accent color
  * Zer (Gold): #FFD700 - Secondary accent
  * Spi (White): #FFFFFF - Backgrounds
  * Black: #000000 - Text
- Add comprehensive logo update instructions
- Add TODO comment for logo replacement after build:images

Next step: Replace pezkuwichain_logo.png and run yarn build:images
2025-11-14 00:57:39 +00:00
Claude c71ddb6e0d Add Pezkuwi SDK UI - Polkadot.js Apps clone
- Clone Polkadot.js Apps repository
- Update package.json with Pezkuwi branding
- Add Pezkuwi endpoint to production chains (wss://pezkuwichain.app:9944)
- Create comprehensive README for SDK UI
- Set up project structure with all packages

Next steps:
- Apply Kurdistan colors (Kesk, Sor, Zer, Spi + Black) to UI theme
- Replace logos with Pezkuwi branding
- Test build and deployment
2025-11-14 00:55:17 +00:00
Claude c48ded7ff2 Reorganize repository into monorepo structure
Restructured the project to support multiple frontend applications:
- Move web app to web/ directory
- Create pezkuwi-sdk-ui/ for Polkadot SDK clone (planned)
- Create mobile/ directory for mobile app development
- Add shared/ directory with common utilities, types, and blockchain code
- Update README.md with comprehensive documentation
- Remove obsolete DKSweb/ directory

This monorepo structure enables better code sharing and organized
development across web, mobile, and SDK UI projects.
2025-11-14 00:46:35 +00:00
pezkuwichain bb3d9aeb29 Track ALL wallet operations in transaction history
Fixed issue: Transaction history only showed transfers (send/receive),
missing staking, swaps, and other wallet operations.

Now tracks:
- Balances: transfer, transferKeepAlive
- Assets: transfer (PEZ, USDT, etc)
- Staking: bond, bondExtra, unbond, nominate, withdrawUnbonded, chill
- DEX: swap, addLiquidity, removeLiquidity
- StakingScore: startTracking
- PezRewards: claimReward

Changes made to both:
- TransactionHistory component (full history modal)
- WalletDashboard Recent Activity section (last 5 transactions)

Now users see complete wallet activity, not just transfers!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 03:28:41 +03:00
pezkuwichain 1c0fd89482 Improve WalletDashboard with live blockchain data
- Removed Pool button (was redirecting to home page - confusing UX)
- Changed button grid from 4 to 3 columns (Send, Receive, History)
- Made Recent Activity section functional with live blockchain data
- Fetches last 5 transactions from blockchain (balances.transfer & assets.transfer)
- Displays transaction details: type, amount, block number, timestamp
- Added refresh button for Recent Activity section
- Shows incoming (green) vs outgoing (yellow) transactions with icons

Benefits:
- No more confusing Pool button navigation
- Users see real transaction history instead of placeholder
- Cleaner UI with 3-column button layout
- Live data from blockchain ensures accuracy

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 03:21:00 +03:00
pezkuwichain 5496de1488 Remove redundant swap and pool pages (Phase 1.2)
- Removed /pool route from App.tsx (redundant with DEX Pools tab)
- Deleted pages/PoolDashboard.tsx (functionality in DEXDashboard)
- Removed TokenSwap modal from AppLayout (redundant with DEX Swap tab)
- Updated WalletDashboard Pool button to navigate to home page

Benefits:
- Reduces code duplication
- Provides consistent user experience through single DEX interface
- Simplifies maintenance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 03:11:55 +03:00
pezkuwichain 5eeff778dd Document staking score calculation matches pallet exactly
- Added comprehensive documentation to staking score calculation
- Clarified that frontend calculation MUST match pallet_staking_score
- Documented score formula and multiplier tiers
- Verified with tests that frontend === pallet calculation (all scenarios pass)
- Updated MONTH_IN_BLOCKS comment to show exact value (432,000)

This ensures the score displayed to users matches exactly what the
blockchain pallet calculates and reports to pallet_pez_rewards.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 02:45:21 +03:00
pezkuwichain 4de1a41cf9 Fix staking unbonding period display: correct era to days conversion
- Changed warning message calculation from ~{bondingDuration} days to ~{Math.floor(bondingDuration / 4)} days
- Correct conversion: 4 eras = 1 day (1 era = 6 hours)
- Example: 112 eras now correctly shows as ~28 days instead of ~112 days
- Location: src/components/staking/StakingDashboard.tsx:661

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 02:34:00 +03:00
pezkuwichain 9073fa54f3 Fix USDT swap insufficient balance bug
Root cause: Token symbol mismatch between TokenSwap component and WalletContext
- WalletContext stored balance with key 'USDT'
- TokenSwap used symbol 'wUSDT' for lookups
- This caused balances['wUSDT'] to return undefined
- Triggered false "insufficient balance" errors

Changes:
- Updated TokenSwap.tsx to use 'USDT' symbol consistently
- Fixed token symbol in AVAILABLE_TOKENS array
- Updated asset ID mapping in swap transaction logic
- Fixed swap history token display

Also includes:
- Added new DEX components (SwapInterface, PoolBrowser, etc.)
- Added TypeScript type definitions for DEX
- Added DEX utility functions
- Removed obsolete test scripts
- Updated WalletContext with USDT balance support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 02:23:15 +03:00
pezkuwichain 591e63e99e feat: Add citizenship NFT workflow and wallet enhancements
- Add BeCitizen page with citizenship application workflow
- Add NftList component to display Tiki role NFTs
- Implement citizenship crypto and workflow utilities
- Add wallet score tracking and calculation
- Update WalletDashboard to display NFTs and scores
- Update AccountBalance and AppLayout for better UX
- Enhance PolkadotContext with Tiki pallet integration
- Clean up temporary debugging scripts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 19:39:02 +03:00
pezkuwichain 3212af89b2 feat: Implement live blockchain staking with score tracking and PEZ rewards
- Add comprehensive staking library (src/lib/staking.ts) with blockchain queries
- Rewrite StakingDashboard to use validator nomination staking
- Implement real-time staking score from pallet_staking_score
- Add PEZ rewards display from pallet_pez_rewards
- Fix bonded amount display with stash/controller account handling
- Add 5-card dashboard: Total Bonded, Unlocking, Redeemable, Staking Score, PEZ Rewards
- Implement bond, nominate, unbond, and withdraw functionality
- Add auto-refresh every 30 seconds for real-time data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 07:36:18 +03:00
pezkuwichain 617b61030a fix: Enable dynamic liquidity pools and improve USDT display consistency
- Make AddLiquidityModal dynamic to support all pool combinations (HEZ-PEZ, HEZ-USDT, PEZ-USDT)
- Pass asset0 and asset1 props from PoolDashboard to AddLiquidityModal
- Rename balance key from wUSDT to USDT in WalletContext for user-facing consistency
- Display USDT instead of wUSDT in PriceChart for better UX
- Backend still uses wUSDT (Asset ID 2), but frontend shows USDT to users

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-06 19:55:57 +03:00
pezkuwichain 5686386ef6 chore: Add utility scripts for DEX pool management
- check-asset-state.mjs: Asset state verification
- check-balances.mjs: Balance checking utilities
- check-founder-balances.mjs: Founder account balance checks
- check-hez-balance.mjs: HEZ token balance verification
- check-pool-balances-detailed.mjs: Detailed pool balance analysis
- create-all-pools.mjs: Automated pool creation
- create-pez-wusdt-pool.mjs: PEZ/wUSDT pool setup
- mint-and-create-pools.mjs: Mint tokens and create pools
- mint-whez.mjs: wHEZ minting utility
- verify-pool-state.mjs: Pool state verification
- wrap-hez-and-create-all-pools.mjs: HEZ wrapping and pool setup

These scripts support DEX pool management and testing for beta testnet.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 12:55:15 +03:00
pezkuwichain 4825ac3839 feat: Add USDT support, dynamic pricing, and balance validation
Major improvements to wallet dashboard and DEX functionality:

## USDT Integration
- Add wUSDT (Asset ID 2) support with 6 decimal precision
- Display USDT balances in wallet dashboard
- Integrate USDT into swap and pool interfaces

## Dynamic Token Pricing
- Fetch real-time HEZ and PEZ prices from liquidity pools
- Calculate USD values using pool reserve ratios
- Display live USD equivalent for token balances

## User Experience Improvements
- Hide wrapped tokens (wHEZ, wUSDT) from user interface
- Show only HEZ, PEZ, USDT as user-facing tokens
- Handle wrapping/unwrapping transparently in backend
- Add balance validation before swap transactions
- Prevent insufficient balance swaps with clear warnings

## Pool Dashboard Enhancements
- Support multiple pool pairs (HEZ/PEZ, HEZ/USDT, PEZ/USDT)
- Dynamic pool selection interface
- User-friendly token names throughout pool interface

## Technical Improvements
- Correct decimal handling (6 for USDT, 12 for others)
- Proper pool account ID derivation using blake2 hash
- Balance subscriptions for real-time updates
- Custom token support with Add Token modal

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-05 10:56:44 +03:00
pezkuwichain 262a0da939 feat: Update pool dashboard to display PEZ/wUSDT pool
- Switch pool display from wHEZ/PEZ to PEZ/wUSDT
- Fix wUSDT decimal conversion (1e6 instead of 1e12)
- Update TokenSwap to support beta testnet endpoint
- Add wallet reconnection on network change
- Update API endpoint to wss://beta.pezkuwichain.com

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 12:50:06 +03:00
pezkuwichain 6c30c06660 config: Adrêsên multisig yên rastîn zêde kir
Multisig Members (3/5):
• Serok: 5D74yW53pg3gCaLMzGvZUNxiqTZMwFXA85bB2QYfcYh5Tdc4
• SerokiMeclise: 5GTRuK96TkmjUSuQnkjBJBCEmHSDSdW22ptWosxCBWACfsZp
• Xezinedar: 5DRTYPChot1UPDHEeJVTtuE8dLDgCVvAcWbdnc8zwwpYYjeR
• Noter: 5DFwqK698vL4gXHEcanaewnAqhxJ2rjhAogpSTHw3iwGDwd3
• Berdevk: 5F4V6dzpe72dE2C7YN3y7VGznMTWPFeSKL3ANhp4XasXjfvj

Guhertin:
 ReservesDashboardPage.tsx - SPECIFIC_ADDRESSES bi adrêsên rastîn
 USDT_MULTISIG_SETUP.md - Tabloya adrêsên tije
 MULTISIG_CONFIG.md (nû) - Referansa bilez û complete config

Ewlekarî:
🔒 Tenê public addresses hate paylaşkirin
🔒 Seed phrases/private keys NEHATINE dîtin
🔒 On-chain verification ji bo unique roles amade ye

🤖 Bi [Claude Code](https://claude.com/claude-code) re hate çêkirin

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 02:49:12 +03:00
pezkuwichain d860d8beb3 feat: Pergala USDT multisig a tevahî li ser chain
Taybetmendiyên Nû:
• pallet-multisig bi kar anîna - 3/5 threshold
• wUSDT asset (ID: 2) - 1:1 backing bi USDT
• Multisig members: Serok, SerokiMeclise, Xezinedar, Noter, Berdevk
• Otomatîk query ji pallet-tiki (unique roles)

Lib/Utilities:
 src/lib/multisig.ts - Multisig utilities (members, tx, queries)
 src/lib/usdt.ts - wUSDT bridge helpers (mint, burn, reserves)
 src/lib/wallet.ts - WUSDT asset ID zêde kir

Components:
 MultisigMembers.tsx - Multisig members display
 USDTBridge.tsx - Deposit/withdrawal UI
 ReservesDashboard.tsx - Reserve monitoring dashboard

Pages & Routes:
 ReservesDashboardPage.tsx - /reserves route
 App.tsx - Route integration

Taybetmendî:
• Full on-chain multisig (no Ethereum dependency)
• Automatic tiki holder lookup
• Reserve health monitoring
• Tiered withdrawal limits (instant, standard, large)
• Event subscriptions (mint/burn tracking)
• 1:1 USDT backing verification

Documentation:
 USDT_MULTISIG_SETUP.md - Complete setup guide

🤖 Bi [Claude Code](https://claude.com/claude-code) re hate çêkirin

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 00:40:12 +03:00
pezkuwichain ee6224e707 docs: Pelên pêşkeftinê û amûrên testing DEX zêde bike
- README_DEX_IMPROVEMENTS.md: Belgekirin û rave kirinên DEX
- check-pool.mjs: Amûra kontrolkirina rewşa pool
- create-beta-pool.mjs: Script ji bo çêkirina pool li beta testnet
- create-beta-pool.js: Versiyona JavaScript ya scripta çêkirina pool

Ev pel ji bo pêşkeftin û testing in.

🤖 Bi [Claude Code](https://claude.com/claude-code) re hate çêkirin

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 23:49:58 +03:00
pezkuwichain 4839765aee serrastkirin: Hesabkirina pool account bi blake2 hash
- poolAccountIds fonksiyona API tune ne, ji ber vê hataye derket
- Niha pool account bi AccountIdConverter û blake2 hash tê hesabkirin
- PalletId "py/ascon" bi (u32, u32) poolId re tê hash kirin
- Ev guhertin hem ji bo AddLiquidityModal û hem jî PoolDashboard

Taybetmendî:
 Add liquidity niha bi rast dixebite
 Pool metrics rast têne xuyakirin
 Reserve balances rast têne hesabkirin
 LP position tracking çêbû

🤖 Bi [Claude Code](https://claude.com/claude-code) re hate çêkirin

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 23:48:44 +03:00
pezkuwichain 8af6127e7e feat: Add comprehensive liquidity pool management system
- Add AddLiquidityModal with automatic HEZ to wHEZ wrapping and 10% slippage tolerance
- Add RemoveLiquidityModal with automatic wHEZ to HEZ unwrapping
- Add PoolDashboard component with metrics, APR calculation, and impermanent loss calculator
- Add /pool route and integrate Pool button in WalletDashboard
- Display real-time pool reserves, TVL, and user positions
- Support batched transactions for optimal UX

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 23:32:40 +03:00
pezkuwichain 6c1fa9f1bf chore: Switch to beta testnet endpoint
- Changed default endpoint from ws://127.0.0.1:9944 to wss://beta.pezkuwichain.io
- Preparing for multi-validator beta testnet deployment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 16:24:07 +03:00
pezkuwichain c9b6dea419 chore: Remove debug logs from swap history parsing
Clean up console.log statements used for debugging the path parsing issue.
Keep only essential error logging.
2025-11-01 15:46:53 +03:00
pezkuwichain b6679aa3cd fix: Correct path array parsing for swap token symbols
The path is an array of tuples [[assetId, amount], [assetId, amount]],
not an array of objects. Fixed to access asset ID at index 0 of each tuple.

Previous code was trying to access object properties (nativeOrAsset.asset)
which don't exist on arrays, causing all swaps to default to HEZ→HEZ.
2025-11-01 15:43:52 +03:00
pezkuwichain 243f3df4bd fix: Correct SwapExecuted event destructuring - add missing send_to field
The SwapExecuted event has 5 fields (who, send_to, amountIn, amountOut, path),
not 4. The old code was missing send_to, which caused the path (asset array)
to be assigned the recipient address instead, resulting in all swaps showing
as HEZ→HEZ regardless of actual token pairs.

This fixes the swap history display to show correct token symbols.
2025-11-01 15:40:34 +03:00
pezkuwichain 41bfce3ba4 fix: Correct token symbol parsing in swap history
- Fixed path array parsing for SwapExecuted events
- Handle different Polkadot.js enum formats (nativeOrAsset vs NativeOrAsset)
- Added toJSON() conversion for proper array parsing
- Now correctly shows HEZ↔PEZ swaps instead of HEZ→HEZ
- Applied fix to both initial history load and post-swap refresh

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 15:27:57 +03:00
pezkuwichain 5eb1cea6f2 feat: Add advanced trading features - Price Charts, Limit Orders & Escrow
🎨 Price Chart Component (TradingView style):
- Real-time price chart with Area Chart visualization
- Multiple timeframes (1H, 24H, 7D, 30D)
- Price change indicator with trending icons
- Color-coded (green for bullish, red for bearish)
- Historical data generation with random walk algorithm
- Responsive Recharts integration

📊 Limit Orders System:
- Full limit order management UI
- Create buy/sell limit orders at target prices
- Order status tracking (pending, filled, cancelled, expired)
- Price distance calculation from current market
- Order expiration (24h default)
- Order cancellation feature
- Real-time order list with filtering
- Step-by-step order creation wizard

🔒 P2P Escrow System (Binance P2P style):
- 3-step escrow flow (Funding → Payment → Release)
- Visual progress indicator with step icons
- Secure escrow protection explanation
- Trade details summary card
- Payment instructions & time limits
- Status-based UI (blue, yellow, green alerts)
- Cancel trade functionality
- Complete trade summary

All features are UI-ready and prepared for blockchain integration.
World-class trading experience matching Uniswap, Binance P2P & TradingView!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 15:20:44 +03:00
pezkuwichain ea1fe462b4 feat: Enhance trading/P2P with world-class features
TokenSwap Improvements (Uniswap/PancakeSwap inspired):
-  Price impact indicator with color-coded warnings (<1% green, 1-5% yellow, >5% red)
-  Real-time transaction history from blockchain (SwapExecuted events)
-  LP fee breakdown display
-  Minimum received calculation with slippage
-  High price impact warnings (>5%)
-  Auto-refresh history after successful swaps

P2P Market Improvements (Binance P2P/LocalBitcoins inspired):
-  Advanced filtering system (payment method, price range)
-  Smart sorting (by price, rating, completed trades)
-  Create Order modal with full form
-  Collapsible advanced filters panel
-  Clear all filters button
-  Better UX with filter toggles

These features bring DKSweb trading experience to world-class standards,
matching the best DEX and P2P platforms in the crypto ecosystem.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 14:50:41 +03:00
pezkuwichain 56170bbd57 perf: Further optimize DKstate background image
- Reduced file size from 243KB to 149KB (39% additional reduction)
- Total optimization: 719KB -> 149KB (79% reduction)
- Enhanced page load performance significantly

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 14:38:06 +03:00
pezkuwichain 580552db0b perf: Optimize DKstate background image
- Reduced file size from 719KB to 243KB (66% reduction)
- Updated DKstate.png with optimized version
- Improved page load performance

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 13:24:26 +03:00
pezkuwichain dc35e19099 feat: Replace hero section background with DKstate image
- Added DKstate.png to public folder (719KB PNG)
- Replaced Kurdish Flag CDN image with local DKstate background
- Updated alt text to "DKstate Background"
- Maintained gradient overlay styling

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 12:39:12 +03:00
pezkuwichain 861e8c710a feat: Replace reward distribution image with PezkuwiChain logo
- Added PezkuwiChain logo to public folder (179KB PNG)
- Replaced CDN image with local logo in RewardDistribution component
- Updated alt text to "PezkuwiChain Logo"

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 11:47:02 +03:00
pezkuwichain 63027314f6 feat: Add real-time trust score display in Wallet Dashboard
- Fetch trust score from blockchain via api.query.trust.trustScores
- Display trust score in AccountBalance component (Account Info card)
- Show between Address and Source fields with Award icon
- Use purple-cyan gradient styling for visual consistency

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 11:30:58 +03:00
pezkuwichain 675a21d214 debug: Add detailed logging for trust score fetch
Added comprehensive console logs to debug trust score fetching:
- API readiness check
- Account availability check
- Query execution log
- Detailed error logging with stack trace

This will help identify the exact point of failure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 10:56:33 +03:00
pezkuwichain 6ee49de3a0 fix: Correct trust score storage query name
Changed from `trustScoreOf` to `trustScores` to match the actual
storage item name in pallet_trust. Polkadot.js API uses storage names,
not getter function names.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 10:53:00 +03:00
pezkuwichain 96d6277a0f feat: Add real-time trust score to wallet dashboard
- Fetch trust score from pallet_trust via API
- Display score in WalletModal with Award icon
- Shows user's current trust score from blockchain
- Gradient styling (purple to cyan) for visual appeal
- Fallback to '-' when API not ready or score unavailable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 10:44:17 +03:00
pezkuwichain e9809ebc99 feat: Align Trust Score Calculator with pallet_staking_score
- Replace free slider with HEZ amount input (0-1000)
- Implement discrete amount scores (20, 30, 40, 50) matching blockchain
- Add automatic score calculation based on staked amount
- Show both amount and calculated score in UI
- Duration multipliers unchanged (x1.0 to x2.0)

This ensures the calculator accurately simulates blockchain behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 10:41:38 +03:00
pezkuwichain a1f19e4487 feat: Add total voters and tokens staked from blockchain
- Fetch total staked tokens from pallet_staking.erasTotalStake()
- Count unique voters from pallet_conviction_voting.votingFor.keys()
- Display real-time data instead of hardcoded values
- Shows '-' when data is unavailable (e.g. no current era)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 10:33:04 +03:00
pezkuwichain ad25287721 feat: Connect homepage stats to blockchain data
Updated HeroSection to fetch real governance data:
- Active Proposals from pallet_referenda (was hardcoded to 127)
- Replaced all hardcoded stats with dynamic blockchain queries
- Shows "-" for unavailable data (totalVoters, tokensStaked, trustScore)
- Real-time updates using PolkadotContext API

Now homepage shows actual on-chain referendum count instead of mock data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 10:25:27 +03:00
pezkuwichain 50cb6d98cc feat: Integrate real blockchain data for governance stats
Connected governance overview to actual blockchain data:
- Active proposals from pallet_referenda
- Treasury balance from treasury account
- Parliament (Council) members from pallet_collective
- Real-time data fetching using PolkadotContext API
- Replaced mock data with live blockchain queries

Todo: Add total voters and participation rate calculation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 10:20:42 +03:00
pezkuwichain 5097b769a1 feat: Add whitepaper PDF download to Docs links
Added Pezkuwi whitepaper PDF to repository and updated navigation:
- Added public/Whitepaper.pdf (738KB)
- Updated Docs links to download whitepaper from GitHub
- Both header and footer navigation now link to GitHub raw PDF
- Users can download whitepaper by clicking Docs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 10:16:20 +03:00
pezkuwichain 0622e3278f feat: Complete DEX frontend integration with Pezkuwi SDK
🎉 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 🌟
2025-11-01 08:59:19 +03:00
pezkuwichain 06fe4783f2 feat: Add Kurdistan sun animation for swap processing
Added animated Kurdistan-themed loading indicator that displays during swap transactions:
- KurdistanSun component with 21 rays (Kurdistan flag symbolism)
- White center sun with glow effects
- Rotating colored halos: green (outer), red (middle), yellow (inner)
- Full-screen overlay with backdrop blur during processing
- Fixed timing: dialog closes before animation shows

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 08:44:56 +03:00
pezkuwichain e92baa75c7 fix: DEX swap calculation and wallet refresh issues
- Fix AMM formula to use correct 3% LP fee (was 0.3%)
  - Runtime uses LPFee=30 (3% = 30/1000)
  - Changed to Uniswap V2 formula: amountOut = (amountIn * 970 * reserveOut) / (reserveIn * 1000 + amountIn * 970)
  - Fixes ProvidedMinimumNotSufficientForSwap error

- Fix wallet disconnection after successful swap
  - Added refreshBalances() to WalletContext
  - Replaced window.location.reload() with refreshBalances()
  - Wallet connection now persists after swap

Changes:
- src/components/TokenSwap.tsx: Correct AMM formula, async callback for refresh
- src/contexts/WalletContext.tsx: Add refreshBalances() export
2025-11-01 08:18:24 +03:00
pezkuwichain 82ff3fd283 chore: Remove debug logging from profile operations
Cleaned up console.log statements added during debugging:
- Removed verbose logging from ProfileSettings loadProfile
- Removed verbose logging from ProfileSettings updateProfile
- Removed verbose logging from Dashboard fetchProfile

Kept only essential error logging for production.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 05:26:43 +03:00
pezkuwichain 205e22e083 fix: Use SECURITY DEFINER function for profile upserts
Changes:
1. Created migration 004_create_upsert_function.sql:
   - Creates upsert_user_profile() function with SECURITY DEFINER
   - Bypasses RLS to allow profile creation/updates
   - Only accessible to authenticated users via auth.uid()

2. Updated ProfileSettings.tsx:
   - Changed from direct upsert to RPC function call
   - Updated updateProfile() to use supabase.rpc()
   - Updated updateNotificationSettings() to use same function

This solves the RLS policy violation by using a secure
server-side function that properly handles authentication.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 05:10:53 +03:00
pezkuwichain ceec6a5569 fix: Simplify profile RLS policies to allow insert
Updated migration 003 to properly handle RLS:
- Make username nullable with default
- Drop all existing policies and recreate them
- Add proper INSERT policy with WITH CHECK clause
- Add UPDATE policy with both USING and WITH CHECK

This fixes RLS error blocking profile creation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 05:07:18 +03:00
pezkuwichain 280c335977 fix: Use upsert for profile updates to handle missing rows
Changes:
1. Created migration 003_fix_profile_creation.sql:
   - Added INSERT policy for profiles table
   - Made username nullable with default value
   - Created upsert_profile function for safe upserts

2. Updated ProfileSettings.tsx:
   - Changed from .update() to .upsert()
   - Added id field to upsert data
   - Added loadProfile() call after save to refresh state

This fixes the issue where users couldn't update their profile
because no profile row existed in the database.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 04:45:23 +03:00
pezkuwichain ca510ead86 debug: Add comprehensive logging to profile save/fetch operations
Added detailed console logging to track data flow:
- ProfileSettings: Log data being saved and save responses
- ProfileSettings: Log data being loaded when page opens
- Dashboard: Log profile data being fetched and set to state

This will help identify where profile data is being lost between
save in ProfileSettings and display in Dashboard.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-29 04:30:43 +03:00