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..eb27bfc3 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 [ { @@ -72,7 +75,13 @@ const nextConfig = { { source: '/tnc/v1', destination: - 'https://github.com/strkfarm/static-assets/blob/177389cad715d69245c1b125df87f90318ac2d7b/tnc.pdf', + 'https://github.com/trovesfi/static-assets/blob/177389cad715d69245c1b125df87f90318ac2d7b/tnc.pdf', + permanent: true, + }, + { + source: '/tnc/v2', + destination: + 'https://github.com/trovesfi/static-assets/blob/a0b4ff3a3533df35570311d95be37f1ffcb7fb54/tnc_v2.pdf', permanent: true, }, ]; diff --git a/package.json b/package.json index 4f3971fa..b1bc4ece 100755 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@adraffy/ens-normalize": "^1.11.0", "@ajna/pagination": "1.4.19", "@apollo/client": "^3.11.8", - "@avnu/avnu-sdk": "^3.0.0", + "@avnu/avnu-sdk": "3.0.2", "@chakra-ui/icons": "2.1.1", "@chakra-ui/react": "2.8.2", "@dagrejs/dagre": "^1.1.4", @@ -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.51", "@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,13 +57,13 @@ "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", "next": "14.1.0", "proxy-from-env": "^1.1.0", "react": "18", - "react-device-detect": "2.2.3", "react-dom": "18", "react-hot-toast": "2.4.1", "react-icons": "5.3.0", @@ -99,7 +101,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/favicon/android-chrome-192x192.png b/public/favicon/android-chrome-192x192.png new file mode 100644 index 00000000..26827ec2 Binary files /dev/null and b/public/favicon/android-chrome-192x192.png differ diff --git a/public/favicon/android-chrome-512x512.png b/public/favicon/android-chrome-512x512.png new file mode 100644 index 00000000..d6c9f200 Binary files /dev/null and b/public/favicon/android-chrome-512x512.png differ diff --git a/public/favicon/apple-touch-icon.png b/public/favicon/apple-touch-icon.png new file mode 100644 index 00000000..dd47565c Binary files /dev/null and b/public/favicon/apple-touch-icon.png differ diff --git a/public/favicon/favicon-16x16.png b/public/favicon/favicon-16x16.png new file mode 100644 index 00000000..3ab0b3cf Binary files /dev/null and b/public/favicon/favicon-16x16.png differ diff --git a/public/favicon/favicon-32x32.png b/public/favicon/favicon-32x32.png new file mode 100644 index 00000000..fb23c551 Binary files /dev/null and b/public/favicon/favicon-32x32.png differ diff --git a/public/favicon/favicon.ico b/public/favicon/favicon.ico new file mode 100644 index 00000000..4c110319 Binary files /dev/null and b/public/favicon/favicon.ico differ diff --git a/public/favicon/site.webmanifest b/public/favicon/site.webmanifest new file mode 100644 index 00000000..fd0a3449 --- /dev/null +++ b/public/favicon/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "Troves.fi | Yield Strategies for Starknet", + "short_name": "Troves.fi", + "background_color": "#000000", + "theme_color": "#000000", + "icons": [ + { + "src": "/favicon/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/favicon/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "display": "standalone" +} \ 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/fulllogo.svg b/public/fulllogo.svg new file mode 100644 index 00000000..3507ad8b --- /dev/null +++ b/public/fulllogo.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/logo.png b/public/logo.png index 0fe5e354..fc61373b 100755 Binary files a/public/logo.png and b/public/logo.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..c63b5526 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 = () => {