Commit Graph

842 Commits

Author SHA1 Message Date
pezkuwichain 800b956c91 feat: add wDOT, wETH, wBTC mint functionality to DEX admin panel 2026-02-06 10:10:52 +03:00
pezkuwichain 001939aae0 fix: safely extract era number in Explorer to avoid toNumber error 2026-02-06 06:31:56 +03:00
pezkuwichain 22bcc5ba64 fix: safely extract era number in Explorer to avoid toNumber error 2026-02-06 06:31:56 +03:00
pezkuwichain 2895050032 fix: update RPC endpoints to correct production URLs
- Relay Chain: wss://rpc.pezkuwichain.io
- Asset Hub: wss://asset-hub-rpc.pezkuwichain.io
- People Chain: wss://people-rpc.pezkuwichain.io
- Add Zagros testnet configuration
- Remove legacy staging/dev endpoints
- Fix port suffix in Edge Functions
2026-02-06 06:27:37 +03:00
pezkuwichain 04e7eedd53 fix: update RPC endpoints to correct production URLs
- Relay Chain: wss://rpc.pezkuwichain.io
- Asset Hub: wss://asset-hub-rpc.pezkuwichain.io
- People Chain: wss://people-rpc.pezkuwichain.io
- Add Zagros testnet configuration
- Remove legacy staging/dev endpoints
- Fix port suffix in Edge Functions
2026-02-06 06:27:37 +03:00
pezkuwichain ef41b996e9 fix: add null checks for welati pallet in all governance functions 2026-02-06 06:17:26 +03:00
pezkuwichain 3445eea8dd fix: add null checks for welati pallet in all governance functions 2026-02-06 06:17:26 +03:00
pezkuwichain 389ba7d430 fix: patch @isaacs/brace-expansion DoS vulnerability (CVE-2026) 2026-02-06 06:03:37 +03:00
pezkuwichain f03164d6ab fix: patch @isaacs/brace-expansion DoS vulnerability (CVE-2026) 2026-02-06 06:03:37 +03:00
pezkuwichain 00ab3793fe 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 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 330384fd3d chore: suppress console output in production
- Silence console.log/debug/info in production mode
- Keep filtered console.warn for important warnings
- Keep console.error for critical issues
2026-02-05 06:09:26 +03:00
pezkuwichain bb61e50794 chore: suppress console output in production
- Silence console.log/debug/info in production mode
- Keep filtered console.warn for important warnings
- Keep console.error for critical issues
2026-02-05 06:09:26 +03:00
pezkuwichain f09950c22d 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 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 cef46b373b 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 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 1a82323cd4 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 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 e9a9262e0a fix: re-export NATIVE_TOKEN_ID from utils/dex.ts 2026-02-05 01:44:05 +03:00
pezkuwichain 2800f52cfb fix: re-export NATIVE_TOKEN_ID from utils/dex.ts 2026-02-05 01:44:05 +03:00
pezkuwichain e342e959f5 fix: add eslint-disable for runtime API any types 2026-02-05 01:41:19 +03:00
pezkuwichain 6582f9df0b fix: add eslint-disable for runtime API any types 2026-02-05 01:41:19 +03:00
pezkuwichain 58d6da393e 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 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 232a4d43be 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 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 a1df2fb6a5 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 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 f32df99c1b 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 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 9e1a0d133b feat: add LP token support and display in wallet
- Add LP_TOKENS definition in shared/types/dex.ts
- Fetch LP token balances from poolAssets pallet
- Add HEZ-PEZ-LP and HEZ-USDT-LP to TokenBalances
- Add lp_token_512.png logo
2026-02-05 00:35:46 +03:00
pezkuwichain 51904c206c feat: add LP token support and display in wallet
- Add LP_TOKENS definition in shared/types/dex.ts
- Fetch LP token balances from poolAssets pallet
- Add HEZ-PEZ-LP and HEZ-USDT-LP to TokenBalances
- Add lp_token_512.png logo
2026-02-05 00:35:46 +03:00
pezkuwichain 2ba766ff8d fix: correct XCM location parsing for pool discovery
- Handle lowercase keys from chain (x2, generalIndex, here)
- Fix pool key args structure (tuple inside array)
- Native token now correctly identified as -1
2026-02-05 00:07:54 +03:00
pezkuwichain 7e3b2b6d86 fix: correct XCM location parsing for pool discovery
- Handle lowercase keys from chain (x2, generalIndex, here)
- Fix pool key args structure (tuple inside array)
- Native token now correctly identified as -1
2026-02-05 00:07:54 +03:00
pezkuwichain 51a6a39603 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 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 0f289b4767 fix: add DEVELOPMENT endpoint alias and change Total text to Toplam 2026-02-04 22:11:25 +03:00
pezkuwichain 6d0437a3af fix: add DEVELOPMENT endpoint alias and change Total text to Toplam 2026-02-04 22:11:25 +03:00
pezkuwichain 1e2efbac99 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 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 3a94838937 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
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
pezkuwichain 3534453508 fix: correct fee percentage (3% -> 0.3%) and asset ID mapping in AddLiquidityModal 2026-02-04 20:48:12 +03:00
pezkuwichain 289ed41b95 fix: correct fee percentage (3% -> 0.3%) and asset ID mapping in AddLiquidityModal 2026-02-04 20:48:12 +03:00
pezkuwichain 959c171d68 fix: remove unused AssetAccountData interface 2026-02-04 20:17:37 +03:00
pezkuwichain 254b59d985 fix: remove unused AssetAccountData interface 2026-02-04 20:17:37 +03:00
pezkuwichain 2bfbbe6d1a fix: resolve DEX pool issues with XCM Location format and slippage calculation
- Fix PoolDashboard reserve fetching (was hardcoded to 0)
- Fix slippage calculation bug in AddLiquidityModal
- Add XCM Location format support for native token (-1) in all liquidity modals
- Update KNOWN_TOKENS with correct wUSDT asset ID (1000) and add NATIVE_TOKEN_ID constant
- Implement dynamic pool discovery in fetchPools() using XCM Location parsing
- Update fetchUserLPPositions() to use correct LP token ID from chain
- Add formatAssetLocation() helper to shared/utils/dex.ts
2026-02-04 20:13:26 +03:00
pezkuwichain ddaa39653d fix: resolve DEX pool issues with XCM Location format and slippage calculation
- Fix PoolDashboard reserve fetching (was hardcoded to 0)
- Fix slippage calculation bug in AddLiquidityModal
- Add XCM Location format support for native token (-1) in all liquidity modals
- Update KNOWN_TOKENS with correct wUSDT asset ID (1000) and add NATIVE_TOKEN_ID constant
- Implement dynamic pool discovery in fetchPools() using XCM Location parsing
- Update fetchUserLPPositions() to use correct LP token ID from chain
- Add formatAssetLocation() helper to shared/utils/dex.ts
2026-02-04 20:13:26 +03:00
pezkuwichain c8fcd262c8 feat: add support for all pool combinations (wHEZ-PEZ, PEZ-USDT, wHEZ-USDT) 2026-02-04 19:32:19 +03:00