feat: created a new ChainSelect

This commit is contained in:
Linkie Link 2024-02-23 15:10:03 +01:00
parent 103246261f
commit b4647ff440
No known key found for this signature in database
GPG Key ID: 5318B0F2564D38EA
30 changed files with 324 additions and 104 deletions

View File

@ -0,0 +1,42 @@
<svg viewBox="0 0 200 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M100.881 178.044C144.869 178.044 180.531 142.388 180.531 98.4C180.531 54.4124 144.869 18.75 100.881 18.75C56.8939 18.75 21.2378 54.4124 21.2378 98.4C21.2378 142.388 56.8939 178.044 100.881 178.044Z"
fill="#2E3148"
/>
<path
d="M100.694 143.475C126.106 143.475 146.712 122.869 146.712 97.4562C146.712 72.0437 126.106 51.4375 100.694 51.4375C75.2749 51.4375 54.6748 72.0437 54.6748 97.4562C54.6748 122.869 75.2749 143.475 100.694 143.475Z"
fill="#1B1E36"
/>
<path
d="M200 97.5C200 110.631 197.412 123.631 192.387 135.769C187.362 147.9 179.994 158.925 170.712 168.206C161.425 177.494 150.4 184.862 138.269 189.887C126.137 194.912 113.131 197.5 100 197.5C86.8687 197.5 73.8625 194.912 61.7313 189.887C49.6001 184.862 38.5748 177.494 29.2873 168.206C20.0061 158.925 12.6376 147.9 7.61262 135.769C2.58761 123.631 0 110.631 0 97.5H23.9689C23.9689 107.481 25.9312 117.369 29.7562 126.594C33.5749 135.819 39.1751 144.2 46.2376 151.262C53.3001 158.319 61.6811 163.925 70.9063 167.744C80.1313 171.563 90.0125 173.531 100 173.531C109.988 173.531 119.869 171.563 129.094 167.744C138.319 163.925 146.7 158.319 153.762 151.262C160.825 144.2 166.425 135.819 170.244 126.594C174.069 117.369 176.031 107.481 176.031 97.5H200Z"
fill="#C73238"
/>
<path
d="M178.95 97.5C178.95 107.869 176.906 118.131 172.937 127.712C168.969 137.287 163.156 145.994 155.825 153.325C148.494 160.656 139.794 166.469 130.212 170.438C120.637 174.406 110.369 176.444 99.9998 176.444C89.631 176.444 79.3685 174.406 69.7873 170.438C60.2124 166.469 51.506 160.656 44.1747 153.325C36.8435 145.994 31.0312 137.287 27.0624 127.712C23.0937 118.131 21.0562 107.869 21.0562 97.5H99.9998H178.95Z"
fill="#070B09"
/>
<path
d="M99.2748 28.6934C90.8686 28.6934 84.0498 59.1809 84.0498 96.7934C84.0498 134.406 90.8686 164.893 99.2748 164.893C107.681 164.893 114.5 134.406 114.5 96.7934C114.5 59.1809 107.681 28.6934 99.2748 28.6934ZM100.325 161.05C99.3623 162.331 98.3998 161.368 98.3998 161.368C94.5311 156.887 92.5936 148.55 92.5936 148.55C85.8248 126.762 87.4373 79.9684 87.4373 79.9684C90.6186 42.8247 96.4061 34.0495 98.3748 32.0995C98.5811 31.8995 98.8436 31.7808 99.1248 31.7558C99.4061 31.737 99.6873 31.8121 99.9186 31.9746C102.775 33.9996 105.175 42.4745 105.175 42.4745C112.256 68.7496 111.612 93.4309 111.612 93.4309C112.256 114.9 108.069 138.937 108.069 138.937C104.844 157.2 100.325 161.05 100.325 161.05Z"
fill="white"
/>
<path
d="M158.338 62.9C154.156 55.6063 124.319 64.8687 91.6814 83.5812C59.0376 102.3 36.0126 123.387 40.2001 130.675C44.3814 137.969 74.2189 128.713 106.856 109.994C139.5 91.275 162.525 70.1875 158.338 62.9ZM44.0564 129.675C42.4564 129.475 42.8189 128.156 42.8189 128.156C44.7814 122.569 51.0377 116.744 51.0377 116.744C66.5814 100.025 107.969 78.1375 107.969 78.1375C141.769 62.4126 152.269 63.075 154.931 63.8062C155.206 63.8875 155.444 64.0562 155.6 64.2875C155.763 64.525 155.831 64.8062 155.806 65.0875C155.481 68.5812 149.313 74.8687 149.313 74.8687C130.056 94.1 108.331 105.825 108.331 105.825C90.0252 117.069 67.0939 125.394 67.0939 125.394C49.6437 131.681 44.0564 129.675 44.0564 129.675Z"
fill="white"
/>
<path
d="M158.194 130.919C162.412 123.644 139.45 102.457 106.925 83.6007C74.3998 64.7445 44.5623 55.3695 40.3498 62.657C36.1373 69.9445 59.1 91.1132 91.6436 109.969C124.187 128.832 153.981 138.207 158.194 130.919ZM43.1437 65.4695C42.5249 63.9882 43.8373 63.6382 43.8373 63.6382C49.6623 62.5382 57.8376 65.0382 57.8376 65.0382C80.0873 70.107 119.769 94.9632 119.769 94.9632C150.312 116.338 155 125.751 155.7 128.426C155.775 128.701 155.744 128.988 155.625 129.244C155.5 129.501 155.294 129.707 155.037 129.819C151.85 131.282 143.319 129.107 143.319 129.107C117.025 122.057 95.9936 109.138 95.9936 109.138C77.0998 98.9507 58.4124 83.2695 58.4124 83.2695C44.2187 71.3132 43.1498 65.482 43.1498 65.482L43.1437 65.4695Z"
fill="white"
/>
<path
d="M99.1126 104.63C103.538 104.63 107.125 101.043 107.125 96.618C107.125 92.193 103.538 88.6055 99.1126 88.6055C94.6876 88.6055 91.1001 92.193 91.1001 96.618C91.1001 101.043 94.6876 104.63 99.1126 104.63Z"
fill="white"
/>
<path
d="M131.969 70.6691C134.531 70.6691 136.613 68.5191 136.613 65.8628C136.613 63.2066 134.531 61.0566 131.969 61.0566C129.4 61.0566 127.319 63.2066 127.319 65.8628C127.319 68.5191 129.4 70.6691 131.969 70.6691Z"
fill="white"
/>
<path
d="M55.6873 87.0133C58.2498 87.0133 60.3313 84.857 60.3313 82.207C60.3313 79.5508 58.2498 77.3945 55.6873 77.3945C53.1185 77.3945 51.0376 79.5508 51.0376 82.207C51.0376 84.857 53.1185 87.0133 55.6873 87.0133Z"
fill="white"
/>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -0,0 +1,26 @@
<svg viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="512" height="512" rx="256" fill="#00A3FF" />
<path
opacity="0.6"
d="M361.012 237.812L363.878 242.209C396.204 291.798 388.984 356.742 346.52 398.348C321.539 422.826 288.798 435.066 256.056 435.069C256.056 435.069 256.056 435.069 361.012 237.812Z"
fill="white"
/>
<path
opacity="0.2"
d="M256.044 297.764L361 237.812C256.045 435.069 256.044 435.069 256.044 435.069C256.044 392.108 256.044 342.88 256.044 297.764Z"
fill="white"
/>
<path
d="M150.988 237.812L148.122 242.209C115.796 291.798 123.016 356.742 165.48 398.348C190.461 422.826 223.202 435.066 255.944 435.069C255.944 435.069 255.944 435.069 150.988 237.812Z"
fill="white"
/>
<path
opacity="0.6"
d="M255.914 297.764L150.958 237.812C255.914 435.069 255.914 435.069 255.914 435.069C255.914 392.108 255.914 342.88 255.914 297.764Z"
fill="white"
/>
<path opacity="0.2" d="M256.083 163.833V267.233L346.491 215.566L256.083 163.833Z" fill="white" />
<path opacity="0.6" d="M256.056 163.833L165.583 215.565L256.056 267.233V163.833Z" fill="white" />
<path d="M256.056 76.875L165.583 215.599L256.056 163.722V76.875Z" fill="white" />
<path opacity="0.6" d="M256.083 163.706L346.56 215.585L256.083 76.7916V163.706Z" fill="white" />
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -75,6 +75,7 @@ function Content() {
urlAddress,
urlAccountId,
searchParams,
isV1,
])
if (isLoadingAccounts || isLoadingBalances) return <FetchLoading />

