mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 09:07:55 +00:00
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
This commit is contained in:
@@ -77,8 +77,17 @@ export interface PoolCreationParams {
|
||||
feeRate?: number;
|
||||
}
|
||||
|
||||
// Native token ID constant (relay chain HEZ)
|
||||
export const NATIVE_TOKEN_ID = -1;
|
||||
|
||||
// Known tokens on testnet
|
||||
export const KNOWN_TOKENS: Record<number, TokenInfo> = {
|
||||
[-1]: {
|
||||
id: -1,
|
||||
symbol: 'HEZ',
|
||||
name: 'Native HEZ',
|
||||
decimals: 12,
|
||||
},
|
||||
0: {
|
||||
id: 0,
|
||||
symbol: 'wHEZ',
|
||||
@@ -93,6 +102,12 @@ export const KNOWN_TOKENS: Record<number, TokenInfo> = {
|
||||
},
|
||||
2: {
|
||||
id: 2,
|
||||
symbol: 'wHEZ',
|
||||
name: 'Wrapped HEZ (Asset Hub)',
|
||||
decimals: 12,
|
||||
},
|
||||
1000: {
|
||||
id: 1000,
|
||||
symbol: 'wUSDT',
|
||||
name: 'Wrapped USDT',
|
||||
decimals: 6,
|
||||
|
||||
Reference in New Issue
Block a user