mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-04-22 12:28:02 +00:00
feat: add HEZ/DOT pool support and fix user-facing token names
- Add HEZ/DOT pool to PoolDashboard - Display DOT, ETH, BTC instead of wDOT, wETH, wBTC to users - Update priceOracle with correct symbol mappings - Fix lint errors in check_all_pools.mjs - Extract MINTABLE_ASSETS to separate file for fast refresh
This commit is contained in:
@@ -8,7 +8,8 @@ import PoolDashboard from '@/components/PoolDashboard';
|
||||
import { CreatePoolModal } from './CreatePoolModal';
|
||||
import { InitializeHezPoolModal } from './InitializeHezPoolModal';
|
||||
import { InitializeUsdtModal } from './InitializeUsdtModal';
|
||||
import { MintAssetModal, MINTABLE_ASSETS, type AssetConfig } from './MintAssetModal';
|
||||
import { MintAssetModal } from './MintAssetModal';
|
||||
import { MINTABLE_ASSETS, type AssetConfig } from './mintableAssets';
|
||||
import { XCMConfigurationWizard } from '@/components/admin/XCMConfigurationWizard';
|
||||
import { ArrowRightLeft, Droplet, Settings } from 'lucide-react';
|
||||
import { isFounderWallet } from '@pezkuwi/utils/auth';
|
||||
|
||||
@@ -8,16 +8,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Alert, AlertDescription } from '@/components/ui/alert';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
|
||||
export interface AssetConfig {
|
||||
id: number;
|
||||
symbol: string;
|
||||
name: string;
|
||||
decimals: number;
|
||||
logo?: string;
|
||||
defaultAmount?: string;
|
||||
color?: string; // For theming (green, blue, orange, etc.)
|
||||
}
|
||||
import type { AssetConfig } from './mintableAssets';
|
||||
|
||||
interface MintAssetModalProps {
|
||||
isOpen: boolean;
|
||||
@@ -327,43 +318,3 @@ export const MintAssetModal: React.FC<MintAssetModalProps> = ({
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
// Pre-configured assets for easy use
|
||||
export const MINTABLE_ASSETS: Record<string, AssetConfig> = {
|
||||
wUSDT: {
|
||||
id: 1000,
|
||||
symbol: 'wUSDT',
|
||||
name: 'Wrapped USDT',
|
||||
decimals: 6,
|
||||
logo: '/shared/images/USDT(hez)logo.png',
|
||||
defaultAmount: '10000',
|
||||
color: 'green',
|
||||
},
|
||||
wDOT: {
|
||||
id: 1001,
|
||||
symbol: 'wDOT',
|
||||
name: 'Wrapped DOT',
|
||||
decimals: 10,
|
||||
logo: '/shared/images/dot.png',
|
||||
defaultAmount: '100',
|
||||
color: 'pink',
|
||||
},
|
||||
wETH: {
|
||||
id: 1002,
|
||||
symbol: 'wETH',
|
||||
name: 'Wrapped ETH',
|
||||
decimals: 18,
|
||||
logo: '/shared/images/etherium.png',
|
||||
defaultAmount: '10',
|
||||
color: 'purple',
|
||||
},
|
||||
wBTC: {
|
||||
id: 1003,
|
||||
symbol: 'wBTC',
|
||||
name: 'Wrapped BTC',
|
||||
decimals: 8,
|
||||
logo: '/shared/images/bitcoin.png',
|
||||
defaultAmount: '1',
|
||||
color: 'orange',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -28,9 +28,9 @@ type TransactionStatus = 'idle' | 'signing' | 'submitting' | 'success' | 'error'
|
||||
const USER_TOKENS = [
|
||||
{ symbol: 'HEZ', emoji: '🟡', assetId: -1, name: 'HEZ', decimals: 12, displaySymbol: 'HEZ', logo: '/shared/images/hez_token_512.png' },
|
||||
{ symbol: 'USDT', emoji: '💵', assetId: 1000, name: 'USDT', decimals: 6, displaySymbol: 'USDT', logo: '/shared/images/USDT(hez)logo.png' },
|
||||
{ symbol: 'wDOT', emoji: '🔴', assetId: 1001, name: 'Wrapped DOT', decimals: 10, displaySymbol: 'wDOT', logo: '/shared/images/dot.png' },
|
||||
{ symbol: 'wETH', emoji: '💎', assetId: 1002, name: 'Wrapped ETH', decimals: 18, displaySymbol: 'wETH', logo: '/shared/images/etherium.png' },
|
||||
{ symbol: 'wBTC', emoji: '🟠', assetId: 1003, name: 'Wrapped BTC', decimals: 8, displaySymbol: 'wBTC', logo: '/shared/images/bitcoin.png' },
|
||||
{ symbol: 'DOT', emoji: '🔴', assetId: 1001, name: 'DOT', decimals: 10, displaySymbol: 'DOT', logo: '/shared/images/dot.png' },
|
||||
{ symbol: 'ETH', emoji: '💎', assetId: 1002, name: 'ETH', decimals: 18, displaySymbol: 'ETH', logo: '/shared/images/etherium.png' },
|
||||
{ symbol: 'BTC', emoji: '🟠', assetId: 1003, name: 'BTC', decimals: 8, displaySymbol: 'BTC', logo: '/shared/images/bitcoin.png' },
|
||||
] as const;
|
||||
|
||||
export const SwapInterface: React.FC<SwapInterfaceProps> = ({ pools }) => {
|
||||
@@ -266,9 +266,9 @@ export const SwapInterface: React.FC<SwapInterfaceProps> = ({ pools }) => {
|
||||
switch (symbol) {
|
||||
case 'HEZ': return nativeLocation;
|
||||
case 'USDT': return usdtLocation;
|
||||
case 'wDOT': return wdotLocation;
|
||||
case 'wETH': return wethLocation;
|
||||
case 'wBTC': return wbtcLocation;
|
||||
case 'DOT': return wdotLocation;
|
||||
case 'ETH': return wethLocation;
|
||||
case 'BTC': return wbtcLocation;
|
||||
default: return formatAssetLocation(fromAssetId!);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
export interface AssetConfig {
|
||||
id: number;
|
||||
symbol: string;
|
||||
name: string;
|
||||
decimals: number;
|
||||
logo?: string;
|
||||
defaultAmount?: string;
|
||||
color?: string; // For theming (green, blue, orange, etc.)
|
||||
}
|
||||
|
||||
// Pre-configured assets for easy use
|
||||
export const MINTABLE_ASSETS: Record<string, AssetConfig> = {
|
||||
wUSDT: {
|
||||
id: 1000,
|
||||
symbol: 'wUSDT',
|
||||
name: 'Wrapped USDT',
|
||||
decimals: 6,
|
||||
logo: '/shared/images/USDT(hez)logo.png',
|
||||
defaultAmount: '10000',
|
||||
color: 'green',
|
||||
},
|
||||
wDOT: {
|
||||
id: 1001,
|
||||
symbol: 'wDOT',
|
||||
name: 'Wrapped DOT',
|
||||
decimals: 10,
|
||||
logo: '/shared/images/dot.png',
|
||||
defaultAmount: '100',
|
||||
color: 'pink',
|
||||
},
|
||||
wETH: {
|
||||
id: 1002,
|
||||
symbol: 'wETH',
|
||||
name: 'Wrapped ETH',
|
||||
decimals: 18,
|
||||
logo: '/shared/images/etherium.png',
|
||||
defaultAmount: '10',
|
||||
color: 'purple',
|
||||
},
|
||||
wBTC: {
|
||||
id: 1003,
|
||||
symbol: 'wBTC',
|
||||
name: 'Wrapped BTC',
|
||||
decimals: 8,
|
||||
logo: '/shared/images/bitcoin.png',
|
||||
defaultAmount: '1',
|
||||
color: 'orange',
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user