Skip to content

Commit

Permalink
Merge branch 'develop' into llama-lend-queries
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini authored Oct 21, 2024
2 parents a846146 + 42f52ea commit bb1842a
Show file tree
Hide file tree
Showing 60 changed files with 388 additions and 296 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ yarn-error.log*
# husky
.husky

# vercel
.vercel

# lingui compiled translation files
src/locales/_build/
src/locales/**/*.js
Expand Down
14 changes: 14 additions & 0 deletions .vercel/dao-branch-filtering.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

echo "VERCEL_GIT_COMMIT_REF: $VERCEL_GIT_COMMIT_REF"

if [[ "$VERCEL_GIT_COMMIT_REF" == "staging" || "$VERCEL_GIT_COMMIT_REF" == "task/init-dao-app" ]] ; then
# Proceed with the build
echo "✅ - Build can proceed"
exit 1;

else
# Don't build
echo "🛑 - Build cancelled"
exit 0;
fi
14 changes: 14 additions & 0 deletions .vercel/storybook-branch-filtering.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

echo "VERCEL_GIT_COMMIT_REF: $VERCEL_GIT_COMMIT_REF"

if [[ "$VERCEL_GIT_COMMIT_REF" == "develop" ]] ; then
# Proceed with the build
echo "✅ - Build can proceed"
exit 1;

else
# Don't build
echo "🛑 - Build cancelled"
exit 0;
fi
Empty file added apps/dao/.gitkeep
Empty file.
16 changes: 10 additions & 6 deletions apps/lend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"i18n:compile": "lingui compile",
"analyze": "ANALYZE=true next build"
},
"peerDependencies": {
"eslint-config-custom": "*",
"react": "*",
"react-dom": "*",
"tsconfig": "*"
},
"dependencies": {
"@curvefi/lending-api": "^2.3.3",
"@lingui/detect-locale": "^4.6.0",
Expand All @@ -39,9 +45,9 @@
"next-images": "^1.8.5",
"numbro": "^2.4.0",
"onboard-helpers": "*",
"react": "^18.2.0",
"react": "*",
"react-aria": "3.22.0",
"react-dom": "^18.2.0",
"react-dom": "*",
"react-is": "16.13.1",
"react-router-dom": "^6.3.0",
"react-stately": "3.18.0",
Expand All @@ -61,8 +67,8 @@
"@svgr/webpack": "^8.1.0",
"@types/lodash": "^4.14.182",
"@types/node": "17.0.24",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/react": "*",
"@types/react-dom": "*",
"@types/styled-components": "5.1.14",
"eslint-config-custom": "*",
"pinst": "^2.1.4",
Expand All @@ -71,8 +77,6 @@
"webpack": "^5.83.1"
},
"resolutions": {
"@types/react": "^18",
"@types/react-dom": "^18",
"styled-components": "^5"
}
}
29 changes: 13 additions & 16 deletions apps/lend/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
import type { AppProps } from 'next/app'

import { useCallback, useEffect, useState } from 'react'
import { HashRouter } from 'react-router-dom'
import { i18n } from '@lingui/core'
import { I18nProvider } from '@lingui/react'
import { OverlayProvider } from '@react-aria/overlays'
import delay from 'lodash/delay'
import { initOnboard } from 'onboard-helpers'
import zhHans from 'onboard-helpers/src/locales/zh-Hans'
import zhHant from 'onboard-helpers/src/locales/zh-Hant'
import { useCallback, useEffect, useState } from 'react'
import 'intersection-observer'
import 'focus-visible'
import '@/globals.css'

import { HashRouter } from 'react-router-dom'
import GlobalStyle from '@/globalStyle'
import Page from '@/layout/index'
import { persister, queryClient } from '@/shared/api/query-client'
import { QueryProvider } from '@/ui/QueryProvider'
import { dynamicActivate, initTranslation } from '@/lib/i18n'
import { getLocaleFromUrl } from '@/utils/utilsRouter'
import { isMobile, removeExtraSpaces } from '@/utils/helpers'
import { getPageWidthClassName } from '@/store/createLayoutSlice'
import { getStorageValue } from '@/utils/utilsStorage'
import { initOnboard } from 'onboard-helpers'
import { messages as messagesEn } from '@/locales/en/messages.js'
import networks from '@/networks'
import { getPageWidthClassName } from '@/store/createLayoutSlice'
import useStore from '@/store/useStore'
import zhHans from 'onboard-helpers/src/locales/zh-Hans'
import zhHant from 'onboard-helpers/src/locales/zh-Hant'

import Page from '@/layout/index'
import GlobalStyle from '@/globalStyle'
import { isMobile, removeExtraSpaces } from '@/utils/helpers'
import { getLocaleFromUrl } from '@/utils/utilsRouter'
import { getStorageValue } from '@/utils/utilsStorage'
import type { AppProps } from 'next/app'

i18n.load({ en: messagesEn })
i18n.activate('en')
Expand Down Expand Up @@ -83,7 +80,7 @@ function CurveApp({ Component }: AppProps) {
},
locale,
themeType,
networks
networks,
)
updateWalletStateByKey('onboard', onboardInstance)

