From b997098775fd61c20d83f0e48f3804ac1dea18f3 Mon Sep 17 00:00:00 2001 From: Oche Date: Mon, 14 Apr 2025 12:56:02 +0100 Subject: [PATCH 01/48] feat: UI redesign --- next.config.mjs | 13 +- src/app/globals.css | 20 +- src/app/page.tsx | 67 +-- src/app/template.tsx | 20 +- src/assets/argentMobile.svg | 12 + src/assets/shield.svg | 4 +- src/assets/tg.svg | 18 +- src/components/Filters.tsx | 739 ++++++++++++++++++++-------------- src/components/Navbar.tsx | 104 +++-- src/components/Pools.tsx | 349 +++++++++++----- src/components/Strategies.tsx | 63 ++- src/components/TVL.tsx | 29 +- src/components/YieldCard.tsx | 182 +++++---- src/constants.ts | 2 +- src/store/ekobu.store.ts | 6 +- 15 files changed, 1001 insertions(+), 627 deletions(-) create mode 100644 src/assets/argentMobile.svg mode change 100755 => 100644 src/assets/tg.svg diff --git a/next.config.mjs b/next.config.mjs index 0ecfe991..0dae19fc 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 [ { diff --git a/src/app/globals.css b/src/app/globals.css index e5419d4b..436ae13e 100755 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -18,12 +18,12 @@ body { color: rgb(var(--foreground-rgb)); - background: linear-gradient( + /* background: linear-gradient( to bottom, transparent, rgb(var(--background-end-rgb)) ) - rgb(var(--background-start-rgb)); + rgb(var(--background-start-rgb)); */ } @layer utilities { @@ -32,10 +32,6 @@ body { } } -.pagination-container { - padding: 20px 0px 2px 0px !important; -} - .glow-button { width: 220px; height: 50px; @@ -130,7 +126,7 @@ body { .text-cell { border-bottom: 1px solid var(--chakra-colors-bg); - padding: 3px; + /* padding: 3px; */ } .embla { @@ -173,14 +169,18 @@ body { ); } +.connect-button-gradient { + background: linear-gradient(90deg, #8f6cff 0%, #6e59ff 100%); +} + td, -th { +tr { border-color: var(--chakra-colors-bg) !important; - vertical-align: top; + border-bottom: 1px solid var(--chakra-colors-slate_blue) !important; } th { - color: var(--chakra-colors-color2Text) !important; + border-bottom: none !important; } .orange { diff --git a/src/app/page.tsx b/src/app/page.tsx index e14d2a51..04dc7361 100755 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -28,7 +28,6 @@ import useEmblaCarousel from 'embla-carousel-react'; import mixpanel from 'mixpanel-browser'; import { useRouter, useSearchParams } from 'next/navigation'; import { useEffect, useState } from 'react'; -import { isMobile } from 'react-device-detect'; const banner_images = [ // { @@ -71,7 +70,7 @@ export default function Home() { } function handleTabsChange(index: number) { - if (index === 0) { + if (index === 1) { setRoute('strategies'); } else { setRoute('pools'); @@ -86,29 +85,28 @@ export default function Home() { (async () => { const tab = searchParams.get('tab'); if (tab === 'pools') { - setTabIndex(1); - } else { setTabIndex(0); + } else { + setTabIndex(1); } })(); }, [searchParams]); return ( - + - - Starknet's Yield Powerhouse - + Starknet's Yield Powerhouse 🚀 - + {/* {banner_images.map((banner, index) => ( ))} - + */} - + {/* ))} - + */} @@ -190,38 +188,53 @@ export default function Home() { > { - mixpanel.track('Strategies opened'); + mixpanel.track('All pools clicked'); }} > - Strategies✨ + Find yields { - mixpanel.track('All pools clicked'); + mixpanel.track('Strategies opened'); }} > - Find yields + Strategies✨ - - - - + + + + {/*
*/} diff --git a/src/app/template.tsx b/src/app/template.tsx index 2b8664d8..43b6ff05 100755 --- a/src/app/template.tsx +++ b/src/app/template.tsx @@ -37,17 +37,31 @@ const theme = extendTheme({ color2: 'rgba(132, 132, 195, 1)', color2Text: 'rgb(184 184 239)', color2_65p: 'rgba(132, 132, 195, 0.65)', - color2_50p: 'rgba(132, 132, 195, 0.15)', + color2_50p: 'rgba(30, 30, 44, 0.5)', highlight: '#1a1a27', // light grey light_grey: '#9ca9ad', disabled_text: '#818181', disabled_bg: '#5f5f5f', - purple: '#6e53dc', + + purple: '#6F4FF2', + purple_hover: '#4C2CD7', + purple_hover_2: '#C5A6FF', + purple_active: '#3B20B4', + bright_purple: '#907CFF', + purple_gray: '#DFDFEC', cyan: '#7DFACB', - bg: '#111119', // dark blue + bg: '#181824', // dark blue grey_text: '#B6B6B6', + text: '#F8F8FF', yellow: '#EFDB72', red: '#e18787', + light_green: '#3EE5C2', + dark_navy: '#181824', + slate_blue: '#2D2D3D', + silver_gray: '#8E8E8E', + + color_3: '#363651', + color_4: '#4DB8FF', }, fontSizes: { large: '50px', diff --git a/src/assets/argentMobile.svg b/src/assets/argentMobile.svg new file mode 100644 index 00000000..1dd02636 --- /dev/null +++ b/src/assets/argentMobile.svg @@ -0,0 +1,12 @@ + + + \ No newline at end of file diff --git a/src/assets/shield.svg b/src/assets/shield.svg index 198e3ee4..8b97b9d2 100644 --- a/src/assets/shield.svg +++ b/src/assets/shield.svg @@ -1,7 +1,7 @@ - - + + diff --git a/src/assets/tg.svg b/src/assets/tg.svg old mode 100755 new mode 100644 index b9fd6b2e..53b3e000 --- a/src/assets/tg.svg +++ b/src/assets/tg.svg @@ -1,9 +1,11 @@ - - - - - - - + + + + - \ No newline at end of file + + + + + + diff --git a/src/components/Filters.tsx b/src/components/Filters.tsx index ed454a01..d1757882 100755 --- a/src/components/Filters.tsx +++ b/src/components/Filters.tsx @@ -2,24 +2,21 @@ import React from 'react'; import { useAtomValue, useSetAtom } from 'jotai'; import { Avatar, - AvatarBadge, - AvatarGroup, Box, + Grid, HStack, - IconButton, Tag, TagLabel, Text, Tooltip, } from '@chakra-ui/react'; -import { CheckIcon, CloseIcon } from '@chakra-ui/icons'; +import { CloseIcon } from '@chakra-ui/icons'; import { ALL_FILTER, filterAtoms, filters, updateFiltersAtom, } from '@/store/protocols'; -import { getTokenInfoFromName } from '@/utils'; import { Category, PoolType } from '@/store/pools'; import mixpanel from 'mixpanel-browser'; @@ -34,111 +31,157 @@ export function ProtocolFilters() { } function atleastOneProtocolSelected() { - return protocolsFilter.length > 0; + return ( + protocolsFilter.includes(ALL_FILTER) || + (protocolsFilter.length > 0 && !protocolsFilter.includes(ALL_FILTER)) + ); } + + function getSelectedProtocolsCount() { + if (protocolsFilter.includes(ALL_FILTER)) { + return filters.protocols.length; + } + return protocolsFilter.length; + } + const updateFilters = useSetAtom(updateFiltersAtom); return ( - - {filters.protocols.map((p) => ( - { - console.log('clicked', p.name); - // generated list of protocols selected. All means array of all protocols. - const selectedProtocols = protocolsFilter.includes(ALL_FILTER) - ? [] - : protocolsFilter; - - let updatedProtocols = []; - if (selectedProtocols.includes(p.name)) { - updatedProtocols = selectedProtocols.filter((x) => x !== p.name); - } else { - updatedProtocols = [...selectedProtocols, p.name]; + + + {filters.protocols.map((p, index) => ( + - - *': { + color: 'black', + }, + }} + onClick={() => { + const selectedProtocols = protocolsFilter.includes(ALL_FILTER) + ? [] + : protocolsFilter; + + let updatedProtocols = []; + if (selectedProtocols.includes(p.name)) { + updatedProtocols = selectedProtocols.filter( + (x) => x !== p.name, + ); + } else { + updatedProtocols = [...selectedProtocols, p.name]; } - /> - - - ))} + if (updatedProtocols.length === filters.protocols.length) { + updatedProtocols = [ALL_FILTER]; + } + mixpanel.track('Protocol Filter', { + protocol: p.name, + selected: + updatedProtocols.includes(p.name) || + updatedProtocols.includes(ALL_FILTER), + updatedProtocols: JSON.stringify(updatedProtocols), + }); + updateFilters('protocols', updatedProtocols); + }} + > + + + + + ))} + {/* Clear all or select all button */} *': { + color: 'black', + }, + }} + onClick={() => { + updateFilters( + 'protocols', + atleastOneProtocolSelected() ? [] : [ALL_FILTER], + ); + mixpanel.track('Clear/Select all protocols', { + atleastOneProtocolSelected: atleastOneProtocolSelected(), + }); + }} > - - : } - onClick={() => { - updateFilters( - 'protocols', - atleastOneProtocolSelected() ? [] : [ALL_FILTER], - ); - mixpanel.track('Clear/Select all protocols', { - atleastOneProtocolSelected: atleastOneProtocolSelected(), - }); - }} - _hover={{ - bg: atleastOneProtocolSelected() ? 'bg' : 'purple', - boxShadow: '0px 0px 5px var(--chakra-colors-color1)', - }} - /> - + {getSelectedProtocolsCount()} + + + {atleastOneProtocolSelected() ? 'Clear filters' : 'Select all'} + ); @@ -233,234 +276,312 @@ export function CategoryFilters() { function getTextProps(isActive: boolean) { return { fontSize: '14px', - color: isActive ? 'bg' : 'color2Text', + fontWeight: isActive ? '600' : 'normal', + color: isActive ? 'black' : 'white', + _hover: { + color: 'black', + }, }; } return ( - - {/* Protocols: {JSON.stringify(protocolFilters)} - Category: {JSON.stringify(categoriesFilter)} - Risk: {JSON.stringify(riskLevelFilters)} - Types: {JSON.stringify(poolTypeFilters)} */} + + + + {/* Stable pools */} + *': { + color: 'black', + }, + }} + onClick={() => { + updateCategory(Category.Stable); + }} + > + + {Category.Stable.valueOf().split(' ')[0]} + + - {/* Stable pools */} - { - updateCategory(Category.Stable); - }} - bg={ - categoriesFilter.includes(Category.Stable.valueOf()) - ? 'purple' - : 'color1' - } - marginBottom={'10px'} - > - - - - - - {Category.Stable.valueOf()} - - + {/* STRK pools */} + { + updateCategory(Category.STRK); + }} + bg={ + categoriesFilter.includes(Category.STRK.valueOf()) + ? 'purple' + : 'transparent' + } + color={'white'} + borderTopWidth={'1px'} + borderBottomWidth={'1px'} + borderRightWidth={'1px'} + borderRadius={'none'} + borderColor={'slate_blue'} + display={'flex'} + justifyContent={'center'} + _hover={{ + bg: 'purple_hover_2', + '& > *': { + color: 'black', + }, + }} + > + + {Category.STRK.valueOf().split(' ')[0]} + + - {/* STRK pools */} - { - updateCategory(Category.STRK); - }} - bg={ - categoriesFilter.includes(Category.STRK.valueOf()) - ? 'purple' - : 'color1' - } - marginBottom={'10px'} - > - - - - - {Category.STRK.valueOf()} - - + {/* ETH pools */} + { + updateCategory(Category.ETH); + }} + bg={ + categoriesFilter.includes(Category.ETH.valueOf()) + ? 'purple' + : 'transparent' + } + color={'white'} + borderTopWidth={'1px'} + borderBottomWidth={'1px'} + borderRightWidth={'1px'} + borderRadius={'none'} + borderColor={'slate_blue'} + display={'flex'} + justifyContent={'center'} + _hover={{ + bg: 'purple_hover_2', + '& > *': { + color: 'black', + }, + }} + > + + {Category.ETH.valueOf().split(' ')[0]} + + - {/* ETH pools */} - { - updateCategory(Category.ETH); - }} - bg={ - categoriesFilter.includes(Category.ETH.valueOf()) - ? 'purple' - : 'color1' - } - marginBottom={'10px'} - > - - - - - {Category.ETH.valueOf()} - - + {/* Low risk pools */} + { + updateRiskLevel(['1', '2']); + }} + bg={isLowRisk() ? 'purple' : 'transparent'} + color={'white'} + display={'flex'} + justifyContent={'center'} + borderTopWidth={'1px'} + borderBottomWidth={'1px'} + borderRightWidth={'1px'} + borderTopLeftRadius={'none'} + borderBottomLeftRadius={'none'} + borderTopRightRadius={'8px'} + borderBottomRightRadius={'8px'} + borderColor={'slate_blue'} + _hover={{ + bg: 'purple_hover_2', + '& > *': { + color: 'black', + }, + }} + > + Low risk + + - {/* Low risk pools */} - { - updateRiskLevel(['1', '2']); - }} - bg={isLowRisk() ? 'purple' : 'color1'} - marginBottom={'10px'} - > - - {['USDC', 'USDT', 'STRK', 'ETH'].map((token, index) => ( - + {/* DEXes */} + { + updatePoolType([PoolType.DEXV2, PoolType.DEXV3], 'DEX'); + }} + bg={ + poolTypeFilters.includes(PoolType.DEXV2.valueOf()) || + poolTypeFilters.includes(PoolType.DEXV3.valueOf()) + ? 'purple' + : 'transparent' + } + color={'white'} + borderLeftWidth={'1px'} + borderRightWidth={'1px'} + borderTopWidth={'1px'} + borderBottomWidth={'1px'} + borderTopLeftRadius={'8px'} + borderBottomLeftRadius={'8px'} + borderTopRightRadius={'none'} + borderBottomRightRadius={'none'} + borderColor={'slate_blue'} + display={'flex'} + justifyContent={'center'} + _hover={{ + bg: 'purple_hover_2', + '& > *': { + color: 'black', + }, + }} + > + - {index == 0 && } - - ))} - - Low risk - + DEX + + - {/* DEXes */} - { - updatePoolType([PoolType.DEXV2, PoolType.DEXV3], 'DEX'); - }} - bg={ - poolTypeFilters.includes(PoolType.DEXV2.valueOf()) || - poolTypeFilters.includes(PoolType.DEXV3.valueOf()) - ? 'purple' - : 'color1' - } - marginBottom={'10px'} - > - - DEX Pools - - + {/* Lending */} + { + updatePoolType([PoolType.Lending], 'Lending'); + }} + bg={ + poolTypeFilters.includes(PoolType.Lending) + ? 'purple' + : 'transparent' + } + color={'white'} + borderTopWidth={'1px'} + borderBottomWidth={'1px'} + borderRightWidth={'1px'} + borderRadius={'none'} + borderColor={'slate_blue'} + display={'flex'} + justifyContent={'center'} + _hover={{ + bg: 'purple_hover_2', + '& > *': { + color: 'black', + }, + }} + > + + Lending + + - {/* Lending */} - { - updatePoolType([PoolType.Lending], 'Lending'); - }} - bg={poolTypeFilters.includes(PoolType.Lending) ? 'purple' : 'color1'} - marginBottom={'10px'} - > - - Lending Pools - - + {/* Derivatives */} + { + updatePoolType([PoolType.Derivatives], 'Derivatives'); + }} + bg={ + poolTypeFilters.includes(PoolType.Derivatives) + ? 'purple' + : 'transparent' + } + color={'white'} + display={'flex'} + justifyContent={'center'} + borderTopWidth={'1px'} + borderBottomWidth={'1px'} + borderRightWidth={'1px'} + borderTopLeftRadius={'none'} + borderBottomLeftRadius={'none'} + borderTopRightRadius={'8px'} + borderBottomRightRadius={'8px'} + borderColor={'slate_blue'} + _hover={{ + bg: 'purple_hover_2', + '& > *': { + color: 'black', + }, + }} + > + + Derivative + + + - {/* Derivatives */} - { - updatePoolType([PoolType.Derivatives], 'Derivatives'); - }} - bg={ - poolTypeFilters.includes(PoolType.Derivatives) ? 'purple' : 'color1' - } - marginBottom={'10px'} - > - *': { + color: 'black', + }, + }} + onClick={() => { + updateFilters('categories', [ALL_FILTER]); + updateFilters('risk', [ALL_FILTER]); + updateFilters('poolTypes', [ALL_FILTER]); + mixpanel.track('Reset Filters'); + }} > - Derivative Pools - - - - {/* Reset */} - { - updateFilters('categories', [ALL_FILTER]); - updateFilters('risk', [ALL_FILTER]); - updateFilters('poolTypes', [ALL_FILTER]); - mixpanel.track('Reset Filters'); - }} - marginBottom={'10px'} - > - - - Reset - - - + + + Reset + + + + ); } diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 1e0abce0..e3e5886c 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -1,4 +1,4 @@ -import { ChevronDownIcon, HamburgerIcon } from '@chakra-ui/icons'; +import { ChevronDownIcon, HamburgerIcon, EmailIcon } from '@chakra-ui/icons'; import { Avatar, Box, @@ -29,6 +29,7 @@ import { } from 'starknetkit'; import tg from '@/assets/tg.svg'; +import argentMobile from '@/assets/argentMobile.svg'; import CONSTANTS from '@/constants'; import { getERC20Balance } from '@/store/balance.atoms'; import { addressAtom } from '@/store/claims.atoms'; @@ -157,6 +158,16 @@ export function getConnectors(isMobile: boolean) { return sortedConnectors; } +const walletIconMap: Record = { + argentMobile, + argentWebWallet: EmailIcon, +}; + +const getWalletIcon = (walletId: string) => { + console.log(walletId, 'walletId'); + return walletIconMap[walletId]; +}; + interface NavbarProps { hideTg?: boolean; forceShowConnect?: boolean; @@ -201,6 +212,7 @@ export default function Navbar(props: NavbarProps) { async function connectWallet(config = connectorConfig) { try { const { connector } = await connect(config); + console.log(connector, 'connector'); if (connector) { connectSnReact({ connector: connector as any }); @@ -383,28 +395,11 @@ export default function Navbar(props: NavbarProps) { {!props.hideTg && ( - - - } - _hover={{ - bg: 'color2_50p', - }} - display={{ base: 'none !important', md: 'flex !important' }} - > - Join Telegram - + } /> + + } + _hover={{ + bg: 'purple_hover_2', + color: 'black', + }} + display={{ base: 'none !important', md: 'flex !important' }} + > + Telegram + )} @@ -434,26 +451,22 @@ export default function Navbar(props: NavbarProps) { rightIcon={address ? : <>} iconSpacing={{ base: '1px', sm: '5px' }} bgColor={'purple'} - color="white" - borderColor={'purple'} - borderWidth="1px" - _hover={{ - bg: 'bg', - borderColor: 'purple', - borderWidth: '1px', - color: 'purple', - }} - _active={{ - bg: 'bg', - borderColor: 'purple', - color: 'purple', - }} + color={'black'} + borderRadius={'100px'} marginLeft={'10px'} display={{ base: 'flex' }} height={{ base: '2rem', sm: '2.5rem' }} my={{ base: 'auto', sm: 'initial' }} paddingX={{ base: '0.5rem', sm: '1rem' }} - fontSize={{ base: '0.8rem', sm: '1rem' }} + fontSize={{ base: '0.5rem', sm: '0.8rem' }} + fontWeight={'bold'} + size="xs" + _hover={{ + bgColor: 'purple_hover', + }} + _active={{ + bgColor: 'purple_active', + }} onClick={ address ? undefined @@ -461,19 +474,22 @@ export default function Navbar(props: NavbarProps) { connectWallet(); } } - size="xs" >
{address ? (
pfp{' '} @@ -483,7 +499,7 @@ export default function Navbar(props: NavbarProps) {
) : ( - 'Connect' + 'Connect wallet' )}
diff --git a/src/components/Pools.tsx b/src/components/Pools.tsx index ab10541c..46920a89 100755 --- a/src/components/Pools.tsx +++ b/src/components/Pools.tsx @@ -101,119 +101,262 @@ export default function Pools() { } }; return ( - - - - - + + + + + + + + + { + setCurrentPage(page); + }} + > + + + {'<'} + + + {pages.map((page: number) => ( + + ))} + + + {'>'} + + + + + - { - setCurrentPage(page); + - - - {'<'} - - - {pages.map((page: number) => ( - + + + + + + + + + + {allPools.length > 0 && ( + <> + {pools.map((pool, index) => { + return ( + + ); + })} + + )} + +
+ Pool name + + + + - ))} - - - {'>'} - - - + + + + MY BAL +
+ {allPools.length > 0 && pools.length === 0 && ( + + + No pools. Check filters. + + + )} + {allPools.length === 0 && ( + + + + + + )}
- - - - - - - - - - - - {allPools.length > 0 && ( - <> - {pools.map((pool, index) => { - return ( - - ); - })} - - )} - -
Pool name - - - - - -
- {allPools.length > 0 && pools.length === 0 && ( - - - No pools. Check filters. - - - )} - {allPools.length === 0 && ( - - - - - - )} -
+ { + setCurrentPage(page); + }} + > + + + {'<'} + + + {pages.map((page: number) => ( + + ))} + + + {'>'} + + +
); } diff --git a/src/components/Strategies.tsx b/src/components/Strategies.tsx index 71184288..9842703e 100755 --- a/src/components/Strategies.tsx +++ b/src/components/Strategies.tsx @@ -1,5 +1,6 @@ import { usePagination } from '@ajna/pagination'; import { + Box, Container, Link, Skeleton, @@ -44,21 +45,51 @@ export default function Strategies() { }, [_filteredPools, currentPage]); return ( - - - What are strategies? - - - Strategies are a combination of investment steps that combine various - pools to maximize yield. - - - - - - - - + + + + What are strategies? + + + Strategies are a combination of investment steps that combine various + pools to maximize yield. + + + +
Strategy nameAPYRiskTVL
+ + + + + + + @@ -82,7 +113,7 @@ export default function Strategies() { )} { width="100%" > - + Total Value locked (TVL) @@ -62,7 +69,14 @@ const TVL: React.FC = () => { - + Your holdings @@ -72,7 +86,7 @@ const TVL: React.FC = () => { ) : !userData ? ( 0 ) : ( - Number(userData?.holdingsUSD.toFixed(2)).toLocaleString() + Number(userData?.holdingsUSD?.toFixed(2)).toLocaleString() )} @@ -80,7 +94,14 @@ const TVL: React.FC = () => { - + Your referral link{' '} diff --git a/src/components/YieldCard.tsx b/src/components/YieldCard.tsx index 33cb6881..9d8ea78d 100644 --- a/src/components/YieldCard.tsx +++ b/src/components/YieldCard.tsx @@ -6,7 +6,7 @@ import { STRKFarmStrategyAPIResult } from '@/store/strkfarm.atoms'; import { UserStats, userStatsAtom } from '@/store/utils.atoms'; import { isLive, StrategyLiveStatus } from '@/strategies/IStrategy'; import { getDisplayCurrencyAmount } from '@/utils'; -import { TriangleDownIcon, TriangleUpIcon } from '@chakra-ui/icons'; +import { ArrowDownIcon, ArrowUpIcon } from '@chakra-ui/icons'; import { Avatar, AvatarGroup, @@ -17,7 +17,6 @@ import { GridItem, Heading, HStack, - Icon, Image, Link, Spinner, @@ -26,13 +25,11 @@ import { Text, Tooltip, Tr, - VStack, } from '@chakra-ui/react'; import { useAtomValue } from 'jotai'; import mixpanel from 'mixpanel-browser'; import { useMemo } from 'react'; import { isMobile } from 'react-device-detect'; -import { FaWallet } from 'react-icons/fa'; export interface YieldCardProps { pool: PoolInfo; @@ -45,7 +42,7 @@ export function getStratCardBg(status: StrategyLiveStatus, index: number) { return '#414173'; } if (isLive(status)) { - return index % 2 === 0 ? 'color1_50p' : 'color2_50p'; + return index % 2 === 0 ? 'dark_navy' : 'color2_50p'; } if (status == StrategyLiveStatus.RETIRED) { return 'black'; @@ -55,10 +52,10 @@ export function getStratCardBg(status: StrategyLiveStatus, index: number) { function getStratCardBadgeBg(status: StrategyLiveStatus) { if (isLive(status)) { - return 'cyan'; + return 'color_4'; } else if (status === StrategyLiveStatus.COMING_SOON) { return 'yellow'; - } else if (status == StrategyLiveStatus.RETIRED) { + } else if (status === StrategyLiveStatus.RETIRED) { return 'grey'; } return 'bg'; @@ -77,7 +74,12 @@ export function StrategyInfo(props: YieldCardProps) { - + {pool.pool.name} {pool.additional && @@ -89,7 +91,7 @@ export function StrategyInfo(props: YieldCardProps) { ml="1" bg={getStratCardBadgeBg(tag)} fontFamily={'sans-serif'} - padding="2px 8px" + padding="4px 8px" textTransform="capitalize" fontWeight={500} key={tag} @@ -109,6 +111,8 @@ export function StrategyInfo(props: YieldCardProps) { justifyContent="center" backgroundColor={'rgba(0, 0, 0, 0.2)'} borderRadius={'50%'} + bg={'#61FCAE'} + padding={'3px 5px'} > @@ -119,7 +123,12 @@ export function StrategyInfo(props: YieldCardProps) { {props.showProtocolName && ( - + {pool.protocol.name} @@ -139,7 +148,7 @@ function getAPRWithToolTip(pool: PoolInfo) { {split.title} {split.description ? `(${split.description})` : ''} - + {split.apr === 'Err' ? split.apr : (split.apr * 100).toFixed(2)}% @@ -154,16 +163,16 @@ function getAPRWithToolTip(pool: PoolInfo) { marginRight={'0px'} marginLeft={'auto'} display={'flex'} - justifyContent={'flex-end'} + justifyContent={'flex-start'} > {pool.isLoading && } {!pool.isLoading && ( <> {(pool.apr * 100).toFixed(2)}% @@ -181,13 +190,13 @@ function StrategyAPY(props: YieldCardProps) { }, [pool]); return ( - + {isRetired ? ( - ) : ( - <> + {getAPRWithToolTip(pool)} {/* {pool.additional && pool.additional.leverage && ( @@ -209,7 +218,7 @@ function StrategyAPY(props: YieldCardProps) { )} */} - + )} ); @@ -242,10 +251,6 @@ export function getStrategyWiseHoldingsInfo( export function StrategyTVL(props: YieldCardProps) { const { pool } = props; - const address = useAtomValue(addressAtom); - const { data: userData } = useAtomValue(userStatsAtom); - - const holdingsInfo = getStrategyWiseHoldingsInfo(userData, pool.pool.id); const isPoolLive = pool.additional && @@ -255,70 +260,55 @@ export function StrategyTVL(props: YieldCardProps) { return ( {isPoolLive && ( - + ${getDisplayCurrencyAmount(pool.tvl || 0, 0)} )} {!isPoolLive && -} - {address && isPoolLive && pool.protocol.name == 'STRKFarm' && ( - - - - - - ${getDisplayCurrencyAmount(holdingsInfo.usdValue, 0)} - - - - - - {holdingsInfo.amount != 0 && ( - - {/* */} - - {getDisplayCurrencyAmount( - holdingsInfo.amount, - holdingsInfo.tokenInfo.displayDecimals, - ).toLocaleString()} - - - - )} - - - + + ); +} + +export function StrategyBalance(props: YieldCardProps) { + const { pool } = props; + const address = useAtomValue(addressAtom); + const { data: userData } = useAtomValue(userStatsAtom); + + const holdingsInfo = getStrategyWiseHoldingsInfo(userData, pool.pool.id); + + const isPoolLive = + pool.additional && + pool.additional.tags[0] && + isLive(pool.additional.tags[0]); + + return ( + + {!isPoolLive && -} + {address && isPoolLive && pool.protocol.name === 'STRKFarm' && ( + + + ${getDisplayCurrencyAmount(holdingsInfo.usdValue || 0, 0)} + + )} ); } + // return sort heading text to match with sort options heading text function sortHeading(field: string) { if (field == 'APY') { @@ -326,6 +316,7 @@ function sortHeading(field: string) { } return field.toUpperCase(); } + function GetRiskLevel(riskFactor: number) { let color = ''; let bgColor = ''; @@ -353,8 +344,8 @@ function GetRiskLevel(riskFactor: number) { - @@ -502,7 +482,7 @@ export default function YieldCard(props: YieldCardProps) { ) : pool.additional?.riskFactor ? ( - GetRiskLevel(pool.additional?.riskFactor) + + {GetRiskLevel(pool.additional?.riskFactor)} + ) : ( '-' )} @@ -543,6 +525,15 @@ export default function YieldCard(props: YieldCardProps) { )} + { props.onClick(order); }} - float={'right'} + float={'left'} + padding={0} > {props.heading.toUpperCase()} - - + - - + ); } diff --git a/src/constants.ts b/src/constants.ts index afe88058..abc977bb 100755 --- a/src/constants.ts +++ b/src/constants.ts @@ -56,7 +56,7 @@ export const CONSTANTS = { BASE_APR_API: '/haiko/markets?network=mainnet', }, STRKFarm: { - BASE_APR_API: '/api/strategies', + BASE_APR_API: 'https://app.strkfarm.com/api/strategies', }, MY_SWAP: { POOLS_API: '/myswap/data/pools/all.json', diff --git a/src/store/ekobu.store.ts b/src/store/ekobu.store.ts index 1908ee55..bdb056ee 100755 --- a/src/store/ekobu.store.ts +++ b/src/store/ekobu.store.ts @@ -177,7 +177,7 @@ export class Ekubo extends IDapp { priceOfUsdc, } = data.data; - const strkToken = tokens.find((t) => t.symbol === 'STRK'); + const strkToken = tokens?.find((t) => t.symbol === 'STRK'); const getTokenPrice = (symbol: string): number => { switch (symbol) { @@ -196,9 +196,9 @@ export class Ekubo extends IDapp { .map((p) => { const t0 = BigInt(p.token0); const t1 = BigInt(p.token1); - const token0 = tokens.find((t) => BigInt(t.l2_token_address) === t0); + const token0 = tokens?.find((t) => BigInt(t.l2_token_address) === t0); if (!token0 || token0.hidden) return; - const token1 = tokens.find((t) => BigInt(t.l2_token_address) === t1); + const token1 = tokens?.find((t) => BigInt(t.l2_token_address) === t1); if (!token1 || token1.hidden) return; const springPair = defiSpringData.pairs.find( From 3fd9aa55c1d83a909161c4887782e8f2aad8ee70 Mon Sep 17 00:00:00 2001 From: Oche Date: Mon, 14 Apr 2025 13:05:00 +0100 Subject: [PATCH 02/48] chore: remove console --- next.config.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index 0dae19fc..724eff57 100755 --- a/next.config.mjs +++ b/next.config.mjs @@ -6,9 +6,9 @@ const nextConfig = { process.env.NODE_ENV == 'development' ? {} : { - // removeConsole: { - // exclude: ['error'], - // }, + removeConsole: { + exclude: ['error'], + }, }, async rewrites() { return [ From 3336d91546f013785dde4c82a6d1edceb39d8d3c Mon Sep 17 00:00:00 2001 From: Oche Date: Sun, 20 Apr 2025 14:04:57 +0100 Subject: [PATCH 03/48] feat: Add strategy status utilities and update strategy components - Add new strategyStatus.ts utility for managing strategy live status - Update Deposit component with improved balance handling and UI - Enhance Strategy component with better tab management and routing - Update strategy store with new status handling and strategy configurations - Add new alerts and warnings for strategy operations - Improve transaction handling and UI feedback - Update template and navbar components for better navigation - Add new yield card component for strategy information display - Update protocol and strategy store atoms for better state management --- .../[strategyId]/_components/Strategy.tsx | 1031 ++++++++--------- src/app/strategy/[strategyId]/page.tsx | 2 +- src/app/template.tsx | 23 +- src/components/Deposit.tsx | 196 ++-- src/components/HarvestTime.tsx | 237 +++- src/components/Navbar.tsx | 4 +- src/components/TxButton.tsx | 18 +- src/components/YieldCard.tsx | 3 +- src/store/protocols.ts | 2 +- src/store/strategies.atoms.tsx | 16 +- src/store/strkfarm.atoms.ts | 2 +- src/utils.ts | 8 +- src/utils/strategyStatus.ts | 29 + 13 files changed, 841 insertions(+), 730 deletions(-) create mode 100644 src/utils/strategyStatus.ts diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index 160e9380..2c5ebc1a 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -6,14 +6,12 @@ import { Avatar, Badge, Box, - Card, - Center, + Button, + Container, Flex, - Grid, - GridItem, + Image, Link, ListItem, - OrderedList, Spinner, Tab, TabIndicator, @@ -23,13 +21,16 @@ import { Tabs, Text, Tooltip, + UnorderedList, VStack, - Wrap, - WrapItem, } from '@chakra-ui/react'; +import { ArrowBackIcon } from '@chakra-ui/icons'; import { atom, useAtomValue, useSetAtom } from 'jotai'; import mixpanel from 'mixpanel-browser'; import { useCallback, useEffect, useMemo, useState } from 'react'; +import { useRouter, useSearchParams } from 'next/navigation'; + +import shield from '@/assets/shield.svg'; import Deposit from '@/components/Deposit'; import HarvestTime from '@/components/HarvestTime'; @@ -37,36 +38,238 @@ import { DUMMY_BAL_ATOM } from '@/store/balance.atoms'; import { addressAtom } from '@/store/claims.atoms'; import { strategiesAtom, StrategyInfo } from '@/store/strategies.atoms'; import { transactionsAtom, TxHistoryAtom } from '@/store/transactions.atom'; -import { - capitalize, - getTokenInfoFromAddr, - getUniqueById, - shortAddress, - timeAgo, -} from '@/utils'; +import { getTokenInfoFromAddr } from '@/utils'; import MyNumber from '@/utils/MyNumber'; -import { ExternalLinkIcon } from '@chakra-ui/icons'; import { StrategyParams } from '../page'; -import FlowChart from './FlowChart'; -import { isMobile } from 'react-device-detect'; import { getRiskExplaination } from '@strkfarm/sdk'; +function Manage({ strategy }: { strategy: StrategyInfo }) { + return ( + + + + How does it work? + + + + Deposit USDC to automatically loop funds between zkLend and Nostra. + + + Creates a delta-neutral position to maximize USDC yield. + + + Position is periodically adjusted to maintain a healthy health + factor + + + Receive an NFT as representation for your stake on STRKFarm. + + Withdraw anytime by redeeming your NFT for USDC. + + + + + Risk + + {strategy.metadata.risk.riskFactor.map((r: any, i: number) => ( + + + {r.type.valueOf()} + + + ))} + + + + + + + {}} + > + Deposit + + {}} + > + Withdraw + + + + + + {strategy.settings.alerts !== undefined && ( + + {strategy.settings.alerts + .filter((a) => a.tab === 'deposit' || a.tab === 'all') + .map((alert, index) => ( + + + {alert.text} + + ))} + + )} + + + + {strategy.settings.alerts !== undefined && ( + + {strategy.settings.alerts + .filter((a) => a.tab === 'withdraw' || a.tab === 'all') + .map((alert, index) => ( + + + {alert.text} + + ))} + + )} + + + + + + ); +} + const Strategy = ({ params }: StrategyParams) => { const address = useAtomValue(addressAtom); const strategies = useAtomValue(strategiesAtom); const transactions = useAtomValue(transactionsAtom); const [isMounted, setIsMounted] = useState(false); + const router = useRouter(); + const searchParams = useSearchParams(); + const [tabIndex, setTabIndex] = useState(0); + + function setRoute(value: string) { + router.push(`?tab=${value}`); + } + + function handleTabsChange(index: number) { + switch (index) { + case 0: + setRoute('manage'); + break; + case 1: + setRoute('risk'); + break; + case 2: + setRoute('details'); + break; + case 3: + setRoute('faq'); + break; + case 4: + setRoute('transactions'); + break; + default: + setRoute('manage'); + break; + } + } + + useEffect(() => { + mixpanel.track('Page open'); + }, []); + + useEffect(() => { + (async () => { + const tab = searchParams.get('tab'); + + switch (tab) { + case 'manage': + setTabIndex(0); + break; + case 'risk': + setTabIndex(1); + break; + case 'details': + setTabIndex(2); + break; + case 'faq': + setTabIndex(3); + break; + case 'transactions': + setTabIndex(4); + break; + default: + setTabIndex(0); + break; + } + })(); + }, [searchParams]); const strategy: StrategyInfo | undefined = useMemo(() => { const id = params.strategyId; - console.log('id', id); - return strategies.find((s) => s.id === id); }, [params.strategyId, strategies]); - console.log('strategy', strategy); - const strategyAddress = useMemo(() => { const holdingTokens = strategy?.holdingTokens; if (holdingTokens && holdingTokens.length) { @@ -166,554 +369,280 @@ const Strategy = ({ params }: StrategyParams) => { if (!isMounted) return null; return ( - <> - - - + + - {strategy ? strategy.name : 'Strategy Not found'} - - + + + + + - {strategy && ( - - - - - {!strategy?.isRetired() && ( - - )} - - - - How does it work? - + {strategy && ( + + + + + + {strategy ? strategy.name : 'Strategy Not found'} + + + + + + + + - {strategy.description} + Your Holdings: - - {getUniqueById( - strategy.actions.map((p) => ({ - id: p.pool.protocol.name, - logo: p.pool.protocol.logo, - })), - ).map((p) => ( - -
- - {p.id} -
-
- ))} -
-
-
- - {!balData.isLoading && - !balData.isError && - !balData.isPending && - balData.data && - balData.data.tokenInfo && ( - - - - Your Holdings - - - {address - ? Number( - balData.data.amount.toEtherToFixedDecimals( - balData.data.tokenInfo?.displayDecimals || - 2, - ), - ) === 0 || strategy?.isRetired() - ? '-' - : `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : 'Connect wallet'} - - - - - - Net earnings - - = 0 ? 'cyan' : 'red'} - > - {address && profit !== 0 && !strategy?.isRetired() - ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : '-'} - - - - - )} - {(balData.isLoading || - balData.isPending || - !balData.data?.tokenInfo) && ( - - Your Holdings: - {address ? ( - - ) : ( - 'Connect wallet' + + {!balData.isLoading && + !balData.isError && + !balData.isPending && + balData.data && + balData.data.tokenInfo && ( + + {address + ? Number( + balData.data.amount.toEtherToFixedDecimals( + balData.data.tokenInfo?.displayDecimals || 2, + ), + ) === 0 || strategy?.isRetired() + ? '-' + : `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` + : 'Connect wallet'} + )} - - )} - {balData.isError && ( - - Your Holdings: Error - - )} - {address && - balData.data && - strategy.id == 'xstrk_sensei' && - profit < 0 && - profit / - Number(balData.data.amount.toEtherToFixedDecimals(6)) < - -0.01 && ( - - - Why did my holdings drop?{' '} - - Learn more - - + + {(balData.isLoading || + balData.isPending || + !balData.data?.tokenInfo) && ( + + {address ? : 'Connect wallet'} + )} - - {strategy?.isRetired() && ( - - - - - This strategy is retired due to zkLend exploit. You can - recover your partial funds from{' '} - - here. - - - - )} -
-
- - - - - - { - // mixpanel.track('All pools clicked') - }} - > - Deposit - - { - // mixpanel.track('Strategies opened') - }} - > - Withdraw - - - - - - - {strategy.settings.alerts != undefined && ( - - {strategy.settings.alerts - .filter((a) => a.tab == 'deposit' || a.tab == 'all') - .map((alert, index) => ( - - - {alert.text} - - ))} - - )} - - - - {strategy.settings.alerts != undefined && ( - - {strategy.settings.alerts - .filter( - (a) => a.tab == 'withdraw' || a.tab == 'all', - ) - .map((alert, index) => ( - - - {alert.text} - - ))} - + + {balData.isError && ( + + Your Holdings: Error + + )} + + {address && + balData.data && + strategy.id === 'xstrk_sensei' && + profit < 0 && + profit / + Number(balData.data.amount.toEtherToFixedDecimals(6)) < + -0.01 && ( + + + Why did my holdings drop?{' '} + + Learn more + + )} - - - - - -
- - {!isMobile && ( - - - Behind the scenes - - - Actions done automatically by the strategy (smart-contract) with - an investment of $1000 - - {strategy.steps.length > 0 && ( -
+ + - - Action - - - Protocol - - - Amount - - Yield + Net earnings + + {!balData.isLoading && + !balData.isError && + !balData.isPending && + balData.data && + balData.data.tokenInfo && ( + + 0 ? 'cyan' : profit < 0 ? 'red' : 'text' + } + fontSize={'18px'} + fontWeight={'700'} + > + {address && profit !== 0 && !strategy?.isRetired() + ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` + : '-'} + + + )} - {strategy.actions.map((action, index) => ( - - - {index + 1} - {')'} {action.name} - - - {' '} - {action.pool.pool.name} on - {' '} - {action.pool.protocol.name} - - - ${Number(action.amount).toLocaleString()} yields{' '} - {action.isDeposit - ? (action.pool.apr * 100).toFixed(2) - : -(action.pool.borrow.apr * 100).toFixed(2)} - % - - - ${Number(action.amount).toLocaleString()} - - - {action.isDeposit - ? (action.pool.apr * 100).toFixed(2) - : -(action.pool.borrow.apr * 100).toFixed(2)} - % - - - ))} - {strategy.actions.length == 0 && ( -
- -
+ + + + + + {!strategy?.isRetired() && ( + )} -
- )} - -
+ + + )} - - - {/* Risks card */} - + + { + mixpanel.track('Manage clicked'); + }} > - - Risks - - - {strategy.risks.map((r) => ( - - {r} - - ))} - - - {strategy.metadata.risk.riskFactor.map( - (r: any, i: number) => ( - - - {r.type.valueOf()} - - - ), - )} - - - - - {/* Transaction history card */} - + { + mixpanel.track('Risk clicked'); + }} > - - Transaction history - - - There may be delays fetching data. If your transaction{' '} - {`isn't`} found, try again later. - - - {txHistoryResult.isSuccess && ( - <> - {txHistory.findManyInvestment_flows.map((tx, index) => { - const token = getTokenInfoFromAddr(tx.asset); - const decimals = token?.decimals; - - return ( - - - {index + 1}. - - - {Number( - new MyNumber( - tx.amount, - decimals!, - ).toEtherToFixedDecimals( - token.displayDecimals, - ), - ).toLocaleString()}{' '} - {token?.name} - - - {capitalize(tx.type)} - - - - - - - {shortAddress(tx.txHash)} - - - - {/* The default msg contains strategy name, since this for a specific strategy, replace it */} - {timeAgo(new Date(tx.timestamp * 1000))} - - - - - ); - })} - - )} - - {/* If no filtered tx */} - {txHistory.findManyInvestment_flows.length === 0 && ( - - No transactions found - - )} - - - -
- )} - + Risk + + { + mixpanel.track('Details clicked'); + }} + > + Details + + { + mixpanel.track('FAQs clicked'); + }} + > + FAQs + + { + mixpanel.track('Transactions clicked'); + }} + > + Transactions + + + + + + + + + + + {strategy && } + + + + + + ); }; diff --git a/src/app/strategy/[strategyId]/page.tsx b/src/app/strategy/[strategyId]/page.tsx index 3b5d2b63..2fdf07f0 100644 --- a/src/app/strategy/[strategyId]/page.tsx +++ b/src/app/strategy/[strategyId]/page.tsx @@ -27,7 +27,7 @@ export async function generateMetadata({ params }: StrategyParams) { export default function StrategyPage({ params }: StrategyParams) { return ( - + ); diff --git a/src/app/template.tsx b/src/app/template.tsx index 43b6ff05..f418b4bb 100755 --- a/src/app/template.tsx +++ b/src/app/template.tsx @@ -38,12 +38,13 @@ const theme = extendTheme({ color2Text: 'rgb(184 184 239)', color2_65p: 'rgba(132, 132, 195, 0.65)', color2_50p: 'rgba(30, 30, 44, 0.5)', - highlight: '#1a1a27', // light grey + highlight: '#1A1A27', // light grey light_grey: '#9ca9ad', disabled_text: '#818181', disabled_bg: '#5f5f5f', purple: '#6F4FF2', + purple_60p: '#6F5CA599', purple_hover: '#4C2CD7', purple_hover_2: '#C5A6FF', purple_active: '#3B20B4', @@ -51,17 +52,33 @@ const theme = extendTheme({ purple_gray: '#DFDFEC', cyan: '#7DFACB', bg: '#181824', // dark blue + bg_2: '#1B1724', + bg_3: '#090910', grey_text: '#B6B6B6', text: '#F8F8FF', yellow: '#EFDB72', red: '#e18787', - light_green: '#3EE5C2', dark_navy: '#181824', slate_blue: '#2D2D3D', silver_gray: '#8E8E8E', + // green colors + light_green: '#3EE5C2', + light_green_2: '#61FCAE', + light_green_30p: '#3EE5C24D', + color_3: '#363651', color_4: '#4DB8FF', + color_5: '#16131E', + + border_light: '#CFCFEA', + border_light_3p: '#CFCFEA0D', + border_light_30p: '#CFCFEA4D', + + black_3p: '#00000008', + + disabled_button: '#2A2A3D80', + disabled_button_text: '#7D7D93', }, fontSizes: { large: '50px', @@ -128,7 +145,7 @@ export default function Template({ children }: { children: React.ReactNode }) { - + ; @@ -159,14 +157,10 @@ export default function Deposit(props: DepositProps) { } }, [maxAmount, isMaxClicked]); - function BalanceComponent(props: { - token: TokenInfo; - strategy: StrategyInfo; - buttonText: string; - }) { + function BalanceComponent(props: { token: TokenInfo }) { return ( - - Available balance + + Wallet balance - - {balance.toEtherToFixedDecimals(4)} - + + {balance.toEtherToFixedDecimals(4)} {props.token.name} + - ); @@ -231,21 +193,39 @@ export default function Deposit(props: DepositProps) { } - bgColor={'highlight'} - borderColor={'bg'} + rightIcon={} + width={'200px'} + bg={'transparent'} + borderColor={'slate_blue'} borderWidth={'1px'} - color="color2" + color="border_light" + fontSize={'16px'} + fontWeight={'500'} + padding={'10px 16px'} + textAlign={'left'} _hover={{ - bg: 'bg', + bg: 'transparent', }} > -
- {/* */} - {balData.data && balData.data.tokenInfo - ? balData.data.tokenInfo.name - : '-'} -
+ + {balData.data && balData.data.tokenInfo && ( + + )} + + {balData.data && balData.data.tokenInfo + ? balData.data.tokenInfo.name + : '-'} + +
{actions.map((dep) => ( @@ -253,7 +233,7 @@ export default function Deposit(props: DepositProps) { key={dep.tokenInfo.name} {...MyMenuItemProps} onClick={() => { - if (selectedMarket.name != dep.tokenInfo.name) { + if (selectedMarket.name !== dep.tokenInfo.name) { setSelectedMarket(dep.tokenInfo); setAmount(new MyNumber('0', dep.tokenInfo.decimals)); setDirty(false); @@ -263,7 +243,11 @@ export default function Deposit(props: DepositProps) { >
- + @@ -290,8 +270,10 @@ export default function Deposit(props: DepositProps) { max={parseFloat(maxAmount.toEtherStr())} step={parseFloat(selectedMarket.stepAmount.toEtherStr())} color={'white'} - bg={'bg'} + bg={'transparent'} borderRadius={'10px'} + borderColor={'slate_blue'} + borderWidth={'1px'} onChange={(value) => { if (value && Number(value) > 0) setAmount(MyNumber.fromEther(value, selectedMarket.decimals)); @@ -311,7 +293,7 @@ export default function Deposit(props: DepositProps) { address, }); }} - marginTop={'10px'} + marginTop={'20px'} keepWithinRange={false} clampValueOnBlur={false} value={rawAmount} @@ -321,24 +303,57 @@ export default function Deposit(props: DepositProps) { border={'0px'} borderRadius={'10px'} placeholder="Amount" + paddingRight="60px" + color={'white'} /> - - - - + + {amount.isZero() && dirty && ( Require amount {'>'} 0 )} + {amount.compare(maxAmount.toEtherStr(), 'gt') && ( Amount to be less than {maxAmount.toEtherToFixedDecimals(2)} )} -
+
- {!props.strategy.isRetired() && props.strategy.settings.maxTVL != 0 && ( - - - - Current TVL Limit: - - + + + Fees + + + No additional fees by STRKFarm + + + + {!props.strategy.isRetired() && props.strategy.settings.maxTVL !== 0 && ( + + + {!tvlInfo || !tvlInfo?.data ? ( ) : ( Number(tvlInfo.data?.amount.toFixedStr(2)).toLocaleString() )} + + + {' '} {' / '} + + {props.strategy.settings.maxTVL.toLocaleString()}{' '} {selectedMarket.name} )} {/* {tvlInfo.isError ? 1 : 0}{tvlInfo.isLoading ? 1 : 0} {JSON.stringify(tvlInfo.error)} */} - + )} ); diff --git a/src/components/HarvestTime.tsx b/src/components/HarvestTime.tsx index ea1f967b..76fd464d 100644 --- a/src/components/HarvestTime.tsx +++ b/src/components/HarvestTime.tsx @@ -2,9 +2,12 @@ import React, { useMemo } from 'react'; import { Box, Flex, + Link, + Spinner, Stat, StatLabel, StatNumber, + Tag, Text, Tooltip, } from '@chakra-ui/react'; @@ -12,11 +15,12 @@ import { useAccount } from '@starknet-react/core'; import { StrategyInfo } from '@/store/strategies.atoms'; import { HarvestTimeAtom } from '@/store/harvest.atom'; import { useAtomValue } from 'jotai'; -import { formatTimediff, getDisplayCurrencyAmount, timeAgo } from '@/utils'; +import { formatTimediff, getDisplayCurrencyAmount } from '@/utils'; import { isMobile } from 'react-device-detect'; import STRKFarmAtoms, { STRKFarmStrategyAPIResult, } from '@/store/strkfarm.atoms'; +import { ExternalLinkIcon } from '@chakra-ui/icons'; interface HarvestTimeProps { strategy: StrategyInfo; @@ -91,46 +95,72 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { }, [strategyInfo]); return ( - - - + + + - APY - + + APY + + {((strategyInfo?.apy || 0) * 100).toFixed(2)}% - {/* - - - 🔥{leverage.toFixed(2)}x boosted - {leverage == 0 && ( - - )} - - - */} + + + + 🔥{leverage.toFixed(2)}x boosted + {leverage === 0 && } + + {!isMobile && !strategy.settings.hideHarvestInfo && ( - + = ({ strategy, balData }) => { )} + @@ -155,15 +185,21 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { justifyContent="center" flexDirection="column" gap="4px" - bgColor="color2_50p" + bg="bg" width="53px" height="53px" borderRadius="8px" + borderWidth={'1px'} + borderColor={'slate_blue'} > - + Days - + {harvestTimestamp.days ?? 0} @@ -174,15 +210,21 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { justifyContent="center" flexDirection="column" gap="4px" - bgColor="color2_50p" + bg="bg" width="53px" height="53px" borderRadius="8px" + borderWidth={'1px'} + borderColor={'slate_blue'} > - + Hour - + {harvestTimestamp.hours ?? 0} @@ -193,58 +235,125 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { justifyContent="center" flexDirection="column" gap="4px" - bgColor="color2_50p" + bg="bg" width="53px" height="53px" borderRadius="8px" + borderWidth={'1px'} + borderColor={'slate_blue'} > - + Mins - + {harvestTimestamp.minutes ?? 0} + + + + Secs + + + {harvestTimestamp.seconds ?? 0} + + - + )} - {!strategy.settings.hideHarvestInfo && ( - - + + - Harvested{' '} - + Contract details + + + + {!strategy.settings.hideHarvestInfo && ( + + + Total rewards harvested: + + + {getDisplayCurrencyAmount( harvestTime?.data?.totalStrkHarvestedByContract.STRKAmount || 0, 2, )}{' '} STRK - {' '} - over {harvestTime?.data?.totalHarvestsByContract} claims.{' '} - {lastHarvest && ( - - Last harvested {timeAgo(lastHarvest)} (Across all users). - - )} - - - )} - + + + | + + + Total number of times harvested: + + + + - + + + )} + + ); }; diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index e3e5886c..bdd1c149 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -267,8 +267,8 @@ export default function Navbar(props: NavbarProps) { return (
Date: Wed, 23 Apr 2025 12:33:37 +0100 Subject: [PATCH 05/48] feat: risk and details tab --- .../[strategyId]/_components/Strategy.tsx | 129 ++++++++++++++++++ src/app/template.tsx | 1 + 2 files changed, 130 insertions(+) diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index 2c5ebc1a..e177208d 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -7,11 +7,13 @@ import { Badge, Box, Button, + Center, Container, Flex, Image, Link, ListItem, + OrderedList, Spinner, Tab, TabIndicator, @@ -197,6 +199,125 @@ function Manage({ strategy }: { strategy: StrategyInfo }) { ); } +function Risk({ strategy }: { strategy: StrategyInfo }) { + return ( + + + + {strategy.risks.map((r, index) => ( + + {r} + + ))} + + + + ); +} + +function Details({ strategy }: { strategy: StrategyInfo }) { + return ( + + + + Behind the scenes + + + Actions done automatically by the strategy (smart-contract) with an + investment of $1000 + + + + + {strategy.actions.map((action, index) => ( + + + {action.name} + + + {' '} + {action.pool.pool.name} on + {' '} + {action.pool.protocol.name} + + + ))} + {strategy.actions.length == 0 && ( +
+ +
+ )} +
+
+ ); +} + const Strategy = ({ params }: StrategyParams) => { const address = useAtomValue(addressAtom); const strategies = useAtomValue(strategiesAtom); @@ -638,6 +759,14 @@ const Strategy = ({ params }: StrategyParams) => { {strategy && } + + + {strategy && } + + + + {strategy &&
} + diff --git a/src/app/template.tsx b/src/app/template.tsx index f418b4bb..b2eadb1a 100755 --- a/src/app/template.tsx +++ b/src/app/template.tsx @@ -70,6 +70,7 @@ const theme = extendTheme({ color_3: '#363651', color_4: '#4DB8FF', color_5: '#16131E', + color_6: '#111119', border_light: '#CFCFEA', border_light_3p: '#CFCFEA0D', From 801375af21d98a81b49f8dfe6d062da0712c7930 Mon Sep 17 00:00:00 2001 From: Oche Date: Wed, 23 Apr 2025 14:58:22 +0100 Subject: [PATCH 06/48] feat: FAQ tab --- .../[strategyId]/_components/Strategy.tsx | 193 ++++++++++++++++++ src/app/template.tsx | 1 + 2 files changed, 194 insertions(+) diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index e177208d..4c6114fe 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -1,6 +1,11 @@ 'use client'; import { + Accordion, + AccordionButton, + AccordionIcon, + AccordionItem, + AccordionPanel, Alert, AlertIcon, Avatar, @@ -318,6 +323,190 @@ function Details({ strategy }: { strategy: StrategyInfo }) { ); } +function FAQ() { + return ( + + + Get to know about all your doubts + + + + + + + + + + Question asked basis zkLend + + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut + enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. + + + + + + + + Question asked basis zkLend + + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut + enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. + + + + + + + + Question asked basis zkLend + + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut + enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. + + + + + + + + Question asked basis zkLend + + + + + + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut + enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. + + + + + + + + + For more queries reach out to us on Telegram + + + Our team will respond to you soon! + + + + + + + + + + ); +} + const Strategy = ({ params }: StrategyParams) => { const address = useAtomValue(addressAtom); const strategies = useAtomValue(strategiesAtom); @@ -767,6 +956,10 @@ const Strategy = ({ params }: StrategyParams) => { {strategy &&
} + + + + diff --git a/src/app/template.tsx b/src/app/template.tsx index b2eadb1a..8ad6db80 100755 --- a/src/app/template.tsx +++ b/src/app/template.tsx @@ -71,6 +71,7 @@ const theme = extendTheme({ color_4: '#4DB8FF', color_5: '#16131E', color_6: '#111119', + color_7: '#6E59FF', border_light: '#CFCFEA', border_light_3p: '#CFCFEA0D', From af4ce741838c735c38608ced6a17628e6f915644 Mon Sep 17 00:00:00 2001 From: Oche Date: Wed, 30 Apr 2025 16:45:11 +0100 Subject: [PATCH 07/48] feat: UI improvements --- src/app/globals.css | 6 - src/app/page.tsx | 84 +- .../[strategyId]/_components/DetailsTab.tsx | 78 ++ .../[strategyId]/_components/FAQTab.tsx | 133 +++ .../[strategyId]/_components/FlowChart.tsx | 10 +- .../[strategyId]/_components/ManageTab.tsx | 87 ++ .../[strategyId]/_components/RiskTab.tsx | 97 ++ .../[strategyId]/_components/Strategy.tsx | 948 ++++++------------ .../_components/TransactionsTab.tsx | 231 +++++ src/app/template.tsx | 7 +- src/assets/depositAction.svg | 5 + src/assets/loopAction.svg | 4 + src/assets/withdrawAction.svg | 5 + src/components/AmountInput.tsx | 307 +++--- src/components/Pools.tsx | 16 +- src/components/Strategies.tsx | 8 +- src/components/YieldCard.tsx | 38 +- src/store/transactions.atom.ts | 29 +- src/strategies/IStrategy.ts | 5 +- 19 files changed, 1154 insertions(+), 944 deletions(-) create mode 100644 src/app/strategy/[strategyId]/_components/DetailsTab.tsx create mode 100644 src/app/strategy/[strategyId]/_components/FAQTab.tsx create mode 100644 src/app/strategy/[strategyId]/_components/ManageTab.tsx create mode 100644 src/app/strategy/[strategyId]/_components/RiskTab.tsx create mode 100644 src/app/strategy/[strategyId]/_components/TransactionsTab.tsx create mode 100644 src/assets/depositAction.svg create mode 100644 src/assets/loopAction.svg create mode 100644 src/assets/withdrawAction.svg diff --git a/src/app/globals.css b/src/app/globals.css index 436ae13e..9b3deab6 100755 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -18,12 +18,6 @@ body { color: rgb(var(--foreground-rgb)); - /* background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) - rgb(var(--background-start-rgb)); */ } @layer utilities { diff --git a/src/app/page.tsx b/src/app/page.tsx index 04dc7361..c4e05629 100755 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -71,9 +71,9 @@ export default function Home() { function handleTabsChange(index: number) { if (index === 1) { - setRoute('strategies'); - } else { setRoute('pools'); + } else { + setRoute('strategies'); } } @@ -84,7 +84,7 @@ export default function Home() { useEffect(() => { (async () => { const tab = searchParams.get('tab'); - if (tab === 'pools') { + if (tab === 'strategies') { setTabIndex(0); } else { setTabIndex(1); @@ -93,7 +93,7 @@ export default function Home() { }, [searchParams]); return ( - + - {/* - - {banner_images.map((banner, index) => ( - - - 450) || size.width == 0 - ? banner.desktop - : banner.mobile - } - height={'auto'} - boxShadow={'none'} - width="100%" - alt="Banner" - style={{ objectFit: 'cover', borderRadius: '10px' }} - /> - - - ))} - - */} - - {/* - - {scrollSnaps.map((_, index) => ( - onDotButtonClick(index)} - width="0.8rem" - height="0.8rem" - borderRadius="50%" - display="flex" - alignItems="center" - justifyContent="center" - cursor="pointer" - backgroundColor={index === selectedIndex ? '#4D59E8' : 'black'} - padding="0" - margin="0" - border="1px solid #373A5D" - textDecoration="none" - appearance="none" - /> - ))} - - */} - { - mixpanel.track('All pools clicked'); + mixpanel.track('Strategies opened'); }} > - Find yields + Strategies✨ { - mixpanel.track('Strategies opened'); + mixpanel.track('All pools clicked'); }} > - Strategies✨ + Find yields - + - + diff --git a/src/app/strategy/[strategyId]/_components/DetailsTab.tsx b/src/app/strategy/[strategyId]/_components/DetailsTab.tsx new file mode 100644 index 00000000..161a2a93 --- /dev/null +++ b/src/app/strategy/[strategyId]/_components/DetailsTab.tsx @@ -0,0 +1,78 @@ +import { Box, Center, Spinner, Flex, Text, Image } from '@chakra-ui/react'; +import { STRKFarmStrategyAPIResult } from '@/store/strkfarm.atoms'; +import FlowChart from './FlowChart'; +import depositAction from '@/assets/depositAction.svg'; +import withdrawAction from '@/assets/withdrawAction.svg'; +import loopAction from '@/assets/loopAction.svg'; + +interface DetailsTabProps { + strategy: STRKFarmStrategyAPIResult; +} + +export function DetailsTab(props: DetailsTabProps) { + const { strategy } = props; + + return ( + + + + Behind the scenes + + + Actions done automatically by the strategy (smart-contract) with an + investment of $1000 + + + + + {strategy.actions.length > 0 && ( + + <> + + Action + + {strategy.actions.map((action, index) => ( + + {action.name.toLowerCase().includes('stake') || + action.name.toLowerCase().includes('supply') ? ( + + ) : action.name.toLowerCase().includes('borrow') ? ( + + ) : ( + + )} + + {action.name} + + + ))} + {strategy.actions.length == 0 && ( +
+ +
+ )} + +
+ )} + + +
+
+ ); +} diff --git a/src/app/strategy/[strategyId]/_components/FAQTab.tsx b/src/app/strategy/[strategyId]/_components/FAQTab.tsx new file mode 100644 index 00000000..44e67203 --- /dev/null +++ b/src/app/strategy/[strategyId]/_components/FAQTab.tsx @@ -0,0 +1,133 @@ +import { + Box, + Flex, + Text, + AccordionPanel, + AccordionButton, + Accordion, + AccordionItem, + AccordionIcon, + Button, + Link, +} from '@chakra-ui/react'; +import { StrategyInfo } from '@/store/strategies.atoms'; + +interface FAQTabProps { + strategy: StrategyInfo; +} + +export function FAQTab(props: FAQTabProps) { + const { strategy } = props; + + return ( + + + Get to know about all your doubts + + + + + {!strategy.metadata.faqs && ( + + No FAQs at the moment + + )} + + {strategy.metadata.faqs && + strategy.metadata.faqs.length > 0 && + strategy.metadata.faqs.map((faq, index) => ( + + + + + {faq.question} + + + + + + {faq.answer} + + + ))} + + + + + + + For more queries reach out to us on Telegram + + + Our team will respond to you soon! + + + + + + + + + + ); +} diff --git a/src/app/strategy/[strategyId]/_components/FlowChart.tsx b/src/app/strategy/[strategyId]/_components/FlowChart.tsx index 5813026c..8d7b4e74 100644 --- a/src/app/strategy/[strategyId]/_components/FlowChart.tsx +++ b/src/app/strategy/[strategyId]/_components/FlowChart.tsx @@ -14,7 +14,7 @@ import STRKFarmAtoms, { import '@xyflow/react/dist/style.css'; import { IInvestmentFlow } from '@strkfarm/sdk'; import { useAtomValue } from 'jotai'; -import { Spinner } from '@chakra-ui/react'; +import { Spinner, Box } from '@chakra-ui/react'; // import ELK from 'elkjs/lib/elk.bundled.js'; const boxStyle = { @@ -260,7 +260,7 @@ function InternalFlowChart(props: FlowChartProps) { if (strategyCached && strategyCached.investmentFlows.length > 0) return ( -
+ -
+
); return ( -
+ -
+ ); } diff --git a/src/app/strategy/[strategyId]/_components/ManageTab.tsx b/src/app/strategy/[strategyId]/_components/ManageTab.tsx new file mode 100644 index 00000000..5e5edc81 --- /dev/null +++ b/src/app/strategy/[strategyId]/_components/ManageTab.tsx @@ -0,0 +1,87 @@ +import { + Badge, + Flex, + ListItem, + Text, + Tooltip, + UnorderedList, +} from '@chakra-ui/react'; + +import { StrategyInfo } from '@/store/strategies.atoms'; +import { getRiskExplaination } from '@strkfarm/sdk'; +import { TokenDeposit } from './TokenDeposit'; + +interface ManageTabProps { + strategy: StrategyInfo; +} + +export function ManageTab(props: ManageTabProps) { + const { strategy } = props; + + return ( + + + + How does it work? + + + + Deposit USDC to automatically loop funds between zkLend and Nostra. + + + Creates a delta-neutral position to maximize USDC yield. + + + Position is periodically adjusted to maintain a healthy health + factor + + + Receive an NFT as representation for your stake on STRKFarm. + + Withdraw anytime by redeeming your NFT for USDC. + + + + + Risk + + {strategy.metadata.risk.riskFactor.map((r: any, i: number) => ( + + + {r.type.valueOf()} + + + ))} + + + + + {!strategy || + (strategy.isSingleTokenDepositView && ( + + ))} + {strategy && !strategy.isSingleTokenDepositView && ( + + )} + + + ); +} diff --git a/src/app/strategy/[strategyId]/_components/RiskTab.tsx b/src/app/strategy/[strategyId]/_components/RiskTab.tsx new file mode 100644 index 00000000..04a7d254 --- /dev/null +++ b/src/app/strategy/[strategyId]/_components/RiskTab.tsx @@ -0,0 +1,97 @@ +import { Badge, Flex, ListItem, OrderedList } from '@chakra-ui/react'; +import { StrategyInfo } from '@/store/strategies.atoms'; + +interface RiskTabProps { + strategy: StrategyInfo; +} + +export function RiskTab(props: RiskTabProps) { + const { strategy } = props; + + return ( + + + + {strategy.risks.map((r, index) => ( + + {r} + {index === 0 && ( + + {strategy.riskFactor <= 2 + ? 'Low' + : strategy.riskFactor < 4 + ? 'Medium' + : 'High'} + risk + + )} + + ))} + + + + ); +} diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index e0aed267..142e69b8 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -1,26 +1,15 @@ 'use client'; import { - Accordion, - AccordionButton, - AccordionIcon, - AccordionItem, - AccordionPanel, - Alert, - AlertIcon, Avatar, AvatarGroup, - Badge, Box, Button, - Center, Container, Flex, Image, HStack, Link, - ListItem, - OrderedList, Spinner, Tab, TabList, @@ -30,7 +19,6 @@ import { TabIndicator, Text, Tooltip, - UnorderedList, } from '@chakra-ui/react'; import { ArrowBackIcon } from '@chakra-ui/icons'; import { atom, useAtomValue, useSetAtom } from 'jotai'; @@ -48,384 +36,15 @@ import { TxHistoryAtom } from '@/store/transactions.atom'; import { getTokenInfoFromAddr } from '@/utils'; import MyNumber from '@/utils/MyNumber'; import { StrategyParams } from '../page'; -import { getRiskExplaination } from '@strkfarm/sdk'; import { STRKFarmBaseAPYsAtom, STRKFarmStrategyAPIResult, } from '@/store/strkfarm.atoms'; -import { TokenDeposit } from './TokenDeposit'; - -function Manage({ strategy }: { strategy: StrategyInfo }) { - return ( - - - - How does it work? - - - - Deposit USDC to automatically loop funds between zkLend and Nostra. - - - Creates a delta-neutral position to maximize USDC yield. - - - Position is periodically adjusted to maintain a healthy health - factor - - - Receive an NFT as representation for your stake on STRKFarm. - - Withdraw anytime by redeeming your NFT for USDC. - - - - - Risk - - {strategy.metadata.risk.riskFactor.map((r: any, i: number) => ( - - - {r.type.valueOf()} - - - ))} - - - - - {!strategy || - (strategy.isSingleTokenDepositView && ( - - ))} - {strategy && !strategy.isSingleTokenDepositView && ( - - )} - - - ); -} - -function Risk({ strategy }: { strategy: StrategyInfo }) { - return ( - - - - {strategy.risks.map((r, index) => ( - - {r} - - ))} - - - - ); -} - -function Details({ strategy }: { strategy: StrategyInfo }) { - return ( - - - - Behind the scenes - - - Actions done automatically by the strategy (smart-contract) with an - investment of $1000 - - - - - {strategy.actions.map((action, index) => ( - - - {action.name} - - - {' '} - {action.pool.pool.name} on - {' '} - {action.pool.protocol.name} - - - ))} - {strategy.actions.length == 0 && ( -
- -
- )} -
-
- ); -} - -function FAQ() { - return ( - - - Get to know about all your doubts - - - - - - - - - - Question asked basis zkLend - - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut - enim ad minim veniam, quis nostrud exercitation ullamco laboris - nisi ut aliquip ex ea commodo consequat. - - - - - - - - Question asked basis zkLend - - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut - enim ad minim veniam, quis nostrud exercitation ullamco laboris - nisi ut aliquip ex ea commodo consequat. - - - - - - - - Question asked basis zkLend - - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut - enim ad minim veniam, quis nostrud exercitation ullamco laboris - nisi ut aliquip ex ea commodo consequat. - - - - - - - - Question asked basis zkLend - - - - - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut - enim ad minim veniam, quis nostrud exercitation ullamco laboris - nisi ut aliquip ex ea commodo consequat. - - - - - - - - - For more queries reach out to us on Telegram - - - Our team will respond to you soon! - - - - - - - - - - ); -} +import { ManageTab } from './ManageTab'; +import { RiskTab } from './RiskTab'; +import { DetailsTab } from './DetailsTab'; +import { FAQTab } from './FAQTab'; +import { TransactionsTab } from './TransactionsTab'; const Strategy = ({ params }: StrategyParams) => { const address = useAtomValue(addressAtom); @@ -604,165 +223,187 @@ const Strategy = ({ params }: StrategyParams) => { if (!isMounted) return null; return ( - - - - - - - - - - {strategy && ( - - - - - {strategy && - strategy.metadata.depositTokens.length > 0 && - strategy.metadata.depositTokens.map((token: any) => { - return ( + + + + + + + + + + + {strategy && ( + + + + + {strategy && + strategy.metadata.depositTokens.length > 0 && + strategy.metadata.depositTokens.map((token: any) => { + return ( + + ); + })} + {strategy && + strategy.metadata.depositTokens.length == 0 && ( - ); - })} - {strategy && - strategy.metadata.depositTokens.length == 0 && ( - - )} - - - {strategy ? strategy.name : 'Strategy Not found'} - - - - - - - - - - Your Holdings: + )} + + + {strategy ? strategy.name : 'Strategy Not found'} + + + + - {!balData.isLoading && - !balData.isError && - !balData.isPending && - balData.data && - balData.data.tokenInfo && ( - - {address - ? Number( - balData.data.amount.toEtherToFixedDecimals( - balData.data.tokenInfo?.displayDecimals || 2, - ), - ) === 0 || strategy?.isRetired() - ? '-' - : `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : 'Connect wallet'} - - )} - - {(balData.isLoading || - balData.isPending || - (!balData.data?.tokenInfo && !balData.isError)) && ( - - {address ? : 'Connect wallet'} + + + + Your Holdings: - )} - {balData.isError && - !balData.isLoading && - !balData.isPending && ( + {!balData.isLoading && + !balData.isError && + !balData.isPending && + balData.data && + balData.data.tokenInfo && ( + + {address + ? Number( + balData.data.amount.toEtherToFixedDecimals( + balData.data.tokenInfo?.displayDecimals || + 2, + ), + ) === 0 || strategy?.isRetired() + ? '-' + : `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` + : 'Connect wallet'} + + )} + + {(balData.isLoading || + balData.isPending || + (!balData.data?.tokenInfo && !balData.isError)) && ( - Error + {address ? : 'Connect wallet'} )} - {/* Show individual holdings is more tokens */} - {individualBalances.length > 1 && - balData.data?.amount.compare('0', 'gt') && ( - - -

Detailed Split:

- {individualBalances.map((bx, index) => { - return ( - - {bx?.amount.toEtherToFixedDecimals( - bx.tokenInfo?.displayDecimals || 2, - )}{' '} - {bx?.tokenInfo?.name} - - ); - })} -
-
- )} - - {address && + Error +
+ )} + + {/* Show individual holdings is more tokens */} + {individualBalances.length > 1 && + balData.data?.amount.compare('0', 'gt') && ( + + +

Detailed Split:

+ {individualBalances.map((bx, index) => { + return ( + + {bx?.amount.toEtherToFixedDecimals( + bx.tokenInfo?.displayDecimals || 2, + )}{' '} + {bx?.tokenInfo?.name} + + ); + })} +
+
+ )} + + {/* {address && balData.data && strategy.id === 'xstrk_sensei' && profit < 0 && @@ -790,129 +431,136 @@ const Strategy = ({ params }: StrategyParams) => { Learn more - )} -
- - - + + - Net earnings - + + Net earnings + - {!balData.isLoading && - !balData.isError && - !balData.isPending && - balData.data && - balData.data.tokenInfo && ( - - 0 ? 'cyan' : profit < 0 ? 'red' : 'text' + {!balData.isLoading && + !balData.isError && + !balData.isPending && + balData.data && + balData.data.tokenInfo && ( + - {address && profit !== 0 && !strategy?.isRetired() - ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : '-'} - - - )} + 0 + ? 'cyan' + : profit < 0 + ? 'red' + : 'text' + } + fontSize={'18px'} + fontWeight={'700'} + > + {address && profit !== 0 && !strategy?.isRetired() + ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` + : '-'} + + + )} +
-
- - - {!strategy?.isRetired() && ( - - )} + + + {!strategy?.isRetired() && ( + + )} + - - )} - - - - { - mixpanel.track('Manage clicked'); - }} - > - Manage - - { - mixpanel.track('Risk clicked'); - }} - > - Risk - - { - mixpanel.track('Details clicked'); - }} - > - Details - - { - mixpanel.track('FAQs clicked'); - }} - > - FAQs - - { - mixpanel.track('Transactions clicked'); - }} - > - Transactions - - - - + )} + + + + { + mixpanel.track('Manage clicked'); + }} + > + Manage + + { + mixpanel.track('Risk clicked'); + }} + > + Risk + + { + mixpanel.track('Details clicked'); + }} + > + Details + + { + mixpanel.track('FAQs clicked'); + }} + > + FAQs + + { + mixpanel.track('Transactions clicked'); + }} + > + Transactions + + + + + - + { > - {strategy && } + {strategy && } + + + + {strategy && } - {strategy && } + {strategyCached && } - {strategy &&
} + {strategy && } - + {strategy && ( + + )} diff --git a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx new file mode 100644 index 00000000..17d0e384 --- /dev/null +++ b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx @@ -0,0 +1,231 @@ +import { + Box, + Flex, + Link, + Table, + Thead, + Tbody, + Tr, + Th, + Td, + TableContainer, + Text, +} from '@chakra-ui/react'; +import { ArrowDownIcon, ArrowUpIcon, ExternalLinkIcon } from '@chakra-ui/icons'; + +import { + capitalize, + getTokenInfoFromAddr, + shortAddress, + timeAgo, +} from '@/utils'; +import MyNumber from '@/utils/MyNumber'; +import { StrategyInfo } from '@/store/strategies.atoms'; + +interface TransactionsTabProps { + strategy: StrategyInfo; + // txHistoryResult: AtomWithQueryResult; + txHistory: { + findManyInvestment_flows: { + amount: string; + timestamp: number; + type: string; + txHash: string; + asset: string; + __typename: 'Investment_flows'; + }[]; + }; +} + +export function TransactionsTab(props: TransactionsTabProps) { + const { strategy, txHistory } = props; + + return ( + + + + Transaction history + + + {!strategy.settings.isTransactionHistDisabled && ( + + There may be delays fetching data. If your transaction {`isn't`}{' '} + found, try again later. + + )} + + + + +
Strategy nameAPYRiskTVLMY BAL
+ {isRetired ? ( + + - + + ) : ( + + )} +
+ + + + + + + + + + + {txHistory.findManyInvestment_flows.map((tx, index) => { + const token = getTokenInfoFromAddr(tx.asset); + const decimals = token?.decimals; + + return ( + + + + + + + + ); + })} + +
+ # + + Amount + + Transaction type + + Wallet address + + Time +
+ {index + 1}. + + {Number( + new MyNumber( + tx.amount, + decimals!, + ).toEtherToFixedDecimals(token.displayDecimals), + ).toLocaleString()}{' '} + {token?.name} + + + {tx.type === 'deposit' ? ( + + + + ) : ( + + + + )} + + {capitalize(tx.type)} + + + + + {shortAddress(tx.txHash)} + + + + + {timeAgo(new Date(tx.timestamp * 1000))} + +
+ + + {/* If no filtered tx */} + {!strategy.settings.isTransactionHistDisabled && + txHistory.findManyInvestment_flows.length === 0 && ( + + No transactions found + + )} + {strategy.settings.isTransactionHistDisabled && ( + + Transaction history is not available for this strategy yet. If + enabled in future, will include the entire history. + + )} + + + ); +} diff --git a/src/app/template.tsx b/src/app/template.tsx index 8ad6db80..2b878f49 100755 --- a/src/app/template.tsx +++ b/src/app/template.tsx @@ -56,8 +56,13 @@ const theme = extendTheme({ bg_3: '#090910', grey_text: '#B6B6B6', text: '#F8F8FF', + yellow: '#EFDB72', + yellow_2: '#FFA500', + red: '#e18787', + red_2: '#FF5F5F', + dark_navy: '#181824', slate_blue: '#2D2D3D', silver_gray: '#8E8E8E', @@ -145,7 +150,7 @@ export default function Template({ children }: { children: React.ReactNode }) { connectors={getConnectors(isMobile)} > - + + + + + diff --git a/src/assets/loopAction.svg b/src/assets/loopAction.svg new file mode 100644 index 00000000..5fd0516e --- /dev/null +++ b/src/assets/loopAction.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/assets/withdrawAction.svg b/src/assets/withdrawAction.svg new file mode 100644 index 00000000..8739f54c --- /dev/null +++ b/src/assets/withdrawAction.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/components/AmountInput.tsx b/src/components/AmountInput.tsx index 340c0c9a..2f10fc1e 100644 --- a/src/components/AmountInput.tsx +++ b/src/components/AmountInput.tsx @@ -116,7 +116,7 @@ const AmountInput = forwardRef( return false; } return true; - }, [inputsInfo, dirty]); + }, [inputsInfo]); /** * Calculate maximum allowed amount based on: * - TVL limits for deposits @@ -174,148 +174,105 @@ const AmountInput = forwardRef( simulatedMaxAmount.amount, ]); - const checkAndTriggerOnAmountsChange = useCallback( - ( - _amt: MyNumber, - _token: TokenInfoV2 = props.tokenInfo, - _inputsInfo: AmountInputInfo[], - _depositInfo: DepositAtomType, - ) => { - // if onAmountsChange defined - const isAllTokenInfosDefined = _inputsInfo.every( - (item) => item.tokenInfo, - ); - console.log( - 'onAmountsChange [2.1]', - props.index, - isAllTokenInfosDefined, - props.buttonText, - _inputsInfo, - _depositInfo.onAmountsChange, - ); - if (!isAllTokenInfosDefined || !_depositInfo.onAmountsChange) { - return; - } - const _amtWeb3 = Web3Number.fromWei(_amt.toString(), _token.decimals); - console.log('onAmountsChange [2.2]', _amtWeb3.toString(), props.index); - try { - setDepositInfo({ - ..._depositInfo, - loading: true, - }); - _depositInfo - .onAmountsChange( - { - amountInfo: { - amount: _amtWeb3, - tokenInfo: _token, - }, - index: props.index, + function onAmountChange( + _amt: MyNumber, + isMaxClicked: boolean, + rawAmount = _amt.toEtherStr(), + _token = props.tokenInfo, + ) { + updateTokenInfo({ + tokenInfo: _token, + amount: Web3Number.fromWei(_amt.toString(), _token.decimals), + isMaxClicked, + rawAmount, + }); + + checkAndTriggerOnAmountsChange(_amt, _token, inputsInfo, depositInfo); + } + + function checkAndTriggerOnAmountsChange( + _amt: MyNumber, + _token: TokenInfoV2 = props.tokenInfo, + _inputsInfo: AmountInputInfo[], + _depositInfo: DepositAtomType, + ) { + // if onAmountsChange defined + const isAllTokenInfosDefined = _inputsInfo.every( + (item) => item.tokenInfo, + ); + console.log( + 'onAmountsChange [2.1]', + props.index, + isAllTokenInfosDefined, + props.buttonText, + _inputsInfo, + _depositInfo.onAmountsChange, + ); + if (!isAllTokenInfosDefined || !_depositInfo.onAmountsChange) { + return; + } + const _amtWeb3 = Web3Number.fromWei(_amt.toString(), _token.decimals); + console.log('onAmountsChange [2.2]', _amtWeb3.toString(), props.index); + try { + setDepositInfo({ + ..._depositInfo, + loading: true, + }); + _depositInfo + .onAmountsChange( + { + amountInfo: { + amount: _amtWeb3, + tokenInfo: _token, }, - _inputsInfo.map((item, index) => { - if (index === props.index) { - return { - amount: _amtWeb3, - tokenInfo: _token, - }; - } + index: props.index, + }, + _inputsInfo.map((item, index) => { + if (index == props.index) { return { - amount: item.amount, - tokenInfo: item.tokenInfo!, + amount: _amtWeb3, + tokenInfo: _token, }; - }), - ) - .then((output) => { - console.log('onAmountsChange [2.3]', JSON.stringify(output)); - output.map((item, _index) => { - console.log( - 'onAmountsChange [2.4]', - item.amount.toString(), - item.tokenInfo.symbol, - ); - setInputInfo({ - index: _index, - info: { - ..._inputsInfo[_index], - ...item, - rawAmount: Number(item.amount.toFixed(6)).toString(), - }, - }); - }); - setDepositInfo({ - ..._depositInfo, - loading: false, - }); - }) - .catch((err) => { - console.log('onAmountsChange [2.4]', err); - setDepositInfo({ - ..._depositInfo, - loading: false, + } + return { + amount: item.amount, + tokenInfo: item.tokenInfo!, + }; + }), + ) + .then((output) => { + console.log('onAmountsChange [2.3]', JSON.stringify(output)); + output.map((item, _index) => { + console.log( + 'onAmountsChange [2.4]', + item.amount.toString(), + item.tokenInfo.symbol, + ); + setInputInfo({ + index: _index, + info: { + ..._inputsInfo[_index], + ...item, + rawAmount: Number(item.amount.toFixed(6)).toString(), + }, }); }); - } catch (err) { - console.log('onAmountsChange [2.5] err', err); - } - }, - [ - props.index, - props.buttonText, - props.tokenInfo, - setDepositInfo, - setInputInfo, - ], - ); - - const updateTokenInfo = useCallback( - (inputInfo: AmountInputInfo) => { - const { amount, tokenInfo: _t, isMaxClicked, rawAmount } = inputInfo; - console.log( - `onAmountsChange [10.1]`, - amount.toWei(), - inputInfo, - props.index, - props.buttonText, - ); - const tokenInfo = _t!; - const _amount = Web3Number.fromWei(amount.toWei(), tokenInfo.decimals); - setInputInfo({ - index: props.index, - info: { - amount: _amount, - tokenInfo, - isMaxClicked, - rawAmount, - }, - }); - }, - [props.index, props.buttonText, setInputInfo], - ); - - const onAmountChange = useCallback( - ( - _amt: MyNumber, - isMaxClicked: boolean, - rawAmount = _amt.toEtherStr(), - _token = props.tokenInfo, - ) => { - updateTokenInfo({ - tokenInfo: _token, - amount: Web3Number.fromWei(_amt.toString(), _token.decimals), - isMaxClicked, - rawAmount, - }); - - checkAndTriggerOnAmountsChange(_amt, _token, inputsInfo, depositInfo); - }, - [ - updateTokenInfo, - checkAndTriggerOnAmountsChange, - inputsInfo, - depositInfo, - props.tokenInfo, - ], - ); + setDepositInfo({ + ..._depositInfo, + loading: false, + }); + }) + .catch((err) => { + console.log('onAmountsChange [2.4]', err); + setDepositInfo({ + ..._depositInfo, + loading: false, + }); + }); + } catch (err) { + console.log('onAmountsChange [2.5] err', err); + } + } const handleMaxClick = useCallback(() => { onAmountChange(maxAmount, true); @@ -373,10 +330,31 @@ const AmountInput = forwardRef( ); } - const inputsInfoString = JSON.stringify(inputsInfo); useEffect(() => { console.log(`onAmountsChange [10.2]`, inputInfo, props.index); - }, [inputsInfoString, inputInfo, props.index]); + }, [JSON.stringify(inputsInfo)]); + + function updateTokenInfo(inputInfo: AmountInputInfo) { + const { amount, tokenInfo: _t, isMaxClicked, rawAmount } = inputInfo; + console.log( + `onAmountsChange [10.1]`, + amount.toWei(), + inputInfo, + props.index, + props.buttonText, + ); + const tokenInfo = _t!; + const _amount = Web3Number.fromWei(amount.toWei(), tokenInfo.decimals); + setInputInfo({ + index: props.index, + info: { + amount: _amount, + tokenInfo, + isMaxClicked, + rawAmount, + }, + }); + } useEffect(() => { console.log('onAmountsChange [3]', props); @@ -386,8 +364,7 @@ const AmountInput = forwardRef( isMaxClicked: false, rawAmount: '', }); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [updateTokenInfo, props.tokenInfo]); + }, []); useEffect(() => { if ( @@ -409,7 +386,7 @@ const AmountInput = forwardRef( index: props.index, }, inputsInfo.map((item, index) => { - if (index === props.index) { + if (index == props.index) { return { amount: amt, tokenInfo: props.tokenInfo, @@ -424,7 +401,7 @@ const AmountInput = forwardRef( .then((output) => { console.log('onAmountsChange [3.1]', output); output.map((item, _index) => { - if (_index === props.index) { + if (_index == props.index) { setSimulatedMaxAmount({ isSet: true, amount: Number(item.amount.toFixed(13)), @@ -432,23 +409,16 @@ const AmountInput = forwardRef( } }); }); - }, [ - depositInfo.onAmountsChange, - simulatedMaxAmount.isSet, - depositInfo, - inputsInfo, - props.index, - props.tokenInfo, - ]); + }, [depositInfo.onAmountsChange, simulatedMaxAmount.isSet]); const handleDebouncedChange = useCallback( - ( - newAmount: MyNumber, - valueStr: string, - _inputsInfo: AmountInputInfo[], - _depositInfo: DepositAtomType, - ) => { - debounce(() => { + debounce( + ( + newAmount: MyNumber, + valueStr: string, + _inputsInfo: AmountInputInfo[], + _depositInfo: DepositAtomType, + ) => { checkAndTriggerOnAmountsChange( newAmount, props.tokenInfo, @@ -456,6 +426,7 @@ const AmountInput = forwardRef( _depositInfo, ); + // Track user input mixpanel.track('Enter amount', { strategyId: props.strategy.id, strategyName: props.strategy.name, @@ -465,19 +436,11 @@ const AmountInput = forwardRef( maxAmount: maxAmount.toEtherStr(), address, }); - }, 400)(); - }, - [ - checkAndTriggerOnAmountsChange, - props.tokenInfo, - props.strategy, - props.buttonText, - inputInfo, - selectedMarket, - maxAmount, - address, - ], - ); + }, + 400, + ), + [], + ); // ms delay return ( diff --git a/src/components/Pools.tsx b/src/components/Pools.tsx index 46920a89..63b873fa 100755 --- a/src/components/Pools.tsx +++ b/src/components/Pools.tsx @@ -213,7 +213,6 @@ export default function Pools() { Pool name - - MY BAL + + + MY BAL + diff --git a/src/components/Strategies.tsx b/src/components/Strategies.tsx index 9842703e..5d0fc721 100755 --- a/src/components/Strategies.tsx +++ b/src/components/Strategies.tsx @@ -88,8 +88,12 @@ export default function Strategies() { Strategy name APY Risk - TVL - MY BAL + + TVL + + + MY BAL + diff --git a/src/components/YieldCard.tsx b/src/components/YieldCard.tsx index 48aaebb5..9b3ba01a 100644 --- a/src/components/YieldCard.tsx +++ b/src/components/YieldCard.tsx @@ -270,10 +270,9 @@ export function StrategyTVL(props: YieldCardProps) { display={'flex'} flexDirection={'column'} justifyContent={'center'} - alignItems={'flex-start'} > {isPoolLive && ( - + ${getDisplayCurrencyAmount(pool.tvl || 0, 0)} )} @@ -301,14 +300,38 @@ export function StrategyBalance(props: YieldCardProps) { display={'flex'} flexDirection={'column'} justifyContent={'center'} - alignItems={'flex-start'} > {!isPoolLive && -} {address && isPoolLive && pool.protocol.name === 'STRKFarm' && ( - - ${getDisplayCurrencyAmount(holdingsInfo.usdValue || 0, 0)} - + <> + + ${getDisplayCurrencyAmount(holdingsInfo.usdValue, 0)} + + {holdingsInfo.amount != 0 && ( + + {/* */} + + {getDisplayCurrencyAmount( + holdingsInfo.amount, + holdingsInfo.tokenInfo.displayDecimals, + ).toLocaleString()} + + + + )} + )} @@ -560,6 +583,7 @@ export function YieldStrategyCard(props: { export function HeaderSorter(props: { heading: string; + align: 'left' | 'right'; mainColor: string; inActiveColor: string; onClick: (order: 'asc' | 'desc') => void; @@ -581,7 +605,7 @@ export function HeaderSorter(props: { onClick={() => { props.onClick(order); }} - float={'left'} + float={props.align} padding={0} > {props.heading.toUpperCase()} diff --git a/src/store/transactions.atom.ts b/src/store/transactions.atom.ts index 47558680..a933c9d7 100755 --- a/src/store/transactions.atom.ts +++ b/src/store/transactions.atom.ts @@ -78,22 +78,25 @@ async function getTxHistory( } } -export const newTxsAtom = atom([]); - export const TxHistoryAtom = (contract: string, owner: string) => atomWithQuery((get) => ({ // balData just to trigger a refetch - queryKey: ['tx_history', contract, owner, JSON.stringify(get(newTxsAtom))], + queryKey: [ + 'tx_history', + contract, + owner, + JSON.stringify(get(transactionsAtom)), + ], queryFn: async ({ queryKey }: any): Promise => { const [, { contract, owner }] = queryKey; const res = await getTxHistory(contract, owner); console.log('TxHistoryAtom res', res, contract, owner, queryKey); - // add new txs from local cache - const newTxs = get(newTxsAtom); - console.log('TxHistoryAtom newTxs', newTxs); + // add txs from local storage + const storedTxs: TransactionInfo[] = await get(transactionsAtom); + console.log('TxHistoryAtom storedTxs', storedTxs); const allTxs = res.findManyInvestment_flows.concat( - newTxs.map((tx) => { + storedTxs.map((tx: TransactionInfo) => { return { amount: tx.info.amount.toString(), timestamp: Math.round(tx.createdAt.getTime() / 1000), @@ -180,18 +183,6 @@ async function waitForTransaction( tx.status = 'success'; txs.push(tx); set(transactionsAtom, txs); - - let newTxs = get(newTxsAtom); - console.log('waitForTransaction newTxs', newTxs); - const txExists = newTxs.find( - (t) => t.txHash.toLowerCase() === tx.txHash.toLowerCase(), - ); - console.log('waitForTransaction txExists', txExists); - if (!txExists) { - newTxs = [...newTxs, tx]; - console.log('waitForTransaction newTxs2', newTxs); - set(newTxsAtom, newTxs); - } } // Somehow waitForTransaction is giving delayed confirmation diff --git a/src/strategies/IStrategy.ts b/src/strategies/IStrategy.ts index bee05523..0829a877 100755 --- a/src/strategies/IStrategy.ts +++ b/src/strategies/IStrategy.ts @@ -190,10 +190,7 @@ export class IStrategyProps { ]; getSafetyFactorLine() { - let factorLevel = 'Low'; - if (this.riskFactor > 2) factorLevel = 'Medium'; - if (this.riskFactor >= 4) factorLevel = 'High'; - return `Risk factor: ${this.riskFactor}/5 (${factorLevel} risk)`; + return `Risk factor: ${this.riskFactor}/5`; } depositMethods = async ( From a915560c0eae296ae7e58768da55b323083918ac Mon Sep 17 00:00:00 2001 From: Oche Date: Wed, 30 Apr 2025 21:00:44 +0100 Subject: [PATCH 08/48] feat: disable cron jobs --- vercel.json | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/vercel.json b/vercel.json index e597d0f8..f6218dda 100644 --- a/vercel.json +++ b/vercel.json @@ -1,16 +1,3 @@ { - "crons": [ - { - "path": "/api/raffle/luckyWinner?winnersCount=3", - "schedule": "0 8 * * *" - }, - { - "path": "/api/strategies?no_cache=true", - "schedule": "*/9 * * * *" - }, - { - "path": "/api/stats?no_cache=true", - "schedule": "*/9 * * * *" - } - ] + "crons": [] } From 295a7c84b340d2168144105c4f10a4dbb9e54b86 Mon Sep 17 00:00:00 2001 From: Oche Date: Wed, 30 Apr 2025 22:25:44 +0100 Subject: [PATCH 09/48] feat: make strategies tab default --- src/app/page.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index c4e05629..64ab02bf 100755 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -84,10 +84,10 @@ export default function Home() { useEffect(() => { (async () => { const tab = searchParams.get('tab'); - if (tab === 'strategies') { - setTabIndex(0); - } else { + if (tab === 'pools') { setTabIndex(1); + } else { + setTabIndex(0); } })(); }, [searchParams]); @@ -126,7 +126,7 @@ export default function Home() { onChange={handleTabsChange} marginTop={'10px'} > - + Date: Thu, 1 May 2025 10:10:27 +0100 Subject: [PATCH 10/48] feat: update starkfarm sdk version --- package.json | 2 +- .../[strategyId]/_components/Strategy.tsx | 1 + yarn.lock | 423 +----------------- 3 files changed, 10 insertions(+), 416 deletions(-) diff --git a/package.json b/package.json index 4f3971fa..b68a2d36 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.38", "@tanstack/query-core": "5.28.0", "@types/mixpanel-browser": "2.49.0", "@types/mustache": "4.2.5", diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index 142e69b8..66522607 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -136,6 +136,7 @@ const Strategy = ({ params }: StrategyParams) => { const individualBalances = useAtomValue( strategy?.balancesAtom || atom([returnEmptyBal()]), ); + console.log('balData', balData); // fetch tx history const txHistoryAtom = useMemo( diff --git a/yarn.lock b/yarn.lock index cd5018b7..02ac31ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1922,19 +1922,6 @@ dependencies: "@prisma/debug" "5.18.0" -"@puppeteer/browsers@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.10.0.tgz#a6e55bf85bfcc819e5e8c79f6122cccaa52515a4" - integrity sha512-HdHF4rny4JCvIcm7V1dpvpctIGqM3/Me255CB44vW7hDG1zYMmcBMjpNqZEDxdCfXGLkx5kP0+Jz5DUS+ukqtA== - dependencies: - debug "^4.4.0" - extract-zip "^2.0.1" - progress "^2.0.3" - proxy-agent "^6.5.0" - semver "^7.7.1" - tar-fs "^3.0.8" - yargs "^17.7.2" - "@redis/bloom@1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@redis/bloom/-/bloom-1.2.0.tgz#d3fd6d3c0af3ef92f26767b56414a370c7b63b71" @@ -2205,10 +2192,10 @@ viem "^2.19.1" zod "^3.22.4" -"@strkfarm/sdk@^1.0.35": - version "1.0.35" - resolved "https://registry.yarnpkg.com/@strkfarm/sdk/-/sdk-1.0.35.tgz#307cd2beb53cb12bc66c4aab08560ff5b316ca5e" - integrity sha512-QG1Oes92QwUvusG8kY8GFWE3CxHr5Zde/ZM9bU1DhwGk0FRMkj0TbN19pNnVOEv4Odw9Tj990uISFphBm/mhHw== +"@strkfarm/sdk@^1.0.38": + version "1.0.38" + resolved "https://registry.yarnpkg.com/@strkfarm/sdk/-/sdk-1.0.38.tgz#d10c5e3ea19ad3a2fb020736c3b439ba8b599c7a" + integrity sha512-PC1mIEmMLgrDZdWKeh74gHXIvxuOq6ZJy8PqRr+bIxPNdL4yAXtDONS1ser1C+MMc/3mj0gcA5kmg7RlL9jZxA== dependencies: "@avnu/avnu-sdk" "^3.0.2" axios "^1.7.2" @@ -2221,7 +2208,6 @@ inquirer "^10.1.2" node-telegram-bot-api "^0.66.0" proxy-from-env "^1.1.0" - puppeteer "^24.4.0" redis "^4.7.0" stacktrace-js "^2.0.2" starknet "^6.11.0" @@ -2251,11 +2237,6 @@ dependencies: "@tanstack/query-core" "5.59.0" -"@tootallnate/quickjs-emscripten@^0.23.0": - version "0.23.0" - resolved "https://registry.yarnpkg.com/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c" - integrity sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA== - "@trpc/client@^10.38.1": version "10.45.2" resolved "https://registry.yarnpkg.com/@trpc/client/-/client-10.45.2.tgz#15f9ba81303bf3417083fc6bb742e4e86b49da90" @@ -2429,13 +2410,6 @@ resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd" integrity sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g== -"@types/yauzl@^2.9.1": - version "2.10.3" - resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.3.tgz#e9b2808b4f109504a03cda958259876f61017999" - integrity sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q== - dependencies: - "@types/node" "*" - "@typescript-eslint/eslint-plugin@7.7.0": version "7.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.0.tgz#bf34a02f221811505b8bf2f31060c8560c1bb0a3" @@ -2917,11 +2891,6 @@ agent-base@6: dependencies: debug "4" -agent-base@^7.1.0, agent-base@^7.1.2: - version "7.1.3" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.3.tgz#29435eb821bc4194633a5b89e5bc4703bafc25a1" - integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== - ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -3159,13 +3128,6 @@ ast-types-flow@^0.0.8: resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.8.tgz#0a85e1c92695769ac13a428bb653e7538bea27d6" integrity sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ== -ast-types@^0.13.4: - version "0.13.4" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.4.tgz#ee0d77b343263965ecc3fb62da16e7222b2b6782" - integrity sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w== - dependencies: - tslib "^2.0.1" - async-mutex@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.5.0.tgz#353c69a0b9e75250971a64ac203b0ebfddd75482" @@ -3245,11 +3207,6 @@ axobject-query@^4.1.0: resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-4.1.0.tgz#28768c76d0e3cff21bc62a9e2d0b6ac30042a1ee" integrity sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ== -b4a@^1.6.4: - version "1.6.7" - resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.7.tgz#a99587d4ebbfbd5a6e3b21bdb5d5fa385767abe4" - integrity sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg== - babel-plugin-macros@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" @@ -3264,44 +3221,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -bare-events@^2.2.0, bare-events@^2.5.4: - version "2.5.4" - resolved "https://registry.yarnpkg.com/bare-events/-/bare-events-2.5.4.tgz#16143d435e1ed9eafd1ab85f12b89b3357a41745" - integrity sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA== - -bare-fs@^4.0.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/bare-fs/-/bare-fs-4.1.2.tgz#5b048298019f489979d5a6afb480f5204ad4e89b" - integrity sha512-8wSeOia5B7LwD4+h465y73KOdj5QHsbbuoUfPBi+pXgFJIPuG7SsiOdJuijWMyfid49eD+WivpfY7KT8gbAzBA== - dependencies: - bare-events "^2.5.4" - bare-path "^3.0.0" - bare-stream "^2.6.4" - -bare-os@^3.0.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/bare-os/-/bare-os-3.6.1.tgz#9921f6f59edbe81afa9f56910658422c0f4858d4" - integrity sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g== - -bare-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bare-path/-/bare-path-3.0.0.tgz#b59d18130ba52a6af9276db3e96a2e3d3ea52178" - integrity sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw== - dependencies: - bare-os "^3.0.1" - -bare-stream@^2.6.4: - version "2.6.5" - resolved "https://registry.yarnpkg.com/bare-stream/-/bare-stream-2.6.5.tgz#bba8e879674c4c27f7e27805df005c15d7a2ca07" - integrity sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA== - dependencies: - streamx "^2.21.0" - -basic-ftp@^5.0.2: - version "5.0.5" - resolved "https://registry.yarnpkg.com/basic-ftp/-/basic-ftp-5.0.5.tgz#14a474f5fffecca1f4f406f1c26b18f800225ac0" - integrity sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg== - bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" @@ -3384,11 +3303,6 @@ browserslist@^4.14.5: node-releases "^2.0.18" update-browserslist-db "^1.1.0" -buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ== - busboy@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" @@ -3503,14 +3417,6 @@ chroma.ts@1.0.10: resolved "https://registry.yarnpkg.com/chroma.ts/-/chroma.ts-1.0.10.tgz#2b965d8f2c2eee44d25072902e5787fe259d4565" integrity sha512-0FOQiB6LaiOwoyaxP+a4d3sCIOSf7YvBKj3TfeQM4ZBb2yskRxe4FlT2P4YNpHz7kIB5rXsfmpyniyrYRRyVHw== -chromium-bidi@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chromium-bidi/-/chromium-bidi-3.0.0.tgz#bfb0549db96552d42377401aadc0198a1bbb3e9f" - integrity sha512-ZOGRDAhBMX1uxL2Cm2TDuhImbrsEz5A/tTcVU6RpXEWaTNUNwsHW6njUXizh51Ir6iqHbKAfhA2XK33uBcLo5A== - dependencies: - mitt "^3.0.1" - zod "^3.24.1" - citty@^0.1.5, citty@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/citty/-/citty-0.1.6.tgz#0f7904da1ed4625e1a9ea7e0fa780981aab7c5e4" @@ -3834,16 +3740,6 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cosmiconfig@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-9.0.0.tgz#34c3fc58287b915f3ae905ab6dc3de258b55ad9d" - integrity sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg== - dependencies: - env-paths "^2.2.1" - import-fresh "^3.3.0" - js-yaml "^4.1.0" - parse-json "^5.2.0" - cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -3959,11 +3855,6 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-uri-to-buffer@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz#8a58bb67384b261a38ef18bea1810cb01badd28b" - integrity sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw== - data-view-buffer@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.1.tgz#8ea6326efec17a2e42620696e671d7d5a8bc66b2" @@ -4039,13 +3930,6 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.1.1, debug@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" - integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== - dependencies: - ms "^2.1.3" - decode-uri-component@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" @@ -4103,15 +3987,6 @@ defu@^6.1.4: resolved "https://registry.yarnpkg.com/defu/-/defu-6.1.4.tgz#4e0c9cf9ff68fe5f3d7f2765cc1a012dfdcb0479" integrity sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg== -degenerator@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-5.0.1.tgz#9403bf297c6dad9a1ece409b37db27954f91f2f5" - integrity sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ== - dependencies: - ast-types "^0.13.4" - escodegen "^2.1.0" - esprima "^4.0.1" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -4142,11 +4017,6 @@ detect-node-es@^1.1.0: resolved "https://registry.yarnpkg.com/detect-node-es/-/detect-node-es-1.1.0.tgz#163acdf643330caa0b4cd7c21e7ee7755d6fa493" integrity sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ== -devtools-protocol@0.0.1425554: - version "0.0.1425554" - resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1425554.tgz#51ed2fed1405f56783d24a393f7c75b6bbb58029" - integrity sha512-uRfxR6Nlzdzt0ihVIkV+sLztKgs7rgquY/Mhcv1YNCWDh5IZgl5mnn2aeEnW5stYTE0wwiF4RYVz8eMEpV1SEw== - didyoumean@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037" @@ -4296,11 +4166,6 @@ enhanced-resolve@^5.15.0: graceful-fs "^4.2.4" tapable "^2.2.0" -env-paths@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" - integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== - error-ex@^1.3.1, error-ex@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -4549,17 +4414,6 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escodegen@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" - integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== - dependencies: - esprima "^4.0.1" - estraverse "^5.2.0" - esutils "^2.0.2" - optionalDependencies: - source-map "~0.6.1" - eslint-config-next@14.1.0: version "14.1.0" resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-14.1.0.tgz#7e309d426b8afacaba3b32fdbb02ba220b6d0a97" @@ -4758,7 +4612,7 @@ espree@^9.6.0, espree@^9.6.1: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.4.1" -esprima@^4.0.1, esprima@~4.0.0: +esprima@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -4857,17 +4711,6 @@ external-editor@^3.1.0: iconv-lite "^0.4.24" tmp "^0.0.33" -extract-zip@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" - integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== - dependencies: - debug "^4.1.1" - get-stream "^5.1.0" - yauzl "^2.10.0" - optionalDependencies: - "@types/yauzl" "^2.9.1" - extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -4883,11 +4726,6 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-fifo@^1.2.0, fast-fifo@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" - integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== - fast-glob@^3.2.12, fast-glob@^3.2.9, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" @@ -4921,13 +4759,6 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== - dependencies: - pend "~1.2.0" - fecha@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd" @@ -5236,13 +5067,6 @@ get-starknet@3.3.3: bowser "^2.11.0" get-starknet-core "^3.3.3" -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - get-stream@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-8.0.1.tgz#def9dfd71742cd7754a7761ed43749a27d02eca2" @@ -5273,15 +5097,6 @@ get-tsconfig@^4.7.5: dependencies: resolve-pkg-maps "^1.0.0" -get-uri@^6.0.1: - version "6.0.4" - resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-6.0.4.tgz#6daaee9e12f9759e19e55ba313956883ef50e0a7" - integrity sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ== - dependencies: - basic-ftp "^5.0.2" - data-uri-to-buffer "^6.0.2" - debug "^4.3.4" - getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -5548,14 +5363,6 @@ hosted-git-info@^7.0.0: dependencies: lru-cache "^10.0.1" -http-proxy-agent@^7.0.0, http-proxy-agent@^7.0.1: - version "7.0.2" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz#9a8b1f246866c028509486585f62b8f2c18c270e" - integrity sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig== - dependencies: - agent-base "^7.1.0" - debug "^4.3.4" - http-shutdown@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/http-shutdown/-/http-shutdown-1.2.2.tgz#41bc78fc767637c4c95179bc492f312c0ae64c5f" @@ -5578,14 +5385,6 @@ https-proxy-agent@5.0.0: agent-base "6" debug "4" -https-proxy-agent@^7.0.6: - version "7.0.6" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz#da8dfeac7da130b05c2ba4b59c9b6cd66611a6b9" - integrity sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw== - dependencies: - agent-base "^7.1.2" - debug "4" - human-signals@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" @@ -5621,14 +5420,6 @@ import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -import-fresh@^3.3.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.1.tgz#9cecb56503c0ada1f2741dbbd6546e4b13b57ccf" - integrity sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -5686,14 +5477,6 @@ invariant@^2.2.4: dependencies: loose-envify "^1.0.0" -ip-address@^9.0.5: - version "9.0.5" - resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a" - integrity sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g== - dependencies: - jsbn "1.1.0" - sprintf-js "^1.1.3" - iron-webcrypto@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz#aa60ff2aa10550630f4c0b11fd2442becdb35a6f" @@ -6162,11 +5945,6 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsbn@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" - integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A== - jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -6414,11 +6192,6 @@ lru-cache@^10.0.1, lru-cache@^10.2.0, lru-cache@^10.4.3: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== -lru-cache@^7.14.1: - version "7.18.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" - integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== - math-intrinsics@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" @@ -6520,11 +6293,6 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== -mitt@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/mitt/-/mitt-3.0.1.tgz#ea36cf0cc30403601ae074c8f77b7092cdab36d1" - integrity sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw== - mixpanel-browser@2.49.0: version "2.49.0" resolved "https://registry.yarnpkg.com/mixpanel-browser/-/mixpanel-browser-2.49.0.tgz#de3f4f2d0f3a32b4babf6d827ef983a9fd48a711" @@ -6606,11 +6374,6 @@ neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -netmask@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7" - integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg== - next@14.1.0: version "14.1.0" resolved "https://registry.yarnpkg.com/next/-/next-14.1.0.tgz#b31c0261ff9caa6b4a17c5af019ed77387174b69" @@ -6916,28 +6679,6 @@ p-locate@^6.0.0: dependencies: p-limit "^4.0.0" -pac-proxy-agent@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz#9cfaf33ff25da36f6147a20844230ec92c06e5df" - integrity sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA== - dependencies: - "@tootallnate/quickjs-emscripten" "^0.23.0" - agent-base "^7.1.2" - debug "^4.3.4" - get-uri "^6.0.1" - http-proxy-agent "^7.0.0" - https-proxy-agent "^7.0.6" - pac-resolver "^7.0.1" - socks-proxy-agent "^8.0.5" - -pac-resolver@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-7.0.1.tgz#54675558ea368b64d210fd9c92a640b5f3b8abb6" - integrity sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg== - dependencies: - degenerator "^5.0.0" - netmask "^2.0.2" - package-json-from-dist@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505" @@ -6955,7 +6696,7 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-json@^5.0.0, parse-json@^5.2.0: +parse-json@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== @@ -7024,11 +6765,6 @@ pathe@^1.1.1, pathe@^1.1.2: resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec" integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ== -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -7197,11 +6933,6 @@ process-warning@^1.0.0: resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-1.0.0.tgz#980a0b25dc38cd6034181be4b7726d89066b4616" integrity sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q== -progress@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -7211,20 +6942,6 @@ prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, object-assign "^4.1.1" react-is "^16.13.1" -proxy-agent@^6.5.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-6.5.0.tgz#9e49acba8e4ee234aacb539f89ed9c23d02f232d" - integrity sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A== - dependencies: - agent-base "^7.1.2" - debug "^4.3.4" - http-proxy-agent "^7.0.1" - https-proxy-agent "^7.0.6" - lru-cache "^7.14.1" - pac-proxy-agent "^7.1.0" - proxy-from-env "^1.1.0" - socks-proxy-agent "^8.0.5" - proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" @@ -7245,43 +6962,11 @@ pump@^2.0.0: end-of-stream "^1.1.0" once "^1.3.1" -pump@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8" - integrity sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== -puppeteer-core@24.6.1: - version "24.6.1" - resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-24.6.1.tgz#fc2ea21a49d6d8240cc959b729a12ba976ac140a" - integrity sha512-sMCxsY+OPWO2fecBrhIeCeJbWWXJ6UaN997sTid6whY0YT9XM0RnxEwLeUibluIS5/fRmuxe1efjb5RMBsky7g== - dependencies: - "@puppeteer/browsers" "2.10.0" - chromium-bidi "3.0.0" - debug "^4.4.0" - devtools-protocol "0.0.1425554" - typed-query-selector "^2.12.0" - ws "^8.18.1" - -puppeteer@^24.4.0: - version "24.6.1" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-24.6.1.tgz#828308e1e05654c4ca87399e677d10e3eeb32702" - integrity sha512-/4ocGfu8LNvDbWUqJZV2VmwEWpbOdJa69y2Jivd213tV0ekAtUh/bgT1hhW63SDN/CtrEucOPwoomZ+9M+eBEg== - dependencies: - "@puppeteer/browsers" "2.10.0" - chromium-bidi "3.0.0" - cosmiconfig "^9.0.0" - devtools-protocol "0.0.1425554" - puppeteer-core "24.6.1" - typed-query-selector "^2.12.0" - qs@6.14.0, qs@^6.7.0: version "6.14.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930" @@ -7782,11 +7467,6 @@ semver@^7.3.5, semver@^7.5.2, semver@^7.5.4, semver@^7.6.0, semver@^7.6.3: resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== -semver@^7.7.1: - version "7.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f" - integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== - server-only@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/server-only/-/server-only-0.0.1.tgz#0f366bb6afb618c37c9255a314535dc412cd1c9e" @@ -7936,28 +7616,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -smart-buffer@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" - integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== - -socks-proxy-agent@^8.0.5: - version "8.0.5" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz#b9cdb4e7e998509d7659d689ce7697ac21645bee" - integrity sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw== - dependencies: - agent-base "^7.1.2" - debug "^4.3.4" - socks "^2.8.3" - -socks@^2.8.3: - version "2.8.4" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.8.4.tgz#07109755cdd4da03269bda4725baa061ab56d5cc" - integrity sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ== - dependencies: - ip-address "^9.0.5" - smart-buffer "^4.2.0" - sonic-boom@^2.2.1: version "2.8.0" resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-2.8.0.tgz#c1def62a77425090e6ad7516aad8eb402e047611" @@ -7980,7 +7638,7 @@ source-map@^0.5.7: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== -source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -8021,11 +7679,6 @@ split2@^4.0.0: resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== -sprintf-js@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a" - integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA== - sshpk@^1.18.0: version "1.18.0" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.18.0.tgz#1663e55cddf4d688b86a46b77f0d5fe363aba028" @@ -8162,16 +7815,6 @@ streamsearch@^1.1.0: resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== -streamx@^2.15.0, streamx@^2.21.0: - version "2.22.0" - resolved "https://registry.yarnpkg.com/streamx/-/streamx-2.22.0.tgz#cd7b5e57c95aaef0ff9b2aef7905afa62ec6e4a7" - integrity sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw== - dependencies: - fast-fifo "^1.3.2" - text-decoder "^1.1.0" - optionalDependencies: - bare-events "^2.2.0" - strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" @@ -8451,33 +8094,6 @@ tapable@^2.2.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -tar-fs@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-3.0.8.tgz#8f62012537d5ff89252d01e48690dc4ebed33ab7" - integrity sha512-ZoROL70jptorGAlgAYiLoBLItEKw/fUxg9BSYK/dF/GAGYFJOJJJMvjPAKDJraCXFwadD456FCuvLWgfhMsPwg== - dependencies: - pump "^3.0.0" - tar-stream "^3.1.5" - optionalDependencies: - bare-fs "^4.0.1" - bare-path "^3.0.0" - -tar-stream@^3.1.5: - version "3.1.7" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-3.1.7.tgz#24b3fb5eabada19fe7338ed6d26e5f7c482e792b" - integrity sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ== - dependencies: - b4a "^1.6.4" - fast-fifo "^1.2.0" - streamx "^2.15.0" - -text-decoder@^1.1.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/text-decoder/-/text-decoder-1.2.3.tgz#b19da364d981b2326d5f43099c310cc80d770c65" - integrity sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA== - dependencies: - b4a "^1.6.4" - text-extensions@^2.0.0: version "2.4.0" resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-2.4.0.tgz#a1cfcc50cf34da41bfd047cc744f804d1680ea34" @@ -8644,11 +8260,6 @@ tslib@2.7.0, tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3. resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== -tslib@^2.0.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" - integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -8777,11 +8388,6 @@ typed-array-length@^1.0.7: possible-typed-array-names "^1.0.0" reflect.getprototypeof "^1.0.6" -typed-query-selector@^2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/typed-query-selector/-/typed-query-selector-2.12.0.tgz#92b65dbc0a42655fccf4aeb1a08b1dddce8af5f2" - integrity sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg== - typescript@5: version "5.6.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.2.tgz#d1de67b6bef77c41823f822df8f0b3bcff60a5a0" @@ -9206,7 +8812,7 @@ ws@8.17.1: resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== -ws@8.18.1, ws@^8.18.1: +ws@8.18.1: version "8.18.1" resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.1.tgz#ea131d3784e1dfdff91adb0a4a116b127515e3cb" integrity sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w== @@ -9254,14 +8860,6 @@ yargs@^17.7.2: y18n "^5.0.5" yargs-parser "^21.1.1" -yauzl@^2.10.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" @@ -9294,11 +8892,6 @@ zod@^3.22.4: resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g== -zod@^3.24.1: - version "3.24.2" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.2.tgz#8efa74126287c675e92f46871cfc8d15c34372b3" - integrity sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ== - zustand@^4.4.0: version "4.5.6" resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.5.6.tgz#6857d52af44874a79fb3408c9473f78367255c96" From bde48ca8537b6636312ec5d6b429fcac3a3f0a1a Mon Sep 17 00:00:00 2001 From: Oche Date: Thu, 1 May 2025 10:31:55 +0100 Subject: [PATCH 11/48] feat: add faqs to strategies --- src/strategies/auto_strk.strat.ts | 1 + src/strategies/auto_xstrk.strat.ts | 1 + src/strategies/delta_neutral_mm.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/src/strategies/auto_strk.strat.ts b/src/strategies/auto_strk.strat.ts index 575d091e..d6090b31 100755 --- a/src/strategies/auto_strk.strat.ts +++ b/src/strategies/auto_strk.strat.ts @@ -83,6 +83,7 @@ export class AutoTokenStrategy extends IStrategy { notARisks: [], }, additionalInfo: undefined, + faqs: [], }; super( `auto_token_${token.toLowerCase()}`, diff --git a/src/strategies/auto_xstrk.strat.ts b/src/strategies/auto_xstrk.strat.ts index cbb7995c..e7727d58 100644 --- a/src/strategies/auto_xstrk.strat.ts +++ b/src/strategies/auto_xstrk.strat.ts @@ -82,6 +82,7 @@ export class AutoXSTRKStrategy extends IStrategy { notARisks: [], }, additionalInfo: undefined, + faqs: [], }; const token = 'STRK'; diff --git a/src/strategies/delta_neutral_mm.ts b/src/strategies/delta_neutral_mm.ts index ca143b5a..57c8b544 100755 --- a/src/strategies/delta_neutral_mm.ts +++ b/src/strategies/delta_neutral_mm.ts @@ -92,6 +92,7 @@ export class DeltaNeutralMM extends IStrategy { notARisks: [], }, additionalInfo: undefined, + faqs: [], }; super( From 796f9268bd85a1e4c49e70d3764d11e796a6589c Mon Sep 17 00:00:00 2001 From: Oche Date: Mon, 5 May 2025 06:03:40 +0100 Subject: [PATCH 12/48] feat: show transaction history when wallet is connected --- .../_components/TransactionsTab.tsx | 316 ++++++++++-------- 1 file changed, 168 insertions(+), 148 deletions(-) diff --git a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx index 17d0e384..e2fe163a 100644 --- a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx +++ b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx @@ -12,6 +12,7 @@ import { Text, } from '@chakra-ui/react'; import { ArrowDownIcon, ArrowUpIcon, ExternalLinkIcon } from '@chakra-ui/icons'; +import { useAccount } from '@starknet-react/core'; import { capitalize, @@ -38,6 +39,7 @@ interface TransactionsTabProps { } export function TransactionsTab(props: TransactionsTabProps) { + const { address } = useAccount(); const { strategy, txHistory } = props; return ( @@ -56,164 +58,182 @@ export function TransactionsTab(props: TransactionsTabProps) { - - - - - - - - - - - - - {txHistory.findManyInvestment_flows.map((tx, index) => { - const token = getTokenInfoFromAddr(tx.asset); - const decimals = token?.decimals; - - return ( - - - - + + + + + + + ); + })} + +
- # - - Amount - - Transaction type - - Wallet address - - Time -
- {index + 1}. - - {Number( - new MyNumber( - tx.amount, - decimals!, - ).toEtherToFixedDecimals(token.displayDecimals), - ).toLocaleString()}{' '} - {token?.name} - - - {tx.type === 'deposit' ? ( - + {!strategy.settings.isTransactionHistDisabled && + txHistory.findManyInvestment_flows.length !== 0 && ( + <> + + + + + + + + + + + + {txHistory.findManyInvestment_flows.map((tx, index) => { + const token = getTokenInfoFromAddr(tx.asset); + const decimals = token?.decimals; - {capitalize(tx.type)} - - - - - - ); - })} - -
+ # + + Amount + + Transaction type + - - - ) : ( - + - - - )} + Time +
- - - {shortAddress(tx.txHash)} - - - - - {timeAgo(new Date(tx.timestamp * 1000))} - -
-
+ return ( +
+ {index + 1}. + + {Number( + new MyNumber( + tx.amount, + decimals!, + ).toEtherToFixedDecimals( + token.displayDecimals, + ), + ).toLocaleString()}{' '} + {token?.name} + + + {tx.type === 'deposit' ? ( + + + + ) : ( + + + + )} + + {capitalize(tx.type)} + + + + + {shortAddress(tx.txHash)}{' '} + + + + + + {timeAgo(new Date(tx.timestamp * 1000))} + +
+
+ + )} + + ) : ( + + Connect your wallet to view transaction history + + )} {/* If no filtered tx */} - {!strategy.settings.isTransactionHistDisabled && + {address && + !strategy.settings.isTransactionHistDisabled && txHistory.findManyInvestment_flows.length === 0 && ( No transactions found )} + {strategy.settings.isTransactionHistDisabled && ( Date: Wed, 7 May 2025 21:42:57 +0530 Subject: [PATCH 13/48] fix tx hist bug --- src/store/transactions.atom.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/transactions.atom.ts b/src/store/transactions.atom.ts index 47558680..f17fd416 100755 --- a/src/store/transactions.atom.ts +++ b/src/store/transactions.atom.ts @@ -85,10 +85,10 @@ export const TxHistoryAtom = (contract: string, owner: string) => // balData just to trigger a refetch queryKey: ['tx_history', contract, owner, JSON.stringify(get(newTxsAtom))], queryFn: async ({ queryKey }: any): Promise => { - const [, { contract, owner }] = queryKey; + // const [, { contract, owner }] = queryKey; const res = await getTxHistory(contract, owner); - console.log('TxHistoryAtom res', res, contract, owner, queryKey); + console.log('TxHistoryAtom res', res, { contract, owner, queryKey }); // add new txs from local cache const newTxs = get(newTxsAtom); console.log('TxHistoryAtom newTxs', newTxs); From e6b0c7cd0959b81e269230bc5af6fa2e30e7d0a9 Mon Sep 17 00:00:00 2001 From: Akira <156126180+akiraonstarknet@users.noreply.github.com> Date: Sat, 10 May 2025 09:23:51 +0530 Subject: [PATCH 14/48] fix @strkfarm/sdk to 1.0.35 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4f3971fa..423be3bc 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.35", "@tanstack/query-core": "5.28.0", "@types/mixpanel-browser": "2.49.0", "@types/mustache": "4.2.5", From 01a88004ca4bd4cdc3958184098d354571a4d389 Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Wed, 28 May 2025 18:31:05 +0530 Subject: [PATCH 15/48] alerts: vesu mig alert --- src/store/strategies.atoms.tsx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/store/strategies.atoms.tsx b/src/store/strategies.atoms.tsx index 3414d656..60400d2f 100755 --- a/src/store/strategies.atoms.tsx +++ b/src/store/strategies.atoms.tsx @@ -194,17 +194,18 @@ export function getStrategies() { { maxTVL: 500000, alerts: [ - // { - // type: 'warning', - // text: 'Note: Deposits may fail sometimes due to high utilisation on Vesu. We are working to add a dynamic TVL limit to better show limits.', - // tab: 'deposit', - // }, + { + type: 'warning', + text: 'Note: Vesu is undergoing an upgrade. Deposits and Withdraws are paused for this strategy until further notice.', + tab: 'all', + }, { type: 'info', text: 'Depeg-risk: If xSTRK price on DEXes deviates from expected price, you may lose money or may have to wait for the price to recover.', tab: 'all', }, ], + isPaused: true, isAudited: false, quoteToken: convertToV2TokenInfo(getTokenInfoFromName('STRK')), }, @@ -221,8 +222,14 @@ export function getStrategies() { maxTVL: 0, isAudited: v.auditUrl ? true : false, auditUrl: v.auditUrl, - isPaused: false, - alerts: [], + isPaused: true, + alerts: [ + { + type: 'warning', + text: 'Note: Vesu is undergoing an upgrade. Deposits and Withdraws are paused for this strategy until further notice.', + tab: 'all', + }, + ], quoteToken: convertToV2TokenInfo( getTokenInfoFromName(v.depositTokens[0]?.symbol || ''), ), From 2cdc1fb9f4b9b77387a392613abe3fe1a947164e Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Thu, 29 May 2025 12:53:38 +0530 Subject: [PATCH 16/48] feat: maintainence mode --- .../[strategyId]/_components/Strategy.tsx | 192 ++++++++++++------ src/components/AmountInput.tsx | 58 +++--- src/store/strategies.atoms.tsx | 34 +++- src/strategies/IStrategy.ts | 1 + src/strategies/delta_neutral_mm_vesu_endur.ts | 2 +- 5 files changed, 195 insertions(+), 92 deletions(-) diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index 04f31ada..7f8c5b81 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -51,6 +51,129 @@ import { } from '@/store/strkfarm.atoms'; import { TokenDeposit } from './TokenDeposit'; +function HoldingsText({ + strategy, + address, + balData, +}: { + strategy: StrategyInfo; + address: string | undefined; + balData: any; +}) { + if (strategy.settings.isInMaintenance) + return Maintenance Mode; + if (!address) return 'Connect wallet'; + if (balData.isLoading || !balData.data?.tokenInfo) { + return ( + <> + {balData.isLoading ? 'loading' : JSON.stringify(balData.data)} + + + ); + } + if (balData.isError) { + console.error('Balance data error:', balData.error); + return 'Error'; + } + const value = Number( + balData.data.amount.toEtherToFixedDecimals( + balData.data.tokenInfo?.displayDecimals || 2, + ), + ); + if (value === 0 || strategy?.isRetired()) return '-'; + return `${balData.data.amount.toEtherToFixedDecimals( + balData.data.tokenInfo?.displayDecimals || 2, + )} ${balData.data.tokenInfo?.name}`; +} + +function NetEarningsText({ + strategy, + address, + profit, + balData, +}: { + strategy: StrategyInfo; + address: string | undefined; + profit: number; + balData: any; +}) { + if ( + !address || + profit === 0 || + strategy?.isRetired() || + strategy.settings.isInMaintenance + ) + return '-'; + return `${profit?.toFixed( + balData.data.tokenInfo?.displayDecimals || 2, + )} ${balData.data.tokenInfo?.name}`; +} + +function HoldingsAndEarnings({ + strategy, + address, + balData, + profit, +}: { + strategy: StrategyInfo; + address: string | undefined; + balData: any; + profit: number; +}) { + // if ( + // balData.isLoading || + // !balData.data?.tokenInfo || + // balData.isPending + // ) { + // return ( + // + // Your Holdings: + // {address ? : 'Connect wallet'} + // + // ); + // } + // if (balData.isError) { + // return ( + // + // Your Holdings: Error + // + // ); + // } + return ( + + + + Your Holdings + + + + + + {!strategy.settings.isTransactionHistDisabled && ( + + + + Net earnings + + = 0 ? 'cyan' : 'red'}> + + + + + )} + + ); +} + const Strategy = ({ params }: StrategyParams) => { const address = useAtomValue(addressAtom); const strategies = useAtomValue(strategiesAtom); @@ -247,69 +370,12 @@ const Strategy = ({ params }: StrategyParams) => { bg={'bg'} marginTop={'20px'} > - {!balData.isLoading && - !balData.isError && - !balData.isPending && - balData.data && - balData.data.tokenInfo && ( - - - - Your Holdings - - - {address - ? Number( - balData.data.amount.toEtherToFixedDecimals( - balData.data.tokenInfo?.displayDecimals || - 2, - ), - ) === 0 || strategy?.isRetired() - ? '-' - : `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : 'Connect wallet'} - - - {!strategy.settings.isTransactionHistDisabled && ( - - - - Net earnings - - = 0 ? 'cyan' : 'red'} - > - {address && - profit !== 0 && - !strategy?.isRetired() - ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : '-'} - - - - )} - - )} - {(balData.isLoading || !balData.data?.tokenInfo) && ( - - Your Holdings: - {address ? ( - - ) : ( - 'Connect wallet' - )} - - )} - {balData.isError && ( - - Your Holdings: Error - - )} + {/* Show individual holdings is more tokens */} {individualBalances.length > 1 && diff --git a/src/components/AmountInput.tsx b/src/components/AmountInput.tsx index 990b2209..d70f6b73 100644 --- a/src/components/AmountInput.tsx +++ b/src/components/AmountInput.tsx @@ -321,32 +321,38 @@ const AmountInput = forwardRef( boxSize: '15px', }} > - - - {balance.toEtherToFixedDecimals(4)} - - - + {props.strategy.settings.isInMaintenance ? ( + '-' + ) : ( + <> + + + {balance.toEtherToFixedDecimals(4)} + + + + + )}
); diff --git a/src/store/strategies.atoms.tsx b/src/store/strategies.atoms.tsx index 60400d2f..d9edd2f8 100755 --- a/src/store/strategies.atoms.tsx +++ b/src/store/strategies.atoms.tsx @@ -196,7 +196,21 @@ export function getStrategies() { alerts: [ { type: 'warning', - text: 'Note: Vesu is undergoing an upgrade. Deposits and Withdraws are paused for this strategy until further notice.', + text: ( +

+ Note: Vesu has recently migrated. Deposits and + withdrawals for this strategy are temporarily paused until we + migrate this strategy.{' '} + + Learn more + + . +

+ ), tab: 'all', }, { @@ -206,6 +220,7 @@ export function getStrategies() { }, ], isPaused: true, + isInMaintenance: true, isAudited: false, quoteToken: convertToV2TokenInfo(getTokenInfoFromName('STRK')), }, @@ -223,10 +238,25 @@ export function getStrategies() { isAudited: v.auditUrl ? true : false, auditUrl: v.auditUrl, isPaused: true, + isInMaintenance: true, alerts: [ { type: 'warning', - text: 'Note: Vesu is undergoing an upgrade. Deposits and Withdraws are paused for this strategy until further notice.', + text: ( +

+ Note: Vesu has recently migrated. Deposits and + withdrawals for this strategy are temporarily paused until we + migrate this strategy.{' '} + + Learn more + + . +

+ ), tab: 'all', }, ], diff --git a/src/strategies/IStrategy.ts b/src/strategies/IStrategy.ts index bee05523..624a0ab5 100755 --- a/src/strategies/IStrategy.ts +++ b/src/strategies/IStrategy.ts @@ -118,6 +118,7 @@ export interface IStrategySettings { isAudited?: boolean; auditUrl?: string; isPaused?: boolean; + isInMaintenance?: boolean; quoteToken: TokenInfoV2; // used to show the holdings in this token, isTransactionHistDisabled?: boolean; } diff --git a/src/strategies/delta_neutral_mm_vesu_endur.ts b/src/strategies/delta_neutral_mm_vesu_endur.ts index fe981248..84332ab0 100644 --- a/src/strategies/delta_neutral_mm_vesu_endur.ts +++ b/src/strategies/delta_neutral_mm_vesu_endur.ts @@ -51,7 +51,7 @@ export class DeltaNeutralMMVesuEndur extends DeltaNeutralMM { const risks = [this.risks[0], this.risks[2]]; if (this.settings.alerts && this.settings.alerts.length > 0) { risks.push( - (this.settings.alerts[0].text as string).replace('Note: ', ''), + 'If xSTRK price on DEXes deviates from expected price, you may lose money or may have to wait for the price to recover.', ); } risks.push(...this.risks.slice(3)); From 9e223fc76a36d9418c71d4ea25b1ca25b795782a Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Fri, 30 May 2025 17:07:48 +0530 Subject: [PATCH 17/48] bump to sdk 1.0.43, fix vesu loading --- package.json | 2 +- src/app/api/lib.ts | 14 +- src/app/api/strategies/route.ts | 4 +- src/utils.ts | 15 +- yarn.lock | 570 ++++---------------------------- 5 files changed, 85 insertions(+), 520 deletions(-) diff --git a/package.json b/package.json index 423be3bc..30c34050 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.43", "@tanstack/query-core": "5.28.0", "@types/mixpanel-browser": "2.49.0", "@types/mustache": "4.2.5", diff --git a/src/app/api/lib.ts b/src/app/api/lib.ts index 12a9a1ab..5821643a 100644 --- a/src/app/api/lib.ts +++ b/src/app/api/lib.ts @@ -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,7 +34,14 @@ 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[], diff --git a/src/app/api/strategies/route.ts b/src/app/api/strategies/route.ts index cc6981b6..9fff9170 100755 --- a/src/app/api/strategies/route.ts +++ b/src/app/api/strategies/route.ts @@ -9,7 +9,7 @@ import { STRKFarmStrategyAPIResult } from '@/store/strkfarm.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'; @@ -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/utils.ts b/src/utils.ts index 662fcd71..a16bfc0a 100755 --- a/src/utils.ts +++ b/src/utils.ts @@ -200,11 +200,16 @@ export function getEndpoint() { export function getHosturl() { const FALLBACK = 'strkfarm.com'; try { - return ( - (typeof window !== 'undefined' - ? window.location.hostname.split('.').slice(-2).join('.') - : null) || FALLBACK - ); + if (typeof window !== 'undefined') { + const hostname = window.location.hostname; + // Check if hostname is an IPv4 or IPv6 address + const isIP = + /^(\d{1,3}\.){3}\d{1,3}$/.test(hostname) || // IPv4 + /^\[?([a-fA-F0-9:]+)\]?$/.test(hostname); // IPv6 (with or without brackets) + if (isIP) return FALLBACK; + return hostname.split('.').slice(-2).join('.'); + } + return FALLBACK; } catch (e) { return FALLBACK; } diff --git a/yarn.lock b/yarn.lock index cd5018b7..1c406a0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1421,9 +1421,9 @@ yoctocolors-cjs "^2.1.2" "@inquirer/figures@^1.0.5", "@inquirer/figures@^1.0.6": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.11.tgz#4744e6db95288fea1dead779554859710a959a21" - integrity sha512-eOg92lvrn/aRUqbxRyvpEWnrvRuTYRifixHkYVpJiygTgVSBIHDqLh0SrMQXkafvULg3ck11V7xvR+zcgvpHFw== + version "1.0.12" + resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.12.tgz#667d6254cc7ba3b0c010a323d78024a1d30c6053" + integrity sha512-MJttijd8rMFcKJC8NYmprWr6hD3r9Gd9qUC0XwPNwoEPWSMVJwA2MlXxF+nhZZNMY+HXsWa+o7KY2emWYIn0jQ== "@inquirer/input@^2.3.0": version "2.3.0" @@ -1695,13 +1695,6 @@ dependencies: "@noble/hashes" "1.3.2" -"@noble/curves@1.7.0", "@noble/curves@~1.7.0": - version "1.7.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.7.0.tgz#0512360622439256df892f21d25b388f52505e45" - integrity sha512-UTMhXK9SeDhFJVrHeUJ5uZlI6ajXg10O6Ddocf9S6GjbSBVZsJo88HzKwXznNfGpMTRDyJkqMjNDPYgf0qFWnw== - dependencies: - "@noble/hashes" "1.6.0" - "@noble/curves@1.8.1", "@noble/curves@^1.6.0", "@noble/curves@~1.8.1": version "1.8.1" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.8.1.tgz#19bc3970e205c99e4bdb1c64a4785706bce497ff" @@ -1738,21 +1731,11 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== -"@noble/hashes@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.6.0.tgz#d4bfb516ad6e7b5111c216a5cc7075f4cf19e6c5" - integrity sha512-YUULf0Uk4/mAA89w+k3+yUYh6NrEvxZa5T6SY3wlMvE2chHkxFUUIDI8/XW1QSC357iA5pSnqt7XEhvFOqmDyQ== - "@noble/hashes@1.7.1", "@noble/hashes@^1.4.0", "@noble/hashes@^1.5.0", "@noble/hashes@~1.7.1": version "1.7.1" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.7.1.tgz#5738f6d765710921e7a751e00c20ae091ed8db0f" integrity sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ== -"@noble/hashes@~1.6.0": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.6.1.tgz#df6e5943edcea504bac61395926d6fd67869a0d5" - integrity sha512-pq5D8h10hHBjyqX+cfBm0i8JUXJ0UhczFc4r74zbuT9XgewFo2E3J1cOaGtdZynILNmQ685YWGzGE1Zv6io50w== - "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1922,28 +1905,15 @@ dependencies: "@prisma/debug" "5.18.0" -"@puppeteer/browsers@2.10.0": - version "2.10.0" - resolved "https://registry.yarnpkg.com/@puppeteer/browsers/-/browsers-2.10.0.tgz#a6e55bf85bfcc819e5e8c79f6122cccaa52515a4" - integrity sha512-HdHF4rny4JCvIcm7V1dpvpctIGqM3/Me255CB44vW7hDG1zYMmcBMjpNqZEDxdCfXGLkx5kP0+Jz5DUS+ukqtA== - dependencies: - debug "^4.4.0" - extract-zip "^2.0.1" - progress "^2.0.3" - proxy-agent "^6.5.0" - semver "^7.7.1" - tar-fs "^3.0.8" - yargs "^17.7.2" - "@redis/bloom@1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@redis/bloom/-/bloom-1.2.0.tgz#d3fd6d3c0af3ef92f26767b56414a370c7b63b71" integrity sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg== -"@redis/client@1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@redis/client/-/client-1.6.0.tgz#dcf4ae1319763db6fdddd6de7f0af68a352c30ea" - integrity sha512-aR0uffYI700OEEH4gYnitAnv3vzVGXCFvYfdpu/CJKvk4pHfLPEy/JSZyrpQ+15WhXe1yJRXLtfQ84s4mEXnPg== +"@redis/client@1.6.1": + version "1.6.1" + resolved "https://registry.yarnpkg.com/@redis/client/-/client-1.6.1.tgz#c4636b7cb34e96008a988409b7e787364ae761a2" + integrity sha512-/KCsg3xSlR+nCK8/8ZYSknYxvXHwubJrU82F3Lm1Fp6789VQ0/3RJKfsmRXjqfaTA++23CvC3hqmqe/2GEt6Kw== dependencies: cluster-key-slot "1.1.2" generic-pool "3.9.0" @@ -1979,11 +1949,6 @@ resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.10.4.tgz#427d5549943a9c6fce808e39ea64dbe60d4047f1" integrity sha512-WJgX9nzTqknM393q1QJDJmoW28kUfEnybeTfVNcNAPnIx210RXm2DiXiHzfNPJNIUUb1tJnz/l4QGtJ30PgWmA== -"@scure/base@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.2.1.tgz#dd0b2a533063ca612c17aa9ad26424a2ff5aa865" - integrity sha512-DGmGtC8Tt63J5GfHgfl5CuAXh96VF/LD8K9Hr/Gv0J2lAoRGlPOMpqMpMbCTOoOJMZCk2Xt+DskdDyn6dEFdzQ== - "@scure/base@~1.1.3": version "1.1.9" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.9.tgz#e5e142fbbfe251091f9c5f1dd4c834ac04c3dbd1" @@ -2011,14 +1976,6 @@ "@noble/hashes" "~1.7.1" "@scure/base" "~1.2.4" -"@scure/starknet@1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@scure/starknet/-/starknet-1.1.0.tgz#d1902e053d98196e161b9b2c3996b20999094e7a" - integrity sha512-83g3M6Ix2qRsPN4wqLDqiRZ2GBNbjVWfboJE/9UjfG+MHr6oDSu/CWgy8hsBSJejr09DkkL+l0Ze4KVrlCIdtQ== - dependencies: - "@noble/curves" "~1.7.0" - "@noble/hashes" "~1.6.0" - "@scure/starknet@~1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@scure/starknet/-/starknet-1.0.0.tgz#4419bc2fdf70f3dd6cb461d36c878c9ef4419f8c" @@ -2205,10 +2162,10 @@ viem "^2.19.1" zod "^3.22.4" -"@strkfarm/sdk@^1.0.35": - version "1.0.35" - resolved "https://registry.yarnpkg.com/@strkfarm/sdk/-/sdk-1.0.35.tgz#307cd2beb53cb12bc66c4aab08560ff5b316ca5e" - integrity sha512-QG1Oes92QwUvusG8kY8GFWE3CxHr5Zde/ZM9bU1DhwGk0FRMkj0TbN19pNnVOEv4Odw9Tj990uISFphBm/mhHw== +"@strkfarm/sdk@^1.0.43": + version "1.0.43" + resolved "https://registry.yarnpkg.com/@strkfarm/sdk/-/sdk-1.0.43.tgz#a022bc4c468a648382efeed741e208deaab2c89e" + integrity sha512-H8c7sM4RVqsoojjJs8iQBligCPoW0dbRInNt6zpJQ3VY0J5e/+ZVfNiMn5XrD0Q1guf1+lNTEc3uDCzUd8gVqA== dependencies: "@avnu/avnu-sdk" "^3.0.2" axios "^1.7.2" @@ -2221,10 +2178,8 @@ inquirer "^10.1.2" node-telegram-bot-api "^0.66.0" proxy-from-env "^1.1.0" - puppeteer "^24.4.0" redis "^4.7.0" stacktrace-js "^2.0.2" - starknet "^6.11.0" winston "^3.13.0" "@swc/helpers@0.5.2": @@ -2251,11 +2206,6 @@ dependencies: "@tanstack/query-core" "5.59.0" -"@tootallnate/quickjs-emscripten@^0.23.0": - version "0.23.0" - resolved "https://registry.yarnpkg.com/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz#db4ecfd499a9765ab24002c3b696d02e6d32a12c" - integrity sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA== - "@trpc/client@^10.38.1": version "10.45.2" resolved "https://registry.yarnpkg.com/@trpc/client/-/client-10.45.2.tgz#15f9ba81303bf3417083fc6bb742e4e86b49da90" @@ -2352,9 +2302,9 @@ "@types/node" "*" "@types/node@*", "@types/node@^22.5.5": - version "22.14.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.14.1.tgz#53b54585cec81c21eee3697521e31312d6ca1e6f" - integrity sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw== + version "22.15.27" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.27.tgz#b99cd64129c4c85a69edca903af9b3aa72c3b4f7" + integrity sha512-5fF+eu5mwihV2BeVtX5vijhdaZOfkQTATrePEaXTcKqI16LhJ7gi2/Vhd9OZM0UojcdmiOCVg5rrax+i1MdoQQ== dependencies: undici-types "~6.21.0" @@ -2429,13 +2379,6 @@ resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd" integrity sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g== -"@types/yauzl@^2.9.1": - version "2.10.3" - resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.10.3.tgz#e9b2808b4f109504a03cda958259876f61017999" - integrity sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q== - dependencies: - "@types/node" "*" - "@typescript-eslint/eslint-plugin@7.7.0": version "7.7.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.0.tgz#bf34a02f221811505b8bf2f31060c8560c1bb0a3" @@ -2870,7 +2813,7 @@ JSONStream@^1.3.5: jsonparse "^1.2.0" through ">=2.2.7 <3" -abi-wan-kanabi@^2.2.2, abi-wan-kanabi@^2.2.3: +abi-wan-kanabi@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/abi-wan-kanabi/-/abi-wan-kanabi-2.2.4.tgz#47ebbafbb7f8df81773efbdcca60cdda8008c821" integrity sha512-0aA81FScmJCPX+8UvkXLki3X1+yPQuWxEkqXBVKltgPAK79J+NB+Lp5DouMXa7L6f+zcRlIA/6XO7BN/q9fnvg== @@ -2917,11 +2860,6 @@ agent-base@6: dependencies: debug "4" -agent-base@^7.1.0, agent-base@^7.1.2: - version "7.1.3" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.3.tgz#29435eb821bc4194633a5b89e5bc4703bafc25a1" - integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== - ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -3159,13 +3097,6 @@ ast-types-flow@^0.0.8: resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.8.tgz#0a85e1c92695769ac13a428bb653e7538bea27d6" integrity sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ== -ast-types@^0.13.4: - version "0.13.4" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.4.tgz#ee0d77b343263965ecc3fb62da16e7222b2b6782" - integrity sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w== - dependencies: - tslib "^2.0.1" - async-mutex@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.5.0.tgz#353c69a0b9e75250971a64ac203b0ebfddd75482" @@ -3232,9 +3163,9 @@ axios@1.6.7: proxy-from-env "^1.1.0" axios@^1.7.2: - version "1.8.4" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.8.4.tgz#78990bb4bc63d2cae072952d374835950a82f447" - integrity sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw== + version "1.9.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.9.0.tgz#25534e3b72b54540077d33046f77e3b8d7081901" + integrity sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg== dependencies: follow-redirects "^1.15.6" form-data "^4.0.0" @@ -3245,11 +3176,6 @@ axobject-query@^4.1.0: resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-4.1.0.tgz#28768c76d0e3cff21bc62a9e2d0b6ac30042a1ee" integrity sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ== -b4a@^1.6.4: - version "1.6.7" - resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.7.tgz#a99587d4ebbfbd5a6e3b21bdb5d5fa385767abe4" - integrity sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg== - babel-plugin-macros@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" @@ -3264,44 +3190,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -bare-events@^2.2.0, bare-events@^2.5.4: - version "2.5.4" - resolved "https://registry.yarnpkg.com/bare-events/-/bare-events-2.5.4.tgz#16143d435e1ed9eafd1ab85f12b89b3357a41745" - integrity sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA== - -bare-fs@^4.0.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/bare-fs/-/bare-fs-4.1.2.tgz#5b048298019f489979d5a6afb480f5204ad4e89b" - integrity sha512-8wSeOia5B7LwD4+h465y73KOdj5QHsbbuoUfPBi+pXgFJIPuG7SsiOdJuijWMyfid49eD+WivpfY7KT8gbAzBA== - dependencies: - bare-events "^2.5.4" - bare-path "^3.0.0" - bare-stream "^2.6.4" - -bare-os@^3.0.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/bare-os/-/bare-os-3.6.1.tgz#9921f6f59edbe81afa9f56910658422c0f4858d4" - integrity sha512-uaIjxokhFidJP+bmmvKSgiMzj2sV5GPHaZVAIktcxcpCyBFFWO+YlikVAdhmUo2vYFvFhOXIAlldqV29L8126g== - -bare-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/bare-path/-/bare-path-3.0.0.tgz#b59d18130ba52a6af9276db3e96a2e3d3ea52178" - integrity sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw== - dependencies: - bare-os "^3.0.1" - -bare-stream@^2.6.4: - version "2.6.5" - resolved "https://registry.yarnpkg.com/bare-stream/-/bare-stream-2.6.5.tgz#bba8e879674c4c27f7e27805df005c15d7a2ca07" - integrity sha512-jSmxKJNJmHySi6hC42zlZnq00rga4jjxcgNZjY9N5WlOe/iOoGRtdwGsHzQv2RlH2KOYMwGUXhf2zXd32BA9RA== - dependencies: - streamx "^2.21.0" - -basic-ftp@^5.0.2: - version "5.0.5" - resolved "https://registry.yarnpkg.com/basic-ftp/-/basic-ftp-5.0.5.tgz#14a474f5fffecca1f4f406f1c26b18f800225ac0" - integrity sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg== - bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" @@ -3384,11 +3272,6 @@ browserslist@^4.14.5: node-releases "^2.0.18" update-browserslist-db "^1.1.0" -buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ== - busboy@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" @@ -3503,14 +3386,6 @@ chroma.ts@1.0.10: resolved "https://registry.yarnpkg.com/chroma.ts/-/chroma.ts-1.0.10.tgz#2b965d8f2c2eee44d25072902e5787fe259d4565" integrity sha512-0FOQiB6LaiOwoyaxP+a4d3sCIOSf7YvBKj3TfeQM4ZBb2yskRxe4FlT2P4YNpHz7kIB5rXsfmpyniyrYRRyVHw== -chromium-bidi@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chromium-bidi/-/chromium-bidi-3.0.0.tgz#bfb0549db96552d42377401aadc0198a1bbb3e9f" - integrity sha512-ZOGRDAhBMX1uxL2Cm2TDuhImbrsEz5A/tTcVU6RpXEWaTNUNwsHW6njUXizh51Ir6iqHbKAfhA2XK33uBcLo5A== - dependencies: - mitt "^3.0.1" - zod "^3.24.1" - citty@^0.1.5, citty@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/citty/-/citty-0.1.6.tgz#0f7904da1ed4625e1a9ea7e0fa780981aab7c5e4" @@ -3834,16 +3709,6 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cosmiconfig@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-9.0.0.tgz#34c3fc58287b915f3ae905ab6dc3de258b55ad9d" - integrity sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg== - dependencies: - env-paths "^2.2.1" - import-fresh "^3.3.0" - js-yaml "^4.1.0" - parse-json "^5.2.0" - cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -3959,11 +3824,6 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -data-uri-to-buffer@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz#8a58bb67384b261a38ef18bea1810cb01badd28b" - integrity sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw== - data-view-buffer@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/data-view-buffer/-/data-view-buffer-1.0.1.tgz#8ea6326efec17a2e42620696e671d7d5a8bc66b2" @@ -4039,13 +3899,6 @@ debug@^3.2.7: dependencies: ms "^2.1.1" -debug@^4.1.1, debug@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.0.tgz#2b3f2aea2ffeb776477460267377dc8710faba8a" - integrity sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA== - dependencies: - ms "^2.1.3" - decode-uri-component@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" @@ -4103,15 +3956,6 @@ defu@^6.1.4: resolved "https://registry.yarnpkg.com/defu/-/defu-6.1.4.tgz#4e0c9cf9ff68fe5f3d7f2765cc1a012dfdcb0479" integrity sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg== -degenerator@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/degenerator/-/degenerator-5.0.1.tgz#9403bf297c6dad9a1ece409b37db27954f91f2f5" - integrity sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ== - dependencies: - ast-types "^0.13.4" - escodegen "^2.1.0" - esprima "^4.0.1" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -4142,11 +3986,6 @@ detect-node-es@^1.1.0: resolved "https://registry.yarnpkg.com/detect-node-es/-/detect-node-es-1.1.0.tgz#163acdf643330caa0b4cd7c21e7ee7755d6fa493" integrity sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ== -devtools-protocol@0.0.1425554: - version "0.0.1425554" - resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.1425554.tgz#51ed2fed1405f56783d24a393f7c75b6bbb58029" - integrity sha512-uRfxR6Nlzdzt0ihVIkV+sLztKgs7rgquY/Mhcv1YNCWDh5IZgl5mnn2aeEnW5stYTE0wwiF4RYVz8eMEpV1SEw== - didyoumean@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037" @@ -4296,11 +4135,6 @@ enhanced-resolve@^5.15.0: graceful-fs "^4.2.4" tapable "^2.2.0" -env-paths@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" - integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== - error-ex@^1.3.1, error-ex@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -4368,26 +4202,26 @@ es-abstract@^1.17.5, es-abstract@^1.22.1, es-abstract@^1.22.3, es-abstract@^1.23 which-typed-array "^1.1.15" es-abstract@^1.23.5, es-abstract@^1.23.6, es-abstract@^1.23.9: - version "1.23.9" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.23.9.tgz#5b45994b7de78dada5c1bebf1379646b32b9d606" - integrity sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA== + version "1.24.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.24.0.tgz#c44732d2beb0acc1ed60df840869e3106e7af328" + integrity sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg== dependencies: array-buffer-byte-length "^1.0.2" arraybuffer.prototype.slice "^1.0.4" available-typed-arrays "^1.0.7" call-bind "^1.0.8" - call-bound "^1.0.3" + call-bound "^1.0.4" data-view-buffer "^1.0.2" data-view-byte-length "^1.0.2" data-view-byte-offset "^1.0.1" es-define-property "^1.0.1" es-errors "^1.3.0" - es-object-atoms "^1.0.0" + es-object-atoms "^1.1.1" es-set-tostringtag "^2.1.0" es-to-primitive "^1.3.0" function.prototype.name "^1.1.8" - get-intrinsic "^1.2.7" - get-proto "^1.0.0" + get-intrinsic "^1.3.0" + get-proto "^1.0.1" get-symbol-description "^1.1.0" globalthis "^1.0.4" gopd "^1.2.0" @@ -4399,21 +4233,24 @@ es-abstract@^1.23.5, es-abstract@^1.23.6, es-abstract@^1.23.9: is-array-buffer "^3.0.5" is-callable "^1.2.7" is-data-view "^1.0.2" + is-negative-zero "^2.0.3" is-regex "^1.2.1" + is-set "^2.0.3" is-shared-array-buffer "^1.0.4" is-string "^1.1.1" is-typed-array "^1.1.15" - is-weakref "^1.1.0" + is-weakref "^1.1.1" math-intrinsics "^1.1.0" - object-inspect "^1.13.3" + object-inspect "^1.13.4" object-keys "^1.1.1" object.assign "^4.1.7" own-keys "^1.0.1" - regexp.prototype.flags "^1.5.3" + regexp.prototype.flags "^1.5.4" safe-array-concat "^1.1.3" safe-push-apply "^1.0.0" safe-regex-test "^1.1.0" set-proto "^1.0.0" + stop-iteration-iterator "^1.1.0" string.prototype.trim "^1.2.10" string.prototype.trimend "^1.0.9" string.prototype.trimstart "^1.0.8" @@ -4422,7 +4259,7 @@ es-abstract@^1.23.5, es-abstract@^1.23.6, es-abstract@^1.23.9: typed-array-byte-offset "^1.0.4" typed-array-length "^1.0.7" unbox-primitive "^1.1.0" - which-typed-array "^1.1.18" + which-typed-array "^1.1.19" es-define-property@^1.0.0: version "1.0.0" @@ -4549,17 +4386,6 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escodegen@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" - integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== - dependencies: - esprima "^4.0.1" - estraverse "^5.2.0" - esutils "^2.0.2" - optionalDependencies: - source-map "~0.6.1" - eslint-config-next@14.1.0: version "14.1.0" resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-14.1.0.tgz#7e309d426b8afacaba3b32fdbb02ba220b6d0a97" @@ -4758,7 +4584,7 @@ espree@^9.6.0, espree@^9.6.1: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.4.1" -esprima@^4.0.1, esprima@~4.0.0: +esprima@~4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== @@ -4801,9 +4627,9 @@ ethers@6.11.1: ws "8.5.0" ethers@^6.13.5: - version "6.13.5" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.5.tgz#8c1d6ac988ac08abc3c1d8fabbd4b8b602851ac4" - integrity sha512-+knKNieu5EKRThQJWwqaJ10a6HE9sSehGeqWN65//wE7j47ZpFhKAnHB/JJFibwwg61I/koxaPsXbXpD/skNOQ== + version "6.14.3" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.14.3.tgz#7c4443c165ee59b2964e691600fd4586004b2000" + integrity sha512-qq7ft/oCJohoTcsNPFaXSQUm457MA5iWqkf1Mb11ujONdg7jBI6sAOrHaTi3j0CBqIGFSCeR/RMc+qwRRub7IA== dependencies: "@adraffy/ens-normalize" "1.10.1" "@noble/curves" "1.2.0" @@ -4857,17 +4683,6 @@ external-editor@^3.1.0: iconv-lite "^0.4.24" tmp "^0.0.33" -extract-zip@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" - integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== - dependencies: - debug "^4.1.1" - get-stream "^5.1.0" - yauzl "^2.10.0" - optionalDependencies: - "@types/yauzl" "^2.9.1" - extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -4883,11 +4698,6 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-fifo@^1.2.0, fast-fifo@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c" - integrity sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ== - fast-glob@^3.2.12, fast-glob@^3.2.9, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" @@ -4921,13 +4731,6 @@ fastq@^1.6.0: dependencies: reusify "^1.0.4" -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g== - dependencies: - pend "~1.2.0" - fecha@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd" @@ -4941,14 +4744,6 @@ fetch-cookie@^3.0.0: set-cookie-parser "^2.4.8" tough-cookie "^5.0.0" -fetch-cookie@~3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/fetch-cookie/-/fetch-cookie-3.0.1.tgz#6a77f7495e1a639ae019db916a234db8c85d5963" - integrity sha512-ZGXe8Y5Z/1FWqQ9q/CrJhkUD73DyBU9VF0hBQmEO/wPHe4A9PKTjplFDLeFX8aOsYypZUcX5Ji/eByn3VCVO3Q== - dependencies: - set-cookie-parser "^2.4.8" - tough-cookie "^4.0.0" - file-entry-cache@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" @@ -5206,7 +5001,7 @@ get-port-please@^3.1.2: resolved "https://registry.yarnpkg.com/get-port-please/-/get-port-please-3.1.2.tgz#502795e56217128e4183025c89a48c71652f4e49" integrity sha512-Gxc29eLs1fbn6LQ4jSU4vXjlwyZhF5HsGuMAa7gqBP4Rw4yxxltyDUuF5MBclFzDTXO+ACchGQoeela4DSfzdQ== -get-proto@^1.0.0, get-proto@^1.0.1: +get-proto@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== @@ -5236,13 +5031,6 @@ get-starknet@3.3.3: bowser "^2.11.0" get-starknet-core "^3.3.3" -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - get-stream@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-8.0.1.tgz#def9dfd71742cd7754a7761ed43749a27d02eca2" @@ -5273,15 +5061,6 @@ get-tsconfig@^4.7.5: dependencies: resolve-pkg-maps "^1.0.0" -get-uri@^6.0.1: - version "6.0.4" - resolved "https://registry.yarnpkg.com/get-uri/-/get-uri-6.0.4.tgz#6daaee9e12f9759e19e55ba313956883ef50e0a7" - integrity sha512-E1b1lFFLvLgak2whF2xDBcOy6NLVGZBqqjJjsIhvopKfWWEi64pLVTWWehV8KlLerZkfNTA95sTe2OdJKm1OzQ== - dependencies: - basic-ftp "^5.0.2" - data-uri-to-buffer "^6.0.2" - debug "^4.3.4" - getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" @@ -5548,14 +5327,6 @@ hosted-git-info@^7.0.0: dependencies: lru-cache "^10.0.1" -http-proxy-agent@^7.0.0, http-proxy-agent@^7.0.1: - version "7.0.2" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz#9a8b1f246866c028509486585f62b8f2c18c270e" - integrity sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig== - dependencies: - agent-base "^7.1.0" - debug "^4.3.4" - http-shutdown@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/http-shutdown/-/http-shutdown-1.2.2.tgz#41bc78fc767637c4c95179bc492f312c0ae64c5f" @@ -5578,14 +5349,6 @@ https-proxy-agent@5.0.0: agent-base "6" debug "4" -https-proxy-agent@^7.0.6: - version "7.0.6" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz#da8dfeac7da130b05c2ba4b59c9b6cd66611a6b9" - integrity sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw== - dependencies: - agent-base "^7.1.2" - debug "4" - human-signals@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" @@ -5621,14 +5384,6 @@ import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" -import-fresh@^3.3.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.1.tgz#9cecb56503c0ada1f2741dbbd6546e4b13b57ccf" - integrity sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -5686,14 +5441,6 @@ invariant@^2.2.4: dependencies: loose-envify "^1.0.0" -ip-address@^9.0.5: - version "9.0.5" - resolved "https://registry.yarnpkg.com/ip-address/-/ip-address-9.0.5.tgz#117a960819b08780c3bd1f14ef3c1cc1d3f3ea5a" - integrity sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g== - dependencies: - jsbn "1.1.0" - sprintf-js "^1.1.3" - iron-webcrypto@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz#aa60ff2aa10550630f4c0b11fd2442becdb35a6f" @@ -6039,7 +5786,7 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" -is-weakref@^1.1.0: +is-weakref@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.1.1.tgz#eea430182be8d64174bd96bffbc46f21bf3f9293" integrity sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew== @@ -6083,7 +5830,7 @@ isexe@^2.0.0: resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== -isomorphic-fetch@^3.0.0, isomorphic-fetch@~3.0.0: +isomorphic-fetch@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4" integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA== @@ -6162,11 +5909,6 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsbn@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" - integrity sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A== - jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -6414,11 +6156,6 @@ lru-cache@^10.0.1, lru-cache@^10.2.0, lru-cache@^10.4.3: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== -lru-cache@^7.14.1: - version "7.18.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.18.3.tgz#f793896e0fd0e954a59dfdd82f0773808df6aa89" - integrity sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA== - math-intrinsics@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" @@ -6520,11 +6257,6 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707" integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== -mitt@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/mitt/-/mitt-3.0.1.tgz#ea36cf0cc30403601ae074c8f77b7092cdab36d1" - integrity sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw== - mixpanel-browser@2.49.0: version "2.49.0" resolved "https://registry.yarnpkg.com/mixpanel-browser/-/mixpanel-browser-2.49.0.tgz#de3f4f2d0f3a32b4babf6d827ef983a9fd48a711" @@ -6606,11 +6338,6 @@ neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -netmask@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7" - integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg== - next@14.1.0: version "14.1.0" resolved "https://registry.yarnpkg.com/next/-/next-14.1.0.tgz#b31c0261ff9caa6b4a17c5af019ed77387174b69" @@ -6722,7 +6449,7 @@ object-inspect@^1.13.1: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g== -object-inspect@^1.13.3: +object-inspect@^1.13.3, object-inspect@^1.13.4: version "1.13.4" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== @@ -6916,28 +6643,6 @@ p-locate@^6.0.0: dependencies: p-limit "^4.0.0" -pac-proxy-agent@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz#9cfaf33ff25da36f6147a20844230ec92c06e5df" - integrity sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA== - dependencies: - "@tootallnate/quickjs-emscripten" "^0.23.0" - agent-base "^7.1.2" - debug "^4.3.4" - get-uri "^6.0.1" - http-proxy-agent "^7.0.0" - https-proxy-agent "^7.0.6" - pac-resolver "^7.0.1" - socks-proxy-agent "^8.0.5" - -pac-resolver@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/pac-resolver/-/pac-resolver-7.0.1.tgz#54675558ea368b64d210fd9c92a640b5f3b8abb6" - integrity sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg== - dependencies: - degenerator "^5.0.0" - netmask "^2.0.2" - package-json-from-dist@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz#4f1471a010827a86f94cfd9b0727e36d267de505" @@ -6955,7 +6660,7 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -parse-json@^5.0.0, parse-json@^5.2.0: +parse-json@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== @@ -7024,11 +6729,6 @@ pathe@^1.1.1, pathe@^1.1.2: resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec" integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ== -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg== - performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -7197,11 +6897,6 @@ process-warning@^1.0.0: resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-1.0.0.tgz#980a0b25dc38cd6034181be4b7726d89066b4616" integrity sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q== -progress@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -7211,20 +6906,6 @@ prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2, object-assign "^4.1.1" react-is "^16.13.1" -proxy-agent@^6.5.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/proxy-agent/-/proxy-agent-6.5.0.tgz#9e49acba8e4ee234aacb539f89ed9c23d02f232d" - integrity sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A== - dependencies: - agent-base "^7.1.2" - debug "^4.3.4" - http-proxy-agent "^7.0.1" - https-proxy-agent "^7.0.6" - lru-cache "^7.14.1" - pac-proxy-agent "^7.1.0" - proxy-from-env "^1.1.0" - socks-proxy-agent "^8.0.5" - proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" @@ -7245,43 +6926,11 @@ pump@^2.0.0: end-of-stream "^1.1.0" once "^1.3.1" -pump@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.2.tgz#836f3edd6bc2ee599256c924ffe0d88573ddcbf8" - integrity sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== -puppeteer-core@24.6.1: - version "24.6.1" - resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-24.6.1.tgz#fc2ea21a49d6d8240cc959b729a12ba976ac140a" - integrity sha512-sMCxsY+OPWO2fecBrhIeCeJbWWXJ6UaN997sTid6whY0YT9XM0RnxEwLeUibluIS5/fRmuxe1efjb5RMBsky7g== - dependencies: - "@puppeteer/browsers" "2.10.0" - chromium-bidi "3.0.0" - debug "^4.4.0" - devtools-protocol "0.0.1425554" - typed-query-selector "^2.12.0" - ws "^8.18.1" - -puppeteer@^24.4.0: - version "24.6.1" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-24.6.1.tgz#828308e1e05654c4ca87399e677d10e3eeb32702" - integrity sha512-/4ocGfu8LNvDbWUqJZV2VmwEWpbOdJa69y2Jivd213tV0ekAtUh/bgT1hhW63SDN/CtrEucOPwoomZ+9M+eBEg== - dependencies: - "@puppeteer/browsers" "2.10.0" - chromium-bidi "3.0.0" - cosmiconfig "^9.0.0" - devtools-protocol "0.0.1425554" - puppeteer-core "24.6.1" - typed-query-selector "^2.12.0" - qs@6.14.0, qs@^6.7.0: version "6.14.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930" @@ -7547,12 +7196,12 @@ redeyed@~2.1.0: esprima "~4.0.0" redis@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/redis/-/redis-4.7.0.tgz#b401787514d25dd0cfc22406d767937ba3be55d6" - integrity sha512-zvmkHEAdGMn+hMRXuMBtu4Vo5P6rHQjLoHftu+lBqq8ZTA3RCVC/WzD790bkKKiNFp7d5/9PcSD19fJyyRvOdQ== + version "4.7.1" + resolved "https://registry.yarnpkg.com/redis/-/redis-4.7.1.tgz#08588a30936be0e7ad9c0f3e1ac6a85ccaf73e94" + integrity sha512-S1bJDnqLftzHXHP8JsT5II/CtHWQrASX5K96REjWjlmWKrviSOLWmM7QnRLstAWsu1VBBV1ffV6DzCvxNP0UJQ== dependencies: "@redis/bloom" "1.2.0" - "@redis/client" "1.6.0" + "@redis/client" "1.6.1" "@redis/graph" "1.1.1" "@redis/json" "1.0.7" "@redis/search" "1.2.0" @@ -7600,7 +7249,7 @@ regexp.prototype.flags@^1.5.1, regexp.prototype.flags@^1.5.2: es-errors "^1.3.0" set-function-name "^2.0.1" -regexp.prototype.flags@^1.5.3: +regexp.prototype.flags@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz#1ad6c62d44a259007e55b3970e00f746efbcaa19" integrity sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA== @@ -7782,11 +7431,6 @@ semver@^7.3.5, semver@^7.5.2, semver@^7.5.4, semver@^7.6.0, semver@^7.6.3: resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== -semver@^7.7.1: - version "7.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.1.tgz#abd5098d82b18c6c81f6074ff2647fd3e7220c9f" - integrity sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA== - server-only@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/server-only/-/server-only-0.0.1.tgz#0f366bb6afb618c37c9255a314535dc412cd1c9e" @@ -7936,28 +7580,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -smart-buffer@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" - integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== - -socks-proxy-agent@^8.0.5: - version "8.0.5" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz#b9cdb4e7e998509d7659d689ce7697ac21645bee" - integrity sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw== - dependencies: - agent-base "^7.1.2" - debug "^4.3.4" - socks "^2.8.3" - -socks@^2.8.3: - version "2.8.4" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.8.4.tgz#07109755cdd4da03269bda4725baa061ab56d5cc" - integrity sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ== - dependencies: - ip-address "^9.0.5" - smart-buffer "^4.2.0" - sonic-boom@^2.2.1: version "2.8.0" resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-2.8.0.tgz#c1def62a77425090e6ad7516aad8eb402e047611" @@ -7980,7 +7602,7 @@ source-map@^0.5.7: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== -source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -8021,11 +7643,6 @@ split2@^4.0.0: resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== -sprintf-js@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a" - integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA== - sshpk@^1.18.0: version "1.18.0" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.18.0.tgz#1663e55cddf4d688b86a46b77f0d5fe363aba028" @@ -8075,7 +7692,7 @@ stacktrace-js@^2.0.2: stack-generator "^2.0.5" stacktrace-gps "^3.0.4" -"starknet-types-07@npm:@starknet-io/types-js@^0.7.10", "starknet-types-07@npm:@starknet-io/types-js@^0.7.7": +"starknet-types-07@npm:@starknet-io/types-js@^0.7.7": version "0.7.10" resolved "https://registry.yarnpkg.com/@starknet-io/types-js/-/types-js-0.7.10.tgz#d21dc973d0cd04d7b6293ce461f2f06a5873c760" integrity sha512-1VtCqX4AHWJlRRSYGSn+4X1mqolI1Tdq62IwzoU2vUuEE72S1OlEeGhpvd6XsdqXcfHmVzYfj8k1XtKBQqwo9w== @@ -8099,23 +7716,6 @@ starknet@6.11.0: ts-mixer "^6.0.3" url-join "^4.0.1" -starknet@^6.11.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/starknet/-/starknet-6.24.1.tgz#87333339795038e93ef32a20726b5272ddb78fe1" - integrity sha512-g7tiCt73berhcNi41otlN3T3kxZnIvZhMi8WdC21Y6GC6zoQgbI2z1t7JAZF9c4xZiomlanwVnurcpyfEdyMpg== - dependencies: - "@noble/curves" "1.7.0" - "@noble/hashes" "1.6.0" - "@scure/base" "1.2.1" - "@scure/starknet" "1.1.0" - abi-wan-kanabi "^2.2.3" - fetch-cookie "~3.0.0" - isomorphic-fetch "~3.0.0" - lossless-json "^4.0.1" - pako "^2.0.4" - starknet-types-07 "npm:@starknet-io/types-js@^0.7.10" - ts-mixer "^6.0.3" - starknetkit@2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/starknetkit/-/starknetkit-2.4.0.tgz#922dacd4686755bdabe2dc1825c990aa5bf0195a" @@ -8152,6 +7752,14 @@ stop-iteration-iterator@^1.0.0: dependencies: internal-slot "^1.0.4" +stop-iteration-iterator@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz#f481ff70a548f6124d0312c3aa14cbfa7aa542ad" + integrity sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ== + dependencies: + es-errors "^1.3.0" + internal-slot "^1.1.0" + stream-shift@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.3.tgz#85b8fab4d71010fc3ba8772e8046cc49b8a3864b" @@ -8162,16 +7770,6 @@ streamsearch@^1.1.0: resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== -streamx@^2.15.0, streamx@^2.21.0: - version "2.22.0" - resolved "https://registry.yarnpkg.com/streamx/-/streamx-2.22.0.tgz#cd7b5e57c95aaef0ff9b2aef7905afa62ec6e4a7" - integrity sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw== - dependencies: - fast-fifo "^1.3.2" - text-decoder "^1.1.0" - optionalDependencies: - bare-events "^2.2.0" - strict-uri-encode@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" @@ -8451,33 +8049,6 @@ tapable@^2.2.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -tar-fs@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-3.0.8.tgz#8f62012537d5ff89252d01e48690dc4ebed33ab7" - integrity sha512-ZoROL70jptorGAlgAYiLoBLItEKw/fUxg9BSYK/dF/GAGYFJOJJJMvjPAKDJraCXFwadD456FCuvLWgfhMsPwg== - dependencies: - pump "^3.0.0" - tar-stream "^3.1.5" - optionalDependencies: - bare-fs "^4.0.1" - bare-path "^3.0.0" - -tar-stream@^3.1.5: - version "3.1.7" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-3.1.7.tgz#24b3fb5eabada19fe7338ed6d26e5f7c482e792b" - integrity sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ== - dependencies: - b4a "^1.6.4" - fast-fifo "^1.2.0" - streamx "^2.15.0" - -text-decoder@^1.1.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/text-decoder/-/text-decoder-1.2.3.tgz#b19da364d981b2326d5f43099c310cc80d770c65" - integrity sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA== - dependencies: - b4a "^1.6.4" - text-extensions@^2.0.0: version "2.4.0" resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-2.4.0.tgz#a1cfcc50cf34da41bfd047cc744f804d1680ea34" @@ -8565,7 +8136,7 @@ toggle-selection@^1.0.6: resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32" integrity sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ== -tough-cookie@^4.0.0, tough-cookie@^4.1.3: +tough-cookie@^4.1.3: version "4.1.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== @@ -8644,11 +8215,6 @@ tslib@2.7.0, tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3. resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01" integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== -tslib@^2.0.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" - integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -8777,11 +8343,6 @@ typed-array-length@^1.0.7: possible-typed-array-names "^1.0.0" reflect.getprototypeof "^1.0.6" -typed-query-selector@^2.12.0: - version "2.12.0" - resolved "https://registry.yarnpkg.com/typed-query-selector/-/typed-query-selector-2.12.0.tgz#92b65dbc0a42655fccf4aeb1a08b1dddce8af5f2" - integrity sha512-SbklCd1F0EiZOyPiW192rrHZzZ5sBijB6xM+cpmrwDqObvdtunOHHIk9fCGsoK5JVIYXoyEp4iEdE3upFH3PAg== - typescript@5: version "5.6.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.2.tgz#d1de67b6bef77c41823f822df8f0b3bcff60a5a0" @@ -9099,7 +8660,7 @@ which-typed-array@^1.1.13, which-typed-array@^1.1.14, which-typed-array@^1.1.15: gopd "^1.0.1" has-tostringtag "^1.0.2" -which-typed-array@^1.1.16, which-typed-array@^1.1.18: +which-typed-array@^1.1.16, which-typed-array@^1.1.19: version "1.1.19" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.19.tgz#df03842e870b6b88e117524a4b364b6fc689f956" integrity sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw== @@ -9206,7 +8767,7 @@ ws@8.17.1: resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== -ws@8.18.1, ws@^8.18.1: +ws@8.18.1: version "8.18.1" resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.1.tgz#ea131d3784e1dfdff91adb0a4a116b127515e3cb" integrity sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w== @@ -9254,14 +8815,6 @@ yargs@^17.7.2: y18n "^5.0.5" yargs-parser "^21.1.1" -yauzl@^2.10.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g== - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" - yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" @@ -9294,11 +8847,6 @@ zod@^3.22.4: resolved "https://registry.yarnpkg.com/zod/-/zod-3.23.8.tgz#e37b957b5d52079769fb8097099b592f0ef4067d" integrity sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g== -zod@^3.24.1: - version "3.24.2" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.2.tgz#8efa74126287c675e92f46871cfc8d15c34372b3" - integrity sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ== - zustand@^4.4.0: version "4.5.6" resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.5.6.tgz#6857d52af44874a79fb3408c9473f78367255c96" From ab6aa94877583bd57b504a684ae6f4ac8fe1d096 Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Fri, 30 May 2025 17:23:58 +0530 Subject: [PATCH 18/48] fix build --- package.json | 3 +++ src/strategies/auto_strk.strat.ts | 2 ++ src/strategies/auto_xstrk.strat.ts | 2 ++ src/strategies/delta_neutral_mm.ts | 2 ++ yarn.lock | 14 +++++++++++++- 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 30c34050..e52e0672 100755 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/strategies/auto_strk.strat.ts b/src/strategies/auto_strk.strat.ts index 575d091e..c0a08a68 100755 --- a/src/strategies/auto_strk.strat.ts +++ b/src/strategies/auto_strk.strat.ts @@ -77,6 +77,8 @@ export class AutoTokenStrategy extends IStrategy { ], protocols: [], maxTVL: new Web3Number('0', tokenInfo.decimals), + launchBlock: 0, + faqs: [], risk: { riskFactor: [], netRisk: 0, diff --git a/src/strategies/auto_xstrk.strat.ts b/src/strategies/auto_xstrk.strat.ts index cbb7995c..5bc77024 100644 --- a/src/strategies/auto_xstrk.strat.ts +++ b/src/strategies/auto_xstrk.strat.ts @@ -74,6 +74,8 @@ export class AutoXSTRKStrategy extends IStrategy { displayDecimals: tokenInfo.displayDecimals, }, ], + launchBlock: 0, + faqs: [], protocols: [], maxTVL: new Web3Number('0', tokenInfo.decimals), risk: { diff --git a/src/strategies/delta_neutral_mm.ts b/src/strategies/delta_neutral_mm.ts index ca143b5a..0209c146 100755 --- a/src/strategies/delta_neutral_mm.ts +++ b/src/strategies/delta_neutral_mm.ts @@ -84,6 +84,8 @@ export class DeltaNeutralMM extends IStrategy { displayDecimals: tokenInfo.displayDecimals, }, ], + launchBlock: 0, + faqs: [], protocols: [], maxTVL: new Web3Number('0', tokenInfo.decimals), risk: { diff --git a/yarn.lock b/yarn.lock index 1c406a0c..7cc310b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2162,7 +2162,7 @@ viem "^2.19.1" zod "^3.22.4" -"@strkfarm/sdk@^1.0.43": +"@strkfarm/sdk@1.0.43": version "1.0.43" resolved "https://registry.yarnpkg.com/@strkfarm/sdk/-/sdk-1.0.43.tgz#a022bc4c468a648382efeed741e208deaab2c89e" integrity sha512-H8c7sM4RVqsoojjJs8iQBligCPoW0dbRInNt6zpJQ3VY0J5e/+ZVfNiMn5XrD0Q1guf1+lNTEc3uDCzUd8gVqA== @@ -6194,6 +6194,11 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== +mime-db@^1.54.0: + version "1.54.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.54.0.tgz#cddb3ee4f9c64530dff640236661d42cb6a314f5" + integrity sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ== + mime-types@^2.1.12, mime-types@~2.1.19: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" @@ -6201,6 +6206,13 @@ mime-types@^2.1.12, mime-types@~2.1.19: dependencies: mime-db "1.52.0" +mime-types@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-3.0.1.tgz#b1d94d6997a9b32fd69ebaed0db73de8acb519ce" + integrity sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA== + dependencies: + mime-db "^1.54.0" + mime@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" From 5fdb00af0f06cfd3d1beb3c42a71e0616be2bac7 Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Fri, 30 May 2025 17:29:24 +0530 Subject: [PATCH 19/48] fix build --- src/utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index a16bfc0a..233879df 100755 --- a/src/utils.ts +++ b/src/utils.ts @@ -203,9 +203,10 @@ export function getHosturl() { if (typeof window !== 'undefined') { const hostname = window.location.hostname; // Check if hostname is an IPv4 or IPv6 address + // prettier-ignore const isIP = - /^(\d{1,3}\.){3}\d{1,3}$/.test(hostname) || // IPv4 - /^\[?([a-fA-F0-9:]+)\]?$/.test(hostname); // IPv6 (with or without brackets) + (/^(\d{1,3}\.){3}\d{1,3}$/).test(hostname) || // IPv4 + (/^\[?([a-fA-F0-9:]+)\]?$/).test(hostname); // IPv6 (with or without brackets) if (isIP) return FALLBACK; return hostname.split('.').slice(-2).join('.'); } From 4c67609a6126741d15d02f4c267046360bb8d7ff Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Fri, 30 May 2025 17:31:23 +0530 Subject: [PATCH 20/48] fix build --- src/utils.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 233879df..00f2e602 100755 --- a/src/utils.ts +++ b/src/utils.ts @@ -203,10 +203,11 @@ export function getHosturl() { if (typeof window !== 'undefined') { const hostname = window.location.hostname; // Check if hostname is an IPv4 or IPv6 address - // prettier-ignore + /* prettier-ignore */ + /* eslint-disable */ const isIP = - (/^(\d{1,3}\.){3}\d{1,3}$/).test(hostname) || // IPv4 - (/^\[?([a-fA-F0-9:]+)\]?$/).test(hostname); // IPv6 (with or without brackets) + /^(\d{1,3}\.){3}\d{1,3}$/.test(hostname) || // IPv4 + /^\[?([a-fA-F0-9:]+)\]?$/.test(hostname); // IPv6 (with or without brackets) if (isIP) return FALLBACK; return hostname.split('.').slice(-2).join('.'); } From d31fc3e1dc24fd0784e5c71954d2435d7f081e4d Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Fri, 30 May 2025 17:38:32 +0530 Subject: [PATCH 21/48] fix bug --- src/app/strategy/[strategyId]/_components/Strategy.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index 7f8c5b81..651461bb 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -66,7 +66,6 @@ function HoldingsText({ if (balData.isLoading || !balData.data?.tokenInfo) { return ( <> - {balData.isLoading ? 'loading' : JSON.stringify(balData.data)} ); From cdf4227bfbb8e6013409660c9e206c864a2487c5 Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Sat, 31 May 2025 23:32:06 +0530 Subject: [PATCH 22/48] undo vesu maintenance --- src/store/strategies.atoms.tsx | 84 +++++++++++++++++----------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/store/strategies.atoms.tsx b/src/store/strategies.atoms.tsx index d9edd2f8..7ac0b237 100755 --- a/src/store/strategies.atoms.tsx +++ b/src/store/strategies.atoms.tsx @@ -194,33 +194,33 @@ export function getStrategies() { { maxTVL: 500000, alerts: [ - { - type: 'warning', - text: ( -

- Note: Vesu has recently migrated. Deposits and - withdrawals for this strategy are temporarily paused until we - migrate this strategy.{' '} - - Learn more - - . -

- ), - tab: 'all', - }, + // { + // type: 'warning', + // text: ( + //

+ // Note: Vesu has recently migrated. Deposits and + // withdrawals for this strategy are temporarily paused until we + // migrate this strategy.{' '} + // + // Learn more + // + // . + //

+ // ), + // tab: 'all', + // }, { type: 'info', text: 'Depeg-risk: If xSTRK price on DEXes deviates from expected price, you may lose money or may have to wait for the price to recover.', tab: 'all', }, ], - isPaused: true, - isInMaintenance: true, + isPaused: false, + isInMaintenance: false, isAudited: false, quoteToken: convertToV2TokenInfo(getTokenInfoFromName('STRK')), }, @@ -237,28 +237,28 @@ export function getStrategies() { maxTVL: 0, isAudited: v.auditUrl ? true : false, auditUrl: v.auditUrl, - isPaused: true, - isInMaintenance: true, + isPaused: false, + isInMaintenance: false, alerts: [ - { - type: 'warning', - text: ( -

- Note: Vesu has recently migrated. Deposits and - withdrawals for this strategy are temporarily paused until we - migrate this strategy.{' '} - - Learn more - - . -

- ), - tab: 'all', - }, + // { + // type: 'warning', + // text: ( + //

+ // Note: Vesu has recently migrated. Deposits and + // withdrawals for this strategy are temporarily paused until we + // migrate this strategy.{' '} + // + // Learn more + // + // . + //

+ // ), + // tab: 'all', + // }, ], quoteToken: convertToV2TokenInfo( getTokenInfoFromName(v.depositTokens[0]?.symbol || ''), From eab81a9f78e084d2a84bce30667fcd6f00e7867c Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Wed, 4 Jun 2025 19:22:27 +0530 Subject: [PATCH 23/48] switch fusion vaults to active --- src/store/strategies.atoms.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/strategies.atoms.tsx b/src/store/strategies.atoms.tsx index 7ac0b237..cfc8ef65 100755 --- a/src/store/strategies.atoms.tsx +++ b/src/store/strategies.atoms.tsx @@ -232,7 +232,7 @@ export function getStrategies() { v.name, v.description as string, v, - StrategyLiveStatus.HOT, + StrategyLiveStatus.ACTIVE, { maxTVL: 0, isAudited: v.auditUrl ? true : false, From d220f5d0c335ec206918f7ab18bf37703edb4b3d Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Mon, 9 Jun 2025 03:16:05 +0530 Subject: [PATCH 24/48] add points --- package.json | 2 +- src/components/YieldCard.tsx | 45 ++++++++++++++++++- src/store/strategies.atoms.tsx | 2 +- src/strategies/delta_neutral_mm_vesu_endur.ts | 8 ++++ yarn.lock | 36 ++++++--------- 5 files changed, 66 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index e52e0672..e57f4cc8 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.43", + "@strkfarm/sdk": "^1.0.45", "@tanstack/query-core": "5.28.0", "@types/mixpanel-browser": "2.49.0", "@types/mustache": "4.2.5", diff --git a/src/components/YieldCard.tsx b/src/components/YieldCard.tsx index 770adeb4..0f573555 100644 --- a/src/components/YieldCard.tsx +++ b/src/components/YieldCard.tsx @@ -2,6 +2,7 @@ import shield from '@/assets/shield.svg'; import { addressAtom } from '@/store/claims.atoms'; import { isPoolRetired, PoolInfo } from '@/store/pools'; import { getPoolInfoFromStrategy, sortAtom } from '@/store/protocols'; +import { strategiesAtom } from '@/store/strategies.atoms'; import { STRKFarmStrategyAPIResult } from '@/store/strkfarm.atoms'; import { UserStats, userStatsAtom } from '@/store/utils.atoms'; import { isLive, StrategyLiveStatus } from '@/strategies/IStrategy'; @@ -182,12 +183,47 @@ function getAPRWithToolTip(pool: PoolInfo) { ); } +function PointsMultiplier(props: { + points: { multiplier: number; logo: string; toolTip?: string }[]; +}) { + const { points } = props; + return ( + + + {points.map((point, index) => ( + + + + {point.multiplier}x + Points + + + + + ))} + + + ); +} + function StrategyAPY(props: YieldCardProps) { const { pool } = props; const isRetired = useMemo(() => { return isPoolRetired(pool); }, [pool]); + const strategies = useAtomValue(strategiesAtom); + + const strategy = useMemo(() => { + return strategies.find((s) => s.id === pool.pool.id); + }, [strategies, pool.pool.id]); + return ( {isRetired ? ( @@ -195,7 +231,7 @@ function StrategyAPY(props: YieldCardProps) { - ) : ( - <> + {getAPRWithToolTip(pool)} {pool.aprSplits.length && @@ -222,7 +258,10 @@ function StrategyAPY(props: YieldCardProps) { )} - + {strategy != undefined && strategy.metadata.points != undefined && ( + + )} + )}
); @@ -278,6 +317,7 @@ export function StrategyTVL(props: YieldCardProps) { flexDirection={'column'} justifyContent={'center'} alignItems={'flex-end'} + position={'relative'} > {isPoolLive && ( @@ -514,6 +554,7 @@ export default function YieldCard(props: YieldCardProps) { const isRetired = useMemo(() => { return isPoolRetired(pool); }, [pool]); + return ( <> { + const ekuboCLStrats = [EkuboCLVaultStrategies[0]].map((v) => { return new EkuboClStrategy( v.name, v.description as ReactNode, diff --git a/src/strategies/delta_neutral_mm_vesu_endur.ts b/src/strategies/delta_neutral_mm_vesu_endur.ts index 84332ab0..3b2b5d05 100644 --- a/src/strategies/delta_neutral_mm_vesu_endur.ts +++ b/src/strategies/delta_neutral_mm_vesu_endur.ts @@ -48,6 +48,14 @@ export class DeltaNeutralMMVesuEndur extends DeltaNeutralMM { vesu, ); + this.metadata.points = [ + { + multiplier: 3, + toolTip: + 'Earn ~3x Endur points on this leveraged strategy. Points can be found on endur.fi.', + logo: 'https://endur.fi/favicon.ico', + }, + ]; const risks = [this.risks[0], this.risks[2]]; if (this.settings.alerts && this.settings.alerts.length > 0) { risks.push( diff --git a/yarn.lock b/yarn.lock index 7cc310b8..955e3a9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2162,19 +2162,17 @@ viem "^2.19.1" zod "^3.22.4" -"@strkfarm/sdk@1.0.43": - version "1.0.43" - resolved "https://registry.yarnpkg.com/@strkfarm/sdk/-/sdk-1.0.43.tgz#a022bc4c468a648382efeed741e208deaab2c89e" - integrity sha512-H8c7sM4RVqsoojjJs8iQBligCPoW0dbRInNt6zpJQ3VY0J5e/+ZVfNiMn5XrD0Q1guf1+lNTEc3uDCzUd8gVqA== +"@strkfarm/sdk@^1.0.45": + version "1.0.45" + resolved "https://registry.yarnpkg.com/@strkfarm/sdk/-/sdk-1.0.45.tgz#995b4c45c18acd2163d8ecc2a7541cdbe4c9825e" + integrity sha512-YyoRx8Kr1BYJ9rMRthnFArp44HWW8e9Nn5eYxIzPFfVeVWwp2nTAgFLwOJbHgfB5nZZjIUTziQA64zbrFrapYg== dependencies: "@avnu/avnu-sdk" "^3.0.2" - axios "^1.7.2" bignumber.js "4.0.4" browser-assert "^1.2.1" chalk "^4.1.2" commander "^12.1.0" ethers "^6.13.5" - form-data "^4.0.2" inquirer "^10.1.2" node-telegram-bot-api "^0.66.0" proxy-from-env "^1.1.0" @@ -2302,9 +2300,9 @@ "@types/node" "*" "@types/node@*", "@types/node@^22.5.5": - version "22.15.27" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.27.tgz#b99cd64129c4c85a69edca903af9b3aa72c3b4f7" - integrity sha512-5fF+eu5mwihV2BeVtX5vijhdaZOfkQTATrePEaXTcKqI16LhJ7gi2/Vhd9OZM0UojcdmiOCVg5rrax+i1MdoQQ== + version "22.15.30" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.30.tgz#3a20431783e28dd0b0326f84ab386a2ec81d921d" + integrity sha512-6Q7lr06bEHdlfplU6YRbgG1SFBdlsfNC4/lX+SkhiTs0cpJkOElmWls8PxDFv4yY/xKb8Y6SO0OmSX4wgqTZbA== dependencies: undici-types "~6.21.0" @@ -3162,15 +3160,6 @@ axios@1.6.7: form-data "^4.0.0" proxy-from-env "^1.1.0" -axios@^1.7.2: - version "1.9.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.9.0.tgz#25534e3b72b54540077d33046f77e3b8d7081901" - integrity sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg== - dependencies: - follow-redirects "^1.15.6" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - axobject-query@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-4.1.0.tgz#28768c76d0e3cff21bc62a9e2d0b6ac30042a1ee" @@ -4815,7 +4804,7 @@ focus-lock@^1.3.5: dependencies: tslib "^2.0.3" -follow-redirects@^1.15.4, follow-redirects@^1.15.6: +follow-redirects@^1.15.4: version "1.15.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== @@ -4856,14 +4845,15 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -form-data@^4.0.2, form-data@~4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.2.tgz#35cabbdd30c3ce73deb2c42d3c8d3ed9ca51794c" - integrity sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w== +form-data@~4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.3.tgz#608b1b3f3e28be0fccf5901fc85fb3641e5cf0ae" + integrity sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" es-set-tostringtag "^2.1.0" + hasown "^2.0.2" mime-types "^2.1.12" framer-motion@11.0.5: From 3bd8319acaffb9905c85936fe36dea2bd3c6befc Mon Sep 17 00:00:00 2001 From: Oche Date: Thu, 19 Jun 2025 14:55:17 +0100 Subject: [PATCH 25/48] mobile view changes --- src/app/globals.css | 4 +- src/app/page.tsx | 58 +- .../[strategyId]/_components/DetailsTab.tsx | 75 +- .../[strategyId]/_components/FAQTab.tsx | 99 +- .../[strategyId]/_components/ManageTab.tsx | 75 +- .../[strategyId]/_components/RiskTab.tsx | 75 +- .../[strategyId]/_components/Strategy.tsx | 1009 +++++++++++------ .../_components/TransactionsTab.tsx | 111 +- src/app/template.tsx | 6 +- src/components/Deposit.tsx | 10 +- src/components/Filters.tsx | 447 +++++++- src/components/Pools.tsx | 7 +- src/components/TVL.tsx | 32 +- src/components/YieldCard.tsx | 166 ++- 14 files changed, 1690 insertions(+), 484 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 9b3deab6..1c122d65 100755 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -17,7 +17,9 @@ } body { - color: rgb(var(--foreground-rgb)); + /* color: rgb(var(--foreground-rgb)); */ + color: #fff; + background-color: #fff; } @layer utilities { diff --git a/src/app/page.tsx b/src/app/page.tsx index 64ab02bf..e5c0d86b 100755 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -15,7 +15,6 @@ import { Container, Link, Tab, - TabIndicator, TabList, TabPanel, TabPanels, @@ -93,12 +92,20 @@ export default function Home() { }, [searchParams]); return ( - - + + @@ -108,7 +115,8 @@ export default function Home() { Identify & Invest in the best $STRK rewarding pools and maximize your @@ -126,10 +134,15 @@ export default function Home() { onChange={handleTabsChange} marginTop={'10px'} > - + { mixpanel.track('Strategies opened'); }} @@ -137,8 +150,13 @@ export default function Home() { Strategies✨ { mixpanel.track('All pools clicked'); }} @@ -146,14 +164,6 @@ export default function Home() { Find yields - @@ -171,7 +184,10 @@ export default function Home() { float={'left'} borderWidth={'1px'} borderColor={'slate_blue'} - borderRadius={'8px'} + borderTopLeftRadius={{ base: '0px', md: '8px' }} + borderTopRightRadius={{ base: '0px', md: '8px' }} + borderBottomLeftRadius={{ base: '8px' }} + borderBottomRightRadius={{ base: '8px' }} > diff --git a/src/app/strategy/[strategyId]/_components/DetailsTab.tsx b/src/app/strategy/[strategyId]/_components/DetailsTab.tsx index 161a2a93..6429543e 100644 --- a/src/app/strategy/[strategyId]/_components/DetailsTab.tsx +++ b/src/app/strategy/[strategyId]/_components/DetailsTab.tsx @@ -7,10 +7,77 @@ import loopAction from '@/assets/loopAction.svg'; interface DetailsTabProps { strategy: STRKFarmStrategyAPIResult; + isMobile?: boolean; } export function DetailsTab(props: DetailsTabProps) { - const { strategy } = props; + const { strategy, isMobile } = props; + + if (isMobile) { + return ( + + + + Behind the scenes + + + Actions done automatically by the strategy (smart-contract) with an + investment of $1000 + + + {strategy.actions.length > 0 ? ( + strategy.actions.map((action, index) => ( + + {action.name.toLowerCase().includes('stake') || + action.name.toLowerCase().includes('supply') ? ( + + ) : action.name.toLowerCase().includes('borrow') ? ( + + ) : ( + + )} + + {action.name} + + + )) + ) : ( + + No actions found + + )} + + + + + + + ); + } return ( @@ -51,11 +118,11 @@ export function DetailsTab(props: DetailsTabProps) { > {action.name.toLowerCase().includes('stake') || action.name.toLowerCase().includes('supply') ? ( - + ) : action.name.toLowerCase().includes('borrow') ? ( - + ) : ( - + )} {action.name} diff --git a/src/app/strategy/[strategyId]/_components/FAQTab.tsx b/src/app/strategy/[strategyId]/_components/FAQTab.tsx index 44e67203..8dbecf7e 100644 --- a/src/app/strategy/[strategyId]/_components/FAQTab.tsx +++ b/src/app/strategy/[strategyId]/_components/FAQTab.tsx @@ -14,10 +14,107 @@ import { StrategyInfo } from '@/store/strategies.atoms'; interface FAQTabProps { strategy: StrategyInfo; + isMobile?: boolean; } export function FAQTab(props: FAQTabProps) { - const { strategy } = props; + const { strategy, isMobile } = props; + + if (isMobile) { + return ( + + + + Get to know about all your doubts + + + {strategy.metadata.faqs && strategy.metadata.faqs.length > 0 ? ( + strategy.metadata.faqs.map((faq, index) => ( + + + + {faq.question} + + + + + {faq.answer} + + + )) + ) : ( + + No FAQs at the moment + + )} + + + + + For more queries reach out to us on Telegram + + + Our team will respond to you soon! + + + + + + + ); + } return ( diff --git a/src/app/strategy/[strategyId]/_components/ManageTab.tsx b/src/app/strategy/[strategyId]/_components/ManageTab.tsx index 5e5edc81..becf5ff5 100644 --- a/src/app/strategy/[strategyId]/_components/ManageTab.tsx +++ b/src/app/strategy/[strategyId]/_components/ManageTab.tsx @@ -6,6 +6,7 @@ import { Tooltip, UnorderedList, } from '@chakra-ui/react'; +import React from 'react'; import { StrategyInfo } from '@/store/strategies.atoms'; import { getRiskExplaination } from '@strkfarm/sdk'; @@ -13,10 +14,82 @@ import { TokenDeposit } from './TokenDeposit'; interface ManageTabProps { strategy: StrategyInfo; + isMobile?: boolean; } export function ManageTab(props: ManageTabProps) { - const { strategy } = props; + const { strategy, isMobile } = props; + + if (isMobile) { + return ( + + + {!strategy || + (strategy.isSingleTokenDepositView && ( + + ))} + {strategy && !strategy.isSingleTokenDepositView && ( + + )} + + + + + How does it work? + + + + Deposit USDC to automatically loop funds between zkLend and + Nostra. + + + Creates a delta-neutral position to maximize USDC yield. + + + Position is periodically adjusted to maintain a healthy health + factor + + + Receive an NFT as representation for your stake on STRKFarm. + + + Withdraw anytime by redeeming your NFT for USDC. + + + + + + Risk + + {strategy.metadata.risk.riskFactor.map((r: any, i: number) => ( + + + {r.type.valueOf()} + + + ))} + + + + ); + } return ( diff --git a/src/app/strategy/[strategyId]/_components/RiskTab.tsx b/src/app/strategy/[strategyId]/_components/RiskTab.tsx index 04a7d254..87775496 100644 --- a/src/app/strategy/[strategyId]/_components/RiskTab.tsx +++ b/src/app/strategy/[strategyId]/_components/RiskTab.tsx @@ -1,12 +1,83 @@ -import { Badge, Flex, ListItem, OrderedList } from '@chakra-ui/react'; +import { + Badge, + Flex, + ListItem, + OrderedList, + Box, + Text, +} from '@chakra-ui/react'; import { StrategyInfo } from '@/store/strategies.atoms'; interface RiskTabProps { strategy: StrategyInfo; + isMobile?: boolean; } export function RiskTab(props: RiskTabProps) { - const { strategy } = props; + const { strategy, isMobile } = props; + + if (isMobile) { + return ( + + + + Risk + + + {strategy.risks.map((r, index) => ( + + + {r} + + {index === 0 && ( + + {strategy.riskFactor <= 2 + ? 'Low' + : strategy.riskFactor < 4 + ? 'Medium' + : 'High'}{' '} + risk + + )} + + ))} + + + + ); + } return ( diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index 66522607..6a0575f0 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -19,8 +19,13 @@ import { TabIndicator, Text, Tooltip, + Accordion, + AccordionItem, + AccordionButton, + AccordionPanel, + AccordionIcon, } from '@chakra-ui/react'; -import { ArrowBackIcon } from '@chakra-ui/icons'; +import { ArrowBackIcon, ExternalLinkIcon } from '@chakra-ui/icons'; import { atom, useAtomValue, useSetAtom } from 'jotai'; import mixpanel from 'mixpanel-browser'; import { useCallback, useEffect, useMemo, useState } from 'react'; @@ -53,6 +58,7 @@ const Strategy = ({ params }: StrategyParams) => { const router = useRouter(); const searchParams = useSearchParams(); const [tabIndex, setTabIndex] = useState(0); + const [accordionIndex, setAccordionIndex] = useState(0); function setRoute(value: string) { router.push(`?tab=${value}`); @@ -224,278 +230,352 @@ const Strategy = ({ params }: StrategyParams) => { if (!isMounted) return null; return ( - - + - - - - - - - - - {strategy && ( - - - - - {strategy && - strategy.metadata.depositTokens.length > 0 && - strategy.metadata.depositTokens.map((token: any) => { - return ( + + + + + + + + + + {strategy && ( + + + + + {strategy && + strategy.metadata.depositTokens.length > 0 && + strategy.metadata.depositTokens.map((token: any) => { + return ( + + ); + })} + {strategy && + strategy.metadata.depositTokens.length == 0 && ( - ); - })} - {strategy && - strategy.metadata.depositTokens.length == 0 && ( - - )} - - - {strategy ? strategy.name : 'Strategy Not found'} - - - badge - - - - - - - Your Holdings: + )} + + + {strategy ? strategy.name : 'Strategy Not found'} + + badge + + - {!balData.isLoading && - !balData.isError && - !balData.isPending && - balData.data && - balData.data.tokenInfo && ( - - {address - ? Number( - balData.data.amount.toEtherToFixedDecimals( - balData.data.tokenInfo?.displayDecimals || - 2, - ), - ) === 0 || strategy?.isRetired() - ? '-' - : `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : 'Connect wallet'} - - )} - - {(balData.isLoading || - balData.isPending || - (!balData.data?.tokenInfo && !balData.isError)) && ( - - {address ? : 'Connect wallet'} + + + + Your Holdings: - )} - {balData.isError && - !balData.isLoading && - !balData.isPending && ( + {!balData.isLoading && + !balData.isError && + !balData.isPending && + balData.data && + balData.data.tokenInfo && ( + + {address + ? Number( + balData.data.amount.toEtherToFixedDecimals( + balData.data.tokenInfo?.displayDecimals || + 2, + ), + ) === 0 || strategy?.isRetired() + ? '-' + : `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` + : 'Connect wallet'} + + )} + + {(balData.isLoading || + balData.isPending || + (!balData.data?.tokenInfo && !balData.isError)) && ( - Error + {address ? : 'Connect wallet'} )} - {/* Show individual holdings is more tokens */} - {individualBalances.length > 1 && - balData.data?.amount.compare('0', 'gt') && ( - - -

Detailed Split:

- {individualBalances.map((bx, index) => { - return ( - - {bx?.amount.toEtherToFixedDecimals( - bx.tokenInfo?.displayDecimals || 2, - )}{' '} - {bx?.tokenInfo?.name} - - ); - })} -
-
- )} - - {/* {address && - balData.data && - strategy.id === 'xstrk_sensei' && - profit < 0 && - profit / - Number(balData.data.amount.toEtherToFixedDecimals(6)) < - -0.01 && ( - - - Why did my holdings drop?{' '} - + )} + + {/* Show individual holdings is more tokens */} + {individualBalances.length > 1 && + balData.data?.amount.compare('0', 'gt') && ( + + +

Detailed Split:

+ {individualBalances.map((bx, index) => { + return ( + + {bx?.amount.toEtherToFixedDecimals( + bx.tokenInfo?.displayDecimals || 2, + )}{' '} + {bx?.tokenInfo?.name} + + ); + })} +
+
+ )} + + {/* {address && + balData.data && + strategy.id === 'xstrk_sensei' && + profit < 0 && + profit / + Number(balData.data.amount.toEtherToFixedDecimals(6)) < + -0.01 && ( + - Learn more -
-
- )} */} -
- - - + Why did my holdings drop?{' '} + + Learn more + + + )} */} + + + - Net earnings -
+ + Net earnings + - {!balData.isLoading && - !balData.isError && - !balData.isPending && - balData.data && - balData.data.tokenInfo && ( - - 0 - ? 'cyan' - : profit < 0 - ? 'red' - : 'text' + {!balData.isLoading && + !balData.isError && + !balData.isPending && + balData.data && + balData.data.tokenInfo && ( + - {address && profit !== 0 && !strategy?.isRetired() - ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : '-'} - - - )} + 0 + ? 'cyan' + : profit < 0 + ? 'red' + : 'text' + } + fontSize={'18px'} + fontWeight={'700'} + > + {address && + profit !== 0 && + !strategy?.isRetired() && + balData.data && + balData.data.tokenInfo + ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` + : '-'} + + + )} +
-
- - - {!strategy?.isRetired() && ( - - )} + + + {!strategy?.isRetired() && ( + + )} + - - )} + )} + + + + { + mixpanel.track('Manage clicked'); + }} + > + Manage + + { + mixpanel.track('Risk clicked'); + }} + > + Risk + + { + mixpanel.track('Details clicked'); + }} + > + Details + + { + mixpanel.track('FAQs clicked'); + }} + > + FAQs + + { + mixpanel.track('Transactions clicked'); + }} + > + Transactions + + + + +
+
+ { index={tabIndex} onChange={handleTabsChange} > - - { - mixpanel.track('Manage clicked'); - }} - > - Manage - - { - mixpanel.track('Risk clicked'); - }} - > - Risk - - { - mixpanel.track('Details clicked'); - }} - > - Details - - { - mixpanel.track('FAQs clicked'); - }} - > - FAQs - - { - mixpanel.track('Transactions clicked'); - }} - > - Transactions - - - + + + {strategy && } + + + + {strategy && } + + + + {strategyCached && } + + + + {strategy && } + + + + {strategy && ( + + )} + +
+
+ + {/* MOBILE VIEW */} + + + + + + - - + + + {strategy?.name} + + {strategy?.settings.isAudited && ( + + badge + + )} + + + + + + + APY + + + {strategyCached?.apySplit?.baseApy + ? `${(strategyCached.apySplit.baseApy * 100).toFixed(2)}%` + : '23.94%'} + + + + + 🔥 + + {strategyCached?.leverage + ? `${strategyCached.leverage.toFixed(2)}x boosted` + : '1.96x boosted'} + + + + Contract details + + + + + + + Your holdings: + + + {address && balData && balData.data && balData.data.tokenInfo + ? `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)}${balData.data.tokenInfo?.name}` + : '-'} + + + - - - {strategy && } - - - - {strategy && } - - - - {strategyCached && } - - - - {strategy && } - - - - {strategy && ( - - )} - - - + + Your earnings: + + + {address && profit !== 0 && balData.data && balData.data.tokenInfo + ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` + : '-'} + + - -
+ + {/* Next Harvest card with countdown only */} + {/* + + Next Harvest in: + + + + + */} + + {/* Harvest stats card (only once, at the bottom) */} + + + Total rewards harvested: $50 0 + + + Total number of times harvested: 48 + + + + {/* */} + {/* Mobile vertical accordion for sections */} + { + if (Array.isArray(expandedIndex)) { + setAccordionIndex(expandedIndex[0] ?? 0); + } else { + setAccordionIndex(expandedIndex); + } + }} + allowToggle + width="100%" + marginTop={'8px'} + > + + + + Manage + + + + + {strategy && } + + + + + + Risk + + + + + {strategy && } + + + + + + Details + + + + + {strategyCached && ( + + )} + + + + + + FAQs + + + + + {strategy && } + + + + + + Transactions + + + + + {strategy && ( + + )} + + + + + {/*
*/} + ); }; diff --git a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx index e2fe163a..60ab6df4 100644 --- a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx +++ b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx @@ -36,11 +36,120 @@ interface TransactionsTabProps { __typename: 'Investment_flows'; }[]; }; + isMobile?: boolean; } export function TransactionsTab(props: TransactionsTabProps) { const { address } = useAccount(); - const { strategy, txHistory } = props; + const { strategy, txHistory, isMobile } = props; + + if (isMobile) { + return ( + + + Transaction history + + {!strategy.settings.isTransactionHistDisabled && ( + + There may be delays fetching data. If your transaction isn't + found, try again later. + + )} + {address ? ( + txHistory.findManyInvestment_flows.length !== 0 ? ( + + {txHistory.findManyInvestment_flows.map((tx, index) => { + const token = getTokenInfoFromAddr(tx.asset); + const decimals = token?.decimals; + const isDeposit = tx.type === 'deposit'; + return ( + + + + {isDeposit ? ( + + ) : ( + + )} + + + {isDeposit ? 'Deposited' : 'Withdrawn'} + + + + Amount:{' '} + {Number( + new MyNumber( + tx.amount, + decimals!, + ).toEtherToFixedDecimals(token.displayDecimals), + ).toLocaleString()}{' '} + {token?.name} + + + Wallet:{' '} + + {shortAddress(tx.txHash)} + + + + {timeAgo(new Date(tx.timestamp * 1000))} + + + ); + })} + + ) : ( + + No transactions found + + ) + ) : ( + + Connect your wallet to view transaction history + + )} + {strategy.settings.isTransactionHistDisabled && ( + + Transaction history is not available for this strategy yet. If + enabled in future, will include the entire history. + + )} + + ); + } return ( diff --git a/src/app/template.tsx b/src/app/template.tsx index 2b878f49..7aa0a8ce 100755 --- a/src/app/template.tsx +++ b/src/app/template.tsx @@ -86,6 +86,10 @@ const theme = extendTheme({ disabled_button: '#2A2A3D80', disabled_button_text: '#7D7D93', + + dark_bg: '#111119', + purple_tint: '#CFCFEA', + lavender_gray: '#B4B1BD', }, fontSizes: { large: '50px', @@ -150,7 +154,7 @@ export default function Template({ children }: { children: React.ReactNode }) { connectors={getConnectors(isMobile)} > - + ( null, ); + useEffect(() => { if (!callsInfo.length) { setInvestedSummary(null); @@ -294,16 +295,19 @@ function InternalDeposit(props: DepositProps) { ); }, [tvlInfo]); + console.log('canSubmit [2]', investedSummary, loadingInvestmentSummary); const canSubmit = useMemo(() => { + console.log('canSubmit [1]', isTVLFull, isDeposit, depositInfo.loading); if (isTVLFull && isDeposit) { return false; } if (depositInfo.loading) { return false; } - if (!investedSummary || loadingInvestmentSummary) { - return false; - } + + // if (!investedSummary || loadingInvestmentSummary) { + // return false; + // } // todo consider max cap of each token as well return inputsInfo.some((a) => a.amount.greaterThan(0)); }, [ diff --git a/src/components/Filters.tsx b/src/components/Filters.tsx index d1757882..31accb78 100755 --- a/src/components/Filters.tsx +++ b/src/components/Filters.tsx @@ -9,8 +9,13 @@ import { TagLabel, Text, Tooltip, + Menu, + MenuButton, + MenuList, + MenuItem, + Button, } from '@chakra-ui/react'; -import { CloseIcon } from '@chakra-ui/icons'; +import { CloseIcon, ChevronDownIcon } from '@chakra-ui/icons'; import { ALL_FILTER, filterAtoms, @@ -50,10 +55,12 @@ export function ProtocolFilters() { - {/* Clear all or select all button */} - *': { - color: 'black', - }, - }} - onClick={() => { - updateFilters( - 'protocols', - atleastOneProtocolSelected() ? [] : [ALL_FILTER], - ); - mixpanel.track('Clear/Select all protocols', { - atleastOneProtocolSelected: atleastOneProtocolSelected(), - }); - }} + - + } + display={{ base: 'flex', md: 'none' }} + width={{ base: '100%' }} + bg="transparent" + color="white" + borderWidth="1px" + borderColor="slate_blue" + borderRadius="md" + padding="12px" + fontSize="14px" + fontWeight="normal" + size="lg" + _hover={{ + bg: 'purple_hover_2', + '& > *': { + color: 'black', + }, + }} + > + + Protocols + + {getSelectedProtocolsCount()} + + + + + {filters.protocols.map((p) => ( + { + const selectedProtocols = protocolsFilter.includes(ALL_FILTER) + ? [] + : protocolsFilter; + + let updatedProtocols = []; + if (selectedProtocols.includes(p.name)) { + updatedProtocols = selectedProtocols.filter( + (x) => x !== p.name, + ); + } else { + updatedProtocols = [...selectedProtocols, p.name]; + } + if (updatedProtocols.length === filters.protocols.length) { + updatedProtocols = [ALL_FILTER]; + } + mixpanel.track('Protocol Filter', { + protocol: p.name, + selected: + updatedProtocols.includes(p.name) || + updatedProtocols.includes(ALL_FILTER), + updatedProtocols: JSON.stringify(updatedProtocols), + }); + updateFilters('protocols', updatedProtocols); + }} + > + + + {p.name} + {/* {isProtocolSelected(p.name) && ( + + ✓ + + )} */} + + + ))} + + + + {/* Clear all or select all button */} + *': { + color: 'black', + }, + }} + onClick={() => { + updateFilters( + 'protocols', + atleastOneProtocolSelected() ? [] : [ALL_FILTER], + ); + mixpanel.track('Clear/Select all protocols', { + atleastOneProtocolSelected: atleastOneProtocolSelected(), + }); + }} > - {getSelectedProtocolsCount()} - - - {atleastOneProtocolSelected() ? 'Clear filters' : 'Select all'} - - + + {getSelectedProtocolsCount()} + + + {atleastOneProtocolSelected() ? 'Clear filters' : 'Select all'} + + + + + {/* Selected protocols list for mobile */} + + {(protocolsFilter.includes(ALL_FILTER) + ? filters.protocols + : filters.protocols.filter((p) => protocolsFilter.includes(p.name)) + ).map((p) => ( + + ))} +
); } @@ -286,7 +420,8 @@ export function CategoryFilters() { return ( - + {/* Desktop category filters */} + {/* Stable pools */} + + {/* Mobile dropdown for category filters */} + + + } + bg="transparent" + color="white" + borderWidth="1px" + borderColor="slate_blue" + borderRadius="md" + padding="12px" + size="lg" + fontSize="14px" + fontWeight="normal" + _hover={{ + bg: 'purple_hover_2', + '& > *': { + color: 'black', + }, + }} + > + Categories + + + updateCategory(Category.Stable)} + > + + {Category.Stable.valueOf().split(' ')[0]} + {categoriesFilter.includes(Category.Stable.valueOf()) && ( + + ✓ + + )} + + + updateCategory(Category.STRK)} + > + + {Category.STRK.valueOf().split(' ')[0]} + {categoriesFilter.includes(Category.STRK.valueOf()) && ( + + ✓ + + )} + + + updateCategory(Category.ETH)} + > + + {Category.ETH.valueOf().split(' ')[0]} + {categoriesFilter.includes(Category.ETH.valueOf()) && ( + + ✓ + + )} + + + updateRiskLevel(['1', '2'])} + > + + Low risk + {isLowRisk() && ( + + ✓ + + )} + + + + + + + } + bg="transparent" + color="white" + borderWidth="1px" + borderColor="slate_blue" + borderRadius="md" + padding="12px" + size="lg" + fontSize="14px" + fontWeight="normal" + _hover={{ + bg: 'purple_hover_2', + '& > *': { + color: 'black', + }, + }} + > + Pool Types + + + + updatePoolType([PoolType.DEXV2, PoolType.DEXV3], 'DEX') + } + > + + DEX + {(poolTypeFilters.includes(PoolType.DEXV2.valueOf()) || + poolTypeFilters.includes(PoolType.DEXV3.valueOf())) && ( + + ✓ + + )} + + + updatePoolType([PoolType.Lending], 'Lending')} + > + + Lending + {poolTypeFilters.includes(PoolType.Lending) && ( + + ✓ + + )} + + + + updatePoolType([PoolType.Derivatives], 'Derivatives') + } + > + + Derivative + {poolTypeFilters.includes(PoolType.Derivatives) && ( + + ✓ + + )} + + + + + + *': { + color: 'black', + }, + }} + onClick={() => { + updateFilters('categories', [ALL_FILTER]); + updateFilters('risk', [ALL_FILTER]); + updateFilters('poolTypes', [ALL_FILTER]); + mixpanel.track('Reset Filters'); + }} + > + + + Reset + + + + ); } diff --git a/src/components/Pools.tsx b/src/components/Pools.tsx index 63b873fa..9ba6b006 100755 --- a/src/components/Pools.tsx +++ b/src/components/Pools.tsx @@ -108,6 +108,7 @@ export default function Pools() { display={'flex'} flexDirection={'column'} gap={'16px'} + padding={{ base: '0px' }} > @@ -131,6 +132,7 @@ export default function Pools() { align="right" float={'right'} padding={'0px'} + marginTop={{ base: '10px', lg: '0px' }} > { return ( - Total Value locked (TVL) - + + Total Value locked (TVL) + + $ {isPending ? ( @@ -71,15 +73,17 @@ const TVL: React.FC = () => { - Your holdings - + + Your holdings + + $ {userStatsPending ? ( @@ -96,14 +100,14 @@ const TVL: React.FC = () => { - + Your referral link{' '} {/* TODO: update the url */} @@ -125,7 +129,7 @@ const TVL: React.FC = () => { ) : ( { ) ) : ( - + - diff --git a/src/components/YieldCard.tsx b/src/components/YieldCard.tsx index 9b3ba01a..7c327871 100644 --- a/src/components/YieldCard.tsx +++ b/src/components/YieldCard.tsx @@ -13,8 +13,6 @@ import { Badge, Box, Flex, - Grid, - GridItem, Heading, HStack, Image, @@ -420,67 +418,119 @@ function GetRiskLevel(riskFactor: number) { function StrategyMobileCard(props: YieldCardProps) { const { pool, index } = props; + const isNew = pool.additional?.tags?.includes(StrategyLiveStatus.NEW); + const hasAudit = !!pool.additional?.auditUrl; + const riskLevel = pool.additional?.riskFactor || 0; + // Only show the main protocol + const protocol = pool.protocol; + return ( - - - - - - - APY - - - - - - RISK - - {pool.additional?.riskFactor - ? GetRiskLevel(pool.additional?.riskFactor) - : '-'} - - - - TVL - - - - + {/* Top row: Avatars, name, shield, New badge */} + + + + {pool.pool.logos.slice(0, 2).map((logo, i) => ( + + ))} + + + {pool.pool.name} + + {hasAudit && ( + + + + )} + + {isNew && ( + + New + + )} + + + {/* Protocol row */} + + + + + {protocol.name} + + + + + {/* APY, TVL, Risk row */} + + + + APY + + + {(pool.apr * 100).toFixed(2)}% + + + + + TVL + + + {`$${getDisplayCurrencyAmount(pool.tvl, 0)}`} + + + + + Risk + + + {[...Array(5)].map((_, i) => ( + + ))} + + + + ); } From eed7d8d20fb0b2a409dccaa8428c13b44cfc0886 Mon Sep 17 00:00:00 2001 From: Oche Date: Fri, 20 Jun 2025 08:32:18 +0100 Subject: [PATCH 26/48] ui: strategy page --- .../[strategyId]/_components/Strategy.tsx | 315 ++++++++---------- src/components/MobileHarvestTime.tsx | 285 ++++++++++++++++ 2 files changed, 427 insertions(+), 173 deletions(-) create mode 100644 src/components/MobileHarvestTime.tsx diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index 6a0575f0..08c57d76 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -50,6 +50,7 @@ import { RiskTab } from './RiskTab'; import { DetailsTab } from './DetailsTab'; import { FAQTab } from './FAQTab'; import { TransactionsTab } from './TransactionsTab'; +import MobileHarvestTime from '@/components/MobileHarvestTime'; const Strategy = ({ params }: StrategyParams) => { const address = useAtomValue(addressAtom); @@ -619,214 +620,183 @@ const Strategy = ({ params }: StrategyParams) => { display={{ base: 'flex', md: 'none' }} flexDirection="column" width="100%" - bg="bg_2" - px={3} - py={3} > - - + + + + + + + + {strategy?.name} + + {strategy?.settings.isAudited && ( + + + + )} - - - - - {strategy?.name} - - {strategy?.settings.isAudited && ( - + + + + APY + + + {strategyCached?.apySplit?.baseApy + ? `${(strategyCached.apySplit.baseApy * 100).toFixed(2)}%` + : '23.94%'} + + + + + 🔥 + + {`${strategyCached?.leverage?.toFixed(2)}x boosted`} + + + - - - )} - + Contract details + + - - + - - APY + + Your holdings: - - {strategyCached?.apySplit?.baseApy - ? `${(strategyCached.apySplit.baseApy * 100).toFixed(2)}%` - : '23.94%'} + + {address && balData && balData.data && balData.data.tokenInfo + ? `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` + : '-'} - - 🔥 - - {strategyCached?.leverage - ? `${strategyCached.leverage.toFixed(2)}x boosted` - : '1.96x boosted'} + + Net earnings: + + 0 ? 'cyan' : profit < 0 ? 'red' : 'text'} + fontWeight="extrabold" + fontSize="22px" + > + {address && + profit !== 0 && + !strategy?.isRetired() && + balData.data && + balData.data.tokenInfo + ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` + : '-'} + - - Contract details - - - - - - Your holdings: - - - {address && balData && balData.data && balData.data.tokenInfo - ? `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)}${balData.data.tokenInfo?.name}` - : '-'} - - - - - Your earnings: - - - {address && profit !== 0 && balData.data && balData.data.tokenInfo - ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : '-'} - - - - - {/* Next Harvest card with countdown only */} - {/* - - Next Harvest in: - - - - - */} - - {/* Harvest stats card (only once, at the bottom) */} - - - Total rewards harvested: $50 0 - - - Total number of times harvested: 48 - + {strategy && } - {/* */} {/* Mobile vertical accordion for sections */} { - {/* */} ); }; diff --git a/src/components/MobileHarvestTime.tsx b/src/components/MobileHarvestTime.tsx new file mode 100644 index 00000000..8f3562d1 --- /dev/null +++ b/src/components/MobileHarvestTime.tsx @@ -0,0 +1,285 @@ +import React, { useMemo } from 'react'; +import { Box, Flex, Text, Tooltip } from '@chakra-ui/react'; +import { useAccount } from '@starknet-react/core'; +import { StrategyInfo } from '@/store/strategies.atoms'; +import { HarvestTimeAtom } from '@/store/harvest.atom'; +import { useAtomValue } from 'jotai'; +import { formatTimediff, getDisplayCurrencyAmount } from '@/utils'; +import STRKFarmAtoms, { + STRKFarmStrategyAPIResult, +} from '@/store/strkfarm.atoms'; + +interface MobileHarvestTimeProps { + strategy: StrategyInfo; +} + +const MobileHarvestTime: React.FC = ({ strategy }) => { + const { address } = useAccount(); + const holdingToken: any = strategy.holdingTokens[0]; + const contractAddress = holdingToken.address || holdingToken.token || ''; + + const harvestTimeAtom = useMemo( + () => HarvestTimeAtom(contractAddress), + [address], + ); + + const harvestTime = useAtomValue(harvestTimeAtom); + + const data = harvestTime.data?.findManyHarvests[0]; + + const lastHarvest = useMemo(() => { + if (!data || !data.timestamp) return null; + return new Date(Number(data.timestamp) * 1000); + }, [data?.timestamp]); + + const harvestTimestamp = useMemo(() => { + const DAYMS = 86400 * 1000; + // Base date is last harvest time + 2 days or now (for no harvest strats) + const baseDate = lastHarvest + ? new Date(lastHarvest.getTime() + 2 * DAYMS) + : new Date(); + + // With base date, get next sunday 12am UTC + // set date to coming sunday in UTC + const nextHarvest = baseDate; + nextHarvest.setUTCDate( + nextHarvest.getUTCDate() + (7 - nextHarvest.getUTCDay()), + ); + nextHarvest.setUTCHours(0); + nextHarvest.setUTCMinutes(0); + nextHarvest.setUTCSeconds(0); + + // if nextHarvest is within 24hrs of last harvest, + // increase it by 7 days + // This is needed as harvest can happen anytime near deadline + if ( + lastHarvest && + nextHarvest.getTime() - lastHarvest.getTime() < 86400 * 1000 + ) { + nextHarvest.setUTCDate(nextHarvest.getUTCDate() + 7); + } + + return formatTimediff(nextHarvest); + }, [data?.timestamp, lastHarvest]); + + const strategiesInfo = useAtomValue(STRKFarmAtoms.baseAPRs!); + + const strategyInfo = useMemo(() => { + if (!strategiesInfo || !strategiesInfo.data) return null; + + const strategiesList: STRKFarmStrategyAPIResult[] = + strategiesInfo.data.strategies; + const strategyInfo = strategiesList.find( + (strat) => strat.id == strategy.id, + ); + return strategyInfo ? strategyInfo : null; + }, [strategiesInfo]); + + return ( + + + {!strategy.settings.hideHarvestInfo && ( + + + + Next Harvest in:{' '} + {harvestTimestamp.isZero && ( + + Anytime now + + )} + + + + + + Days + + + {harvestTimestamp.days ?? 0} + + + + + + Hour + + + {harvestTimestamp.hours ?? 0} + + + + + + Mins + + + {harvestTimestamp.minutes ?? 0} + + + + + + Secs + + + {harvestTimestamp.seconds ?? 0} + + + + + + )} + + + + {!strategy.settings.hideHarvestInfo && ( + + + + Total rewards harvested: + + + + {getDisplayCurrencyAmount( + harvestTime?.data?.totalStrkHarvestedByContract.STRKAmount || + 0, + 2, + )}{' '} + STRK + + + + + + Total number of times harvested: + + + + - + + + + )} + + + ); +}; + +export default MobileHarvestTime; From b199c86468851ec56d36deb11e5c5c57f2e0e3a7 Mon Sep 17 00:00:00 2001 From: Oche Date: Fri, 20 Jun 2025 14:10:38 +0100 Subject: [PATCH 27/48] ui: strategy tabs --- .../[strategyId]/_components/DetailsTab.tsx | 83 +++--- .../[strategyId]/_components/FAQTab.tsx | 88 +++--- .../[strategyId]/_components/ManageTab.tsx | 2 +- .../[strategyId]/_components/RiskTab.tsx | 142 ++++----- .../[strategyId]/_components/Strategy.tsx | 271 ++++++++++-------- 5 files changed, 309 insertions(+), 277 deletions(-) diff --git a/src/app/strategy/[strategyId]/_components/DetailsTab.tsx b/src/app/strategy/[strategyId]/_components/DetailsTab.tsx index 6429543e..d1cf08a0 100644 --- a/src/app/strategy/[strategyId]/_components/DetailsTab.tsx +++ b/src/app/strategy/[strategyId]/_components/DetailsTab.tsx @@ -16,65 +16,58 @@ export function DetailsTab(props: DetailsTabProps) { if (isMobile) { return ( - - + + Behind the scenes - + Actions done automatically by the strategy (smart-contract) with an investment of $1000 - - {strategy.actions.length > 0 ? ( - strategy.actions.map((action, index) => ( + + + {strategy.actions.length > 0 && ( + + <> + + Action + + {strategy.actions.map((action, index) => ( {action.name.toLowerCase().includes('stake') || action.name.toLowerCase().includes('supply') ? ( - + ) : action.name.toLowerCase().includes('borrow') ? ( - + ) : ( - + )} - + {action.name} - )) - ) : ( - - No actions found - - )} + ))} + {strategy.actions.length == 0 && ( +
+ +
+ )} +
-
- - - + )} + +
); } @@ -118,11 +111,11 @@ export function DetailsTab(props: DetailsTabProps) { > {action.name.toLowerCase().includes('stake') || action.name.toLowerCase().includes('supply') ? ( - + ) : action.name.toLowerCase().includes('borrow') ? ( - + ) : ( - + )} {action.name} diff --git a/src/app/strategy/[strategyId]/_components/FAQTab.tsx b/src/app/strategy/[strategyId]/_components/FAQTab.tsx index 8dbecf7e..aa406b27 100644 --- a/src/app/strategy/[strategyId]/_components/FAQTab.tsx +++ b/src/app/strategy/[strategyId]/_components/FAQTab.tsx @@ -22,58 +22,48 @@ export function FAQTab(props: FAQTabProps) { if (isMobile) { return ( - - - - Get to know about all your doubts - - - {strategy.metadata.faqs && strategy.metadata.faqs.length > 0 ? ( - strategy.metadata.faqs.map((faq, index) => ( - - - - {faq.question} - - - - - {faq.answer} - - - )) - ) : ( - - No FAQs at the moment - - )} - - + + + Get to know about all your doubts + + + {strategy.metadata.faqs && strategy.metadata.faqs.length > 0 ? ( + strategy.metadata.faqs.map((faq, index) => ( + + + + {faq.question} + + + + + {faq.answer} + + + )) + ) : ( + + No FAQs at the moment + + )} + + - + Risk diff --git a/src/app/strategy/[strategyId]/_components/RiskTab.tsx b/src/app/strategy/[strategyId]/_components/RiskTab.tsx index 87775496..0bc295a7 100644 --- a/src/app/strategy/[strategyId]/_components/RiskTab.tsx +++ b/src/app/strategy/[strategyId]/_components/RiskTab.tsx @@ -1,11 +1,4 @@ -import { - Badge, - Flex, - ListItem, - OrderedList, - Box, - Text, -} from '@chakra-ui/react'; +import { Badge, Flex, ListItem, OrderedList } from '@chakra-ui/react'; import { StrategyInfo } from '@/store/strategies.atoms'; interface RiskTabProps { @@ -18,63 +11,84 @@ export function RiskTab(props: RiskTabProps) { if (isMobile) { return ( - - + - - Risk - - - {strategy.risks.map((r, index) => ( - - - {r} - - {index === 0 && ( - - {strategy.riskFactor <= 2 - ? 'Low' - : strategy.riskFactor < 4 - ? 'Medium' - : 'High'}{' '} - risk - - )} - - ))} - - + {strategy.risks.map((r, index) => ( + + {r} + {index === 0 && ( + + {strategy.riskFactor <= 2 + ? 'Low' + : strategy.riskFactor < 4 + ? 'Medium' + : 'High'} + risk + + )} + + ))} + ); } diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index 08c57d76..de8df83b 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -233,7 +233,7 @@ const Strategy = ({ params }: StrategyParams) => { return ( <> { {/* MOBILE VIEW */} @@ -797,123 +797,158 @@ const Strategy = ({ params }: StrategyParams) => { {strategy && } - {/* Mobile vertical accordion for sections */} - { - if (Array.isArray(expandedIndex)) { - setAccordionIndex(expandedIndex[0] ?? 0); - } else { - setAccordionIndex(expandedIndex); - } - }} - allowToggle - width="100%" - marginTop={'8px'} + - - - - Manage - - - - - {strategy && } - - - - - - Risk - - - - - {strategy && } - - - - - - Details - - - - - {strategyCached && ( - - )} - - - - - - FAQs - - - - - {strategy && } - - - - - - Transactions - - - - - {strategy && ( - - )} - - - + { + if (Array.isArray(expandedIndex)) { + setAccordionIndex(expandedIndex[0] ?? 0); + } else { + setAccordionIndex(expandedIndex); + } + }} + allowToggle + width="100%" + display="flex" + flexDirection="column" + gap="10px" + > + + + + Manage + + + + + {strategy && } + + + + + + Risk + + + + + {strategy && } + + + + + + Details + + + + + {strategyCached && ( + + )} + + + + + + FAQs + + + + + {strategy && } + + + + + + Transactions + + + + + {strategy && ( + + )} + + + + ); From fbc886967420ecfd52faff83621062eab8f5069a Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Fri, 20 Jun 2025 19:41:24 +0530 Subject: [PATCH 28/48] clean strategy page --- .eslintrc.json | 14 +- .gitignore | 3 +- src/app/page.tsx | 11 +- .../[strategyId]/_components/FAQTab.tsx | 110 +---- .../[strategyId]/_components/ManageTab.tsx | 127 ++---- .../[strategyId]/_components/RiskTab.tsx | 13 +- .../[strategyId]/_components/Strategy.tsx | 399 ++++-------------- .../[strategyId]/_components/StrategyInfo.tsx | 50 +++ .../[strategyId]/_components/TokenDeposit.tsx | 12 +- .../_components/TransactionsTab.tsx | 40 +- src/app/template.tsx | 2 +- src/components/APYInfo.tsx | 117 +++++ src/components/AmountInput.tsx | 46 +- src/components/ContractDetails.tsx | 19 + src/components/Deposit.tsx | 14 +- src/components/Filters.tsx | 397 ++++++++--------- src/components/HarvestTime.tsx | 311 +++----------- src/components/Pools.tsx | 9 +- src/components/Strategies.tsx | 33 +- src/components/TxButton.tsx | 6 +- src/style.ts | 0 src/utils.ts | 11 +- 22 files changed, 667 insertions(+), 1077 deletions(-) create mode 100644 src/app/strategy/[strategyId]/_components/StrategyInfo.tsx create mode 100644 src/components/APYInfo.tsx create mode 100644 src/components/ContractDetails.tsx create mode 100644 src/style.ts 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/src/app/page.tsx b/src/app/page.tsx index a8b1c902..72247242 100755 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -99,13 +99,13 @@ export default function Home() { padding={{ base: '15px 10px' }} > Discover and invest in custom-built yield strategies. diff --git a/src/app/strategy/[strategyId]/_components/FAQTab.tsx b/src/app/strategy/[strategyId]/_components/FAQTab.tsx index 8dbecf7e..0872312f 100644 --- a/src/app/strategy/[strategyId]/_components/FAQTab.tsx +++ b/src/app/strategy/[strategyId]/_components/FAQTab.tsx @@ -20,112 +20,16 @@ interface FAQTabProps { export function FAQTab(props: FAQTabProps) { const { strategy, isMobile } = props; - if (isMobile) { - return ( - - - - Get to know about all your doubts - - - {strategy.metadata.faqs && strategy.metadata.faqs.length > 0 ? ( - strategy.metadata.faqs.map((faq, index) => ( - - - - {faq.question} - - - - - {faq.answer} - - - )) - ) : ( - - No FAQs at the moment - - )} - - - - - For more queries reach out to us on Telegram - - - Our team will respond to you soon! - - - - - - - ); - } - return ( - Get to know about all your doubts + Get your questions answered {!strategy.metadata.faqs && ( - + No FAQs at the moment )} @@ -140,14 +44,14 @@ export function FAQTab(props: FAQTabProps) { strategy.metadata.faqs.map((faq, index) => ( @@ -161,7 +65,7 @@ export function FAQTab(props: FAQTabProps) { fontSize={'14px'} fontWeight={'400'} lineHeight={'20px'} - color={'silver_gray'} + color={'text_secondary'} > {faq.answer} diff --git a/src/app/strategy/[strategyId]/_components/ManageTab.tsx b/src/app/strategy/[strategyId]/_components/ManageTab.tsx index becf5ff5..59f527e3 100644 --- a/src/app/strategy/[strategyId]/_components/ManageTab.tsx +++ b/src/app/strategy/[strategyId]/_components/ManageTab.tsx @@ -1,16 +1,9 @@ -import { - Badge, - Flex, - ListItem, - Text, - Tooltip, - UnorderedList, -} from '@chakra-ui/react'; +import { Flex, ListItem, Text, UnorderedList } from '@chakra-ui/react'; import React from 'react'; import { StrategyInfo } from '@/store/strategies.atoms'; -import { getRiskExplaination } from '@strkfarm/sdk'; import { TokenDeposit } from './TokenDeposit'; +import { ContractDetails } from '@/components/ContractDetails'; interface ManageTabProps { strategy: StrategyInfo; @@ -20,96 +13,27 @@ interface ManageTabProps { export function ManageTab(props: ManageTabProps) { const { strategy, isMobile } = props; - if (isMobile) { - return ( - - - {!strategy || - (strategy.isSingleTokenDepositView && ( - - ))} - {strategy && !strategy.isSingleTokenDepositView && ( - - )} - - - - - How does it work? - - - - Deposit USDC to automatically loop funds between zkLend and - Nostra. - - - Creates a delta-neutral position to maximize USDC yield. - - - Position is periodically adjusted to maintain a healthy health - factor - - - Receive an NFT as representation for your stake on STRKFarm. - - - Withdraw anytime by redeeming your NFT for USDC. - - - - - - Risk - - {strategy.metadata.risk.riskFactor.map((r: any, i: number) => ( - - - {r.type.valueOf()} - - - ))} - - - - ); - } - return ( - + - + How does it work? Deposit USDC to automatically loop funds between zkLend and Nostra. @@ -127,25 +51,34 @@ export function ManageTab(props: ManageTabProps) { Withdraw anytime by redeeming your NFT for USDC. - + + {/* - Risk + Risks + {strategy.metadata.risk.riskFactor.map((r: any, i: number) => ( - + {r.type.valueOf()} ))} - + + */} {!strategy || (strategy.isSingleTokenDepositView && ( diff --git a/src/app/strategy/[strategyId]/_components/RiskTab.tsx b/src/app/strategy/[strategyId]/_components/RiskTab.tsx index 87775496..ec8ce01b 100644 --- a/src/app/strategy/[strategyId]/_components/RiskTab.tsx +++ b/src/app/strategy/[strategyId]/_components/RiskTab.tsx @@ -117,11 +117,12 @@ export function RiskTab(props: RiskTabProps) { }} display={'flex'} flexDirection={'column'} - gap={'32px'} + gap={'16px'} > {strategy.risks.map((r, index) => ( {r} @@ -139,13 +138,13 @@ export function RiskTab(props: RiskTabProps) { padding={'4px 8px'} borderRadius={'4px'} bg={ - strategy.riskFactor === 0 + strategy.riskFactor <= 1 ? 'light_green_2' - : strategy.riskFactor < 2.5 + : strategy.riskFactor < 3 ? 'yellow_2' : 'red_2' } - color={'color_6'} + color={'black'} fontSize={'10px'} fontWeight={'500'} textTransform={'none'} diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index 65393cda..a59b8f1a 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -2,7 +2,6 @@ import { Avatar, - AvatarGroup, Box, Button, Container, @@ -24,6 +23,7 @@ import { TabList, Tab, TabIndicator, + VStack, } from '@chakra-ui/react'; import { ArrowBackIcon, ExternalLinkIcon } from '@chakra-ui/icons'; import { atom, useAtomValue, useSetAtom } from 'jotai'; @@ -51,6 +51,8 @@ import { FAQTab } from './FAQTab'; import { TransactionsTab } from './TransactionsTab'; import MobileHarvestTime from '@/components/MobileHarvestTime'; import HarvestTime from '@/components/HarvestTime'; +import { StrategyInfoComponent } from './StrategyInfo'; +import { APYInfo } from '@/components/APYInfo'; function HoldingsText({ strategy, @@ -121,12 +123,12 @@ function HoldingsAndEarnings({ profit: number; }) { return ( - - - + + + Your Holdings - + {!strategy.settings.isTransactionHistDisabled && ( - - + + Net earnings - = 0 ? 'cyan' : 'red'}> + = 0 ? 'light_green_2' : 'red'} + > { alignItems={'center'} justifyContent={'center'} > - + - - {strategy && ( - - - - - {strategy && - strategy.metadata.depositTokens.length > 0 && - strategy.metadata.depositTokens.map((token: any) => { - return ( - - ); - })} - {strategy && - strategy.metadata.depositTokens.length == 0 && ( - - )} - - - {strategy ? strategy.name : 'Strategy Not found'} - + + {strategy && ( + + + {!strategy?.isRetired() && strategyCached && ( - + - - - - - - Your Holdings: - - - {!balData.isLoading && - !balData.isError && - !balData.isPending && - balData.data && - balData.data.tokenInfo && ( - - {address - ? Number( - balData.data.amount.toEtherToFixedDecimals( - balData.data.tokenInfo?.displayDecimals || - 2, - ), - ) === 0 || strategy?.isRetired() - ? '-' - : `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : 'Connect wallet'} - - )} - - {(balData.isLoading || - balData.isPending || - (!balData.data?.tokenInfo && !balData.isError)) && ( - - {address ? : 'Connect wallet'} - - )} + )} + + )} - {balData.isError && - !balData.isLoading && - !balData.isPending && ( - - Error - - )} - - {/* Show individual holdings is more tokens */} - {individualBalances.length > 1 && - balData.data?.amount.compare('0', 'gt') && ( - - -

Detailed Split:

- {individualBalances.map((bx, index) => { - return ( - - {bx?.amount.toEtherToFixedDecimals( - bx.tokenInfo?.displayDecimals || 2, - )}{' '} - {bx?.tokenInfo?.name} - - ); - })} -
-
- )} - - {/* {address && - balData.data && - strategy.id === 'xstrk_sensei' && - profit < 0 && - profit / - Number(balData.data.amount.toEtherToFixedDecimals(6)) < - -0.01 && ( - - - Why did my holdings drop?{' '} - - Learn more - - - )} */} -
- - - - Net earnings - - - {!balData.isLoading && - !balData.isError && - !balData.isPending && - balData.data && - balData.data.tokenInfo && ( - - 0 - ? 'cyan' - : profit < 0 - ? 'red' - : 'text' - } - fontSize={'18px'} - fontWeight={'700'} - > - {address && - profit !== 0 && - !strategy?.isRetired() && - balData.data && - balData.data.tokenInfo - ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : '-'} - - - )} - -
-
- - - - {!strategy?.isRetired() && ( - - )} - - -
- )} + {strategy && ( + + + + + )} + { index={tabIndex} onChange={handleTabsChange} > - + { mixpanel.track('Manage clicked'); }} @@ -636,17 +434,17 @@ const Strategy = ({ params }: StrategyParams) => { Manage { mixpanel.track('Risk clicked'); }} > - Risk + Risks { mixpanel.track('Details clicked'); }} @@ -654,8 +452,8 @@ const Strategy = ({ params }: StrategyParams) => { Details { mixpanel.track('FAQs clicked'); }} @@ -663,8 +461,8 @@ const Strategy = ({ params }: StrategyParams) => { FAQs { mixpanel.track('Transactions clicked'); }} @@ -675,50 +473,39 @@ const Strategy = ({ params }: StrategyParams) => { + + + {strategy && } + + + + {strategy && } + + + + {strategyCached && } + + + + {strategy && } + + + + {strategy && ( + + )} + +
- - - - - - {strategy && } - - - - {strategy && } - - - - {strategyCached && } - - - - {strategy && } - - - - {strategy && ( - - )} - - - -
@@ -795,9 +582,7 @@ const Strategy = ({ params }: StrategyParams) => { display="flex" alignItems="center" padding="8px" - borderRadius="8px" - borderColor="#2D2D3D" - borderWidth="1px" + borderRadius="md" > { { gap="4px" alignItems="center" justifyContent="center" - borderWidth="1px" - borderColor="#CFCFEA4D" - borderRadius="12px" + borderRadius="md" > Your holdings: diff --git a/src/app/strategy/[strategyId]/_components/StrategyInfo.tsx b/src/app/strategy/[strategyId]/_components/StrategyInfo.tsx new file mode 100644 index 00000000..12f013e4 --- /dev/null +++ b/src/app/strategy/[strategyId]/_components/StrategyInfo.tsx @@ -0,0 +1,50 @@ +import { Avatar, AvatarGroup, Box, Flex, Image, Text } from '@chakra-ui/react'; +import shield from '@/assets/shield.svg'; +import { StrategyInfo } from '@/store/strategies.atoms'; + +export function StrategyInfoComponent(props: { strategy: StrategyInfo }) { + const { strategy } = props; + + return ( + + + {strategy && + strategy.metadata.depositTokens.length > 0 && + strategy.metadata.depositTokens.map((token: any) => { + return ( + + ); + })} + {strategy && strategy.metadata.depositTokens.length == 0 && ( + + )} + + + {strategy ? strategy.name : 'Strategy Not found'} + + + + + + ); +} diff --git a/src/app/strategy/[strategyId]/_components/TokenDeposit.tsx b/src/app/strategy/[strategyId]/_components/TokenDeposit.tsx index d2a89331..233f63f5 100644 --- a/src/app/strategy/[strategyId]/_components/TokenDeposit.tsx +++ b/src/app/strategy/[strategyId]/_components/TokenDeposit.tsx @@ -32,12 +32,12 @@ export function TokenDeposit(props: TokenDepositProps) { { // mixpanel.track('All pools clicked') }} @@ -46,12 +46,12 @@ export function TokenDeposit(props: TokenDepositProps) { { // mixpanel.track('Strategies opened') }} diff --git a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx index 60ab6df4..aa3b7abd 100644 --- a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx +++ b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx @@ -51,7 +51,7 @@ export function TransactionsTab(props: TransactionsTabProps) { {!strategy.settings.isTransactionHistDisabled && ( - There may be delays fetching data. If your transaction isn't + There may be delays in fetching data. If your transaction isn't found, try again later. )} @@ -174,35 +174,30 @@ export function TransactionsTab(props: TransactionsTabProps) { <>
@@ -247,15 +237,11 @@ export function TransactionsTab(props: TransactionsTabProps) { const decimals = token?.decimals; return ( - - + - - - -
# Time
+
{index + 1}. + {Number( new MyNumber( tx.amount, @@ -266,7 +252,7 @@ export function TransactionsTab(props: TransactionsTabProps) { ).toLocaleString()}{' '} {token?.name} + {tx.type === 'deposit' ? ( + + {timeAgo(new Date(tx.timestamp * 1000))} diff --git a/src/app/template.tsx b/src/app/template.tsx index 810f27a9..b77d2efe 100755 --- a/src/app/template.tsx +++ b/src/app/template.tsx @@ -41,7 +41,7 @@ const theme = extendTheme({ purple_gray: '#DFDFEC', mybg: 'black', // dark blue - bg_2: '#1B1724', + bg_2: '#111113', bg_3: '#090910', mycard: '#19191b', diff --git a/src/components/APYInfo.tsx b/src/components/APYInfo.tsx new file mode 100644 index 00000000..eb452664 --- /dev/null +++ b/src/components/APYInfo.tsx @@ -0,0 +1,117 @@ +import { StrategyInfo } from '@/store/strategies.atoms'; +import { STRKFarmStrategyAPIResult } from '@/store/strkfarm.atoms'; +import { + Flex, + Tooltip, + Box, + Text, + Stat, + StatLabel, + StatNumber, + Tag, + Spinner, +} from '@chakra-ui/react'; +import { useMemo } from 'react'; + +export function APYInfo(props: { + strategy: StrategyInfo; + strategyAPIResult: STRKFarmStrategyAPIResult; +}) { + const { strategy, strategyAPIResult } = props; + + const defaultAPYTooltip = + 'Current APY including any fees. Net returns subject to change based on market conditions.'; + + const leverage = useMemo(() => { + if (!strategyAPIResult) return 0; + return strategyAPIResult.leverage || 0; + }, [strategyAPIResult]); + + return ( + + + {strategy.metadata.apyMethodology || defaultAPYTooltip} + {strategyAPIResult && ( + + + Strategy APY: + + Including fees and Defi spring rewards + + + + {(strategyAPIResult.apySplit.baseApy * 100).toFixed(2)}% + + + )} + {strategyAPIResult && strategyAPIResult.apySplit.rewardsApy > 0 && ( + + + Rewards APY: + + Incentives by STRKFarm + + + + {(strategyAPIResult.apySplit.rewardsApy * 100).toFixed(2)}% + + + )} + + } + > + + + APY + + + {((strategyAPIResult?.apy || 0) * 100).toFixed(2)}% + + + + + + + 🔥{leverage.toFixed(2)}x boosted + {leverage === 0 && } + + + + ); +} diff --git a/src/components/AmountInput.tsx b/src/components/AmountInput.tsx index 2b3192c2..3e56669b 100644 --- a/src/components/AmountInput.tsx +++ b/src/components/AmountInput.tsx @@ -23,6 +23,7 @@ import { MenuItem, Link, HStack, + Flex, } from '@chakra-ui/react'; import { useAccount } from '@starknet-react/core'; import { useAtom, useAtomValue, Atom, useSetAtom } from 'jotai'; @@ -304,7 +305,7 @@ const AmountInput = forwardRef( return ( - Wallet balance + Wallet balance {props.strategy.settings.isInMaintenance ? ( - '-' + - ) : ( - <> + - + {balance.toEtherToFixedDecimals(4)} - + - + )} @@ -480,16 +483,17 @@ const AmountInput = forwardRef( height={'100%'} rightIcon={} width={'200px'} - bg={'transparent'} - borderColor={'slate_blue'} - borderWidth={'1px'} - color="border_light" + bg={'mycard_light'} + color="text_primary" fontSize={'16px'} fontWeight={'500'} padding={'10px 16px'} textAlign={'left'} _hover={{ - bg: 'transparent', + bg: 'mycard_light_2x', + }} + _active={{ + bg: 'mycard_light_2x', }} > @@ -548,10 +552,8 @@ const AmountInput = forwardRef( min={0} max={parseFloat(maxAmount.toEtherStr())} color={'white'} - bg={'transparent'} - borderRadius={'10px'} - borderColor={'slate_blue'} - borderWidth={'1px'} + bg={'mycard_light'} + borderRadius={'lg'} onChange={(valueStr) => { const newAmount = valueStr && Number(valueStr) > 0 @@ -578,7 +580,7 @@ const AmountInput = forwardRef( > }) { + return ( + + + Contract details + + + ); +} diff --git a/src/components/Deposit.tsx b/src/components/Deposit.tsx index d5f82565..e8e553ed 100755 --- a/src/components/Deposit.tsx +++ b/src/components/Deposit.tsx @@ -372,11 +372,17 @@ function InternalDeposit(props: DepositProps) { /> - - - Fees + + + Fees: - + No additional fees by STRKFarm diff --git a/src/components/Filters.tsx b/src/components/Filters.tsx index fbfb8e78..ee9da6a3 100755 --- a/src/components/Filters.tsx +++ b/src/components/Filters.tsx @@ -15,7 +15,7 @@ import { Button, HStack, } from '@chakra-ui/react'; -import { CloseIcon, ChevronDownIcon } from '@chakra-ui/icons'; +import { ChevronDownIcon } from '@chakra-ui/icons'; import { ALL_FILTER, filterAtoms, @@ -108,8 +108,8 @@ export function ProtocolFilters() { - - {/* Mobile dropdown for protocol filters */} - - } - display={{ base: 'flex', md: 'none' }} - width={{ base: '100%' }} - bg="transparent" - color="white" - borderWidth="1px" - borderColor="slate_blue" - borderRadius="md" - padding="12px" - fontSize="14px" - fontWeight="normal" - size="lg" - _hover={{ - bg: 'purple_hover_2', - '& > *': { - color: 'black', - }, - }} - > - - Protocols - - {getSelectedProtocolsCount()} - - - - - {filters.protocols.map((p) => ( - { - const selectedProtocols = protocolsFilter.includes(ALL_FILTER) - ? [] - : protocolsFilter; - - let updatedProtocols = []; - if (selectedProtocols.includes(p.name)) { - updatedProtocols = selectedProtocols.filter( - (x) => x !== p.name, - ); - } else { - updatedProtocols = [...selectedProtocols, p.name]; - } - if (updatedProtocols.length === filters.protocols.length) { - updatedProtocols = [ALL_FILTER]; - } - mixpanel.track('Protocol Filter', { - protocol: p.name, - selected: - updatedProtocols.includes(p.name) || - updatedProtocols.includes(ALL_FILTER), - updatedProtocols: JSON.stringify(updatedProtocols), - }); - updateFilters('protocols', updatedProtocols); - }} - > - - - {p.name} - {/* {isProtocolSelected(p.name) && ( - - ✓ - - )} */} - - - ))} - - - - {/* Clear all or select all button */} - + } + display={{ base: 'flex', md: 'none' }} + bg="mycard_light" + color="white" borderRadius="md" - borderColor={'slate_blue'} - padding={'12px'} - fontSize={'14px'} - fontWeight={'normal'} - bg={'transparent'} - color={'white'} - marginRight={'5px'} - as="button" - marginTop={'1px'} - aria-label={atleastOneProtocolSelected() ? 'Clear all' : 'Select all'} + padding="12px" + fontSize="14px" + fontWeight="normal" + size="lg" _hover={{ - bg: 'purple_hover_2', + bg: 'mycard_light_2x', '& > *': { color: 'black', }, }} - onClick={() => { - updateFilters( - 'protocols', - atleastOneProtocolSelected() ? [] : [ALL_FILTER], - ); - mixpanel.track('Clear/Select all protocols', { - atleastOneProtocolSelected: atleastOneProtocolSelected(), - }); - }} > - - {getSelectedProtocolsCount()} - - - {atleastOneProtocolSelected() ? 'Clear filters' : 'Select all'} - - - + + Protocols + + {getSelectedProtocolsCount()} + + + + + {filters.protocols.map((p) => ( + { + const selectedProtocols = protocolsFilter.includes(ALL_FILTER) + ? [] + : protocolsFilter; + + let updatedProtocols = []; + if (selectedProtocols.includes(p.name)) { + updatedProtocols = selectedProtocols.filter( + (x) => x !== p.name, + ); + } else { + updatedProtocols = [...selectedProtocols, p.name]; + } + if (updatedProtocols.length === filters.protocols.length) { + updatedProtocols = [ALL_FILTER]; + } + mixpanel.track('Protocol Filter', { + protocol: p.name, + selected: + updatedProtocols.includes(p.name) || + updatedProtocols.includes(ALL_FILTER), + updatedProtocols: JSON.stringify(updatedProtocols), + }); + updateFilters('protocols', updatedProtocols); + }} + > + + + {p.name} + {/* {isProtocolSelected(p.name) && ( + + ✓ + + )} */} + + + ))} + + + + {/* Clear all or select all button */} + *': { + color: 'white', + }, + }} + onClick={() => { + updateFilters( + 'protocols', + atleastOneProtocolSelected() ? [] : [ALL_FILTER], + ); + mixpanel.track('Clear/Select all protocols', { + atleastOneProtocolSelected: atleastOneProtocolSelected(), + }); + }} + > + + {getSelectedProtocolsCount()} + + + {atleastOneProtocolSelected() ? 'Clear filters' : 'Select all'} + + {/* Selected protocols list for mobile */} - ))} - + */} ); } @@ -565,19 +552,18 @@ export function CategoryFilters() { > } - bg="transparent" + bg="mycard_light" color="white" - borderWidth="1px" - borderColor="slate_blue" borderRadius="md" padding="12px" size="lg" fontSize="14px" fontWeight="normal" _hover={{ - bg: 'purple_hover_2', + bg: 'mycard_light_2x', '& > *': { color: 'black', }, @@ -585,69 +571,34 @@ export function CategoryFilters() { > Categories - - updateCategory(Category.Stable)} - > - - {Category.Stable.valueOf().split(' ')[0]} - {categoriesFilter.includes(Category.Stable.valueOf()) && ( - - ✓ - - )} - - - updateCategory(Category.STRK)} - > - - {Category.STRK.valueOf().split(' ')[0]} - {categoriesFilter.includes(Category.STRK.valueOf()) && ( - - ✓ - - )} - - - updateCategory(Category.ETH)} - > - - {Category.ETH.valueOf().split(' ')[0]} - {categoriesFilter.includes(Category.ETH.valueOf()) && ( - - ✓ - - )} - - + + {[Category.Stable, Category.STRK, Category.ETH].map((category) => ( + updateCategory(category)} + > + + {category.valueOf().split(' ')[0]} + {categoriesFilter.includes(category.valueOf()) && ( + + ✓ + + )} + + + ))} updateRiskLevel(['1', '2'])} > Low risk @@ -663,19 +614,18 @@ export function CategoryFilters() { } - bg="transparent" + bg="mycard_light" color="white" - borderWidth="1px" - borderColor="slate_blue" borderRadius="md" padding="12px" size="lg" fontSize="14px" fontWeight="normal" _hover={{ - bg: 'purple_hover_2', + bg: 'mycard_light_2x', '& > *': { color: 'black', }, @@ -683,13 +633,12 @@ export function CategoryFilters() { > Pool Types - + updatePoolType([PoolType.DEXV2, PoolType.DEXV3], 'DEX') @@ -706,11 +655,10 @@ export function CategoryFilters() { updatePoolType([PoolType.Lending], 'Lending')} > @@ -724,11 +672,10 @@ export function CategoryFilters() { updatePoolType([PoolType.Derivatives], 'Derivatives') @@ -746,7 +693,7 @@ export function CategoryFilters() { - Reset - + */} ); diff --git a/src/components/HarvestTime.tsx b/src/components/HarvestTime.tsx index 0d162ba7..08ff052e 100644 --- a/src/components/HarvestTime.tsx +++ b/src/components/HarvestTime.tsx @@ -1,26 +1,11 @@ import React, { useMemo } from 'react'; -import { - Box, - Flex, - Spinner, - Link, - Stat, - StatLabel, - StatNumber, - Tag, - Text, - Tooltip, -} from '@chakra-ui/react'; +import { Box, Flex, Text, Tooltip } from '@chakra-ui/react'; import { useAccount } from '@starknet-react/core'; import { StrategyInfo } from '@/store/strategies.atoms'; import { HarvestTimeAtom } from '@/store/harvest.atom'; import { useAtomValue } from 'jotai'; import { formatTimediff, getDisplayCurrencyAmount } from '@/utils'; import { isMobile } from 'react-device-detect'; -import STRKFarmAtoms, { - STRKFarmStrategyAPIResult, -} from '@/store/strkfarm.atoms'; -import { ExternalLinkIcon } from '@chakra-ui/icons'; interface HarvestTimeProps { strategy: StrategyInfo; @@ -76,120 +61,9 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { return formatTimediff(nextHarvest); }, [data?.timestamp, lastHarvest]); - const strategiesInfo = useAtomValue(STRKFarmAtoms.baseAPRs!); - - const strategyInfo = useMemo(() => { - if (!strategiesInfo || !strategiesInfo.data) return null; - - const strategiesList: STRKFarmStrategyAPIResult[] = - strategiesInfo.data.strategies; - const strategyInfo = strategiesList.find( - (strat) => strat.id == strategy.id, - ); - return strategyInfo ? strategyInfo : null; - }, [strategiesInfo]); - - const leverage = useMemo(() => { - if (!strategyInfo) return 0; - return strategyInfo.leverage || 0; - }, [strategyInfo]); - - const defaultAPYTooltip = - 'Current APY including any fees. Net returns subject to change based on market conditions.'; return ( - - - - {strategy.metadata.apyMethodology || defaultAPYTooltip} - - {strategyInfo && ( - - - Strategy APY: - - Including fees and Defi spring rewards - - - - {(strategyInfo.apySplit.baseApy * 100).toFixed(2)}% - - - )} - {strategyInfo && strategyInfo.apySplit.rewardsApy > 0 && ( - - - Rewards APY: - - Incentives by STRKFarm - - - - {(strategyInfo.apySplit.rewardsApy * 100).toFixed(2)}% - - - )} - - } - > - - - APY - - - {((strategyInfo?.apy || 0) * 100).toFixed(2)}% - - - - - - - 🔥{leverage.toFixed(2)}x boosted - {leverage === 0 && } - - - - {!isMobile && !strategy.settings.hideHarvestInfo && ( = ({ strategy, balData }) => { Next Harvest in:{' '} {harvestTimestamp.isZero && ( - + Anytime now )} @@ -223,105 +96,52 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { gap="10px" justifyContent="space-between" > - - - Days - - - {harvestTimestamp.days ?? 0} - - - - - - Hour - - - {harvestTimestamp.hours ?? 0} - - - - - - Mins - - - {harvestTimestamp.minutes ?? 0} - - - - - - Secs - - ( + - {harvestTimestamp.seconds ?? 0} - - + + {item.label} + + + {item.value} + + + ))} @@ -329,32 +149,18 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { - - - Contract details - - - {!strategy.settings.hideHarvestInfo && ( = ({ strategy, balData }) => { STRK - | + + {' '} + |{' '} + - - + + - + + + + + What are strategies? + + {/* */} + + + + Strategies are structured investment plans that combine multiple + liquidity pools or protocols to optimize returns. They automate + the process of maximizing yield by intelligently allocating assets + across opportunities. + + + + + {/* What are strategies? @@ -67,7 +94,7 @@ export default function Strategies() { process of maximizing yield by intelligently allocating assets across opportunities. - + */}
+ + + + + + + + + + + {transactions.map((tx, index) => { const token = getTokenInfoFromAddr(tx.asset); const decimals = token?.decimals; - const isDeposit = tx.type === 'deposit'; + return ( - - - - {isDeposit ? ( - - ) : ( - - )} - - - {isDeposit ? 'Deposited' : 'Withdrawn'} - - - - Amount:{' '} + + + + + + ); })} + +
+ # + + Amount + + Transaction type + + Wallet address + + Time +
+ {index + 1}. + {Number( new MyNumber( tx.amount, @@ -108,239 +122,205 @@ export function TransactionsTab(props: TransactionsTabProps) { ).toEtherToFixedDecimals(token.displayDecimals), ).toLocaleString()}{' '} {token?.name} - - - Wallet:{' '} - + + + {tx.type === 'deposit' ? ( + + + + ) : ( + + + + )} + + {capitalize(tx.type)} + + + - {shortAddress(tx.txHash)} - - - - {timeAgo(new Date(tx.timestamp * 1000))} - - + + {shortAddress(tx.txHash)} + + + + + {timeAgo(new Date(tx.timestamp * 1000))} + +
+ + + ) + ); +} + +function MobileTransactionHistory(props: { transactions: ITransaction[] }) { + const { transactions: transactions } = props; + + return ( + <> + {transactions.map((tx, index) => { + const token = getTokenInfoFromAddr(tx.asset); + const decimals = token?.decimals; + const isDeposit = tx.type === 'deposit'; + + return ( + + + + {isDeposit ? ( + + ) : ( + + )} + + + {isDeposit ? 'Deposited' : 'Withdrawn'} + - ) : ( - - No transactions found + + Amount:{' '} + {Number( + new MyNumber(tx.amount, decimals!).toEtherToFixedDecimals( + token.displayDecimals, + ), + ).toLocaleString()}{' '} + {token?.name} - ) - ) : ( - - Connect your wallet to view transaction history - - )} - {strategy.settings.isTransactionHistDisabled && ( - - Transaction history is not available for this strategy yet. If - enabled in future, will include the entire history. - - )} -
- ); - } + + Wallet:{' '} + + {shortAddress(tx.txHash)} + + + + {timeAgo(new Date(tx.timestamp * 1000))} + + + ); + })} + + ); +} + +export function TransactionsTab(props: TransactionsTabProps) { + const { address } = useAccount(); + const { strategy, txHistory, isMobile } = props; return ( - - - + + + Transaction history - {!strategy.settings.isTransactionHistDisabled && ( - - There may be delays fetching data. If your transaction {`isn't`}{' '} + + There may be delays in fetching data. If your transaction isn't found, try again later. )} - - - - {address ? ( - <> - {!strategy.settings.isTransactionHistDisabled && - txHistory.findManyInvestment_flows.length !== 0 && ( - <> - - - - - - - - - - - - - {txHistory.findManyInvestment_flows.map((tx, index) => { - const token = getTokenInfoFromAddr(tx.asset); - const decimals = token?.decimals; - - return ( - - - - - - - - ); - })} - -
- # - - Amount - - Transaction type - - Wallet address - - Time -
- {index + 1}. - - {Number( - new MyNumber( - tx.amount, - decimals!, - ).toEtherToFixedDecimals( - token.displayDecimals, - ), - ).toLocaleString()}{' '} - {token?.name} - - - {tx.type === 'deposit' ? ( - - - - ) : ( - - - - )} - - {capitalize(tx.type)} - - - - - {shortAddress(tx.txHash)}{' '} - - - - - - {timeAgo(new Date(tx.timestamp * 1000))} - -
-
- - )} - + + {address ? ( + txHistory.findManyInvestment_flows.length !== 0 ? ( + isMobile ? ( + + ) : ( + + ) ) : ( - - Connect your wallet to view transaction history + + No transactions found - )} - - {/* If no filtered tx */} - {address && - !strategy.settings.isTransactionHistDisabled && - txHistory.findManyInvestment_flows.length === 0 && ( - - No transactions found - - )} - - {strategy.settings.isTransactionHistDisabled && ( - - Transaction history is not available for this strategy yet. If - enabled in future, will include the entire history. - - )} -
+ ) + ) : ( + + Connect your wallet to view transaction history + + )} + {strategy.settings.isTransactionHistDisabled && ( + + Transaction history is not available for this strategy yet. If enabled + in future, will include the entire history. + + )}
); } From 86c5ba7004a4e0cbf069cc723e8534273c26dcb9 Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Fri, 20 Jun 2025 20:55:56 +0530 Subject: [PATCH 30/48] clean landing page --- src/app/page.tsx | 12 +- src/components/Navbar.tsx | 10 +- src/components/Pools.tsx | 191 ++++++++------------- src/components/Strategies.tsx | 135 +++++++-------- src/components/TVL.tsx | 15 +- src/components/YieldCard.tsx | 310 +++++++++++++++------------------- src/store/strkfarm.atoms.ts | 2 +- src/style.ts | 12 ++ 8 files changed, 303 insertions(+), 384 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 2217ecae..9742d5cf 100755 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -116,8 +116,8 @@ export default function Home() { @@ -192,7 +192,11 @@ export default function Home() { {/*
*/}
- +
@@ -202,7 +206,7 @@ export default function Home() { marginTop={'20px'} borderTop={'1px solid var(--chakra-colors-highlight)'} textAlign={'center'} - textColor={'color2'} + textColor={'purple'} padding="10px 0" fontSize={'13px'} > diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index eaa73fc4..f35093d4 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -483,16 +483,18 @@ export default function Navbar(props: NavbarProps) { pfp{' '} {starkProfile && starkProfile.name diff --git a/src/components/Pools.tsx b/src/components/Pools.tsx index 11b3ecf8..2d6311a3 100755 --- a/src/components/Pools.tsx +++ b/src/components/Pools.tsx @@ -31,6 +31,71 @@ import { useAtomValue, useSetAtom } from 'jotai'; import { useMemo, useState } from 'react'; import YieldCard, { HeaderSorter } from './YieldCard'; +function MyPagination(props: { + pagesCount: number; + currentPage: number; + setCurrentPage: (page: number) => void; + pages: number[]; +}) { + const { pagesCount, currentPage, setCurrentPage, pages } = props; + return ( + { + setCurrentPage(page); + }} + > + + + {'<'} + + + {pages.map((page: number) => ( + + ))} + + + {'>'} + + + + ); +} + export default function Pools() { const allPools = useAtomValue(allPoolsAtomUnSorted); const _filteredPools = useAtomValue(filteredPools); @@ -126,72 +191,12 @@ export default function Pools() { width={{ base: '100%', md: '30%' }} marginTop={'10px'} > - { - setCurrentPage(page); - }} - > - - - {'<'} - - - {pages.map((page: number) => ( - - ))} - - - {'>'} - - - + setCurrentPage={setCurrentPage} + pages={pages} + /> @@ -287,62 +292,12 @@ export default function Pools() { - { - setCurrentPage(page); - }} - > - - - {'<'} - - - {pages.map((page: number) => ( - - ))} - - - {'>'} - - - + setCurrentPage={setCurrentPage} + pages={pages} + /> ); } diff --git a/src/components/Strategies.tsx b/src/components/Strategies.tsx index 91b1ba2e..80553ec5 100755 --- a/src/components/Strategies.tsx +++ b/src/components/Strategies.tsx @@ -4,7 +4,6 @@ import { AccordionItem, AccordionPanel, Container, - Link, Skeleton, Stack, Table, @@ -19,7 +18,6 @@ import { useAtomValue } from 'jotai'; import React, { useMemo } from 'react'; import { Accordion } from '@chakra-ui/react'; -import CONSTANTS from '@/constants'; import { filteredPools } from '@/store/protocols'; import { STRKFarmBaseAPYsAtom, @@ -59,7 +57,7 @@ export default function Strategies() { marginTop={'0px'} display={'flex'} flexDirection={'column'} - gap={'16px'} + gap={'1rem'} > - {/* - - What are strategies? - - - Strategies are structured investment plans that combine multiple - liquidity pools or protocols to optimize returns. They automate the - process of maximizing yield by intelligently allocating assets across - opportunities. - - */} - - - 0 && ( + +
- - - - - - {address != undefined && ( - + + + + + + {address != undefined && ( + + )} + + + + {strkFarmPools.length > 0 && ( + <> + {strkFarmPools.map((pool, index) => { + return ( + + ); + })} + )} - - - - {strkFarmPools.length > 0 && ( - <> - {strkFarmPools.map((pool, index) => { - return ( - - ); - })} - - )} - -
- Strategy name - - APY - - Risk - - TVL - - MY BAL +
+ Strategy name + APY + + Risk + + TVL + + MY BAL +
+ +
- {/* + {/* {strkFarmPools.length > 0 && ( <> {strkFarmPools.map((pool, index) => { @@ -159,7 +151,9 @@ export default function Strategies() { )} */} - + + )} + {strkFarmPools.length === 0 && ( @@ -168,19 +162,6 @@ export default function Strategies() { )} - - More strategies coming soon. Join our{' '} - - Telegram channel - {' '} - to stay upto date. -
); } diff --git a/src/components/TVL.tsx b/src/components/TVL.tsx index db3644c8..5b0a9115 100755 --- a/src/components/TVL.tsx +++ b/src/components/TVL.tsx @@ -2,6 +2,7 @@ import { addressAtom } from '@/store/claims.atoms'; import { referralCodeAtom } from '@/store/referral.store'; import { strategiesAtom } from '@/store/strategies.atoms'; import { dAppStatsAtom, userStatsAtom } from '@/store/utils.atoms'; +import { MYSTYLES } from '@/style'; import { copyReferralLink, getHosturl } from '@/utils'; import { CopyIcon } from '@chakra-ui/icons'; import { @@ -53,10 +54,10 @@ const TVL: React.FC = () => { // borderColor={'color_3'} > - + Total Value locked (TVL) - + $ {isPending ? ( @@ -80,10 +81,8 @@ const TVL: React.FC = () => { // borderColor={'color_3'} > - - Your holdings - - + Your holdings + $ {userStatsPending ? ( @@ -107,7 +106,7 @@ const TVL: React.FC = () => { // borderColor={'color_3'} > - + Your referral link{' '} {/* TODO: update the url */} @@ -129,13 +128,13 @@ const TVL: React.FC = () => { ) : ( { copyReferralLink(referralCode); }} + {...MYSTYLES.TEXT.H1Label} > {referralCode} diff --git a/src/components/YieldCard.tsx b/src/components/YieldCard.tsx index 3210fa3a..ecbea54d 100644 --- a/src/components/YieldCard.tsx +++ b/src/components/YieldCard.tsx @@ -24,6 +24,7 @@ import { Text, Tooltip, Tr, + VStack, } from '@chakra-ui/react'; import { ContractAddr } from '@strkfarm/sdk'; import { useAtomValue } from 'jotai'; @@ -38,13 +39,14 @@ export interface YieldCardProps { } export function getStratCardBg(status: StrategyLiveStatus, index: number) { - if (isLive(status)) { - return index % 2 === 0 ? 'mycard_dark' : 'mycard_dark'; - } - if (status == StrategyLiveStatus.RETIRED) { - return 'black'; - } - return 'bg'; + // if (isLive(status)) { + // return index % 2 === 0 ? 'mycard_dark' : 'mycard_dark'; + // } + // if (status == StrategyLiveStatus.RETIRED) { + // return 'black'; + // } + // return 'bg'; + return 'mycard_dark'; } function getStratCardBadgeBg(status: StrategyLiveStatus) { @@ -61,80 +63,94 @@ function getStratCardBadgeBg(status: StrategyLiveStatus) { export function StrategyInfo(props: YieldCardProps) { const { pool } = props; + const tags = useMemo(() => { + if (!pool.additional || !pool.additional.tags) return []; + return pool.additional.tags.filter( + (tag) => tag != StrategyLiveStatus.ACTIVE, + ); + }, [pool.additional]); + return ( - + {pool.pool.logos.map((logo, index) => ( ))} - - - - {pool.pool.name} - - {pool.additional && - pool.additional.tags - .filter((tag) => tag != StrategyLiveStatus.ACTIVE) - .map((tag) => { - return ( - + + + + {pool.pool.name} + + {pool.additional && pool.additional.auditUrl && ( + + + - {tag} - - ); - })} - {pool.additional && pool.additional.auditUrl && ( - - - - badge - - - + badge + + + + )} + + {tags.length > 0 && ( + + + {tags.map((tag) => { + return ( + + {tag} + + ); + })} + + )} - + {props.showProtocolName && ( - + {pool.protocol.name} )} - + ); @@ -463,119 +479,65 @@ function GetRiskLevel(riskFactor: number) { function StrategyMobileCard(props: YieldCardProps) { const { pool, index } = props; - const isNew = pool.additional?.tags?.includes(StrategyLiveStatus.NEW); - const hasAudit = !!pool.additional?.auditUrl; const riskLevel = pool.additional?.riskFactor || 0; - // Only show the main protocol - const protocol = pool.protocol; + const isRetired = useMemo(() => { + return isPoolRetired(pool); + }, [pool]); return ( - - {/* Top row: Avatars, name, shield, New badge */} - - - - {pool.pool.logos.slice(0, 2).map((logo, i) => ( - - ))} - - - {pool.pool.name} - - {hasAudit && ( - - badge - - )} - - {isNew && ( - - New - + + - - {/* Protocol row */} - - - - - {protocol.name} - - - - - {/* APY, TVL, Risk row */} - - - - APY - - - {(pool.apr * 100).toFixed(2)}% - - - - - TVL - - - {`$${getDisplayCurrencyAmount(pool.tvl, 0)}`} - - - - - Risk - - - {[...Array(5)].map((_, i) => ( - - ))} - - - - + filter={isRetired ? 'opacity(0.5)' : 'none'} + borderRadius="lg" + padding="18px 18px 14px 18px" + marginBottom={'10px'} + width="100%" + position="relative" + > + {/* Top row: Avatars, name, shield, New badge */} + + + + + {/* APY, TVL, Risk row */} + + + + APY + + + {(pool.apr * 100).toFixed(2)}% + + + + + TVL + + + {`$${getDisplayCurrencyAmount(pool.tvl, 0)}`} + + + + + Risk + + + {GetRiskLevel(pool.additional?.riskFactor)} + + + + + ); } @@ -612,7 +574,11 @@ export default function YieldCard(props: YieldCardProps) { { - name = 'STRKFarm'; + name = 'Troves'; logo = strkfarmLogo.src; incentiveDataKey = ''; diff --git a/src/style.ts b/src/style.ts index e69de29b..51d73adc 100644 --- a/src/style.ts +++ b/src/style.ts @@ -0,0 +1,12 @@ +export const MYSTYLES = { + TEXT: { + H2Label: { + fontSize: { base: '15px', md: '18px' }, + color: 'text_secondary', + }, + H1Label: { + fontSize: { base: '20px', md: '24px' }, + color: 'text_primary', + }, + }, +}; From 722501c323599a4d32f0912516d8f3c9ac0cebbc Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Fri, 20 Jun 2025 21:52:22 +0530 Subject: [PATCH 31/48] fix strategy page mobile --- .../[strategyId]/_components/DetailsTab.tsx | 67 +- .../[strategyId]/_components/FAQTab.tsx | 33 +- .../[strategyId]/_components/ManageTab.tsx | 7 +- .../[strategyId]/_components/RiskTab.tsx | 95 +-- .../[strategyId]/_components/Strategy.tsx | 696 ++++++------------ .../[strategyId]/_components/StrategyInfo.tsx | 10 +- .../[strategyId]/_components/TokenDeposit.tsx | 4 +- .../_components/TransactionsTab.tsx | 29 +- src/components/AmountInput.tsx | 8 +- src/components/HarvestTime.tsx | 45 +- src/components/Pools.tsx | 2 +- src/components/Strategies.tsx | 2 +- src/components/TxButton.tsx | 3 +- 13 files changed, 296 insertions(+), 705 deletions(-) diff --git a/src/app/strategy/[strategyId]/_components/DetailsTab.tsx b/src/app/strategy/[strategyId]/_components/DetailsTab.tsx index d1cf08a0..88a821ae 100644 --- a/src/app/strategy/[strategyId]/_components/DetailsTab.tsx +++ b/src/app/strategy/[strategyId]/_components/DetailsTab.tsx @@ -13,69 +13,14 @@ interface DetailsTabProps { export function DetailsTab(props: DetailsTabProps) { const { strategy, isMobile } = props; - if (isMobile) { - return ( - - - - Behind the scenes - - - Actions done automatically by the strategy (smart-contract) with an - investment of $1000 - - - - {strategy.actions.length > 0 && ( - - <> - - Action - - {strategy.actions.map((action, index) => ( - - {action.name.toLowerCase().includes('stake') || - action.name.toLowerCase().includes('supply') ? ( - - ) : action.name.toLowerCase().includes('borrow') ? ( - - ) : ( - - )} - - {action.name} - - - ))} - {strategy.actions.length == 0 && ( -
- -
- )} - -
- )} - - -
- ); - } - return ( - + - + Behind the scenes diff --git a/src/app/strategy/[strategyId]/_components/FAQTab.tsx b/src/app/strategy/[strategyId]/_components/FAQTab.tsx index 0872312f..dfb92f50 100644 --- a/src/app/strategy/[strategyId]/_components/FAQTab.tsx +++ b/src/app/strategy/[strategyId]/_components/FAQTab.tsx @@ -18,16 +18,19 @@ interface FAQTabProps { } export function FAQTab(props: FAQTabProps) { - const { strategy, isMobile } = props; + const { strategy } = props; return ( - - + + Get your questions answered - - - + + {!strategy.metadata.faqs && ( No FAQs at the moment @@ -38,6 +41,7 @@ export function FAQTab(props: FAQTabProps) { display={'flex'} flexDirection={'column'} gap={'16px'} + allowToggle={true} > {strategy.metadata.faqs && strategy.metadata.faqs.length > 0 && @@ -81,20 +85,19 @@ export function FAQTab(props: FAQTabProps) { gap={'16px'} marginLeft={'auto'} marginRight={'auto'} + width={{ base: '100%', md: '50%' }} > For more queries reach out to us on Telegram @@ -102,7 +105,7 @@ export function FAQTab(props: FAQTabProps) { Our team will respond to you soon! @@ -115,13 +118,13 @@ export function FAQTab(props: FAQTabProps) { padding={'12px 20px'} borderRadius={'100px'} borderWidth={'1px'} - borderColor={'color_7'} - color={'color_7'} + borderColor={'purple'} + color={'purple'} fontSize={'14px'} fontWeight={'700'} _hover={{ - bg: 'transparent', - color: 'color_7', + bg: 'mycard_dark', + color: 'purple', }} > Connect on Telegram diff --git a/src/app/strategy/[strategyId]/_components/ManageTab.tsx b/src/app/strategy/[strategyId]/_components/ManageTab.tsx index 59f527e3..76058189 100644 --- a/src/app/strategy/[strategyId]/_components/ManageTab.tsx +++ b/src/app/strategy/[strategyId]/_components/ManageTab.tsx @@ -1,4 +1,4 @@ -import { Flex, ListItem, Text, UnorderedList } from '@chakra-ui/react'; +import { Box, Flex, Text } from '@chakra-ui/react'; import React from 'react'; import { StrategyInfo } from '@/store/strategies.atoms'; @@ -30,7 +30,7 @@ export function ManageTab(props: ManageTabProps) { How does it work? - Withdraw anytime by redeeming your NFT for USDC. - + */} + {strategy.description} {/* diff --git a/src/app/strategy/[strategyId]/_components/RiskTab.tsx b/src/app/strategy/[strategyId]/_components/RiskTab.tsx index f2f091b0..6f721528 100644 --- a/src/app/strategy/[strategyId]/_components/RiskTab.tsx +++ b/src/app/strategy/[strategyId]/_components/RiskTab.tsx @@ -9,98 +9,9 @@ interface RiskTabProps { export function RiskTab(props: RiskTabProps) { const { strategy, isMobile } = props; - if (isMobile) { - return ( - - - {strategy.risks.map((r, index) => ( - - {r} - {index === 0 && ( - - {strategy.riskFactor <= 2 - ? 'Low' - : strategy.riskFactor < 4 - ? 'Medium' - : 'High'} - risk - - )} - - ))} - - - ); - } - return ( - - + + ( { } return ( - - - - - - - - - {strategy && ( - - - {!strategy?.isRetired() && strategyCached && ( - - - - )} - - )} - - {strategy && ( - - - - - )} - - - - - { - mixpanel.track('Manage clicked'); - }} - > - Manage - - { - mixpanel.track('Risk clicked'); - }} - > - Risks - - { - mixpanel.track('Details clicked'); - }} - > - Details - - { - mixpanel.track('FAQs clicked'); - }} - > - FAQs - - { - mixpanel.track('Transactions clicked'); - }} - > - Transactions - - - - - - {strategy && } - - - - {strategy && } - - - - {strategyCached && } - - - - {strategy && } - - - - {strategy && ( - - )} - - - - - - - - {/* MOBILE VIEW */} - - - + + - - - - - - {strategy?.name} - - {strategy?.settings.isAudited && ( - - badge - - )} - - - - - - - APY - - - {strategyCached?.apySplit?.baseApy - ? `${(strategyCached.apySplit.baseApy * 100).toFixed(2)}%` - : '23.94%'} - - - - - 🔥 - - {`${strategyCached?.leverage?.toFixed(2)}x boosted`} - - - - Contract details - - - - - - - Your holdings: - - - {address && balData && balData.data && balData.data.tokenInfo - ? `${balData.data.amount.toEtherToFixedDecimals(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : '-'} - - - - - Net earnings: - - 0 ? 'cyan' : profit < 0 ? 'red' : 'text'} - fontWeight="extrabold" - fontSize="22px" - > - {address && - profit !== 0 && - !strategy?.isRetired() && - balData.data && - balData.data.tokenInfo - ? `${profit?.toFixed(balData.data.tokenInfo?.displayDecimals || 2)} ${balData.data.tokenInfo?.name}` - : '-'} - - - - - {strategy && } + - - - { - if (Array.isArray(expandedIndex)) { - setAccordionIndex(expandedIndex[0] ?? 0); - } else { - setAccordionIndex(expandedIndex); - } - }} - allowToggle - width="100%" - display="flex" - flexDirection="column" - gap="10px" + {strategy && ( + + + {!strategy?.isRetired() && strategyCached && ( + + + + )} + + )} + + {strategy && ( + + + + + )} + + + {!isMobile && ( + - - + { + mixpanel.track('Manage clicked'); + }} > - - Manage - - - - - {strategy && } - - - - + { + mixpanel.track('Risk clicked'); + }} > - - Risk - - - - - {strategy && } - - - - + { + mixpanel.track('Details clicked'); + }} > - - Details - - - - - {strategyCached && ( - - )} - - - - + { + mixpanel.track('FAQs clicked'); + }} > - - FAQs - - - - - {strategy && } - - - - + { + mixpanel.track('Transactions clicked'); + }} > - - Transactions - - - - + Transactions + + + + + + {strategy && } + + + + {strategy && } + + + + {strategyCached && } + + + + {strategy && } + + + {strategy && ( - + )} - - - - - + + + + )} + + {/* MOBILE VIEW */} + {isMobile && ( + + { + if (Array.isArray(expandedIndex)) { + setAccordionIndex(expandedIndex[0] ?? 0); + } else { + setAccordionIndex(expandedIndex); + } + }} + allowToggle + width="100%" + display="flex" + flexDirection="column" + gap="10px" + borderRadius={'lg'} + > + {strategy && + [ + { + label: 'Manage', + content: , + }, + { + label: 'Risk', + content: , + }, + { + label: 'Details', + content: strategyCached && ( + + ), + }, + { + label: 'FAQs', + content: , + }, + { + label: 'Transactions', + content: ( + + ), + }, + ].map((item, index) => ( + + + + {item.label} + + + + + {item.content} + + + ))} + + + )} +
); }; diff --git a/src/app/strategy/[strategyId]/_components/StrategyInfo.tsx b/src/app/strategy/[strategyId]/_components/StrategyInfo.tsx index 12f013e4..cd0b1c50 100644 --- a/src/app/strategy/[strategyId]/_components/StrategyInfo.tsx +++ b/src/app/strategy/[strategyId]/_components/StrategyInfo.tsx @@ -7,7 +7,7 @@ export function StrategyInfoComponent(props: { strategy: StrategyInfo }) { return ( - + {strategy && strategy.metadata.depositTokens.length > 0 && strategy.metadata.depositTokens.map((token: any) => { @@ -16,8 +16,6 @@ export function StrategyInfoComponent(props: { strategy: StrategyInfo }) { key={token.address} marginRight={'5px'} src={token.logo} - width={'64px'} - height={'64px'} /> ); })} @@ -30,7 +28,11 @@ export function StrategyInfoComponent(props: { strategy: StrategyInfo }) { /> )} - + {strategy ? strategy.name : 'Strategy Not found'} diff --git a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx index a1573277..ba1744ae 100644 --- a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx +++ b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx @@ -51,7 +51,7 @@ function DesktopTransactionHistory(props: { transactions: ITransaction[] }) { sx={{ overflow: 'hidden', 'border-collapse': 'separate', - 'border-spacing': '0px 5px', + 'border-spacing': '0px 3px', }} > - Wallet address + Transaction hash - - Wallet:{' '} + + Tx Hash:{' '} - + {timeAgo(new Date(tx.timestamp * 1000))} @@ -295,30 +293,29 @@ export function TransactionsTab(props: TransactionsTabProps) { No transactions found ) - ) : ( + ) : strategy.settings.isTransactionHistDisabled ? ( - Connect your wallet to view transaction history + Transaction history is not available for this strategy yet. If enabled + in future, will include the entire history. - )} - {strategy.settings.isTransactionHistDisabled && ( + ) : ( - Transaction history is not available for this strategy yet. If enabled - in future, will include the entire history. + Connect your wallet to view transaction history )} diff --git a/src/components/AmountInput.tsx b/src/components/AmountInput.tsx index 3e56669b..00cc766d 100644 --- a/src/components/AmountInput.tsx +++ b/src/components/AmountInput.tsx @@ -482,7 +482,9 @@ const AmountInput = forwardRef( as={Button} height={'100%'} rightIcon={} - width={'200px'} + maxWidth={'200px'} + minWidth={'140px'} + width={'100%'} bg={'mycard_light'} color="text_primary" fontSize={'16px'} @@ -611,7 +613,7 @@ const AmountInput = forwardRef( {simulatedMaxAmount.amount === 0 && ( + The liquidity at the current market price, is only in{' '} { inputsInfo.find((_, index) => index !== props.index) @@ -625,8 +627,8 @@ const AmountInput = forwardRef( The liquidity at the current market price, is only in{' '} { diff --git a/src/components/HarvestTime.tsx b/src/components/HarvestTime.tsx index 08ff052e..644f9d44 100644 --- a/src/components/HarvestTime.tsx +++ b/src/components/HarvestTime.tsx @@ -5,7 +5,6 @@ import { StrategyInfo } from '@/store/strategies.atoms'; import { HarvestTimeAtom } from '@/store/harvest.atom'; import { useAtomValue } from 'jotai'; import { formatTimediff, getDisplayCurrencyAmount } from '@/utils'; -import { isMobile } from 'react-device-detect'; interface HarvestTimeProps { strategy: StrategyInfo; @@ -64,7 +63,7 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { return ( - {!isMobile && !strategy.settings.hideHarvestInfo && ( + {!strategy.settings.hideHarvestInfo && ( @@ -152,28 +151,22 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { {!strategy.settings.hideHarvestInfo && ( - Total rewards harvested: - - - + Total rewards harvested:{' '} {getDisplayCurrencyAmount( harvestTime?.data?.totalStrkHarvestedByContract.STRKAmount || 0, 2, @@ -181,27 +174,17 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { STRK - - {' '} - |{' '} - - - Total number of times harvested: - - - - - + Total number of times harvested: - )} diff --git a/src/components/Pools.tsx b/src/components/Pools.tsx index 2d6311a3..1ae9176a 100755 --- a/src/components/Pools.tsx +++ b/src/components/Pools.tsx @@ -207,7 +207,7 @@ export default function Pools() { sx={{ overflow: 'hidden', 'border-collapse': 'separate', - 'border-spacing': '0px 7px', + 'border-spacing': '0px 3px', }} gap={2} > diff --git a/src/components/Strategies.tsx b/src/components/Strategies.tsx index 80553ec5..9290f1b4 100755 --- a/src/components/Strategies.tsx +++ b/src/components/Strategies.tsx @@ -90,7 +90,7 @@ export default function Strategies() { sx={{ overflow: 'hidden', 'border-collapse': 'separate', - 'border-spacing': '0px 7px', + 'border-spacing': '0px 3px', }} gap={2} > diff --git a/src/components/TxButton.tsx b/src/components/TxButton.tsx index 31f5caff..148d1db9 100755 --- a/src/components/TxButton.tsx +++ b/src/components/TxButton.tsx @@ -148,10 +148,9 @@ export default function TxButton(props: TxButtonProps) { Date: Sat, 21 Jun 2025 11:24:40 +0530 Subject: [PATCH 32/48] integrate dynamic strat data --- package.json | 4 +- src/app/layout.tsx | 9 +- .../[strategyId]/_components/DetailsTab.tsx | 24 +- .../[strategyId]/_components/FAQTab.tsx | 11 +- .../[strategyId]/_components/ManageTab.tsx | 4 +- .../[strategyId]/_components/RiskTab.tsx | 218 +++++++++----- .../[strategyId]/_components/Strategy.tsx | 8 +- .../[strategyId]/_components/StrategyInfo.tsx | 38 ++- .../_components/TransactionsTab.tsx | 5 +- src/app/template.tsx | 1 + src/components/ContractDetails.tsx | 92 +++++- src/components/Deposit.tsx | 41 +-- src/components/HarvestTime.tsx | 2 +- src/components/MobileHarvestTime.tsx | 285 ------------------ src/constants.ts | 1 + src/strategies/delta_neutral_mm.ts | 1 + yarn.lock | 51 +++- 17 files changed, 342 insertions(+), 453 deletions(-) delete mode 100644 src/components/MobileHarvestTime.tsx diff --git a/package.json b/package.json index e57f4cc8..125daa2a 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.45", + "@strkfarm/sdk": "^1.0.47", "@tanstack/query-core": "5.28.0", "@types/mixpanel-browser": "2.49.0", "@types/mustache": "4.2.5", @@ -102,7 +102,7 @@ "typescript": "5" }, "engines": { - "node": "20.x" + "node": ">=20.x" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f8e6fb23..cf4a1137 100755 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -34,9 +34,14 @@ export default function RootLayout({ - + + + - + {children} diff --git a/src/app/strategy/[strategyId]/_components/DetailsTab.tsx b/src/app/strategy/[strategyId]/_components/DetailsTab.tsx index 88a821ae..b944ed6d 100644 --- a/src/app/strategy/[strategyId]/_components/DetailsTab.tsx +++ b/src/app/strategy/[strategyId]/_components/DetailsTab.tsx @@ -15,31 +15,17 @@ export function DetailsTab(props: DetailsTabProps) { return ( - - - Behind the scenes - - - Actions done automatically by the strategy (smart-contract) with an - investment of $1000 - - - - + {strategy.actions.length > 0 && ( <> - Action + Steps performed by the strategy {strategy.actions.map((action, index) => ( diff --git a/src/app/strategy/[strategyId]/_components/FAQTab.tsx b/src/app/strategy/[strategyId]/_components/FAQTab.tsx index dfb92f50..567693cb 100644 --- a/src/app/strategy/[strategyId]/_components/FAQTab.tsx +++ b/src/app/strategy/[strategyId]/_components/FAQTab.tsx @@ -31,11 +31,12 @@ export function FAQTab(props: FAQTabProps) { - {!strategy.metadata.faqs && ( - - No FAQs at the moment - - )} + {!strategy.metadata.faqs || + (strategy.metadata.faqs.length == 0 && ( + + No FAQs at the moment + + ))} Withdraw anytime by redeeming your NFT for USDC. */} - {strategy.description} + + {strategy.description} + {/* diff --git a/src/app/strategy/[strategyId]/_components/RiskTab.tsx b/src/app/strategy/[strategyId]/_components/RiskTab.tsx index 6f721528..cdeda95e 100644 --- a/src/app/strategy/[strategyId]/_components/RiskTab.tsx +++ b/src/app/strategy/[strategyId]/_components/RiskTab.tsx @@ -1,5 +1,15 @@ -import { Badge, Flex, ListItem, OrderedList } from '@chakra-ui/react'; +import { + Badge, + Box, + Flex, + ListItem, + OrderedList, + Text, + Tooltip, +} from '@chakra-ui/react'; import { StrategyInfo } from '@/store/strategies.atoms'; +import { getRiskColor, getRiskExplaination } from '@strkfarm/sdk'; +import { useMemo } from 'react'; interface RiskTabProps { strategy: StrategyInfo; @@ -9,84 +19,142 @@ interface RiskTabProps { export function RiskTab(props: RiskTabProps) { const { strategy, isMobile } = props; - return ( - - - { + if (riskValue === 0) { + return 'No risk'; + } else if (riskValue <= 1) { + return 'Very Low'; + } else if (riskValue <= 2) { + return 'Low'; + } else if (riskValue < 3) { + return 'Medium'; + } + return 'High'; + }; - '&::before': { - content: 'attr(data-number)', - position: 'absolute', - left: '10px', - top: '12px', - padding: '4px 8px', - color: 'black', - fontSize: '10px', - borderRadius: '50%', - backgroundColor: 'white', - width: '20px', - height: '20px', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - }, - }, - }} - display={'flex'} - flexDirection={'column'} - gap={'16px'} - > - {strategy.risks.map((r, index) => ( - - {r} - {index === 0 && ( + const risks = useMemo(() => { + const _risks = strategy.metadata.risk.riskFactor.map((risk) => ({ + type: risk.type.toLowerCase(), + value: risk.value, + color: getRiskColor(risk), + toolTip: getRiskExplaination(risk.type), + })); + const noRisks = strategy.metadata.risk.notARisks.map((risk) => ({ + type: risk.toLowerCase(), + value: 0, + color: 'text_secondary', + toolTip: `${getRiskExplaination(risk)}`, + })); + return [..._risks, ...noRisks]; + }, [strategy.metadata.risk.riskFactor, strategy.metadata.risk.notARisks]); + + return ( + + {risks.length > 0 && ( + + + Risk Assessment + + + {risks.map((risk, index) => ( + - {strategy.riskFactor <= 2 - ? 'Low' - : strategy.riskFactor < 4 - ? 'Medium' - : 'High'} - risk + {risk.type}: {getRiskString(risk.value)} - )} - - ))} - - + + ))} + + + )} + + + Risk details + + + + {strategy.risks.map((r, index) => ( + + {r} + {index === 0 && ( + + {getRiskString(strategy.riskFactor)} + {' risk'} + + )} + + ))} + + + ); } diff --git a/src/app/strategy/[strategyId]/_components/Strategy.tsx b/src/app/strategy/[strategyId]/_components/Strategy.tsx index f39a48a4..58338275 100755 --- a/src/app/strategy/[strategyId]/_components/Strategy.tsx +++ b/src/app/strategy/[strategyId]/_components/Strategy.tsx @@ -144,7 +144,13 @@ function HoldingsAndEarnings({ = 0 ? 'light_green_2' : 'red'} + color={ + profit == 0 + ? 'text_secondary' + : profit > 0 + ? 'light_green_2' + : 'red' + } > }) { > {strategy ? strategy.name : 'Strategy Not found'} - - badge - + {strategy.metadata.auditUrl && ( + + + badge + + + )} ); } diff --git a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx index ba1744ae..637ff261 100644 --- a/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx +++ b/src/app/strategy/[strategyId]/_components/TransactionsTab.tsx @@ -22,6 +22,7 @@ import { } from '@/utils'; import MyNumber from '@/utils/MyNumber'; import { StrategyInfo } from '@/store/strategies.atoms'; +import CONSTANTS from '@/constants'; interface ITransaction { amount: string; @@ -163,7 +164,7 @@ function DesktopTransactionHistory(props: { transactions: ITransaction[] }) { color={'text_secondary'} > {shortAddress(tx.txHash)} @@ -243,7 +244,7 @@ function MobileTransactionHistory(props: { transactions: ITransaction[] }) { Tx Hash:{' '} diff --git a/src/app/template.tsx b/src/app/template.tsx index b77d2efe..6594a939 100755 --- a/src/app/template.tsx +++ b/src/app/template.tsx @@ -32,6 +32,7 @@ const theme = extendTheme({ disabled_text: '#818181', disabled_bg: '#5f5f5f', + highlight: '#303136', purple: '#9069F0', purple_60p: '#6F5CA599', purple_hover: '#4C2CD7', diff --git a/src/components/ContractDetails.tsx b/src/components/ContractDetails.tsx index d1f4d48c..d8971305 100644 --- a/src/components/ContractDetails.tsx +++ b/src/components/ContractDetails.tsx @@ -1,19 +1,89 @@ -import { Flex, Link } from '@chakra-ui/react'; +import { + Accordion, + AccordionButton, + AccordionIcon, + AccordionItem, + AccordionPanel, + Flex, + Image, + Link, + Text, +} from '@chakra-ui/react'; import { ExternalLinkIcon } from '@chakra-ui/icons'; import { StrategyInfo } from '@/store/strategies.atoms'; +import CONSTANTS from '@/constants'; +import shield from '@/assets/shield.svg'; export function ContractDetails(props: { strategy: StrategyInfo }) { + const { strategy } = props; return ( - - - Contract details - + + {props.strategy.metadata.contractDetails.length > 0 && ( + + + + Contracts Info + + + + {props.strategy.metadata.contractDetails.map( + (contract, index) => ( + + + {index + 1}. {contract.name} + + + + + + ), + )} + + + + )} + + {strategy.metadata.docs && ( + + Docs + + )} + {strategy.metadata.auditUrl && ( + + badge + Audit + + )} + ); } diff --git a/src/components/Deposit.tsx b/src/components/Deposit.tsx index e8e553ed..7c0b0be9 100755 --- a/src/components/Deposit.tsx +++ b/src/components/Deposit.tsx @@ -393,25 +393,28 @@ function InternalDeposit(props: DepositProps) { width="100%" marginTop={'15px'} gap={'6px'} + fontSize={'12px'} > - - - {!tvlInfo || !tvlInfo?.data ? ( - - ) : ( - Number( - tvlInfo.data?.amounts[0].amount.toFixed(2), - ).toLocaleString() - )} - - - {' '} - {' / '} - - - {props.strategy.settings.maxTVL.toLocaleString()}{' '} - {inputsInfo[0].tokenInfo?.symbol} - + + TVL Limt: + + + {!tvlInfo || !tvlInfo?.data ? ( + + ) : ( + Number( + tvlInfo.data?.amounts[0].amount.toFixed(2), + ).toLocaleString() + )} + + + {'/'} + + + {props.strategy.settings.maxTVL.toLocaleString()}{' '} + {inputsInfo[0].tokenInfo?.symbol} + + - + TVL limit reached. Please wait for increase in limits. diff --git a/src/components/HarvestTime.tsx b/src/components/HarvestTime.tsx index 644f9d44..b3f1fae7 100644 --- a/src/components/HarvestTime.tsx +++ b/src/components/HarvestTime.tsx @@ -153,7 +153,7 @@ const HarvestTime: React.FC = ({ strategy, balData }) => { alignItems={'center'} marginTop={'10px'} gap={'2'} - direction={{ base: 'column', md: 'row' }} + direction={{ base: 'column' }} width={'100%'} > ; -} - -const MobileHarvestTime: React.FC = ({ strategy }) => { - const { address } = useAccount(); - const holdingToken: any = strategy.holdingTokens[0]; - const contractAddress = holdingToken.address || holdingToken.token || ''; - - const harvestTimeAtom = useMemo( - () => HarvestTimeAtom(contractAddress), - [address], - ); - - const harvestTime = useAtomValue(harvestTimeAtom); - - const data = harvestTime.data?.findManyHarvests[0]; - - const lastHarvest = useMemo(() => { - if (!data || !data.timestamp) return null; - return new Date(Number(data.timestamp) * 1000); - }, [data?.timestamp]); - - const harvestTimestamp = useMemo(() => { - const DAYMS = 86400 * 1000; - // Base date is last harvest time + 2 days or now (for no harvest strats) - const baseDate = lastHarvest - ? new Date(lastHarvest.getTime() + 2 * DAYMS) - : new Date(); - - // With base date, get next sunday 12am UTC - // set date to coming sunday in UTC - const nextHarvest = baseDate; - nextHarvest.setUTCDate( - nextHarvest.getUTCDate() + (7 - nextHarvest.getUTCDay()), - ); - nextHarvest.setUTCHours(0); - nextHarvest.setUTCMinutes(0); - nextHarvest.setUTCSeconds(0); - - // if nextHarvest is within 24hrs of last harvest, - // increase it by 7 days - // This is needed as harvest can happen anytime near deadline - if ( - lastHarvest && - nextHarvest.getTime() - lastHarvest.getTime() < 86400 * 1000 - ) { - nextHarvest.setUTCDate(nextHarvest.getUTCDate() + 7); - } - - return formatTimediff(nextHarvest); - }, [data?.timestamp, lastHarvest]); - - const strategiesInfo = useAtomValue(STRKFarmAtoms.baseAPRs!); - - const strategyInfo = useMemo(() => { - if (!strategiesInfo || !strategiesInfo.data) return null; - - const strategiesList: STRKFarmStrategyAPIResult[] = - strategiesInfo.data.strategies; - const strategyInfo = strategiesList.find( - (strat) => strat.id == strategy.id, - ); - return strategyInfo ? strategyInfo : null; - }, [strategiesInfo]); - - return ( - - - {!strategy.settings.hideHarvestInfo && ( - - - - Next Harvest in:{' '} - {harvestTimestamp.isZero && ( - - Anytime now - - )} - - - - - - Days - - - {harvestTimestamp.days ?? 0} - - - - - - Hour - - - {harvestTimestamp.hours ?? 0} - - - - - - Mins - - - {harvestTimestamp.minutes ?? 0} - - - - - - Secs - - - {harvestTimestamp.seconds ?? 0} - - - - - - )} - - - - {!strategy.settings.hideHarvestInfo && ( - - - - Total rewards harvested: - - - - {getDisplayCurrencyAmount( - harvestTime?.data?.totalStrkHarvestedByContract.STRKAmount || - 0, - 2, - )}{' '} - STRK - - - - - - Total number of times harvested: - - - - - - - - - )} - - - ); -}; - -export default MobileHarvestTime; diff --git a/src/constants.ts b/src/constants.ts index abc977bb..a43ad513 100755 --- a/src/constants.ts +++ b/src/constants.ts @@ -82,6 +82,7 @@ export const CONSTANTS = { '0x7023a5cadc8a5db80e4f0fde6b330cbd3c17bbbf9cb145cbabd7bd5e6fb7b0b', }, MOBILE_MSG: 'Desktop/Tablet only', + BLOCK_EXPLORER: 'https://voyager.online', }; export const TOKENS: TokenInfo[] = [ diff --git a/src/strategies/delta_neutral_mm.ts b/src/strategies/delta_neutral_mm.ts index 0209c146..84906bf1 100755 --- a/src/strategies/delta_neutral_mm.ts +++ b/src/strategies/delta_neutral_mm.ts @@ -93,6 +93,7 @@ export class DeltaNeutralMM extends IStrategy { netRisk: 0, notARisks: [], }, + contractDetails: [], additionalInfo: undefined, }; diff --git a/yarn.lock b/yarn.lock index 955e3a9b..055abf25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -46,9 +46,9 @@ integrity sha512-BqqazrXDKn5RE1anyl9Ba+Kd/4VaKNsdKTl0ryTfXhMIYp+R4dXMaLD40emfXd+25kxM00xPKiZOiGHl2ntG5g== "@avnu/avnu-sdk@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@avnu/avnu-sdk/-/avnu-sdk-3.0.2.tgz#1751f951380160858bcb8a3fa30a5b4b086d3891" - integrity sha512-N8McoXYEcp1uhSZ4XlEi5BcTpvJDDhUw4kYnlYmPrd7fWezfGy4UHyoFT/A4gqEM4nL3vtENczDNFS1AVfdTnA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/@avnu/avnu-sdk/-/avnu-sdk-3.1.0.tgz#5cd9160954a682cd3b49ba9d21f2e3dee55af8c4" + integrity sha512-Llhh8gY6xoc4u+IdSn7iokpo6C3zbYOpptvM9+2tBQW0cTXTJx4l1fPJVjbxD5wh35wLcDT/FBMJIBH+NuYh/g== "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.21.4", "@babel/code-frame@^7.24.7": version "7.24.7" @@ -2162,10 +2162,10 @@ viem "^2.19.1" zod "^3.22.4" -"@strkfarm/sdk@^1.0.45": - version "1.0.45" - resolved "https://registry.yarnpkg.com/@strkfarm/sdk/-/sdk-1.0.45.tgz#995b4c45c18acd2163d8ecc2a7541cdbe4c9825e" - integrity sha512-YyoRx8Kr1BYJ9rMRthnFArp44HWW8e9Nn5eYxIzPFfVeVWwp2nTAgFLwOJbHgfB5nZZjIUTziQA64zbrFrapYg== +"@strkfarm/sdk@^1.0.47": + version "1.0.47" + resolved "https://registry.yarnpkg.com/@strkfarm/sdk/-/sdk-1.0.47.tgz#9bf397f75f0662ced59ab3e19fdaa62ee1fc8b42" + integrity sha512-znviTKoIyofIYYsl6curANaKNKiTKGEEwCyuTH6w0vG5cbcDXZNTGZIXcDUb5pM9K/UIPpUa3dCp0q1DToINxg== dependencies: "@avnu/avnu-sdk" "^3.0.2" bignumber.js "4.0.4" @@ -2299,12 +2299,12 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@^22.5.5": - version "22.15.30" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.30.tgz#3a20431783e28dd0b0326f84ab386a2ec81d921d" - integrity sha512-6Q7lr06bEHdlfplU6YRbgG1SFBdlsfNC4/lX+SkhiTs0cpJkOElmWls8PxDFv4yY/xKb8Y6SO0OmSX4wgqTZbA== +"@types/node@*": + version "24.0.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.0.3.tgz#f935910f3eece3a3a2f8be86b96ba833dc286cab" + integrity sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg== dependencies: - undici-types "~6.21.0" + undici-types "~7.8.0" "@types/node@18.15.13": version "18.15.13" @@ -2325,6 +2325,13 @@ dependencies: undici-types "~6.19.2" +"@types/node@^22.5.5": + version "22.15.32" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.15.32.tgz#c301cc2275b535a5e54bb81d516b1d2e9afe06e5" + integrity sha512-3jigKqgSjsH6gYZv2nEsqdXfZqIFGAV36XYYjf9KGZ3PSG+IhLecqPnI310RvjutyMwifE2hhhNEklOUrvx/wA== + dependencies: + undici-types "~6.21.0" + "@types/normalize-package-data@^2.4.1": version "2.4.4" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz#56e2cc26c397c038fab0e3a917a12d5c5909e901" @@ -4109,7 +4116,14 @@ enabled@2.0.x: resolved "https://registry.yarnpkg.com/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2" integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ== -end-of-stream@^1.1.0, end-of-stream@^1.4.1: +end-of-stream@^1.1.0: + version "1.4.5" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.5.tgz#7344d711dea40e0b74abc2ed49778743ccedb08c" + integrity sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg== + dependencies: + once "^1.4.0" + +end-of-stream@^1.4.1: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== @@ -4616,9 +4630,9 @@ ethers@6.11.1: ws "8.5.0" ethers@^6.13.5: - version "6.14.3" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.14.3.tgz#7c4443c165ee59b2964e691600fd4586004b2000" - integrity sha512-qq7ft/oCJohoTcsNPFaXSQUm457MA5iWqkf1Mb11ujONdg7jBI6sAOrHaTi3j0CBqIGFSCeR/RMc+qwRRub7IA== + version "6.14.4" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.14.4.tgz#0f6fbc562a8425c7c888da307fa71ef796be0c04" + integrity sha512-Jm/dzRs2Z9iBrT6e9TvGxyb5YVKAPLlpna7hjxH7KH/++DSh2T/JVmQUv7iHI5E55hDbp/gEVvstWYXVxXFzsA== dependencies: "@adraffy/ens-normalize" "1.10.1" "@noble/curves" "1.2.0" @@ -8414,6 +8428,11 @@ undici-types@~6.21.0: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== +undici-types@~7.8.0: + version "7.8.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.8.0.tgz#de00b85b710c54122e44fbfd911f8d70174cd294" + integrity sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw== + unenv@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/unenv/-/unenv-1.10.0.tgz#c3394a6c6e4cfe68d699f87af456fe3f0db39571" From c67129ceb8fdf73fe56edf96f47d5b0f18e08e30 Mon Sep 17 00:00:00 2001 From: akiraonstarknet Date: Sat, 21 Jun 2025 21:10:09 +0530 Subject: [PATCH 33/48] link data --- package.json | 2 +- public/fulllogo.png | Bin 9791 -> 2370 bytes src/app/api/lib.ts | 4 +- src/app/api/strategies/route.ts | 6 +- src/app/community/page.tsx | 14 +- src/app/layout.tsx | 12 +- src/app/page.tsx | 4 +- .../raffle/_components/active-deposits.tsx | 6 +- .../raffle/_components/register-raffle.tsx | 2 +- src/app/raffle/_components/share-on-x.tsx | 9 +- .../_components/zkLendRecoveryComp.tsx | 14 +- src/app/recovery/page.tsx | 19 +- src/app/robots.txt | 6 +- src/app/sitemap.xml | 6 +- .../[strategyId]/_components/DetailsTab.tsx | 61 ++++-- .../[strategyId]/_components/FlowChart.tsx | 12 +- .../[strategyId]/_components/ManageTab.tsx | 2 +- .../[strategyId]/_components/RiskTab.tsx | 45 ++-- .../[strategyId]/_components/Strategy.tsx | 57 +++-- .../[strategyId]/_components/StrategyInfo.tsx | 1 - .../[strategyId]/_components/TokenDeposit.tsx | 4 +- src/app/strategy/[strategyId]/page.tsx | 6 +- src/components/APYInfo.tsx | 43 ++-- src/components/AmountInput.tsx | 9 +- src/components/ContractDetails.tsx | 80 +++++-- src/components/Deposit.tsx | 4 +- src/components/HarvestTime.tsx | 40 ++-- src/components/Navbar.tsx | 200 +++++++++--------- src/components/Strategies.tsx | 10 +- src/components/TncModal.tsx | 2 +- src/components/TxButton.tsx | 28 ++- src/components/YieldCard.tsx | 10 +- src/constants.ts | 11 +- src/store/endur.store.ts | 2 +- src/store/protocols.ts | 21 +- src/store/strategies.atoms.tsx | 50 +++-- .../{strkfarm.atoms.ts => troves.atoms.ts} | 38 ++-- src/strategies/IStrategy.ts | 13 ++ src/strategies/auto_strk.strat.ts | 2 + src/strategies/auto_xstrk.strat.ts | 2 + src/strategies/delta_neutral_mm.ts | 4 +- src/strategies/delta_neutral_mm_2.ts | 3 +- src/style.ts | 9 + src/utils.ts | 8 +- yarn.lock | 20 +- 45 files changed, 548 insertions(+), 353 deletions(-) rename src/store/{strkfarm.atoms.ts => troves.atoms.ts} (79%) diff --git a/package.json b/package.json index 125daa2a..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.47", + "@strkfarm/sdk": "^1.0.49", "@tanstack/query-core": "5.28.0", "@types/mixpanel-browser": "2.49.0", "@types/mustache": "4.2.5", diff --git a/public/fulllogo.png b/public/fulllogo.png index 0dfec990973d83657a062aa214201fba0aa2ecc6..8d7e61bded5157065f67c2feee4983bacdced726 100755 GIT binary patch delta 2344 zcmV+@3D@?&Ou`Z&iBL{Q4GJ0x0000DNk~Le0001L0000j2nGNE07iWNLy;jge+bt} zL_t(|0qt5{a??lgk#O9|hol1YElF1_4|4hmN^L1(w{r zA8XIAf!m)zDX(^kOU#hu?A=xIi$P6SfLoKe#m|mQ zvw=%DuIsYitDIN+U99U4A#roid?{_>)}^6A9KTln4H7unK7B<14;H>a5I~q_bU~Bh zhfdPuwI;X>nkIE*>a=jwA|6)H<*!6EF0~Ta3PBbR$NcOUtc;7`ln3oVf53v5!J-W+ zZFHkO^YiSISWIs9E04Ubeyg3aP&Wtf;)ndZ!Osa)f)0Ab$ji#_Ev6gB*+Qha{ zM1kWH7S2OhhvU)9lfE>F(4baW0m|H1@fs|>qA;UXu~K?Be6Ac#1Q{ZzL<@X2QqkuXQhI zA$Wx}TrOx_!=}IKkeiGl?wSwZ_E?m?L$>nRbe|^$N!l%Z7L$)h}%>%=(*8Lv>(j{Ng1?-a$tv*-<6(7-DIlb>ye9|z+Xr=warz;rIKKYlTr zrbN$P7lO|anx5BSal$K`&zrUncAP6=ynVVWLaHHUw9(FZe|z>>St(;U?ns^Y$r%;1 z)%2hOyupv>52|4=-ykKVa}}Eh5CGv@*6HiZ+9`+*qZe^bkgqF8LqRo7bJh5+wfPlt zRT@XsuO?$7%f9h}()c;bZX<#%@PJ*kSX1tjh~v3TNj zvgfb_BJQ=Me|+rfzSBcq)Tc6i8st`^VvF+k#&lM^G}(w=*>oV`cy>_5kHjwKW0U9DQy0g+qK+h! zF21p>0ZWQ9qdT-I@5_8lYb7;5mLqZX|w zrkHJ-v0xq42YHYle(W6c!us4kbh%&`R%l)ezNZjdwO3kIwM3FMF&IRA?Lu zfBc5fghmLtUtk7xSXb`I8iP?5cYJPd+4ISO%0xjY9#Wqrm9JvauChcaRm|?F83*-U zONB4QS&0T^)=^3B!t>!Woo|A-rsBAxY9l96U`&T*ahaBtKrBvThIK(6PdpdUru(&D z5+^wym4r%L@PV75I{fy{B&d0e3bL98ea0X_;5FY3a|onou(OqPL!N;QdXiV7RCVe!_a-m@dFmU_TGoehT(GSIbWP>DzwBJEn?0z%GZxH&e}|uA zYi4bY;DI_X3K7$n8!M=@#F3VAV9${KUoP8&Iw^<0m#(MR1|!)ym^4%PX4) z{mwTmDFT-af9Lm0r{_ymQ)K-Ve-MpgP5Z=)a0*S{1Ws)^g-uvHyWW32;q$rSyLb=$ z5Nmk@RqUjxSHQxLO7XSjDhJFlgWGy3D}@xmh|zsGQ%7F0wJOEWy(0FAvT%7|^038p zzNk1AW$v0d=0@NMP+%lEEwjEAVx12^eZe(bf7kntoSEH8hfo1s8%--{eC6l5hx}2U1In41$90*Y@{v-0Qa<&KN4?nme?rRVi{%+K)Dcs;q~A+(PuM%WVWUMrjyqnJKoe%g1zg)XpNp^8(NhO z+ANKpf9>+mj{3l8YuZfWinuJlHF)?@-;~rRmLk(rw`?(P0#Zps5&(q0&Nky^`O$kL zG9h%1V1tqCviwKoT0 z%wc;Hfw+0e%W8O71(g-MK6D#yC{|;P9*g|p19b2LE=_Y*3~bmQM(#g7ib}YcjJ&%5 O0000F#sR9e~6PFtkAVeiAV=_jT^`JKbM*pNsG-!f1thx@tH2OG&yjL+VQq`w*cgG5-*7 z2Ot0@gqYwJv-s5%u?k4D2__dZgqiK7(uLu1oP`1f3VdXNa2xUBR~Pz|BhO90a0-Gj)cOM(?n1%uc3Vfu{c0#h2P-*c- z1qcU|1j~kqawL-`Og<2i5C4n4o0Ty2BqYQHLQ?4FLqeBJNiw!lTbX%md|MR?6ew`V zqiuv_i71(0tN>((42kpvqH!cbj&Bmkky8@QV}go_$xa~5Sx|{5EKgMY8z&7hjTgjJ zpunAtO%u}S5cNPZUomWP2v`py>zYAu&B$?w(})~-*!ji;lG%wP9B8zdz!Q-rB}ZCz zSrh_dH!in~TV*_1E=?3#Q-K0^CN@P#-x!+fFJXGxY^7}e8RD@tW0h&b1`7$?{KRn! zH=NwWUGu-m{jlW4%jXD+m$TadircW?t7!sbgGWkdpg@5FcN8{6NY*NjJRxlBr$h%%n_kpCrqOrt6OkA?OHLJ`#6|v2H)|(L2rE}Y{ zUY=u}XnPG>Q*OEy&w(ye$I8CpkwRN4P~c8L(#pcm56$e>6|fiGLfOW8~|8@evbbH;&oG2SMA{6>Oh;&LGRb7eU5y;-_{(hq`3LEA^T&{9=X*bS ziTa>GfdX3|O%u}d56urj4c{|gd&Ns~V7_ql;XF6@fil}Nh0udU>mAvE#Qp7B%p<%g zD3`b&q!yEe)yPu~vy}e@LO!5N>W(EWSnbNv?EG6V(;yTmP+&`=DMI@CgY!cf;G2dA zda{hjSu?0E7LyTsOFYqAJ4C=9nI{@HqLjYa8sbIOV&VmzQf;^64JU4eNsDc)$W%fm zHr2BbS1}eqcKWTCYXvD4D6oaGu7+eRqrN)9`#!6h%?{G6Yp~3~+E6aC<~Hv19|_sJ zb%EV0T_(!h)=)mif_TCk3XwLBzO5F(Sx3rcb;n{i@0^`CYxefOhez-N6ev(&%i)%U zbmYN>vau}A0cK^ykn9smKv*kE61GTe#6KTp^912?kwD17Cq)8B&SvL7fIt1SKNcow z*ty6Vi+>~Jr*GS~1ODCbeGNX=eUFIRVR_#s3-7a-E#3QtLg+3~V9VjAgj5-zp3bi8 z=MATnL84|Ml<&+D(BBp@(LiJ=MNzL+mXMO!*>hiq_y5n-y4KoyIQ$21!Ecv8O;Jt~ z`ly}mH_KPmr7YPqJW`|t6ezHja8nJbqicT5=r=o=vz&B|BKr`F)0ra>4V$qn#Ilc% ztl8k1tmEV$p33V1hwr24T3g^6Bo4T_R@`?lMX~4(Sl*VxC=@7AU`t_5LVD(bYeVK) zmZV3ig>`cz8qWfaBN^o9pLBi@oV`}0o|Ctx7!(3-O=ww7VGVARMxDMyl0(4%WtE?v zT@EjwEqPqk`_>I?^{!pESo?pg@5wfmMW*mgXzgRU^(40=9|*nZzM| z3Z5FfXOc-2a+El-@AHz_oAa|VkX?H$B#1Hxh=lUQ)06~CYtBi8&d%F)S0@~T0tE_e z3FHW=GH|7AK1SWcoA`K^a7@sV*fQdR{x}MzA8J*3Ysu#lg@kN^U?R1Pk5I`@EFsbc zb#iD%ns=sCrLd9;6xbTb5mJ(-LFf$`i7X2HyhTzmTLf&sd?X%w0bFPDheqXufubbI z_CYjw&5ZQpFBxQP9Z5-wW`bkS_QFakP+&{I6H;Zs<{aUW{ubRwfm++D^F*XZPf7?r zRj7ev$j>IfVP6-54N~`JK=~bp$Wipu91&5JWzMS=R#JfiTL7MrlEg-ww4y^LVT?r| z6@xP*-3?! zRG`2XfF~pZ8(9k>dt&3qC(X|PCH&{`S#S>h0(W)Y4IlrFf7;;wY0M9OxL?O3NYsWSpV(bK`vdBK;A=Pyw-GL_qBP$J zHQH~?(jM0%Bvj1+W+vXgdzzP7C{IkaR@%a4K5L`9@yBB0L^or0d~*HFbvt%CEH19^ z-gcYqO>8a`{@7QeV`|vn=O*&!=U8R+@i#7WE1a~))fJAbd##0Z;^Nv16l1z?9wq)T z4~KnH6O~!ON78&2kq@jzQL9kMDo;CbL9F?|`u~3ce|_bbP4CF>|C{IGcR%%rAE1rP zP(slx$RPg~j!a}MZj|C)2!p=4UGlCaxp%z<;*pXSB8*5++|3f~H9w}|HlcF=dM+aHHDanK;`+4tv+q`Ij9P-YcKy6rz6Yc9e7RSoUD=C;MHqkdM%8p+(=~wc z@gKJKuzv60;yJUye$-J#>+I_5oHQ+Wh|ErD~FO z-aE1mF`hiKP)1rlZ@SwawXB!98SMtyIaro2shP53@4tk+OaXA&{M!WuHU+Jt?++{! z5*>pyjZv6PX5<2B>W+y^v;m#^cmMe#zA*>`v@zFdx-~`P;s&J}CC7-foWyg~C>mg+ zc@`OHet-Gk&A;G!6Ekj@9CGy}V^wCd&HlzSOhUH7)XvupWO1L|{Jh z>94g$Pl=Lsqn+k~9CTz9_BcARF0D)h7jBFiGhwIsK3F1n@5M*24?vT!){Y}1l?Zr~ zj%cJ~v^(7QM^DktIwXD8x+NK_hRt=oA7~e0ZTEWZB~%(TA8Z|k6DGYZ`g}P}xdXWm z38Z`qbE9W#HP7X<(G}MrKWG+I&A_{!N)l7nM;R zNjc7?mRTLqM%95&^EF1N+^1)h8Q`*=Bp&S^8H>Km7eBw~t~UZUFN_1ep5>0Pr* zHK#3#5lu=rvJcEpa!-o?FNfcHFI-?1jLTN)lbeZMwtTX)R_L=fq%J|E0m(2Ux(2Qm zjG6;#a~cYZ%w_A^BoduV^jr(ubKHS zv=w-WA7J;8RL$?9lkeO;6E89H*=zgF!A+P&%6i^gK~T$FO9Lt0<;HxXbZ#GI$!Rw| z%Pt{p-?vTHSxB!}%yCyhyZm)9KG|C}AG^Nu?`dZZZ%mo<*2f_V97(&kO~uP*S*?s& zZO9zUAo38!y^tm+VI8+n@!Su#4I8~`l2PhBq?A4<=G z-Z#^LT|-a5jO&t-#mI^6_FV1yV{37hRxH7lrM*g8>X>R=US&AKr2#|b6HuUSuo}`{ z?vYhUQT@e_zzF#W8lmqQP=#$TIeD~dBe84+z@xg6dK1<2SxISM_G25p<6JI6R~;JaT;&ROz=z-Xvc54|sX(OABUQyN*5g$?OZS zu6p?G@0o8udgG!!Jh`}gttj5C*lm|H?%P$TdjVg}r=xa`SC$59K<0cotCmd{#8Xeb z+}X7D7UQ6?xF(J)d8anTWcJ|Eo0Hlr&o5u~!|QCoVS8nv$#2zQY1@mm5I`A0g+9|n*h2%j` zyrCbQcL+H{!7Peo7@15Wn{GfpilBCq5|nDssBW0klQi3#v~o93geqG{mYY%;i)PGa z(HP!w*&9H+UkKn`K(-X>S8ujpwo;!;OQqAI7gwPLs3??kLk-MLU^H0rSE&)?jic7P z5cT(NwN(ACrODDl*GVy1vGcmMXrTEKJL`38=7nBJaQtgGDn?R%nLAUyGtAtvr(f-BN{XXe}Fp3yx``%4`i z_{NJX<6r(}#~5q?r(ar`FrCw(kRK==Ho=S`q6HHRdlfuFxxpRAD~E`%LAUYa@1z2@E={Q0YN z-{+nPBe>de6?>R%&k>+eEI=XhA^vTtt*1If{7{T=FIZm*thnUM%ijwbJIy4W$m?QFECO2J=a2|^rya>2e6 z@Fc0G$uwMfW}<8JWE9C^X;fL2n)ZzPZ41vQe{f`>-%hJ{7iFUc2%kHrWmO2HZ+yqTqP}&QYr0=t9eohE8$sNeX4!e;8jPCOcKGE(vHK1aRhhhH z^+Mh6zrQYEy$eG|%xj!<%=bw$NY;uah%E$rsJ&?k{v_V4wUEl*G7$?2Ard8p5=ain zy?s``3*%~em_Gh_5^ECTX9ZJ5qe60XxMa#GXaRj3&&6o?SXP_nBEa;2&|N5%=)-@|F-l!O^J0$1a?nL#4H@0tV zJaZPvdyhSNebO{M2;s1<5~c&sp6r-`wm`$Q_Wyd>kx!{)G%+fp2fA zLO5ez7GfUtL2jRRoqdh^A9#%O|4Mcy#&xhBLeR3u7#dU}S1Om@S)S{_Of9jJsMT6% z5(oC#eQOk`#BJk-qTC{I`AP&rM!FqRTJn4;&YixkMAb8ZUT8aNr%YIV$m~$rb?8XD z%*QTsF^25Gn}qrjy2KI4^%^0>)MVrkZMvj zfJtA9t6b{YdJ~bf=Aj)On$Cm95L3d8LMP3s2b=1&zB1l9@%s46`IU^WJ~7_8CPBaU z;);pD(mDCr^P}(3&M&=yEgk3Zk&+eUohX0iczx777h@RG6U5!2>H6}@@bGhd&;8^j zIz?&SbRy~W@Zr3^6XO66|9s#luh38m^k&E}$;LnbL^^K2{_IsMn@4d-)fW4LjR(HU z?%CUhgv^wk$icLoy4{i$(xP2div(385WyJ2(;uuRJuI&+W61sK>bwV9K@`Q)N!~n4 zP`X&93?y$IVO(1m>gL${lDkLuR&)%@Sb@@5P?A+#+ikaytSe^Rw0%VBsA*)-Tcm8q zDOL6x&vI|ARGS$2?A-Xtx9=Wnp$RztGv^vs8>d^BE%WDgHNN|wHfXU3I2K}hd&mZi zHAIp&=KBFABQiZ>I`+-iyQenPNCH}J#3cbLSn}m7mjKVbRGB~U?8N4dML`JO3!xCi z(S+TWI@+7z(NVVOPLER0a;e^*)v}&6)%KIw6oSXm7C7-V$Q||o4bP4YK3zH$FZS@W zjxdH>*(`XEgk~N*$Yd1F6E4E3&qrEO#`9Oj0!sdydNq;05|ZgC+|QyHX-2Na1M zr|w7ZYl)B>Gy zTc|HzMvBdY&BERLsFtR&Zn9)x@L8OJ_JDjMaw9l{-`;w&jr-$fH`wka&9#@ARsfd4 z_aT>>;!O&%kb<=VzCXm!h{NuGH~`^oC4Ae4G7w2_l#-7tbAO3v-+K<4!7u*zJMi(p z_s{4Pzwt@X5x+&7_HRQ0-$fI@mo2hIJhP#?pKfuXqYbOCO+kps6OAFLK67>Yk|f=0 zc6$(j^8-u|QhDmLbMJm%>f1I0zT&GRaBYBEDbwa8R^5BBvbu43jm3n%H|`}YSz&vF z){E7rQcY5`7kA>wscr83op^F-)M)WzQc}`e1AGTIqUq!g2!r~FICSV3N7R1s-10ee z8l44gsz%R{(U>`wQEf5Yh~ehTLS{PY?Y&uOG2KxsQ{iJ{N+XVHrq7C!9K|pNPFj-i>CXM(i6Rz10AwP@`hwo<< z%g|fHDErJdIU6W#eKnFTrX3lWJ2WydKe*O>Lr@nc{-k%(h}pySj@oa5h=?rGW7|qu z+{4`Ti_@Dxe3A(#$KKdBJocvR%0T%hKRt15AD1a;{SL-Yty+yTrZ!uY zh++tWkQXl!x9Zo|_y)A;nrf$O&hLyeny!|V%*Tx0XvVClxXS%a0E4^lQSa;+uTlLE&F!-9 z@naj0=-E&^_ks2rn`e(;tTXHA{mQpWyB?K)U;bu?5qOL>#(dt!QB}FYMmP%R4H|`C>4pT#&7HR29 z3y1|q^4nCyi$dZfiR}|HI6v$0RrXG&op>4A3MCc0f7!bEB<7IHs2tgR^7Kt%qinu* zFKerWq%;m%x)I~KANE#jON&Ox5AF>@>CMr~mDb22_>pW-zG9Hp0IUo>bLS;>Y zbU(BD>=P&25Xtk;O{okGkh?@-}CiIB6`>-4F&^=(QQ#4@c27kbsft3wvz&h%Xfp z0+6z;@;j%g=fE(|qSZIdrY77>)Yn|QLm-fVV*WMXNs^ElZ~B^V z-NyK5zJlY>CR7II&Y6$Bp3J>XhqLD4xxl;Rtf(@lBS=aYQnkKP-zOq?)A;&B^FwIs z;UaqXR10DYO4uq*@bVlk?U|VDZR#c*9a<V55O+6MkG!&Nm(DW;)Nkg!2N)iA zmat&@>F;;%gInO_Q%eKpiGN2o-`HWrQDI}@j68X)yX7QB3ri4-N$oGpRqlb1$9Dl) zx3tsB@)?YOFL8i$YBciY7dqE%|Maoiknw*`^J5v;rp7L*M8>r#bN{W>>-TA$+pX}^ zlT=1?FPM$=uJWZ3M;<(g6F+~|)fo;UY5}_)MhXu+^f*qv{Tf}e$E#=AJc8A$ov_E8 z8=F+7y?AUIiqPwKJhps5*e1AevW|R@O}99;3AGkCa_iKHYR#SSY!Ze3DKhW;^`_X~ zkK8uSqI6~^M*5ohGY##Lj&1jkZv=r6aA9kzj9h zZsl5q->U9&9GlA9>fKG3$`~@*Z}zQMZBpK{&z_gW*5vma*L&f$?h!NdqT2)aP&S%Ox~2cB|up-SXhBCZp&t z`})ZsY!J>h%jmG%6c0gTzwRb*dXcj_!_p*NA)UCpV7B8;n`$3ZH);j2H9)!UiFII4 zMifoQ&Qh|sneAsO^phkJ$F7?FZph`4=qPma&ag=n$ZsFLU{c<`1beOhFfIE>5FTRk z)=h)|ihewpm_WR%*SH73R21cNAm3#|%G_B4KnRXC2e%d0x_s$KJX1ur@F@CT0Od-f zHm$qtcmVV;E=-l?A+b z%&XW+|K-KyGtF#&xeilEoXU|Cw2fw1%j)0uMlYj6#!7WTwTj$+L5=rP}_steZ`Ug^6Ikt+}?Ud_77aw>$*;F1& zGq5k@G(FvJvrA>7#Fp+dS32EliO5F@ zPRcSQHHB`}$b^$}L{i~J*bVdgaB$PSZ*9$-L{lGm6tbM_=a$AOF%NTFai4#F>Ay8i zM!Y?*Td4F7;N>rfe?=@EEG5U-@|Qai%UZX0fPaO!VpS;cYYizMY1%^lb%1E>wHc1D zW|1Vw(2>={qYW$GzOWV|Hgy&mM&>U$@tdtE_VJ9{y|JiPfdU2E1OFV4 z+<)zo6$*o^%qWA9Kgptor(YEfpy({M;W*i=L zJL^hMuz5bC2ULC{UolhX!9vV4lcH;KW-Z zpNdbKiz^0El-wv)A{w@D2mZw;4?tJf-K*7YA9n=_P>HS%zBW$hx>`I4JE?moGG`DE zS#LsL6lhMw7!)W_;6sHcq%5nQLLNZL=|`G9?URypL5bK%UJ^o!(Xm@WHJzB_h?5Ay ze||}28WL4Vk_*(o49;Gh1>hq!ZkmSn%)zWI6~26d0v|R!A=&7TadV=vQN)#@967L& z5$o32hP3twaSn|q7xaJ8M=J9KrCK%!eSt0&+)sAlWDo<=-&_Eio%zDZ%?G0@P@urC z2D$q0TFvFmxZ+ZY;8R2q#9?|ipc;kgcENLwYca~m45Y$zB-wHx#lT6Nj2TpTDg09< zI|$n7N984`FDK(rpg@5S9XUdBRuU)HMM;r53O;i3uUvo=xnBX&bUg)(wOR*eptL*LN z;?2V`3CX}znxLzyI^_)@XCYCLi=;fuZ)dGtlGLT(h7we7)RI$Bpg@5wfmMX$GKDi7 zw%_yh7;cJ=D-6O#l8)X!3yDh|9K}eyU(*hBfgntC`VdGB39b^oDVOoYV>xj?ftz3} ze8*a;ZZ1%u!0pAFV+h(|Q)N&w0AFP5qf?QimUpW*3vblOYiG$v`#>xuKWd2=vC;pL z>LrAzpw_ETl#9lZt;?cQpFeo>7vU8sP~caOn+|GPyQ@A9^7d4Tp6BwA*ivd3=WLVk zj1g_qn@3#dh;gwag1!|cjA2T&=I+G2Ww&{0i3%aRK!L4>TUs}j2d|X7pyPeBRIe1V z`f-q4rnHQgw74=)fA)X>qxXh%%WB5>nleua`A=Qu_dYd5-Cf&#fo~%3P2=&6!f*87 z(TiK0MGpMR9REAGm_CEskkK+N-8Ve4$+uG!C{Up7Sl8Wp{-OCkvIAcM^@5BVsbwRL z|A5CrL5Zo$0B_*SKIDxcN-jb~5S57V9?76;ToS@WgF3LAGm~_?Q3;5fo(3Z0{gFZB zkZXS3=yZhlK0LDVLD~xxC~*6*?t3Wgiv%g7!(K%eMMe-_GNN)Zi_+9MGA-)B`}%IJ zhIZ7|a#WUSNS{M(I>@_h9=)_hx+h2!M%JV7=8?Q*Mp-sokWqmGTNh2e80ULG+dc{I zZIDdGVcaR&jJRm*j`1LENf>Wi^=RZ526!DR@g-+6 zxHdu1r~tq(8{D~Qpg7WzCxg2NZiX8OK;N&DaD9tuYc|cYeGfm|Sy)B|3T$z-^y)zC zzSUP&_8Bweau~8Wqy&UC#b_`#3O0|1@`J18v!?-c0p=Mk>IIIRN#Y}g@O{qd)66Kq z$Ut*0Ue)aHo`Q@D6u2|c^1Dor|E#y#kuL8+NG4DOYzwLf3*>~W$eFdnxw;R zes_6+0tJ2r*wowJzx(5RCKFiMgIO}RR(_-o>K4jP^gTS@#cEtZKgF#hNr%+BH4(1# z%@R6FoSkB{BFb#cFFDx$wNpGm`kd zyfGwaB>}=shp#0~l+@|=RX0edN-L#PYrc}WK!E~x4BAFWiep0y<&}wT zE*le%YgEYwH~&E z_8LyvlPd=il1VfJJJyfnU2je|@|KVzstd-dnlif8w7f#5K!E}uA>39%iZNQDo{!aQ zy9u*?`wqAyNp=uryA0{{7~a_diO)TnHGgK!=anQ)E&yg1jkQ%>xt7k1Oca(-fdU_8 Z{4I%Dq9qW%k9z[], + strategies: Pick[], ) => { const funder = '0x02D6cf6182259ee62A001EfC67e62C1fbc0dF109D2AA4163EB70D6d1074F0173'; diff --git a/src/app/api/strategies/route.ts b/src/app/api/strategies/route.ts index 9fff9170..c7ea9c53 100755 --- a/src/app/api/strategies/route.ts +++ b/src/app/api/strategies/route.ts @@ -5,7 +5,7 @@ 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'; @@ -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])); } 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 = () => {