Skip to content

Commit

Permalink
feat: swell
Browse files Browse the repository at this point in the history
  • Loading branch information
rhlsthrm committed Dec 20, 2024
1 parent 0cbd6a8 commit 2c1f8a8
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 6 deletions.
4 changes: 3 additions & 1 deletion packages/ui/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ createAppKit({
[mode.id]: 'https://icons.llamao.fi/icons/chains/rsz_mode.jpg',
[bob.id]: 'https://icons.llamao.fi/icons/chains/rsz_bob.jpg',
[fraxtal.id]: 'https://icons.llamao.fi/icons/chains/rsz_fraxtal.jpg',
[superseed.id]: 'https://icons.llamao.fi/icons/chains/rsz_superseed.jpg'
[superseed.id]: '/logo/img/SUPERSEED.png',
[swellchain.id]: '/logo/img/SWELL.png',
[ink.id]: '/logo/img/INK.png'
}
});

Expand Down
2 changes: 2 additions & 0 deletions packages/ui/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type CONFIG = {
isSuperseedEnabled: boolean;
isWorldchainEnabled: boolean;
isInkEnabled: boolean;
isSwellEnabled: boolean;
isTestnetEnabled: boolean;
productDomain: string | undefined;
productUrl: string | undefined;
Expand Down Expand Up @@ -42,6 +43,7 @@ const config: CONFIG = {
isSuperseedEnabled: true,
isWorldchainEnabled: true,
isInkEnabled: true,
isSwellEnabled: true,
isTestnetEnabled: process.env.NEXT_PUBLIC_SHOW_TESTNETS === 'true',
productDomain: process.env.PRODUCT_DOMAIN,
productUrl: process.env.PRODUCT_URL,
Expand Down
8 changes: 7 additions & 1 deletion packages/ui/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,13 @@ export const pools: Record<number, PoolParams> = {
text: 'text-white',
border: 'border-swell',
logo: '/img/logo/SWELL.png',
pools: []
pools: [
{
id: '0',
name: 'Main Pool',
assets: ['WETH']
}
]
}
};

Expand Down
7 changes: 7 additions & 0 deletions packages/ui/hooks/useFusePoolData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export const useFusePoolData = (
return undefined;
}
}, [usdPrices, poolChainId]);
console.log('🚀 ~ usdPrice ~ usdPrices:', usdPrices);
console.log('🚀 ~ usdPrice ~ poolChainId:', poolChainId);
console.log('🚀 ~ queryFn: ~ usdPrice:', usdPrice);
console.log('🚀 ~ queryFn: ~ sdk?.chainId:', sdk?.chainId);
console.log('🚀 ~ queryFn: ~ poolId:', poolId);
console.log('🚀 ~ queryFn: ~ address:', address);
console.log('🚀 ~ queryFn: ~ excludeNonBorrowable:', excludeNonBorrowable);

return useQuery({
queryKey: [
Expand Down
Binary file added packages/ui/public/img/logo/SWELL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion packages/ui/types/ChainMetaData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
lisk,
superseed,
worldchain,
ink
ink,
swellchain
} from '@ionicprotocol/chains';
import type { IonicPoolData } from '@ionicprotocol/types';

Expand Down Expand Up @@ -51,6 +52,10 @@ export const supportedChainIdToConfig: {
[ink.chainId]: {
enabled: config.isInkEnabled,
supported: config.isInkEnabled
},
[swellchain.chainId]: {
enabled: config.isSwellEnabled,
supported: config.isSwellEnabled
}
};

Expand Down
14 changes: 11 additions & 3 deletions packages/ui/utils/networkData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import {
superseed,
worldchain,
ink,
vInk
vInk,
swellchain,
vSwellchain
} from '@ionicprotocol/chains';
import { SupportedChains } from '@ionicprotocol/types';
import type {
Expand Down Expand Up @@ -113,6 +115,10 @@ export function getEnabledChains() {
enabledChains.push(vInk);
}

if (config.isSwellEnabled) {
enabledChains.push(vSwellchain);
}

return enabledChains;
}

Expand All @@ -125,7 +131,8 @@ export const ChainSupportedAssets: ChainSupportedAssetsType = {
[SupportedChains.lisk]: lisk.assets,
[SupportedChains.superseed]: superseed.assets,
[SupportedChains.worldchain]: worldchain.assets,
[SupportedChains.ink]: ink.assets
[SupportedChains.ink]: ink.assets,
[SupportedChains.swell]: swellchain.assets
};

export const deployedPlugins: { [chainId: string]: DeployedPluginsType } = {
Expand All @@ -137,5 +144,6 @@ export const deployedPlugins: { [chainId: string]: DeployedPluginsType } = {
[SupportedChains.lisk]: lisk.deployedPlugins,
[SupportedChains.superseed]: superseed.deployedPlugins,
[SupportedChains.worldchain]: worldchain.deployedPlugins,
[SupportedChains.ink]: ink.deployedPlugins
[SupportedChains.ink]: ink.deployedPlugins,
[SupportedChains.swell]: swellchain.deployedPlugins
};

0 comments on commit 2c1f8a8

Please sign in to comment.