From 8d959a35f609033c593b3c1e0129f2151cf411b1 Mon Sep 17 00:00:00 2001 From: sirpy Date: Mon, 26 Aug 2024 14:56:09 +0300 Subject: [PATCH 01/11] add: superfluid flow explorer link --- .../app/src/components/Header/ConnectedAccountDisplay.tsx | 4 ++-- .../TransactionList/SupportTransactionListItem.tsx | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/app/src/components/Header/ConnectedAccountDisplay.tsx b/packages/app/src/components/Header/ConnectedAccountDisplay.tsx index 22c49fd..314f2ea 100644 --- a/packages/app/src/components/Header/ConnectedAccountDisplay.tsx +++ b/packages/app/src/components/Header/ConnectedAccountDisplay.tsx @@ -7,7 +7,7 @@ import { Colors } from '../../utils/colors'; import { PlaceholderAvatar } from '../../assets'; import { useGetTokenBalance } from '../../hooks/useGetTokenBalance'; import { formatNumberWithCommas } from '../../lib/formatFiatCurrency'; -import { SupportedNetwork } from '../../models/constants'; +import { GDToken, SupportedNetwork } from '../../models/constants'; interface ConnectedAccountDisplayProps { isDesktopResolution: boolean; @@ -24,7 +24,7 @@ export const ConnectedAccountDisplay = (props: ConnectedAccountDisplayProps) => chainName = 'Unsupported Network'; } - const tokenBalance = useGetTokenBalance('G$', address, chain?.id, true); + const tokenBalance = useGetTokenBalance(GDToken.address, address, chain?.id, true); const formattedTokenBalance = formatNumberWithCommas(tokenBalance); const { data: ensName } = useEnsName({ address, chainId: 1 }); diff --git a/packages/app/src/components/TransactionList/SupportTransactionListItem.tsx b/packages/app/src/components/TransactionList/SupportTransactionListItem.tsx index 281bfc6..909b78b 100644 --- a/packages/app/src/components/TransactionList/SupportTransactionListItem.tsx +++ b/packages/app/src/components/TransactionList/SupportTransactionListItem.tsx @@ -1,6 +1,6 @@ import { SupportTx } from '../../models/models'; import { formatAddress } from '../../lib/formatAddress'; -import { useEnsName } from 'wagmi'; +import { useEnsName, useWaitForTransaction } from 'wagmi'; import Decimal from 'decimal.js'; import TransactionListItem from './TransactionListItem'; import { useFetchFullName } from '../../hooks/useFetchFullName'; @@ -31,6 +31,10 @@ export function SupportTransactionListItem({ transaction }: SupportTransactionLi const { data: ensName } = useEnsName({ address: userAddress, chainId: 1 }); const userFullName = useFetchFullName(userAddress); const userIdentifier = userFullName ?? ensName ?? formatAddress(userAddress); + const flowUpdateLog = useWaitForTransaction({ hash: hash as `0x${string}`, chainId: 42220 }); + const flowLogIndex = flowUpdateLog.data?.logs.find( + (_) => _.topics[0] === '0x57269d2ebcccecdcc0d9d2c0a0b80ead95f344e28ec20f50f709811f209d4e0e' + )?.logIndex; const flowingAmount = useMemo(() => { return transaction.isFlowUpdate ? ( @@ -66,7 +70,7 @@ export function SupportTransactionListItem({ transaction }: SupportTransactionLi isStream={transaction.isFlowUpdate} explorerLink={ // ? `${env.REACT_APP_SUPERFLUID_EXPLORER}/streams/${donor}-${transaction.collective}-${transaction.rewardToken}-0.0` - transaction.isFlowUpdate ? `${env.REACT_APP_SUPERFLUID_EXPLORER}/accounts/${donor}?tab=streams` : undefined + transaction.isFlowUpdate ? `${env.REACT_APP_SUPERFLUID_EXPLORER}/${hash}-${flowLogIndex}` : undefined } icon={getTxIcon(transaction)} userIdentifier={userIdentifier} From e01e12a0a5c83c43d45489ce56ddf3dac4b4603e Mon Sep 17 00:00:00 2001 From: sirpy Date: Mon, 26 Aug 2024 14:56:54 +0300 Subject: [PATCH 02/11] fix: double profile details --- .../src/components/WalletDetails/WalletDetails.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/app/src/components/WalletDetails/WalletDetails.tsx b/packages/app/src/components/WalletDetails/WalletDetails.tsx index d9df9e3..9805157 100644 --- a/packages/app/src/components/WalletDetails/WalletDetails.tsx +++ b/packages/app/src/components/WalletDetails/WalletDetails.tsx @@ -12,14 +12,10 @@ interface WalletDetailsProps { } function WalletDetails({ firstName, donor, steward, tokenPrice }: WalletDetailsProps) { - return ( - <> - {donor === undefined && steward === undefined && } - {!!donor && !!steward && } - {!!donor && } - {!!steward && } - - ); + if (!!donor && !!steward) return ; + else if (donor) return ; + else if (steward) return ; + return ; } export default WalletDetails; From f0bd1383ccb582badc990e9bf8eea5b9bd73e332 Mon Sep 17 00:00:00 2001 From: sirpy Date: Mon, 26 Aug 2024 15:02:29 +0300 Subject: [PATCH 03/11] add: dev/qa tokens support --- packages/app/package.json | 1 + packages/app/src/App.tsx | 27 +++++---- .../app/src/components/DonateComponent.tsx | 57 ++++++++++++------- ...em.tsx => FlowingDonationsRowItem.old.tsx} | 25 +++----- .../components/FlowingDonationsRowItem.tsx | 29 +++++++--- packages/app/src/components/RoundedButton.tsx | 6 +- .../app/src/components/ViewCollective.tsx | 18 +++--- packages/app/src/components/WalletProfile.tsx | 2 +- packages/app/src/hooks/useGetTokenBalance.ts | 10 ++-- packages/app/src/hooks/useSwapRoute.tsx | 15 ++--- packages/app/src/hooks/useTokenList.ts | 11 +++- packages/app/src/lib/defaults.ts | 4 +- packages/app/src/models/constants.ts | 14 ++++- packages/app/src/models/models.ts | 1 + packages/app/src/models/transforms.ts | 1 + packages/app/src/pages/DonatePage.tsx | 9 ++- .../app/src/subgraph/useSubgraphCollective.ts | 3 + packages/contracts/package.json | 1 + yarn.lock | 8 +++ 19 files changed, 150 insertions(+), 92 deletions(-) rename packages/app/src/components/{FlowingCurrentPoolRowItem.tsx => FlowingDonationsRowItem.old.tsx} (69%) diff --git a/packages/app/package.json b/packages/app/package.json index f6d90d8..e7f8fca 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -82,6 +82,7 @@ "@tsconfig/react-native": "^2.0.2", "@types/fast-text-encoding": "^1", "@types/jest": "^29.2.1", + "@types/lodash": "^4.17.7", "@types/moment-duration-format": "^2", "@types/qs": "^6", "@types/react": "^18.2.12", diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsx index 3f1e4b0..f7379b6 100644 --- a/packages/app/src/App.tsx +++ b/packages/app/src/App.tsx @@ -25,18 +25,23 @@ import { Colors } from './utils/colors'; import { useCreateSubgraphApolloClient, useCreateMongoDbApolloClient } from './hooks/apollo'; import { MongoDbApolloProvider } from './components/providers/MongoDbApolloProvider'; -const celoProvider = jsonRpcProvider({ - rpc: (chain) => { - if (chain.id === 42220) { - return { - http: 'https://rpc.ankr.com/celo', - }; - } - return null; - }, -}); function App(): JSX.Element { - const { publicClient, webSocketPublicClient } = configureChains([celo, mainnet], [publicProvider(), celoProvider]); + const { publicClient, webSocketPublicClient } = configureChains( + [celo, mainnet], + [ + publicProvider(), + jsonRpcProvider({ + rpc: (chain) => { + if (chain.id === 42220) { + return { + http: 'https://rpc.ankr.com/celo', + }; + } + return null; + }, + }), + ] + ); const connectors = [ new MetaMaskConnector({ diff --git a/packages/app/src/components/DonateComponent.tsx b/packages/app/src/components/DonateComponent.tsx index 37fd048..a2367a4 100644 --- a/packages/app/src/components/DonateComponent.tsx +++ b/packages/app/src/components/DonateComponent.tsx @@ -9,9 +9,9 @@ import Dropdown from './Dropdown'; import { getDonateStyles, getFrequencyPlural } from '../utils'; import { useContractCalls, useGetTokenPrice } from '../hooks'; import { useAccount, useNetwork } from 'wagmi'; -import { IpfsCollective } from '../models/models'; +import { Collective } from '../models/models'; import { useGetTokenBalance } from '../hooks/useGetTokenBalance'; -import { acceptablePriceImpact, Frequency, frequencyOptions, SupportedNetwork } from '../models/constants'; +import { acceptablePriceImpact, Frequency, frequencyOptions, GDEnvTokens, SupportedNetwork } from '../models/constants'; import { InfoIconOrange } from '../assets'; import { useParams } from 'react-router-native'; import Decimal from 'decimal.js'; @@ -28,7 +28,7 @@ import ThankYouModal from './modals/ThankYouModal'; import useCrossNavigate from '../routes/useCrossNavigate'; interface DonateComponentProps { - collective: IpfsCollective; + collective: Collective; } function DonateComponent({ collective }: DonateComponentProps) { @@ -51,26 +51,39 @@ function DonateComponent({ collective }: DonateComponentProps) { navigate(`/profile/${address}`); } - const [currency, setCurrency] = useState('G$'); const [frequency, setFrequency] = useState(Frequency.Monthly); const [duration, setDuration] = useState(12); const [decimalDonationAmount, setDecimalDonationAmount] = useState(0); const tokenList = useTokenList(); + const gdEnvSymbol = + Object.keys(tokenList).find((key) => { + if (key.startsWith('G$')) { + return tokenList[key].address.toLowerCase() === collective.rewardToken.toLowerCase(); + } else return false; + }) || 'G$'; + + const GDToken = GDEnvTokens[gdEnvSymbol]; + const currencyOptions: { value: string; label: string }[] = useMemo(() => { - let options = Object.keys(tokenList).map((key) => ({ - value: key, - label: key, - })); + let options = Object.keys(tokenList) + .filter((key) => key.startsWith('G$') === false || key === gdEnvSymbol) + .map((key) => ({ + value: key, + label: key, + })); + return options; - }, [tokenList]); + }, [tokenList, gdEnvSymbol]); + + const [currency, setCurrency] = useState(gdEnvSymbol || 'G$'); const { path: swapPath, rawMinimumAmountOut, priceImpact, status: swapRouteStatus, - } = useSwapRoute(currency, decimalDonationAmount, duration); + } = useSwapRoute(currency, GDToken, decimalDonationAmount, duration); const { handleApproveToken, isRequireApprove } = useApproveSwapTokenCallback( currency, @@ -79,7 +92,7 @@ function DonateComponent({ collective }: DonateComponentProps) { (value: boolean) => setApproveSwapModalVisible(value), collectiveId as `0x${string}` ); - const approvalNotReady = handleApproveToken === undefined && currency !== 'G$'; + const approvalNotReady = handleApproveToken === undefined && currency.startsWith('G$') === false; const { supportFlowWithSwap, supportFlow, supportSingleTransferAndCall, supportSingleWithSwap } = useContractCalls( collectiveId, @@ -97,12 +110,12 @@ function DonateComponent({ collective }: DonateComponentProps) { const handleDonate = useCallback(async () => { if (frequency === Frequency.OneTime) { - if (currency === 'G$') { + if (currency.startsWith('G$')) { return await supportSingleTransferAndCall(); } else { return await supportSingleWithSwap(); } - } else if (currency === 'G$') { + } else if (currency.startsWith('G$')) { return await supportFlow(); } @@ -143,8 +156,9 @@ function DonateComponent({ collective }: DonateComponentProps) { supportSingleWithSwap, ]); - const currencyDecimals = useToken(currency).decimals; - const donorCurrencyBalance = useGetTokenBalance(currency, address, chain?.id, true); + const token = useToken(currency); + const currencyDecimals = token.decimals; + const donorCurrencyBalance = useGetTokenBalance(token.address, address, chain?.id, true); const totalDecimalDonation = new Decimal(duration * decimalDonationAmount); const totalDonationFormatted = totalDecimalDonation.toDecimalPlaces(currencyDecimals, Decimal.ROUND_DOWN).toString(); @@ -152,9 +166,12 @@ function DonateComponent({ collective }: DonateComponentProps) { const isNonZeroDonation = totalDecimalDonation.gt(0); const isInsufficientBalance = isNonZeroDonation && (!donorCurrencyBalance || totalDecimalDonation.gt(donorCurrencyBalance)); - const isInsufficientLiquidity = isNonZeroDonation && currency !== 'G$' && swapRouteStatus === SwapRouteState.NO_ROUTE; + const isInsufficientLiquidity = + isNonZeroDonation && currency.startsWith('G$') === false && swapRouteStatus === SwapRouteState.NO_ROUTE; const isUnacceptablePriceImpact = - isNonZeroDonation && currency !== 'G$' && priceImpact ? priceImpact > acceptablePriceImpact : false; + isNonZeroDonation && currency.startsWith('G$') === false && priceImpact + ? priceImpact > acceptablePriceImpact + : false; const { price } = useGetTokenPrice(currency); const donationAmountUsdValue = price ? formatFiatCurrency(decimalDonationAmount * price) : undefined; @@ -199,7 +216,7 @@ function DonateComponent({ collective }: DonateComponentProps) { Donate - Support {collective.name}{' '} + Support {collective.ipfs.name}{' '} {isDesktopResolution && ( <>
@@ -487,7 +504,7 @@ function DonateComponent({ collective }: DonateComponentProps) { onPress={handleDonate} isLoading={swapRouteStatus === SwapRouteState.LOADING} disabled={ - (currency !== 'G$' && swapRouteStatus !== SwapRouteState.READY) || + (currency.startsWith('G$') === false && swapRouteStatus !== SwapRouteState.READY) || address === undefined || chain?.id === undefined || !(chain.id in SupportedNetwork) || @@ -502,7 +519,7 @@ function DonateComponent({ collective }: DonateComponentProps) {
diff --git a/packages/app/src/components/FlowingCurrentPoolRowItem.tsx b/packages/app/src/components/FlowingDonationsRowItem.old.tsx similarity index 69% rename from packages/app/src/components/FlowingCurrentPoolRowItem.tsx rename to packages/app/src/components/FlowingDonationsRowItem.old.tsx index 4468acb..9adf2f6 100644 --- a/packages/app/src/components/FlowingCurrentPoolRowItem.tsx +++ b/packages/app/src/components/FlowingDonationsRowItem.old.tsx @@ -2,41 +2,32 @@ import { Image, Text, View, StyleSheet } from 'react-native'; import { InterRegular, InterSemiBold } from '../utils/webFonts'; import { Colors } from '../utils/colors'; import { useMediaQuery } from 'native-base'; -import { useDonorCollectivesFlowingBalancesWithAltStaticBalance } from '../hooks/useFlowingBalance'; +import { useDonorCollectivesFlowingBalances } from '../hooks/useFlowingBalance'; import { DonorCollective } from '../models/models'; -import { useGetTokenBalance } from '../hooks/useGetTokenBalance'; -import { SupportedNetwork } from '../models/constants'; -import Decimal from 'decimal.js'; interface FlowingDonationsRowItemProps { rowInfo: string; - collective: `0x${string}`; donorCollectives: DonorCollective[]; tokenPrice: number | undefined; currency?: string; imageUrl: string; - additionalBalance?: string; } function FlowingDonationsRowItem({ rowInfo, - collective, donorCollectives, tokenPrice, currency, imageUrl, - additionalBalance, }: FlowingDonationsRowItemProps) { const [isDesktopResolution] = useMediaQuery({ minWidth: 920, }); - const currentBalance = useGetTokenBalance('G$', collective, SupportedNetwork.CELO); - const balanceUsed = additionalBalance - ? new Decimal(currentBalance).add(additionalBalance).toFixed(0, Decimal.ROUND_DOWN) - : currentBalance; - const { formatted: formattedCurrentPool, usdValue: usdValueCurrentPool } = - useDonorCollectivesFlowingBalancesWithAltStaticBalance(balanceUsed, donorCollectives, tokenPrice); + const { formatted: formattedDonations, usdValue: donationsUsdValue } = useDonorCollectivesFlowingBalances( + donorCollectives, + tokenPrice + ); return ( @@ -47,10 +38,10 @@ function FlowingDonationsRowItem({ - {currency} {formattedCurrentPool} - {isDesktopResolution && currency && = {usdValueCurrentPool} USD} + {currency} {formattedDonations} + {isDesktopResolution && currency && = {donationsUsdValue} USD} - {!isDesktopResolution && currency && = {usdValueCurrentPool} USD} + {!isDesktopResolution && currency && = {donationsUsdValue} USD} diff --git a/packages/app/src/components/FlowingDonationsRowItem.tsx b/packages/app/src/components/FlowingDonationsRowItem.tsx index 9adf2f6..25626ef 100644 --- a/packages/app/src/components/FlowingDonationsRowItem.tsx +++ b/packages/app/src/components/FlowingDonationsRowItem.tsx @@ -2,32 +2,43 @@ import { Image, Text, View, StyleSheet } from 'react-native'; import { InterRegular, InterSemiBold } from '../utils/webFonts'; import { Colors } from '../utils/colors'; import { useMediaQuery } from 'native-base'; -import { useDonorCollectivesFlowingBalances } from '../hooks/useFlowingBalance'; +import { useDonorCollectivesFlowingBalancesWithAltStaticBalance } from '../hooks/useFlowingBalance'; import { DonorCollective } from '../models/models'; +import { useGetTokenBalance } from '../hooks/useGetTokenBalance'; +import { SupportedNetwork } from '../models/constants'; +import Decimal from 'decimal.js'; +import { useTokenByAddress } from '../hooks/useTokenList'; interface FlowingDonationsRowItemProps { rowInfo: string; + collective: `0x${string}`; donorCollectives: DonorCollective[]; tokenPrice: number | undefined; - currency?: string; + currency: string; imageUrl: string; + additionalBalance?: string; } function FlowingDonationsRowItem({ rowInfo, + collective, donorCollectives, tokenPrice, currency, imageUrl, + additionalBalance, }: FlowingDonationsRowItemProps) { + const token = useTokenByAddress(currency); const [isDesktopResolution] = useMediaQuery({ minWidth: 920, }); - const { formatted: formattedDonations, usdValue: donationsUsdValue } = useDonorCollectivesFlowingBalances( - donorCollectives, - tokenPrice - ); + const currentBalance = useGetTokenBalance(currency, collective, SupportedNetwork.CELO); + const balanceUsed = additionalBalance + ? new Decimal(currentBalance).add(additionalBalance).toFixed(0, Decimal.ROUND_DOWN) + : currentBalance; + const { formatted: formattedCurrentPool, usdValue: usdValueCurrentPool } = + useDonorCollectivesFlowingBalancesWithAltStaticBalance(balanceUsed, donorCollectives, tokenPrice); return ( @@ -38,10 +49,10 @@ function FlowingDonationsRowItem({ - {currency} {formattedDonations} - {isDesktopResolution && currency && = {donationsUsdValue} USD} + {token.symbol} {formattedCurrentPool} + {isDesktopResolution && currency && = {usdValueCurrentPool} USD} - {!isDesktopResolution && currency && = {donationsUsdValue} USD} + {!isDesktopResolution && currency && = {usdValueCurrentPool} USD} diff --git a/packages/app/src/components/RoundedButton.tsx b/packages/app/src/components/RoundedButton.tsx index 1baa8f5..0124679 100644 --- a/packages/app/src/components/RoundedButton.tsx +++ b/packages/app/src/components/RoundedButton.tsx @@ -37,7 +37,11 @@ function RoundedButton({ disabled={disabled} style={[styles.button, { backgroundColor, maxWidth: maxWidth ?? 'auto' }]} onPress={onPress}> - {isLoading ? () : ({title})} + {isLoading ? ( + + ) : ( + {title} + )} ); } diff --git a/packages/app/src/components/ViewCollective.tsx b/packages/app/src/components/ViewCollective.tsx index 6fbf493..5fbb3ea 100644 --- a/packages/app/src/components/ViewCollective.tsx +++ b/packages/app/src/components/ViewCollective.tsx @@ -32,7 +32,7 @@ import { import { calculateGoodDollarAmounts } from '../lib/calculateGoodDollarAmounts'; import { useDeleteFlow } from '../hooks/useContractCalls/useDeleteFlow'; import ErrorModal from './modals/ErrorModal'; -import FlowingCurrentPoolRowItem from './FlowingCurrentPoolRowItem'; +import FlowingDonationsRowItem from './FlowingDonationsRowItem'; import { defaultInfoLabel, SUBGRAPH_POLL_INTERVAL } from '../models/constants'; import env from '../lib/env'; @@ -189,13 +189,13 @@ function ViewCollective({ collective }: ViewCollectiveProps) { - - @@ -284,13 +284,13 @@ function ViewCollective({ collective }: ViewCollectiveProps) { - - diff --git a/packages/app/src/components/WalletProfile.tsx b/packages/app/src/components/WalletProfile.tsx index 68e18f3..457b714 100644 --- a/packages/app/src/components/WalletProfile.tsx +++ b/packages/app/src/components/WalletProfile.tsx @@ -115,7 +115,7 @@ const styles = StyleSheet.create({ borderBottomEndRadius: 16, }, desktopContainer: { - maxHeight: 485, + maxHeight: 550, maxWidth: 420, borderRadius: 16, }, diff --git a/packages/app/src/hooks/useGetTokenBalance.ts b/packages/app/src/hooks/useGetTokenBalance.ts index 26a3fc7..73a408d 100644 --- a/packages/app/src/hooks/useGetTokenBalance.ts +++ b/packages/app/src/hooks/useGetTokenBalance.ts @@ -4,21 +4,19 @@ import { fetchBalance } from 'wagmi/actions'; import { useToken } from './useTokenList'; export const useGetTokenBalance = ( - currencySymbol: string, + currencyAddress: string, accountAddress: `0x${string}` | undefined, chainId: number = SupportedNetwork.CELO, formatted?: boolean ): string => { const [tokenBalance, setTokenBalance] = useState('0'); - const token = useToken(currencySymbol); - useEffect(() => { - if (!token || !accountAddress || chainId !== SupportedNetwork.CELO) return; + if (!currencyAddress || !accountAddress || chainId !== SupportedNetwork.CELO) return; fetchBalance({ address: accountAddress, chainId: chainId, - token: token.address as `0x${string}`, + token: currencyAddress as `0x${string}`, }) .then((res) => { const balance = formatted ? res.formatted : res.value.toString(); @@ -27,7 +25,7 @@ export const useGetTokenBalance = ( .catch((e) => { console.error(e); }); - }, [currencySymbol, token, accountAddress, chainId, formatted]); + }, [currencyAddress, accountAddress, chainId, formatted]); return tokenBalance; }; diff --git a/packages/app/src/hooks/useSwapRoute.tsx b/packages/app/src/hooks/useSwapRoute.tsx index 482c159..928539a 100644 --- a/packages/app/src/hooks/useSwapRoute.tsx +++ b/packages/app/src/hooks/useSwapRoute.tsx @@ -6,9 +6,9 @@ import { UniswapMulticallProvider, V3Route, } from '@uniswap/smart-order-router'; -import { CurrencyAmount, Percent, TradeType } from '@uniswap/sdk-core'; +import { CurrencyAmount, Percent, Token, TradeType } from '@uniswap/sdk-core'; import { useAccount, useNetwork } from 'wagmi'; -import { GDToken, SupportedNetwork } from '../models/constants'; +import { SupportedNetwork } from '../models/constants'; import { useEthersProvider } from './useEthers'; import { calculateRawTotalDonation } from '../lib/calculateRawTotalDonation'; import Decimal from 'decimal.js'; @@ -27,6 +27,7 @@ const DEFAULT_SLIPPAGE_TOLERANCE = new Percent(100, 10_000); export function useSwapRoute( currencyIn: string, + GDToken: Token, decimalAmountIn: number, duration: number, slippageTolerance: Percent = DEFAULT_SLIPPAGE_TOLERANCE @@ -51,7 +52,7 @@ export function useSwapRoute( !chain?.id || chain.id !== SupportedNetwork.CELO || !provider || - tokenIn.symbol === 'G$' + tokenIn.symbol?.startsWith('G$') ) { return; } @@ -69,12 +70,8 @@ export function useSwapRoute( minTimeout: 100, maxTimeout: 1000, }, + undefined, // this settings are required to solve multicall gas issue with forno - { - multicallChunk: 10, - gasLimitPerCall: 2_000_000, - quoteMinSuccessRate: 0.1, - }, { gasLimitOverride: 2_000_000, multicallChunk: 5, @@ -111,7 +108,7 @@ export function useSwapRoute( console.error('failed to get route:', e, { inputAmount, tokenIn, GDToken }); setRoute(undefined); }); - }, [address, chain?.id, provider, tokenIn, decimalAmountIn, duration, slippageTolerance]); + }, [address, chain?.id, provider, tokenIn, decimalAmountIn, duration, slippageTolerance, GDToken]); if (route === 'loading') { return { status: SwapRouteState.LOADING }; diff --git a/packages/app/src/hooks/useTokenList.ts b/packages/app/src/hooks/useTokenList.ts index 96c0d59..bf4a450 100644 --- a/packages/app/src/hooks/useTokenList.ts +++ b/packages/app/src/hooks/useTokenList.ts @@ -4,7 +4,10 @@ import { Token } from '@uniswap/sdk-core'; import CeloTokenList from '../models/CeloTokenList.json'; import { SupportedNetwork } from '../models/constants'; -const populatedTokenList: Record = {}; +const populatedTokenList: Record = { + 'G$-Dev': new Token(42220, '0xFa51eFDc0910CCdA91732e6806912Fa12e2FD475', 18, 'G$-Dev'), + 'G$-QA': new Token(42220, '0x61FA0fB802fd8345C06da558240E0651886fec69', 18, 'G$-QA'), +}; populateTokenList(); async function populateTokenList() { @@ -35,6 +38,12 @@ export function useToken(symbol: string): Token { return populatedTokenList[symbol] || {}; } +export function useTokenByAddress(address: string): Token { + return ( + Object.values(populatedTokenList).find((_) => _.address.toLowerCase() === address.toLowerCase()) || ({} as Token) + ); +} + export function useTokenList(): Record { return populatedTokenList; } diff --git a/packages/app/src/lib/defaults.ts b/packages/app/src/lib/defaults.ts index 1982cbc..c8b34b7 100644 --- a/packages/app/src/lib/defaults.ts +++ b/packages/app/src/lib/defaults.ts @@ -1,6 +1,6 @@ export const defaults = { REACT_APP_CELO_EXPLORER: 'https://celoscan.io', - REACT_APP_SUPERFLUID_EXPLORER: 'https://console.superfluid.finance/celo', + REACT_APP_SUPERFLUID_EXPLORER: 'https://app.superfluid.finance/stream/celo', REACT_APP_NETWORK: 'celo', - REACT_APP_SUBGRAPH: 'https://api.studio.thegraph.com/query/59211/goodcollective/dev-v1.0.4', + REACT_APP_SUBGRAPH: 'https://api.studio.thegraph.com/query/59211/goodcollective/version/latest', }; diff --git a/packages/app/src/models/constants.ts b/packages/app/src/models/constants.ts index 14312fa..ded429f 100644 --- a/packages/app/src/models/constants.ts +++ b/packages/app/src/models/constants.ts @@ -17,7 +17,19 @@ export const SupportedNetworkNames: Record = { export const UNISWAP_V3_ROUTER_ADDRESS = '0x5615CDAb10dc425a742d643d949a7F474C01abc4'; export const GDToken: Token = new Token(SupportedNetwork.CELO, GdContracts['production-celo'].GoodDollar, 18, 'G$'); - +export const GDDevToken: Token = new Token( + SupportedNetwork.CELO, + GdContracts['development-celo'].GoodDollar, + 18, + 'G$-Dev' +); +export const GDQAToken: Token = new Token(SupportedNetwork.CELO, GdContracts['staging-celo'].GoodDollar, 18, 'G$-QA'); + +export const GDEnvTokens: { [key: string]: Token } = { + 'G$-Dev': GDDevToken, + 'G$-QA': GDQAToken, + G$: GDToken, +}; // if a token is not in this list, the address from the Celo Token List is used export const coingeckoTokenMapping: Record = { WBTC: '0xD629eb00dEced2a080B7EC630eF6aC117e614f1b', diff --git a/packages/app/src/models/models.ts b/packages/app/src/models/models.ts index 6da8ab7..3fbda22 100644 --- a/packages/app/src/models/models.ts +++ b/packages/app/src/models/models.ts @@ -37,6 +37,7 @@ export interface Collective { paymentsMade: number; totalDonations: string; totalRewards: string; + rewardToken: string; } export interface IpfsCollective { diff --git a/packages/app/src/models/transforms.ts b/packages/app/src/models/transforms.ts index d51f013..dfb5a6b 100644 --- a/packages/app/src/models/transforms.ts +++ b/packages/app/src/models/transforms.ts @@ -71,6 +71,7 @@ export function subgraphCollectiveToModel(subgraphCollective: SubgraphCollective paymentsMade: subgraphCollective.paymentsMade, totalDonations: subgraphCollective.totalDonations, totalRewards: subgraphCollective.totalRewards, + rewardToken: subgraphCollective.settings?.rewardToken || '', }; } diff --git a/packages/app/src/pages/DonatePage.tsx b/packages/app/src/pages/DonatePage.tsx index a8eac45..2e9accc 100644 --- a/packages/app/src/pages/DonatePage.tsx +++ b/packages/app/src/pages/DonatePage.tsx @@ -1,22 +1,21 @@ import Layout from '../components/Layout/Layout'; import DonateComponent from '../components/DonateComponent'; import React from 'react'; -import { useCollectivesMetadataById } from '../hooks'; +import { useCollectiveById } from '../hooks'; import { useParams } from 'react-router-native'; import { Text } from 'react-native'; function DonatePage() { const { id: collectiveId = '' } = useParams(); - const ipfsCollectives = useCollectivesMetadataById([collectiveId]); - const ipfsCollective = ipfsCollectives.length > 0 ? ipfsCollectives[0] : undefined; + const collective = useCollectiveById(collectiveId); return ( - {!ipfsCollective ? Loading... : } + {!collective ? Loading... : } ); } diff --git a/packages/app/src/subgraph/useSubgraphCollective.ts b/packages/app/src/subgraph/useSubgraphCollective.ts index dbf75b2..4182a7d 100644 --- a/packages/app/src/subgraph/useSubgraphCollective.ts +++ b/packages/app/src/subgraph/useSubgraphCollective.ts @@ -45,6 +45,9 @@ export const collectivesById = gql` paymentsMade totalDonations totalRewards + settings { + rewardToken + } } } `; diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 288ba2e..487a816 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -6,6 +6,7 @@ "types": "./typechain-types/index.ts", "files": [ "contracts", + "artifacts/contracts", "typechain-types", "releases" ], diff --git a/yarn.lock b/yarn.lock index 0fb3a9c..3dec912 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4526,6 +4526,7 @@ __metadata: "@tsconfig/react-native": ^2.0.2 "@types/fast-text-encoding": ^1 "@types/jest": ^29.2.1 + "@types/lodash": ^4.17.7 "@types/moment-duration-format": ^2 "@types/qs": ^6 "@types/react": ^18.2.12 @@ -10836,6 +10837,13 @@ __metadata: languageName: node linkType: hard +"@types/lodash@npm:^4.17.7": + version: 4.17.7 + resolution: "@types/lodash@npm:4.17.7" + checksum: 09e58a119cd8a70acfb33f8623dc2fc54f74cdce3b3429b879fc2daac4807fe376190a04b9e024dd300f9a3ee1876d6623979cefe619f70654ca0fe0c47679a7 + languageName: node + linkType: hard + "@types/long@npm:^4.0.1": version: 4.0.2 resolution: "@types/long@npm:4.0.2" From 86bc49ecbd220e23e40c2f50caef3d4e744a14f1 Mon Sep 17 00:00:00 2001 From: sirpy Date: Mon, 26 Aug 2024 15:03:50 +0300 Subject: [PATCH 04/11] fix: ubi pool support --- .../src/goodcollective/goodcollective.ts | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/packages/sdk-js/src/goodcollective/goodcollective.ts b/packages/sdk-js/src/goodcollective/goodcollective.ts index 43c0701..cbb4ae2 100644 --- a/packages/sdk-js/src/goodcollective/goodcollective.ts +++ b/packages/sdk-js/src/goodcollective/goodcollective.ts @@ -7,6 +7,8 @@ import { UBIPool, UBIPoolFactory, } from '@gooddollar/goodcollective-contracts/typechain-types'; +import { abi as UBIPoolAbi } from '@gooddollar/goodcollective-contracts/artifacts/contracts/UBI/UBIPool.sol/UBIPool.json'; + import { Framework } from '@superfluid-finance/sdk-core'; import { HelperLibrary } from '@gooddollar/goodcollective-contracts/typechain-types/contracts/GoodCollective/GoodCollectiveSuperApp.ts'; // import * as W3Client from '@web3-storage/w3up-client'; @@ -59,6 +61,7 @@ export class GoodCollectiveSDK { ubifactory?: UBIPoolFactory; contracts: Contracts; pool: DirectPaymentsPool; + ubipool: UBIPool; superfluidSDK: Promise; chainId: Key; // w3Storage: Promise; @@ -86,6 +89,12 @@ export class GoodCollectiveSDK { (this.contracts.DirectPaymentsPool?.abi || []).concat(nftEvents as []), //add events of nft so they are parsable readProvider ) as DirectPaymentsPool; + this.ubipool = new ethers.Contract( + ethers.constants.AddressZero, + this.contracts.UBIPool?.abi || UBIPoolAbi || [], + readProvider + ) as UBIPool; + console.log('ubi abi:', this.contracts.UBIPool?.abi); // initialize framework const opts = { chainId: Number(chainId), @@ -120,8 +129,21 @@ export class GoodCollectiveSDK { async rewardToken(poolAddress: string) { // Get the superfluid sdk const sdk = await this.superfluidSDK; + + const callResult = await this.pool.provider.call({ + to: poolAddress, + data: this.pool.interface.encodeFunctionData('settings'), + }); + let token = ''; // Get the reward token from the pool - const token = (await this.pool.attach(poolAddress).settings()).rewardToken; + try { + const settings = this.pool.interface.decodeFunctionResult('settings', callResult); + token = settings.rewardToken; + } catch (e) { + const settings = this.ubipool.interface.decodeFunctionResult('settings', callResult); + token = settings.rewardToken; + } + // Return the supertoken return sdk.loadSuperToken(token); } @@ -365,9 +387,7 @@ export class GoodCollectiveSDK { */ async supportFlow(signer: ethers.Signer, poolAddress: string, flowRate: string) { // call the superfluid core-sdk to start a flow using createflow - const sdk = await this.superfluidSDK; - const token = (await this.pool.attach(poolAddress).settings()).rewardToken; - const st = await sdk.loadSuperToken(token); + const st = await this.rewardToken(poolAddress); const signerAddress = await signer.getAddress(); const flowAction = st.createFlow({ @@ -386,9 +406,7 @@ export class GoodCollectiveSDK { poolAddress: string, memberAddress: string ) { - const sdk = await this.superfluidSDK; - const token = (await this.pool.attach(poolAddress).settings()).rewardToken; - const st = await sdk.loadSuperToken(token); + const st = await this.rewardToken(poolAddress); const hasFlow = await st.getFlow({ receiver: poolAddress, sender: memberAddress, @@ -406,9 +424,7 @@ export class GoodCollectiveSDK { */ async updateFlow(signer: ethers.Signer, poolAddress: string, flowRate: string) { // call the superfluid core-sdk to start a flow using createflow - const sdk = await this.superfluidSDK; - const token = (await this.pool.attach(poolAddress).settings()).rewardToken; - const st = await sdk.loadSuperToken(token); + const st = await this.rewardToken(poolAddress); const signerAddress = await signer.getAddress(); const flowAction = st.updateFlow({ @@ -431,9 +447,7 @@ export class GoodCollectiveSDK { */ async deleteFlow(signer: ethers.Signer, poolAddress: string, flowRate: string) { // call the superfluid core-sdk to start a flow using createflow - const sdk = await this.superfluidSDK; - const token = (await this.pool.attach(poolAddress).settings()).rewardToken; - const st = await sdk.loadSuperToken(token); + const st = await this.rewardToken(poolAddress); const signerAddress = await signer.getAddress(); const flowAction = st.deleteFlow({ @@ -458,8 +472,7 @@ export class GoodCollectiveSDK { async supportFlowWithSwap(signer: ethers.Signer, poolAddress: string, flowRate: string, swap: SwapData) { // call the superfluid core-sdk to start a flow using createflow const sdk = await this.superfluidSDK; - const token = (await this.pool.attach(poolAddress).settings()).rewardToken; - const st = await sdk.loadSuperToken(token); + const st = await this.rewardToken(poolAddress); const signerAddress = await signer.getAddress(); const appAction = this.pool.interface.encodeFunctionData('handleSwap', [swap, signerAddress, '0x']); From 4ffbda8eb121d1765e310de1277018a63d554cd1 Mon Sep 17 00:00:00 2001 From: sirpy Date: Mon, 26 Aug 2024 15:11:55 +0300 Subject: [PATCH 05/11] refactor: remove console.log --- packages/app/src/hooks/useTokenList.ts | 1 - .../src/goodcollective/__tests__/goodcollective.test.ts | 6 +++--- packages/sdk-js/src/goodcollective/goodcollective.ts | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/app/src/hooks/useTokenList.ts b/packages/app/src/hooks/useTokenList.ts index bf4a450..7f28704 100644 --- a/packages/app/src/hooks/useTokenList.ts +++ b/packages/app/src/hooks/useTokenList.ts @@ -28,7 +28,6 @@ async function populateTokenList() { 'https://raw.githubusercontent.com/celo-org/celo-token-list/main/celo.tokenlist.json' ).then((_) => _.json()); if (isEqual(newList?.version, tokensJson?.version) === false) { - console.log({ a: JSON.stringify(newList), b: JSON.stringify(tokensJson) }); await AsyncStorage.setItem('celo.tokenlist.json', JSON.stringify(newList)); populateTokenList(); } diff --git a/packages/sdk-js/src/goodcollective/__tests__/goodcollective.test.ts b/packages/sdk-js/src/goodcollective/__tests__/goodcollective.test.ts index 58895b6..32aa3db 100644 --- a/packages/sdk-js/src/goodcollective/__tests__/goodcollective.test.ts +++ b/packages/sdk-js/src/goodcollective/__tests__/goodcollective.test.ts @@ -176,9 +176,9 @@ describe('GoodCollective SDK', () => { it('should support single with swap', async () => { const pool = await sdk.createPool(...testPoolSettings); - const balance = await gooddollar.balanceOf(wallet.address); - const routerBalance = await gooddollar.balanceOf(await pool.swapRouter()); - console.log({ balance, router: await pool.swapRouter(), routerBalance }); + // const balance = await gooddollar.balanceOf(wallet.address); + // const routerBalance = await gooddollar.balanceOf(await pool.swapRouter()); + // console.log({ balance, router: await pool.swapRouter(), routerBalance }); await (await gooddollar.connect(wallet).approve(pool.address, '1000')).wait(); const tx = await sdk.supportSingleWithSwap(wallet, pool.address, { amount: 1000, diff --git a/packages/sdk-js/src/goodcollective/goodcollective.ts b/packages/sdk-js/src/goodcollective/goodcollective.ts index cbb4ae2..c1510ca 100644 --- a/packages/sdk-js/src/goodcollective/goodcollective.ts +++ b/packages/sdk-js/src/goodcollective/goodcollective.ts @@ -94,7 +94,6 @@ export class GoodCollectiveSDK { this.contracts.UBIPool?.abi || UBIPoolAbi || [], readProvider ) as UBIPool; - console.log('ubi abi:', this.contracts.UBIPool?.abi); // initialize framework const opts = { chainId: Number(chainId), @@ -542,7 +541,6 @@ export class GoodCollectiveSDK { const token = new ethers.Contract(await swap.swapFrom, tcabi, signer); const signerAddress = await signer.getAddress(); const allowance = await token.allowance(signerAddress, poolAddress); - console.log({ allowance, amount: await swap.amount }); if (allowance.lt(ethers.BigNumber.from(swap.amount))) { throw new Error('Not enough allowance'); } From 0dbee45a951ed100852427665322e83d6eba549c Mon Sep 17 00:00:00 2001 From: sirpy Date: Mon, 26 Aug 2024 15:29:17 +0300 Subject: [PATCH 06/11] fix: vercel cli github actions --- packages/app/package.json | 2 +- yarn.lock | 305 +++++++++++++------------------------- 2 files changed, 105 insertions(+), 202 deletions(-) diff --git a/packages/app/package.json b/packages/app/package.json index e7f8fca..12d4a69 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -100,7 +100,7 @@ "react-test-renderer": "18.2.0", "typechain": "^8.1.1", "typescript": "^5.1.3", - "vercel": "latest", + "vercel": "^37.1.1", "vite": "^4.5.0", "vite-plugin-dynamic-import": "^1.5.0", "vite-plugin-node-polyfills": "^0.16.0", diff --git a/yarn.lock b/yarn.lock index 3dec912..4c59542 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2491,20 +2491,6 @@ __metadata: languageName: node linkType: hard -"@edge-runtime/cookies@npm:3.4.1": - version: 3.4.1 - resolution: "@edge-runtime/cookies@npm:3.4.1" - checksum: 606642b61f29559f9e26752a1503e3eb33e86c6ec042905f872ab31aca758872ccdef145b3c5597107732df0ee81935974bbcc21a614744a7b2808780316a910 - languageName: node - linkType: hard - -"@edge-runtime/format@npm:2.2.0": - version: 2.2.0 - resolution: "@edge-runtime/format@npm:2.2.0" - checksum: cfe6e009264b8676de4b1ec8f6ddc64efdea2f801a600af02ca487dc88cde35f4396d288a1bc5efc75a9ac1d6d5130b285c8ea80a13125d225daf2e803a68925 - languageName: node - linkType: hard - "@edge-runtime/format@npm:2.2.1": version: 2.2.1 resolution: "@edge-runtime/format@npm:2.2.1" @@ -2512,15 +2498,6 @@ __metadata: languageName: node linkType: hard -"@edge-runtime/node-utils@npm:2.2.1": - version: 2.2.1 - resolution: "@edge-runtime/node-utils@npm:2.2.1" - dependencies: - "@edge-runtime/cookies": 3.4.1 - checksum: 6c18350bf7a6e273c2725d62bf3ffb317ce19378fba8c3191803653b27d1550a0ade0372d58b11a967768b75372f5bebe1fb33f25f0e53c414d61bfdaa14a40a - languageName: node - linkType: hard - "@edge-runtime/node-utils@npm:2.3.0": version: 2.3.0 resolution: "@edge-runtime/node-utils@npm:2.3.0" @@ -2528,13 +2505,6 @@ __metadata: languageName: node linkType: hard -"@edge-runtime/ponyfill@npm:2.4.1": - version: 2.4.1 - resolution: "@edge-runtime/ponyfill@npm:2.4.1" - checksum: ef0363c7f3446ad6069df1fab4110352bd36265f0ddbc3cea9f9523918744f8d0aaaf0e3947aa9f56f78734a339714b89cec36195fe619e4dd64460a3ccbad66 - languageName: node - linkType: hard - "@edge-runtime/ponyfill@npm:2.4.2": version: 2.4.2 resolution: "@edge-runtime/ponyfill@npm:2.4.2" @@ -2542,13 +2512,6 @@ __metadata: languageName: node linkType: hard -"@edge-runtime/primitives@npm:4.0.5": - version: 4.0.5 - resolution: "@edge-runtime/primitives@npm:4.0.5" - checksum: c4b8f724526d4b3b3ddfccccbf725ca2163d4dfca311e7ea1d7e7b2d6a3cbb58b0bc4dcd69065ec8a1b13c5bb1cc2e28a3a5643185e036c4734a19d0ed7e96ae - languageName: node - linkType: hard - "@edge-runtime/primitives@npm:4.1.0": version: 4.1.0 resolution: "@edge-runtime/primitives@npm:4.1.0" @@ -2556,15 +2519,6 @@ __metadata: languageName: node linkType: hard -"@edge-runtime/vm@npm:3.1.7": - version: 3.1.7 - resolution: "@edge-runtime/vm@npm:3.1.7" - dependencies: - "@edge-runtime/primitives": 4.0.5 - checksum: e22e62cf40ce9367bce7300fa9f4e2f81a7049d2babba794281d84cd681741c7f5c6bc496e356b460d3fc4e9d28460006758979e3c5a05c9f2b2c4d4e40f2d75 - languageName: node - linkType: hard - "@edge-runtime/vm@npm:3.2.0": version: 3.2.0 resolution: "@edge-runtime/vm@npm:3.2.0" @@ -4584,7 +4538,7 @@ __metadata: realm-web: ^2.0.0 typechain: ^8.1.1 typescript: ^5.1.3 - vercel: latest + vercel: ^37.1.1 viem: ^1.10.8 vite: ^4.5.0 vite-plugin-dynamic-import: ^1.5.0 @@ -10923,13 +10877,6 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:14.18.33": - version: 14.18.33 - resolution: "@types/node@npm:14.18.33" - checksum: 4e23f95186d8ae1d38c999bc6b46fe94e790da88744b0a3bfeedcbd0d9ffe2cb0ff39e85f43014f6739e5270292c1a1f6f97a1fc606fd573a0c17fda9a1d42de - languageName: node - linkType: hard - "@types/node@npm:16.18.11": version: 16.18.11 resolution: "@types/node@npm:16.18.11" @@ -11641,13 +11588,6 @@ __metadata: languageName: node linkType: hard -"@vercel/build-utils@npm:7.2.3": - version: 7.2.3 - resolution: "@vercel/build-utils@npm:7.2.3" - checksum: e089a1f7474c780c3f9b196f600c141e5fc253c9c6f216b74969a3506121d3c9a6ba9f1bfc8088e20604f4ef49ba020dcd6d7a0b8881b77f7d6e8ae90f501d2a - languageName: node - linkType: hard - "@vercel/build-utils@npm:8.3.1": version: 8.3.1 resolution: "@vercel/build-utils@npm:8.3.1" @@ -11655,6 +11595,13 @@ __metadata: languageName: node linkType: hard +"@vercel/build-utils@npm:8.3.7": + version: 8.3.7 + resolution: "@vercel/build-utils@npm:8.3.7" + checksum: 22f7c085e9d6a14122b23bef5dff4b610cf9917b233bb4d84b531af918ed3b9536c82abcf1d3e4bf635cd6f8d9da7bc63e0ea48537a38bbdb784f14cf7d88593 + languageName: node + linkType: hard + "@vercel/error-utils@npm:2.0.2": version: 2.0.2 resolution: "@vercel/error-utils@npm:2.0.2" @@ -11713,24 +11660,17 @@ __metadata: languageName: node linkType: hard -"@vercel/gatsby-plugin-vercel-builder@npm:2.0.9": - version: 2.0.9 - resolution: "@vercel/gatsby-plugin-vercel-builder@npm:2.0.9" +"@vercel/gatsby-plugin-vercel-builder@npm:2.0.41": + version: 2.0.41 + resolution: "@vercel/gatsby-plugin-vercel-builder@npm:2.0.41" dependencies: "@sinclair/typebox": 0.25.24 - "@vercel/build-utils": 7.2.3 + "@vercel/build-utils": 8.3.7 "@vercel/routing-utils": 3.1.0 esbuild: 0.14.47 etag: 1.8.1 fs-extra: 11.1.0 - checksum: 2c00fd55374b35b3a9bcd63b091396122c1b0dfb1a9e0be8d534dfbec8c349fa93f24da924c936d4e47ad315e837927a7b5095898dbcd8712e2ba463ea5439ce - languageName: node - linkType: hard - -"@vercel/go@npm:3.0.3": - version: 3.0.3 - resolution: "@vercel/go@npm:3.0.3" - checksum: cf9fa10e00f8bba70c520c9371d4ba7e2d4e6e1970ae74c44b0db86f626c2a294eff7cc36e0f76112084a8bffc35569eca38abc8b3912b59e1081bcfdc2134a3 + checksum: c37c37e7381ca233d656d2bfbdae61fbabf22e94c92e75b93375262ff90baa9a0aca7015a8a24d99e63ce0f54184dc8ceb005eaea2ab0fea6813aafc559a1834 languageName: node linkType: hard @@ -11741,16 +11681,6 @@ __metadata: languageName: node linkType: hard -"@vercel/hydrogen@npm:1.0.1": - version: 1.0.1 - resolution: "@vercel/hydrogen@npm:1.0.1" - dependencies: - "@vercel/static-config": 3.0.0 - ts-morph: 12.0.0 - checksum: a13cdacfba84ff10ca2036815ea9d0e36fa5d8fe7e5af2083a8cf93a3b47d5e9c102be491d1882c08b555764804f4092cf10ba5e7d4b2495fb434bda1610f4de - languageName: node - linkType: hard - "@vercel/hydrogen@npm:1.0.2": version: 1.0.2 resolution: "@vercel/hydrogen@npm:1.0.2" @@ -11761,12 +11691,13 @@ __metadata: languageName: node linkType: hard -"@vercel/next@npm:4.0.13": - version: 4.0.13 - resolution: "@vercel/next@npm:4.0.13" +"@vercel/hydrogen@npm:1.0.4": + version: 1.0.4 + resolution: "@vercel/hydrogen@npm:1.0.4" dependencies: - "@vercel/nft": 0.24.2 - checksum: 9e845a2c97a0be2e61612eaea10b5594b6fb4e2cdec6555a7bb0b3c030c412dbd3e09274d74632521474c02d46e4e09443ba3f3555ca5cf8195418cd0940ae88 + "@vercel/static-config": 3.0.0 + ts-morph: 12.0.0 + checksum: 58a12e664d46ded40bba5984d29a5c47e7184d79b3177f6d2d37375e3c787ae141075bab40fb49ee76765c066f6f3a9ea803e70818d9dd2919d79e51cab7ec28 languageName: node linkType: hard @@ -11779,13 +11710,23 @@ __metadata: languageName: node linkType: hard -"@vercel/nft@npm:0.24.2": - version: 0.24.2 - resolution: "@vercel/nft@npm:0.24.2" +"@vercel/next@npm:4.3.7": + version: 4.3.7 + resolution: "@vercel/next@npm:4.3.7" + dependencies: + "@vercel/nft": 0.27.3 + checksum: 6e657c0c3bccf1f638da6ebbd4cc6ada7d39c8b9efe4721322b63785781ccbf8d06b39ddcc72e165966d10649eff0f1fc1f75efd0c3a21105e3fc5654726abc2 + languageName: node + linkType: hard + +"@vercel/nft@npm:0.27.2": + version: 0.27.2 + resolution: "@vercel/nft@npm:0.27.2" dependencies: "@mapbox/node-pre-gyp": ^1.0.5 "@rollup/pluginutils": ^4.0.0 acorn: ^8.6.0 + acorn-import-attributes: ^1.9.5 async-sema: ^3.1.1 bindings: ^1.4.0 estree-walker: 2.0.2 @@ -11796,13 +11737,13 @@ __metadata: resolve-from: ^5.0.0 bin: nft: out/cli.js - checksum: 1be8ed9860a5e091181aff8eb9031463c7b35b7712d06ab399d6d35b5356d9d309b8e9991ae365b677fa7ba9be63377b51d3fc14559c66ee39c4f879fcc216f8 + checksum: b8a9104f948816ba2bd2fb74a2d6cb4585d5550d8c91816569ac0aa7cc0ec62f04306418f8877908784c59897f6cd5b9623ba4cb7d6d2c75a8438c4f0ec13a74 languageName: node linkType: hard -"@vercel/nft@npm:0.27.2": - version: 0.27.2 - resolution: "@vercel/nft@npm:0.27.2" +"@vercel/nft@npm:0.27.3": + version: 0.27.3 + resolution: "@vercel/nft@npm:0.27.3" dependencies: "@mapbox/node-pre-gyp": ^1.0.5 "@rollup/pluginutils": ^4.0.0 @@ -11818,48 +11759,49 @@ __metadata: resolve-from: ^5.0.0 bin: nft: out/cli.js - checksum: b8a9104f948816ba2bd2fb74a2d6cb4585d5550d8c91816569ac0aa7cc0ec62f04306418f8877908784c59897f6cd5b9623ba4cb7d6d2c75a8438c4f0ec13a74 + checksum: ae6757a34c8c644456aadb6e3e1c697c0520fc3fc90e7e5a9a59cbf8b4805a7f6486b07b9776653a4be480f00058f22e36eb949d9102f9af2359cd9397d7156d languageName: node linkType: hard -"@vercel/node@npm:3.0.8": - version: 3.0.8 - resolution: "@vercel/node@npm:3.0.8" +"@vercel/node@npm:3.2.2": + version: 3.2.2 + resolution: "@vercel/node@npm:3.2.2" dependencies: - "@edge-runtime/node-utils": 2.2.1 - "@edge-runtime/primitives": 4.0.5 - "@edge-runtime/vm": 3.1.7 - "@types/node": 14.18.33 - "@vercel/build-utils": 7.2.3 + "@edge-runtime/node-utils": 2.3.0 + "@edge-runtime/primitives": 4.1.0 + "@edge-runtime/vm": 3.2.0 + "@types/node": 16.18.11 + "@vercel/build-utils": 8.3.1 "@vercel/error-utils": 2.0.2 - "@vercel/nft": 0.24.2 + "@vercel/nft": 0.27.2 "@vercel/static-config": 3.0.0 async-listen: 3.0.0 - edge-runtime: 2.5.7 + cjs-module-lexer: 1.2.3 + edge-runtime: 2.5.9 + es-module-lexer: 1.4.1 esbuild: 0.14.47 etag: 1.8.1 - exit-hook: 2.2.1 node-fetch: 2.6.9 path-to-regexp: 6.2.1 ts-morph: 12.0.0 ts-node: 10.9.1 typescript: 4.9.5 - undici: 5.23.0 - checksum: 3b8665b7fba143547e839a5675eae83557281f4bb49ef090971b8af5e9f0c0e1116ea853e670821ec6e6e5417870f007b2764736265566412e29f5ed74d1c87b + undici: 5.28.4 + checksum: 021edd06fc051738a24a6f4e153b3b4a7e245b324503093232639fe475b2c3ff77fef00376dded2c98d2830fb7886ae3effc881a68ccb7a5e5819d26d0c8a96c languageName: node linkType: hard -"@vercel/node@npm:3.2.2": - version: 3.2.2 - resolution: "@vercel/node@npm:3.2.2" +"@vercel/node@npm:3.2.9": + version: 3.2.9 + resolution: "@vercel/node@npm:3.2.9" dependencies: "@edge-runtime/node-utils": 2.3.0 "@edge-runtime/primitives": 4.1.0 "@edge-runtime/vm": 3.2.0 "@types/node": 16.18.11 - "@vercel/build-utils": 8.3.1 + "@vercel/build-utils": 8.3.7 "@vercel/error-utils": 2.0.2 - "@vercel/nft": 0.27.2 + "@vercel/nft": 0.27.3 "@vercel/static-config": 3.0.0 async-listen: 3.0.0 cjs-module-lexer: 1.2.3 @@ -11873,14 +11815,7 @@ __metadata: ts-node: 10.9.1 typescript: 4.9.5 undici: 5.28.4 - checksum: 021edd06fc051738a24a6f4e153b3b4a7e245b324503093232639fe475b2c3ff77fef00376dded2c98d2830fb7886ae3effc881a68ccb7a5e5819d26d0c8a96c - languageName: node - linkType: hard - -"@vercel/python@npm:4.1.0": - version: 4.1.0 - resolution: "@vercel/python@npm:4.1.0" - checksum: b0a777b3ce84f26525785406e3a251faba67dd2bdf49044acd72ffa12203a6c6eb99cb93add851c8921a714cfc1174dd75d1704c38e39e7ec42f80c588f2df5b + checksum: 8a666e2b321f680aa127c550ea7604081a37e6188e0ab644850184ee800d0810f7af6ec29731c0a89e9f3f08efdbe4b4aa74184db432789f4045d3eec175a027 languageName: node linkType: hard @@ -11891,14 +11826,10 @@ __metadata: languageName: node linkType: hard -"@vercel/redwood@npm:2.0.5": - version: 2.0.5 - resolution: "@vercel/redwood@npm:2.0.5" - dependencies: - "@vercel/nft": 0.24.2 - "@vercel/routing-utils": 3.1.0 - semver: 6.3.1 - checksum: b9a6d996fb9469ee607dbb17f85c3969c7a3ab30754a7e6f9b92092edce1ff80cd308ad4dcd9034c69c966177a0364f7cab5e44b103147a29dc38cd10826b25b +"@vercel/python@npm:4.3.1": + version: 4.3.1 + resolution: "@vercel/python@npm:4.3.1" + checksum: 270ba55dda004ce93581bdd343a2cc39a61acee68ed003030fa30c82a0e838c7de5fdc3f960f1319494999a82091dcc1d0c75973dfb68307c61a4311619bf60b languageName: node linkType: hard @@ -11915,14 +11846,16 @@ __metadata: languageName: node linkType: hard -"@vercel/remix-builder@npm:2.0.11": - version: 2.0.11 - resolution: "@vercel/remix-builder@npm:2.0.11" +"@vercel/redwood@npm:2.1.3": + version: 2.1.3 + resolution: "@vercel/redwood@npm:2.1.3" dependencies: - "@vercel/nft": 0.24.2 + "@vercel/nft": 0.27.3 + "@vercel/routing-utils": 3.1.0 "@vercel/static-config": 3.0.0 + semver: 6.3.1 ts-morph: 12.0.0 - checksum: 10ada155ab297d705010117d4bfda20f29c30eb6731db59bfc79f43ec05cc025051435fb4c55023bbcb4051be540150ddec863d016f3710b746df15a80f4380a + checksum: e3b8c060e4c20bcd9f531dc203f3e0d755e8d005faa142f81a3829d97269916759af772af2369b0c11fb68aa16c8dfcc3f4a4922ee92a210f1aff785d871a019 languageName: node linkType: hard @@ -11938,6 +11871,18 @@ __metadata: languageName: node linkType: hard +"@vercel/remix-builder@npm:2.2.6": + version: 2.2.6 + resolution: "@vercel/remix-builder@npm:2.2.6" + dependencies: + "@vercel/error-utils": 2.0.2 + "@vercel/nft": 0.27.3 + "@vercel/static-config": 3.0.0 + ts-morph: 12.0.0 + checksum: c2e5880022eefcb2c4b49cf0bf89f4ea31b3e0b5985febb36cd5d81845c3f4413f7b595b23504517974647a72c20290afbc0ebd2d9bfcdc40acf8e33f9291e81 + languageName: node + linkType: hard + "@vercel/routing-utils@npm:3.1.0": version: 3.1.0 resolution: "@vercel/routing-utils@npm:3.1.0" @@ -11951,13 +11896,6 @@ __metadata: languageName: node linkType: hard -"@vercel/ruby@npm:2.0.2": - version: 2.0.2 - resolution: "@vercel/ruby@npm:2.0.2" - checksum: 7e15e8302a09ad3b2db12d958c2501701afccec8b845451096e5a89b6f442cfd55290b98ab027ba606f875a16a4fd724b6356b650aaa0cd4e0c07a4088a1bcde - languageName: node - linkType: hard - "@vercel/ruby@npm:2.1.0": version: 2.1.0 resolution: "@vercel/ruby@npm:2.1.0" @@ -11965,27 +11903,27 @@ __metadata: languageName: node linkType: hard -"@vercel/static-build@npm:2.0.10": - version: 2.0.10 - resolution: "@vercel/static-build@npm:2.0.10" +"@vercel/static-build@npm:2.5.13": + version: 2.5.13 + resolution: "@vercel/static-build@npm:2.5.13" dependencies: "@vercel/gatsby-plugin-vercel-analytics": 1.0.11 - "@vercel/gatsby-plugin-vercel-builder": 2.0.9 + "@vercel/gatsby-plugin-vercel-builder": 2.0.35 "@vercel/static-config": 3.0.0 ts-morph: 12.0.0 - checksum: 4dd50e7b2487f60bcf106559d4fa81ca782b5c83c5db04782b21ae39afd0e07ca3638a10a39d4bd1009b6565538dff46648327ef4966de814c2e722611b1358b + checksum: c8e760684f6a8c0de5aa066d70a1c37084eb6d2766bc5fef6c925955eadc12d98cc666928ecbc20ee9b1f8834ba2e8071d68da5eb79a36cf2c6f56f05fda1dcb languageName: node linkType: hard -"@vercel/static-build@npm:2.5.13": - version: 2.5.13 - resolution: "@vercel/static-build@npm:2.5.13" +"@vercel/static-build@npm:2.5.19": + version: 2.5.19 + resolution: "@vercel/static-build@npm:2.5.19" dependencies: "@vercel/gatsby-plugin-vercel-analytics": 1.0.11 - "@vercel/gatsby-plugin-vercel-builder": 2.0.35 + "@vercel/gatsby-plugin-vercel-builder": 2.0.41 "@vercel/static-config": 3.0.0 ts-morph: 12.0.0 - checksum: c8e760684f6a8c0de5aa066d70a1c37084eb6d2766bc5fef6c925955eadc12d98cc666928ecbc20ee9b1f8834ba2e8071d68da5eb79a36cf2c6f56f05fda1dcb + checksum: c6e0bba6939cf58824fa42953a0e9db769656446c76a8ff2bcdcaa5f7502b4820f9967de6956530166d9476aa07dfa1941fb12ab8e07f6f9502d81b5db824602 languageName: node linkType: hard @@ -19262,25 +19200,6 @@ __metadata: languageName: node linkType: hard -"edge-runtime@npm:2.5.7": - version: 2.5.7 - resolution: "edge-runtime@npm:2.5.7" - dependencies: - "@edge-runtime/format": 2.2.0 - "@edge-runtime/ponyfill": 2.4.1 - "@edge-runtime/vm": 3.1.7 - async-listen: 3.0.1 - mri: 1.2.0 - picocolors: 1.0.0 - pretty-ms: 7.0.1 - signal-exit: 4.0.2 - time-span: 4.0.0 - bin: - edge-runtime: dist/cli/index.js - checksum: 0633677fd28b0aa60d11e8df67f561d65ff53473aa88d62dc8e057b3a8d44054478d3668a4577d745f2231e12c11ab32126f396e0809f753509ad35f5a882cb7 - languageName: node - linkType: hard - "edge-runtime@npm:2.5.9": version: 2.5.9 resolution: "edge-runtime@npm:2.5.9" @@ -21490,13 +21409,6 @@ __metadata: languageName: node linkType: hard -"exit-hook@npm:2.2.1": - version: 2.2.1 - resolution: "exit-hook@npm:2.2.1" - checksum: 1aa8359b6c5590a012d6cadf9cd337d227291bfcaa8970dc585d73dffef0582af34ed8ac56f6164f8979979fb417cff1eb49f03cdfd782f9332a30c773f0ada0 - languageName: node - linkType: hard - "exit@npm:^0.1.2": version: 0.1.2 resolution: "exit@npm:0.1.2" @@ -37057,15 +36969,6 @@ __metadata: languageName: node linkType: hard -"undici@npm:5.23.0": - version: 5.23.0 - resolution: "undici@npm:5.23.0" - dependencies: - busboy: ^1.6.0 - checksum: 906ca4fb1d47163d2cee2ecbbc664a1d92508a2cdf1558146621109f525c983a83597910b36e6ba468240e95259be5939cea6babc99fc0c36360b16630f66784 - languageName: node - linkType: hard - "undici@npm:5.28.4": version: 5.28.4 resolution: "undici@npm:5.28.4" @@ -37564,26 +37467,26 @@ __metadata: languageName: node linkType: hard -"vercel@npm:latest": - version: 32.5.2 - resolution: "vercel@npm:32.5.2" +"vercel@npm:^37.1.1": + version: 37.1.1 + resolution: "vercel@npm:37.1.1" dependencies: - "@vercel/build-utils": 7.2.3 + "@vercel/build-utils": 8.3.7 "@vercel/fun": 1.1.0 - "@vercel/go": 3.0.3 - "@vercel/hydrogen": 1.0.1 - "@vercel/next": 4.0.13 - "@vercel/node": 3.0.8 - "@vercel/python": 4.1.0 - "@vercel/redwood": 2.0.5 - "@vercel/remix-builder": 2.0.11 - "@vercel/ruby": 2.0.2 - "@vercel/static-build": 2.0.10 + "@vercel/go": 3.1.1 + "@vercel/hydrogen": 1.0.4 + "@vercel/next": 4.3.7 + "@vercel/node": 3.2.9 + "@vercel/python": 4.3.1 + "@vercel/redwood": 2.1.3 + "@vercel/remix-builder": 2.2.6 + "@vercel/ruby": 2.1.0 + "@vercel/static-build": 2.5.19 chokidar: 3.3.1 bin: vc: dist/index.js vercel: dist/index.js - checksum: 0fc5583375a21b9007867295de7fcf7041bec81a23cdcd071db1b7c8ce3d6c301a2de2d9fc868dcfb878412448503b0d144b25d0da208eef01d26794eed7a04f + checksum: 8deb5ddc7babc4d32e065ed347de1562963b7a7a2e0f8c9788a4718e3eaa1e0ef13e5816e5beb49c979b4442840abb093066a135a2dbe802fe61df3dd7e4a49c languageName: node linkType: hard From 84d3d33f68823ca4b6177fa33b9e74cf2b60a6ef Mon Sep 17 00:00:00 2001 From: sirpy Date: Mon, 26 Aug 2024 15:52:25 +0300 Subject: [PATCH 07/11] wip: vercel cli --- packages/app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/app/package.json b/packages/app/package.json index 12d4a69..fc824cb 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@gooddollar/goodcollective-app", - "version": "1.0.0", + "version": "1.1.0", "private": true, "scripts": { "android": "react-native run-android", From 66125a8623092019fa3ada1fc0c10d6ed4ce5dc0 Mon Sep 17 00:00:00 2001 From: sirpy Date: Mon, 26 Aug 2024 16:00:02 +0300 Subject: [PATCH 08/11] wip: vercel cli --- package.json | 2 +- packages/app/package.json | 1 - yarn.lock | 160 +------------------------------------- 3 files changed, 2 insertions(+), 161 deletions(-) diff --git a/package.json b/package.json index 3d9bfc1..f34edca 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "shx": "^0.3.4", "syncpack": "^8.2.4", "ts-node": "^10.9.1", - "vercel": "^34.3.1" + "vercel": "^37.1.1" }, "lint-staged": { "packages/app/**/*.{ts,tsx}": [ diff --git a/packages/app/package.json b/packages/app/package.json index fc824cb..8647e95 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -100,7 +100,6 @@ "react-test-renderer": "18.2.0", "typechain": "^8.1.1", "typescript": "^5.1.3", - "vercel": "^37.1.1", "vite": "^4.5.0", "vite-plugin-dynamic-import": "^1.5.0", "vite-plugin-node-polyfills": "^0.16.0", diff --git a/yarn.lock b/yarn.lock index 4c59542..30413c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4538,7 +4538,6 @@ __metadata: realm-web: ^2.0.0 typechain: ^8.1.1 typescript: ^5.1.3 - vercel: ^37.1.1 viem: ^1.10.8 vite: ^4.5.0 vite-plugin-dynamic-import: ^1.5.0 @@ -4642,7 +4641,7 @@ __metadata: shx: ^0.3.4 syncpack: ^8.2.4 ts-node: ^10.9.1 - vercel: ^34.3.1 + vercel: ^37.1.1 languageName: unknown linkType: soft @@ -11588,13 +11587,6 @@ __metadata: languageName: node linkType: hard -"@vercel/build-utils@npm:8.3.1": - version: 8.3.1 - resolution: "@vercel/build-utils@npm:8.3.1" - checksum: 92490f094c9be2e6f999eaa29fce79799b887cccb756b72821f5f06d1abab7a15604e80e061ee67b40ac2d025d9884863495ee7a55f513bacae7fb436f4ccb61 - languageName: node - linkType: hard - "@vercel/build-utils@npm:8.3.7": version: 8.3.7 resolution: "@vercel/build-utils@npm:8.3.7" @@ -11646,20 +11638,6 @@ __metadata: languageName: node linkType: hard -"@vercel/gatsby-plugin-vercel-builder@npm:2.0.35": - version: 2.0.35 - resolution: "@vercel/gatsby-plugin-vercel-builder@npm:2.0.35" - dependencies: - "@sinclair/typebox": 0.25.24 - "@vercel/build-utils": 8.3.1 - "@vercel/routing-utils": 3.1.0 - esbuild: 0.14.47 - etag: 1.8.1 - fs-extra: 11.1.0 - checksum: 63de379db0795b9b8f8bd0550fe0d298db1ecb1c30c0cc4d344fd0c5a7a8da30f97da631f50da373a3ac6a07f176a46780f4e5646ebdd7004e7347ccf8f1953e - languageName: node - linkType: hard - "@vercel/gatsby-plugin-vercel-builder@npm:2.0.41": version: 2.0.41 resolution: "@vercel/gatsby-plugin-vercel-builder@npm:2.0.41" @@ -11681,16 +11659,6 @@ __metadata: languageName: node linkType: hard -"@vercel/hydrogen@npm:1.0.2": - version: 1.0.2 - resolution: "@vercel/hydrogen@npm:1.0.2" - dependencies: - "@vercel/static-config": 3.0.0 - ts-morph: 12.0.0 - checksum: 637fa7738edfb8310806b381b2106ffacaeeb12efd2c0549df476f82114b96132279c6f2c0589516bc5bfcea25445897b3bf07ffd6306e7133e83bee679ae11a - languageName: node - linkType: hard - "@vercel/hydrogen@npm:1.0.4": version: 1.0.4 resolution: "@vercel/hydrogen@npm:1.0.4" @@ -11701,15 +11669,6 @@ __metadata: languageName: node linkType: hard -"@vercel/next@npm:4.3.1": - version: 4.3.1 - resolution: "@vercel/next@npm:4.3.1" - dependencies: - "@vercel/nft": 0.27.2 - checksum: f0edb8eefdc46d210808928f712540626cc183437f37d6a0113b8348667bfc92e5593c1f31ca4cf8108b41f8bc1e8a0d244ad6b6a48e1a6621f6bd9e8e5473e6 - languageName: node - linkType: hard - "@vercel/next@npm:4.3.7": version: 4.3.7 resolution: "@vercel/next@npm:4.3.7" @@ -11719,28 +11678,6 @@ __metadata: languageName: node linkType: hard -"@vercel/nft@npm:0.27.2": - version: 0.27.2 - resolution: "@vercel/nft@npm:0.27.2" - dependencies: - "@mapbox/node-pre-gyp": ^1.0.5 - "@rollup/pluginutils": ^4.0.0 - acorn: ^8.6.0 - acorn-import-attributes: ^1.9.5 - async-sema: ^3.1.1 - bindings: ^1.4.0 - estree-walker: 2.0.2 - glob: ^7.1.3 - graceful-fs: ^4.2.9 - micromatch: ^4.0.2 - node-gyp-build: ^4.2.2 - resolve-from: ^5.0.0 - bin: - nft: out/cli.js - checksum: b8a9104f948816ba2bd2fb74a2d6cb4585d5550d8c91816569ac0aa7cc0ec62f04306418f8877908784c59897f6cd5b9623ba4cb7d6d2c75a8438c4f0ec13a74 - languageName: node - linkType: hard - "@vercel/nft@npm:0.27.3": version: 0.27.3 resolution: "@vercel/nft@npm:0.27.3" @@ -11763,34 +11700,6 @@ __metadata: languageName: node linkType: hard -"@vercel/node@npm:3.2.2": - version: 3.2.2 - resolution: "@vercel/node@npm:3.2.2" - dependencies: - "@edge-runtime/node-utils": 2.3.0 - "@edge-runtime/primitives": 4.1.0 - "@edge-runtime/vm": 3.2.0 - "@types/node": 16.18.11 - "@vercel/build-utils": 8.3.1 - "@vercel/error-utils": 2.0.2 - "@vercel/nft": 0.27.2 - "@vercel/static-config": 3.0.0 - async-listen: 3.0.0 - cjs-module-lexer: 1.2.3 - edge-runtime: 2.5.9 - es-module-lexer: 1.4.1 - esbuild: 0.14.47 - etag: 1.8.1 - node-fetch: 2.6.9 - path-to-regexp: 6.2.1 - ts-morph: 12.0.0 - ts-node: 10.9.1 - typescript: 4.9.5 - undici: 5.28.4 - checksum: 021edd06fc051738a24a6f4e153b3b4a7e245b324503093232639fe475b2c3ff77fef00376dded2c98d2830fb7886ae3effc881a68ccb7a5e5819d26d0c8a96c - languageName: node - linkType: hard - "@vercel/node@npm:3.2.9": version: 3.2.9 resolution: "@vercel/node@npm:3.2.9" @@ -11819,13 +11728,6 @@ __metadata: languageName: node linkType: hard -"@vercel/python@npm:4.3.0": - version: 4.3.0 - resolution: "@vercel/python@npm:4.3.0" - checksum: 531968b34c5b645891dfd295caf35526ae5dfce1393752d854eabf8ff72a5ac1d4e050284e25ab7437f2a3bb99407dd85ec31a986d31b16a8fcb7cf6ee06c9fb - languageName: node - linkType: hard - "@vercel/python@npm:4.3.1": version: 4.3.1 resolution: "@vercel/python@npm:4.3.1" @@ -11833,19 +11735,6 @@ __metadata: languageName: node linkType: hard -"@vercel/redwood@npm:2.1.0": - version: 2.1.0 - resolution: "@vercel/redwood@npm:2.1.0" - dependencies: - "@vercel/nft": 0.27.2 - "@vercel/routing-utils": 3.1.0 - "@vercel/static-config": 3.0.0 - semver: 6.3.1 - ts-morph: 12.0.0 - checksum: 0df907bbdaff3d7278ad9fb5e067f615b7062727f40a8b2e126b109c01a924b5a50f13b0af66470d4540835c05c2235f1a0de037be36213e4f489868a624cd3f - languageName: node - linkType: hard - "@vercel/redwood@npm:2.1.3": version: 2.1.3 resolution: "@vercel/redwood@npm:2.1.3" @@ -11859,18 +11748,6 @@ __metadata: languageName: node linkType: hard -"@vercel/remix-builder@npm:2.1.9": - version: 2.1.9 - resolution: "@vercel/remix-builder@npm:2.1.9" - dependencies: - "@vercel/error-utils": 2.0.2 - "@vercel/nft": 0.27.2 - "@vercel/static-config": 3.0.0 - ts-morph: 12.0.0 - checksum: b4eeb37efcd16f206a2cc039b821f4a54d02345a6abe0b0af5d24caeada05223e4ca559f5c60015e2c0b5f1977116bbfda828b84dd94b64bc65f7d937418346c - languageName: node - linkType: hard - "@vercel/remix-builder@npm:2.2.6": version: 2.2.6 resolution: "@vercel/remix-builder@npm:2.2.6" @@ -11903,18 +11780,6 @@ __metadata: languageName: node linkType: hard -"@vercel/static-build@npm:2.5.13": - version: 2.5.13 - resolution: "@vercel/static-build@npm:2.5.13" - dependencies: - "@vercel/gatsby-plugin-vercel-analytics": 1.0.11 - "@vercel/gatsby-plugin-vercel-builder": 2.0.35 - "@vercel/static-config": 3.0.0 - ts-morph: 12.0.0 - checksum: c8e760684f6a8c0de5aa066d70a1c37084eb6d2766bc5fef6c925955eadc12d98cc666928ecbc20ee9b1f8834ba2e8071d68da5eb79a36cf2c6f56f05fda1dcb - languageName: node - linkType: hard - "@vercel/static-build@npm:2.5.19": version: 2.5.19 resolution: "@vercel/static-build@npm:2.5.19" @@ -37444,29 +37309,6 @@ __metadata: languageName: node linkType: hard -"vercel@npm:^34.3.1": - version: 34.3.1 - resolution: "vercel@npm:34.3.1" - dependencies: - "@vercel/build-utils": 8.3.1 - "@vercel/fun": 1.1.0 - "@vercel/go": 3.1.1 - "@vercel/hydrogen": 1.0.2 - "@vercel/next": 4.3.1 - "@vercel/node": 3.2.2 - "@vercel/python": 4.3.0 - "@vercel/redwood": 2.1.0 - "@vercel/remix-builder": 2.1.9 - "@vercel/ruby": 2.1.0 - "@vercel/static-build": 2.5.13 - chokidar: 3.3.1 - bin: - vc: dist/index.js - vercel: dist/index.js - checksum: 58c5b0359b00111a812de8a68739b571006b618f8a66f7c55222eec7327811d37df81610324c9d6fb2665d421315d47d8ca1f26569cd6760313296e0c7133531 - languageName: node - linkType: hard - "vercel@npm:^37.1.1": version: 37.1.1 resolution: "vercel@npm:37.1.1" From 20e5fb9f8be912d15f993344dc49103fa3367f9e Mon Sep 17 00:00:00 2001 From: sirpy Date: Wed, 28 Aug 2024 11:46:03 +0300 Subject: [PATCH 09/11] Update packages/app/src/components/DonateComponent.tsx Co-authored-by: Lewis B --- packages/app/src/components/DonateComponent.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/app/src/components/DonateComponent.tsx b/packages/app/src/components/DonateComponent.tsx index a2367a4..0d9eb6c 100644 --- a/packages/app/src/components/DonateComponent.tsx +++ b/packages/app/src/components/DonateComponent.tsx @@ -66,12 +66,12 @@ function DonateComponent({ collective }: DonateComponentProps) { const GDToken = GDEnvTokens[gdEnvSymbol]; const currencyOptions: { value: string; label: string }[] = useMemo(() => { - let options = Object.keys(tokenList) - .filter((key) => key.startsWith('G$') === false || key === gdEnvSymbol) - .map((key) => ({ - value: key, - label: key, - })); + let options = Object.keys(tokenList).reduce((acc, key) => { + if (!key.startsWith('G$') || key === gdEnvSymbol) { + acc.push({ value: key, label: key }); + } + return acc; +}, []); return options; }, [tokenList, gdEnvSymbol]); From 8ab4c1a123264c2d3d4ae469051952c91ba404a2 Mon Sep 17 00:00:00 2001 From: sirpy Date: Wed, 28 Aug 2024 11:53:44 +0300 Subject: [PATCH 10/11] fix: code review --- .../TransactionList/SupportTransactionListItem.tsx | 1 + packages/app/src/hooks/useTokenList.ts | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/app/src/components/TransactionList/SupportTransactionListItem.tsx b/packages/app/src/components/TransactionList/SupportTransactionListItem.tsx index 909b78b..fcecca3 100644 --- a/packages/app/src/components/TransactionList/SupportTransactionListItem.tsx +++ b/packages/app/src/components/TransactionList/SupportTransactionListItem.tsx @@ -32,6 +32,7 @@ export function SupportTransactionListItem({ transaction }: SupportTransactionLi const userFullName = useFetchFullName(userAddress); const userIdentifier = userFullName ?? ensName ?? formatAddress(userAddress); const flowUpdateLog = useWaitForTransaction({ hash: hash as `0x${string}`, chainId: 42220 }); + // super fluid event flowupdated event https://www.4byte.directory/event-signatures/?bytes_signature=0x57269d2ebcccecdcc0d9d2c0a0b80ead95f344e28ec20f50f709811f209d4e0e const flowLogIndex = flowUpdateLog.data?.logs.find( (_) => _.topics[0] === '0x57269d2ebcccecdcc0d9d2c0a0b80ead95f344e28ec20f50f709811f209d4e0e' )?.logIndex; diff --git a/packages/app/src/hooks/useTokenList.ts b/packages/app/src/hooks/useTokenList.ts index 7f28704..bf8ee75 100644 --- a/packages/app/src/hooks/useTokenList.ts +++ b/packages/app/src/hooks/useTokenList.ts @@ -2,11 +2,12 @@ import AsyncStorage from '@react-native-async-storage/async-storage'; import { isEqual } from 'lodash'; import { Token } from '@uniswap/sdk-core'; import CeloTokenList from '../models/CeloTokenList.json'; -import { SupportedNetwork } from '../models/constants'; +import { GDDevToken, GDQAToken, GDToken, SupportedNetwork } from '../models/constants'; const populatedTokenList: Record = { - 'G$-Dev': new Token(42220, '0xFa51eFDc0910CCdA91732e6806912Fa12e2FD475', 18, 'G$-Dev'), - 'G$-QA': new Token(42220, '0x61FA0fB802fd8345C06da558240E0651886fec69', 18, 'G$-QA'), + 'G$-Dev': GDDevToken, + 'G$-QA': GDQAToken, + G$: GDToken, }; populateTokenList(); From 40fd161b66f4829a8687bfa9f797c4dcab02754b Mon Sep 17 00:00:00 2001 From: sirpy Date: Wed, 28 Aug 2024 14:43:36 +0300 Subject: [PATCH 11/11] fix: type error --- packages/app/src/components/DonateComponent.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/app/src/components/DonateComponent.tsx b/packages/app/src/components/DonateComponent.tsx index 0d9eb6c..6d17bd2 100644 --- a/packages/app/src/components/DonateComponent.tsx +++ b/packages/app/src/components/DonateComponent.tsx @@ -66,12 +66,12 @@ function DonateComponent({ collective }: DonateComponentProps) { const GDToken = GDEnvTokens[gdEnvSymbol]; const currencyOptions: { value: string; label: string }[] = useMemo(() => { - let options = Object.keys(tokenList).reduce((acc, key) => { - if (!key.startsWith('G$') || key === gdEnvSymbol) { - acc.push({ value: key, label: key }); - } - return acc; -}, []); + let options = Object.keys(tokenList).reduce>((acc, key) => { + if (!key.startsWith('G$') || key === gdEnvSymbol) { + acc.push({ value: key, label: key }); + } + return acc; + }, []); return options; }, [tokenList, gdEnvSymbol]);