847 Commits

Author SHA1 Message Date
pezkuwichain ad3c0e414e feat(web): add PEZMessage on-chain E2E encrypted messaging UI
- x25519 ECDH + XChaCha20-Poly1305 encryption via @noble libs
- Key derivation from wallet signRaw, private key held in memory only
- Messaging pallet integration (registerEncryptionKey, sendMessage, inbox)
- Inbox polling every 12s, auto-decrypt when key unlocked
- ComposeDialog with recipient key validation and 512-byte limit
- Settings moved from grid to nav bar gear icon, PEZMessage takes its slot
- i18n translations for all 6 languages (en, tr, kmr, ckb, ar, fa)
2026-03-03 08:29:16 +03:00
pezkuwichain a9cb2972b9 feat(web): add PEZMessage on-chain E2E encrypted messaging UI
- x25519 ECDH + XChaCha20-Poly1305 encryption via @noble libs
- Key derivation from wallet signRaw, private key held in memory only
- Messaging pallet integration (registerEncryptionKey, sendMessage, inbox)
- Inbox polling every 12s, auto-decrypt when key unlocked
- ComposeDialog with recipient key validation and 512-byte limit
- Settings moved from grid to nav bar gear icon, PEZMessage takes its slot
- i18n translations for all 6 languages (en, tr, kmr, ckb, ar, fa)
2026-03-03 08:29:16 +03:00
pezkuwichain 6aae238f05 test: update dashboard snapshot for March 2026 2026-03-01 22:23:47 +03:00
pezkuwichain 86433a88ff test: update dashboard snapshot for March 2026 2026-03-01 22:23:47 +03:00
pezkuwichain 626fc5166c fix: correct KycLevel enum map and restrict founder bypass
1. Fixed enum map missing NotStarted at index 0, causing all status
   indices to be off by one (ReferrerApproved decoded as PendingReferral)
2. Restricted founder bypass to only show applications with no referrer,
   not all applications regardless of referrer
2026-03-01 22:08:40 +03:00
pezkuwichain e3beba7538 fix: correct KycLevel enum map and restrict founder bypass
1. Fixed enum map missing NotStarted at index 0, causing all status
   indices to be off by one (ReferrerApproved decoded as PendingReferral)
2. Restricted founder bypass to only show applications with no referrer,
   not all applications regardless of referrer
