diff --git a/.eslintrc.json b/.eslintrc.json index e253f9bf..ea521074 100755 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -47,15 +47,15 @@ "no-dupe-class-members": 0, // Warnings - "no-debugger": 1, - "no-empty": 1, - "no-invalid-regexp": 1, - "no-unused-expressions": 1, - "no-native-reassign": 1, - "no-fallthrough": 1, + "no-debugger": "off", + "no-empty": "off", + "no-invalid-regexp": "off", + "no-unused-expressions": "off", + "no-native-reassign": "off", + "no-fallthrough": "off", + "eqeqeq": "off", // Errors - "eqeqeq": ["warn"], "no-undef": 2, "no-dupe-keys": 2, "no-empty-character-class": 2, diff --git a/.gitignore b/.gitignore index 7a642ba4..3c6f31d9 100755 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts -.env \ No newline at end of file +.env +*.log \ No newline at end of file diff --git a/next.config.mjs b/next.config.mjs index 0ecfe991..869b4c42 100755 --- a/next.config.mjs +++ b/next.config.mjs @@ -2,11 +2,14 @@ const nextConfig = { // output: 'export', - compiler: process.env.NODE_ENV == 'development' ? {} : { - removeConsole: { - exclude: ['error'], - }, - }, + compiler: + process.env.NODE_ENV == 'development' + ? {} + : { + removeConsole: { + exclude: ['error'], + }, + }, async rewrites() { return [ { @@ -24,7 +27,7 @@ const nextConfig = { }, { source: '/ekubo/:path*', - destination: 'https://mainnet-api.ekubo.org/:path*', + destination: 'https://app.strkfarm.xyz/ekubo/:path*', }, { source: '/haiko/:path*', diff --git a/package.json b/package.json index 4f3971fa..0f817b02 100755 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@prisma/client": "5.18.0", "@starknet-react/chains": "3.0.0", "@starknet-react/core": "3.0.1", - "@strkfarm/sdk": "^1.0.35", + "@strkfarm/sdk": "^1.0.49", "@tanstack/query-core": "5.28.0", "@types/mixpanel-browser": "2.49.0", "@types/mustache": "4.2.5", @@ -43,10 +43,12 @@ "@vercel/speed-insights": "1.0.12", "@xyflow/react": "^12.4.4", "aes-js": "^3.1.2", + "asynckit": "^0.4.0", "axios": "1.6.7", "bignumber.js": "4.0.4", "chroma.ts": "1.0.10", "coinmarketcap-api": "^3.1.1", + "combined-stream": "^1.0.8", "ethers": "6.11.1", "framer-motion": "11.0.5", "get-starknet": "3.3.3", @@ -55,6 +57,7 @@ "jotai": "2.6.4", "jotai-tanstack-query": "0.8.5", "lodash.debounce": "^4.0.8", + "mime-types": "^3.0.1", "mixpanel": "^0.18.0", "mixpanel-browser": "2.49.0", "mustache": "4.2.0", @@ -99,7 +102,7 @@ "typescript": "5" }, "engines": { - "node": "20.x" + "node": ">=20.x" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/public/discord.svg b/public/discord.svg new file mode 100644 index 00000000..6d875840 --- /dev/null +++ b/public/discord.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/fulllogo.png b/public/fulllogo.png index 0dfec990..8d7e61bd 100755 Binary files a/public/fulllogo.png and b/public/fulllogo.png differ diff --git a/public/tg.svg b/public/tg.svg new file mode 100644 index 00000000..387a08b2 --- /dev/null +++ b/public/tg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app/api/lib.ts b/src/app/api/lib.ts index 12a9a1ab..6b8dd214 100644 --- a/src/app/api/lib.ts +++ b/src/app/api/lib.ts @@ -1,4 +1,4 @@ -import { STRKFarmStrategyAPIResult } from '@/store/strkfarm.atoms'; +import { TrovesStrategyAPIResult } from '@/store/troves.atoms'; import { Redis } from '@upstash/redis'; import { Contract, RpcProvider, uint256 } from 'starknet'; @@ -16,6 +16,11 @@ export async function getDataFromRedis( // force no cache return null; } + + if (!process.env.VK_REDIS_KV_REST_API_URL) { + return null; + } + const cacheData: any = await kvRedis.get(key); if ( cacheData && @@ -29,10 +34,17 @@ export async function getDataFromRedis( return null; } -export default kvRedis; +export async function setDataToRedis(key: string, data: any) { + if (!process.env.VK_REDIS_KV_REST_API_URL) { + return; + } + + await kvRedis.set(key, data); + console.log(`Cache set for ${key}`); +} export const getRewardsInfo = async ( - strategies: Pick[], + strategies: Pick[], ) => { const funder = '0x02D6cf6182259ee62A001EfC67e62C1fbc0dF109D2AA4163EB70D6d1074F0173'; diff --git a/src/app/api/strategies/route.ts b/src/app/api/strategies/route.ts index cc6981b6..c7ea9c53 100755 --- a/src/app/api/strategies/route.ts +++ b/src/app/api/strategies/route.ts @@ -5,11 +5,11 @@ import { RpcProvider } from 'starknet'; import { getLiveStatusNumber, getStrategies } from '@/store/strategies.atoms'; import MyNumber from '@/utils/MyNumber'; import { IStrategy, NFTInfo, TokenInfo } from '@/strategies/IStrategy'; -import { STRKFarmStrategyAPIResult } from '@/store/strkfarm.atoms'; +import { TrovesStrategyAPIResult } from '@/store/troves.atoms'; import { MY_STORE } from '@/store'; import VesuAtoms, { vesu } from '@/store/vesu.store'; import EndurAtoms, { endur } from '@/store/endur.store'; -import kvRedis, { getDataFromRedis, getRewardsInfo } from '../lib'; +import { setDataToRedis, getDataFromRedis, getRewardsInfo } from '../lib'; export const revalidate = 1800; // 30 minutes export const dynamic = 'force-dynamic'; @@ -56,7 +56,7 @@ const provider = new RpcProvider({ async function getStrategyInfo( strategy: IStrategy, -): Promise { +): Promise { const tvl = await strategy.getTVL(); const data = { @@ -158,7 +158,7 @@ export async function GET(req: Request) { // } // }); - const stratsDataProms: Promise[] = []; + const stratsDataProms: Promise[] = []; for (let i = 0; i < strategies.length; i++) { stratsDataProms.push(getStrategyInfo(strategies[i])); } @@ -181,7 +181,7 @@ export async function GET(req: Request) { strategies: _strats, lastUpdated: new Date().toISOString(), }; - await kvRedis.set(REDIS_KEY, data); + await setDataToRedis(REDIS_KEY, data); const response = NextResponse.json(data); response.headers.set( 'Cache-Control', diff --git a/src/app/community/page.tsx b/src/app/community/page.tsx index b82a66b7..df7cc821 100644 --- a/src/app/community/page.tsx +++ b/src/app/community/page.tsx @@ -204,6 +204,7 @@ const CommunityPage = () => { variant="outline" border="1px" borderRadius="5px" + color={'white'} zIndex={1} _before={{ content: `""`, @@ -224,10 +225,10 @@ const CommunityPage = () => { zIndex: -1, }} _hover={{ - bg: 'color2_50p', + bg: 'mycard', }} > - Know more + Know more @@ -274,7 +275,7 @@ const CommunityPage = () => {