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F,EACF,GAAI,CACF,MAAMzW,EAAiB,CACrBU,QAASkC,EAAM8C,EAAE,EAErB,CAAE,MAAO/E,EAAG,CACV6a,EATaF,EAUf,CAEJ,GApBK1Y,EAAM8C,EAAE,OAyBrB,GAAAzC,EAAAnI,GAAA,EAACkD,OAAAA,CAAKxD,UAAU,yCAAgC,wCAGtD,kBChHe,SAASshB,KACtB,MACE,GAAA7Y,EAAAnI,GAAA,EAACihB,GAAAA,CAAgBA,CAAAA,CAACvhB,UAAU,wBAC1B,GAAAyI,EAAAjH,IAAA,EAACggB,EAAAA,CAAuBA,CAAAA,WACtB,GAAA/Y,EAAAnI,GAAA,EAACmhB,EAAAA,CAAMA,CAAAA,CAAAA,GACP,GAAAhZ,EAAAnI,GAAA,EAACohB,EAAAA,CAAWA,CAAAA,UACV,GAAAjZ,EAAAjH,IAAA,EAACmgB,EAAAA,EAAaA,CAAAA,WACZ,GAAAlZ,EAAAnI,GAAA,EAACugB,GAAeA,CAAAA,GAChB,GAAApY,EAAAnI,GAAA,EAACiY,GAASA,CAAAA,GACV,GAAA9P,EAAAnI,GAAA,EAAC0e,GAAcA,CAAAA,GACf,GAAAvW,EAAAnI,GAAA,EAACuf,GAAUA,CAAAA,QAGf,GAAApX,EAAAnI,GAAA,EAACshB,EAAAA,CAAMA,CAAAA,CAAAA,OAIf","sources":["webpack://_N_E/./src/components/Button.tsx","webpack://_N_E/./src/components/DoneToastContent.tsx","webpack://_N_E/./src/components/LoadButton.tsx","webpack://_N_E/./src/components/components_staking/LoggedInPageRoot.tsx","webpack://_N_E/./src/components/components_staking/PanelDiv.tsx","webpack://_N_E/./src/components/components_staking/StakeModal.tsx","webpack://_N_E/./src/hooks/staking_hooks/useChainInitialization.tsx","webpack://_N_E/./src/utils/stakeHistory.ts","webpack://_N_E/./src/hooks/hooks_staking/useStakeTxHandler.tsx","webpack://_N_E/./src/hooks/hooks_staking/useStakeTxWithApprovalCheck.tsx","webpack://_N_E/./src/hooks/hooks_staking/useSelfStakeTxStore.tsx","webpack://_N_E/./src/components/components_staking/SelfStakeModal.tsx","webpack://_N_E/./src/components/components_staking/StakeFormInputSection.tsx","webpack://_N_E/./src/components/components_staking/YourStakeForm.tsx","webpack://_N_E/./src/components/components_staking/DropDownIcon.tsx","webpack://_N_E/./src/components/components_staking/StakeSection.tsx","webpack://_N_E/./src/hooks/legacyStaking.tsx","webpack://_N_E/./src/components/components_staking/SelfRestakeModal.tsx","webpack://_N_E/./src/components/components_staking/SelfUnstakeModal.tsx","webpack://_N_E/./src/components/components_staking/YourStakeHistory.tsx","webpack://_N_E/./src/components/components_staking/YourStake.tsx","webpack://_N_E/./src/components/components_staking/CommunityUpdateButton.tsx","webpack://_N_E/./src/components/components_staking/CommunityRestakeModal.tsx","webpack://_N_E/./src/components/components_staking/CommunityUnstakeModal.tsx","webpack://_N_E/./src/hooks/hooks_staking/useCommunityStakeTxStore.tsx","webpack://_N_E/./src/components/components_staking/StakeForOthersHistory.tsx","webpack://_N_E/./src/components/components_staking/StakeForOthersModal.tsx","webpack://_N_E/./src/components/components_staking/StakeForOthersForm.tsx","webpack://_N_E/./src/components/components_staking/StakeForOthers.tsx","webpack://_N_E/./src/components/components_staking/TrustInYouHistory.tsx","webpack://_N_E/./src/components/components_staking/ShareWithFriends.tsx","webpack://_N_E/./src/components/components_staking/TrustInYou.tsx","webpack://_N_E/./src/components/components_staking/NetworkDropdown.tsx","webpack://_N_E/./src/pages/home.tsx","webpack://_N_E/"],"sourcesContent":["import React, { ButtonHTMLAttributes, useMemo } from \"react\";\n\nexport type ButtonProps = ButtonHTMLAttributes & {\n variant?: \"primary\" | \"secondary\" | \"custom\";\n};\n\n// Children are centered and spaced out with gap-4.\n// If your button just contains text, simply use the text\n// e.g. \n// If your button has an icon or other elements, just include both elements\n// e.g. \nexport const Button = ({ variant, className, ...props }: ButtonProps) => {\n const variantClassName = useMemo(() => {\n if (variant === \"custom\") {\n return \"\";\n } else if (variant === \"secondary\") {\n return \"text-color-1 bg-background border border-foreground-3 hover:border-foreground-4\";\n } else {\n // primary, default\n return \"text-color-4 bg-background-8 hover:bg-background-9\";\n }\n }, [variant]);\n\n return (\n \n );\n};\n\nexport type FormButtonProps = ButtonHTMLAttributes & {\n variant?: \"active\" | \"inactive\";\n};\n\nexport const FormButton = ({ variant, className, ...props }: FormButtonProps) => {\n const variantClassName = useMemo(() => {\n if (variant === \"active\") {\n return \"text-color-4 bg-foreground-2\";\n } else {\n return \"text-color-4 bg-foreground-4 hover:bg-foreground-2\";\n }\n }, [variant]);\n\n return (\n \n );\n};\n","// --- React Methods\nimport React from \"react\";\n\nexport type CustomToastProps = {\n // platformId?: PLATFORM_ID | undefined; TODO - this was removed in staking app\n // providerId?: PROVIDER_ID;\n title: string;\n body?: React.ReactNode;\n icon: string;\n result: any;\n message?: boolean | string;\n testId?: string;\n};\n\nexport const makeErrorToastProps = (title: string, message: React.ReactNode) => ({\n duration: 6000,\n isClosable: true,\n render: (result: any) => (\n \n ),\n});\n\nexport const makeSuccessToastProps = (title: string, message: React.ReactNode) => ({\n duration: 6000,\n isClosable: true,\n render: (result: any) => (\n \n ),\n});\n\n// This content overrides Chakra UI Toast style in render function\nexport const DoneToastContent = ({\n title,\n body,\n icon,\n result,\n message = false,\n testId,\n}: CustomToastProps): JSX.Element => {\n return (\n
\n
\n
\n
\n \"information\n
\n
\n
\n

{title}

\n {message ?

{message}

: body}\n
\n
\n \n
\n
\n
\n );\n};\n","import React from \"react\";\nimport { Button, ButtonProps } from \"./Button\";\nimport { Spinner } from \"@chakra-ui/react\";\n\nexport type LoadingButtonProps = ButtonProps & {\n isLoading?: boolean;\n subtext?: string;\n};\n\nexport const LoadButton = ({ isLoading, disabled, subtext, children, ...props }: LoadingButtonProps) => {\n return (\n \n );\n};\n","import React, { useEffect } from \"react\";\nimport { useAccount } from \"wagmi\";\n\nimport { useDatastoreConnectionContext } from \"../../context/datastoreConnectionContext\";\nimport { useNavigateWithCommonParams } from \"@/hooks/hooks_staking/useNavigateWithCommonParams\";\nimport { useChainInitialization } from \"@/hooks/staking_hooks/useChainInitialization\";\nimport PageRoot, { PageRootProps } from \"./PageRoot\";\n\nconst LoggedInPageRoot = (props: PageRootProps) => {\n useChainInitialization();\n const { isConnected } = useAccount();\n const { dbAccessTokenStatus } = useDatastoreConnectionContext();\n const navigate = useNavigateWithCommonParams();\n\n useEffect(() => {\n if (!isConnected || dbAccessTokenStatus !== \"connected\") {\n navigate(\"/\");\n }\n }, [isConnected, dbAccessTokenStatus, navigate]);\n\n return ;\n};\n\nexport default LoggedInPageRoot;\n","import React, { forwardRef } from \"react\";\n\ntype PanelDivProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nexport const PanelDiv = forwardRef(function PanelDiv({ children, className }, ref) {\n return (\n \n {children}\n \n );\n});\n","import React, { Fragment } from \"react\";\nimport { Dialog, Transition } from \"@headlessui/react\";\nimport { PanelDiv } from \"./PanelDiv\";\nimport { Button } from \"../Button\";\nimport { LoadButton } from \"../LoadButton\";\nimport { BackdropEnabler } from \"./Backdrop\";\n\nexport const DataLine = ({ label, value }: { label: string; value: React.ReactNode }) => (\n
\n {label}\n {value}\n
\n);\n\nexport const StakeModal = ({\n title,\n buttonText,\n buttonSubtext,\n onButtonClick,\n buttonLoading,\n buttonDisabled,\n isOpen,\n onClose,\n children,\n}: {\n title: string;\n buttonText: string;\n buttonSubtext?: string;\n onButtonClick: () => void;\n buttonLoading: boolean;\n buttonDisabled?: boolean;\n isOpen: boolean;\n onClose: () => void;\n children: React.ReactNode;\n}) => {\n return (\n <>\n \n \n \n
\n \n\n
\n
\n \n \n \n \n \n {title}\n \n
{children}
\n\n
\n \n {buttonText}\n \n \n
\n
\n
\n \n
\n
\n
\n
\n \n );\n};\n","// --- React Methods\nimport { makeErrorToastProps } from \"@/components/DoneToastContent\";\nimport { useToast } from \"@chakra-ui/react\";\nimport { useEffect, useMemo, useRef } from \"react\";\n\n// --Components\nimport { useSearchParams } from \"react-router-dom\";\nimport { useAccount, useChainId, useSwitchChain } from \"wagmi\";\n\n// Just returns true/false indicating if\n// the connected chain still hasn't been\n// switched to the desired chain for the\n// ?chain_id= query param\nexport const useChainInitializing = (): boolean => {\n const [searchParams] = useSearchParams();\n return Boolean(searchParams.get(\"chain_id\"));\n};\n\nexport const useChainInitialization = () => {\n const [searchParams, setSearchParams] = useSearchParams();\n const alreadyRunning = useRef(false);\n\n const { switchChainAsync } = useSwitchChain();\n const connectedChainId = useChainId();\n const { isConnected } = useAccount();\n\n const toast = useToast();\n\n const desiredChainId = parseInt(searchParams.get(\"chain_id\") || \"\");\n\n useEffect(() => {\n if (desiredChainId && desiredChainId === connectedChainId) {\n searchParams.delete(\"chain_id\");\n setSearchParams(searchParams);\n }\n }, [desiredChainId, connectedChainId, searchParams, setSearchParams]);\n\n useEffect(() => {\n (async () => {\n if (desiredChainId && !alreadyRunning.current && desiredChainId !== connectedChainId && isConnected) {\n alreadyRunning.current = true;\n try {\n await switchChainAsync({ chainId: desiredChainId });\n } catch (e) {\n console.error(\"Failed to switch chains\", e);\n toast(\n makeErrorToastProps(\"Error\", \"Failed to switch chains. Please switch chains using your wallet provider.\")\n );\n }\n alreadyRunning.current = false;\n }\n })();\n }, [desiredChainId, connectedChainId, isConnected, switchChainAsync, toast]);\n\n return useMemo(() => ({ initializing: Boolean(desiredChainId) }), [desiredChainId]);\n};\n","import React, { useMemo } from \"react\";\nimport { useDatastoreConnectionContext } from \"@/context/datastoreConnectionContext\";\n\nimport { useQuery } from \"@tanstack/react-query\";\nimport axios from \"axios\";\nimport { useChainId } from \"wagmi\";\n\nexport type LegacyRoundMeta = {\n unlock_time: string;\n lock_time: string;\n round_id: number;\n name: string;\n};\n\nexport type StakeData = {\n legacy?: {\n type: \"v1Single\" | \"v1Community\";\n round?: LegacyRoundMeta;\n stakees?: `0x${string}`[]; // Only for v1Community\n amounts?: string[]; // Only for v1Community\n };\n chain: number;\n staker: `0x${string}`;\n stakee: `0x${string}`;\n amount: string;\n unlock_time: string;\n lock_time: string;\n last_updated_in_block: bigint;\n};\n\nexport const useStakeHistoryQueryKey = (address: string | undefined): string[] => {\n return useMemo(() => [\"stakeHistory\", address || \"\"], [address]);\n};\n\nexport const useStakeHistoryQuery = (address: string | undefined) => {\n const { dbAccessToken, dbAccessTokenStatus } = useDatastoreConnectionContext();\n const queryKey = useStakeHistoryQueryKey(address);\n return useQuery({\n queryKey,\n queryFn: async (): Promise => {\n const response = await axios.get(`${process.env.NEXT_PUBLIC_SCORER_ENDPOINT}/ceramic-cache/stake/gtc`, {\n headers: {\n Authorization: `Bearer ${dbAccessToken}`,\n },\n });\n\n return response.data.items.map((item: StakeData) => {\n // NOTE: Modify the response format\n // Remove the `.` symbol form the `amount` to not modify the current implementation at the moment\n // This fix is required because initially the API return the amount value like an big integer\n // The API returned data format was changed to match the data format returned by the `/registry/gtc-stake` API.\n return {\n ...item,\n amount: item.amount.replace(\".\", \"\"),\n last_updated_in_block: BigInt(item.last_updated_in_block),\n };\n });\n },\n enabled: Boolean(address) && dbAccessTokenStatus === \"connected\",\n });\n};\n\nexport const useYourStakeHistoryQuery = (address: string | undefined) => {\n const { data, ...rest } = useStakeHistoryQuery(address);\n const chainId = useChainId();\n const filteredData = useMemo(\n () =>\n data?.filter(\n (stake) =>\n stake.staker.toLowerCase() === address?.toLowerCase() &&\n stake.stakee.toLowerCase() === address?.toLowerCase() &&\n stake.chain === chainId\n ),\n [data, address, chainId]\n );\n\n return {\n ...rest,\n data: filteredData,\n };\n};\n\nexport const useCommunityStakeHistoryQuery = (address: string | undefined) => {\n const { data, ...rest } = useStakeHistoryQuery(address);\n const chainId = useChainId();\n const filteredData = useMemo(\n () =>\n data?.filter(\n (stake) =>\n stake.staker.toLowerCase() === address?.toLowerCase() &&\n stake.stakee.toLowerCase() !== address.toLowerCase() &&\n stake.chain === chainId\n ),\n [data, address, chainId]\n );\n\n return {\n ...rest,\n data: filteredData,\n };\n};\n\nexport const useStakeOnYouHistoryQuery = (address: string | undefined) => {\n const { data, ...rest } = useStakeHistoryQuery(address);\n const chainId = useChainId();\n const filteredData = useMemo(\n () =>\n data?.filter(\n (stake) =>\n stake.staker.toLowerCase() !== address?.toLowerCase() &&\n stake.stakee.toLowerCase() === address?.toLowerCase() &&\n stake.chain === chainId\n ),\n [data, address, chainId]\n );\n\n return {\n ...rest,\n data: filteredData,\n };\n};\n","import React, { useEffect, useMemo } from \"react\";\nimport { useQueryClient } from \"@tanstack/react-query\";\nimport { makeErrorToastProps, makeSuccessToastProps } from \"../../components/DoneToastContent\";\nimport { Toast, useToast } from \"@chakra-ui/react\";\nimport { useWaitForTransactionReceipt, useWriteContract } from \"wagmi\";\nimport { useConnectedChain } from \"@/utils/helpers\";\n\nexport const onTxError = (txTitle: string, error: any, toast: typeof Toast) => {\n console.error(`${txTitle} failed:`, error);\n toast(\n makeErrorToastProps(\n \"Failed\",\n
\n