Expand Down
2 changes: 1 addition & 1 deletion apps/lend/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextPage } from 'next'

import { Navigate, Route, Routes } from 'react-router'
import dynamic from 'next/dynamic'
import { Navigate, Route, Routes } from 'react-router'

import { ROUTE } from '@/constants'

Expand Down
16 changes: 10 additions & 6 deletions apps/loan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"i18n:compile": "lingui compile",
"analyze": "ANALYZE=true next build"
},
"peerDependencies": {
"eslint-config-custom": "*",
"react": "*",
"react-dom": "*",
"tsconfig": "*"
},
"dependencies": {
"@curvefi/stablecoin-api": "^1.5.5",
"@lingui/detect-locale": "^4.6.0",
Expand All @@ -38,9 +44,9 @@
"next-images": "^1.8.5",
"numbro": "^2.4.0",
"onboard-helpers": "*",
"react": "^18.2.0",
"react": "*",
"react-aria": "3.22.0",
"react-dom": "^18.2.0",
"react-dom": "*",
"react-is": "16.13.1",
"react-router-dom": "^6.3.0",
"react-stately": "3.18.0",
Expand All @@ -60,8 +66,8 @@
"@svgr/webpack": "^8.1.0",
"@types/lodash": "^4.14.182",
"@types/node": "17.0.24",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/react": "*",
"@types/react-dom": "*",
"@types/styled-components": "5.1.14",
"eslint-config-custom": "*",
"pinst": "^2.1.4",
Expand All @@ -70,8 +76,6 @@
"webpack": "^5.83.1"
},
"resolutions": {
"@types/react": "^18",
"@types/react-dom": "^18",
"styled-components": "^5"
}
}
33 changes: 15 additions & 18 deletions apps/loan/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
import type { AppProps } from 'next/app'
import type { Locale } from '@/lib/i18n'

import { useCallback, useEffect, useState } from 'react'
import { HashRouter } from 'react-router-dom'
import { i18n } from '@lingui/core'
import { I18nProvider } from '@lingui/react'
import { OverlayProvider } from '@react-aria/overlays'
import delay from 'lodash/delay'
import 'intersection-observer'
import 'focus-visible'
import '@/globals.css'

import { dynamicActivate, initTranslation } from '@/lib/i18n'
import { getLocaleFromUrl } from '@/utils/utilsRouter'
import { isMobile, removeExtraSpaces } from '@/utils/helpers'
import { getPageWidthClassName } from '@/store/createLayoutSlice'
import { getStorageValue } from '@/utils/storage'
import { REFRESH_INTERVAL } from '@/constants'
import { initOnboard } from 'onboard-helpers'
import { messages as messagesEn } from '@/locales/en/messages.js'
import networks from '@/networks'
import usePageVisibleInterval from '@/hooks/usePageVisibleInterval'
import useStore from '@/store/useStore'
import zhHans from 'onboard-helpers/src/locales/zh-Hans'
import zhHant from 'onboard-helpers/src/locales/zh-Hant'

import Page from '@/layout/index'
import { useCallback, useEffect, useState } from 'react'
import { HashRouter } from 'react-router-dom'
import { REFRESH_INTERVAL } from '@/constants'
import GlobalStyle from '@/globalStyle'
import usePageVisibleInterval from '@/hooks/usePageVisibleInterval'
import Page from '@/layout/index'
import type { Locale } from '@/lib/i18n'
import { dynamicActivate, initTranslation } from '@/lib/i18n'
import { messages as messagesEn } from '@/locales/en/messages.js'
import networks from '@/networks'
import { getPageWidthClassName } from '@/store/createLayoutSlice'
import useStore from '@/store/useStore'
import { isMobile, removeExtraSpaces } from '@/utils/helpers'
import { getStorageValue } from '@/utils/storage'
import { getLocaleFromUrl } from '@/utils/utilsRouter'
import type { AppProps } from 'next/app'

i18n.load({ en: messagesEn })
i18n.activate('en')
Expand Down
2 changes: 1 addition & 1 deletion apps/loan/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { NextPage } from 'next'

import { Navigate, Route, Routes } from 'react-router'
import dynamic from 'next/dynamic'
import { Navigate, Route, Routes } from 'react-router'

import { ROUTE } from '@/constants'

