Skip to content

Commit fdc8a9f

Browse files
committed
Revert "Merge pull request #1029 from curvefi/chore/curve-js"
This reverts commit 3cc1dfc, reversing changes made to 40cb8c7.
1 parent 369cac0 commit fdc8a9f

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
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.66.31",
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/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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,15 +1709,15 @@ __metadata:
17091709
languageName: node
17101710
linkType: hard
17111711

1712-
"@curvefi/api@npm:^2.66.31":
1713-
version: 2.66.31
1714-
resolution: "@curvefi/api@npm:2.66.31"
1712+
"@curvefi/api@npm:2.66.30":
1713+
version: 2.66.30
1714+
resolution: "@curvefi/api@npm:2.66.30"
17151715
dependencies:
17161716
"@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/6c47be6c82991a99420ca9c14d53be53b7d58e75a0c4f218ac74829fcde7fff257669ad4e17a2dcdae093d06c204d1e54af26ea7e00cc3eeadd68cfcff28ad8a
1720+
checksum: 10c0/bad98fb876986308b2505d13d7658352e8333628fb9de502f609f3cf41565ca5a9813a62d4eeb164fa0cf4a55f1f9d7551864da3f2bb87599ea9d22f801bc8ab
17211721
languageName: node
17221722
linkType: hard
17231723

@@ -14987,7 +14987,7 @@ __metadata:
1498714987
version: 0.0.0-use.local
1498814988
resolution: "main@workspace:apps/main"
1498914989
dependencies:
14990-
"@curvefi/api": "npm:^2.66.31"
14990+
"@curvefi/api": "npm:2.66.30"
1499114991
"@curvefi/llamalend-api": "npm:^1.0.21"
1499214992
"@ethersproject/abi": "npm:^5.8.0"
1499314993
"@hookform/error-message": "npm:^2.0.1"

0 commit comments

Comments
 (0)