View File

@ -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<BorrowMarketTableData>, _: TanstackTable<BorrowMarketTableData>) => {

View File

@ -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 (
<div className='flex items-center flex-1 gap-3'>
<AssetImage asset={asset} size={32} />
<TitleAndSubCell title={asset.symbol} sub={asset.name} className='text-left min-w-15' />
<TitleAndSubCell
title={asset.symbol}
sub={props.v1 ? '' : asset.name}
className='text-left min-w-15'
/>
</div>
)
}

View File

@ -24,7 +24,7 @@ export default function useActiveColumns(props: Props) {
return [
{
...NAME_META,
cell: ({ row }) => <Name data={row.original} />,
cell: ({ row }) => <Name data={row.original} v1={props.v1} />,
},
{
...DEBT_VALUE_META,

View File

@ -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<ColumnDef<BorrowMarketTableData>[]>(() => {
return [
{
...NAME_META,
cell: ({ row }) => <Name data={row.original} />,
cell: ({ row }) => <Name data={row.original} v1={props.v1} />,
},
{
...BORROW_RATE_META,
@ -35,5 +39,5 @@ export default function useAvailableColumns() {
cell: ({ row }) => <Chevron isExpanded={row.getIsExpanded()} />,
},
]
}, [])
}, [props.v1])
}

View File

@ -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() {

View File

@ -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 (
<div className='flex items-center flex-1 gap-3'>
<AssetImage asset={asset} size={32} />
<TitleAndSubCell title={asset.symbol} sub={asset.name} className='text-left min-w-15' />
<TitleAndSubCell
title={asset.symbol}
sub={props.v1 ? '' : asset.name}
className='text-left min-w-15'
/>
</div>
)
}

View File

@ -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 }) => <Name asset={row.original.asset} />,
cell: ({ row }) => <Name asset={row.original.asset} v1={props.v1} />,
},
{
...APY_META,
@ -45,5 +46,5 @@ export default function useAvailableColumns(props: Props) {
cell: ({ row }) => <Chevron isExpanded={row.getIsExpanded()} />,
},
]
}, [props.isLoading])
}, [props.isLoading, props.v1])
}