Expand Down
16 changes: 10 additions & 6 deletions apps/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"i18n:compile": "lingui compile",
"analyze": "ANALYZE=true next build"
},
"peerDependencies": {
"eslint-config-custom": "*",
"react": "*",
"react-dom": "*",
"tsconfig": "*"
},
"dependencies": {
"@curvefi/api": "^2.63.10",
"@hookform/error-message": "^2.0.1",
Expand All @@ -41,9 +47,9 @@
"next-images": "^1.8.5",
"numbro": "^2.4.0",
"onboard-helpers": "*",
"react": "^18.2.0",
"react": "*",
"react-aria": "3.22.0",
"react-dom": "^18.2.0",
"react-dom": "*",
"react-hook-form": "^7.53.0",
"react-is": "16.13.1",
"react-router-dom": "^6.3.0",
Expand All @@ -66,8 +72,8 @@
"@svgr/webpack": "^8.1.0",
"@types/lodash": "^4.14.182",
"@types/node": "17.0.24",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/react": "*",
"@types/react-dom": "*",
"@types/styled-components": "5.1.14",
"@types/validator": "^13.12.1",
"eslint-config-custom": "*",
Expand All @@ -76,8 +82,6 @@
"webpack": "^5.83.1"
},
"resolutions": {
"@types/react": "^18",
"@types/react-dom": "^18",
"styled-components": "^5"
}
}
2 changes: 1 addition & 1 deletion apps/main/src/components/PageCreatePool/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const POOL_PRESETS: PRESETS = {
stableSwapFee: '0.01',
stableA: '1000',
maExpTime: '600',
offpegFeeMultiplier: '2',
offpegFeeMultiplier: '5',
},
},
1: {
Expand Down
2 changes: 1 addition & 1 deletion apps/main/src/entities/chain/lib.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCurve } from '@/entities/curve'
import networks from '@/networks'
import { useCurve } from '@/entities/curve'

export const useChainId = () => {
const { data: curve } = useCurve()
Expand Down
2 changes: 1 addition & 1 deletion apps/main/src/entities/chain/model/chain-validation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { enforce, group, test } from 'vest'
import type { ChainQueryParams } from '@/entities/chain/types'
import { createValidationSuite } from '@/shared/lib/validation'
import { enforce, group, test } from 'vest'

export const chainValidationGroup = ({ chainId }: ChainQueryParams) =>
group('chainValidation', () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/main/src/entities/gauge/api/estimate-gas.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { QueryFunction } from '@tanstack/react-query'
import useStore from '@/store/useStore'
import { assertGaugeValidity } from '@/entities/gauge/lib'
import type { GaugeQueryKeyType, PoolMethodResult } from '@/entities/gauge/types'
import { BD } from '@/shared/curve-lib'
import useStore from '@/store/useStore'
import { logQuery } from '@/shared/lib/logging'
import type { QueryFunction } from '@tanstack/react-query'

export const queryEstimateGasDepositRewardApprove: QueryFunction<
PoolMethodResult<'gauge.estimateGas.depositRewardApprove'>,
Expand Down
6 changes: 3 additions & 3 deletions apps/main/src/entities/gauge/api/gauge-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
* business logic and data fetching.
*/

import { QueryFunction } from '@tanstack/react-query'
import { zeroAddress, type Address } from 'viem'
import useStore from '@/store/useStore'
import { assertGaugeValidity } from '@/entities/gauge/lib'
import { GaugeQueryKeyType, type PoolMethodResult } from '@/entities/gauge/types'
import { BD } from '@/shared/curve-lib'
import useStore from '@/store/useStore'
import { logQuery } from '@/shared/lib/logging'
import { QueryFunction } from '@tanstack/react-query'
import { zeroAddress, type Address } from 'viem'

export const queryGaugeStatus: QueryFunction<PoolMethodResult<'gaugeStatus'>, GaugeQueryKeyType<'status'>> = async ({
queryKey,
Expand Down
4 changes: 2 additions & 2 deletions apps/main/src/entities/gauge/api/rewards-mutate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* business logic and data fetching.
*/

import { type MutateFunction } from '@tanstack/react-query'
import useStore from '@/store/useStore'
import { assertGaugeValidity } from '@/entities/gauge/lib'
import { GaugeQueryKeyType, type PoolMethodResult } from '@/entities/gauge/types'
import useStore from '@/store/useStore'
import { type MutateFunction } from '@tanstack/react-query'

export const mutateAddRewardToken: MutateFunction<
PoolMethodResult<'gauge.addReward'>,
Expand Down
8 changes: 4 additions & 4 deletions apps/main/src/entities/gauge/lib/reward-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
* allowing components to easily access and manipulate gauge-related data.
*/

import { t } from '@lingui/macro'
import { useIsMutating, useMutation, UseMutationResult } from '@tanstack/react-query'
import useTokensMapper from '@/hooks/useTokensMapper'
import useStore from '@/store/useStore'
import * as models from '@/entities/gauge/model'
import { gaugeKeys as keys } from '@/entities/gauge/model'
import type {
Expand All @@ -19,11 +23,7 @@ import type {
GaugeQueryParams,
PoolMethodResult,
} from '@/entities/gauge/types'
import useTokensMapper from '@/hooks/useTokensMapper'
import { queryClient } from '@/shared/api/query-client'
import useStore from '@/store/useStore'
import { t } from '@lingui/macro'
import { useIsMutating, useMutation, UseMutationResult } from '@tanstack/react-query'

export const useAddRewardToken = ({
chainId,
Expand Down
Loading

0 comments on commit bb1842a

Please sign in to comment.