Skip to content

Commit

Permalink
Merge branch 'main' into feat/turbopack
Browse files Browse the repository at this point in the history
  • Loading branch information
agualis committed Dec 20, 2024
2 parents 73f70ec + e313738 commit 7f8acde
Show file tree
Hide file tree
Showing 11 changed files with 279 additions and 266 deletions.
3 changes: 2 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@

version: 2
updates:
- package-ecosystem: "pnpm"
- 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
Expand Up @@ -485,6 +485,7 @@ describe('Liquidity helpers for GNOSIS V3 Boosted pools', async () => {
"index": 0,
"isBufferAllowed": true,
"isErc4626": false,
"logoURI": "https://raw.githubusercontent.com/balancer/tokenlists/main/src/assets/images/tokens/0x9c58bacc331c9aa871afd802db6379a98e80cedb.png",
"name": "Gnosis Token on xDai",
"priority": 0,
"symbol": "GNO",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ export function TokenInputs({ tokenSelectDisclosureOpen, customSetAmountIn }: Pr

function weightFor(tokenAddress: string) {
return (
pool.poolTokens.find(token =>
isSameAddress(token.address as Address, tokenAddress as Address)
)?.weight ?? undefined
tokens.find(token => isSameAddress(token.address as Address, tokenAddress as Address))
?.weight ?? undefined
)
}

Expand All @@ -44,6 +43,7 @@ export function TokenInputs({ tokenSelectDisclosureOpen, customSetAmountIn }: Pr

return (
<TokenInput
address={token.address}
apiToken={token}
chain={token.chain}
isDisabled={hasNoLiquidity(pool)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ function selectProportionalHandler(pool: Pool) {
return selectAddLiquidityHandler(pool) as ProportionalAddLiquidityHandler
}

describe('When adding proportional liquidity for a CoW AMM pool', async () => {
// Skip until we find the root cause of this issue:
// Error: Unable to get pool state with balances for v2 pool.
describe.skip('When adding proportional liquidity for a CoW AMM pool', async () => {
const cowAMMPoolId = '0xf08d4dea369c456d26a3168ff0024b904f2d8b91'
const cowAmmPool = await getPoolMock(cowAMMPoolId, GqlChain.Mainnet) // USDC-WETH

Expand Down Expand Up @@ -69,7 +71,9 @@ describe('When adding proportional liquidity for a CoW AMM pool', async () => {
})
})

describe('When adding proportional liquidity for a gyro pool', () => {
// Skip until we find the root cause of this issue:
// Error: Unable to get pool state with balances for v2 pool.
describe.skip('When adding proportional liquidity for a gyro pool', () => {
// USDC address in polygon
const polygonUsdcAddress = '0x2791bca1f2de4661ed88a30c99a7a9449aa84174' as const
const polygonDaiAddress = '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063' as const
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/modules/pool/pool.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ export function getBoostedGqlTokens(pool: Pool): ApiToken[] {
const underlyingTokens = pool.poolTokens
.flatMap(token =>
shouldUseUnderlyingToken(token, pool)
? [token.underlyingToken as ApiToken]
? [{ ...token, ...token.underlyingToken } as ApiToken]
: [token as ApiToken]
)
.filter((token): token is ApiToken => token !== undefined)
Expand Down
1 change: 1 addition & 0 deletions packages/lib/modules/pool/pool.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export type TokenCore = {
export type ApiToken = Omit<GetTokensQuery['tokens'][0], '__typename'> & {
nestedTokens?: ApiToken[]
underlyingToken?: ApiToken
weight?: string
}

export enum PoolListDisplayType {
Expand Down
1 change: 1 addition & 0 deletions packages/lib/modules/tokens/TokenInput/TokenInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export const TokenInput = forwardRef(
const { colors } = useTheme()
const { getToken } = useTokens()
const tokenFromAddress = address && chain ? getToken(address, chain) : undefined

const token = apiToken || tokenFromAddress
const { hasValidationError } = useTokenInputsValidation()

Expand Down
4 changes: 3 additions & 1 deletion packages/lib/modules/tokens/token.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,7 @@ function buildApiToken(poolToken: PoolToken): ApiToken {
chain: poolToken.chain as GqlChain,
priority: poolToken.priority as number,
tradable: poolToken.tradable as boolean,
} as ApiToken
weight: poolToken?.weight ?? undefined,
underlyingToken: poolToken?.underlyingToken ?? undefined,
}
}
2 changes: 1 addition & 1 deletion packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"echarts-for-react": "^3.0.2",
"fathom-client": "^3.7.0",
"framer-motion": "10.18.0",
"graphql": "^16.7.1",
"graphql": "16.10.0",
"graphql-request": "^6.1.0",
"graphql-tag": "^2.12.6",
"lodash": "^4.17.21",
Expand Down
3 changes: 3 additions & 0 deletions packages/lib/shared/services/api/pool-tokens.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fragment UnderlyingToken on GqlToken {
tradable
isErc4626
isBufferAllowed
logoURI
}

fragment Erc4626ReviewData on Erc4626ReviewData {
Expand Down Expand Up @@ -40,6 +41,7 @@ fragment PoolTokens on GqlPoolTokenDetail {
hasNestedPool
isAllowed
priceRateProvider
logoURI
priceRateProviderData {
address
name
Expand Down Expand Up @@ -72,6 +74,7 @@ fragment PoolTokens on GqlPoolTokenDetail {
weight
isErc4626
isBufferAllowed
logoURI
underlyingToken {
...UnderlyingToken
}
Expand Down
Loading

0 comments on commit 7f8acde

Please sign in to comment.