{txTitle} transaction failed

\n

\n Error: {error?.name}, Details: {error?.message}\n

\n
\n )\n );\n};\n\nexport const onTxReceiptError = (txTitle: any, hash: any, receiptError: any, toast: typeof Toast, explorerUrl: any) => {\n console.error(`${txTitle} receipt failed, tx hash =`, hash, \" error:\", receiptError);\n toast(\n makeErrorToastProps(\n \"Error\",\n
\n

{txTitle} transaction failed to confirm

\n

\n See details on the block explorer\n

\n
\n )\n );\n};\n\nexport const useStakeTxHandler = ({ txTitle, queryKey }: { txTitle: string; queryKey?: Readonly> }) => {\n const connectedChain = useConnectedChain();\n const toast = useToast();\n const queryClient = useQueryClient();\n\n const { data: hash, error, isPending, isError, writeContract } = useWriteContract();\n const {\n isLoading: isConfirming,\n isSuccess: isConfirmed,\n isError: isReceiptError,\n error: receiptError,\n data: txReceipt\n } = useWaitForTransactionReceipt({\n hash,\n });\n const blockNumber = txReceipt?.blockNumber;\n\n useEffect(() => {\n (async () => {\n if (isConfirmed) {\n toast(makeSuccessToastProps(\"Success\", `${txTitle} transaction confirmed`));\n if (queryKey) {\n // delay for indexer\n // maybe it would be better to wait for a few TX confirmations instead of delaying?\n await new Promise((resolve) => setTimeout(resolve, 10000));\n await queryClient.invalidateQueries({ queryKey });\n }\n }\n })();\n }, [isConfirmed, toast, queryClient, queryKey, txTitle]);\n\n useEffect(() => {\n if (isError) {\n onTxError(txTitle, error, toast);\n }\n }, [error, toast, txTitle, isError]);\n\n useEffect(() => {\n if (isReceiptError) {\n onTxReceiptError(txTitle, hash, receiptError, toast, connectedChain.explorer);\n }\n }, [isReceiptError, receiptError, toast, txTitle, hash, connectedChain.explorer]);\n\n const isLoading = isPending || isConfirming;\n\n return useMemo(\n () => ({\n blockNumber,\n isLoading,\n isConfirmed,\n writeContract,\n }),\n [blockNumber, isLoading, isConfirmed, writeContract]\n );\n};\n","import { useCallback, useMemo, useState } from \"react\";\nimport IdentityStakingAbi from \"../../abi/IdentityStaking.json\";\nimport ERC20 from \"../../abi/ERC20.json\";\nimport { useReadContract } from \"wagmi\";\nimport { useConnectedChain } from \"@/utils/helpers\";\nimport { onTxError, onTxReceiptError, useStakeTxHandler } from \"@/hooks/hooks_staking/useStakeTxHandler\";\nimport { useStakeHistoryQueryKey } from \"@/utils/stakeHistory\";\nimport { useToast } from \"@chakra-ui/react\";\nimport { wagmiConfig } from \"@/utils/wagmi\";\nimport { waitForTransactionReceipt, writeContract } from \"@wagmi/core\";\n\nexport const useStakeTxWithApprovalCheck = ({ address }: { address: `0x${string}` }) => {\n const toast = useToast();\n const queryKey = useStakeHistoryQueryKey(address);\n const connectedChain = useConnectedChain();\n\n const [approvalIsLoading, setApprovalIsLoading] = useState(false);\n\n const {\n isLoading: allowanceCheckIsLoading,\n isSuccess: allowanceCheckIsSuccess,\n data: allowance,\n } = useReadContract({\n abi: ERC20,\n address: connectedChain.gtcContractAddr,\n functionName: \"allowance\",\n chainId: connectedChain.id,\n args: [address, connectedChain.stakingContractAddr],\n });\n\n const {\n isLoading: stakeIsLoading,\n writeContract: stakeWriteContract,\n isConfirmed,\n blockNumber,\n } = useStakeTxHandler({\n queryKey,\n txTitle: \"Stake\",\n });\n\n const submitStakeTx = useCallback(\n (functionName: string, args: any[]) => {\n stakeWriteContract({\n address: connectedChain.stakingContractAddr,\n abi: IdentityStakingAbi,\n chainId: connectedChain.id,\n functionName,\n args,\n });\n },\n [stakeWriteContract, connectedChain]\n );\n\n const stake = useCallback(\n async ({\n functionName,\n functionArgs,\n requiredApprovalAmount,\n }: {\n functionName: string;\n functionArgs: any[];\n requiredApprovalAmount: bigint;\n }) => {\n const isSpendingApproved = allowanceCheckIsSuccess && (allowance as bigint) >= requiredApprovalAmount;\n\n if (!isSpendingApproved) {\n setApprovalIsLoading(true);\n let hash;\n try {\n hash = await writeContract(wagmiConfig, {\n address: connectedChain.gtcContractAddr,\n abi: ERC20,\n functionName: \"approve\",\n chainId: connectedChain.id as (typeof wagmiConfig)[\"chains\"][number][\"id\"],\n args: [connectedChain.stakingContractAddr, requiredApprovalAmount],\n });\n } catch (e) {\n setApprovalIsLoading(false);\n onTxError(\"Spending approval\", e, toast);\n }\n\n if (hash) {\n try {\n const { status } = await waitForTransactionReceipt(wagmiConfig, {\n hash,\n chainId: connectedChain.id as (typeof wagmiConfig)[\"chains\"][number][\"id\"],\n });\n if (status !== \"success\") {\n onTxReceiptError(\n \"Spending approval\",\n hash,\n new Error(\"Transaction failed\"),\n toast,\n connectedChain.explorer\n );\n }\n setApprovalIsLoading(false);\n // TODO: we should probably not continue if the approval fails\n submitStakeTx(functionName, functionArgs);\n } catch (e) {\n setApprovalIsLoading(false);\n onTxReceiptError(\"Spending approval\", hash, e, toast, connectedChain.explorer);\n }\n }\n } else {\n submitStakeTx(functionName, functionArgs);\n }\n },\n [\n submitStakeTx,\n allowanceCheckIsSuccess,\n allowance,\n connectedChain.explorer,\n connectedChain.gtcContractAddr,\n connectedChain.id,\n connectedChain.stakingContractAddr,\n toast,\n ]\n );\n\n const isLoading = allowanceCheckIsLoading || approvalIsLoading || stakeIsLoading;\n\n return useMemo(\n () => ({\n stake,\n isLoading,\n isConfirmed,\n approvalIsLoading,\n blockNumber,\n }),\n [blockNumber, stake, isLoading, isConfirmed, approvalIsLoading]\n );\n};\n","import { create } from \"zustand\";\n\ntype SelfStakeTxInfo = {\n blockNumber: bigint | undefined;\n timestamp: Date | undefined;\n};\n\n/**\n * The purpose of this store is to hold information about the self-stake transactions.\n * So that it can be queried when needed form other components as well.\n * \n * For now for each chain and connected address it will store a map like:\n * \n * chainId -> ( address -> SelfStakeTxInfo )\n */\nexport const useSelfStakeTxStore = create<{\n // map chainId -> ( address -> SelfStakeTxInfo )\n selfStakeTxInfoMap: Record>;\n updateSelfStakeTxInfo: (chainId: number, address: string, selfStakeTxInfo: Partial) => void;\n}>((set) => ({\n selfStakeTxInfoMap: {},\n updateSelfStakeTxInfo: (chainId: number, address: string, selfStakeTxInfo: Partial) =>\n set((state) => {\n const chainRecord = state.selfStakeTxInfoMap[chainId] || {};\n const addressRecord = chainRecord[address] || {};\n const newStakeTxInfo = {\n ...(addressRecord || {}),\n ...selfStakeTxInfo,\n };\n return {\n ...state,\n selfStakeTxInfoMap: { ...state.selfStakeTxInfoMap, [chainId]: { ...chainRecord, [address]: newStakeTxInfo } },\n };\n }),\n}));\n","import React, { useCallback, useEffect, useMemo } from \"react\";\nimport { StakeModal, DataLine } from \"./StakeModal\";\nimport { DisplayAddressOrENS, DisplayDuration, formatAmount, formatDate, getLockSeconds } from \"@/utils/helpers\";\nimport { StakeData } from \"@/utils/stakeHistory\";\nimport { parseEther } from \"viem\";\nimport { useStakeTxWithApprovalCheck } from \"@/hooks/hooks_staking/useStakeTxWithApprovalCheck\";\nimport { useSelfStakeTxStore } from \"@/hooks/hooks_staking/useSelfStakeTxStore\";\nimport { useChainId } from \"wagmi\";\n\nexport const useSelfStakeTx = ({ address }: { address: `0x${string}` }) => {\n const { blockNumber, stake, isLoading, isConfirmed, approvalIsLoading } = useStakeTxWithApprovalCheck({\n address,\n });\n const chainId = useChainId();\n const { updateSelfStakeTxInfo } = useSelfStakeTxStore();\n\n const selfStake = useCallback(\n ({ inputValue, lockedPeriodSeconds }: { inputValue: string; lockedPeriodSeconds: number }) => {\n const valueToStake = parseEther(inputValue);\n let functionName = \"extendSelfStake\";\n let functionArgs: any[] = [BigInt(lockedPeriodSeconds)];\n if (valueToStake > 0n) {\n functionName = \"selfStake\";\n functionArgs.unshift(valueToStake);\n }\n\n stake({\n functionName,\n functionArgs,\n requiredApprovalAmount: valueToStake,\n });\n },\n [stake]\n );\n\n useEffect(() => {\n if (blockNumber) {\n updateSelfStakeTxInfo(chainId, address, { blockNumber, timestamp: new Date() });\n }\n }, [chainId, address, blockNumber, updateSelfStakeTxInfo]);\n\n return {\n selfStake,\n isLoading,\n isConfirmed,\n approvalIsLoading,\n };\n};\n\nconst UpdateModalDataLine = ({\n label,\n children,\n emphasis,\n}: {\n label: string;\n children: React.ReactNode;\n emphasis?: boolean;\n}) => (\n
\n {label}\n
{children}
\n
\n);\n\nexport const UpdateStakeModalBody = ({\n address,\n inputValue,\n lockedPeriodSeconds,\n stakeToUpdate,\n}: {\n address: `0x${string}`;\n inputValue: string;\n lockedPeriodSeconds: number;\n stakeToUpdate: StakeData;\n}) => {\n const oldAmount = formatAmount(stakeToUpdate.amount);\n const newAmount = parseFloat(inputValue) >= 0 ? inputValue : \"0\";\n const total = formatAmount((parseEther(inputValue) + BigInt(stakeToUpdate.amount)).toString());\n\n const oldUnlockDate = new Date(stakeToUpdate.unlock_time);\n\n const newUnlockDate = new Date(Date.now() + lockedPeriodSeconds * 1000);\n\n return (\n
\n \n \n \n
\n {oldAmount} GTC\n
\n \n +{newAmount} GTC\n \n
\n \n {total} GTC\n \n
\n {formatDate(oldUnlockDate)}\n
\n \n \n \n
\n {formatDate(newUnlockDate)}\n
\n );\n};\n\nconst SelfStakeModalBody = ({\n address,\n inputValue,\n lockedPeriodMonths,\n lockedPeriodSeconds,\n stakeToUpdate,\n}: {\n address: `0x${string}`;\n inputValue: string;\n lockedPeriodMonths: number;\n lockedPeriodSeconds: number;\n stakeToUpdate?: StakeData;\n}) => {\n if (stakeToUpdate) {\n return (\n \n );\n }\n return (\n
\n } />\n
\n \n
\n {lockedPeriodMonths} months
} />\n \n );\n};\n\nexport const SelfStakeModal = ({\n address,\n inputValue,\n lockedPeriodMonths,\n stakeToUpdate,\n isOpen,\n onClose,\n}: {\n address: `0x${string}`;\n inputValue: string;\n lockedPeriodMonths: number;\n isOpen: boolean;\n onClose: () => void;\n stakeToUpdate?: StakeData;\n}) => {\n const lockedPeriodSeconds = useMemo(() => getLockSeconds(new Date(), lockedPeriodMonths), [lockedPeriodMonths]);\n\n const { selfStake, isLoading, isConfirmed, approvalIsLoading } = useSelfStakeTx({\n address,\n });\n\n useEffect(() => {\n if (isConfirmed) {\n onClose();\n }\n }, [isConfirmed, onClose]);\n\n return (\n selfStake({ inputValue, lockedPeriodSeconds })}\n buttonLoading={isLoading}\n isOpen={isOpen}\n onClose={onClose}\n >\n \n \n );\n};\n","import React, { ButtonHTMLAttributes, ChangeEvent, useEffect, useMemo, useRef } from \"react\";\nimport { PanelDiv } from \"./PanelDiv\";\nimport { getUnlockTime } from \"@/utils/helpers\";\nimport { FormButton } from \"../Button\";\n\nexport const PresetAmountsSelection = ({\n amount,\n handleAmountChange,\n disabled,\n includePlusAmountPrefix,\n}: {\n amount: string;\n handleAmountChange: (value: string) => void;\n disabled?: boolean;\n includePlusAmountPrefix?: boolean;\n}) => {\n return [\"5\", \"20\", \"125\"].map((presetAmount) => (\n handleAmountChange(presetAmount)}\n className=\"w-14\"\n variant={presetAmount === amount ? \"active\" : \"inactive\"}\n disabled={disabled}\n >\n {includePlusAmountPrefix && \"+\"}\n {presetAmount}\n \n ));\n};\n\nexport const PresetMonthsSelection = ({\n lockedMonths,\n handleLockedMonthsChange,\n disabled,\n onlyAllowStakeAfterTime,\n}: {\n lockedMonths: number;\n handleLockedMonthsChange: (value: number) => void;\n disabled?: boolean;\n onlyAllowStakeAfterTime?: Date;\n}) => {\n return [3, 6, 12].map((presetMonths) => (\n handleLockedMonthsChange(presetMonths)}\n className={`text-sm w-full ${lockedMonths === presetMonths ? \"font-bold\" : \"\"}`}\n variant={lockedMonths === presetMonths ? \"active\" : \"inactive\"}\n disabled={\n disabled ||\n (onlyAllowStakeAfterTime &&\n getUnlockTime(new Date(), presetMonths).getTime() < onlyAllowStakeAfterTime.getTime())\n }\n >\n {presetMonths} months\n \n ));\n};\n\nexport const StakeAmountInput = ({\n amount,\n onChange,\n disabled,\n includePlusAmountPrefix,\n autoFocus,\n className,\n}: {\n amount: string;\n onChange: (event: ChangeEvent) => void;\n disabled?: boolean;\n includePlusAmountPrefix?: boolean;\n autoFocus?: boolean;\n className?: string;\n}) => (\n
\n \n {includePlusAmountPrefix && (\n
\n +\n
\n )}\n
\n);\n\nexport const StakeFormInputSection = ({\n amount,\n lockedMonths,\n handleAmountChange,\n handleLockedMonthsChange,\n className,\n isLoading,\n includePlusAmountPrefix,\n onlyAllowStakeAfterTime,\n autoFocus,\n}: {\n amount: string;\n lockedMonths: number;\n handleAmountChange: (value: string) => void;\n handleLockedMonthsChange: (value: number) => void;\n className?: string;\n isLoading?: boolean;\n includePlusAmountPrefix?: boolean;\n onlyAllowStakeAfterTime?: Date;\n autoFocus?: boolean;\n}) => {\n const ref = useRef(null);\n\n useEffect(() => {\n if (autoFocus) {\n ref.current?.scrollIntoView({ behavior: \"smooth\", block: \"center\" });\n }\n }, [autoFocus]);\n\n return (\n \n
Amount
\n handleAmountChange(event.target.value)}\n disabled={isLoading}\n includePlusAmountPrefix={includePlusAmountPrefix}\n autoFocus={autoFocus}\n />\n \n
\n Lockup\n
\n period\n
\n
\n \n
\n \n );\n};\n","import React, { useState, useEffect, useCallback, useMemo } from \"react\";\nimport { Button } from \"@/components/Button\";\nimport { StakeData, useYourStakeHistoryQuery } from \"@/utils/stakeHistory\";\nimport { SelfStakeModal } from \"./SelfStakeModal\";\nimport { StakeFormInputSection } from \"./StakeFormInputSection\";\nimport { useAccount } from \"wagmi\";\n\nconst TWELVE_MONTHS_IN_SECONDS = 12 * 30 * 24 * 60 * 60;\nconst SIX_MONTHS_IN_SECONDS = 6 * 30 * 24 * 60 * 60;\n\nexport const useInitializeStakeForm = ({\n stake,\n setLockedPeriodMonths,\n setPreviousUnlockTime,\n}: {\n stake: StakeData | undefined;\n setLockedPeriodMonths: React.Dispatch>;\n setPreviousUnlockTime: React.Dispatch>;\n}) => {\n useEffect(() => {\n if (stake && BigInt(stake.amount) > 0n) {\n const unlockTime = new Date(stake.unlock_time);\n const lockTime = new Date(stake.lock_time);\n const unlockPeriodSeconds = Math.floor((unlockTime.getTime() - lockTime.getTime()) / 1000);\n\n if (unlockPeriodSeconds >= TWELVE_MONTHS_IN_SECONDS) {\n setLockedPeriodMonths(12);\n } else if (unlockPeriodSeconds >= SIX_MONTHS_IN_SECONDS) {\n setLockedPeriodMonths(6);\n } else {\n setLockedPeriodMonths(3);\n }\n setPreviousUnlockTime(unlockTime);\n } else {\n setPreviousUnlockTime(undefined);\n }\n }, [stake, setLockedPeriodMonths, setPreviousUnlockTime]);\n};\n\nexport const YourStakeForm: React.FC = ({}) => {\n const { address } = useAccount();\n const { data, isLoading } = useYourStakeHistoryQuery(address);\n const stake = useMemo(() => data?.[0], [data]);\n const [previousUnlockTime, setPreviousUnlockTime] = useState();\n const isUpdate = previousUnlockTime !== undefined;\n\n const [inputValue, setInputValue] = useState(\"\");\n const [lockedPeriodMonths, setLockedPeriodMonths] = useState(3);\n const [modalIsOpen, setModalIsOpen] = useState(false);\n\n useInitializeStakeForm({ stake, setLockedPeriodMonths, setPreviousUnlockTime });\n\n const onClose = useCallback(() => {\n setModalIsOpen(false);\n }, []);\n\n const selfStakeModal = address ? (\n \n ) : null;\n\n return (\n
\n \n {selfStakeModal}\n setModalIsOpen(true)}\n disabled={isLoading || !(isUpdate || (inputValue && parseFloat(inputValue) > 0))}\n >\n {isUpdate && \"Update \"}Stake\n \n
\n );\n};\n","import React from \"react\";\n\nexport const DropDownIcon = ({\n isOpen,\n className,\n width,\n height,\n}: {\n isOpen: boolean;\n className?: string;\n width?: string;\n height?: string;\n}) => (\n
\n \n \n \n
\n);\n","import React, { useEffect, useState } from \"react\";\nimport { Disclosure } from \"@headlessui/react\";\nimport { formatAmount } from \"@/utils/helpers\";\nimport { DropDownIcon } from \"./DropDownIcon\";\n\nexport const StakeSection = ({\n children,\n icon,\n heading,\n subheading,\n last,\n amount,\n initialOpen,\n}: {\n children: React.ReactNode;\n heading: string;\n subheading: string;\n icon: {\n src: string;\n alt: string;\n height?: string;\n };\n last?: boolean;\n initialOpen?: boolean;\n amount: string;\n}) => {\n const [dropDownOpen, setDropDownOpen] = useState(false);\n const openRef = React.useRef(dropDownOpen);\n openRef.current = dropDownOpen;\n\n // Unmounting the panel on a delay to allow the animation to complete\n const [panelMounted, setPanelMounted] = useState(false);\n\n useEffect(() => {\n if (initialOpen) {\n handleOpen();\n }\n }, [initialOpen]);\n\n const handleOpen = () => {\n setPanelMounted(true);\n };\n\n useEffect(() => {\n // Causes this to open one render after mounting, so animation can play\n setDropDownOpen(panelMounted);\n }, [panelMounted]);\n\n const handleClose = () => {\n setDropDownOpen(false);\n setTimeout(() => {\n // Only unmount the panel if it's still closed\n // Need to use ref to access runtime state here\n const isOpen = openRef.current;\n if (!isOpen) setPanelMounted(false);\n }, 150);\n };\n\n const handleClick = () => {\n if (dropDownOpen) handleClose();\n else handleOpen();\n };\n\n return (\n
\n \n \n
\n {icon.alt}\n
\n
\n
\n {heading}\n
\n \n
\n
\n
{formatAmount(amount)} GTC
\n
Staked
\n
\n \n \n {panelMounted && (\n \n {children}\n {last ||
}\n \n )}\n
\n
\n );\n};\n","import { useReadContracts } from \"wagmi\";\nimport LegacyStakingAbi from \"../abi/LegacyIdentityStaking.json\";\nimport { LegacyRoundMeta, StakeData } from \"@/utils/stakeHistory\";\nimport { useQueries } from \"@tanstack/react-query\";\nimport axios from \"axios\";\nimport { ChainConfig } from \"@/utils/chains\";\nimport { AbiFunction } from \"viem\";\nimport { useMemo } from \"react\";\n\n// Default to 6, but provide a way to override it\nconst MAX_ROUND_ID = process.env.NEXT_PUBLIC_MAX_LEGACY_ROUND_ID\n ? parseInt(process.env.NEXT_PUBLIC_MAX_LEGACY_ROUND_ID)\n : 6;\n\nconst roundIds = Array.from({ length: MAX_ROUND_ID }, (_, i) => i + 1);\n\ntype LegacyStakeQuery = {\n data: StakeData[];\n isLoading: boolean;\n isPending: boolean;\n isError: boolean;\n error?: any;\n};\n\nconst useRoundMetadata = (\n chain: ChainConfig | undefined\n): {\n data: Record;\n isPending: boolean;\n isLoading: boolean;\n} => {\n const { data, isPending, isLoading } = useReadContracts({\n query: {\n staleTime: Infinity,\n },\n contracts:\n chain && chain.legacyContractAddr\n ? // Calls to get the metadata for rounds\n roundIds.map((roundId) => ({\n address: chain.legacyContractAddr,\n abi: LegacyStakingAbi as AbiFunction[],\n functionName: \"fetchRoundMeta\",\n chainId: chain.id,\n args: [roundId],\n }))\n : [],\n });\n\n const processedData = useMemo(\n () =>\n data\n ? data.reduce((allRoundsMetadata, d, index) => {\n const result: any[] | undefined = d.result as any[];\n if (result && result.length > 0) {\n allRoundsMetadata[roundIds[index]] = {\n lock_time: new Date(Number(result[0]) * 1000).toISOString(),\n unlock_time: new Date(Number(result[0] + result[1]) * 1000).toISOString(),\n name: result[3],\n round_id: roundIds[index],\n };\n } else {\n allRoundsMetadata[roundIds[index]] = {\n lock_time: new Date(0).toISOString(),\n unlock_time: new Date(0).toISOString(),\n name: \"\",\n round_id: 0,\n };\n }\n return allRoundsMetadata;\n }, {} as Record)\n : {},\n [data]\n );\n\n return {\n data: processedData,\n isPending: Boolean(chain?.legacyContractAddr) && isPending,\n isLoading: Boolean(chain?.legacyContractAddr) && isLoading,\n };\n};\n\nconst useLegacySelfStakeQuery = (address: `0x${string}` | undefined, chain: ChainConfig | undefined) => {\n return useReadContracts({\n query: {\n staleTime: Infinity,\n },\n contracts:\n chain && chain.legacyContractAddr\n ? roundIds.map((roundId) => ({\n address: chain.legacyContractAddr,\n abi: LegacyStakingAbi as AbiFunction[],\n functionName: \"getUserStakeForRound\",\n args: [roundId, address],\n }))\n : [],\n });\n};\n\n// This is the only reliable way to get the query key for this query\nexport const useLegacySelfStakeQueryKey = (address: `0x${string}` | undefined, chain: ChainConfig | undefined) => {\n const query = useLegacySelfStakeQuery(address, chain);\n const queryKeyStringified = JSON.stringify(query.queryKey);\n return useMemo(() => {\n return query.queryKey;\n // The queryKey isn't properly memoized, so we use the stringified version\n // as our memo dependency\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [queryKeyStringified]);\n};\n\nexport const useLegacySelfStake = (address: `0x${string}` | undefined, chain: ChainConfig): LegacyStakeQuery => {\n const {\n data: roundMeta,\n isPending: roundMetadataIsPending,\n isLoading: roundMetadataIsLoading,\n } = useRoundMetadata(chain);\n\n const { data, isPending, isLoading, ...rest } = useReadContracts({\n query: {\n staleTime: Infinity,\n },\n contracts:\n chain && chain.legacyContractAddr\n ? roundIds.map((roundId) => ({\n address: chain.legacyContractAddr,\n abi: LegacyStakingAbi as AbiFunction[],\n functionName: \"getUserStakeForRound\",\n args: [roundId, address],\n }))\n : [],\n });\n\n const legacyData: StakeData[] =\n chain && chain.legacyContractAddr && address && data\n ? data.reduce((acc: StakeData[], d, index) => {\n const amount = d.result as bigint;\n const round = roundMeta[roundIds[index]];\n if (d.status === \"success\" && amount > 0)\n acc.push({\n legacy: {\n type: \"v1Single\",\n round,\n },\n chain: chain.id,\n staker: address,\n stakee: address,\n amount: amount.toString(),\n unlock_time: round?.unlock_time || \"\",\n lock_time: round?.lock_time || \"\",\n last_updated_in_block: BigInt(0),\n });\n return acc;\n }, [])\n : [];\n\n return {\n data: legacyData,\n isPending: Boolean(chain?.legacyContractAddr) && (isPending || roundMetadataIsPending),\n isLoading: Boolean(chain?.legacyContractAddr) && (isLoading || roundMetadataIsLoading),\n ...rest,\n };\n};\n\ntype V1GtcStake = {\n id: number;\n event_type: \"SelfStake\" | \"Xstake\";\n round_id: number;\n staker: `0x${string}`;\n address: `0x${string}`;\n amount: string;\n staked: boolean;\n block_number: number;\n tx_hash: `0x${string}`;\n};\n\nexport const LEGACY_COMMUNITY_STAKE_BASE_KEY = \"v1_gtc_stakes\";\n\nexport const useLegacyCommunityStakes = (\n address: `0x${string}` | undefined,\n chain: ChainConfig | undefined\n): LegacyStakeQuery => {\n let data: StakeData[] = [];\n let error: any = undefined;\n let isLoading = false;\n let isPending = false;\n let isError = false;\n\n const {\n data: roundMeta,\n isPending: roundMetadataIsPending,\n isLoading: roundMetadataIsLoading,\n } = useRoundMetadata(chain);\n\n const v1GtcStakeQueries = useQueries({\n queries:\n chain && chain.legacyContractAddr && address\n ? roundIds.map((roundId) => {\n return {\n staleTime: Infinity,\n queryKey: [LEGACY_COMMUNITY_STAKE_BASE_KEY, address, roundId],\n queryFn: async (): Promise => {\n const response = await axios.get(`${process.env.NEXT_PUBLIC_GET_GTC_STAKE_API}${address}/${roundId}`);\n return response.data?.results as V1GtcStake[];\n },\n };\n })\n : [],\n });\n\n if (chain && chain.legacyContractAddr && address) {\n isLoading = roundMetadataIsLoading || v1GtcStakeQueries.some((q) => q.isLoading);\n isPending = roundMetadataIsPending || v1GtcStakeQueries.some((q) => q.isPending);\n isError = v1GtcStakeQueries.some((q) => q.isError);\n\n if (isError) {\n error = v1GtcStakeQueries.find((q) => q.isError)?.error;\n } else if (!isPending) {\n data = v1GtcStakeQueries.reduce((acc: StakeData[], query, index) => {\n const data = query.data;\n if (data) {\n const unstakedCommunityStakes = data.reduce((acc, stake: V1GtcStake) => {\n if (stake.event_type === \"Xstake\" && stake.address.toLowerCase() !== address.toLowerCase()) {\n if (acc[stake.address] === undefined) {\n acc[stake.address] = BigInt(0);\n }\n if (stake.staked) {\n acc[stake.address] += BigInt(stake.amount.replace(\".\", \"\"));\n } else {\n acc[stake.address] -= BigInt(stake.amount.replace(\".\", \"\"));\n }\n\n if (acc[stake.address] === 0n) {\n delete acc[stake.address];\n }\n }\n return acc;\n }, {} as Record<`0x${string}`, bigint>);\n\n const unstakedCommunityStakesAsList = Object.values(unstakedCommunityStakes);\n\n const totalAmountForRound = unstakedCommunityStakesAsList.reduce((acc, cs) => {\n acc += cs;\n return acc;\n }, 0n);\n\n const round = roundMeta[roundIds[index]];\n if (round && totalAmountForRound && unstakedCommunityStakesAsList.length > 0) {\n acc.push({\n legacy: {\n type: \"v1Community\",\n stakees: Object.keys(unstakedCommunityStakes) as `0x${string}`[],\n amounts: unstakedCommunityStakesAsList.map((a) => a.toString()),\n round,\n },\n chain: chain.id,\n amount: totalAmountForRound.toString(),\n lock_time: round.lock_time,\n unlock_time: round.unlock_time,\n staker: address || \"0x\",\n stakee: \"0x\",\n last_updated_in_block: BigInt(0),\n });\n }\n }\n return acc;\n }, []);\n }\n }\n\n return { data, isLoading, isPending, isError, error };\n};\n","import React, { useCallback, useEffect, useMemo } from \"react\";\nimport IdentityStakingAbi from \"../../abi/IdentityStaking.json\";\nimport { useStakeHistoryQueryKey } from \"@/utils/stakeHistory\";\nimport { DisplayAddressOrENS, DisplayDuration, formatAmount, useConnectedChain } from \"@/utils/helpers\";\nimport { StakeModal, DataLine } from \"./StakeModal\";\nimport { useStakeTxHandler } from \"@/hooks/hooks_staking/useStakeTxHandler\";\n\nconst useExtendSelfStake = ({ address }: { address: string }) => {\n const chain = useConnectedChain();\n const queryKey = useStakeHistoryQueryKey(address);\n const { isLoading, writeContract, isConfirmed } = useStakeTxHandler({ queryKey, txTitle: \"Restake\" });\n\n const extendSelfStake = useCallback(\n async (lockSeconds: number) => {\n writeContract({\n address: chain.stakingContractAddr,\n abi: IdentityStakingAbi,\n functionName: \"extendSelfStake\",\n args: [BigInt(lockSeconds)],\n });\n },\n [writeContract, chain.stakingContractAddr]\n );\n\n return useMemo(\n () => ({\n isLoading,\n extendSelfStake,\n isConfirmed,\n }),\n [isLoading, extendSelfStake, isConfirmed]\n );\n};\n\nexport const SelfRestakeModal = ({\n address,\n amount,\n lockSeconds,\n isOpen,\n onClose,\n}: {\n address: string;\n amount: string;\n lockSeconds: number;\n isOpen: boolean;\n onClose: () => void;\n}) => {\n const { isLoading, extendSelfStake, isConfirmed } = useExtendSelfStake({ address });\n\n useEffect(() => {\n if (isConfirmed) {\n onClose();\n }\n }, [isConfirmed, onClose]);\n\n return (\n extendSelfStake(lockSeconds)}\n buttonLoading={isLoading}\n isOpen={isOpen}\n onClose={onClose}\n >\n
\n } />\n
\n \n
\n } />\n
\n \n );\n};\n","import React, { useCallback, useEffect, useMemo } from \"react\";\nimport IdentityStakingAbi from \"../../abi/IdentityStaking.json\";\nimport LegacyIdentityStaking from \"../../abi/LegacyIdentityStaking.json\";\nimport { useStakeHistoryQueryKey } from \"@/utils/stakeHistory\";\nimport { DisplayAddressOrENS, formatAmount, useConnectedChain } from \"@/utils/helpers\";\nimport { StakeModal, DataLine } from \"./StakeModal\";\nimport { useStakeTxHandler } from \"@/hooks/hooks_staking/useStakeTxHandler\";\nimport { useLegacySelfStakeQueryKey } from \"@/hooks/legacyStaking\";\n\nconst useWithdrawSelfStake = ({ address }: { address: string }) => {\n const chain = useConnectedChain();\n const queryKey = useStakeHistoryQueryKey(address);\n const { isLoading, writeContract, isConfirmed } = useStakeTxHandler({ queryKey, txTitle: \"Unstake\" });\n\n const withdrawSelfStake = useCallback(\n async (amount: string) => {\n writeContract({\n address: chain.stakingContractAddr,\n abi: IdentityStakingAbi,\n functionName: \"withdrawSelfStake\",\n args: [BigInt(amount)],\n });\n },\n [writeContract, chain.stakingContractAddr]\n );\n\n return useMemo(\n () => ({\n isLoading,\n withdrawSelfStake,\n isConfirmed,\n }),\n [isLoading, withdrawSelfStake, isConfirmed]\n );\n};\n\nexport const SelfUnstakeModal = ({\n address,\n amount,\n isOpen,\n onClose,\n}: {\n address: string;\n amount: string;\n isOpen: boolean;\n onClose: () => void;\n}) => {\n const { isLoading, withdrawSelfStake, isConfirmed } = useWithdrawSelfStake({ address });\n\n useEffect(() => {\n if (isConfirmed) {\n onClose();\n }\n }, [isConfirmed, onClose]);\n\n return (\n withdrawSelfStake(amount)}\n buttonLoading={isLoading}\n isOpen={isOpen}\n onClose={onClose}\n >\n
\n } />\n
\n \n
\n \n );\n};\n\nconst useWithdrawLegacySelfStake = ({ address, roundId }: { address: string; roundId: number }) => {\n const chain = useConnectedChain();\n const queryKey = useLegacySelfStakeQueryKey(address as `0x{string}`, chain);\n\n const { isLoading, writeContract, isConfirmed } = useStakeTxHandler({ queryKey, txTitle: \"Unstake\" });\n\n const withdrawSelfStake = useCallback(\n async (amount: string) => {\n if (chain.legacyContractAddr) {\n writeContract({\n address: chain.legacyContractAddr,\n abi: LegacyIdentityStaking,\n functionName: \"unstake\",\n args: [roundId, BigInt(amount)],\n });\n } else {\n console.error(\"Legacy contract address not found (this is probably a misconfiguration)\");\n }\n },\n [writeContract, chain.legacyContractAddr, roundId]\n );\n\n return useMemo(\n () => ({\n isLoading,\n withdrawSelfStake,\n isConfirmed,\n }),\n [isLoading, withdrawSelfStake, isConfirmed]\n );\n};\n\nexport const LegacySelfUnstakeModal = ({\n address,\n amount,\n isOpen,\n onClose,\n roundId,\n}: {\n address: string;\n amount: string;\n isOpen: boolean;\n onClose: () => void;\n roundId: number;\n}) => {\n const { isLoading, withdrawSelfStake, isConfirmed } = useWithdrawLegacySelfStake({ address, roundId });\n\n useEffect(() => {\n if (isConfirmed) {\n onClose();\n }\n }, [isConfirmed, onClose]);\n\n return (\n withdrawSelfStake(amount)}\n buttonLoading={isLoading}\n isOpen={isOpen}\n onClose={onClose}\n >\n
\n } />\n
\n \n
\n \n );\n};\n","import React, { ComponentPropsWithRef, useCallback, useEffect, useState } from \"react\";\nimport { PanelDiv } from \"./PanelDiv\";\nimport { useLegacySelfStake } from \"@/hooks/legacyStaking\";\nimport { SelfRestakeModal } from \"./SelfRestakeModal\";\nimport { useSelfStakeTxStore } from \"@/hooks/hooks_staking/useSelfStakeTxStore\";\nimport { DisplayAddressOrENS, DisplayDuration, formatAmount, useConnectedChain, formatDate } from \"@/utils/helpers\";\n\nimport { StakeData, useYourStakeHistoryQuery } from \"@/utils/stakeHistory\";\nimport { SelfUnstakeModal, LegacySelfUnstakeModal } from \"./SelfUnstakeModal\";\nimport { useAccount, useChainId } from \"wagmi\";\n\nconst Th = ({ className, ...props }: ComponentPropsWithRef<\"th\">) => (\n \n);\n\nconst Td = ({ className, ...props }: ComponentPropsWithRef<\"td\">) => (\n \n);\n\nconst SelfRestakeButton = ({\n lockSeconds,\n address,\n amount,\n disabled,\n}: {\n lockSeconds: number;\n address: string;\n amount: string;\n disabled: boolean;\n}) => {\n const [modalIsOpen, setModalIsOpen] = useState(false);\n const onClose = useCallback(() => setModalIsOpen(false), []);\n\n return (\n <>\n \n setModalIsOpen(true)}\n disabled={disabled}\n className=\"disabled:text-color-5 disabled:cursor-not-allowed\"\n >\n Restake\n \n \n );\n};\n\nconst SelfUnstakeButton = ({ address, unlocked, stake }: { address: string; unlocked: boolean; stake: StakeData }) => {\n const [modalIsOpen, setModalIsOpen] = useState(false);\n const onClose = useCallback(() => setModalIsOpen(false), []);\n const modal = stake.legacy?.round?.round_id ? (\n \n ) : (\n \n );\n\n return (\n <>\n {modal}\n\n setModalIsOpen(true)}\n disabled={!unlocked}\n className=\"disabled:text-color-5 disabled:cursor-not-allowed\"\n >\n Unstake\n \n \n );\n};\n\n// Combines current and legacy self stakes\nexport const useSelfStakes = () => {\n const { address } = useAccount();\n const chain = useConnectedChain();\n\n const { isPending, isError, data, error, isLoading } = useYourStakeHistoryQuery(address);\n const {\n data: legacyData,\n isPending: legacyIsPending,\n isLoading: legacyIsLoading,\n isError: legacyIsError,\n error: legacyError,\n } = useLegacySelfStake(address, chain);\n\n const aggregatedData = (data || []).concat(legacyData);\n\n return {\n data: aggregatedData,\n isLoading: isLoading || legacyIsLoading,\n isPending: isPending || legacyIsPending,\n isError: isError || legacyIsError,\n error: error || legacyError,\n };\n};\n\nconst Tbody = () => {\n const { address } = useAccount();\n const chainId = useChainId();\n const { isPending, isError, data, error } = useSelfStakes();\n const { selfStakeTxInfoMap } = useSelfStakeTxStore();\n const stakeTxInfo = address ? selfStakeTxInfoMap[chainId]?.[address] : null;\n const blockNumber = stakeTxInfo?.blockNumber;\n\n // Verify that the expected block has been indexed already\n const hasBlockBeenIndexed = blockNumber ? data?.some((stake) => stake.last_updated_in_block >= blockNumber) : true;\n\n useEffect(() => {\n isError && console.error(\"Error getting StakeHistory:\", error);\n }, [error, isError]);\n\n let tbody_contents;\n if (!isPending && !isError && address && data && data.length > 0 && hasBlockBeenIndexed) {\n tbody_contents = (\n <>\n {data.map((stake, index) => (\n \n ))}\n \n );\n } else {\n const status = isError\n ? \"Error loading stakes\"\n : isPending || !hasBlockBeenIndexed\n ? \"Loading...\"\n : \"No stakes found\";\n tbody_contents = (\n <>\n \n \n {status}\n \n \n \n );\n }\n return {tbody_contents};\n};\n\nconst StakeLine = ({ stake, address }: { stake: StakeData; address: string }) => {\n const unlockTime = new Date(stake.unlock_time);\n const unlockTimeStr = formatDate(unlockTime);\n\n const lockTime = new Date(stake.lock_time);\n const lockTimeStr = formatDate(lockTime);\n\n const lockSeconds = Math.floor((unlockTime.getTime() - lockTime.getTime()) / 1000);\n\n const unlocked = unlockTime < new Date();\n\n const amount = formatAmount(stake.amount);\n\n return (\n \n {stake.legacy ? stake.legacy.round?.name : }\n {amount} GTC\n {unlocked ? \"Unlocked\" : \"Locked\"}\n \n \n \n \n {lockTimeStr}\n
\n {unlockTimeStr}\n \n \n \n
\n \n \n \n );\n};\n\nexport const YourStakeHistory = ({}: any) => {\n return (\n \n
Your Stake
\n \n \n \n \n \n \n \n \n \n \n \n \n
AddressAmountStatusLockupStart/End
\n
\n );\n};\n","import React, { useMemo } from \"react\";\nimport { YourStakeForm } from \"./YourStakeForm\";\nimport { StakeSection } from \"./StakeSection\";\nimport { useSelfStakes } from \"./YourStakeHistory\";\nimport { YourStakeHistory } from \"./YourStakeHistory\";\nimport { useAccount, useChainId } from \"wagmi\";\n\nexport const YourStake = () => {\n const { address } = useAccount();\n const chainId = useChainId();\n const { data } = useSelfStakes();\n\n const stakedAmount = useMemo(\n () =>\n data\n ? data.reduce((acc, stake) => {\n if (\n stake.staker.toLowerCase() === address?.toLowerCase() &&\n stake.stakee.toLowerCase() === address.toLowerCase() &&\n stake.chain === chainId\n ) {\n acc += BigInt(stake.amount);\n }\n return acc;\n }, 0n)\n : 0n,\n [data, address, chainId]\n );\n\n return (\n \n \n \n \n );\n};\n","import React, { useState, useCallback, useMemo, ChangeEvent, useEffect, ComponentPropsWithRef } from \"react\";\nimport { DisplayAddressOrENS, formatAmount, getLockSeconds } from \"@/utils/helpers\";\nimport { StakeModal } from \"./StakeModal\";\nimport { parseEther } from \"viem\";\nimport { StakeData } from \"@/utils/stakeHistory\";\nimport { PresetAmountsSelection, PresetMonthsSelection, StakeAmountInput } from \"./StakeFormInputSection\";\nimport { useInitializeStakeForm } from \"./YourStakeForm\";\nimport { useStakeTxWithApprovalCheck } from \"@/hooks/hooks_staking/useStakeTxWithApprovalCheck\";\nimport { UpdateStakeModalBody } from \"./SelfStakeModal\";\n\nconst useExtendCommunityStake = ({ staker }: { staker: `0x${string}` }) => {\n const { stake, isLoading, isConfirmed, approvalIsLoading } = useStakeTxWithApprovalCheck({\n address: staker,\n });\n\n const extendCommunityStake = useCallback(\n async (communityAddress: string, stakeValue: bigint, lockSeconds: number) => {\n let functionName: string;\n let functionArgs: any[];\n if (stakeValue > 0n) {\n functionName = \"communityStake\";\n functionArgs = [communityAddress, stakeValue, BigInt(lockSeconds)];\n } else {\n functionName = \"extendCommunityStake\";\n functionArgs = [communityAddress, BigInt(lockSeconds)];\n }\n stake({ functionName, functionArgs, requiredApprovalAmount: stakeValue });\n },\n [stake]\n );\n\n return useMemo(\n () => ({\n isLoading,\n extendCommunityStake,\n isConfirmed,\n }),\n [isLoading, extendCommunityStake, isConfirmed]\n );\n};\n\nconst CommunityUpdateModal = ({\n stakeToUpdate,\n amount,\n lockedPeriodMonths,\n isOpen,\n onClose,\n}: {\n stakeToUpdate: StakeData;\n amount: string;\n lockedPeriodMonths: number;\n isOpen: boolean;\n onClose: () => void;\n}) => {\n const lockedPeriodSeconds = useMemo(() => getLockSeconds(new Date(), lockedPeriodMonths), [lockedPeriodMonths]);\n const { isLoading, extendCommunityStake, isConfirmed } = useExtendCommunityStake({ staker: stakeToUpdate.staker });\n const stakeValue = parseEther(amount);\n\n useEffect(() => {\n if (isConfirmed) {\n onClose();\n }\n }, [isConfirmed, onClose]);\n\n return (\n extendCommunityStake(stakeToUpdate.stakee, stakeValue, lockedPeriodSeconds)}\n buttonLoading={isLoading}\n isOpen={isOpen}\n onClose={onClose}\n >\n \n \n );\n};\n\nconst CommunityUpdateModalPreview = ({\n stake,\n amount,\n setAmount,\n lockedPeriodMonths,\n setLockedPeriodMonths,\n isOpen,\n onClose,\n onContinue,\n}: {\n stake: StakeData;\n amount: string;\n setAmount: React.Dispatch>;\n lockedPeriodMonths: number;\n setLockedPeriodMonths: React.Dispatch>;\n isOpen: boolean;\n onClose: () => void;\n onContinue: () => void;\n}) => {\n const [previousUnlockTime, setPreviousUnlockTime] = useState();\n\n useInitializeStakeForm({ stake, setLockedPeriodMonths, setPreviousUnlockTime });\n\n const handleInputChange = (event: ChangeEvent) => {\n setAmount(event.target.value);\n };\n\n return (\n \n
\n
Address
\n \n
\n Amount\n
\n Current Amount\n
\n {formatAmount(stake.amount)}\n
\n
\n
\n \n\n
\n \n
\n\n
Lockup period
\n
\n \n
\n
\n \n );\n};\n\nexport const CommunityUpdateButton = ({\n stake,\n isOpenInitial,\n onClose,\n}: {\n stake: StakeData;\n isOpenInitial: boolean;\n onClose: () => void;\n}) => {\n const [previewModalIsOpen, setPreviewModalIsOpen] = useState(isOpenInitial);\n const [transactionModalIsOpen, setTransactionModalIsOpen] = useState(false);\n const [amount, setAmount] = useState(\"\");\n const [lockedPeriodMonths, setLockedPeriodMonths] = useState(3);\n\n useEffect(() => {\n if (isOpenInitial) {\n setPreviewModalIsOpen(true);\n }\n }, [isOpenInitial]);\n\n const onClosePreviewModal = useCallback(() => {\n setPreviewModalIsOpen(false);\n onClose();\n }, [onClose]);\n\n const onCloseTransactionModal = useCallback(() => {\n setTransactionModalIsOpen(false);\n onClose();\n }, [onClose]);\n\n const onContinue = useCallback(() => {\n setPreviewModalIsOpen(false);\n setTransactionModalIsOpen(true);\n }, []);\n\n return (\n <>\n \n \n\n setPreviewModalIsOpen(true)}\n disabled={Boolean(stake.legacy)}\n className=\"text-color-6 font-bold disabled:text-color-5 disabled:cursor-not-allowed\"\n >\n Update stake\n \n \n );\n};\n","import React, { ComponentPropsWithRef, Fragment, useCallback, useEffect, useMemo } from \"react\";\nimport IdentityStakingAbi from \"../../abi/IdentityStaking.json\";\nimport { useStakeHistoryQueryKey } from \"@/utils/stakeHistory\";\nimport { DisplayAddressOrENS, DisplayDuration, formatAmount, useConnectedChain } from \"@/utils/helpers\";\nimport { useStakeTxHandler } from \"@/hooks/hooks_staking/useStakeTxHandler\";\nimport { Dialog, Transition } from \"@headlessui/react\";\nimport { BackdropEnabler } from \"./Backdrop\";\nimport { PanelDiv } from \"./PanelDiv\";\nimport { LoadButton } from \"../LoadButton\";\nimport { Button } from \"@chakra-ui/react\";\nimport { StakeData } from \"@/utils/stakeHistory\";\n\nconst useExtendCommunityStake = ({ address }: { address: string }) => {\n const chain = useConnectedChain();\n const queryKey = useStakeHistoryQueryKey(address);\n const { isLoading, writeContract, isConfirmed } = useStakeTxHandler({ queryKey, txTitle: \"Restake\" });\n\n const extendCommunityStake = useCallback(\n async (stakedData: StakeData[]) => {\n if (stakedData.length == 1) {\n const unlockTime = new Date(stakedData[0].unlock_time);\n const lockTime = new Date(stakedData[0].lock_time);\n\n const lockSeconds = Math.floor((unlockTime.getTime() - lockTime.getTime()) / 1000);\n\n return writeContract({\n address: chain.stakingContractAddr,\n abi: IdentityStakingAbi,\n functionName: \"extendCommunityStake\",\n args: [stakedData[0].stakee, BigInt(lockSeconds)],\n });\n } else {\n const stakeeList = stakedData.map((stake) => stake.stakee);\n const lockedList = stakedData.map((stake) => {\n const unlockTime = new Date(stake.unlock_time);\n const lockTime = new Date(stake.lock_time);\n\n const lockSeconds = Math.floor((unlockTime.getTime() - lockTime.getTime()) / 1000);\n return lockSeconds;\n });\n\n return writeContract({\n address: chain.stakingContractAddr,\n abi: IdentityStakingAbi,\n functionName: \"extendMultipleCommunityStake\",\n args: [stakeeList, lockedList],\n });\n }\n },\n [writeContract, chain.stakingContractAddr]\n );\n\n return useMemo(\n () => ({\n isLoading,\n extendCommunityStake,\n isConfirmed,\n }),\n [isLoading, extendCommunityStake, isConfirmed]\n );\n};\n\nconst Th = ({ className, children, ...props }: ComponentPropsWithRef<\"th\"> & { children: React.ReactNode }) => (\n \n {children}\n \n);\n\nconst Td = ({ className, ...props }: ComponentPropsWithRef<\"td\">) => (\n \n);\n\nconst StakeLine = ({ stake }: { stake: StakeData }) => {\n const unlockTime = new Date(stake.unlock_time);\n const lockTime = new Date(stake.lock_time);\n\n const lockSeconds = Math.floor((unlockTime.getTime() - lockTime.getTime()) / 1000);\n\n const amount = formatAmount(stake.amount);\n\n return (\n \n \n
\n \n
\n \n {amount} GTC\n \n \n \n \n );\n};\n\nexport const CommunityRestakeModal = ({\n address,\n stakedData,\n isOpen,\n onClose,\n}: {\n address: string;\n stakedData: StakeData[];\n isOpen: boolean;\n onClose: () => void;\n}) => {\n const { isLoading, extendCommunityStake, isConfirmed } = useExtendCommunityStake({ address });\n\n useEffect(() => {\n if (isConfirmed) {\n onClose();\n }\n }, [isConfirmed, onClose]);\n\n return (\n <>\n \n \n \n
\n \n\n
\n
\n \n \n \n \n \n Restake on others\n \n
\n \n \n \n \n \n \n \n \n\n \n {stakedData.map((stake, index) => (\n \n ))}\n \n
AddressAmountLockup
\n
\n\n
\n extendCommunityStake(stakedData)}\n isLoading={isLoading}\n >\n Stake\n \n \n
\n
\n
\n \n
\n
\n
\n
\n \n );\n};\n","import React, { ComponentPropsWithRef, Fragment, useCallback, useEffect, useMemo } from \"react\";\nimport IdentityStakingAbi from \"../../abi/IdentityStaking.json\";\nimport LegacyIdentityStaking from \"../../abi/LegacyIdentityStaking.json\";\nimport { useStakeHistoryQueryKey } from \"@/utils/stakeHistory\";\nimport { DisplayAddressOrENS, DisplayDuration, formatAmount, useConnectedChain } from \"@/utils/helpers\";\nimport { useStakeTxHandler } from \"@/hooks/hooks_staking/useStakeTxHandler\";\nimport { Dialog, Transition } from \"@headlessui/react\";\nimport { BackdropEnabler } from \"./Backdrop\";\nimport { PanelDiv } from \"./PanelDiv\";\nimport { LoadButton } from \"../LoadButton\";\nimport { Button } from \"@chakra-ui/react\";\nimport { StakeData } from \"@/utils/stakeHistory\";\nimport { LEGACY_COMMUNITY_STAKE_BASE_KEY } from \"@/hooks/legacyStaking\";\n\nconst useUnstakeCommunityStake = ({ address }: { address: string }) => {\n const chain = useConnectedChain();\n const queryKey = useStakeHistoryQueryKey(address);\n const { isLoading, writeContract, isConfirmed } = useStakeTxHandler({ queryKey, txTitle: \"Unstake\" });\n\n const unstakeCommunityStake = useCallback(\n async (stakedData: StakeData[]) => {\n stakedData.map((stake) => {\n writeContract({\n address: chain.stakingContractAddr,\n abi: IdentityStakingAbi,\n functionName: \"withdrawCommunityStake\",\n args: [stake.stakee, stake.amount],\n });\n });\n },\n [writeContract, chain.stakingContractAddr]\n );\n\n return useMemo(\n () => ({\n isLoading,\n unstakeCommunityStake,\n isConfirmed,\n }),\n [isLoading, unstakeCommunityStake, isConfirmed]\n );\n};\n\nconst useUnstakeV1CommunityStake = ({ address }: { address: string }) => {\n const chain = useConnectedChain();\n const queryKey = useMemo(() => [LEGACY_COMMUNITY_STAKE_BASE_KEY, address], [address]);\n const { isLoading, writeContract, isConfirmed } = useStakeTxHandler({ queryKey, txTitle: \"Unstake\" });\n\n const unstakeCommunityStake = useCallback(\n async (stakedData: StakeData[]) => {\n stakedData.map((stake) => {\n if (chain.legacyContractAddr && stake.legacy) {\n const { round, stakees } = stake.legacy;\n writeContract({\n address: chain.legacyContractAddr,\n abi: LegacyIdentityStaking,\n functionName: \"unstakeUsers\",\n args: [round?.round_id, stakees],\n });\n }\n });\n },\n [writeContract, chain.legacyContractAddr]\n );\n\n return useMemo(\n () => ({\n isLoading,\n unstakeCommunityStake,\n isConfirmed,\n }),\n [isLoading, unstakeCommunityStake, isConfirmed]\n );\n};\n\nconst Th = ({ className, children, ...props }: ComponentPropsWithRef<\"th\"> & { children: React.ReactNode }) => (\n \n {children}\n \n);\n\nconst Td = ({ className, ...props }: ComponentPropsWithRef<\"td\">) => (\n \n);\n\nconst LegacyStakeLine = ({ stake }: { stake: StakeData }) => {\n const unlockTime = new Date(stake.unlock_time);\n const lockTime = new Date(stake.lock_time);\n\n const lockSeconds = Math.floor((unlockTime.getTime() - lockTime.getTime()) / 1000);\n\n return stake.legacy?.stakees?.map((stakee, index) => (\n \n \n
\n \n
\n \n {formatAmount(stake.legacy?.amounts?.[index] || \"0\")} GTC\n \n \n \n \n ));\n};\n\nconst StakeLine = ({ stake }: { stake: StakeData }) => {\n if (stake.legacy) {\n return ;\n }\n\n const unlockTime = new Date(stake.unlock_time);\n const lockTime = new Date(stake.lock_time);\n\n const lockSeconds = Math.floor((unlockTime.getTime() - lockTime.getTime()) / 1000);\n\n const amount = formatAmount(stake.amount);\n\n return (\n \n \n
\n \n
\n \n {amount} GTC\n \n \n \n \n );\n};\n\nconst GenericCommunityUnstakeModal = ({\n stakedData,\n isOpen,\n onClose,\n isLoading,\n isConfirmed,\n unstake,\n}: {\n stakedData: StakeData[];\n isOpen: boolean;\n onClose: () => void;\n isLoading: boolean;\n isConfirmed: boolean;\n unstake: (stakedData: StakeData[]) => void;\n}) => {\n useEffect(() => {\n if (isConfirmed) {\n onClose();\n }\n }, [isConfirmed, onClose]);\n\n return (\n <>\n \n \n \n
\n \n\n
\n
\n \n \n \n \n \n Unstake on others\n \n
\n \n \n \n \n \n \n \n \n\n \n {stakedData.map((stake, index) => (\n \n ))}\n \n
AddressAmountLockup
\n
\n\n
\n unstake(stakedData)} isLoading={isLoading}>\n Unstake\n \n \n
\n
\n
\n \n
\n
\n
\n
\n \n );\n};\n\nexport const CommunityUnstakeModal = ({\n address,\n stakedData,\n isOpen,\n onClose,\n}: {\n address: string;\n stakedData: StakeData[];\n isOpen: boolean;\n onClose: () => void;\n}) => {\n const { isLoading, unstakeCommunityStake, isConfirmed } = useUnstakeCommunityStake({ address });\n\n return (\n \n );\n};\n\nexport const LegacyCommunityUnstakeModal = ({\n address,\n stakedData,\n isOpen,\n onClose,\n}: {\n address: string;\n stakedData: StakeData[];\n isOpen: boolean;\n onClose: () => void;\n}) => {\n const { isLoading, unstakeCommunityStake, isConfirmed } = useUnstakeV1CommunityStake({ address });\n\n return (\n \n );\n};\n","import { create } from \"zustand\";\n\ntype SelfStakeTxInfo = {\n blockNumber: bigint | undefined;\n timestamp: Date | undefined;\n};\n\n/**\n * The purpose of this store is to hold information about the community-stake transactions.\n * So that it can be queried when needed form other components as well.\n * \n * For now for each chain and connected address it will store a map like:\n * \n * chainId -> ( address -> SelfStakeTxInfo )\n */\nexport const useCommunityStakeTxStore = create<{\n // map chainId -> ( address -> SelfStakeTxInfo )\n communityStakeTxInfoMap: Record>;\n updateCommunityStakeTxInfo: (chainId: number, address: string, selfStakeTxInfo: Partial) => void;\n}>((set) => ({\n communityStakeTxInfoMap: {},\n updateCommunityStakeTxInfo: (chainId: number, address: string, selfStakeTxInfo: Partial) =>\n set((state) => {\n const chainRecord = state.communityStakeTxInfoMap[chainId] || {};\n const addressRecord = chainRecord[address] || {};\n const newStakeTxInfo = {\n ...(addressRecord || {}),\n ...selfStakeTxInfo,\n };\n return {\n ...state,\n communityStakeTxInfoMap: { ...state.communityStakeTxInfoMap, [chainId]: { ...chainRecord, [address]: newStakeTxInfo } },\n };\n }),\n}));\n","import React, { ComponentPropsWithRef, useCallback, useEffect, useRef, useState } from \"react\";\nimport { PanelDiv } from \"./PanelDiv\";\nimport { DisplayAddressOrENS, DisplayDuration, formatAmount, useConnectedChain, formatDate } from \"@/utils/helpers\";\nimport { StakeData, useCommunityStakeHistoryQuery, useStakeHistoryQuery } from \"@/utils/stakeHistory\";\nimport { useLegacyCommunityStakes } from \"@/hooks/legacyStaking\";\nimport { CommunityUpdateButton } from \"./CommunityUpdateButton\";\nimport { Popover } from \"@headlessui/react\";\nimport { CommunityRestakeModal } from \"./CommunityRestakeModal\";\nimport { CommunityUnstakeModal, LegacyCommunityUnstakeModal } from \"./CommunityUnstakeModal\";\nimport { useAccount, useChainId } from \"wagmi\";\nimport { useCommunityStakeTxStore } from \"@/hooks/hooks_staking/useCommunityStakeTxStore\";\n\nconst Th = ({ className, children, ...props }: ComponentPropsWithRef<\"th\"> & { children: React.ReactNode }) => (\n \n {children}\n \n);\n\nconst Td = ({ className, ...props }: ComponentPropsWithRef<\"td\">) => (\n \n);\n\nconst CommunityRestakeButton = ({ stake, address }: { stake: StakeData; address: string }) => {\n const [modalIsOpen, setModalIsOpen] = useState(false);\n const onClose = useCallback(() => setModalIsOpen(false), []);\n\n return (\n <>\n \n setModalIsOpen(true)}\n disabled={stake.legacy?.type === \"v1Community\"}\n className=\"disabled:text-color-5 disabled:cursor-not-allowed\"\n >\n Restake\n \n \n );\n};\n\nconst CommunityRestakeAllButton = ({ stakes, address }: { stakes: StakeData[]; address: string }) => {\n const [modalIsOpen, setModalIsOpen] = useState(false);\n const onClose = useCallback(() => setModalIsOpen(false), []);\n const v2StakeData = stakes.filter((s) => !s.legacy);\n\n return (\n <>\n \n \n \n );\n};\n\nconst CommunityUnstakeButton = ({\n stake,\n address,\n unlocked,\n}: {\n stake: StakeData;\n address: string;\n unlocked: boolean;\n}) => {\n const [modalIsOpen, setModalIsOpen] = useState(false);\n return (\n <>\n setModalIsOpen(false)}\n />\n setModalIsOpen(true)}\n disabled={!unlocked}\n >\n Unstake\n \n \n );\n};\n\nconst LegacyCommunityUnstakeButton = ({\n stake,\n address,\n unlocked,\n}: {\n stake: StakeData;\n address: string;\n unlocked: boolean;\n}) => {\n const [modalIsOpen, setModalIsOpen] = useState(false);\n return (\n <>\n setModalIsOpen(false)}\n />\n setModalIsOpen(true)}\n disabled={!unlocked}\n >\n Unstake\n \n \n );\n};\n\n// Combines current and legacy community stakes\nconst useCommunityStakes = (): {\n data: StakeData[] | undefined;\n legacyData: StakeData[];\n isLoading: boolean;\n isPending: boolean;\n isError: boolean;\n error?: any;\n} => {\n const { address } = useAccount();\n const chain = useConnectedChain();\n\n const { data, isLoading, isPending, isError, error } = useCommunityStakeHistoryQuery(address);\n const {\n data: legacyData,\n isLoading: legacyIsLoading,\n isPending: legacyIsPending,\n isError: legacyIsError,\n error: legacyError,\n } = useLegacyCommunityStakes(address, chain);\n\n return {\n data,\n legacyData,\n isLoading: isLoading || legacyIsLoading,\n isPending: isPending || legacyIsPending,\n isError: isError || legacyIsError,\n error: error || legacyError,\n };\n};\n\nconst Tbody = ({ presetAddress, clearPresetAddress }: { presetAddress?: string; clearPresetAddress: () => void }) => {\n const { address } = useAccount();\n const chainId = useChainId();\n const { data, legacyData, isPending, isError, error } = useCommunityStakes();\n const { communityStakeTxInfoMap } = useCommunityStakeTxStore();\n const stakeTxInfo = address ? communityStakeTxInfoMap[chainId]?.[address] : null;\n const blockNumber = stakeTxInfo?.blockNumber;\n const combinedV1AndV2Stakes = (data || [])\n .sort((a, b) => new Date(b.lock_time).valueOf() - new Date(a.lock_time).valueOf())\n .concat(legacyData);\n\n // Verify that the expected block has been indexed already\n const hasBlockBeenIndexed = blockNumber ? data?.some((stake) => stake.last_updated_in_block >= blockNumber) : true;\n\n useEffect(() => {\n isError && console.error(\"Error getting StakeHistory:\", error);\n }, [error, isError]);\n\n let tbody_contents;\n if (\n !isPending &&\n !isError &&\n address &&\n combinedV1AndV2Stakes &&\n combinedV1AndV2Stakes.length > 0 &&\n hasBlockBeenIndexed\n ) {\n tbody_contents = (\n <>\n {combinedV1AndV2Stakes.map((stake, index) => (\n \n ))}\n \n );\n } else {\n const status = isError\n ? \"Error loading stakes\"\n : isPending || !hasBlockBeenIndexed\n ? \"Loading...\"\n : \"No stakes found\";\n tbody_contents = (\n \n \n {status}\n \n \n );\n }\n return {tbody_contents};\n};\n\nconst StakeLine = ({\n stake,\n address,\n isPresetAddress,\n clearPresetAddress,\n}: {\n stake: StakeData;\n address: string;\n isPresetAddress: boolean;\n clearPresetAddress: () => void;\n}) => {\n const ref = useRef(null);\n const unlockTime = new Date(stake.unlock_time);\n const unlockTimeStr = formatDate(unlockTime);\n\n const lockTime = new Date(stake.lock_time);\n const lockTimeStr = formatDate(lockTime);\n\n const lockSeconds = Math.floor((unlockTime.getTime() - lockTime.getTime()) / 1000);\n const unlocked = unlockTime < new Date();\n\n const amount = formatAmount(stake.amount);\n\n useEffect(() => {\n if (isPresetAddress && ref.current) {\n ref.current.scrollIntoView({ behavior: \"instant\", block: \"center\" });\n }\n });\n\n const unstakeButton =\n stake.legacy?.type === \"v1Community\" ? (\n \n ) : (\n \n );\n\n return (\n \n {stake.legacy ? stake.legacy.round?.name : }\n {amount} GTC\n {unlocked ? \"Unlocked\" : \"Locked\"}\n \n \n \n \n {lockTimeStr}\n
\n {unlockTimeStr}\n \n \n {!stake.legacy && (\n \n )}\n \n \n \n \n \"Menu\"\n \n\n \n
\n \n {unstakeButton}\n
\n
\n
\n \n \n );\n};\n\nexport const StakeForOthersHistory = ({\n presetAddress,\n clearPresetAddress,\n}: {\n presetAddress?: string;\n clearPresetAddress: () => void;\n}) => {\n const { address } = useAccount();\n\n const { isPending, isError, data } = useCommunityStakeHistoryQuery(address);\n\n let restakeAllBtn;\n if (!isPending && !isError && address && data && data.length > 0) {\n restakeAllBtn = ;\n } else {\n restakeAllBtn = (\n \n );\n }\n\n return (\n \n
Stake for Others
\n \n \n \n \n \n \n \n \n \n \n \n \n
AddressAmountStatusLockupStart/End{restakeAllBtn}
\n
\n );\n};\n","import React, { useCallback, useEffect } from \"react\";\nimport { StakeModal } from \"./StakeModal\";\nimport { useStakeTxWithApprovalCheck } from \"@/hooks/hooks_staking/useStakeTxWithApprovalCheck\";\nimport { DisplayAddressOrENS, DisplayDuration, formatAmount } from \"@/utils/helpers\";\nimport { useCommunityStakesStore } from \"./StakeForOthersForm\";\nimport { useCommunityStakeTxStore } from \"@/hooks/hooks_staking/useCommunityStakeTxStore\";\nimport { useChainId } from \"wagmi\";\n\nconst useCommunityStakeTx = ({ staker }: { staker: `0x${string}` }) => {\n const { blockNumber, stake, isLoading, isConfirmed } = useStakeTxWithApprovalCheck({\n address: staker,\n });\n const chainId = useChainId();\n const { updateCommunityStakeTxInfo } = useCommunityStakeTxStore();\n\n const communityStake = useCallback(\n ({\n stakees,\n amounts,\n lockedPeriodsSeconds,\n }: {\n stakees: `0x${string}`[];\n amounts: bigint[];\n lockedPeriodsSeconds: bigint[];\n }) => {\n let functionName: string;\n let functionArgs: any[];\n if (stakees.length === 1) {\n functionName = \"communityStake\";\n functionArgs = [stakees[0], amounts[0], lockedPeriodsSeconds[0]];\n } else {\n functionName = \"multipleCommunityStakes\";\n functionArgs = [stakees, amounts, lockedPeriodsSeconds];\n }\n\n const requiredApprovalAmount = amounts.reduce((a, b) => a + b, 0n);\n\n stake({\n functionName,\n functionArgs,\n requiredApprovalAmount,\n });\n },\n [stake]\n );\n\n useEffect(() => {\n if (blockNumber) {\n updateCommunityStakeTxInfo(chainId, staker, { blockNumber, timestamp: new Date() });\n }\n }, [chainId, staker, blockNumber, updateCommunityStakeTxInfo]);\n\n return {\n communityStake,\n isLoading,\n isConfirmed,\n };\n};\n\nexport const StakeForOthersModal = ({\n address,\n stakees,\n amounts,\n lockedPeriodsSeconds,\n isOpen,\n onClose,\n}: {\n address: `0x${string}`;\n stakees: `0x${string}`[];\n amounts: bigint[];\n lockedPeriodsSeconds: bigint[];\n isOpen: boolean;\n onClose: () => void;\n}) => {\n const resetCommunityStakes = useCommunityStakesStore((state) => state.resetCommunityStakes);\n const { communityStake, isLoading, isConfirmed } = useCommunityStakeTx({\n staker: address,\n });\n\n useEffect(() => {\n if (isConfirmed) {\n resetCommunityStakes();\n onClose();\n }\n }, [isConfirmed, onClose, resetCommunityStakes]);\n\n return (\n communityStake({ stakees, amounts, lockedPeriodsSeconds })}\n buttonLoading={isLoading}\n isOpen={isOpen}\n onClose={onClose}\n >\n \n \n \n \n \n \n \n \n \n {stakees.map((stakee, idx) => (\n \n \n \n \n \n ))}\n \n
AddressAmountLockup
\n \n {formatAmount(amounts[idx].toString())} GTC\n \n
\n \n );\n};\n","import React, { ChangeEvent, useState, useMemo, useCallback, useEffect } from \"react\";\nimport { Button } from \"@/components/Button\";\nimport { useAccount } from \"wagmi\";\nimport { StakeFormInputSection } from \"./StakeFormInputSection\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { create } from \"zustand\";\nimport { Chain, isAddress, parseEther } from \"viem\";\nimport { StakeForOthersModal } from \"./StakeForOthersModal\";\nimport { useCommunityStakeHistoryQuery } from \"@/utils/stakeHistory\";\nimport { getLockSeconds } from \"@/utils/helpers\";\nimport { useChainInitializing } from \"@/hooks/staking_hooks/useChainInitialization\";\nimport { getEnsAddress } from \"@wagmi/core\";\nimport { wagmiChains } from \"@/utils/chains\";\nimport { mainnet } from \"viem/chains\";\nimport { normalize } from \"viem/ens\";\nimport { wagmiConfig } from \"@/utils/wagmi\";\n\ntype StakeeError = \"INVALID_ADDRESS\" | \"ENS_RESOLUTION_FAILED\" | \"DUPLICATE_ADDRESS\";\n\ntype CommunityStakeInputs = {\n uuid: string;\n stakeeInput: string;\n amountInput: string;\n lockedPeriodMonths: number;\n autoFocus: boolean;\n};\n\ntype CommunityStakeChainParams = {\n stakee: `0x${string}`;\n amount: bigint;\n lockedPeriodsSeconds: bigint;\n ensResolution?: string;\n};\n\ntype CommunityStake = CommunityStakeInputs & CommunityStakeChainParams;\n\nconst createEmptyCommunityStake = (): CommunityStake => ({\n uuid: uuidv4(),\n stakeeInput: \"\",\n amountInput: \"\",\n lockedPeriodMonths: 3,\n amount: 0n,\n lockedPeriodsSeconds: BigInt(getLockSeconds(new Date(), 3)),\n stakee: \"0x0\",\n autoFocus: false,\n});\n\nconst initialEmptyStake = createEmptyCommunityStake();\n\nexport const useCommunityStakesStore = create<{\n communityStakes: CommunityStake[];\n communityStakesById: Record;\n resetCommunityStakes: () => void;\n stakeSections: (typeof StakeForOthersFormSection)[];\n updateCommunityStake: (uuid: string, communityStake: Partial) => void;\n removeCommunityStake: (uuid: string) => void;\n addCommunityStake: () => void;\n}>((set) => ({\n communityStakes: [initialEmptyStake],\n communityStakesById: { [initialEmptyStake.uuid]: initialEmptyStake },\n resetCommunityStakes: () =>\n set((state) => ({\n ...state,\n communityStakes: [initialEmptyStake],\n communityStakesById: { [initialEmptyStake.uuid]: initialEmptyStake },\n })),\n stakeSections: [],\n addCommunityStake: () =>\n set((state) => {\n const communityStake = createEmptyCommunityStake();\n return {\n ...state,\n communityStakes: [...state.communityStakes, communityStake],\n communityStakesById: { ...state.communityStakesById, [communityStake.uuid]: communityStake },\n };\n }),\n updateCommunityStake: (uuid: string, communityStake: Partial) =>\n set((state) => {\n if (communityStake.amountInput !== undefined) {\n communityStake.amount = parseEther(communityStake.amountInput);\n }\n\n if (communityStake.lockedPeriodMonths !== undefined) {\n communityStake.lockedPeriodsSeconds = BigInt(getLockSeconds(new Date(), communityStake.lockedPeriodMonths));\n }\n\n if (communityStake.stakeeInput !== undefined) {\n communityStake.stakee = communityStake.stakeeInput as `0x${string}`;\n }\n\n const newCommunityStake = {\n ...state.communityStakesById[uuid],\n autoFocus: false,\n ...communityStake,\n };\n return {\n ...state,\n communityStakes: state.communityStakes.map((cStake) => {\n return newCommunityStake.uuid === cStake.uuid ? newCommunityStake : cStake;\n }),\n communityStakesById: { ...state.communityStakesById, [uuid]: newCommunityStake },\n };\n }),\n removeCommunityStake: (uuid: string) =>\n set((state) => {\n const newCommunityStakesById = { ...state.communityStakesById };\n delete newCommunityStakesById[uuid];\n return {\n ...state,\n communityStakes: state.communityStakes.filter((cStake) => {\n return cStake.uuid !== uuid;\n }),\n communityStakesById: newCommunityStakesById,\n };\n }),\n}));\n\nconst StakeForOthersFormSection = ({\n showClose,\n uuid,\n autoFocus,\n onChange,\n stakeeError,\n}: {\n showClose: boolean;\n uuid: string;\n autoFocus?: boolean;\n onChange?: () => void;\n stakeeError?: StakeeError;\n}) => {\n const communityStake = useCommunityStakesStore((state) => state.communityStakesById[uuid]);\n const updateCommunityStake = useCommunityStakesStore((state) => state.updateCommunityStake);\n const removeCommunityStake = useCommunityStakesStore((state) => state.removeCommunityStake);\n\n const setInputValue = useCallback(\n (value: string) => {\n onChange?.();\n updateCommunityStake(uuid, { amountInput: value });\n },\n [updateCommunityStake, uuid, onChange]\n );\n\n const setStakeeAddress = useCallback(\n async (inputValue: string) => {\n let ensResolution: string | undefined;\n const address = inputValue.trim();\n onChange?.();\n if (address.endsWith(\".eth\")) {\n // check for ens resolution\n const mainnetChain = wagmiChains.find((chain: Chain) => chain.id === mainnet.id);\n if (!mainnetChain) {\n return;\n }\n try {\n const ensAddress = await getEnsAddress(wagmiConfig, {\n chainId: mainnet.id,\n name: normalize(address),\n });\n if (ensAddress) {\n ensResolution = ensAddress;\n }\n } catch (e) {\n // Catching error here, as normalize might fail, and we don't want to crash\n console.error(\"Failed to resolve ENS name: \", address);\n }\n }\n updateCommunityStake(uuid, { stakeeInput: address as `0x${string}`, ensResolution });\n },\n [updateCommunityStake, uuid, onChange]\n );\n\n const setLockedPeriod = useCallback(\n (lockPeriod: number) => {\n onChange?.();\n updateCommunityStake(uuid, { lockedPeriodMonths: lockPeriod });\n },\n [updateCommunityStake, uuid, onChange]\n );\n\n const handleStakeeInputChange = useCallback(\n (event: ChangeEvent) => {\n onChange?.();\n setStakeeAddress(event.target.value);\n },\n [setStakeeAddress, onChange]\n );\n\n return (\n
\n
\n
\n
Address
\n \n {\n removeCommunityStake(uuid);\n }}\n >\n \n \n \n \n
\n
\n
\n {stakeeError === \"ENS_RESOLUTION_FAILED\"\n ? \"Invalid ENS name\"\n : stakeeError === \"INVALID_ADDRESS\"\n ? \"Invalid Ethereum address\"\n : stakeeError === \"DUPLICATE_ADDRESS\"\n ? \"You have already staked on this address\"\n : null}\n
\n
\n \n \n );\n};\n\nexport const StakeForOthersForm = ({\n presetAddress,\n clearPresetAddress,\n}: {\n presetAddress?: string;\n clearPresetAddress: () => void;\n}) => {\n const { address } = useAccount();\n const { data, isPending } = useCommunityStakeHistoryQuery(address);\n const chainInitializing = useChainInitializing();\n\n const communityStakes = useCommunityStakesStore((state) => state.communityStakes);\n const addCommunityStake = useCommunityStakesStore((state) => state.addCommunityStake);\n const updateCommunityStake = useCommunityStakesStore((state) => state.updateCommunityStake);\n\n const previousStakedAddresses = useMemo(() => data?.map((stake) => stake.stakee.toLowerCase()) ?? [], [data]);\n const hasDuplicateAddresses = useMemo(\n () =>\n communityStakes\n .map((cStake) => cStake.stakee.toLowerCase())\n .find((address, idx, arr) => arr.indexOf(address) !== idx && address !== \"0x0\"),\n [communityStakes]\n );\n\n useEffect(() => {\n if (presetAddress && !isPending && !chainInitializing) {\n if (!previousStakedAddresses.includes(presetAddress.toLowerCase()) && communityStakes[0].stakeeInput === \"\") {\n updateCommunityStake(communityStakes[0].uuid, { stakeeInput: presetAddress, autoFocus: true });\n }\n }\n }, [presetAddress, isPending, communityStakes, updateCommunityStake, chainInitializing, previousStakedAddresses]);\n\n const stakeSections = useMemo(\n () =>\n communityStakes.map((communityStake, idx) => {\n const stakee = communityStake.stakeeInput.trim();\n let error: StakeeError | undefined;\n if (stakee.endsWith(\".eth\") && !communityStake.ensResolution) {\n error = \"ENS_RESOLUTION_FAILED\";\n } else if (stakee && !stakee.endsWith(\".eth\") && !isAddress(stakee)) {\n error = \"INVALID_ADDRESS\";\n } else if (\n previousStakedAddresses.includes(communityStake.stakee.toLowerCase()) ||\n (communityStake.stakee !== \"0x0\" &&\n communityStakes.findIndex(\n (cStake) => cStake.stakee.toLowerCase() === communityStake.stakee.toLowerCase()\n ) !== idx)\n ) {\n error = \"DUPLICATE_ADDRESS\";\n }\n\n return (\n \n );\n }),\n [communityStakes, previousStakedAddresses, clearPresetAddress]\n );\n\n const anyIncomplete: boolean = useMemo(\n () =>\n Boolean(\n hasDuplicateAddresses ||\n communityStakes.find(\n (cStake) =>\n !(parseFloat(cStake.amountInput) > 0) || previousStakedAddresses.includes(cStake.stakee.toLowerCase())\n )\n ),\n [communityStakes, hasDuplicateAddresses, previousStakedAddresses]\n );\n\n const [modalIsOpen, setModalIsOpen] = useState(false);\n\n const onClose = useCallback(() => {\n setModalIsOpen(false);\n }, []);\n\n const communityStakeModal = useMemo(\n () =>\n address ? (\n {\n if (cStake.ensResolution) {\n return cStake.ensResolution as `0x${string}`;\n }\n return cStake.stakee;\n })}\n amounts={communityStakes.map((cStake) => cStake.amount)}\n lockedPeriodsSeconds={communityStakes.map((cStake) => cStake.lockedPeriodsSeconds)}\n isOpen={modalIsOpen}\n onClose={onClose}\n />\n ) : null,\n [address, communityStakes, modalIsOpen, onClose]\n );\n\n return (\n
\n {stakeSections}\n
\n \n \n
\n\n {communityStakeModal}\n
\n );\n};\n","import React, { useCallback } from \"react\";\nimport { StakeForOthersHistory } from \"./StakeForOthersHistory\";\nimport { StakeForOthersForm } from \"./StakeForOthersForm\";\nimport { StakeSection } from \"./StakeSection\";\nimport { useCommunityStakeHistoryQuery } from \"@/utils/stakeHistory\";\nimport { useAccount } from \"wagmi\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { useChainInitializing } from \"@/hooks/staking_hooks/useChainInitialization\";\n\nexport const StakeForOthers = () => {\n const chainInitializing = useChainInitializing();\n const [searchParams, setSearchParams] = useSearchParams();\n\n const presetAddress = (!chainInitializing && searchParams.get(\"stake_on\")) || undefined;\n const clearPresetAddress = useCallback(() => {\n if (chainInitializing) return;\n searchParams.delete(\"stake_on\");\n setSearchParams(searchParams);\n }, [searchParams, setSearchParams, chainInitializing]);\n\n const { address } = useAccount();\n const { data } = useCommunityStakeHistoryQuery(address);\n\n const stakedAmount: string = data?.reduce((acc, stake) => acc + BigInt(stake.amount), 0n).toString() || \"0\";\n\n return (\n \n \n \n \n );\n};\n","import React, { ComponentPropsWithRef, useEffect } from \"react\";\nimport { PanelDiv } from \"./PanelDiv\";\nimport { DisplayAddressOrENS, DisplayDuration, formatAmount, formatDate } from \"@/utils/helpers\";\nimport { StakeData, useStakeOnYouHistoryQuery } from \"@/utils/stakeHistory\";\nimport { useAccount } from \"wagmi\";\n\nconst Th = ({ className, children, ...props }: ComponentPropsWithRef<\"th\"> & { children: React.ReactNode }) => (\n \n {children}\n \n);\n\nconst Td = ({ className, ...props }: ComponentPropsWithRef<\"td\">) => (\n \n);\n\nconst StakeLine = ({ stake }: { stake: StakeData }) => {\n const unlockTime = new Date(stake.unlock_time);\n const unlockTimeStr = formatDate(unlockTime);\n\n const lockTime = new Date(stake.lock_time);\n const lockTimeStr = formatDate(lockTime);\n\n const lockSeconds = Math.floor((unlockTime.getTime() - lockTime.getTime()) / 1000);\n const unlocked = unlockTime < new Date();\n\n const amount = formatAmount(stake.amount);\n\n return (\n \n \n \n \n {amount} GTC\n {unlocked ? \"Unlocked\" : \"Locked\"}\n \n \n \n \n {lockTimeStr}\n
\n {unlockTimeStr}\n \n \n );\n};\n\nconst Tbody = () => {\n const { address } = useAccount();\n const { isPending, isError, data, error } = useStakeOnYouHistoryQuery(address);\n\n useEffect(() => {\n isError && console.error(\"Error getting StakeHistory:\", error);\n }, [error, isError]);\n\n let tbody_contents;\n if (!isPending && !isError && address && data && data.length > 0) {\n tbody_contents = (\n <>\n {data.map((stake, index) => (\n \n ))}\n \n );\n } else {\n const status = isError ? \"Error loading stakes\" : isPending ? \"Loading...\" : \"No stakes found\";\n tbody_contents = (\n \n \n {status}\n \n \n );\n }\n return {tbody_contents};\n};\n\nexport const TrustInYouHistory = () => {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n
AddressAmountStatusLockupStart/End
\n
\n );\n};\n","import React from \"react\";\nimport { useAccount, useChainId } from \"wagmi\";\nimport { PanelDiv } from \"./PanelDiv\";\n\nexport const ShareWithFriends = () => {\n const { address } = useAccount();\n const chainId = useChainId();\n\n const [copied, setCopied] = React.useState(false);\n\n const shareLink = window.location.origin + `/#/?chain_id=${chainId}&stake_on=${address}`;\n const shareText = `Support me on @gitcoinpassport! Click this link to stake on my digital identity and help boost my trust score: ${shareLink} - It's quick and makes a big difference. Thank you! 🌟`;\n\n const onCopy = () => {\n navigator.clipboard.writeText(shareText);\n setCopied(true);\n setTimeout(() => setCopied(false), 3000);\n };\n\n return (\n \n
\n
\n Share with Friends\n Get friends to stake on you by sharing this on your socials.\n
\n \n
\n
\n );\n};\n","import React from \"react\";\nimport { TrustInYouHistory } from \"./TrustInYouHistory\";\nimport { StakeSection } from \"./StakeSection\";\nimport { useStakeOnYouHistoryQuery } from \"@/utils/stakeHistory\";\nimport { useAccount } from \"wagmi\";\nimport { ShareWithFriends } from \"./ShareWithFriends\";\n\nexport const TrustInYou = ({}: any) => {\n const { address } = useAccount();\n const { data } = useStakeOnYouHistoryQuery(address);\n\n const stakedAmount: string = data?.reduce((acc, stake) => acc + BigInt(stake.amount), 0n).toString() || \"0\";\n\n return (\n \n \n \n \n );\n};\n","import React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport { chainConfigs, ChainConfig } from \"@/utils/chains\";\nimport { useAccount, useBalance } from \"wagmi\";\nimport { DropDownIcon } from \"./DropDownIcon\";\nimport { useConnectedChain, useOutsideClick } from \"@/utils/helpers\";\nimport { useSwitchChain } from \"wagmi\";\n\nconst ChainMenuItem = ({\n chain,\n isSelected,\n menuIsOpen,\n onMenuOpen,\n onMenuItemSelect,\n isPendingWalletApproval,\n className,\n}: {\n chain: ChainConfig;\n isSelected: boolean;\n menuIsOpen: boolean;\n onMenuOpen: () => void;\n onMenuItemSelect: () => void;\n isPendingWalletApproval: boolean;\n className?: string;\n}) => {\n const { address } = useAccount();\n const balance = useBalance({\n address,\n token: chain.gtcContractAddr,\n chainId: chain.id,\n });\n\n const calculatedBalance = Number(balance.data?.value || 0) / 10 ** Number(balance.data?.decimals || 1);\n\n const formattedBalance = calculatedBalance.toLocaleString(\"en\", {\n // Use period as decimal separator\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n });\n return (\n (menuIsOpen ? onMenuItemSelect() : onMenuOpen())}\n >\n \n \n
\n {isPendingWalletApproval ? \"Approve in wallet...\" : \"GTC Balance\"}\n
\n \"Gitcoin\n
{formattedBalance}
\n \n \n \n );\n};\n\nexport const NetworkDropdown: React.FC = ({}) => {\n const selectedChain = useConnectedChain();\n // Facilitates optimistically updating the chain in the UI, but\n // rolling back if the chain switch fails or is cancelled\n const [tempSelectedChain, setTempSelectedChain] = useState(selectedChain);\n const [menuIsOpen, setMenuIsOpen] = useState(false);\n const ref = useRef(null);\n const { switchChainAsync } = useSwitchChain();\n useOutsideClick(ref, () => setMenuIsOpen(false));\n\n useEffect(() => {\n setTempSelectedChain(selectedChain);\n }, [selectedChain]);\n\n const nonSelectedChainConfigs = useMemo(\n () => chainConfigs.filter(({ id }) => id !== tempSelectedChain.id),\n [tempSelectedChain.id]\n );\n\n const sortedChainConfigs = useMemo(\n () => [tempSelectedChain, ...nonSelectedChainConfigs],\n [tempSelectedChain, nonSelectedChainConfigs]\n );\n\n return (\n
\n
\n \n {sortedChainConfigs.map((chain, idx) => (\n idx || setMenuIsOpen(true)}\n isPendingWalletApproval={tempSelectedChain.id !== selectedChain.id}\n onMenuItemSelect={async () => {\n const oldChain = selectedChain;\n setTempSelectedChain(chain);\n setMenuIsOpen(false);\n if (idx) {\n try {\n await switchChainAsync({\n chainId: chain.id,\n });\n } catch (e) {\n setTempSelectedChain(oldChain);\n }\n }\n }}\n />\n ))}\n
\n
\n Choose a network above to stake \n \n );\n};\n","// --- React Methods\nimport React from \"react\";\n\n// --Components\nimport Header from \"../components/Header\";\nimport Footer from \"../components/components_staking/Footer\";\nimport BodyWrapper from \"../components/BodyWrapper\";\nimport HeaderContentFooterGrid from \"../components/HeaderContentFooterGrid\";\nimport PageWidthGrid from \"../components/PageWidthGrid\";\nimport { YourStake } from \"../components/components_staking/YourStake\";\nimport { StakeForOthers } from \"../components/components_staking/StakeForOthers\";\nimport { TrustInYou } from \"@/components/components_staking/TrustInYou\";\nimport { NetworkDropdown } from \"../components/components_staking/NetworkDropdown\";\nimport LoggedInPageRoot from \"@/components/components_staking/LoggedInPageRoot\";\n\nexport default function Home() {\n return (\n \n \n
\n \n \n \n \n \n \n \n \n