2026-03-01 22:08:40 +03:00
pezkuwichain 1f561afde7 fix: update referral share text with localized invitation message
Share text now includes friendly invitation + wallet address for
manual paste. Hardcoded English text replaced with i18n keys.
2026-02-28 02:35:25 +03:00
pezkuwichain 419e75f38e fix: update referral share text with localized invitation message
Share text now includes friendly invitation + wallet address for
manual paste. Hardcoded English text replaced with i18n keys.
2026-02-28 02:35:25 +03:00
pezkuwichain 5bdc80e3ed fix: use dynamic SS58 prefix in referral/KYC address encoding
Replace hardcoded SS58 prefix 42 with api.registry.chainSS58 ?? 42
for robustness in getPendingApprovalsForReferrer, getReferralInfo,
and getMyReferrals functions.
2026-02-28 01:59:04 +03:00
pezkuwichain a8505a4d50 fix: use dynamic SS58 prefix in referral/KYC address encoding
Replace hardcoded SS58 prefix 42 with api.registry.chainSS58 ?? 42
for robustness in getPendingApprovalsForReferrer, getReferralInfo,
and getMyReferrals functions.
2026-02-28 01:59:04 +03:00
pezkuwichain 99bc85f42e fix: handle all kycStatus formats in pending approvals check
toJSON() for Substrate enums can return string, object ({"approved":null}),
or number (enum index). Previous code assumed string only, causing already
approved applications to appear as pending.
2026-02-27 04:14:35 +03:00
pezkuwichain fd57a75fd9 fix: handle all kycStatus formats in pending approvals check
toJSON() for Substrate enums can return string, object ({"approved":null}),
or number (enum index). Previous code assumed string only, causing already
approved applications to appear as pending.
2026-02-27 04:14:35 +03:00
pezkuwichain 7a1d4d00e0 fix: convert hex AccountId to SS58 in referral/KYC queries
toJSON() returns hex format for AccountId fields but comparison was
against SS58 addresses, causing referrer matching to always fail.
- citizenship-workflow: encodeAddress for referrer in getPendingApprovals
- citizenship-workflow: handle both PascalCase and camelCase KycStatus
- referral: encodeAddress for referrer in getMyReferrals and getReferralInfo
2026-02-27 03:57:36 +03:00
pezkuwichain abdb67f6ca fix: convert hex AccountId to SS58 in referral/KYC queries
toJSON() returns hex format for AccountId fields but comparison was
against SS58 addresses, causing referrer matching to always fail.
- citizenship-workflow: encodeAddress for referrer in getPendingApprovals
- citizenship-workflow: handle both PascalCase and camelCase KycStatus
- referral: encodeAddress for referrer in getMyReferrals and getReferralInfo
2026-02-27 03:57:36 +03:00
pezkuwichain a77840838f fix: wait 12s before auto-verify to allow block inclusion
TX was not yet included in a block when verify fired immediately
after signing, causing first attempt to always fail. Block time on
Asset Hub is ~12s, so delay the verify call accordingly.
2026-02-26 15:55:49 +03:00
pezkuwichain c64c4bf00f fix: wait 12s before auto-verify to allow block inclusion
TX was not yet included in a block when verify fired immediately
after signing, causing first attempt to always fail. Block time on
Asset Hub is ~12s, so delay the verify call accordingly.
2026-02-26 15:55:49 +03:00
pezkuwichain f55a522eba fix: auto-verify deposit after TX sign, remove manual verify step
The manual "Verify Deposit" step required users to click a button after
signing. Hash was already captured automatically, making the manual step
redundant and risky (modal close = hash lost). Now verification starts
immediately after TX is signed, with spinner UI and retry on failure.
2026-02-26 15:30:30 +03:00
pezkuwichain aa7cc78de8 fix: auto-verify deposit after TX sign, remove manual verify step
The manual "Verify Deposit" step required users to click a button after
signing. Hash was already captured automatically, making the manual step
redundant and risky (modal close = hash lost). Now verification starts
immediately after TX is signed, with spinner UI and retry on failure.
2026-02-26 15:30:30 +03:00
pezkuwichain 768d637fdc fix: improve CitizensIssues mobile UI — two-line tab labels, responsive header 2026-02-25 05:58:58 +03:00
pezkuwichain 3e310fb980 fix: improve CitizensIssues mobile UI — two-line tab labels, responsive header 2026-02-25 05:58:58 +03:00
pezkuwichain 2e0e55c3f7 fix: improve mobile UI across all pages for 360px screens
- AppLayout: tighter button grid, smaller icons/fonts, centered dropdowns, narrower mobile menu
- HeroSection: smaller stats padding/gap, compact CTA buttons
- GovernmentEntrance: responsive title/tabs/vote layout, smaller action buttons
- Citizens: smaller portal title and announcement header
- GovernanceInterface: 2-col tab grid on mobile
2026-02-25 04:39:05 +03:00
pezkuwichain 60bdf84816 fix: improve mobile UI across all pages for 360px screens
- AppLayout: tighter button grid, smaller icons/fonts, centered dropdowns, narrower mobile menu
- HeroSection: smaller stats padding/gap, compact CTA buttons
- GovernmentEntrance: responsive title/tabs/vote layout, smaller action buttons
- Citizens: smaller portal title and announcement header
- GovernanceInterface: 2-col tab grid on mobile
2026-02-25 04:39:05 +03:00
pezkuwichain 9c1ec82175 fix: move Start Citizenship button to top bar and Ready to Join card above benefits grid 2026-02-24 23:56:07 +03:00
pezkuwichain 05280cbd45 fix: move Start Citizenship button to top bar and Ready to Join card above benefits grid 2026-02-24 23:56:07 +03:00
pezkuwichain 25754d2224 fix: improve DEX page mobile UI — smaller back button, taller chart, compact swap card
- Back to Home button: smaller padding/font on mobile, pinned to corner
- PriceChart: increase height to 280px, stack header vertically on mobile
- TokenSwap: reduce padding/gaps/fonts on mobile, fix double-colon in balance text
2026-02-24 23:48:17 +03:00
pezkuwichain cccf5dec21 fix: improve DEX page mobile UI — smaller back button, taller chart, compact swap card
- Back to Home button: smaller padding/font on mobile, pinned to corner
- PriceChart: increase height to 280px, stack header vertically on mobile
- TokenSwap: reduce padding/gaps/fonts on mobile, fix double-colon in balance text
2026-02-24 23:48:17 +03:00
pezkuwichain 385288dae3 fix: extract actual error from process-withdraw edge function response
Supabase JS client wraps non-2xx responses as generic FunctionsHttpError
("Edge Function returned a non-2xx status code"), hiding the real error.
Now reads the response body to show the actual error message.

