From a7931e8ee0805994de032823af8fc4fd6e3a1964 Mon Sep 17 00:00:00 2001 From: Nicolas carballo Date: Mon, 19 Jun 2023 17:43:34 -0300 Subject: [PATCH 01/14] adding new gauges --- src/constants/contracts.ts | 3 + src/utils/data/pools.ts | 232 +++++++++++++++++++++++++++++-------- 2 files changed, 184 insertions(+), 51 deletions(-) diff --git a/src/constants/contracts.ts b/src/constants/contracts.ts index 2887521e..89302a44 100644 --- a/src/constants/contracts.ts +++ b/src/constants/contracts.ts @@ -32,6 +32,9 @@ const contracts = { gaugeV3: { 250: '0xfe1C8A68351B52E391e10106BD3bf2d0759AFf4e', }, + combineProxy: { + 250: '0x9E7A4F683E52bE88a927eB46771B21d62aaa2501', + }, variableProxy: { 250: '0xfe1C8A68351B52E391e10106BD3bf2d0759AFf4e', }, diff --git a/src/utils/data/pools.ts b/src/utils/data/pools.ts index ed356d40..b8f09684 100644 --- a/src/utils/data/pools.ts +++ b/src/utils/data/pools.ts @@ -37,24 +37,32 @@ export const verifiedLpTokenData = () => { export const getGaugeBasicInfo = async (_provider = null) => { const variableGaugeCalls: Call[] = []; const variableTokensCalls: Call[] = []; + const stableGaugeCalls: Call[] = []; const stableTokensCalls: Call[] = []; + const adminGaugeCalls: Call[] = []; const adminTokensCalls: Call[] = []; + const combineGaugeCalls: Call[] = []; + const combineTokensCalls: Call[] = []; + const variableAddress = Contracts.variableProxy[CHAIN_ID]; const stableAddress = Contracts.stableProxy[CHAIN_ID]; const adminAddress = Contracts.adminProxy[CHAIN_ID]; + const combineProxyAddress = Contracts.combineProxy[CHAIN_ID]; const [ { response: variableLpsResponse }, { response: stableLpsResponse }, { response: adminLpsResponse }, + { response: combineGaugesResponse }, ] = await Multicall( [ { name: 'tokens', params: [], address: variableAddress }, { name: 'tokens', params: [], address: stableAddress }, { name: 'tokens', params: [], address: adminAddress }, + { name: 'tokens', params: [], address: combineProxyAddress }, ], 'gaugeproxyV3', undefined, @@ -65,6 +73,7 @@ export const getGaugeBasicInfo = async (_provider = null) => { const variableLps = variableLpsResponse[0]; const stableLps = stableLpsResponse[0]; const adminLps = adminLpsResponse[0]; + const combineLps = combineGaugesResponse[0]; variableLps.forEach(variableLp => { variableGaugeCalls.push({ @@ -114,10 +123,28 @@ export const getGaugeBasicInfo = async (_provider = null) => { }); }); + combineLps.forEach(combineLp => { + combineGaugeCalls.push({ + address: combineProxyAddress, + name: 'gauges', + params: [combineLp], + }); + combineTokensCalls.push({ + address: combineLp, + name: 'token0', + }); + combineTokensCalls.push({ + address: combineLp, + name: 'token1', + }); + }); + const [ variableGauges, stableGauges, adminGauges, + combineGauges, + combineTokens, variableTokens, stableTokens, adminTokens, @@ -126,6 +153,8 @@ export const getGaugeBasicInfo = async (_provider = null) => { variableGaugeCalls, stableGaugeCalls, adminGaugeCalls, + combineGaugeCalls, + combineTokensCalls, variableTokensCalls, stableTokensCalls, adminTokensCalls, @@ -134,6 +163,8 @@ export const getGaugeBasicInfo = async (_provider = null) => { 'gaugeproxyV3', 'gaugeproxyV3', 'gaugeproxyV3', + 'gaugeproxyV3', + 'pairV2', 'pairV2', 'pairV2', 'pairV2', @@ -150,6 +181,9 @@ export const getGaugeBasicInfo = async (_provider = null) => { variableTokens: variableTokens.map(token => token.response[0]), stableTokens: stableTokens.map(token => token.response[0]), adminTokens: adminTokens.map(token => token.response[0]), + combineGauges: combineGauges.map(gauge => gauge.response[0]), + combineTokens: combineTokens.map(token => token.response[0]), + combineLps, variableLps, stableLps, adminLps, @@ -165,28 +199,41 @@ export const getGaugesPoolInfoWithMulticall = async ( const adminAddress = Contracts.adminProxy[CHAIN_ID]; const masterchefAddress = Contracts.masterchef[CHAIN_ID]; + const combineProxyAddress = Contracts.combineProxy[CHAIN_ID]; + const { variableGauges, stableGauges, adminGauges, + combineGauges, + variableLps, stableLps, adminLps, + combineLps, + variableTokens, stableTokens, adminTokens, + combineTokens, } = await gaugesPromise; const variableDataCalls: Call[] = []; const variableLockedWeightsCalls: Call[] = []; const variableERC20Calls: Call[] = []; + const stableDataCalls: Call[] = []; const stableLockedWeightsCalls: Call[] = []; const stableERC20Calls: Call[] = []; + const adminDataCalls: Call[] = []; const adminWeightsCalls: Call[] = []; const adminERC20Calls: Call[] = []; + const combineDataCalls: Call[] = []; + const combineERC20Calls: Call[] = []; + const combineLockedWeightsCalls: Call[] = []; + variableGauges.forEach((variableGauge, i) => { const address = variableGauge; const lpAddress = variableLps[i]; @@ -268,6 +315,34 @@ export const getGaugesPoolInfoWithMulticall = async ( }); }); + combineGauges.forEach((combineGauge, i) => { + const address = combineGauge; + const lpAddress = combineLps[i]; + + combineDataCalls.push({ + address, + name: 'rewardRate', + }); + combineDataCalls.push({ + address, + name: 'derivedSupply', + }); + combineLockedWeightsCalls.push({ + address: adminAddress, + name: 'gaugeWeights', + params: [lpAddress], + }); + combineERC20Calls.push({ + address: lpAddress, + name: 'balanceOf', + params: [address], + }); + combineERC20Calls.push({ + address: lpAddress, + name: 'stable', + }); + }); + const masterChefCalls: Call[] = [ { address: masterchefAddress, @@ -284,6 +359,11 @@ export const getGaugesPoolInfoWithMulticall = async ( name: 'poolInfo', params: ['73'], }, + { + address: masterchefAddress, + name: 'poolInfo', + params: ['72'], + }, { address: masterchefAddress, name: 'totalAllocPoint', @@ -296,12 +376,15 @@ export const getGaugesPoolInfoWithMulticall = async ( variableDataCalls, stableDataCalls, adminDataCalls, + combineDataCalls, variableERC20Calls, stableERC20Calls, adminERC20Calls, + combineERC20Calls, variableLockedWeightsCalls, stableLockedWeightsCalls, adminWeightsCalls, + combineLockedWeightsCalls, masterChefCalls, [ { @@ -316,18 +399,25 @@ export const getGaugesPoolInfoWithMulticall = async ( name: 'totalWeight', address: adminAddress, }, + { + name: 'lockedTotalWeight', + address: combineProxyAddress, + }, ], ], [ 'gauge', 'gauge', 'gauge', + 'gauge', + 'pairV2', 'pairV2', 'pairV2', 'pairV2', 'gaugeproxyV3', 'gaugeproxyV3', 'gaugeproxyV3', + 'gaugeproxyV3', 'masterchef', 'gaugeproxyV3', ], @@ -336,28 +426,48 @@ export const getGaugesPoolInfoWithMulticall = async ( _provider, ); - const variableWeights = chainResponse[10][0].response[0]; - const stableWeights = chainResponse[10][1].response[0]; - const adminWeights = chainResponse[10][2].response[0]; + const variableWeights = chainResponse[13][0].response[0]; + const stableWeights = chainResponse[13][1].response[0]; + const adminWeights = chainResponse[13][2].response[0]; + const combineWeights = chainResponse[13][3].response[0]; - const totalAllocPoint = new BigNumber( - chainResponse[9][3].response[0].toString(), - ); const variableAlloc = new BigNumber( - chainResponse[9][0].response[1].toString(), + chainResponse[12][0]?.response[1]?.toString(), + ); + const stableAlloc = new BigNumber( + chainResponse[12][1]?.response[1]?.toString(), + ); + const adminAlloc = new BigNumber( + chainResponse[12][2]?.response[1]?.toString(), + ); + const combineAlloc = new BigNumber( + chainResponse[12][3]?.response[1]?.toString(), + ); + const totalAllocPoint = new BigNumber( + chainResponse[12][4]?.response[0]?.toString(), ); - const stableAlloc = new BigNumber(chainResponse[9][1].response[1].toString()); - const adminAlloc = new BigNumber(chainResponse[9][2].response[1].toString()); const variableShare = variableAlloc.div(totalAllocPoint); const stableShare = stableAlloc.div(totalAllocPoint); const adminShare = adminAlloc.div(totalAllocPoint); + const combineShare = combineAlloc.div(totalAllocPoint); + + const data: any = [[], [], [], []]; - const data: any = [[], [], []]; - const unionGauges = [variableGauges, stableGauges, adminGauges]; - const unionTokens = [variableTokens, stableTokens, adminTokens]; + const unionGauges = [ + variableGauges, + stableGauges, + adminGauges, + combineGauges, + ]; + const unionTokens = [ + variableTokens, + stableTokens, + adminTokens, + combineTokens, + ]; - [variableLps, stableLps, adminLps].forEach((lps, x) => { + [variableLps, stableLps, adminLps, combineLps].forEach((lps, x) => { const loc = data[x]; let doubleCountEven = 0; let doubleCountOdd = 1; @@ -365,40 +475,50 @@ export const getGaugesPoolInfoWithMulticall = async ( loc.push({ address: lp, gaugeAddress: unionGauges[x][y], - rewardRate: chainResponse[x][doubleCountEven].response[0].toString(), - derivedSupply: chainResponse[x][doubleCountOdd].response[0].toString(), - weight: chainResponse[x + 6].length - ? chainResponse[x + 6][y].response[0].toString() + rewardRate: chainResponse[x][doubleCountEven]?.response[0]?.toString(), + derivedSupply: + chainResponse[x][doubleCountOdd]?.response[0]?.toString(), + weight: chainResponse[x + 8].length + ? chainResponse[x + 8][y]?.response[0]?.toString() : null, liquidityShare: formatUnits( - chainResponse[x + 3][doubleCountEven].response[0].toString(), + chainResponse[x + 4][doubleCountEven]?.response[0]?.toString() || '0', 18, - ).toString(), - stable: chainResponse[x + 3][doubleCountOdd].response[0], + )?.toString(), + stable: chainResponse[x + 4][doubleCountOdd]?.response[0], token0: unionTokens[x][doubleCountEven], token1: unionTokens[x][doubleCountOdd], - type: ['variable', 'stable', 'admin'][x], + type: ['variable', 'stable', 'admin', 'combine'][x], }); doubleCountOdd += 2; doubleCountEven += 2; }); }); - const [variableGaugesData, stableGaugesData, adminGaugesData] = data; - const variableTotalLocked = variableWeights.toString(); - const stableTotalLocked = stableWeights.toString(); - const adminTotalLocked = adminWeights.toString(); + const [ + variableGaugesData, + stableGaugesData, + adminGaugesData, + combineGaugesData, + ] = data; + const variableTotalLocked = variableWeights?.toString(); + const stableTotalLocked = stableWeights?.toString(); + const adminTotalLocked = adminWeights?.toString(); + const combineTotalLocked = combineWeights?.toString(); return { variableGauges: variableGaugesData, stableGauges: stableGaugesData, adminGauges: adminGaugesData, + combineGauges: combineGaugesData, variableTotalLocked, stableTotalLocked, adminTotalLocked, + combineTotalLocked, variableShare, stableShare, adminShare, + combineShare, }; }; @@ -500,12 +620,12 @@ export const getLpTokenPrices = async ( if (tokenAddresses.includes(WFTM.address.toLowerCase())) { const ftmReserve = ( checkAddress(token0, WFTM.address) ? reserve0 : reserve1 - ).toString(); + )?.toString(); return usdcFTMValue.times(reconcileReserves(ftmReserve, totalSupply)); } else if (tokenAddresses.includes(USDC.address.toLowerCase())) { const usdcReserve = ( checkAddress(token0, USDC.address) ? reserve0 : reserve1 - ).toString(); + )?.toString(); return reconcileReserves( formatUnits(usdcReserve, 6), formatUnits(totalSupply, 18), @@ -513,7 +633,7 @@ export const getLpTokenPrices = async ( } else if (tokenAddresses.includes(SPIRIT.address.toLowerCase())) { const spiritReserve = ( checkAddress(token0, SPIRIT.address) ? reserve0 : reserve1 - ).toString(); + )?.toString(); return usdcSpiritValue.times( reconcileReserves(spiritReserve, totalSupply), ); @@ -530,9 +650,9 @@ export const getLpTokenPrices = async ( const rate = determineUSDCValue( chainTokens[doubleCountEven], chainTokens[doubleCountOdd], - reserves[doubleCountEven].response[0].toString(), - reserves[doubleCountOdd].response[0].toString(), - supply[count].response[0].toString(), + reserves[doubleCountEven].response[0]?.toString(), + reserves[doubleCountOdd].response[0]?.toString(), + supply[count].response[0]?.toString(), ); data[lp.toLowerCase()] = rate; doubleCountOdd += 2; @@ -622,19 +742,38 @@ export const loadFarmsList = async ( variableGauges, stableGauges, adminGauges, + combineGauges, + variableTotalLocked, stableTotalLocked, adminTotalLocked, + combineTotalLocked, + variableShare, stableShare, adminShare, + combineShare, } = gaugeChainData; - const totalData = [...variableGauges, ...stableGauges, ...adminGauges]; + const totalData = [ + ...variableGauges, + ...stableGauges, + ...adminGauges, + ...combineGauges, + ]; // Here's where we call stable and weighted data const masterFarms: (IFarm | null)[] = await Promise.all( totalData.map(async (farm, i) => { + const share = + farm.type === 'variable' + ? variableShare + : farm.type === 'stable' + ? stableShare + : farm.type === 'admin' + ? adminShare + : combineShare; + const lowerLp = farm.lpAddresses ? farm.lpAddresses[chainId].toLowerCase() : farm.lpAddress @@ -652,27 +791,22 @@ export const loadFarmsList = async ( const gaugeRewardPerYear = gaugeRewardPerSecond.times( new BigNumber('31536000'), ); - const rewardBase = gaugeRewardPerYear.div(totalDerivedBalance).toString(); + const rewardBase = gaugeRewardPerYear + .div(totalDerivedBalance) + ?.toString(); let totalLocked; if (farm.type === 'admin') { totalLocked = new BigNumber(adminTotalLocked); } else if (farm.type === 'stable') { totalLocked = new BigNumber(stableTotalLocked); + } else if (farm.type === 'combine') { + totalLocked = new BigNumber(combineTotalLocked); } else { totalLocked = new BigNumber(variableTotalLocked); } - farm.multiplier = gaugeWeight - .div(totalLocked) - .times( - farm.type === 'variable' - ? variableShare - : farm.type === 'stable' - ? stableShare - : adminShare, - ) - .times(100); + farm.multiplier = gaugeWeight.div(totalLocked).times(share).times(100); if (tokens[0] && tokens[1]) { farm.lpSymbol = `${tokens[0].symbol}-${tokens[1].symbol}`; @@ -680,8 +814,6 @@ export const loadFarmsList = async ( farm.lpSymbol = ''; } - farm.label = farm.type || 'NMC'; - const maxApy = new BigNumber( rewardBase && rewardBase !== 'Infinity' ? new BigNumber(rewardBase!).times(spiritPrice.div(rate)).times(100) @@ -696,8 +828,6 @@ export const loadFarmsList = async ( .times(rate) .toNumber(); - const type = farm?.stable ? 'stable' : 'variable'; - const isIncative = inactiveFarms.includes(farm.lpSymbol.toUpperCase()); const lp: IFarm = { @@ -713,7 +843,7 @@ export const loadFarmsList = async ( maxApy.toFormat(2) === 'NaN' || isIncative ? '0' : maxApy.toFormat(2), boosted: true, lpApr: '0', - label: farm.label || '', + label: farm.type || 'NMC', rewardToken: farm?.rewardToken, totalLiquidity, totalSupply: farm.liquidityShare, @@ -723,12 +853,12 @@ export const loadFarmsList = async ( yourApr: minApy.isFinite() ? isIncative ? '0' - : minApy.toString() + : minApy?.toString() : '0', valid: tokens.length > 0, multiplier: farm.multiplier ? farm.multiplier.isFinite() - ? farm.multiplier.toString() + ? farm.multiplier?.toString() : '0.00' : '0.00', holdAmountForMaxBoost: '1', @@ -738,7 +868,7 @@ export const loadFarmsList = async ( lpTokens: '0.00', stable: farm.stable, lpTokensMoney: '0.00', - type, + type: farm.stable ? 'stable' : 'variable', pid: farm?.pid || 0, }; From 2028eca0b01cdf78d477ec8f65977538f9591a1e Mon Sep 17 00:00:00 2001 From: Nicolas carballo Date: Mon, 19 Jun 2023 18:10:58 -0300 Subject: [PATCH 02/14] adding filters --- src/app/interfaces/Farm.ts | 1 + src/app/pages/Farms/components/FarmControls/FarmControls.tsx | 1 + src/app/pages/Farms/helpers/filters.ts | 2 ++ src/utils/data/pools.ts | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/interfaces/Farm.ts b/src/app/interfaces/Farm.ts index 859e6acd..707e5c7f 100644 --- a/src/app/interfaces/Farm.ts +++ b/src/app/interfaces/Farm.ts @@ -210,6 +210,7 @@ export enum FarmType { CLASSIC, STABLE, CONCENTRATED, + COMBINE, ADMIN, } diff --git a/src/app/pages/Farms/components/FarmControls/FarmControls.tsx b/src/app/pages/Farms/components/FarmControls/FarmControls.tsx index c4e4d60b..3b86d927 100644 --- a/src/app/pages/Farms/components/FarmControls/FarmControls.tsx +++ b/src/app/pages/Farms/components/FarmControls/FarmControls.tsx @@ -35,6 +35,7 @@ export default function FarmControls({ t(`${translationPath}.classicV2`), t(`${translationPath}.stable`), t(`${translationPath}.concentrated`), + 'Combine', ]} onChange={onFarmTabChange} /> diff --git a/src/app/pages/Farms/helpers/filters.ts b/src/app/pages/Farms/helpers/filters.ts index f2d4069d..1e00995e 100644 --- a/src/app/pages/Farms/helpers/filters.ts +++ b/src/app/pages/Farms/helpers/filters.ts @@ -10,6 +10,8 @@ export const handleFarmData = (data, index) => { return data.filter(farm => farm.type === 'stable'); case FarmType.CONCENTRATED: return data.filter(farm => farm.type === 'concentrated'); + case FarmType.COMBINE: + return data.filter(farm => farm.type === 'combine'); default: return data; } diff --git a/src/utils/data/pools.ts b/src/utils/data/pools.ts index b8f09684..148306e4 100644 --- a/src/utils/data/pools.ts +++ b/src/utils/data/pools.ts @@ -868,7 +868,7 @@ export const loadFarmsList = async ( lpTokens: '0.00', stable: farm.stable, lpTokensMoney: '0.00', - type: farm.stable ? 'stable' : 'variable', + type: farm.type, pid: farm?.pid || 0, }; From dfa4374e0cac5d18a5e6af38bd5fa8ee981d30f0 Mon Sep 17 00:00:00 2001 From: Nicolas carballo Date: Wed, 28 Jun 2023 13:54:41 -0300 Subject: [PATCH 03/14] code refactor --- src/app/pages/Farms/FarmController/index.tsx | 2 +- src/app/pages/Farms/components/TokenList/TokenList.tsx | 9 ++------- src/app/pages/Farms/components/TokenList/styles.ts | 2 +- src/utils/data/pools.ts | 5 ++++- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/app/pages/Farms/FarmController/index.tsx b/src/app/pages/Farms/FarmController/index.tsx index fddb7a1f..1a61e502 100644 --- a/src/app/pages/Farms/FarmController/index.tsx +++ b/src/app/pages/Farms/FarmController/index.tsx @@ -44,7 +44,7 @@ const MemorizeTokenList = memo(({ farm }: IFarm) => ( ecosystem={farm.ecosystem} apr={farm.apr} rewardToken={farm.rewardToken} - farmType={farm.type} + farmType={farm.label} lpAddress={farm.lpAddress} type={farm.type} hideTypeIcons={Boolean(farm.concentrated)} diff --git a/src/app/pages/Farms/components/TokenList/TokenList.tsx b/src/app/pages/Farms/components/TokenList/TokenList.tsx index d3f41956..62275c1d 100644 --- a/src/app/pages/Farms/components/TokenList/TokenList.tsx +++ b/src/app/pages/Farms/components/TokenList/TokenList.tsx @@ -1,4 +1,3 @@ -import { useTranslation } from 'react-i18next'; import { Heading } from 'app/components/Typography'; import { ReactComponent as BarChart } from 'app/assets/images/bar-chart.svg'; import { ReactComponent as Calculator } from 'app/assets/images/calculator.svg'; @@ -17,20 +16,17 @@ import { openInNewTab } from 'app/utils/redirectTab'; const TokenList = ({ tokens, - boosted, title, - ecosystem, hideTypeTitle, hideTypeIcons, invertTitleOrder, titleSmall, + farmType, apr, type, rewardToken, - farmType, lpAddress, }: Props) => { - const { t } = useTranslation(); const roiCalculatorDisclosure = useDisclosure(); const onCalculatorClick = () => { @@ -52,13 +48,12 @@ const TokenList = ({ display: 'flex', flexDirection: invertTitleOrder ? 'column-reverse' : 'column', gap: '5px', - padding: '5px', }} > - {!hideTypeTitle && {type}} + {!hideTypeTitle && {farmType}} theme.fontSizes.sm}; color: ${({ theme }) => theme.colors.gray}; - margin-bottom: ${({ theme }) => theme.space.spacing01}; + margin-bottom: ${({ theme }) => theme.space.spacing03}; `; export const StyledWrapper = styled.div` diff --git a/src/utils/data/pools.ts b/src/utils/data/pools.ts index 148306e4..6ab4fe02 100644 --- a/src/utils/data/pools.ts +++ b/src/utils/data/pools.ts @@ -761,6 +761,7 @@ export const loadFarmsList = async ( ...adminGauges, ...combineGauges, ]; + console.log(combineGauges, 'here'); // Here's where we call stable and weighted data const masterFarms: (IFarm | null)[] = await Promise.all( @@ -830,6 +831,8 @@ export const loadFarmsList = async ( const isIncative = inactiveFarms.includes(farm.lpSymbol.toUpperCase()); + const label = farm.type === 'combine' ? 'V3' : farm.type; + const lp: IFarm = { title: farm?.lpSymbol .replace('WFTM', 'FTM') @@ -843,7 +846,7 @@ export const loadFarmsList = async ( maxApy.toFormat(2) === 'NaN' || isIncative ? '0' : maxApy.toFormat(2), boosted: true, lpApr: '0', - label: farm.type || 'NMC', + label: label || 'NMC', rewardToken: farm?.rewardToken, totalLiquidity, totalSupply: farm.liquidityShare, From 69663fb5b3c5faecd77b2f402d22164e936b90d8 Mon Sep 17 00:00:00 2001 From: Nicolas carballo Date: Wed, 28 Jun 2023 18:17:58 -0300 Subject: [PATCH 04/14] adding combine gauges to the saturate process --- src/app/hooks/usePieChartData.ts | 1 - .../Inspirit/components/Voting/Voting.tsx | 4 +- .../components/TokenTableV3/TokenTableV3.tsx | 24 +- .../components/VotingPanel/VotingPanel.tsx | 64 +++- src/app/utils/methods.ts | 13 +- src/utils/data/inspirit.ts | 347 +++++++++++++----- src/utils/web3/contracts.ts | 1 - 7 files changed, 339 insertions(+), 115 deletions(-) diff --git a/src/app/hooks/usePieChartData.ts b/src/app/hooks/usePieChartData.ts index 22a4f424..ceead58f 100644 --- a/src/app/hooks/usePieChartData.ts +++ b/src/app/hooks/usePieChartData.ts @@ -87,7 +87,6 @@ const usePieChartData = ({ farmsList }: { farmsList: BoostedFarm[] }) => { datasets: [ { data, - borderColor: ['white'], borderWidth: 1, hoverBorderWidth: 2, diff --git a/src/app/pages/Inspirit/components/Voting/Voting.tsx b/src/app/pages/Inspirit/components/Voting/Voting.tsx index 14a25850..4b739a14 100644 --- a/src/app/pages/Inspirit/components/Voting/Voting.tsx +++ b/src/app/pages/Inspirit/components/Voting/Voting.tsx @@ -48,7 +48,9 @@ function Voting() { }>({ index: 0, value: 'Stable' }); let versionId = 1; + if (selectedFarmType.index === 0) { + // check this versionId = 3; } if (selectedFarmType.index === 1) { @@ -133,7 +135,7 @@ function Voting() { {t(`${translationPath}.farmType.label`)} @@ -75,19 +68,6 @@ export default function FarmControls({ } checked={farmFilters.inactive} /> - {/* {![FarmType.ECOSYSTEM, FarmType.WEIGHTED].includes(selectedTab) && ( - { - setFarmFilters(prevState => ({ - ...prevState, - boosted: !farmFilters.boosted, - })); - }} - checked={farmFilters.boosted} - /> - )} */} )} diff --git a/src/app/pages/Farms/components/TokenList/TokenList.tsx b/src/app/pages/Farms/components/TokenList/TokenList.tsx index 96df2d40..326b716c 100644 --- a/src/app/pages/Farms/components/TokenList/TokenList.tsx +++ b/src/app/pages/Farms/components/TokenList/TokenList.tsx @@ -5,8 +5,8 @@ import { Props } from './TokenList.d'; import { StyledHeader, StyledWrapper, - StyledH3, StyledIconButton, + TypeText, } from './styles'; import ImageLogo from 'app/components/ImageLogo'; import { Flex } from '@chakra-ui/react'; @@ -41,6 +41,27 @@ const TokenList = ({ const tokenSymbols = title.split('+'); + const Version = () => { + const title = type === 'concentrated' ? 'V3' : 'V2'; + const color = type === 'concentrated' ? '#1D9384' : 'white'; + + if (type === 'concentrated') { + return ; + } else { + return ( + + {title} + + ); + } + }; + return ( <> - - {type === 'combine' ? ( - - New V3 farms 🔥 - - ) : null} + - {title} + {title}{' '} + {type === 'concentrated' && + lpAddress === '0xcfc1cbe6d81675719341c3175a34e6762548f79d' ? ( + + ) : null} + {!hideTypeIcons && ( diff --git a/src/app/pages/Farms/components/TokenList/styles.ts b/src/app/pages/Farms/components/TokenList/styles.ts index 2f391426..9166f905 100644 --- a/src/app/pages/Farms/components/TokenList/styles.ts +++ b/src/app/pages/Farms/components/TokenList/styles.ts @@ -1,4 +1,4 @@ -import styled from '@emotion/styled'; +import styled, { keyframes, css } from 'styled-components'; import { Heading } from 'app/components/Typography'; import { IconButton } from 'app/components/IconButton'; @@ -11,19 +11,63 @@ export const StyledH3 = styled(Heading)` text-transform: uppercase; line-height: 1; font-size: ${({ theme }) => theme.fontSizes.sm}; - color: ${({ theme }) => theme.colors.gray}; + color: ${({ theme }) => theme.color?.gray}; margin-bottom: ${({ theme }) => theme.space.spacing03}; `; export const StyledWrapper = styled.div` h2, h3 { - color: ${({ theme }) => theme.colors.white}; + color: ${({ theme }) => theme.color?.white}; } `; export const StyledIconButton = styled(IconButton)` svg { - color: ${({ theme }) => theme.colors.ci}; + color: ${({ theme }) => theme.color?.ci}; + } +`; +const concentratedAnimation = keyframes` + 0% { + transform: scale(1); + } + 50% { + transform: scale(1.2); + } + 100% { + transform: scale(1); + } +`; + +export const TypeText = styled.div<{ + text: string; + disabledAnimation?: boolean; +}>` + padding: 0.25rem 0.75rem; + position: relative; + border-radius: 3px; + margin-left: 4px; + + &:before { + content: ${({ text }) => `'${text}'`}; + position: absolute; + items-align: center; + top: -12px; + left: calc(-1 * 3px); + padding: 5px 8px; + color: white; + background: ${({ disabledAnimation }) => + disabledAnimation + ? '#1d9384' + : css`linear-gradient(100deg, #60e6c5, #1d9384, #000315)`}; + linear-gradient(100deg, #60e6c5, #1d9384, #000315); + border-radius: 8px; + animation: ${({ disabledAnimation }) => + disabledAnimation + ? css`` + : css` + ${concentratedAnimation} 2.5s infinite; + `} + background-size: 300% 300%; } `; diff --git a/src/app/pages/Farms/helpers/filters.ts b/src/app/pages/Farms/helpers/filters.ts index 20ee73ed..02dbd335 100644 --- a/src/app/pages/Farms/helpers/filters.ts +++ b/src/app/pages/Farms/helpers/filters.ts @@ -4,14 +4,10 @@ export const handleFarmData = (data, index) => { switch (index) { case 0: return data; - case FarmType.CLASSIC: - return data.filter(farm => farm.type === 'variable'); - case FarmType.STABLE: - return data.filter(farm => farm.type === 'stable'); case FarmType.CONCENTRATED: return data.filter(farm => farm.type === 'concentrated'); - case FarmType.COMBINE: - return data.filter(farm => farm.type === 'combine'); + case FarmType.TRADICIONAL: + return data.filter(farm => farm.type !== 'concentrated'); default: return data; } @@ -40,12 +36,13 @@ export const filterByState = ( ? true : false; - let inactive = !(parseFloat(pool?.apr) > 0); + // V3 Migration + // once we make the migration to v3, filter by apr again - // V3 MIGRATION - // if (pool.type === 'combine') { - // inactive = false; - // } + let inactive = !(parseFloat(pool?.apr) > 0); + if (pool.type === 'combine') { + inactive = false; + } const filterType = [filterByStaked, filterByInactive]; diff --git a/src/app/pages/Liquidity/Liquidity.tsx b/src/app/pages/Liquidity/Liquidity.tsx index 1dbd5ab2..daa7aeec 100644 --- a/src/app/pages/Liquidity/Liquidity.tsx +++ b/src/app/pages/Liquidity/Liquidity.tsx @@ -1477,9 +1477,7 @@ export function LiquidityPage() { labels={[ TOKEN_TYPE_CLASSIC_LABEL, TOKEN_TYPE_STABLE_LABEL, - - Concentrated Liquidity - , + 'Concentrated Liquidity', // TOKEN_TYPE_CONCENTRATED_LABEL, // TOKEN_TYPE_WEIGHTED_LABEL, ]} diff --git a/src/constants/index.ts b/src/constants/index.ts index 16dd12a5..f759d556 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -18,7 +18,7 @@ export enum ConnectorNames { export const CHAIN_ID = 250; // I think this should be refactored export const DEFAULT_HANDLER = 'spiritswap'; -export const COVALENT_API_KEY = 'ckey_ce0907ce545344edb6d203df10e'; +export const COVALENT_API_KEY = 'ckey_d86797acadb64dc28689f380b74'; export const GELATO_ADDRESS = '0x59e61b95f20e940ac777e88fa2dfa0a6a4c40fa0'; export const GELATO_APPROVE_ADDRESS = diff --git a/src/utils/data/pools.ts b/src/utils/data/pools.ts index af690329..75355d1b 100644 --- a/src/utils/data/pools.ts +++ b/src/utils/data/pools.ts @@ -828,14 +828,9 @@ export const loadFarmsList = async ( .times(rate) .toNumber(); - const label = farm.type === 'combine' ? 'V3' : farm.type; - - ///// INACTIVE FARM LOGIC ///// - // V3 MIGRATION - const IS_INACTIVE = inactiveFarms.includes(farm.lpSymbol.toUpperCase()); - - // enable this - // const IS_INACTIVE = farm.type === 'combine' ? false : true; + //// INACTIVE FARMS LOGIC //// + const label = 'tradicional'; + const inactiveFarm = farm.type === 'combine' ? false : true; const lp: IFarm = { title: farm?.lpSymbol @@ -847,7 +842,7 @@ export const loadFarmsList = async ( gaugeAddress: farm?.gaugeAddress, aprLabel: 'APY', apr: - maxApy.toFormat(2) === 'NaN' || IS_INACTIVE + maxApy.toFormat(2) === 'NaN' || inactiveFarm ? '0' : maxApy.toFormat(2), boosted: true, @@ -857,10 +852,10 @@ export const loadFarmsList = async ( totalLiquidity, totalSupply: farm.liquidityShare, aprRange: - maxApy.toFormat(2) === 'NaN' || IS_INACTIVE ? ['0', '0'] : AprRange, + maxApy.toFormat(2) === 'NaN' || inactiveFarm ? ['0', '0'] : AprRange, boostFactor: '1', yourApr: minApy.isFinite() - ? IS_INACTIVE + ? inactiveFarm ? '0' : minApy?.toString() : '0', diff --git a/yarn.lock b/yarn.lock index e798dabb..063b11b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3133,17 +3133,6 @@ "@emotion/weak-memoize" "^0.3.0" stylis "4.1.3" -"@emotion/cache@^11.9.3": - version "11.9.3" - resolved "https://registry.npmjs.org/@emotion/cache/-/cache-11.9.3.tgz" - integrity sha512-0dgkI/JKlCXa+lEXviaMtGBL0ynpx4osh7rjOXE71q9bIF8G+XhJgvi+wDu0B0IdCVx37BffiwXlN9I3UuzFvg== - dependencies: - "@emotion/memoize" "^0.7.4" - "@emotion/sheet" "^1.1.1" - "@emotion/utils" "^1.0.0" - "@emotion/weak-memoize" "^0.2.5" - stylis "4.0.13" - "@emotion/hash@^0.8.0": version "0.8.0" resolved "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz" @@ -3204,19 +3193,6 @@ "@emotion/weak-memoize" "^0.3.0" hoist-non-react-statics "^3.3.1" -"@emotion/react@^11": - version "11.9.3" - resolved "https://registry.npmjs.org/@emotion/react/-/react-11.9.3.tgz" - integrity sha512-g9Q1GcTOlzOEjqwuLF/Zd9LC+4FljjPjDfxSM7KmEakm+hsHXk+bYZ2q+/hTJzr0OUNkujo72pXLQvXj6H+GJQ== - dependencies: - "@babel/runtime" "^7.13.10" - "@emotion/babel-plugin" "^11.7.1" - "@emotion/cache" "^11.9.3" - "@emotion/serialize" "^1.0.4" - "@emotion/utils" "^1.1.0" - "@emotion/weak-memoize" "^0.2.5" - hoist-non-react-statics "^3.3.1" - "@emotion/serialize@^1.0.2", "@emotion/serialize@^1.0.4": version "1.0.4" resolved "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.0.4.tgz" @@ -3239,11 +3215,6 @@ "@emotion/utils" "^1.2.0" csstype "^3.0.2" -"@emotion/sheet@^1.1.1": - version "1.1.1" - resolved "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.1.1.tgz" - integrity sha512-J3YPccVRMiTZxYAY0IOq3kd+hUP8idY8Kz6B/Cyo+JuXq52Ek+zbPbSQUrVQp95aJ+lsAW7DPL1P2Z+U1jGkKA== - "@emotion/sheet@^1.2.1": version "1.2.1" resolved "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.1.tgz" @@ -3302,11 +3273,6 @@ resolved "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.0.tgz" integrity sha512-sn3WH53Kzpw8oQ5mgMmIzzyAaH2ZqFEbozVVBSYp538E06OSE6ytOp7pRAjNQR+Q/orwqdQYJSe2m3hCOeznkw== -"@emotion/weak-memoize@^0.2.5": - version "0.2.5" - resolved "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz" - integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== - "@emotion/weak-memoize@^0.3.0": version "0.3.0" resolved "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz" From c58791eea1ce9c67e1a8be44f4b2a3145a1acd35 Mon Sep 17 00:00:00 2001 From: Nicolas carballo Date: Tue, 4 Jul 2023 18:54:31 -0300 Subject: [PATCH 08/14] polish --- src/app/assets/icons/index.tsx | 15 ++ src/app/assets/images/V2Icon.svg | 37 ++++ src/app/assets/images/V3Icon.svg | 17 ++ src/app/assets/images/X2Icon.svg | 24 +++ .../NewTokenAmountPanel.tsx | 19 +- src/app/components/Select/Select.tsx | 12 +- src/app/components/TWAP/TWAPOrders.tsx | 4 +- .../TransactionFlow/utils/helper.ts | 14 +- src/app/connectors/EthersConnector/index.tsx | 7 +- src/app/hooks/useGetTokensPrices.ts | 1 + src/app/interfaces/Farm.ts | 2 +- src/app/pages/Farms/Farms.tsx | 13 +- .../components/FarmControls/FarmControls.tsx | 2 +- .../Farms/components/TokenList/TokenList.tsx | 38 +--- src/app/pages/Farms/helpers/filters.ts | 2 +- .../Inspirit/components/Dashboard/index.tsx | 8 +- .../Inspirit/components/Voting/Voting.tsx | 22 +-- .../components/TokenTableV3/TokenTableV3.tsx | 15 +- .../components/VotingPanel/VotingPanel.tsx | 68 +------ src/app/pages/Liquidity/Liquidity.tsx | 174 ++---------------- src/utils/data/covalent.ts | 2 + src/utils/data/pools.ts | 2 +- src/utils/web3/actions/farm.ts | 6 +- yarn.lock | 2 +- 24 files changed, 172 insertions(+), 334 deletions(-) create mode 100644 src/app/assets/images/V2Icon.svg create mode 100644 src/app/assets/images/V3Icon.svg create mode 100644 src/app/assets/images/X2Icon.svg diff --git a/src/app/assets/icons/index.tsx b/src/app/assets/icons/index.tsx index 8607a418..6135df78 100644 --- a/src/app/assets/icons/index.tsx +++ b/src/app/assets/icons/index.tsx @@ -88,6 +88,10 @@ import { ReactComponent as PeckShieldAudit } from 'app/assets/images/peckShieldA import { ReactComponent as ParaSwap } from 'app/assets/images/paraSwap.svg'; import { ReactComponent as Algebra } from 'app/assets/images/algebra.svg'; +import { ReactComponent as V3Icon } from 'app/assets/images/V3Icon.svg'; +import { ReactComponent as V2Icon } from 'app/assets/images/V2Icon.svg'; +import { ReactComponent as X2Icon } from 'app/assets/images/X2Icon.svg'; + const { ci, grayDarker, danger, warning } = colors; const iconSize = { xs: '12px', @@ -98,6 +102,17 @@ const iconSize = { const { md } = iconSize; +export const V3IconBadge = ({ w = md, h = md, ...rest }) => { + return ; +}; +export const X2IconBadge = ({ w = md, h = md, ...rest }) => { + return ; +}; + +export const V2IconBadge = ({ w = md, h = md, ...rest }) => { + return ; +}; + export const ZokyoAuditLogo = ({ w = md, h = md, color = ci, ...rest }) => { return ; }; diff --git a/src/app/assets/images/V2Icon.svg b/src/app/assets/images/V2Icon.svg new file mode 100644 index 00000000..6b4378e7 --- /dev/null +++ b/src/app/assets/images/V2Icon.svg @@ -0,0 +1,37 @@ + + + + + + + + + + V2 + diff --git a/src/app/assets/images/V3Icon.svg b/src/app/assets/images/V3Icon.svg new file mode 100644 index 00000000..5e0673a1 --- /dev/null +++ b/src/app/assets/images/V3Icon.svg @@ -0,0 +1,17 @@ + + + diff --git a/src/app/assets/images/X2Icon.svg b/src/app/assets/images/X2Icon.svg new file mode 100644 index 00000000..07fdcccb --- /dev/null +++ b/src/app/assets/images/X2Icon.svg @@ -0,0 +1,24 @@ + + + + + + 2X + diff --git a/src/app/components/NewTokenAmountPanel/NewTokenAmountPanel.tsx b/src/app/components/NewTokenAmountPanel/NewTokenAmountPanel.tsx index bc460eef..3b4c47f1 100644 --- a/src/app/components/NewTokenAmountPanel/NewTokenAmountPanel.tsx +++ b/src/app/components/NewTokenAmountPanel/NewTokenAmountPanel.tsx @@ -110,15 +110,16 @@ const NewTokenAmountPanel = ({ token?.symbol !== 'FTM' ? [token?.address ?? ''] : [WFTM.address], token?.chainId ?? 1, ); - tokensPrices.forEach(price => { - if ( - price.address.toLowerCase() === token?.address.toLowerCase() || - (token?.symbol === 'FTM' && - price.address.toLowerCase() === WFTM.address.toLowerCase()) - ) { - setTokenPrice(price.rate); - } - }); + tokensPrices && + tokensPrices.forEach(price => { + if ( + price.address.toLowerCase() === token?.address.toLowerCase() || + (token?.symbol === 'FTM' && + price.address.toLowerCase() === WFTM.address.toLowerCase()) + ) { + setTokenPrice(price.rate); + } + }); }; fetchTokenPrice(); diff --git a/src/app/components/Select/Select.tsx b/src/app/components/Select/Select.tsx index a78b9a0f..c016101b 100644 --- a/src/app/components/Select/Select.tsx +++ b/src/app/components/Select/Select.tsx @@ -33,17 +33,7 @@ const Select = ({ if (typeof label === 'string') { return ( - + {label} ); diff --git a/src/app/components/TWAP/TWAPOrders.tsx b/src/app/components/TWAP/TWAPOrders.tsx index 92576302..13ab8620 100644 --- a/src/app/components/TWAP/TWAPOrders.tsx +++ b/src/app/components/TWAP/TWAPOrders.tsx @@ -14,9 +14,7 @@ function TWAPOrders({ showChart }: { showChart: boolean }) { { - return await getProvider(); - }} + getProvider={getProvider} getTokenImageUrl={getTokenImageUrl} /> diff --git a/src/app/components/TransactionFlow/utils/helper.ts b/src/app/components/TransactionFlow/utils/helper.ts index b447a7a3..ccfc359f 100644 --- a/src/app/components/TransactionFlow/utils/helper.ts +++ b/src/app/components/TransactionFlow/utils/helper.ts @@ -69,7 +69,7 @@ export const buildAddLiquidity = ( | AddLiquidityTradeV3 | null, isV2?: boolean, - type?: number, // classic: 0, stable: 1, concentrated: 2, weighted: 3 + type?: number, // varible: 0, stable: 1, concentrated: 2, weighted: 3 isStable?: boolean, ): StepProps | {} => { let action: Function = addLiquidity; @@ -91,12 +91,12 @@ export const buildAddLiquidity = ( } } - if (type === 3) { - action = addWeightedLiquidity; - if (liquidityTrade) { - params = Object.values(liquidityTrade); - } - } + // if (type === 3) { + // action = addWeightedLiquidity; + // if (liquidityTrade) { + // params = Object.values(liquidityTrade); + // } + // } return { number, diff --git a/src/app/connectors/EthersConnector/index.tsx b/src/app/connectors/EthersConnector/index.tsx index 95435867..768041be 100644 --- a/src/app/connectors/EthersConnector/index.tsx +++ b/src/app/connectors/EthersConnector/index.tsx @@ -19,6 +19,7 @@ import { WorkerCall } from 'types'; import useWallets from 'app/hooks/useWallets'; import getNotificationIcon from '../getNotificationIcon'; import { selectAddress, selectPendingTransactions } from 'store/user/selectors'; +import { ethers } from 'ethers'; const EthersConnector = ({ children }) => { const toast = useToast(); @@ -245,7 +246,11 @@ const EthersConnector = ({ children }) => { Object.keys(inQueue).forEach(hash => { if (!hash) return; - const receiptPromise = provider!.getTransactionReceipt(hash); + const newProvider = provider + ? new ethers.providers.Web3Provider(provider, 'any') + : undefined; + + const receiptPromise = newProvider!.getTransactionReceipt(hash); const match = pending.find( transaction => `${transaction.hash}` === `${hash}`, diff --git a/src/app/hooks/useGetTokensPrices.ts b/src/app/hooks/useGetTokensPrices.ts index bc8133f9..2574b679 100644 --- a/src/app/hooks/useGetTokensPrices.ts +++ b/src/app/hooks/useGetTokensPrices.ts @@ -27,6 +27,7 @@ const useGetTokensPrices = ({ try { setLoadingPrices(true); const data = await getTokensDetails(tokenAddresses, chainId); + if (!data) return setTokensPrices({}); let tokenObjectPrices = {}; data?.forEach(token => { if (token.address === BASE_TOKEN_ADDRESS) { diff --git a/src/app/interfaces/Farm.ts b/src/app/interfaces/Farm.ts index 89dc661c..ff5facba 100644 --- a/src/app/interfaces/Farm.ts +++ b/src/app/interfaces/Farm.ts @@ -207,7 +207,7 @@ export interface GaugeFarm { export enum FarmType { ALL, - TRADICIONAL, + TRADITIONAL, CONCENTRATED, } diff --git a/src/app/pages/Farms/Farms.tsx b/src/app/pages/Farms/Farms.tsx index e7732b47..4f1e56e5 100644 --- a/src/app/pages/Farms/Farms.tsx +++ b/src/app/pages/Farms/Farms.tsx @@ -1,6 +1,6 @@ import { FARMS } from 'constants/icons'; import { useState, useEffect, useMemo, useCallback } from 'react'; -import { Box, Button, HStack, useDisclosure } from '@chakra-ui/react'; +import { Box, HStack, useDisclosure } from '@chakra-ui/react'; import { CardHeader } from 'app/components/CardHeader'; import Web3Monitoring from 'app/connectors/EthersConnector/transactions'; import { IFarm, IFarmFilters } from 'app/interfaces/Farm'; @@ -37,7 +37,6 @@ import { ConnectWallet } from 'app/components/ConnectWallet'; import { FarmCreateModal } from './components/FarmCreateModal'; import { ethers } from 'ethers'; import useWallets from 'app/hooks/useWallets'; -import useLogin from 'app/connectors/EthersConnector/login'; import { FARMS as FARMS_ROUTE } from 'app/router/routes'; import { useEternalFarmingRewards } from 'app/hooks/v3/useEternalFarmingsRewards'; @@ -50,7 +49,6 @@ export const Farms = () => { const { addToQueue } = Web3Monitoring(); const { userLiquidity, userConcentratedLiquidity } = GetWalletBalance(); const { account } = useWallets(); - const { handleLogin } = useLogin(); const pageTitle = `${t('common.name')} - ${t(`${translationPath}.title`)}`; const navigate = useNavigate(); const [sortType, setSortType] = useState(0); @@ -86,10 +84,10 @@ export const Farms = () => { const [farmFilters, setFarmFilters] = useState(initialFarmFilters); - const onCreateFarm = () => { - if (!account) handleLogin(); - farmCreate.onOpen(); - }; + // const onCreateFarm = () => { + // if (!account) handleLogin(); + // farmCreate.onOpen(); + // }; // Function that runs when component receives a new farm address (creation ecofarm) useMemo(() => { @@ -277,7 +275,6 @@ export const Farms = () => { /> - {' '}
{!address && ( diff --git a/src/app/pages/Farms/components/FarmControls/FarmControls.tsx b/src/app/pages/Farms/components/FarmControls/FarmControls.tsx index a5c48ad8..7ee31a53 100644 --- a/src/app/pages/Farms/components/FarmControls/FarmControls.tsx +++ b/src/app/pages/Farms/components/FarmControls/FarmControls.tsx @@ -29,7 +29,7 @@ export default function FarmControls({ diff --git a/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx b/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx index 9db13e6c..9d20872d 100644 --- a/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx +++ b/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx @@ -74,29 +74,16 @@ const TokenTableV3 = ({ useEffect(() => { const getBoostedFarms = async () => { - const userBoostedVariable = getUserFarms(boostedVariable, stakedFarms); - const userBoostedStable = getUserFarms(boostedStable, stakedFarms); const userBoostedCombine = getUserFarms(boostedCombine, stakedFarms); onUpdateFarm({ - variableClassics: sortFn(boostedVariable, 'yourVote', 'des'), - userVariableClassics: sortFn(userBoostedVariable, 'yourVote', 'des'), - stables: sortFn(boostedStable, 'yourVote', 'des'), - userStables: sortFn(userBoostedStable, 'yourVote', 'des'), combine: sortFn(boostedCombine, 'yourVote', 'des'), userCombine: sortFn(userBoostedCombine, 'yourVote', 'des'), }); }; getBoostedFarms(); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [ - searchValues, - userOnly, - farmType, - account, - boostedVariable, - boostedStable, - ]); + }, [searchValues, userOnly, farmType, account]); const filteredBribes = useMemo(() => { if (searchValues) { diff --git a/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx b/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx index 7b17461e..522c9beb 100644 --- a/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx +++ b/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx @@ -26,26 +26,10 @@ const VotingPanel = ({ }) => { const allFarms = useAppSelector(selectFarmMasterData); const [userOnly, setUserOnly] = useState(false); - - const [classicFarms, setclassicFarms] = useState({ - farms: [], - userFarms: [], - }); - const [stableFarms, setStableFarms] = useState({ - farms: [], - userFarms: [], - }); - - const [variableFarms, setVariableFarms] = useState({ - farms: [], - userFarms: [], - }); - const [combineFarms, setCombineFarms] = useState({ farms: [], userFarms: [], }); - const [selectedFarms, setSelectedFarms] = useState([]); const [sortBy, setSortBy] = useState(); const [sortDirection, setSortDirection] = useState(); @@ -56,22 +40,7 @@ const VotingPanel = ({ setUserOnly(!userOnly); }; - const updatingFarm = ({ - classics, - userClassics, - stables, - userStables, - variableClassics, - userVariableClassics, - combine, - userCombine, - }) => { - setclassicFarms({ farms: classics, userFarms: userClassics }); - setVariableFarms({ - farms: variableClassics, - userFarms: userVariableClassics, - }); - setStableFarms({ farms: stables, userFarms: userStables }); + const updatingFarm = ({ combine, userCombine }) => { setCombineFarms({ farms: combine, userFarms: userCombine }); }; @@ -82,37 +51,7 @@ const VotingPanel = ({ }; useEffect(() => { - if (farmType.index === 0) { - const filterInactivesFarms = stableFarms.farms.filter( - farm => !inactiveInspirit.includes(farm.name.toUpperCase()), - ); - const filterInactivesUserFarms = stableFarms.userFarms.filter( - farm => !inactiveInspirit.includes(farm.name.toUpperCase()), - ); - setSelectedFarms( - sortFn( - userOnly ? filterInactivesUserFarms : filterInactivesFarms, - sortBy, - sortDirection, - ), - ); - } - if (farmType.index === 1) { - const filterInactivesFarms = variableFarms.farms.filter( - farm => !inactiveInspirit.includes(farm.name.toUpperCase()), - ); - const filterInactivesUserFarms = variableFarms.userFarms.filter( - farm => !inactiveInspirit.includes(farm.name.toUpperCase()), - ); - setSelectedFarms( - sortFn( - userOnly ? filterInactivesUserFarms : filterInactivesFarms, - sortBy, - sortDirection, - ), - ); - } - if (farmType.index === 2) { + if (farmType.value === 'Combine') { // Combine farms const filterInactivesFarms = combineFarms.farms.filter( farm => !inactiveInspirit.includes(farm.name.toUpperCase()), @@ -131,9 +70,6 @@ const VotingPanel = ({ }, [ farmType, userOnly, - classicFarms, - stableFarms, - variableFarms, sortBy, sortDirection, combineFarms.farms, diff --git a/src/app/pages/Liquidity/Liquidity.tsx b/src/app/pages/Liquidity/Liquidity.tsx index daa7aeec..5649125a 100644 --- a/src/app/pages/Liquidity/Liquidity.tsx +++ b/src/app/pages/Liquidity/Liquidity.tsx @@ -28,7 +28,6 @@ import { YourLiquidityWrapper, CollapseSection, StyledLiquiditySetting, - StyledConcentratedLiqudityLabel, } from './styles'; import { Select } from 'app/components/Select'; import { Slippage } from './components/Slippage'; @@ -60,11 +59,7 @@ import { } from 'app/utils'; import UseIsLoading from 'app/hooks/UseIsLoading'; import { formatUnits, parseUnits } from 'ethers/lib/utils'; -import { - checkAllowance, - queryJoinPool, - addSobLiquidity, -} from 'utils/web3/actions'; +import { checkAllowance, addSobLiquidity } from 'utils/web3/actions'; import { buildCheckAndApprove, buildAddLiquidity, @@ -80,7 +75,6 @@ import pools from 'constants/farms'; import { ClassicPanel, StablePanel, - WeightedPanel, ConcentratedPanel, } from 'app/pages/Liquidity/components/Panels'; import { ActionButton } from './components/ActionButton'; @@ -111,16 +105,12 @@ import { Heading } from 'app/components/Typography'; import { ConfirmModalConcentrated } from './components/ConfirmModalConcentrated'; import { Switch } from 'app/components/Switch'; -// TODO: [DEV2-591] refactor liquidity component - -const TOKEN_TYPE_CLASSIC_INDEX = 0; -const TOKEN_TYPE_CLASSIC_LABEL = 'Variable'; +const TOKEN_TYPE_VARIABLE_INDEX = 0; +const TOKEN_TYPE_VARIABLE_LABEL = 'Variable'; const TOKEN_TYPE_STABLE_INDEX = 1; const TOKEN_TYPE_STABLE_LABEL = 'Stable'; const TOKEN_TYPE_CONCENTRATED_INDEX = 2; const TOKEN_TYPE_CONCENTRATED_LABEL = 'Concentrated Liquidity'; -const TOKEN_TYPE_WEIGHTED_INDEX = 3; -const TOKEN_TYPE_WEIGHTED_LABEL = 'Weighted'; export function LiquidityPage() { const { t } = useTranslation(); @@ -154,7 +144,7 @@ export function LiquidityPage() { if (type === 'concentrated') { return TOKEN_TYPE_CONCENTRATED_INDEX; } - return TOKEN_TYPE_CLASSIC_INDEX; + return TOKEN_TYPE_VARIABLE_INDEX; }; const matchesToken = tokenParam => { @@ -341,26 +331,9 @@ export function LiquidityPage() { } = useDisclosure(); const [tokenTypeFilter, setTokenTypeFilter] = useState(liquidityTypeFromFarm); const isStableSelected = tokenTypeFilter === TOKEN_TYPE_STABLE_INDEX; - const isWeightedSelected = tokenTypeFilter === TOKEN_TYPE_WEIGHTED_INDEX; const isConcentratedSelected = tokenTypeFilter === TOKEN_TYPE_CONCENTRATED_INDEX; - const [inputErrors, setInputErrors] = useState({ - [TOKEN_TYPE_CLASSIC_INDEX]: undefined, - [TOKEN_TYPE_STABLE_INDEX]: undefined, - [TOKEN_TYPE_WEIGHTED_INDEX]: undefined, - }); - - const updateInputError = (indexType, message) => { - setInputErrors({ - ...inputErrors, - [indexType]: message, - }); - }; - - const setWeightedInputError = message => - updateInputError(TOKEN_TYPE_WEIGHTED_INDEX, message); - // Handle behaviour when user logouts useEffect(() => { resetPanel(); @@ -991,19 +964,11 @@ export function LiquidityPage() { amount: '2', }, ]; - } else if (!isWeightedSelected && liquidityTrade) { + } else if (liquidityTrade) { return [ { token: liquidityTrade.tokenA, amount: liquidityTrade.amountA }, { token: liquidityTrade.tokenB, amount: liquidityTrade.amountB }, ]; - } else if (isWeightedSelected) { - const tps = weightedPoolSelected?.tokens as Token[]; - if (tps) { - return tps.map(token => ({ - token, - amount: weightedPoolInputValue[token.symbol] ?? '0', - })); - } } else { const tps = tokenPoolSelected?.tokens as Token[]; if (tps) { @@ -1020,7 +985,6 @@ export function LiquidityPage() { // eslint-disable-next-line react-hooks/exhaustive-deps }, [ isStableSelected, - isWeightedSelected, isConcentratedSelected, liquidityTrade, firstToken, @@ -1040,9 +1004,7 @@ export function LiquidityPage() { tokenPoolSelected, ]); - const liquidityToReceive = isWeightedSelected - ? nonClassicTrade?.liquidity || 0 - : liquidityTrade?.liquidity || 0; + const liquidityToReceive = liquidityTrade?.liquidity || 0; const verifyAllowance = useCallback( async (tokenWithAmount: TokenAmount) => { @@ -1057,10 +1019,6 @@ export function LiquidityPage() { let approve_address = ROUTERV2_ADDRESS; - if (isWeightedSelected) { - approve_address = WEIGHTED_VAULT_ADDRESS; - } - if (isConcentratedSelected) { approve_address = NONFUNGIBLE_POSITION_ADDRESS; } @@ -1083,7 +1041,6 @@ export function LiquidityPage() { WEIGHTED_VAULT_ADDRESS, NONFUNGIBLE_POSITION_ADDRESS, account, - isWeightedSelected, isConcentratedSelected, isStableSelected, ], @@ -1111,10 +1068,6 @@ export function LiquidityPage() { const initialSteps = useCallback(() => { let approveAddress = ROUTERV2_ADDRESS; - if (isWeightedSelected) { - approveAddress = WEIGHTED_VAULT_ADDRESS; - } - if (isConcentratedSelected) { approveAddress = NONFUNGIBLE_POSITION_ADDRESS; } @@ -1169,29 +1122,6 @@ export function LiquidityPage() { ]; } - if (tokenTypeFilter === TOKEN_TYPE_WEIGHTED_INDEX) { - const tradeParams = { - pool: (tokenTypeFilter === TOKEN_TYPE_WEIGHTED_INDEX - ? weightedPoolSelected - : tokenPoolSelected) as SobTokenPool, - tokensWithValue: selectedTokensWithValue(), - account, - }; - - return [ - ...approveSteps, - buildAddLiquidity( - stepNumber, - account, - tradeParams as AddLiquidityTradeV2, - true, - tokenTypeFilter, - false, - ), - ...zapStep, - ]; - } - if (tokenTypeFilter === TOKEN_TYPE_CONCENTRATED_INDEX) { return [ ...approveSteps, @@ -1241,15 +1171,6 @@ export function LiquidityPage() { useEffect(() => { const [action] = steps.filter(step => step?.type === 'liquidity'); const [pool, tokensWithAmounts, account] = action?.params || []; - const queryJoin = async () => { - loadingOn(); - - if (action.params) { - const query = await queryJoinPool(pool, tokensWithAmounts, account); - setNonClassicTrade(query); - loadingOff(); - } - }; const queryBatchSwap = async () => { loadingOff(); @@ -1276,13 +1197,6 @@ export function LiquidityPage() { }); if (checkQuery && hasAllBalances && steps && steps.length) { - if ( - tokenTypeFilter === TOKEN_TYPE_WEIGHTED_INDEX && - pool?.type === 'weighted' - ) { - queryJoin(); - } - if ( tokenTypeFilter === TOKEN_TYPE_STABLE_INDEX && pool?.type === 'stable' @@ -1299,16 +1213,12 @@ export function LiquidityPage() { const poolsLabel = 'Pools'; const defaultTitle = 'Add liquidity'; switch (tokenTypeFilter) { - case TOKEN_TYPE_CLASSIC_INDEX: + case TOKEN_TYPE_VARIABLE_INDEX: return defaultTitle; case TOKEN_TYPE_STABLE_INDEX: return tokenPoolSelected ? `${TOKEN_TYPE_STABLE_LABEL} ${poolsLabel}` : defaultTitle; - case TOKEN_TYPE_WEIGHTED_INDEX: - return weightedPoolSelected - ? `${TOKEN_TYPE_WEIGHTED_LABEL} ${poolsLabel}` - : defaultTitle; default: return defaultTitle; } @@ -1335,12 +1245,7 @@ export function LiquidityPage() { tokensWithValue={selectedTokensWithValue()?.reverse()} price={liquidityToReceive || '0'} sharePool={liquidityTrade ? liquidityTrade.ownership : '-'} - isWeightedPool={tokenTypeFilter === TOKEN_TYPE_WEIGHTED_INDEX} - poolName={ - tokenTypeFilter === TOKEN_TYPE_WEIGHTED_INDEX - ? weightedPoolSelected?.name - : liquidityTrade?.lpSymbol - } + poolName={liquidityTrade?.lpSymbol} isLoading={isLoading} zapDirectly={zapDirectly} setZapDirectly={setZapDirectly} @@ -1419,10 +1324,7 @@ export function LiquidityPage() { onClose={onClose} isOpen={isOpen} disabled={ - !liquidityTrade && - !isStableSelected && - !isWeightedSelected && - !isConcentratedSelected + !liquidityTrade && !isStableSelected && !isConcentratedSelected } nextStep={() => void 0} notifications={notifications} @@ -1475,18 +1377,16 @@ export function LiquidityPage() { diff --git a/src/app/pages/Farms/helpers/filters.ts b/src/app/pages/Farms/helpers/filters.ts index 2e8701a3..b9406422 100644 --- a/src/app/pages/Farms/helpers/filters.ts +++ b/src/app/pages/Farms/helpers/filters.ts @@ -6,8 +6,19 @@ export const handleFarmData = (data, index) => { return data; case FarmType.CONCENTRATED: return data.filter(farm => farm.type === 'concentrated'); - case FarmType.TRADITIONAL: - return data.filter(farm => farm.type !== 'concentrated'); + case FarmType.VARIABLE: + return data.filter( + farm => + farm.type === 'variable' || + (farm.type === 'combine' && farm.stable === false), + ); + case FarmType.STABLE: + return data.filter( + farm => + farm.type === 'stable' || + (farm.type === 'combine' && farm.stable === true), + ); + default: return data; } diff --git a/src/app/pages/Inspirit/components/Voting/Voting.tsx b/src/app/pages/Inspirit/components/Voting/Voting.tsx index b46e0176..8bbd18a5 100644 --- a/src/app/pages/Inspirit/components/Voting/Voting.tsx +++ b/src/app/pages/Inspirit/components/Voting/Voting.tsx @@ -44,7 +44,7 @@ function Voting() { const [selectedFarmType, setSelectedFarmType] = useState<{ index: number; value: string; - }>({ index: 0, value: 'Combine' }); + }>({ index: 0, value: 'Traditional' }); // Version id 1 for combine farms const VERSION_ID = 1; @@ -125,7 +125,7 @@ function Voting() { {t(`${translationPath}.farmType.label`)} diff --git a/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx b/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx index 29e12fb6..e01da088 100644 --- a/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx +++ b/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx @@ -27,6 +27,7 @@ import { selectSaturatedGauges } from 'store/general/selectors'; import useMobile from 'utils/isMobile'; import { MobileTable } from '../MobileTable'; import useWallets from 'app/hooks/useWallets'; +import { selectFarmMasterData } from 'store/farms/selectors'; const TokenTableV3 = ({ errorMessage, @@ -50,6 +51,7 @@ const TokenTableV3 = ({ const translationPath = 'inSpirit.voting'; const stakedFarms = useAppSelector(selectFarmsStaked); const lockedSpiritBalance = useAppSelector(selectLockedInSpiritAmount); + const farms = useAppSelector(selectFarmMasterData); const [searchValues, setSearchValues] = useState(''); const [showMobileTableFilters, setShowMobileTableFilters] = useState(false); @@ -74,9 +76,45 @@ const TokenTableV3 = ({ const getBoostedFarms = async () => { const userBoostedCombine = getUserFarms(boostedCombine, stakedFarms); + console.log('userBoostedCombine', userBoostedCombine); + console.log(boostedCombine, 'boostedCombine'); + + const combineFarmsData = farms.filter(farm => farm.type === 'combine'); + + let stableFarms: any = []; + let variableFarms: any = []; + + boostedCombine.forEach(farm => { + const { fulldata } = farm; + const farmData = combineFarmsData.find( + combineFarm => combineFarm.gaugeAddress === fulldata.gaugeAddress, + ); + if (farmData.stable) { + stableFarms.push(farm); + } else { + variableFarms.push(farm); + } + }); + + boostedCombine.forEach(farm => { + const { fulldata } = farm; + const farmData = combineFarmsData.find( + combineFarm => combineFarm.gaugeAddress === fulldata.gaugeAddress, + ); + if (farmData.stable) { + stableFarms.push(farm); + } else { + variableFarms.push(farm); + } + }); + + console.log(userBoostedCombine, 'userBoostedCombine'); + onUpdateFarm({ - combine: sortFn(boostedCombine, 'yourVote', 'des'), - userCombine: sortFn(userBoostedCombine, 'yourVote', 'des'), + variableCombine: sortFn(variableFarms, 'yourVote', 'des'), + userVariableCombine: sortFn(userBoostedCombine, 'yourVote', 'des'), + stableCombine: sortFn(stableFarms, 'yourVote', 'des'), + userStableCombine: sortFn(userBoostedCombine, 'yourVote', 'des'), }); }; getBoostedFarms(); diff --git a/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx b/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx index 3d1304ee..6c880ba1 100644 --- a/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx +++ b/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx @@ -26,7 +26,13 @@ const VotingPanel = ({ }) => { const allFarms = useAppSelector(selectFarmMasterData); const [userOnly, setUserOnly] = useState(false); - const [combineFarms, setCombineFarms] = useState({ + const [variableCombineFarms, setVariableCombineFarms] = useState( + { + farms: [], + userFarms: [], + }, + ); + const [stableCombineFarms, setStableCombineFarms] = useState({ farms: [], userFarms: [], }); @@ -40,8 +46,13 @@ const VotingPanel = ({ setUserOnly(!userOnly); }; - const updatingFarm = ({ combine, userCombine }) => { - setCombineFarms({ farms: combine, userFarms: userCombine }); + const updatingFarm = ({ + variableCombine, + userVariableCombine, + stableCombine, + userStableCombine, + }) => { + // setCombineFarms({ farms: combine, userFarms: userCombine }); }; const handleSort = (by, direction) => { @@ -51,12 +62,28 @@ const VotingPanel = ({ }; useEffect(() => { - if (farmType.value === 'Traditional') { + if (farmType.value === 'Variable') { + // Combine farms + const filterInactivesFarms = variableCombineFarms.farms.filter( + farm => !inactiveInspirit.includes(farm.name.toUpperCase()), + ); + const filterInactivesUserFarms = variableCombineFarms.userFarms.filter( + farm => !inactiveInspirit.includes(farm.name.toUpperCase()), + ); + setSelectedFarms( + sortFn( + userOnly ? filterInactivesUserFarms : filterInactivesFarms, + sortBy, + sortDirection, + ), + ); + } + if (farmType.value === 'Stable') { // Combine farms - const filterInactivesFarms = combineFarms.farms.filter( + const filterInactivesFarms = stableCombineFarms.farms.filter( farm => !inactiveInspirit.includes(farm.name.toUpperCase()), ); - const filterInactivesUserFarms = combineFarms.userFarms.filter( + const filterInactivesUserFarms = stableCombineFarms.userFarms.filter( farm => !inactiveInspirit.includes(farm.name.toUpperCase()), ); setSelectedFarms( @@ -72,8 +99,10 @@ const VotingPanel = ({ userOnly, sortBy, sortDirection, - combineFarms.farms, - combineFarms.userFarms, + variableCombineFarms.farms, + variableCombineFarms.userFarms, + stableCombineFarms.farms, + stableCombineFarms.userFarms, ]); const farmsSize = selectedFarms?.length; From 4de325ae0364a6782297bcfd8894a3440f868901 Mon Sep 17 00:00:00 2001 From: Nicolas carballo Date: Wed, 5 Jul 2023 12:26:44 -0300 Subject: [PATCH 12/14] fixing labeling on inspirit --- .../components/TokenTableV3/TokenTableV3.tsx | 34 ++++++--------- .../components/VotingPanel/VotingPanel.tsx | 12 +++++- src/constants/farms/index.ts | 42 +------------------ 3 files changed, 25 insertions(+), 63 deletions(-) diff --git a/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx b/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx index e01da088..b23926f6 100644 --- a/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx +++ b/src/app/pages/Inspirit/components/Voting/components/TokenTableV3/TokenTableV3.tsx @@ -75,46 +75,38 @@ const TokenTableV3 = ({ useEffect(() => { const getBoostedFarms = async () => { const userBoostedCombine = getUserFarms(boostedCombine, stakedFarms); - - console.log('userBoostedCombine', userBoostedCombine); - console.log(boostedCombine, 'boostedCombine'); - const combineFarmsData = farms.filter(farm => farm.type === 'combine'); let stableFarms: any = []; let variableFarms: any = []; + let userStableFarms: any = []; + let userVariableFarms: any = []; - boostedCombine.forEach(farm => { + boostedCombine?.forEach(farm => { const { fulldata } = farm; const farmData = combineFarmsData.find( combineFarm => combineFarm.gaugeAddress === fulldata.gaugeAddress, ); - if (farmData.stable) { - stableFarms.push(farm); - } else { - variableFarms.push(farm); - } + + if (farmData.stable) stableFarms.push(farm); + else variableFarms.push(farm); }); - boostedCombine.forEach(farm => { + userBoostedCombine?.forEach(farm => { const { fulldata } = farm; const farmData = combineFarmsData.find( - combineFarm => combineFarm.gaugeAddress === fulldata.gaugeAddress, + combineFarm => combineFarm.lpAddress === fulldata.farmAddress, ); - if (farmData.stable) { - stableFarms.push(farm); - } else { - variableFarms.push(farm); - } - }); - console.log(userBoostedCombine, 'userBoostedCombine'); + if (farmData.stable) userStableFarms.push(farm); + else userVariableFarms.push(farm); + }); onUpdateFarm({ variableCombine: sortFn(variableFarms, 'yourVote', 'des'), - userVariableCombine: sortFn(userBoostedCombine, 'yourVote', 'des'), + userVariableCombine: sortFn(userVariableFarms, 'yourVote', 'des'), stableCombine: sortFn(stableFarms, 'yourVote', 'des'), - userStableCombine: sortFn(userBoostedCombine, 'yourVote', 'des'), + userStableCombine: sortFn(userStableFarms, 'yourVote', 'des'), }); }; getBoostedFarms(); diff --git a/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx b/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx index 6c880ba1..ebbe8594 100644 --- a/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx +++ b/src/app/pages/Inspirit/components/Voting/components/VotingPanel/VotingPanel.tsx @@ -52,7 +52,14 @@ const VotingPanel = ({ stableCombine, userStableCombine, }) => { - // setCombineFarms({ farms: combine, userFarms: userCombine }); + setVariableCombineFarms({ + farms: variableCombine, + userFarms: userVariableCombine, + }); + setStableCombineFarms({ + farms: stableCombine, + userFarms: userStableCombine, + }); }; const handleSort = (by, direction) => { @@ -62,8 +69,8 @@ const VotingPanel = ({ }; useEffect(() => { + // Combine farms if (farmType.value === 'Variable') { - // Combine farms const filterInactivesFarms = variableCombineFarms.farms.filter( farm => !inactiveInspirit.includes(farm.name.toUpperCase()), ); @@ -103,6 +110,7 @@ const VotingPanel = ({ variableCombineFarms.userFarms, stableCombineFarms.farms, stableCombineFarms.userFarms, + variableCombineFarms, ]); const farmsSize = selectedFarms?.length; diff --git a/src/constants/farms/index.ts b/src/constants/farms/index.ts index 20cf1fa9..8f7e303b 100644 --- a/src/constants/farms/index.ts +++ b/src/constants/farms/index.ts @@ -12,46 +12,8 @@ export const farmsRouterV2 = farmsRouterV2List; export const allV1farms = farms.concat(farmsV2); -export const inactiveFarms = [ - 'SPIRIT-SINSPIRIT', - 'SCARAB-GSCARAB', - 'WFTM-GOHM', - 'WFTM-COMB', - 'WFTM-CRE8R', - 'WFTM-FXS', - 'WFTM-MIM', - 'WFTM-FRAX', - 'WFTM-TAROT', - 'WFTM-BIFI', - 'WFTM-GALCX', - 'WFTM-RING', - 'WFTM-WPGUNK', - 'WFTM-LINK', - 'WFTM-WBOMB', - 'USDC-BUSD', - 'USDC-ALUSD', - 'USDC-MAI', -]; -export const inactiveInspirit = [ - 'SPIRIT SINSPIRIT', - 'SCARAB GSCARAB', - 'WFTM GOHM', - 'WFTM COMB', - 'WFTM CRE8R', - 'WFTM FXS', - 'WFTM MIM', - 'WFTM FRAX', - 'WFTM TAROT', - 'WFTM BIFI', - 'WFTM GALCX', - 'WFTM RING', - 'WFTM WPGUNK', - 'WFTM LINK', - 'WFTM WBOMB', - 'USDC BUSD', - 'USDC ALUSD', - 'USDC MAI', -]; +export const inactiveFarms = []; +export const inactiveInspirit: string[] = []; const allFarms = allV1farms.concat(farmsRouterV2); export default allFarms; From 2304e40a0e262301015d426084ef8345c7f6e6ad Mon Sep 17 00:00:00 2001 From: Nicolas carballo Date: Wed, 5 Jul 2023 19:16:17 -0300 Subject: [PATCH 13/14] fixing swap page --- src/app/components/TWAP/TWAPOrders.tsx | 3 +-- src/app/components/TWAP/TWAPPanel.tsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/components/TWAP/TWAPOrders.tsx b/src/app/components/TWAP/TWAPOrders.tsx index 13ab8620..e548f757 100644 --- a/src/app/components/TWAP/TWAPOrders.tsx +++ b/src/app/components/TWAP/TWAPOrders.tsx @@ -1,7 +1,6 @@ import { Orders } from '@orbs-network/twap-ui-spiritswap'; import useWallets from 'app/hooks/useWallets'; import { useTokens } from 'app/hooks/useTokens'; -import { getProvider } from 'app/connectors/EthersConnector/login'; import { LimitOrderContainer } from 'app/pages/Swap/components/LimitOrders/styles'; import { getTokenImageUrl } from '../ImageLogo'; @@ -14,7 +13,7 @@ function TWAPOrders({ showChart }: { showChart: boolean }) { window.ethereum} getTokenImageUrl={getTokenImageUrl} /> diff --git a/src/app/components/TWAP/TWAPPanel.tsx b/src/app/components/TWAP/TWAPPanel.tsx index 5019662e..2a87943b 100644 --- a/src/app/components/TWAP/TWAPPanel.tsx +++ b/src/app/components/TWAP/TWAPPanel.tsx @@ -1,5 +1,4 @@ import { ModalToken } from 'app/components/ModalToken'; -import { getProvider } from 'app/connectors/EthersConnector/login'; import { useTokens } from 'app/hooks/useTokens'; import useWallets from 'app/hooks/useWallets'; import { TWAP } from '@orbs-network/twap-ui-spiritswap'; @@ -29,7 +28,7 @@ function TWAPPanel({ gasPrice, panelProps }: TWAPPanelProps) { TokenSelectModal={ModalToken} dappTokens={tokens} account={account} - getProvider={getProvider} + getProvider={() => window.ethereum} getTokenImageUrl={getTokenImageUrl} onSrcTokenSelected={(token: Token) => handleChangeToken(token, () => {}, 0) From 974bd9370ee8329066ad020bee2d3b3b3112b08a Mon Sep 17 00:00:00 2001 From: Nicolas carballo Date: Thu, 6 Jul 2023 12:58:54 -0300 Subject: [PATCH 14/14] updating emotion react --- package.json | 3 +- .../RangeSelector/RangeSelector.tsx | 5 - src/app/index.tsx | 6 +- src/workers/dataWorker.ts | 15 +- src/workers/userDataWorker.ts | 16 +- yarn.lock | 180 +++++++++++------- 6 files changed, 132 insertions(+), 93 deletions(-) diff --git a/package.json b/package.json index d441355e..4a04798c 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "@chakra-ui/toast": "2.1.0", "@clover-network/clover-connector": "^1.0.0", "@datastructures-js/priority-queue": "6.1.1", - "@emotion/styled": "^11", + "@emotion/react": "11.11.1", + "@emotion/styled": "11.11.0", "@gelatonetwork/limit-orders-lib": "4.3.0-alpha.6", "@jcoreio/async-throttle": "^1.4.3", "@lifi/sdk": "1.1.3", diff --git a/src/app/components/RangeSelector/RangeSelector.tsx b/src/app/components/RangeSelector/RangeSelector.tsx index df04aeff..1a6d0c1e 100644 --- a/src/app/components/RangeSelector/RangeSelector.tsx +++ b/src/app/components/RangeSelector/RangeSelector.tsx @@ -1,10 +1,7 @@ import { Bound } from 'store/v3/mint/actions'; - import { RangeSelectorPart } from '../RangeSelectorPart'; - import type { Props } from './RangeSelector.d'; import { useMemo } from 'react'; -import { useTranslation } from 'react-i18next'; import { Grid, GridItem, Skeleton } from '@chakra-ui/react'; import { Heading } from '../Typography'; import { StyledCurrentPrice, StyledCurrentPriceWrapper } from './styled'; @@ -26,8 +23,6 @@ export default function RangeSelector({ isAfterPrice, mintInfo, }: Props) { - const { t } = useTranslation(); - const tokenA = (currencyA ?? undefined)?.wrapped; const tokenB = (currencyB ?? undefined)?.wrapped; diff --git a/src/app/index.tsx b/src/app/index.tsx index 8b141c64..ca55b73d 100644 --- a/src/app/index.tsx +++ b/src/app/index.tsx @@ -42,10 +42,8 @@ export function App() { - <> - - - + + ); diff --git a/src/workers/dataWorker.ts b/src/workers/dataWorker.ts index cc1b47c5..09d2623b 100644 --- a/src/workers/dataWorker.ts +++ b/src/workers/dataWorker.ts @@ -64,12 +64,17 @@ onmessage = ({ data: { type, isLoggedIn, network = CHAIN_ID } }) => { break; case 'getBoostedGauges': if (isLoggedIn) break; - saturateGauges(gaugesPromise, BASE_TOKEN_ADDRESS).then(data => { - self.postMessage({ - type: 'setSaturatedGauges', - payload: data, + saturateGauges(gaugesPromise, BASE_TOKEN_ADDRESS) + .then(data => { + self.postMessage({ + type: 'setSaturatedGauges', + payload: data, + }); + }) + .catch(err => { + console.error(err); }); - }); + break; } diff --git a/src/workers/userDataWorker.ts b/src/workers/userDataWorker.ts index da40b747..2a6f40c4 100644 --- a/src/workers/userDataWorker.ts +++ b/src/workers/userDataWorker.ts @@ -173,13 +173,17 @@ const updatePortfolioData = async (userWalletAddress, provider) => { }; const inSpiritData = async () => { - saturateGauges(gaugesPromise, userWalletAddress).then(data => { - self.postMessage({ - type: 'setSaturatedGauges', - payload: data, - userWalletAddress, + saturateGauges(gaugesPromise, userWalletAddress) + .then(data => { + self.postMessage({ + type: 'setSaturatedGauges', + payload: data, + userWalletAddress, + }); + }) + .catch(e => { + console.log('Error saturating gauges', e); }); - }); const [inspiritUserStatistics, boostedFarmVotes] = await Promise.all([ getUserInspiritBalances(userWalletAddress), diff --git a/yarn.lock b/yarn.lock index 33af9d7d..b25b83a0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -808,7 +808,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-jsx@^7.12.13", "@babel/plugin-syntax-jsx@^7.17.12", "@babel/plugin-syntax-jsx@^7.18.6", "@babel/plugin-syntax-jsx@^7.2.0": +"@babel/plugin-syntax-jsx@^7.17.12", "@babel/plugin-syntax-jsx@^7.18.6", "@babel/plugin-syntax-jsx@^7.2.0": version "7.18.6" resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz" integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== @@ -1519,7 +1519,7 @@ core-js-pure "^3.20.2" regenerator-runtime "^0.13.4" -"@babel/runtime@7.18.6", "@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.14.5", "@babel/runtime@^7.14.6", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": +"@babel/runtime@7.18.6", "@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.5", "@babel/runtime@^7.14.6", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.3", "@babel/runtime@^7.3.1", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": version "7.18.6" resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.6.tgz" integrity sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ== @@ -3104,23 +3104,22 @@ source-map "^0.5.7" stylis "4.1.3" -"@emotion/babel-plugin@^11.7.1": - version "11.9.2" - resolved "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.9.2.tgz" - integrity sha512-Pr/7HGH6H6yKgnVFNEj2MVlreu3ADqftqjqwUvDy/OJzKFgxKeTQ+eeUf20FOTuHVkDON2iNa25rAXVYtWJCjw== +"@emotion/babel-plugin@^11.11.0": + version "11.11.0" + resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz#c2d872b6a7767a9d176d007f5b31f7d504bb5d6c" + integrity sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ== dependencies: - "@babel/helper-module-imports" "^7.12.13" - "@babel/plugin-syntax-jsx" "^7.12.13" - "@babel/runtime" "^7.13.10" - "@emotion/hash" "^0.8.0" - "@emotion/memoize" "^0.7.5" - "@emotion/serialize" "^1.0.2" - babel-plugin-macros "^2.6.1" + "@babel/helper-module-imports" "^7.16.7" + "@babel/runtime" "^7.18.3" + "@emotion/hash" "^0.9.1" + "@emotion/memoize" "^0.8.1" + "@emotion/serialize" "^1.1.2" + babel-plugin-macros "^3.1.0" convert-source-map "^1.5.0" escape-string-regexp "^4.0.0" find-root "^1.1.0" source-map "^0.5.7" - stylis "4.0.13" + stylis "4.2.0" "@emotion/cache@^11.10.5": version "11.10.5" @@ -3133,16 +3132,27 @@ "@emotion/weak-memoize" "^0.3.0" stylis "4.1.3" -"@emotion/hash@^0.8.0": - version "0.8.0" - resolved "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz" - integrity sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow== +"@emotion/cache@^11.11.0": + version "11.11.0" + resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.11.0.tgz#809b33ee6b1cb1a625fef7a45bc568ccd9b8f3ff" + integrity sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ== + dependencies: + "@emotion/memoize" "^0.8.1" + "@emotion/sheet" "^1.2.2" + "@emotion/utils" "^1.2.1" + "@emotion/weak-memoize" "^0.3.1" + stylis "4.2.0" "@emotion/hash@^0.9.0": version "0.9.0" resolved "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.0.tgz" integrity sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ== +"@emotion/hash@^0.9.1": + version "0.9.1" + resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.9.1.tgz#4ffb0055f7ef676ebc3a5a91fb621393294e2f43" + integrity sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ== + "@emotion/is-prop-valid@^0.8.2", "@emotion/is-prop-valid@^0.8.8": version "0.8.8" resolved "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz" @@ -3150,13 +3160,6 @@ dependencies: "@emotion/memoize" "0.7.4" -"@emotion/is-prop-valid@^1.1.3": - version "1.1.3" - resolved "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.1.3.tgz" - integrity sha512-RFg04p6C+1uO19uG8N+vqanzKqiM9eeV1LDOG3bmkYmuOj7NbKNlFC/4EZq5gnwAIlcC/jOT24f8Td0iax2SXA== - dependencies: - "@emotion/memoize" "^0.7.4" - "@emotion/is-prop-valid@^1.2.0": version "1.2.0" resolved "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.0.tgz" @@ -3164,21 +3167,42 @@ dependencies: "@emotion/memoize" "^0.8.0" +"@emotion/is-prop-valid@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@emotion/is-prop-valid/-/is-prop-valid-1.2.1.tgz#23116cf1ed18bfeac910ec6436561ecb1a3885cc" + integrity sha512-61Mf7Ufx4aDxx1xlDeOm8aFFigGHE4z+0sKCa+IHCeZKiyP9RLD0Mmx7m8b9/Cf37f7NAvQOOJAbQQGVr5uERw== + dependencies: + "@emotion/memoize" "^0.8.1" + "@emotion/memoize@0.7.4": version "0.7.4" resolved "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz" integrity sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw== -"@emotion/memoize@^0.7.4", "@emotion/memoize@^0.7.5": - version "0.7.5" - resolved "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.5.tgz" - integrity sha512-igX9a37DR2ZPGYtV6suZ6whr8pTFtyHL3K/oLUotxpSVO2ASaprmAe2Dkq7tBo7CRY7MMDrAa9nuQP9/YG8FxQ== - "@emotion/memoize@^0.8.0": version "0.8.0" resolved "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.0.tgz" integrity sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA== +"@emotion/memoize@^0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.8.1.tgz#c1ddb040429c6d21d38cc945fe75c818cfb68e17" + integrity sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA== + +"@emotion/react@11.11.1": + version "11.11.1" + resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.11.1.tgz#b2c36afac95b184f73b08da8c214fdf861fa4157" + integrity sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA== + dependencies: + "@babel/runtime" "^7.18.3" + "@emotion/babel-plugin" "^11.11.0" + "@emotion/cache" "^11.11.0" + "@emotion/serialize" "^1.1.2" + "@emotion/use-insertion-effect-with-fallbacks" "^1.0.1" + "@emotion/utils" "^1.2.1" + "@emotion/weak-memoize" "^0.3.1" + hoist-non-react-statics "^3.3.1" + "@emotion/react@11.x": version "11.10.5" resolved "https://registry.npmjs.org/@emotion/react/-/react-11.10.5.tgz" @@ -3193,17 +3217,6 @@ "@emotion/weak-memoize" "^0.3.0" hoist-non-react-statics "^3.3.1" -"@emotion/serialize@^1.0.2", "@emotion/serialize@^1.0.4": - version "1.0.4" - resolved "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.0.4.tgz" - integrity sha512-1JHamSpH8PIfFwAMryO2bNka+y8+KA5yga5Ocf2d7ZEiJjb7xlLW7aknBGZqJLajuLOvJ+72vN+IBSwPlXD1Pg== - dependencies: - "@emotion/hash" "^0.8.0" - "@emotion/memoize" "^0.7.4" - "@emotion/unitless" "^0.7.5" - "@emotion/utils" "^1.0.0" - csstype "^3.0.2" - "@emotion/serialize@^1.1.1": version "1.1.1" resolved "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.1.tgz" @@ -3215,11 +3228,39 @@ "@emotion/utils" "^1.2.0" csstype "^3.0.2" +"@emotion/serialize@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-1.1.2.tgz#017a6e4c9b8a803bd576ff3d52a0ea6fa5a62b51" + integrity sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA== + dependencies: + "@emotion/hash" "^0.9.1" + "@emotion/memoize" "^0.8.1" + "@emotion/unitless" "^0.8.1" + "@emotion/utils" "^1.2.1" + csstype "^3.0.2" + "@emotion/sheet@^1.2.1": version "1.2.1" resolved "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.1.tgz" integrity sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA== +"@emotion/sheet@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.2.2.tgz#d58e788ee27267a14342303e1abb3d508b6d0fec" + integrity sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA== + +"@emotion/styled@11.11.0": + version "11.11.0" + resolved "https://registry.yarnpkg.com/@emotion/styled/-/styled-11.11.0.tgz#26b75e1b5a1b7a629d7c0a8b708fbf5a9cdce346" + integrity sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng== + dependencies: + "@babel/runtime" "^7.18.3" + "@emotion/babel-plugin" "^11.11.0" + "@emotion/is-prop-valid" "^1.2.1" + "@emotion/serialize" "^1.1.2" + "@emotion/use-insertion-effect-with-fallbacks" "^1.0.1" + "@emotion/utils" "^1.2.1" + "@emotion/styled@11.x": version "11.10.5" resolved "https://registry.npmjs.org/@emotion/styled/-/styled-11.10.5.tgz" @@ -3232,23 +3273,12 @@ "@emotion/use-insertion-effect-with-fallbacks" "^1.0.0" "@emotion/utils" "^1.2.0" -"@emotion/styled@^11": - version "11.9.3" - resolved "https://registry.npmjs.org/@emotion/styled/-/styled-11.9.3.tgz" - integrity sha512-o3sBNwbtoVz9v7WB1/Y/AmXl69YHmei2mrVnK7JgyBJ//Rst5yqPZCecEJlMlJrFeWHp+ki/54uN265V2pEcXA== - dependencies: - "@babel/runtime" "^7.13.10" - "@emotion/babel-plugin" "^11.7.1" - "@emotion/is-prop-valid" "^1.1.3" - "@emotion/serialize" "^1.0.4" - "@emotion/utils" "^1.1.0" - "@emotion/stylis@^0.8.4": version "0.8.5" resolved "https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz" integrity sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ== -"@emotion/unitless@^0.7.4", "@emotion/unitless@^0.7.5": +"@emotion/unitless@^0.7.4": version "0.7.5" resolved "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz" integrity sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg== @@ -3258,26 +3288,41 @@ resolved "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.0.tgz" integrity sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw== +"@emotion/unitless@^0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.8.1.tgz#182b5a4704ef8ad91bde93f7a860a88fd92c79a3" + integrity sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ== + "@emotion/use-insertion-effect-with-fallbacks@^1.0.0": version "1.0.0" resolved "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.0.tgz" integrity sha512-1eEgUGmkaljiBnRMTdksDV1W4kUnmwgp7X9G8B++9GYwl1lUdqSndSriIrTJ0N7LQaoauY9JJ2yhiOYK5+NI4A== -"@emotion/utils@^1.0.0", "@emotion/utils@^1.1.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@emotion/utils/-/utils-1.1.0.tgz" - integrity sha512-iRLa/Y4Rs5H/f2nimczYmS5kFJEbpiVvgN3XVfZ022IYhuNA1IRSHEizcof88LtCTXtl9S2Cxt32KgaXEu72JQ== +"@emotion/use-insertion-effect-with-fallbacks@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.1.tgz#08de79f54eb3406f9daaf77c76e35313da963963" + integrity sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw== "@emotion/utils@^1.2.0": version "1.2.0" resolved "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.0.tgz" integrity sha512-sn3WH53Kzpw8oQ5mgMmIzzyAaH2ZqFEbozVVBSYp538E06OSE6ytOp7pRAjNQR+Q/orwqdQYJSe2m3hCOeznkw== +"@emotion/utils@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.2.1.tgz#bbab58465738d31ae4cb3dbb6fc00a5991f755e4" + integrity sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg== + "@emotion/weak-memoize@^0.3.0": version "0.3.0" resolved "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz" integrity sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg== +"@emotion/weak-memoize@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz#d0fce5d07b0620caa282b5131c297bb60f9d87e6" + integrity sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww== + "@eslint/eslintrc@^1.3.0": version "1.3.0" resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz" @@ -9783,15 +9828,6 @@ babel-plugin-jest-hoist@^28.1.3: "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" -babel-plugin-macros@^2.6.1: - version "2.8.0" - resolved "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz" - integrity sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg== - dependencies: - "@babel/runtime" "^7.7.2" - cosmiconfig "^6.0.0" - resolve "^1.12.0" - babel-plugin-macros@^3.0.1, babel-plugin-macros@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz" @@ -22740,7 +22776,7 @@ resolve@1.17.0: dependencies: path-parse "^1.0.6" -resolve@^1.1.7, resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.22.1, resolve@^1.3.2, resolve@^1.8.1, resolve@^1.9.0: +resolve@^1.1.7, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.22.1, resolve@^1.3.2, resolve@^1.8.1, resolve@^1.9.0: version "1.22.1" resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -24258,16 +24294,16 @@ stylelint@13.13.1: v8-compile-cache "^2.3.0" write-file-atomic "^3.0.3" -stylis@4.0.13: - version "4.0.13" - resolved "https://registry.npmjs.org/stylis/-/stylis-4.0.13.tgz" - integrity sha512-xGPXiFVl4YED9Jh7Euv2V220mriG9u4B2TA6Ybjc1catrstKD2PpIdU3U0RKpkVBC2EhmL/F0sPCr9vrFTNRag== - stylis@4.1.3: version "4.1.3" resolved "https://registry.npmjs.org/stylis/-/stylis-4.1.3.tgz" integrity sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA== +stylis@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.2.0.tgz#79daee0208964c8fe695a42fcffcac633a211a51" + integrity sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw== + sugarss@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/sugarss/-/sugarss-2.0.0.tgz"