Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: PoolCore, remove pool.displayTokens, new display token functions #373

Open
wants to merge 32 commits into
base: feat/vote-list
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b9319c9
Create dependabot.yml
garethfuller Dec 20, 2024
fbacd6b
Update dependabot.yml
garethfuller Dec 20, 2024
b31c08d
fix: Token inputs (#365)
garethfuller Dec 20, 2024
54fe27a
refactor: PoolCore, remove pool.displayTokens, new display token func…
agualis Dec 20, 2024
d189dc4
Update dependabot.yml
garethfuller Dec 20, 2024
e313738
chore: bump graphql (#372)
garethfuller Dec 20, 2024
b23cdb4
chore: update dependencies recommended by dependabot (#375)
agualis Dec 20, 2024
86cea82
chore: rename prop
agualis Dec 20, 2024
19e8ce2
chore: add addPossibleNestedTokens
agualis Dec 20, 2024
ca91d8e
fix: use getCompositionDisplayTokensWithPossibleNestedTokensWithBalan…
agualis Dec 20, 2024
ad5605a
Merge branch 'main' into refactor/displayTokensInVoteListPR
agualis Dec 20, 2024
4196de4
chore: add pool examples to debug page
agualis Dec 20, 2024
cc60d6a
refactor: user reference tokens
agualis Dec 20, 2024
46c333a
refactor: with balance user reference helper
agualis Dec 20, 2024
a643067
test weitghts and uris
agualis Dec 20, 2024
e4b42ad
fix: swap symbol (#387)
agualis Dec 24, 2024
824d326
refactor: replace blockExplorer hook by plain TS functions (#378)
agualis Dec 24, 2024
e98febd
chore: Hide pool swap for cow pools (#392)
garethfuller Dec 30, 2024
a6dfdd0
chore(deps): bump @tanstack/react-query-devtools from 5.56.2 to 5.62.…
dependabot[bot] Jan 2, 2025
11ce2b7
chore(deps-dev): bump @testing-library/jest-dom from 6.5.0 to 6.6.3 (…
dependabot[bot] Jan 2, 2025
1e0704c
chore(deps): bump react-swipeable from 7.0.1 to 7.0.2 (#384)
dependabot[bot] Jan 2, 2025
82863e3
Merge branch 'main' into refactor/displayTokensInVoteListPR
agualis Jan 2, 2025
c99d6c4
chore: remove comments
agualis Jan 3, 2025
35daa25
refactor: move ApiToken type to token.types.ts
agualis Jan 3, 2025
0dfea2d
refactor: PoolToken type
agualis Jan 3, 2025
0ae79fe
chore: update Twitter URL to x.com format (#400)
agualis Jan 6, 2025
190bdab
chore: simplify pool types
agualis Jan 6, 2025
e4f6677
chore: sort pool tokens by index
agualis Jan 7, 2025
3cde3a8
merge from beets (#376)
groninge01 Jan 7, 2025
1372ff4
chore: Merge main
agualis Jan 7, 2025
d1337ed
refactor: from allowNestedActions to disallowNestedActions (#346)
agualis Jan 7, 2025
cf34d15
Merge branch 'main' into refactor/displayTokensInVoteListPR
agualis Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm"
directories:
- /
- /apps/frontend-v3
- /apps/beets-frontend-v3
- /packages/lib
schedule:
interval: "weekly"
open-pull-requests-limit: 4
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/* eslint-disable max-len */
import { FetchPoolProps } from '@repo/lib/modules/pool/pool.types'
import {
ChainSlug,
getChainSlug,
getPoolDisplayTokens,
getPoolTypeLabel,
} from '@repo/lib/modules/pool/pool.utils'
import { FetchPoolProps, PoolCore } from '@repo/lib/modules/pool/pool.types'
import { ChainSlug, getChainSlug, getPoolTypeLabel } from '@repo/lib/modules/pool/pool.utils'
import { PropsWithChildren, Suspense } from 'react'
import { PoolDetailSkeleton } from '@repo/lib/modules/pool/PoolDetail/PoolDetailSkeleton'
import { getApolloServerClient } from '@repo/lib/shared/services/api/apollo-server.client'
Expand All @@ -15,6 +10,7 @@ import { PoolProvider } from '@repo/lib/modules/pool/PoolProvider'
import { arrayToSentence } from '@repo/lib/shared/utils/strings'
import { ensureError } from '@repo/lib/shared/utils/errors'
import { notFound } from 'next/navigation'
import { getUserReferenceTokens } from '@repo/lib/modules/pool/pool.tokens.utils'

type Props = PropsWithChildren<{
params: Omit<FetchPoolProps, 'chain'> & { chain: ChainSlug }
Expand Down Expand Up @@ -48,7 +44,7 @@ export async function generateMetadata({
const pool = data?.pool
if (!pool) return {}

const displayTokens = getPoolDisplayTokens(pool)
const displayTokens = getUserReferenceTokens(pool as PoolCore)
const poolTokenString = arrayToSentence(displayTokens.map(token => token.symbol))

return {
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
6 changes: 3 additions & 3 deletions apps/beets-frontend-v3/app/(app)/pools/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { PropsWithChildren } from 'react'
export const metadata: Metadata = {
title: 'Beets DeFi Liquidity Pools',
description: `
Explore DeFi liquidity pools or create your own.
Provide liquidity to accumulate yield from swap fees
while retaining your token exposure as prices move.
Fuel your liquidity.
Earn yield from swap fees, incentives, and more.
Create and customize pools tailored to your strategy.
`,
}

Expand Down
10 changes: 5 additions & 5 deletions apps/beets-frontend-v3/app/(app)/pools/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { Suspense } from 'react'
// import { getProjectConfig } from '@repo/lib/config/getProjectConfig'
// import { GetFeaturedPoolsDocument } from '@repo/lib/shared/services/api/generated/graphql'
// import { FeaturedPools } from '@repo/lib/modules/featured-pools/FeaturedPools'
import { CowPromoBanner } from '@repo/lib/shared/components/promos/CowPromoBanner'
import { PoolListDisplayType } from '@repo/lib/modules/pool/pool.types'
import { GqlPoolType } from '@repo/lib/shared/services/api/generated/graphql'
import { BeetsPromoBanner } from '@/lib/components/promos/BeetsPromoBanner'

export default async function PoolsPage() {
// Featured pools set up
Expand All @@ -29,11 +29,11 @@ export default async function PoolsPage() {

return (
<>
<Box bg="background.level0" borderBottom="1px solid" borderColor="border.base">
<Box>
<DefaultPageContainer pb={['xl', '2xl']} pt={['xl', '40px']}>
<FadeInOnView animateOnce={false}>
<Box>
<CowPromoBanner />
<BeetsPromoBanner />
</Box>
</FadeInOnView>
{/* <FadeInOnView animateOnce={false}>
Expand All @@ -48,13 +48,13 @@ export default async function PoolsPage() {
<Suspense fallback={<Skeleton h="500px" w="full" />}>
<PoolList
displayType={PoolListDisplayType.Name}
hidePoolTags={['VE8020']}
hidePoolTags={['VE8020', 'BOOSTED']}
hidePoolTypes={[
GqlPoolType.LiquidityBootstrapping,
GqlPoolType.CowAmm,
GqlPoolType.Fx,
]}
hideProtocolVersion={['cow']}
hideProtocolVersion={['cow', 'v3']}
/>
</Suspense>
</FadeInOnView>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
import { BeetsPromoBanner } from '@/lib/components/promos/BeetsPromoBanner'
import { Box, Skeleton } from '@chakra-ui/react'
import { PoolListDisplayType } from '@repo/lib/modules/pool/pool.types'
import { PoolList } from '@repo/lib/modules/pool/PoolList/PoolList'
import { DefaultPageContainer } from '@repo/lib/shared/components/containers/DefaultPageContainer'
import FadeInOnView from '@repo/lib/shared/components/containers/FadeInOnView'
import { GqlPoolType } from '@repo/lib/shared/services/api/generated/graphql'
import { Box, Skeleton } from '@chakra-ui/react'
import { GqlChain, GqlPoolType } from '@repo/lib/shared/services/api/generated/graphql'
import { Suspense } from 'react'
import { Metadata } from 'next'
import { CowFooter } from '@repo/lib/shared/components/navs/CowFooter'
import { DefaultPageContainer } from '@repo/lib/shared/components/containers/DefaultPageContainer'
import { CowHeader } from '@repo/lib/shared/components/navs/CowHeader'

export const metadata: Metadata = {
title: `CoW AMM DeFi Liquidity Pools`,
description: `
CoW AMM protects LPs from LVR so they can provide liquidity
with less risk and more return.
`,
}

export default function PoolsPage() {
return (
<>
<Box
bg="background.level0"
borderBottom="0.5px solid"
borderColor="border.base"
shadow="innerBase"
>
<Box>
<DefaultPageContainer pb={['xl', '2xl']} pt={['xl', '40px']}>
<FadeInOnView animateOnce={false}>
<Box>
<CowHeader />
<BeetsPromoBanner />
</Box>
</FadeInOnView>
</DefaultPageContainer>
Expand All @@ -37,12 +23,20 @@ export default function PoolsPage() {
<DefaultPageContainer noVerticalPadding pb={['xl', '2xl']} pt={['lg', '54px']}>
<FadeInOnView animateOnce={false}>
<Suspense fallback={<Skeleton h="500px" w="full" />}>
<PoolList fixedPoolTypes={[GqlPoolType.CowAmm]} />
<PoolList
displayType={PoolListDisplayType.Name}
fixedChains={[GqlChain.Sonic]}
hidePoolTags={['VE8020', 'BOOSTED']}
hidePoolTypes={[
GqlPoolType.LiquidityBootstrapping,
GqlPoolType.CowAmm,
GqlPoolType.Fx,
]}
hideProtocolVersion={['cow', 'v3']}
/>
</Suspense>
</FadeInOnView>
</DefaultPageContainer>

<CowFooter />
</>
)
}
6 changes: 4 additions & 2 deletions apps/beets-frontend-v3/app/(app)/portfolio/[chain]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PoolName } from '@repo/lib/modules/pool/PoolName'
import { Pool } from '@repo/lib/modules/pool/PoolProvider'
import { ClaimModal } from '@repo/lib/modules/pool/actions/claim/ClaimModal'
import { ClaimProvider } from '@repo/lib/modules/pool/actions/claim/ClaimProvider'
import { ChainSlug, getChainSlug, getPoolDisplayTokens } from '@repo/lib/modules/pool/pool.utils'
import { ChainSlug, getChainSlug } from '@repo/lib/modules/pool/pool.utils'
// eslint-disable-next-line max-len
import { ClaimNetworkPoolsLayout } from '@repo/lib/modules/portfolio/PortfolioClaim/ClaimNetworkPools/ClaimNetworkPoolsLayout'
import { usePortfolio } from '@repo/lib/modules/portfolio/PortfolioProvider'
Expand All @@ -15,6 +15,8 @@ import { Button, Card, HStack, Heading, Skeleton, Stack, Text, VStack } from '@c
import { capitalize } from 'lodash'
import { useParams } from 'next/navigation'
import { useState } from 'react'
import { getUserReferenceTokens } from '@repo/lib/modules/pool/pool.tokens.utils'
import { PoolCore } from '@repo/lib/modules/pool/pool.types'

export default function NetworkClaim() {
const { toCurrency } = useCurrency()
Expand Down Expand Up @@ -76,7 +78,7 @@ export default function NetworkClaim() {
<TokenIconStack
chain={pool.chain}
size={36}
tokens={getPoolDisplayTokens(pool)}
tokens={getUserReferenceTokens(pool as PoolCore)}
/>
{hasMultipleClaims && (
<Button
Expand Down
8 changes: 8 additions & 0 deletions apps/beets-frontend-v3/app/(app)/stake/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use client'

import { DefaultPageContainer } from '@repo/lib/shared/components/containers/DefaultPageContainer'
import { PropsWithChildren } from 'react'

export default function LstLayout({ children }: PropsWithChildren) {
return <DefaultPageContainer minH="100vh">{children}</DefaultPageContainer>
}
12 changes: 12 additions & 0 deletions apps/beets-frontend-v3/app/(app)/stake/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client'

import { Lst } from '@/lib/modules/lst/Lst'
import LstProvidersLayout from '@/lib/modules/lst/LstProvidersLayout'

export default function LstPage() {
return (
<LstProvidersLayout>
<Lst />
</LstProvidersLayout>
)
}
96 changes: 0 additions & 96 deletions apps/beets-frontend-v3/app/(marketing)/3rd-party-services/page.tsx

This file was deleted.

69 changes: 0 additions & 69 deletions apps/beets-frontend-v3/app/(marketing)/components/SandPatterns.tsx

This file was deleted.

Loading
Loading