From b4647ff4404b04f8bedc57b97fbedf8f54acbc12 Mon Sep 17 00:00:00 2001 From: Linkie Link Date: Fri, 23 Feb 2024 15:10:03 +0100 Subject: [PATCH] feat: created a new ChainSelect --- public/images/tokens/stkatom.svg | 42 +++++ public/images/tokens/wsteth.svg | 26 +++ .../Wallet/WalletFetchBalancesAndAccounts.tsx | 1 + .../borrow/Table/AvailableBorrowingsTable.tsx | 2 +- src/components/borrow/Table/Columns/Name.tsx | 7 +- .../borrow/Table/Columns/useActiveColumns.tsx | 2 +- .../Table/Columns/useAvailableColumns.tsx | 10 +- src/components/common/Footer.tsx | 2 +- .../earn/lend/Table/Columns/Name.tsx | 7 +- .../Table/Columns/useAvailableColumns.tsx | 5 +- .../Table/Columns/useDepositedColumns.tsx | 2 +- src/components/header/ChainSelect.tsx | 161 ++++++++++-------- src/components/v1/V1Intro.tsx | 6 +- .../assets/{WETH.xal.ts => WETH.axl.ts} | 0 src/configs/assets/stkATOM.ts | 16 ++ src/configs/assets/wstETH.ts | 18 ++ src/configs/chains/neutron/neutron-1.ts | 86 ++++++++++ src/configs/chains/osmosis/osmosis-1.ts | 2 +- src/constants/wallets.ts | 2 +- src/hooks/useClients.ts | 1 - src/pages/BorrowPage.tsx | 2 - src/pages/FarmPage.tsx | 4 +- src/pages/HLSFarmPage.tsx | 2 - src/pages/HLSStakingPage.tsx | 2 - src/pages/LendPage.tsx | 2 - src/pages/PortfolioAccountPage.tsx | 2 - src/pages/PortfolioPage.tsx | 4 +- src/pages/TradePage.tsx | 2 - src/pages/V1Page.tsx | 2 - src/utils/getCurrentChainId.ts | 8 + 30 files changed, 324 insertions(+), 104 deletions(-) create mode 100644 public/images/tokens/stkatom.svg create mode 100644 public/images/tokens/wsteth.svg rename src/configs/assets/{WETH.xal.ts => WETH.axl.ts} (100%) create mode 100644 src/configs/assets/stkATOM.ts create mode 100644 src/configs/assets/wstETH.ts create mode 100644 src/configs/chains/neutron/neutron-1.ts diff --git a/public/images/tokens/stkatom.svg b/public/images/tokens/stkatom.svg new file mode 100644 index 00000000..c0679269 --- /dev/null +++ b/public/images/tokens/stkatom.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + diff --git a/public/images/tokens/wsteth.svg b/public/images/tokens/wsteth.svg new file mode 100644 index 00000000..656b0244 --- /dev/null +++ b/public/images/tokens/wsteth.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/src/components/Wallet/WalletFetchBalancesAndAccounts.tsx b/src/components/Wallet/WalletFetchBalancesAndAccounts.tsx index 63876f95..e006fc75 100644 --- a/src/components/Wallet/WalletFetchBalancesAndAccounts.tsx +++ b/src/components/Wallet/WalletFetchBalancesAndAccounts.tsx @@ -75,6 +75,7 @@ function Content() { urlAddress, urlAccountId, searchParams, + isV1, ]) if (isLoadingAccounts || isLoadingBalances) return diff --git a/src/components/borrow/Table/AvailableBorrowingsTable.tsx b/src/components/borrow/Table/AvailableBorrowingsTable.tsx index b025e004..5a89521d 100644 --- a/src/components/borrow/Table/AvailableBorrowingsTable.tsx +++ b/src/components/borrow/Table/AvailableBorrowingsTable.tsx @@ -13,7 +13,7 @@ type Props = { } export default function AvailableBorrowingsTable(props: Props) { - const columns = useAvailableColumns() + const columns = useAvailableColumns({ v1: false }) const renderExpanded = useCallback( (row: Row, _: TanstackTable) => { diff --git a/src/components/borrow/Table/Columns/Name.tsx b/src/components/borrow/Table/Columns/Name.tsx index 6ec22845..d4541f1f 100644 --- a/src/components/borrow/Table/Columns/Name.tsx +++ b/src/components/borrow/Table/Columns/Name.tsx @@ -5,6 +5,7 @@ export const NAME_META = { accessorKey: 'asset.symbol', header: 'Asset', id: 'sy interface Props { data: BorrowMarketTableData + v1?: boolean } export default function Name(props: Props) { @@ -12,7 +13,11 @@ export default function Name(props: Props) { return (
- +
) } diff --git a/src/components/borrow/Table/Columns/useActiveColumns.tsx b/src/components/borrow/Table/Columns/useActiveColumns.tsx index 5cc6633f..afcbef32 100644 --- a/src/components/borrow/Table/Columns/useActiveColumns.tsx +++ b/src/components/borrow/Table/Columns/useActiveColumns.tsx @@ -24,7 +24,7 @@ export default function useActiveColumns(props: Props) { return [ { ...NAME_META, - cell: ({ row }) => , + cell: ({ row }) => , }, { ...DEBT_VALUE_META, diff --git a/src/components/borrow/Table/Columns/useAvailableColumns.tsx b/src/components/borrow/Table/Columns/useAvailableColumns.tsx index 9cc2bd8e..c55f5870 100644 --- a/src/components/borrow/Table/Columns/useAvailableColumns.tsx +++ b/src/components/borrow/Table/Columns/useAvailableColumns.tsx @@ -10,12 +10,16 @@ import Liquidity, { } from 'components/borrow/Table/Columns/Liquidity' import Name, { NAME_META } from 'components/borrow/Table/Columns/Name' -export default function useAvailableColumns() { +interface Props { + v1?: boolean +} + +export default function useAvailableColumns(props: Props) { return useMemo[]>(() => { return [ { ...NAME_META, - cell: ({ row }) => , + cell: ({ row }) => , }, { ...BORROW_RATE_META, @@ -35,5 +39,5 @@ export default function useAvailableColumns() { cell: ({ row }) => , }, ] - }, []) + }, [props.v1]) } diff --git a/src/components/common/Footer.tsx b/src/components/common/Footer.tsx index ff936c6d..10fa7b7f 100644 --- a/src/components/common/Footer.tsx +++ b/src/components/common/Footer.tsx @@ -1,7 +1,7 @@ import { TextLink } from 'components/common/TextLink' import { DocURL } from 'types/enums/docURL' - import useStore from 'store' + import packageInfo from '../../../package.json' export default function Footer() { diff --git a/src/components/earn/lend/Table/Columns/Name.tsx b/src/components/earn/lend/Table/Columns/Name.tsx index a2f5db0c..ac8ecdf2 100644 --- a/src/components/earn/lend/Table/Columns/Name.tsx +++ b/src/components/earn/lend/Table/Columns/Name.tsx @@ -4,13 +4,18 @@ import TitleAndSubCell from 'components/common/TitleAndSubCell' export const NAME_META = { accessorKey: 'asset.symbol', header: 'Asset', id: 'symbol' } interface Props { asset: Asset + v1?: boolean } export default function Name(props: Props) { const { asset } = props return (
- +
) } diff --git a/src/components/earn/lend/Table/Columns/useAvailableColumns.tsx b/src/components/earn/lend/Table/Columns/useAvailableColumns.tsx index 976402c1..f776ba0e 100644 --- a/src/components/earn/lend/Table/Columns/useAvailableColumns.tsx +++ b/src/components/earn/lend/Table/Columns/useAvailableColumns.tsx @@ -12,6 +12,7 @@ import Name, { NAME_META } from 'components/earn/lend/Table/Columns/Name' interface Props { isLoading: boolean + v1?: boolean } export default function useAvailableColumns(props: Props) { @@ -19,7 +20,7 @@ export default function useAvailableColumns(props: Props) { return [ { ...NAME_META, - cell: ({ row }) => , + cell: ({ row }) => , }, { ...APY_META, @@ -45,5 +46,5 @@ export default function useAvailableColumns(props: Props) { cell: ({ row }) => , }, ] - }, [props.isLoading]) + }, [props.isLoading, props.v1]) } diff --git a/src/components/earn/lend/Table/Columns/useDepositedColumns.tsx b/src/components/earn/lend/Table/Columns/useDepositedColumns.tsx index 638888fe..aa392747 100644 --- a/src/components/earn/lend/Table/Columns/useDepositedColumns.tsx +++ b/src/components/earn/lend/Table/Columns/useDepositedColumns.tsx @@ -25,7 +25,7 @@ export default function useDepositedColumns(props: Props) { return [ { ...NAME_META, - cell: ({ row }) => , + cell: ({ row }) => , }, { ...DEPOSIT_VALUE_META, diff --git a/src/components/header/ChainSelect.tsx b/src/components/header/ChainSelect.tsx index 77035442..c56844bd 100644 --- a/src/components/header/ChainSelect.tsx +++ b/src/components/header/ChainSelect.tsx @@ -1,11 +1,12 @@ import classNames from 'classnames' -import { useCallback, useMemo } from 'react' +import React, { useCallback, useMemo } from 'react' import { useNavigate, useSearchParams } from 'react-router-dom' import { useSWRConfig } from 'swr' import Button from 'components/common/Button' import { ExternalLink } from 'components/common/Icons' import Overlay from 'components/common/Overlay' +import Radio from 'components/common/Radio' import Text from 'components/common/Text' import ChainLogo from 'components/common/chain/ChainLogo' import chains from 'configs/chains' @@ -17,14 +18,35 @@ import { NETWORK } from 'types/enums/network' import { ChainInfoID } from 'types/enums/wallet' import { getRoute } from 'utils/route' -const v1Outposts = [ +interface V1Outpost { + chainId: ChainInfoID + name: string + url: string + target: '_blank' | '_self' +} + +interface ChainOptionProps { + chainConfig?: ChainConfig + onSelect?: (chain: ChainConfig) => void + active: boolean + outpost?: V1Outpost +} + +const v1Outposts: V1Outpost[] = [ { chainId: ChainInfoID.Neutron1, name: 'Neutron', url: 'https://neutron.marsprotocol.io', target: '_blank', }, + { + chainId: ChainInfoID.Pion1, + name: 'Neutron Testnet', + url: '/v1', + target: '_self', + }, { chainId: ChainInfoID.Osmosis1, name: 'Osmosis', url: '/v1', target: '_self' }, + { chainId: ChainInfoID.OsmosisDevnet, name: 'Osmosis Devnet', url: '/v1', target: '_self' }, ] export default function ChainSelect() { @@ -55,10 +77,51 @@ export default function ChainSelect() { [setCurrentChainId, setShowMenu, mutate, navigate, searchParams], ) - const currentChains = useMemo(() => { - const currentNetworkType = process.env.NEXT_PUBLIC_NETWORK ?? NETWORK.TESTNET + const ChainOption = (props: ChainOptionProps) => { + const { onSelect, active, outpost, chainConfig } = props + return ( +
onSelect(chainConfig) + : () => { + if (chainConfig) { + setCurrentChainId(chainConfig.id) + useStore.setState({ + chainConfig, + }) + } + window.open(outpost?.url, outpost?.target) + } + } + > + + {outpost ? 'v1' : 'v2'} Outpost + {outpost && outpost.target !== '_self' && } +
+ ) + } - return Object.entries(chains).filter(([_, chain]) => chain.network === currentNetworkType) + const availableChains = useMemo(() => { + const currentNetworkType = process.env.NEXT_PUBLIC_NETWORK ?? NETWORK.TESTNET + const availableChains: { chainId: ChainInfoID; name: string }[] = [] + Object.entries(chains).forEach(([chainId, chainConfig]) => { + if (chainConfig.network !== currentNetworkType) return + availableChains.push({ chainId: chainId as ChainInfoID, name: chainConfig.name }) + }) + if (currentNetworkType === NETWORK.TESTNET) return availableChains + + v1Outposts.forEach((v1Outpost) => { + if (!availableChains.find((chain) => chain.chainId === v1Outpost.chainId)) + availableChains.push({ chainId: v1Outpost.chainId, name: v1Outpost.name }) + }) + + return availableChains }, []) return ( @@ -69,73 +132,37 @@ export default function ChainSelect() { color='secondary' onClick={() => setShowMenu()} className={classNames('!p-0 w-8 flex items-center justify-center')} - > - -
- - Select Chain - -
-
    - {currentChains.map(([name, chain]) => ( -
  • selectChain(chain)} - > - - {chain.name} -
  • - ))} -
- {process.env.NEXT_PUBLIC_NETWORK === NETWORK.MAINNET && ( - <> + /> + + {availableChains.map((chain, index) => ( +
0 && 'border-t', )} > - - V1 Outposts - + + {chain.name}
-
    - {v1Outposts.map((outpost) => ( -
  • window.open(outpost.url, outpost.target)} - key={outpost.name} - > - - - {outpost.name}{' '} - {outpost.target !== '_self' && ( - - )} - -
  • - ))} -
- - )} + {!!chains[chain.chainId] && ( + selectChain(chains[chain.chainId])} + active={chainConfig.name === chain.name && !isV1} + /> + )} + outpost.chainId === chain.chainId)} + active={chainConfig.name === chain.name && isV1} + /> +
+ ))}
) diff --git a/src/components/v1/V1Intro.tsx b/src/components/v1/V1Intro.tsx index f8212b8a..a5a67838 100644 --- a/src/components/v1/V1Intro.tsx +++ b/src/components/v1/V1Intro.tsx @@ -11,9 +11,9 @@ export default function V1Intro() { Welcome to the Red Bank!
This is the first version (v1) of the Red Bank. It provides simple lending and borrowing, - without the use of Credit Accounts. Funds are{' '} - not cross-collateralized and can‘t be used on v2 - as collateral. + without the use of Credit Accounts. +
+ Deposited funds can‘t be used on v2 as collateral. } bg='v1' diff --git a/src/configs/assets/WETH.xal.ts b/src/configs/assets/WETH.axl.ts similarity index 100% rename from src/configs/assets/WETH.xal.ts rename to src/configs/assets/WETH.axl.ts diff --git a/src/configs/assets/stkATOM.ts b/src/configs/assets/stkATOM.ts new file mode 100644 index 00000000..4116de1b --- /dev/null +++ b/src/configs/assets/stkATOM.ts @@ -0,0 +1,16 @@ +const stkATOM: AssetMetaData = { + symbol: 'stkATOM', + name: 'Persistence Staked Atom', + id: 'stkATOM', + color: '#c73238', + logo: '/images/tokens/stkatom.svg', + decimals: 6, + hasOraclePrice: true, + isEnabled: true, + isMarket: true, + isDisplayCurrency: true, + isAutoLendEnabled: false, + isStaking: true, +} + +export default stkATOM diff --git a/src/configs/assets/wstETH.ts b/src/configs/assets/wstETH.ts new file mode 100644 index 00000000..d2d24e63 --- /dev/null +++ b/src/configs/assets/wstETH.ts @@ -0,0 +1,18 @@ +const wstETH: AssetMetaData = { + symbol: 'wstETH', + id: 'wstETH', + name: 'Lido Wrapped Staked Ethereum', + color: '#00a3ff', + logo: '/images/tokens/wsteth.svg', + decimals: 18, + hasOraclePrice: true, + isEnabled: true, + isMarket: true, + isDisplayCurrency: true, + isAutoLendEnabled: true, + isBorrowEnabled: true, + pythPriceFeedId: '0x6df640f3b8963d8f8358f791f352b8364513f6ab1cca5ed3f1f7b5448980e784', + pythFeedName: 'WSTETHUSD', +} + +export default wstETH diff --git a/src/configs/chains/neutron/neutron-1.ts b/src/configs/chains/neutron/neutron-1.ts new file mode 100644 index 00000000..00f0b9bb --- /dev/null +++ b/src/configs/chains/neutron/neutron-1.ts @@ -0,0 +1,86 @@ +import { Bech32Address } from '@keplr-wallet/cosmos' + +import ATOM from 'configs/assets/ATOM' +import DYDX from 'configs/assets/DYDX' +import NTRN from 'configs/assets/NTRN' +import USDCaxl from 'configs/assets/USDC.axl' +import USDollar from 'configs/assets/USDollar' +import WETHaxl from 'configs/assets/WETH.axl' +import stATOM from 'configs/assets/stATOM' +import stkATOM from 'configs/assets/stkATOM' +import wstETH from 'configs/assets/wstETH' +import { NETWORK } from 'types/enums/network' +import { ChainInfoID } from 'types/enums/wallet' + +const Neutron1: ChainConfig = { + assets: [ + { ...NTRN, denom: 'untrn' }, + { ...USDCaxl, denom: 'ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349' }, + { + ...ATOM, + denom: 'ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9', + }, + { + ...stATOM, + denom: 'ibc/B7864B03E1B9FD4F049243E92ABD691586F682137037A9F3FCA5222815620B3C', + }, + { + ...stkATOM, + denom: 'ibc/3649CE0C8A2C79048D8C6F31FF18FA69C9BC7EB193512E0BD03B733011290445', + }, + { ...WETHaxl, denom: 'ibc/A585C2D15DCD3B010849B453A2CFCB5E213208A5AB665691792684C26274304D' }, + { + ...wstETH, + denom: 'factory/neutron1ug740qrkquxzrk2hh29qrlx3sktkfml3je7juusc2te7xmvsscns0n2wry/wstETH', + }, + { ...DYDX, denom: 'ibc/2CB87BCE0937B1D1DFCEE79BE4501AAF3C265E923509AEAC410AD85D27F35130' }, + USDollar, + ], + id: ChainInfoID.Neutron1, + name: 'Neutron', + contracts: { + redBank: 'neutron1n97wnm7q6d2hrcna3rqlnyqw2we6k0l8uqvmyqq6gsml92epdu7quugyph', + incentives: 'neutron1aszpdh35zsaz0yj80mz7f5dtl9zq5jfl8hgm094y0j0vsychfekqxhzd39', + oracle: 'neutron1dwp6m7pdrz6rnhdyrx5ha0acsduydqcpzkylvfgspsz60pj2agxqaqrr7g', + swapper: 'neutron1udr9fc3kd743dezrj38v2ac74pxxr6qsx4xt4nfpcfczgw52rvyqyjp5au', + params: 'neutron16kqg3hr2qc36gz2wqvdzsctatkmzd3ss5gc07tnj6u3n5ajw89asrx8hfp', + creditManager: 'neutron1kj50g96c86nu7jmy5y7uy5cyjanntgru0eekmwz2qcmyyvx6383s8dgvm6', + accountNft: 'neutron17wvpxdc3k37054ume0ga4r0r6ra2rpfe622m0ecgd9s7xd5s0qusspc4ct', + perps: 'neutron14v9g7regs90qvful7djcajsvrfep5pg9qau7qm6wya6c2lzcpnms692dlt', + pyth: 'neutron1m2emc93m9gpwgsrsf2vylv9xvgqh654630v7dfrhrkmr5slly53spg85wv', + }, + endpoints: { + routes: 'https://app.astroport.fi/api/routes', + rpc: process.env.NEXT_PUBLIC_NEUTRON_RPC ?? 'https://rpc-kralum.neutron-1.neutron.org', + rest: process.env.NEXT_PUBLIC_NEUTRON_REST ?? 'https://rest-kralum.neutron-1.neutron.org', + swap: 'https://neutron.astroport.fi/swap', + pools: '', //TODO: ⛓️ Implement this + explorer: 'https://mintscan.io/neutron', + aprs: { + vaults: 'https://api.marsprotocol.io/v1/vaults/neutron', + stride: 'https://edge.stride.zone/api/stake-stats', + }, + }, + network: NETWORK.MAINNET, + vaults: [], + explorerName: 'Mintscan', + bech32Config: Bech32Address.defaultBech32Config('neutron'), + defaultCurrency: { + coinDenom: 'NTRN', + coinMinimalDenom: 'untrn', + coinDecimals: 6, + coinGeckoId: 'neutron', + gasPriceStep: { + low: 0, + average: 0.025, + high: 0.04, + }, + }, + features: ['ibc-transfer', 'ibc-go'], + gasPrice: '0.025untrn', + hls: false, + perps: false, + farm: false, +} + +export default Neutron1 diff --git a/src/configs/chains/osmosis/osmosis-1.ts b/src/configs/chains/osmosis/osmosis-1.ts index b25594e8..227c022b 100644 --- a/src/configs/chains/osmosis/osmosis-1.ts +++ b/src/configs/chains/osmosis/osmosis-1.ts @@ -13,7 +13,7 @@ import USDCaxl from 'configs/assets/USDC.axl' import USDT from 'configs/assets/USDT' import USDollar from 'configs/assets/USDollar' import WBTCaxl from 'configs/assets/WBTC.axl' -import WETHaxl from 'configs/assets/WETH.xal' +import WETHaxl from 'configs/assets/WETH.axl' import OSMO_ATOM from 'configs/assets/lp/OSMO-ATOM' import OSMO_USDC from 'configs/assets/lp/OSMO_USDC' import OSMO_WBTC from 'configs/assets/lp/OSMO_WBTC' diff --git a/src/constants/wallets.ts b/src/constants/wallets.ts index c641fbf9..062d7948 100644 --- a/src/constants/wallets.ts +++ b/src/constants/wallets.ts @@ -15,7 +15,7 @@ export const WALLETS: WalletInfos = { walletConnect: 'Cosmostation WalletConnect', imageURL: '/images/wallets/cosmostation.png', mobileImageURL: '/images/wallets/cosmostation-wc.png', - supportedChains: [ChainInfoID.Osmosis1, ChainInfoID.OsmosisDevnet], + supportedChains: [ChainInfoID.Osmosis1, ChainInfoID.OsmosisDevnet, ChainInfoID.Pion1], }, [WalletID.Keplr]: { name: 'Keplr Wallet', diff --git a/src/hooks/useClients.ts b/src/hooks/useClients.ts index 7fbee02f..4cd3d471 100644 --- a/src/hooks/useClients.ts +++ b/src/hooks/useClients.ts @@ -20,7 +20,6 @@ export default function useClients() { `chains/${chainConfig.id}/clients`, async () => { const client = await CosmWasmClient.connect(getUrl(chainConfig.endpoints.rpc)) - return { creditManager: new MarsCreditManagerQueryClient( client, diff --git a/src/pages/BorrowPage.tsx b/src/pages/BorrowPage.tsx index 8eefc851..eec33e71 100644 --- a/src/pages/BorrowPage.tsx +++ b/src/pages/BorrowPage.tsx @@ -1,11 +1,9 @@ import Borrowings from 'components/borrow/Borrowings' import BorrowIntro from 'components/borrow/BorrowIntro' -import MigrationBanner from 'components/common/MigrationBanner' export default function BorrowPage() { return (
-
diff --git a/src/pages/FarmPage.tsx b/src/pages/FarmPage.tsx index 4c6bcccd..07938c9c 100644 --- a/src/pages/FarmPage.tsx +++ b/src/pages/FarmPage.tsx @@ -1,13 +1,11 @@ +import Tab from 'components/earn/Tab' import FarmIntro from 'components/earn/farm/FarmIntro' import Vaults from 'components/earn/farm/Vaults' -import Tab from 'components/earn/Tab' -import MigrationBanner from 'components/common/MigrationBanner' import { EARN_TABS } from 'constants/pages' export default function FarmPage() { return (
- diff --git a/src/pages/HLSFarmPage.tsx b/src/pages/HLSFarmPage.tsx index 40e75b38..290ceb4a 100644 --- a/src/pages/HLSFarmPage.tsx +++ b/src/pages/HLSFarmPage.tsx @@ -1,13 +1,11 @@ import Tab from 'components/earn/Tab' import AvailableHLSVaults from 'components/hls/Farm/AvailableHLSVaults' import HlsFarmIntro from 'components/hls/Farm/HLSFarmIntro' -import MigrationBanner from 'components/common/MigrationBanner' import { HLS_TABS } from 'constants/pages' export default function HLSFarmPage() { return (
- diff --git a/src/pages/HLSStakingPage.tsx b/src/pages/HLSStakingPage.tsx index 3aeac7c8..d8f57501 100644 --- a/src/pages/HLSStakingPage.tsx +++ b/src/pages/HLSStakingPage.tsx @@ -2,13 +2,11 @@ import Tab from 'components/earn/Tab' import ActiveStakingAccounts from 'components/hls/Staking/ActiveStakingAccounts' import AvailableHlsStakingAssets from 'components/hls/Staking/AvailableHLSStakingAssets' import HLSStakingIntro from 'components/hls/Staking/HLSStakingIntro' -import MigrationBanner from 'components/common/MigrationBanner' import { HLS_TABS } from 'constants/pages' export default function HLSStakingPage() { return (
- diff --git a/src/pages/LendPage.tsx b/src/pages/LendPage.tsx index 81a15210..450ede17 100644 --- a/src/pages/LendPage.tsx +++ b/src/pages/LendPage.tsx @@ -1,4 +1,3 @@ -import MigrationBanner from 'components/common/MigrationBanner' import Tab from 'components/earn/Tab' import LendIntro from 'components/earn/lend/LendIntro' import Lends from 'components/earn/lend/Lends' @@ -10,7 +9,6 @@ export default function LendPage() { return (
- {chainConfig.farm && } diff --git a/src/pages/PortfolioAccountPage.tsx b/src/pages/PortfolioAccountPage.tsx index b0308320..ab0464b5 100644 --- a/src/pages/PortfolioAccountPage.tsx +++ b/src/pages/PortfolioAccountPage.tsx @@ -1,6 +1,5 @@ import { useNavigate, useParams, useSearchParams } from 'react-router-dom' -import MigrationBanner from 'components/common/MigrationBanner' import ShareBar from 'components/common/ShareBar' import Balances from 'components/portfolio/Account/Balances' import BreadCrumbs from 'components/portfolio/Account/BreadCrumbs' @@ -25,7 +24,6 @@ export default function PortfolioAccountPage() { return (
- diff --git a/src/pages/PortfolioPage.tsx b/src/pages/PortfolioPage.tsx index 6e7269c2..0d05c6ae 100644 --- a/src/pages/PortfolioPage.tsx +++ b/src/pages/PortfolioPage.tsx @@ -1,13 +1,11 @@ -import MigrationBanner from 'components/common/MigrationBanner' +import ShareBar from 'components/common/ShareBar' import AccountOverview from 'components/portfolio/Overview' import PortfolioSummary from 'components/portfolio/Overview/Summary' import PortfolioIntro from 'components/portfolio/PortfolioIntro' -import ShareBar from 'components/common/ShareBar' export default function PortfolioPage() { return (
- diff --git a/src/pages/TradePage.tsx b/src/pages/TradePage.tsx index 0a27a128..34eef272 100644 --- a/src/pages/TradePage.tsx +++ b/src/pages/TradePage.tsx @@ -1,7 +1,6 @@ import { useMemo } from 'react' import { useLocation } from 'react-router-dom' -import MigrationBanner from 'components/common/MigrationBanner' import AccountDetailsCard from 'components/trade/AccountDetailsCard' import TradeChart from 'components/trade/TradeChart' import TradeModule from 'components/trade/TradeModule' @@ -47,7 +46,6 @@ export default function TradePage() { ) return (
-
diff --git a/src/pages/V1Page.tsx b/src/pages/V1Page.tsx index 9ca42fb5..0236c50a 100644 --- a/src/pages/V1Page.tsx +++ b/src/pages/V1Page.tsx @@ -1,4 +1,3 @@ -import MigrationBanner from 'components/common/MigrationBanner' import Summary from 'components/portfolio/Account/Summary' import Borrowings from 'components/v1/Borrowings' import Deposits from 'components/v1/Deposits' @@ -9,7 +8,6 @@ export default function V1Page() { const address = useStore((s) => s.address) return (
- {address && }
diff --git a/src/utils/getCurrentChainId.ts b/src/utils/getCurrentChainId.ts index 2350c12a..701e5400 100644 --- a/src/utils/getCurrentChainId.ts +++ b/src/utils/getCurrentChainId.ts @@ -23,6 +23,10 @@ export const getCurrentChainId = () => { if (currentNetwork === NETWORK.TESTNET) chainId = ChainInfoID.OsmosisDevnet break + case 'neutron': + if (currentNetwork === NETWORK.MAINNET) chainId = ChainInfoID.Neutron1 + break + case 'testnet-neutron': if (currentNetwork === NETWORK.TESTNET) chainId = ChainInfoID.Pion1 break @@ -42,6 +46,10 @@ export const getCurrentChainId = () => { if (currentNetwork === NETWORK.TESTNET) chainId = ChainInfoID.OsmosisDevnet break + case ChainInfoID.Neutron1: + if (currentNetwork === NETWORK.MAINNET) chainId = ChainInfoID.Neutron1 + break + case ChainInfoID.Pion1: if (currentNetwork === NETWORK.TESTNET) chainId = ChainInfoID.Pion1 break