Skip to content

Commit cfcd0fd

Browse files
committed
Revert "Merge pull request #1037 from curvefi/revert-1035-fix/revert-#1029"
This reverts commit 818ea8b, reversing changes made to aa8dfa8.
1 parent 98f2a6f commit cfcd0fd

File tree

8 files changed

+22
-36
lines changed

8 files changed

+22
-36
lines changed

apps/main/next.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfiguration = {
3-
// reactStrictMode: false, // uncomment to disable React's Strict Mode when testing page load
43
compiler: {
54
styledComponents: true
65
},

apps/main/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"analyze": "ANALYZE=true next build"
1919
},
2020
"dependencies": {
21-
"@curvefi/api": "^2.67.1",
21+
"@curvefi/api": "2.66.30",
2222
"@curvefi/llamalend-api": "^1.0.21",
2323
"@ethersproject/abi": "^5.8.0",
2424
"@hookform/error-message": "^2.0.1",

apps/main/src/app/.well-known/walletconnect.txt/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { headers } from 'next/headers'
22

33
const WALLET_CONNECT_ACCOUNT = `c3fe8dd8-93df-44af-803f-83798aa1d440`
44

5-
// for curve-dapp-git-chore-curve-js-curvefi.vercel.app, other domains can be added the dashboard
6-
const VERCEL_DOMAIN_VERIFICATION = 'bfc9255d32decb58f8e2c39e798017ff0d28a7200471a67ff1000d08e1d8a045'
5+
// for curve-dapp-git-fix-wallet-connect-curvefi.vercel.app, other domains can be added the dashboard
6+
const VERCEL_DOMAIN_VERIFICATION = 'a88005b9d67c9ec31773975c8bd861ef2583b1c3112dbc919b809efb79b003a8'
77
// for curve.fi and staging.curve.fi
88
const CURVE_FI_DOMAIN_VERIFICATION = '3d76b3cd8cd754f34ac1c18ff25dc23ee9b80fc7f75800041335263b11f20b19'
99
// for curve.finance and staging.curve.finance

apps/main/src/app/api/dex/[network]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import cloneDeep from 'lodash/cloneDeep'
12
import { getAllNetworks } from '@/app/dex/[network]/pools.util'
23
import { refreshDataInBackground } from '@/background'
34
import { getPools } from '@/dex/lib/pools'
45
import { CurveApi, NetworkConfig, PoolDataMapper, type ValueMapperCached } from '@/dex/types/main.types'
5-
import { createCurve } from '@curvefi/api'
66
import type { DexServerSideNetworkCache } from '../types'
77

88
const DexServerSideCache: Record<string, DexServerSideNetworkCache> = {}
@@ -39,7 +39,7 @@ const getVolumeCache = async (network: NetworkConfig, pools: PoolDataMapper) =>
3939
* Unfortunately we cannot use an API as the pool names are generated in CurveJS
4040
*/
4141
const getServerSideCache = async (network: NetworkConfig) => {
42-
const curveJS = createCurve() as CurveApi
42+
const curveJS = cloneDeep((await import('@curvefi/api')).default) as CurveApi
4343
await curveJS.init('NoRPC', 'NoRPC', { chainId: network.chainId })
4444
await Promise.all([
4545
curveJS.factory.fetchPools(),

apps/main/src/dao/lib/curvejs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Eip1193Provider } from 'ethers'
2+
import cloneDeep from 'lodash/cloneDeep'
23
import type { FormType as LockFormType } from '@/dao/components/PageVeCrv/types'
34
import { CurveApi, ChainId, Provider, EstimatedGas, UsdRatesMapper, ClaimButtonsKey } from '@/dao/types/dao.types'
45
import { getErrorMessage } from '@/dao/utils'
5-
import { createCurve } from '@curvefi/api'
66
import type { DateValue } from '@internationalized/date'
77
import PromisePool from '@supercharge/promise-pool/dist'
88
import { log } from '@ui-kit/lib'
@@ -11,7 +11,7 @@ import { waitForTransaction, waitForTransactions } from '@ui-kit/lib/ethers'
1111

1212
export const helpers = {
1313
initCurveJs: async (chainId: ChainId, provider?: Eip1193Provider) => {
14-
const curveApi = createCurve() as CurveApi
14+
const curveApi = cloneDeep((await import('@curvefi/api')).default) as CurveApi
1515
if (provider) {
1616
await curveApi.init('Web3', { network: { chainId }, externalProvider: provider }, { chainId })
1717
} else {

apps/main/src/dex/store/createPoolsSlice.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import produce from 'immer'
22
import type { UTCTimestamp } from 'lightweight-charts'
33
import chunk from 'lodash/chunk'
4+
import cloneDeep from 'lodash/cloneDeep'
45
import countBy from 'lodash/countBy'
56
import groupBy from 'lodash/groupBy'
67
import isNaN from 'lodash/isNaN'
@@ -482,13 +483,11 @@ const createPoolsSlice = (set: SetState<State>, get: GetState<State>): PoolsSlic
482483

483484
const tokens = curvejsApi.pool.poolTokens(poolData.pool, isWrapped)
484485
const tokenAddresses = curvejsApi.pool.poolTokenAddresses(poolData.pool, isWrapped)
485-
const cPoolData = {
486-
...poolData,
487-
isWrapped,
488-
tokens,
489-
tokensCountBy: countBy(tokens),
490-
tokenAddresses,
491-
}
486+
const cPoolData = cloneDeep(poolData)
487+
cPoolData.isWrapped = isWrapped
488+
cPoolData.tokens = tokens
489+
cPoolData.tokensCountBy = countBy(tokens)
490+
cPoolData.tokenAddresses = tokenAddresses
492491

493492
set(
494493
produce((state) => {

apps/main/src/dex/utils/utilsCurvejs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { Eip1193Provider } from 'ethers'
2+
import cloneDeep from 'lodash/cloneDeep'
23
import { CurveApi, ChainId, RewardsApy } from '@/dex/types/main.types'
3-
import { createCurve } from '@curvefi/api'
44
import { FORMAT_OPTIONS, formatNumber } from '@ui/utils'
55

66
export async function initCurveJs(chainId: ChainId, provider?: Eip1193Provider) {
7-
const curveApi = createCurve() as CurveApi
7+
const curveApi = cloneDeep((await import('@curvefi/api')).default) as CurveApi
88
if (provider) {
99
await curveApi.init('Web3', { network: { chainId }, externalProvider: provider }, { chainId })
1010
} else {

yarn.lock

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,19 +1709,19 @@ __metadata:
17091709
languageName: node
17101710
linkType: hard
17111711

1712-
"@curvefi/api@npm:^2.67.1":
1713-
version: 2.67.1
1714-
resolution: "@curvefi/api@npm:2.67.1"
1712+
"@curvefi/api@npm:2.66.30":
1713+
version: 2.66.30
1714+
resolution: "@curvefi/api@npm:2.66.30"
17151715
dependencies:
1716-
"@curvefi/ethcall": "npm:^6.0.14"
1716+
"@curvefi/ethcall": "npm:^6.0.13"
17171717
bignumber.js: "npm:^9.3.0"
17181718
ethers: "npm:^6.14.1"
17191719
memoizee: "npm:^0.4.17"
1720-
checksum: 10c0/f09069183b71566ff975d68f882b5c43ba34f850e63784f3aeb0495c935e9a954f9a5684ba7e5820f4230e383159a7589015e69e1f397a550275022822ddd6f2
1720+
checksum: 10c0/bad98fb876986308b2505d13d7658352e8333628fb9de502f609f3cf41565ca5a9813a62d4eeb164fa0cf4a55f1f9d7551864da3f2bb87599ea9d22f801bc8ab
17211721
languageName: node
17221722
linkType: hard
17231723

1724-
"@curvefi/ethcall@npm:6.0.13":
1724+
"@curvefi/ethcall@npm:6.0.13, @curvefi/ethcall@npm:^6.0.13":
17251725
version: 6.0.13
17261726
resolution: "@curvefi/ethcall@npm:6.0.13"
17271727
dependencies:
@@ -1733,18 +1733,6 @@ __metadata:
17331733
languageName: node
17341734
linkType: hard
17351735

1736-
"@curvefi/ethcall@npm:^6.0.14":
1737-
version: 6.0.14
1738-
resolution: "@curvefi/ethcall@npm:6.0.14"
1739-
dependencies:
1740-
"@types/node": "npm:^22.12.0"
1741-
abi-coder: "npm:^5.0.0"
1742-
peerDependencies:
1743-
ethers: ^6.0.0
1744-
checksum: 10c0/a29ca908e4c2c769607374d73c1d926f1b17696901e82352d5834cfcbaa8b5d5a6df4c7925996fd0decba3324bc0fce348d4bf56dec688215f9d67b8aafdf898
1745-
languageName: node
1746-
linkType: hard
1747-
17481736
"@curvefi/llamalend-api@npm:^1.0.21":
17491737
version: 1.0.21
17501738
resolution: "@curvefi/llamalend-api@npm:1.0.21"
@@ -14999,7 +14987,7 @@ __metadata:
1499914987
version: 0.0.0-use.local
1500014988
resolution: "main@workspace:apps/main"
1500114989
dependencies:
15002-
"@curvefi/api": "npm:^2.67.1"
14990+
"@curvefi/api": "npm:2.66.30"
1500314991
"@curvefi/llamalend-api": "npm:^1.0.21"
1500414992
"@ethersproject/abi": "npm:^5.8.0"
1500514993
"@hookform/error-message": "npm:^2.0.1"

0 commit comments

Comments
 (0)