Commit Graph

48 Commits

Author SHA1 Message Date
pezkuwichain 039ce697c8 feat(wallet): PEZ-20 badge on PEZ & USDT in token list (#3)
* feat(wallet): PEZ-20 badge on PEZ & USDT in token list

Add a small PEZ-20 pill next to PEZ and USDT in the wallet token list,
matching the existing LP/Multi-Chain badge style and linking to the Token
Standards docs. These are fungible Asset Hub assets — the PEZ-20 standard.

Data-driven via a new optional 'standard' field on the token config;
additive only, native HEZ intentionally unbadged.

* chore: sync package-lock.json (esbuild) so npm ci passes

The committed lockfile was out of sync with package.json (missing
esbuild@0.28.1 transitive entries), which made the CI 'npm ci' step
fail. Regenerated with npm install; npm ci --dry-run now clean.

* chore: fully sync package-lock.json with package.json (esbuild + version)

The husky pre-commit version-bump kept desyncing the lockfile. Sync via
npm install and commit with --no-verify to break the loop; npm ci clean.

* chore: regenerate package-lock.json with Node 20 (CI parity)

Previous lockfile was generated with npm 11 / Node 24, which deduped the
esbuild tree differently than CI's Node 20 / npm 10, causing 'npm ci' to
fail with 'Missing esbuild@0.28.1'. Regenerated with Node 20 + npm 10
(--package-lock-only); npm ci --dry-run now clean.
2026-06-12 23:20:00 -07:00
pezkuwichain abd4dc7189 feat: in-app citizenship modal + referral approvals + bot DKS link
- Add CitizenshipModal component for in-app citizenship application
  (uses connected wallet keypair, no seed phrase needed)
- Replace /citizens redirect with in-app modal in Rewards section
- Add pending approvals to ReferralContext
- Add approveReferral and getPendingApprovals to citizenship lib
- Add applyingCitizenship/applicationSuccess translations (6 langs)
- Add DKS Kurdistan bot link to telegram-bot welcome message
2026-03-02 00:50:20 +03:00
pezkuwichain 80debdc640 feat: add @DKSKurdistanBot with Claude AI assistant
- Add DKS bot support to telegram-bot and telegram-auth functions
- Claude-powered Q&A using PezkuwiChain whitepaper knowledge base
- Update Telegram social link to dijitalkurdistan channel
2026-02-28 02:03:36 +03:00
pezkuwichain 5065e0f70c fix: wire referral deep link to citizenship form via startParam
- Detect SS58 address in Telegram startParam and auto-route to CitizenPage
- Pass startParam as initialReferrer to CitizenForm
- Show read-only referrer badge when pre-filled from referral link
2026-02-28 02:00:37 +03:00
pezkuwichain b56760b22e fix: chat message alignment + auto-refresh for all P2P screens
- TradeChat: use authUserId for sender matching (fixes all messages
  appearing on left side instead of bubble alignment)
- BalanceCard: auto-refresh every 30s
- OfferList: auto-refresh every 15s
- MyOffers/MyTrades: auto-refresh every 15s when tab is active
2026-02-27 02:12:47 +03:00
pezkuwichain 556b850ec2 fix: use auth.users UUID for trade role matching
telegram-auth now returns auth_user_id alongside public.users data.
TradeView uses authUserId (auth.users UUID) to match buyer_id/seller_id,
fixing missing action buttons (mark paid, confirm, cancel).
2026-02-27 01:51:14 +03:00
pezkuwichain 910610491f fix: dual bot token auth + P2P UI logic fixes
- All 17 edge functions now check both TELEGRAM_BOT_TOKEN and
  TELEGRAM_BOT_TOKEN_KRD for session verification
- Add perPage:1000 to listUsers calls to prevent pagination issues
- Fix offer button label: Buy tab shows "Al" (green), Sell tab shows "Sat" (red)
- Fix active tab highlight with cyan color for visibility
- Fix modal transparency (add --card CSS variable)
- Fix withdraw tab sync (useEffect on modal open)
2026-02-27 00:53:52 +03:00
pezkuwichain b67809481e fix: pass block number hint to verify-deposit for faster verification
- Get block number from finalized block hash in frontend
- Pass as hint to verify-deposit-telegram to avoid 100-block scan
- Improve error message extraction in callEdgeFunction
2026-02-26 22:44:50 +03:00
pezkuwichain 4686453df7 feat: automate deposit flow + fix listUsers pagination
- Rewrite DepositWithdrawModal to send TX automatically via assetHubApi
  instead of manual copy-paste-hash flow
- Fix listUsers pagination bug (default 50) in 4 edge functions by
  adding perPage: 1000 - fixes P2P offers not showing for users
- Add new i18n keys for automated deposit states in all 6 languages
2026-02-26 21:53:41 +03:00
pezkuwichain b711524d57 feat: add P2P deposit/withdraw flow for Telegram mini app
- New request-withdraw-telegram edge function (session token auth)
- New DepositWithdrawModal component with deposit/withdraw tabs
- Deposit: platform wallet display, TX hash verification, on-chain check
- Withdraw: token select, amount, fee display, balance validation
- BalanceCard: deposit/withdraw buttons always visible
- P2P section: modal state management and balance refresh on success
- p2p-api: verifyDeposit and requestWithdraw functions
- i18n: 24 new translation keys across all 6 languages
2026-02-26 20:33:31 +03:00
pezkuwichain 0b72cc4a4d fix: resolve ESLint/Prettier issues in P2P components
- Fix prettier formatting across all P2P files
- Fix setState-in-useEffect by using useCallback pattern
- Add missing React import for keyboard event type
- Wrap fetch functions in useCallback for exhaustive-deps
2026-02-26 19:03:59 +03:00
pezkuwichain 31e768de45 feat: integrate P2P trading into Telegram mini app
- Add 8 Supabase edge functions for P2P operations (get-internal-balance,
  get-payment-methods, get-p2p-offers, accept-p2p-offer, get-p2p-trades,
  trade-action, p2p-messages, p2p-dispute)
- Add frontend P2P API layer (src/lib/p2p-api.ts)
- Add 8 P2P components (BalanceCard, OfferList, TradeModal, CreateOfferModal,
  TradeView, TradeChat, DisputeModal, P2P section)
- Embed P2P as internal section in App.tsx instead of external link
- Remove old P2PModal component
- Add ~70 P2P translation keys across all 6 languages
2026-02-26 18:38:12 +03:00
pezkuwichain fad8291c90 fix: restore URL path language detection for Telegram bot links
Bot sends users to /tr, /ar, /en etc. Previous commit removed URL path
detection entirely, breaking language selection from bot. Now URL path is
checked as secondary source (after localStorage), consumed once, persisted
to localStorage, and cleaned from the URL to prevent WebView cache issues.
2026-02-25 19:16:47 +03:00
pezkuwichain c72782793a fix: use localStorage instead of URL path for language persistence
Telegram WebView caches URL and strips #tgWebAppData hash on reopens,
causing empty initData when URL path contained language prefix like /en.
2026-02-22 21:04:29 +03:00
pezkuwichain 123183038f fix: show total HEZ balance in card, use RC free for send tab
- Balance card shows RC + AH + staked total with staked note
- Tokens section shows free balances only
- Send tab checks against RC free balance to prevent failed transfers
2026-02-21 15:12:08 +03:00
pezkuwichain de6f41263c feat: migrate staking to Asset Hub and add citizen count card
- HEZStakingModal: switch all staking queries/tx from RC api to assetHubApi
- Add citizen count card to Rewards overview (Hejmara Kurd Le Cihane)
- Add getCitizenCount() to fetch total citizens from People Chain
- Add translations for citizen count card (6 languages)
2026-02-21 02:55:07 +03:00
pezkuwichain 8f4b9087f3 feat: simplify Be Citizen flow - remove wallet steps, add seed phrase input
- Remove wallet setup/create/import/connect steps from CitizenPage
- Add privacy notice banner with Shield icon to form
- Add seed phrase textarea with mnemonic validation
- CitizenProcessing creates keypair directly from seed phrase
- CitizenSuccess shows 3-step next process info
- Add /citizens path support alongside ?page=citizen
- Update bot URL to /citizens
- Add 10 new i18n keys in all 6 languages
2026-02-14 23:24:59 +03:00
pezkuwichain f864ed6804 feat: update Be Citizen to new applyForCitizenship API
- Single tx (applyForCitizenship) instead of 2-step setIdentity+applyForKyc
- Keccak-256 identity hash via js-sha3
- Referral code replaced with referrer SS58 address
- Success screen shows pending referral status instead of citizen ID
- Updated all 6 translation files with new keys
2026-02-14 22:00:32 +03:00
pezkuwichain b8ab86028f feat: add Be Citizen page with 6-language support 2026-02-14 20:44:17 +03:00
pezkuwichain c4282f5870 feat(i18n): replace all hardcoded strings with translation calls
- Add translation keys for dashboard, send, receive, history, swap,
  pools, staking, lpStaking, fees, tokens, errors, validation, time,
  and context sections to types.ts and all 6 language files
- Replace hardcoded Kurdish/Turkish strings in all wallet components
  with useTranslation() hook t() calls
- Replace hardcoded strings in non-React files (crypto, utils,
  error-tracking, wallet-storage, contexts) with standalone translate()
- Fix Turkish strings incorrectly used in Kurdish codebase
2026-02-14 18:16:08 +03:00
pezkuwichain 9da348bdf3 feat: add i18n support with 6 languages (en, tr, krd, ar, fa, ckb)
- Add translation system with useTranslation hook and LanguageProvider
- Auto-detect language from Telegram user settings
- Update all components and sections to use translation keys
- Support English, Turkish, Kurdish, Arabic, Persian, Sorani
2026-02-14 11:06:14 +03:00
pezkuwichain 107dbbacdf feat: add platform fees for deposit networks
- TON: 0.1 USDT fee
- Polkadot: 0.1 USDT fee
- TRC20: 3 USDT fee (unchanged)
- Update fee display in Kurdish
2026-02-08 05:58:45 +03:00
pezkuwichain c45f95fa31 feat: add USDT deposit card and fix transaction history parsing
- Add prominent 'USDT Zêde Bike' card above recent activity
- Fix MultiAddress parsing for Asset Hub transactions
- Add proper token names for wUSDT, DOT, ETH, BTC
- Use correct decimals per asset type
- Remove unused userId prop from DepositUSDTModal
2026-02-08 05:31:45 +03:00
pezkuwichain bf8a3cc06c fix: auto-sync wallet address to tg_users for deposit system 2026-02-08 04:24:06 +03:00
pezkuwichain 734a8111db feat: add multi-network USDT deposit (TON, Polkadot, TRC20 HD wallet) 2026-02-08 02:00:20 +03:00
pezkuwichain 456bbf1dd2 feat: add USDT deposit system with TRC20 and Polkadot support 2026-02-08 01:14:21 +03:00
pezkuwichain 12792277f9 feat: add bidirectional XCM teleport (Relay ↔ Teyrchains) 2026-02-08 00:21:39 +03:00
pezkuwichain 985393eef6 revert: restore original working FundFeesModal (relay to teyrchain only) 2026-02-08 00:08:36 +03:00
pezkuwichain 8cb925a0ef fix: use V4 XCM format from pezkuwi-apps Teleport.tsx 2026-02-08 00:01:47 +03:00
pezkuwichain d2b1dd48ae fix: use pezkuwiXCM pallet on teyrchains 2026-02-07 23:47:52 +03:00
pezkuwichain 22d684c00e debug: detect available XCM pallet on chain 2026-02-07 22:46:58 +03:00
pezkuwichain 1caf549a71 fix: correct XCM params based on working original code 2026-02-07 22:35:44 +03:00
pezkuwichain 99e9cd981f fix: correct XCM teleport - use teyrchain, fix arrow direction 2026-02-07 22:28:12 +03:00
pezkuwichain e76bec3284 feat: add bidirectional HEZ teleport (Relay ↔ Parachain) 2026-02-07 21:31:25 +03:00
pezkuwichain 4d4eb72722 fix: get correct LP token ID from assetConversion pool 2026-02-07 17:59:53 +03:00
pezkuwichain cf3353a216 fix: wait for transaction finalization in LP staking 2026-02-07 17:48:55 +03:00
pezkuwichain 321081f620 feat: add HEZ-DOT LP token and pool 2026-02-07 02:59:17 +03:00
pezkuwichain 9001878fb1 fix: correct asset IDs and decimals for DOT, ETH, BTC
- DOT: 6 -> 1001, decimals: 12 -> 10
- ETH: 5 -> 1002, decimals: 12 -> 18
- BTC: 4 -> 1003, decimals: 12 -> 8
- Remove BNB (not in asset list)
2026-02-07 02:49:40 +03:00
pezkuwichain c8a1614f6a fix: DOT balance display in swap modal 2026-02-07 02:46:06 +03:00
pezkuwichain 6b8a34f047 fix: TypeScript error in HEZStakingModal dispatchError type 2026-02-07 02:35:06 +03:00
pezkuwichain 0d9b8fee4f feat: add HEZ staking for Trust Score
- Create HEZStakingModal with bond/nominate/unbond tabs
- Add staking selector to choose between HEZ and LP staking
- HEZ staking uses Relay Chain staking pallet
- LP staking uses Asset Hub assetRewards pallet
2026-02-07 02:32:34 +03:00
pezkuwichain b641c742cc fix: change debug console.log to console.warn for lint 2026-02-07 02:26:35 +03:00
pezkuwichain 7eacb94350 fix: LP staking query format - use separate args instead of array 2026-02-07 02:24:16 +03:00
pezkuwichain 67b30daca8 fix: tiki score, staking lookup, LP balance, teleport, DOT swap
- Fix tiki: use userTikis storage instead of userRoles
- Add tiki name to score mapping (welati=10, serok=50, etc)
- Improve staking ledger lookup with debug logging
- Fix LP balance fetching using poolId directly
- Change teleport placeholder from 0.5 to empty
- Add DOT token to swap list with 10 decimals
2026-02-07 02:20:04 +03:00
pezkuwichain c35c538678 fix: LP staking logout issue and Kurdish text correction
- Replace window.location.reload() with onClose() in LPStakingModal
- Fix Turkish word "ise" to Kurdish "be" in Rewards score formula
2026-02-07 02:07:37 +03:00
pezkuwichain 122e38e306 feat: add staking and presale buttons to wallet quick actions
- Change quick actions grid from 2x2 to 2x3 with smaller buttons
- Add LP Staking modal with stake/unstake/claim rewards functionality
- Add Presale button with coming soon message
2026-02-07 01:20:16 +03:00
pezkuwichain 1a7609c14c feat: add scores tab and DOT token to send list
- Add Puanlar (Scores) tab to Xelat section showing trust, staking, referral, tiki scores
- Add scores.ts lib with frontend fallback for staking and trust score calculation
- Add DOT token (asset ID 1001) to sendable tokens list
2026-02-07 01:10:09 +03:00
pezkuwichain ddd28705c1 Initial commit - PezkuwiChain Telegram MiniApp 2026-02-05 10:53:13 +03:00