diff --git a/apps/main/next.config.js b/apps/main/next.config.js index 156c0c4e25..628be3349e 100644 --- a/apps/main/next.config.js +++ b/apps/main/next.config.js @@ -1,5 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfiguration = { + // reactStrictMode: false, // uncomment to disable React's Strict Mode when testing page load compiler: { styledComponents: true }, diff --git a/apps/main/package.json b/apps/main/package.json index 65b02e4e6e..1f70ba6c06 100644 --- a/apps/main/package.json +++ b/apps/main/package.json @@ -18,7 +18,7 @@ "analyze": "ANALYZE=true next build" }, "dependencies": { - "@curvefi/api": "2.66.30", + "@curvefi/api": "^2.66.31", "@curvefi/llamalend-api": "^1.0.21", "@ethersproject/abi": "^5.8.0", "@hookform/error-message": "^2.0.1", diff --git a/apps/main/src/app/.well-known/walletconnect.txt/route.ts b/apps/main/src/app/.well-known/walletconnect.txt/route.ts index 74feaf8eb0..ffa55e99ac 100644 --- a/apps/main/src/app/.well-known/walletconnect.txt/route.ts +++ b/apps/main/src/app/.well-known/walletconnect.txt/route.ts @@ -2,8 +2,8 @@ import { headers } from 'next/headers' const WALLET_CONNECT_ACCOUNT = `c3fe8dd8-93df-44af-803f-83798aa1d440` -// for curve-dapp-git-fix-wallet-connect-curvefi.vercel.app, other domains can be added the dashboard -const VERCEL_DOMAIN_VERIFICATION = 'a88005b9d67c9ec31773975c8bd861ef2583b1c3112dbc919b809efb79b003a8' +// for curve-dapp-git-chore-curve-js-curvefi.vercel.app, other domains can be added the dashboard +const VERCEL_DOMAIN_VERIFICATION = 'bfc9255d32decb58f8e2c39e798017ff0d28a7200471a67ff1000d08e1d8a045' // for curve.fi and staging.curve.fi const CURVE_FI_DOMAIN_VERIFICATION = '3d76b3cd8cd754f34ac1c18ff25dc23ee9b80fc7f75800041335263b11f20b19' // for curve.finance and staging.curve.finance diff --git a/apps/main/src/app/api/dex/[network]/route.ts b/apps/main/src/app/api/dex/[network]/route.ts index 77d90b9a71..b584435412 100644 --- a/apps/main/src/app/api/dex/[network]/route.ts +++ b/apps/main/src/app/api/dex/[network]/route.ts @@ -1,8 +1,8 @@ -import cloneDeep from 'lodash/cloneDeep' import { getAllNetworks } from '@/app/dex/[network]/pools.util' import { refreshDataInBackground } from '@/background' import { getPools } from '@/dex/lib/pools' import { CurveApi, NetworkConfig, PoolDataMapper, type ValueMapperCached } from '@/dex/types/main.types' +import { createCurve } from '@curvefi/api' import type { DexServerSideNetworkCache } from '../types' const DexServerSideCache: Record = {} @@ -39,7 +39,7 @@ const getVolumeCache = async (network: NetworkConfig, pools: PoolDataMapper) => * Unfortunately we cannot use an API as the pool names are generated in CurveJS */ const getServerSideCache = async (network: NetworkConfig) => { - const curveJS = cloneDeep((await import('@curvefi/api')).default) as CurveApi + const curveJS = createCurve() as CurveApi await curveJS.init('NoRPC', 'NoRPC', { chainId: network.chainId }) await Promise.all([ curveJS.factory.fetchPools(), diff --git a/apps/main/src/dao/lib/curvejs.ts b/apps/main/src/dao/lib/curvejs.ts index 0cbd668d6b..4112f88814 100644 --- a/apps/main/src/dao/lib/curvejs.ts +++ b/apps/main/src/dao/lib/curvejs.ts @@ -1,8 +1,8 @@ import type { Eip1193Provider } from 'ethers' -import cloneDeep from 'lodash/cloneDeep' import type { FormType as LockFormType } from '@/dao/components/PageVeCrv/types' import { CurveApi, ChainId, Provider, EstimatedGas, UsdRatesMapper, ClaimButtonsKey } from '@/dao/types/dao.types' import { getErrorMessage } from '@/dao/utils' +import { createCurve } from '@curvefi/api' import type { DateValue } from '@internationalized/date' import PromisePool from '@supercharge/promise-pool/dist' import { log } from '@ui-kit/lib' @@ -11,7 +11,7 @@ import { waitForTransaction, waitForTransactions } from '@ui-kit/lib/ethers' export const helpers = { initCurveJs: async (chainId: ChainId, provider?: Eip1193Provider) => { - const curveApi = cloneDeep((await import('@curvefi/api')).default) as CurveApi + const curveApi = createCurve() as CurveApi if (provider) { await curveApi.init('Web3', { network: { chainId }, externalProvider: provider }, { chainId }) } else { diff --git a/apps/main/src/dex/utils/utilsCurvejs.ts b/apps/main/src/dex/utils/utilsCurvejs.ts index 9cfb26992b..0554aa6249 100644 --- a/apps/main/src/dex/utils/utilsCurvejs.ts +++ b/apps/main/src/dex/utils/utilsCurvejs.ts @@ -1,10 +1,10 @@ import type { Eip1193Provider } from 'ethers' -import cloneDeep from 'lodash/cloneDeep' import { CurveApi, ChainId, RewardsApy } from '@/dex/types/main.types' +import { createCurve } from '@curvefi/api' import { FORMAT_OPTIONS, formatNumber } from '@ui/utils' export async function initCurveJs(chainId: ChainId, provider?: Eip1193Provider) { - const curveApi = cloneDeep((await import('@curvefi/api')).default) as CurveApi + const curveApi = createCurve() as CurveApi if (provider) { await curveApi.init('Web3', { network: { chainId }, externalProvider: provider }, { chainId }) } else { diff --git a/yarn.lock b/yarn.lock index 1d900287e7..090bbe8bce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1709,15 +1709,15 @@ __metadata: languageName: node linkType: hard -"@curvefi/api@npm:2.66.30": - version: 2.66.30 - resolution: "@curvefi/api@npm:2.66.30" +"@curvefi/api@npm:^2.66.31": + version: 2.66.31 + resolution: "@curvefi/api@npm:2.66.31" dependencies: "@curvefi/ethcall": "npm:^6.0.13" bignumber.js: "npm:^9.3.0" ethers: "npm:^6.14.1" memoizee: "npm:^0.4.17" - checksum: 10c0/bad98fb876986308b2505d13d7658352e8333628fb9de502f609f3cf41565ca5a9813a62d4eeb164fa0cf4a55f1f9d7551864da3f2bb87599ea9d22f801bc8ab + checksum: 10c0/6c47be6c82991a99420ca9c14d53be53b7d58e75a0c4f218ac74829fcde7fff257669ad4e17a2dcdae093d06c204d1e54af26ea7e00cc3eeadd68cfcff28ad8a languageName: node linkType: hard @@ -14987,7 +14987,7 @@ __metadata: version: 0.0.0-use.local resolution: "main@workspace:apps/main" dependencies: - "@curvefi/api": "npm:2.66.30" + "@curvefi/api": "npm:^2.66.31" "@curvefi/llamalend-api": "npm:^1.0.21" "@ethersproject/abi": "npm:^5.8.0" "@hookform/error-message": "npm:^2.0.1"