- PezkuwiWebView now uses signAndSend via native API
- Transactions are signed AND submitted on native side
- Returns actual block hash instead of raw signature
- Web sends section/method/args payload format
- WalletContext extracts tx details for mobile bridge
- Add mobile-bridge.ts utility for native app communication
- Add useMobileBridge.ts React hook
- Update AuthContext to detect and use native wallet
- Update PezkuwiContext to connect mobile wallet automatically
- Update WalletContext to sign transactions via native bridge
Mobile app can now seamlessly use web P2P features with native wallet.
This commit reorganizes the codebase to eliminate duplication between web and mobile frontends by moving all commonly used files to the shared folder.
Changes:
- Moved lib files to shared/lib/:
* wallet.ts, staking.ts, tiki.ts, identity.ts
* multisig.ts, usdt.ts, scores.ts, citizenship-workflow.ts
- Moved utils to shared/utils/:
* auth.ts, dex.ts
* Created format.ts (extracted formatNumber from web utils)
- Created shared/theme/:
* colors.ts (Kurdistan and App color definitions)
- Updated web configuration:
* Added @pezkuwi/* path aliases in tsconfig.json and vite.config.ts
* Updated all imports to use @pezkuwi/lib/*, @pezkuwi/utils/*, @pezkuwi/theme/*
* Removed duplicate files from web/src/lib and web/src/utils
- Updated mobile configuration:
* Added @pezkuwi/* path aliases in tsconfig.json
* Updated theme/colors.ts to re-export from shared
* Mobile already uses relative imports to shared (no changes needed)
Architecture Benefits:
- Single source of truth for common code
- No duplication between frontends
- Easier maintenance and consistency
- Clear separation of shared vs platform-specific code
Web-specific files kept:
- web/src/lib/supabase.ts
- web/src/lib/utils.ts (cn function for Tailwind, re-exports formatNumber from shared)
All imports updated and tested. Both web and mobile now use the centralized shared folder.
- Created useDelegation hook to fetch real delegation data from blockchain
- Queries democracy.voting pallet for all delegations
- Tracks delegate totals, delegator counts, and voting power
- Calculates delegate performance metrics and success rates
- Fetches user's own delegations with conviction levels
- Auto-refreshes every 30 seconds for live updates
- Provides delegateVotes and undelegateVotes transaction builders
- Updated DelegationManager component to use live data
- Replaced mock delegates with real blockchain delegates
- Replaced mock delegations with user's actual delegations
- Added loading states with spinner during data fetch
- Added error handling with user-friendly messages
- Added "Live Blockchain Data" badge for transparency
- Formatted token amounts from blockchain units (12 decimals)
- Show delegate addresses in monospace font
- Display delegator count and conviction levels
- Empty states for no delegates/delegations scenarios
- Enhanced PolkadotContext with isConnected property
- Added isConnected as alias for isApiReady
- Maintains backward compatibility with existing hooks
- Added formatNumber utility to lib/utils
- Formats large numbers with K/M/B suffixes
- Handles decimals and edge cases
- Consistent formatting across all components
All delegation data now comes from live blockchain queries.
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.