Also adds migration to drop auth.users FK on p2p_withdrawal_limits
(already absent in production, added for migration completeness).
2026-02-24 23:01:50 +03:00
pezkuwichain 8232cdb0e1 fix: extract actual error from process-withdraw edge function response
Supabase JS client wraps non-2xx responses as generic FunctionsHttpError
("Edge Function returned a non-2xx status code"), hiding the real error.
Now reads the response body to show the actual error message.

Also adds migration to drop auth.users FK on p2p_withdrawal_limits
(already absent in production, added for migration completeness).
2026-02-24 23:01:50 +03:00
pezkuwichain 2f89afc051 fix: remove unused getApprovedChainId and stale eslint-disable 2026-02-24 22:24:44 +03:00
pezkuwichain 53854abba9 fix: remove unused getApprovedChainId and stale eslint-disable 2026-02-24 22:24:44 +03:00
pezkuwichain 240a05a999 fix: require all chains in WC session and use correct chainId
Three fixes for WC signing:

1. Changed optionalNamespaces to requiredNamespaces so wallet MUST
   approve all Pezkuwi chains (relay, asset hub, people) or reject.

2. Restored payload-based chainId in signPayload — wallet validates
   that WC chainId matches the transaction payload's genesisHash
   and rejects mismatches with "Wrong chain id passed by dApp".

3. Added session validation on restore — old sessions missing
   required chains are discarded, forcing a fresh session with
   all chains included.
2026-02-24 22:20:37 +03:00
pezkuwichain 6c1865cf55 fix: require all chains in WC session and use correct chainId
Three fixes for WC signing:

1. Changed optionalNamespaces to requiredNamespaces so wallet MUST
   approve all Pezkuwi chains (relay, asset hub, people) or reject.

2. Restored payload-based chainId in signPayload — wallet validates
   that WC chainId matches the transaction payload's genesisHash
   and rejects mismatches with "Wrong chain id passed by dApp".

3. Added session validation on restore — old sessions missing
   required chains are discarded, forcing a fresh session with
   all chains included.
2026-02-24 22:20:37 +03:00
pezkuwichain a95492dc08 fix: add missing useEffect dependencies in P2P components 2026-02-24 22:16:32 +03:00
pezkuwichain e6c8f2a537 fix: add missing useEffect dependencies in P2P components 2026-02-24 22:16:32 +03:00
pezkuwichain 4eec8d5948 fix: send plain SS58 address in WC signPayload instead of CAIP-10 2026-02-24 22:10:46 +03:00
pezkuwichain 5dc4298974 fix: send plain SS58 address in WC signPayload instead of CAIP-10 2026-02-24 22:10:46 +03:00
pezkuwichain 54c70afe4b fix: expose actual WC error message instead of generic fallback 2026-02-24 22:01:49 +03:00
pezkuwichain c79966c192 fix: expose actual WC error message instead of generic fallback 2026-02-24 22:01:49 +03:00
pezkuwichain 6d8820ced0 fix: use session-approved chainId for WC signing requests
WC SignClient validates that the request chainId is in the session's
approved namespaces. When the DApp browser creates a session, it may
only approve the relay chain. Signing requests for Asset Hub or People
Chain then fail with "Missing or invalid chainId".