View File

@ -25,7 +25,7 @@ export default function useDepositedColumns(props: Props) {
return [
{
...NAME_META,
cell: ({ row }) => <Name asset={row.original.asset} />,
cell: ({ row }) => <Name asset={row.original.asset} v1={props.v1} />,
},
{
...DEPOSIT_VALUE_META,

View File

@ -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 (
<div
className={classNames(
'w-full px-4 py-3 flex gap-3 group/chain text-white items-center',
active ? 'pointer-events-none' : 'opacity-60 hover:opacity-100',
)}
role='button'
onClick={
onSelect && chainConfig
? () => onSelect(chainConfig)
: () => {
if (chainConfig) {
setCurrentChainId(chainConfig.id)
useStore.setState({
chainConfig,
})
}
window.open(outpost?.url, outpost?.target)
}
}
>
<Radio active={active} className='group-hover/account:opacity-100' />
<Text size='sm'>{outpost ? 'v1' : 'v2'} Outpost</Text>
{outpost && outpost.target !== '_self' && <ExternalLink className='inline w-4 -mb-0.5' />}
</div>
)
}
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')}
></Button>
<Overlay show={showMenu} setShow={setShowMenu} className='right-0 w-[180px] mt-2'>
<div
className={classNames(
'flex w-full items-center bg-white/5 px-4 py-3',
'border border-transparent border-b-white/10',
)}
>
<Text size='lg' className='font-bold'>
Select Chain
</Text>
</div>
<ul className='w-full px-4 py-3 list-none'>
{currentChains.map(([name, chain]) => (
<li
className={classNames(
'w-full py-2 flex gap-3 group/chain text-white items-center',
chainConfig.name === chain.name && !isV1
? 'pointer-events-none'
: 'opacity-60 hover:opacity-100',
)}
role='button'
key={name}
onClick={() => selectChain(chain)}
>
<ChainLogo chainID={chain.id} className='w-6' />
<Text size='sm'>{chain.name}</Text>
</li>
))}
</ul>
{process.env.NEXT_PUBLIC_NETWORK === NETWORK.MAINNET && (
<>
/>
<Overlay
show={showMenu}
setShow={setShowMenu}
className='right-0 w-[200px] mt-2 overflow-hidden'
>
{availableChains.map((chain, index) => (
<React.Fragment key={chain.chainId}>
<div
className={classNames(
'flex w-full items-center bg-white/5 px-4 py-3',
'border border-transparent border-y-white/10',
'flex items-center gap-2 px-4 py-3 border-b bg-white/10 border-white/20',
index > 0 && 'border-t',
)}
>
<Text size='lg' className='font-bold'>
V1 Outposts
</Text>
<ChainLogo chainID={chain.chainId} className='w-5' />
<Text>{chain.name}</Text>
</div>
<ul className='w-full px-4 py-3 list-none'>
{v1Outposts.map((outpost) => (
<li
className={classNames(
'w-full py-2 flex gap-3 group/chain text-white items-center',
chainConfig.name === outpost.name && isV1
? 'pointer-events-none'
: 'opacity-60 hover:opacity-100',
)}
role='button'
onClick={() => window.open(outpost.url, outpost.target)}
key={outpost.name}
>
<ChainLogo chainID={outpost.chainId} className='w-6' />
<Text size='sm'>
{outpost.name}{' '}
{outpost.target !== '_self' && (
<ExternalLink className='w-4 ml-1 mb-0.5 inline' />
)}
</Text>
</li>
))}
</ul>
</>
)}
{!!chains[chain.chainId] && (
<ChainOption
chainConfig={chains[chain.chainId]}
onSelect={() => selectChain(chains[chain.chainId])}
active={chainConfig.name === chain.name && !isV1}
/>
)}
<ChainOption
chainConfig={chains[chain.chainId]}
outpost={v1Outposts.find((outpost) => outpost.chainId === chain.chainId)}
active={chainConfig.name === chain.name && isV1}
/>
</React.Fragment>
))}
</Overlay>
</div>
)

View File

@ -11,9 +11,9 @@ export default function V1Intro() {
<span className='text-white'>Welcome to the Red Bank!</span>
<br />
This is the first version (v1) of the Red Bank. It provides simple lending and borrowing,
without the use of Credit Accounts. Funds are{' '}
<span className='text-white'>not cross-collateralized</span> and can&lsquo;t be used on v2
as collateral.
without the use of Credit Accounts.
<br />
Deposited funds can&lsquo;t be used on v2 as collateral.
</>
}
bg='v1'

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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',

View File

@ -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,

View File

@ -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 (
<div className='flex flex-wrap w-full gap-6'>
<MigrationBanner />
<BorrowIntro />
<Borrowings />
</div>

View File

@ -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 (
<div className='flex flex-wrap w-full gap-6'>
<MigrationBanner />
<Tab tabs={EARN_TABS} activeTabIdx={1} />
<FarmIntro />
<Vaults />

View File

@ -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 (
<div className='flex flex-wrap w-full gap-6'>
<MigrationBanner />
<Tab tabs={HLS_TABS} activeTabIdx={1} />
<HlsFarmIntro />
<AvailableHLSVaults />

View File

@ -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 (
<div className='flex flex-wrap w-full gap-6'>
<MigrationBanner />
<Tab tabs={HLS_TABS} activeTabIdx={0} />
<HLSStakingIntro />
<AvailableHlsStakingAssets />

View File

@ -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 (
<div className='flex flex-wrap w-full gap-6'>
<MigrationBanner />
{chainConfig.farm && <Tab tabs={EARN_TABS} activeTabIdx={0} />}
<LendIntro />
<Lends />

View File

@ -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 (
<div className='flex flex-wrap w-full gap-6'>
<MigrationBanner />
<BreadCrumbs accountId={accountId} />
<Summary accountId={accountId} />
<Balances accountId={accountId} />

View File

@ -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 (
<div className='flex flex-wrap w-full gap-6'>
<MigrationBanner />
<PortfolioIntro />
<PortfolioSummary />
<AccountOverview />

View File

@ -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 (
<div className='flex flex-col w-full h-full gap-4'>
<MigrationBanner />
<div className='grid w-full grid-cols-[auto_346px] gap-4'>
<TradeChart buyAsset={buyAsset} sellAsset={sellAsset} />
<TradeModule buyAsset={buyAsset} sellAsset={sellAsset} isAdvanced={isAdvanced} />

View File

@ -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 (
<div className='flex flex-wrap w-full gap-6'>
<MigrationBanner />
<V1Intro />
{address && <Summary accountId={address} v1 />}
<div className='grid w-full grid-cols-1 gap-6 lg:grid-cols-2'>

View File

@ -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