Fix: always use a chainId from the session's approved chains for the
WC request. The wallet determines the actual signing chain from the
transaction payload's genesisHash, not from the WC request chainId.
2026-02-24 20:36:56 +03:00
pezkuwichain 1bedda8006 fix: use session-approved chainId for WC signing requests
WC SignClient validates that the request chainId is in the session's
approved namespaces. When the DApp browser creates a session, it may
only approve the relay chain. Signing requests for Asset Hub or People
Chain then fail with "Missing or invalid chainId".

Fix: always use a chainId from the session's approved chains for the
WC request. The wallet determines the actual signing chain from the
transaction payload's genesisHash, not from the WC request chainId.
2026-02-24 20:36:56 +03:00
pezkuwichain a4e68ff9c1 fix: hardcode chain genesis hashes in WC session to fix signing
WC session was missing Asset Hub and People Chain because their APIs
weren't connected yet at session creation time. Also fix catch blocks
in ExistingCitizenAuth that referenced undefined err variable.
2026-02-24 20:00:20 +03:00
pezkuwichain 8b906f0b84 fix: hardcode chain genesis hashes in WC session to fix signing
WC session was missing Asset Hub and People Chain because their APIs
weren't connected yet at session creation time. Also fix catch blocks
in ExistingCitizenAuth that referenced undefined err variable.
2026-02-24 20:00:20 +03:00
pezkuwichain 609953c689 fix: rewrite ID card to flow layout for mobile readability 2026-02-24 10:42:14 +03:00
pezkuwichain aac6c6581c fix: rewrite ID card to flow layout for mobile readability 2026-02-24 10:42:14 +03:00
pezkuwichain 0ddcb5d453 update: upgrade @pezkuwi/api to 16.5.36, clean up images and assets
- Upgrade @pezkuwi/api 16.5.11 -> 16.5.36 in supabase edge functions
- Remove manual SS58-to-hex workaround, use native SS58 addresses
- Add kurdistan flag and Dijital Kurdistan images
- Add PezkuwiExplorer to web public assets
- Remove unused react-logo and telegram_welcome images
- Add *.bak to gitignore
2026-02-24 10:28:47 +03:00
pezkuwichain 87b081fa60 update: upgrade @pezkuwi/api to 16.5.36, clean up images and assets
- Upgrade @pezkuwi/api 16.5.11 -> 16.5.36 in supabase edge functions
- Remove manual SS58-to-hex workaround, use native SS58 addresses
- Add kurdistan flag and Dijital Kurdistan images
- Add PezkuwiExplorer to web public assets
- Remove unused react-logo and telegram_welcome images
- Add *.bak to gitignore
2026-02-24 10:28:47 +03:00
pezkuwichain 84969d158f fix: citizen portal mobile responsive layout
- Shrink title/banner fonts and padding on mobile
- Move digital ID card above entrance buttons
- Auto-resize uploaded photos via canvas instead of 2MB limit
- Make entrance cards compact 2-column grid on all screens
2026-02-24 10:26:25 +03:00
pezkuwichain 570e426333 fix: citizen portal mobile responsive layout
- Shrink title/banner fonts and padding on mobile
- Move digital ID card above entrance buttons
- Auto-resize uploaded photos via canvas instead of 2MB limit
- Make entrance cards compact 2-column grid on all screens
2026-02-24 10:26:25 +03:00
pezkuwichain c85ae06fe1 fix: send plain SS58 address in WC signRaw instead of CAIP-10
The signRaw handler was wrapping the address in CAIP-10 format
(polkadot:<chain>:<address>) before sending to the wallet. The wallet
expects a plain SS58 address in polkadot_signMessage params, causing
InvalidChecksumException crash when trying to decode the CAIP-10 string.
2026-02-24 09:45:01 +03:00
pezkuwichain 6c4960c32a fix: send plain SS58 address in WC signRaw instead of CAIP-10
The signRaw handler was wrapping the address in CAIP-10 format
(polkadot:<chain>:<address>) before sending to the wallet. The wallet
expects a plain SS58 address in polkadot_signMessage params, causing
InvalidChecksumException crash when trying to decode the CAIP-10 string.
2026-02-24 09:45:01 +03:00